docstr: Compile the given terms into a TermGraph, compute it with
  initial_workspace, and compare the results with ``expected``.
docstr_tok: ["Compile","the","given","terms","into","a","TermGraph",",","compute","it","with","initial_workspace",",","and","compare","the","results","with","``","expected","``","."]
code: def check_terms(
      self, terms, expected, initial_workspace, mask, check=check_arrays
  ):
      """
      Compile the given terms into a TermGraph, compute it with
      initial_workspace, and compare the results with ``expected``.
      """
      start_date, end_date = mask.index[[0, -1]]
      graph = ExecutionPlan(
          terms,
          all_dates=self.nyse_sessions,
          start_date=start_date,
          end_date=end_date,
      )
  
      results = self.run_graph(graph, initial_workspace, mask)
      for key, (res, exp) in dzip_exact(results, expected).items():
          check(res, exp)
  
      return results
  
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 4 for calling the BasePipelineTestCase obj's underlying member method code with example usage: obj.check_terms(terms, expected, initial_workspace, mask, check) and returns: results