def tag_prefix(self, *axis_order: AxisName) -> NamedArray | NamedArrayView:
    """Attaches names to the first positional axes in an array or view.

    This is a version of `tag` that allows you to name only a subset of the
    array's positional axes.

    Args:
      *axis_order: Axis names to make positional, in the order they should
        appear in the positional view.

    Returns:
      A NamedArray or view with the given names assigned to the first positional
      axes, and whose positional shape includes only the suffix of axes that
      have not been given names.
    """
    # We implement `tag_prefix` using `tag` with temporary axis
    # identifiers.
    tmp_axis_ids = [
        TmpPosAxisMarker()
        for _ in range(len(self.positional_shape) - len(axis_order))
    ]
    return self.tag(*axis_order, *tmp_axis_ids).untag(*tmp_axis_ids)
Attaches names to the first positional axes in an array or view.

    This is a version of `tag` that allows you to name only a subset of the
    array's positional axes.

    Args:
      *axis_order: Axis names to make positional, in the order they should
        appear in the positional view.

    Returns:
      A NamedArray or view with the given names assigned to the first positional
      axes, and whose positional shape includes only the suffix of axes that
      have not been given names.
    
penzai/core/named_axes.py