code: def _pipeline_output_index(dates, assets, mask):
      """
      Create a MultiIndex for a pipeline output.
  
      Parameters
      ----------
      dates : pd.DatetimeIndex
          Row labels for ``mask``.
      assets : pd.Index
          Column labels for ``mask``.
      mask : np.ndarray[bool]
          Mask array indicating date/asset pairs that should be included in
          output index.
  
      Returns
      -------
      index : pd.MultiIndex
          MultiIndex  containing (date,  asset) pairs  corresponding to  ``True``
          values in ``mask``.
      """
      date_labels = repeat_last_axis(arange(len(dates)), len(assets))[
          mask
      ]
      asset_labels = repeat_first_axis(arange(len(assets)), len(dates))[
          mask
      ]
      return MultiIndex(
          levels=[dates, assets],
          labels=[date_labels, asset_labels],
          # TODO: We should probably add names for these.
          names=[None, None],
          verify_integrity=False,
      )
  
imports: from abc import ABCMeta, abstractmethod
  from functools import partial
  from six import iteritems, with_metaclass, viewkeys
  from numpy import array, arange
  from pandas import DataFrame, MultiIndex
  from toolz import groupby
  from zipline.lib.adjusted_array import ensure_adjusted_array, ensure_ndarray
  from zipline.errors import NoFurtherDataError
  from zipline.utils.input_validation import expect_types
  from zipline.utils.numpy_utils import as_column, repeat_first_axis, repeat_last_axis
  from zipline.utils.pandas_utils import explode
  from zipline.utils.string_formatting import bulleted_list
  from .domain import Domain, GENERIC
  from .graph import maybe_specialize
  from .hooks import DelegatingHooks
  from .term import AssetExists, InputDates, LoadableTerm
  from zipline.utils.date_utils import compute_date_range_chunks
  from zipline.utils.pandas_utils import categorical_df_concat
label_desc: Use image node_id 2 for calling a global function with example usage: _pipeline_output_index(dates, assets, mask) and returns: MultiIndex