docstr: Compute the given TermGraph, seeding the workspace of our engine with
  `initial_workspace`.
  
  Parameters
  ----------
  graph : catalyst.pipeline.graph.TermGraph
      Graph to run.
  initial_workspace : dict
      Initial workspace to forward to SimplePipelineEngine.compute_chunk.
  mask : DataFrame, optional
      This is a value to pass to `initial_workspace` as the mask from
      `AssetExists()`.  Defaults to a frame of shape `self.default_shape`
      containing all True values.
  
  Returns
  -------
  results : dict
      Mapping from termname -> computed result.
docstr_tok: ["Compute","the","given","TermGraph",",","seeding","the","workspace","of","our","engine","with","`","initial_workspace","`",".","Parameters","--","--","--","--","--","graph",":","catalyst.pipeline.graph.TermGraph","Graph","to","run",".","initial_workspace",":","dict","Initial","workspace","to","forward","to","SimplePipelineEngine.compute_chunk",".","mask",":","DataFrame",",","optional","This","is","a","value","to","pass","to","`","initial_workspace","`","as","the","mask","from","`","AssetExists","(",")","`",".","Defaults","to","a","frame","of","shape","`","self.default_shape","`","containing","all","True","values",".","Returns","--","--","--","-","results",":","dict","Mapping","from","termname","-",">","computed","result","."]
code: def run_graph(self, graph, initial_workspace, mask=None):
      """
      Compute the given TermGraph, seeding the workspace of our engine with
      `initial_workspace`.
  
      Parameters
      ----------
      graph : catalyst.pipeline.graph.TermGraph
          Graph to run.
      initial_workspace : dict
          Initial workspace to forward to SimplePipelineEngine.compute_chunk.
      mask : DataFrame, optional
          This is a value to pass to `initial_workspace` as the mask from
          `AssetExists()`.  Defaults to a frame of shape `self.default_shape`
          containing all True values.
  
      Returns
      -------
      results : dict
          Mapping from termname -> computed result.
      """
      engine = SimplePipelineEngine(
          lambda column: ExplodingObject(),
          self.nyse_sessions,
          self.asset_finder,
      )
      if mask is None:
          mask = self.default_asset_exists_mask
  
      dates, assets, mask_values = explode(mask)
  
      initial_workspace.setdefault(AssetExists(), mask_values)
      initial_workspace.setdefault(InputDates(), dates)
  
      return engine.compute_chunk(
          graph,
          dates,
          assets,
          initial_workspace,
      )
  
imports: from functools import wraps
  import numpy
  from numpy import arange, prod
  from pandas import DataFrame, Timestamp
  from six import iteritems
  from catalyst.pipeline.engine import SimplePipelineEngine
  from catalyst.pipeline import ExecutionPlan
  from catalyst.pipeline.term import AssetExists, InputDates
  from catalyst.testing import check_arrays, ExplodingObject
  from catalyst.testing.fixtures import WithAssetFinder, WithTradingSessions, CatalystTestCase
  from catalyst.utils.functional import dzip_exact
  from catalyst.utils.pandas_utils import explode
label_desc: Use image node_id 3 for calling the BasePipelineTestCase obj's underlying member method code with example usage: obj.run_graph(graph, initial_workspace, mask) and returns: engine