class_docstr: Graph represention of Pipeline Term dependencies that includes metadata
  about extra rows required to perform computations.
  
  Each node in the graph has an `extra_rows` attribute, indicating how many,
  if any, extra rows we should compute for the node.  Extra rows are most
  often needed when a term is an input to a rolling window computation.  For
  example, if we compute a 30 day moving average of price from day X to day
  Y, we need to load price data for the range from day (X - 29) to day Y.
  
  Parameters
  ----------
  terms : dict
      A dict mapping names to final output terms.
  all_dates : pd.DatetimeIndex
      An index of all known trading days for which ``terms`` will be
      computed.
  start_date : pd.Timestamp
      The first date for which output is requested for ``terms``.
  end_date : pd.Timestamp
      The last date for which output is requested for ``terms``.
  
  Attributes
  ----------
  outputs
  offset
  extra_rows
  
  Methods
  -------
  ordered()
      Return a topologically-sorted iterator over the terms in self.
class_docstr_tok: ["Graph","represention","of","Pipeline","Term","dependencies","that","includes","metadata","about","extra","rows","required","to","perform","computations",".","Each","node","in","the","graph","has","an","`","extra_rows","`","attribute",",","indicating","how","many",",","if","any",",","extra","rows","we","should","compute","for","the","node",".","Extra","rows","are","most","often","needed","when","a","term","is","an","input","to","a","rolling","window","computation",".","For","example",",","if","we","compute","a","30","day","moving","average","of","price","from","day","X","to","day","Y",",","we","need","to","load","price","data","for","the","range","from","day","(","X","-","29",")","to","day","Y.","Parameters","--","--","--","--","--","terms",":","dict","A","dict","mapping","names","to","final","output","terms",".","all_dates",":","pd.DatetimeIndex","An","index","of","all","known","trading","days","for","which","``","terms","``","will","be","computed",".","start_date",":","pd.Timestamp","The","first","date","for","which","output","is","requested","for","``","terms","``",".","end_date",":","pd.Timestamp","The","last","date","for","which","output","is","requested","for","``","terms","``",".","Attributes","--","--","--","--","--","outputs","offset","extra_rows","Methods","--","--","--","-","ordered","(",")","Return","a","topologically-sorted","iterator","over","the","terms","in","self","."]
docstr: A dict mapping `term` -> `# of extra rows to load/compute of `term`.
  
  Notes
  ----
  This value depends on the other terms in the graph that require `term`
  **as an input**.  This is not to be confused with `term.dependencies`,
  which describes how many additional rows of `term`'s inputs we need to
  load, and which is determined entirely by `Term` itself.
  
  Examples
  --------
  Our graph contains the following terms:
  
      A = SimpleMovingAverage([USEquityPricing.high], window_length=5)
      B = SimpleMovingAverage([USEquityPricing.high], window_length=10)
      C = SimpleMovingAverage([USEquityPricing.low], window_length=8)
  
  To compute N rows of A, we need N + 4 extra rows of `high`.
  To compute N rows of B, we need N + 9 extra rows of `high`.
  To compute N rows of C, we need N + 7 extra rows of `low`.
  
  We store the following extra_row requirements:
  
  self.extra_rows[high] = 9  # Ensures that we can service B.
  self.extra_rows[low] = 7
  
  See Also
  --------
  catalyst.pipeline.graph.TermGraph.offset
  catalyst.pipeline.term.Term.dependencies
docstr_tok: ["A","dict","mapping","`","term","`","-",">","`","#","of","extra","rows","to","load\/compute","of","`","term","`",".","Notes","--","--","This","value","depends","on","the","other","terms","in","the","graph","that","require","`","term","`","*","*","as","an","input","*","*",".","This","is","not","to","be","confused","with","`","term.dependencies","`",",","which","describes","how","many","additional","rows","of","`","term","`","'s","inputs","we","need","to","load",",","and","which","is","determined","entirely","by","`","Term","`","itself",".","Examples","--","--","--","--","Our","graph","contains","the","following","terms",":","A","=","SimpleMovingAverage","(","[","USEquityPricing.high","]",",","window_length=5",")","B","=","SimpleMovingAverage","(","[","USEquityPricing.high","]",",","window_length=10",")","C","=","SimpleMovingAverage","(","[","USEquityPricing.low","]",",","window_length=8",")","To","compute","N","rows","of","A",",","we","need","N","+","4","extra","rows","of","`","high","`",".","To","compute","N","rows","of","B",",","we","need","N","+","9","extra","rows","of","`","high","`",".","To","compute","N","rows","of","C",",","we","need","N","+","7","extra","rows","of","`","low","`",".","We","store","the","following","extra_row","requirements",":","self.extra_rows","[","high","]","=","9","#","Ensures","that","we","can","service","B.","self.extra_rows","[","low","]","=","7","See","Also","--","--","--","--","catalyst.pipeline.graph.TermGraph.offset","catalyst.pipeline.term.Term.dependencies"]
code: def extra_rows(self):
      """
      A dict mapping `term` -> `# of extra rows to load/compute of `term`.
  
      Notes
      ----
      This value depends on the other terms in the graph that require `term`
      **as an input**.  This is not to be confused with `term.dependencies`,
      which describes how many additional rows of `term`'s inputs we need to
      load, and which is determined entirely by `Term` itself.
  
      Examples
      --------
      Our graph contains the following terms:
  
          A = SimpleMovingAverage([USEquityPricing.high], window_length=5)
          B = SimpleMovingAverage([USEquityPricing.high], window_length=10)
          C = SimpleMovingAverage([USEquityPricing.low], window_length=8)
  
      To compute N rows of A, we need N + 4 extra rows of `high`.
      To compute N rows of B, we need N + 9 extra rows of `high`.
      To compute N rows of C, we need N + 7 extra rows of `low`.
  
      We store the following extra_row requirements:
  
      self.extra_rows[high] = 9  # Ensures that we can service B.
      self.extra_rows[low] = 7
  
      See Also
      --------
      catalyst.pipeline.graph.TermGraph.offset
      catalyst.pipeline.term.Term.dependencies
      """
      return {
          term: attrs["extra_rows"]
          for term, attrs in iteritems(self.graph.node)
      }
  
imports: from networkx import DiGraph, topological_sort
  from six import iteritems, itervalues
  from catalyst.utils.memoize import lazyval
  from catalyst.pipeline.visualize import display_graph
  from .term import LoadableTerm
label_desc: Use image node_id 4 for calling the ExecutionPlan obj's underlying member method code with example usage: obj.extra_rows() and returns: unknown