class_docstr: PipelineEngine class that computes each term independently.
  
  Parameters
  ----------
  get_loader : callable
      A function that is given a loadable term and returns a PipelineLoader
      to use to retrieve raw data for that term.
  asset_finder : zipline.assets.AssetFinder
      An AssetFinder instance.  We depend on the AssetFinder to determine
      which assets are in the top-level universe at any point in time.
  populate_initial_workspace : callable, optional
      A function which will be used to populate the initial workspace when
      computing a pipeline. See
      :func:`zipline.pipeline.engine.default_populate_initial_workspace`
      for more info.
  default_hooks : list, optional
      List of hooks that should be used to instrument all pipelines executed
      by this engine.
  
  See Also
  --------
  :func:`zipline.pipeline.engine.default_populate_initial_workspace`
class_docstr_tok: ["PipelineEngine","class","that","computes","each","term","independently",".","Parameters","--","--","--","--","--","get_loader",":","callable","A","function","that","is","given","a","loadable","term","and","returns","a","PipelineLoader","to","use","to","retrieve","raw","data","for","that","term",".","asset_finder",":","zipline.assets.AssetFinder","An","AssetFinder","instance",".","We","depend","on","the","AssetFinder","to","determine","which","assets","are","in","the","top-level","universe","at","any","point","in","time",".","populate_initial_workspace",":","callable",",","optional","A","function","which","will","be","used","to","populate","the","initial","workspace","when","computing","a","pipeline",".","See",":","func",":","`","zipline.pipeline.engine.default_populate_initial_workspace","`","for","more","info",".","default_hooks",":","list",",","optional","List","of","hooks","that","should","be","used","to","instrument","all","pipelines","executed","by","this","engine",".","See","Also","--","--","--","--",":","func",":","`","zipline.pipeline.engine.default_populate_initial_workspace","`"]
docstr: Compute a lifetimes matrix from our AssetFinder, then drop columns that
  didn't exist at all during the query dates.
  
  Parameters
  ----------
  domain : zipline.pipeline.domain.Domain
      Domain for which we're computing a pipeline.
  start_date : pd.Timestamp
      Base start date for the matrix.
  end_date : pd.Timestamp
      End date for the matrix.
  extra_rows : int
      Number of extra rows to compute before `start_date`.
      Extra rows are needed by terms like moving averages that require a
      trailing window of data.
  
  Returns
  -------
  lifetimes : pd.DataFrame
      Frame of dtype `bool` containing dates from `extra_rows` days
      before `start_date`, continuing through to `end_date`.  The
      returned frame contains as columns all assets in our AssetFinder
      that existed for at least one day between `start_date` and
      `end_date`.
docstr_tok: ["Compute","a","lifetimes","matrix","from","our","AssetFinder",",","then","drop","columns","that","did","n't","exist","at","all","during","the","query","dates",".","Parameters","--","--","--","--","--","domain",":","zipline.pipeline.domain.Domain","Domain","for","which","we","'re","computing","a","pipeline",".","start_date",":","pd.Timestamp","Base","start","date","for","the","matrix",".","end_date",":","pd.Timestamp","End","date","for","the","matrix",".","extra_rows",":","int","Number","of","extra","rows","to","compute","before","`","start_date","`",".","Extra","rows","are","needed","by","terms","like","moving","averages","that","require","a","trailing","window","of","data",".","Returns","--","--","--","-","lifetimes",":","pd.DataFrame","Frame","of","dtype","`","bool","`","containing","dates","from","`","extra_rows","`","days","before","`","start_date","`",",","continuing","through","to","`","end_date","`",".","The","returned","frame","contains","as","columns","all","assets","in","our","AssetFinder","that","existed","for","at","least","one","day","between","`","start_date","`","and","`","end_date","`","."]
code: def _compute_root_mask(
      self, domain, start_date, end_date, extra_rows
  ):
      """
      Compute a lifetimes matrix from our AssetFinder, then drop columns that
      didn't exist at all during the query dates.
  
      Parameters
      ----------
      domain : zipline.pipeline.domain.Domain
          Domain for which we're computing a pipeline.
      start_date : pd.Timestamp
          Base start date for the matrix.
      end_date : pd.Timestamp
          End date for the matrix.
      extra_rows : int
          Number of extra rows to compute before `start_date`.
          Extra rows are needed by terms like moving averages that require a
          trailing window of data.
  
      Returns
      -------
      lifetimes : pd.DataFrame
          Frame of dtype `bool` containing dates from `extra_rows` days
          before `start_date`, continuing through to `end_date`.  The
          returned frame contains as columns all assets in our AssetFinder
          that existed for at least one day between `start_date` and
          `end_date`.
      """
      sessions = domain.all_sessions()
  
      if start_date not in sessions:
          raise ValueError(
              "Pipeline start date ({}) is not a trading session for "
              "domain {}.".format(start_date, domain)
          )
  
      elif end_date not in sessions:
          raise ValueError(
              "Pipeline end date {} is not a trading session for "
              "domain {}.".format(end_date, domain)
          )
  
      start_idx, end_idx = sessions.slice_locs(start_date, end_date)
      if start_idx < extra_rows:
          raise NoFurtherDataError.from_lookback_window(
              initial_message="Insufficient data to compute Pipeline:",
              first_date=sessions[0],
              lookback_start=start_date,
              lookback_length=extra_rows,
          )
  
      # NOTE: This logic should probably be delegated to the domain once we
      #       start adding more complex domains.
      #
      # Build lifetimes matrix reaching back to `extra_rows` days before
      # `start_date.`
      finder = self._finder
      lifetimes = finder.lifetimes(
          sessions[start_idx - extra_rows : end_idx],
          include_start_date=False,
          country_codes=(domain.country_code,),
      )
  
      if not lifetimes.columns.unique:
          columns = lifetimes.columns
          duplicated = columns[columns.duplicated()].unique()
          raise AssertionError("Duplicated sids: %d" % duplicated)
  
      # Filter out columns that didn't exist from the farthest look back
      # window through the end of the requested dates.
      existed = lifetimes.any()
      ret = lifetimes.loc[:, existed]
      num_assets = ret.shape[1]
  
      if num_assets == 0:
          raise ValueError(
              "Failed to find any assets with country_code {!r} that traded "
              "between {} and {}.\n"
              "This probably means that your asset db is old or that it has "
              "incorrect country/exchange metadata.".format(
                  domain.country_code,
                  start_date,
                  end_date,
              )
          )
  
      return ret
  
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 5 for calling the SimplePipelineEngine obj's underlying member method code with example usage: obj._compute_root_mask(domain, start_date, end_date, extra_rows) and returns: ret