class_docstr: Helpers for writing expectation functions over tests.
  Each test has a list of testcases, and each testcase has a list of examples.
  Expectation function will act on whole tests, testcases, individual examples, or pairs of examples.
  In any of these, the output of an expectation function for a single example
  is an integer, float, bool, or None, where:
      > 0 (or True) means passed,
      <= 0 or False means fail, and (optionally) the magnitude of the
        failure, indicated by distance from 0, e.g. -10 is worse than -1
      None means the test does not apply, and this should not be counted
docstr: aggregates expectation results for all examples in each test case
  
  Parameters
  ----------
  data : type
      list of np.arrays
  agg_fn : function or string in 'all', 'all_except_first'
      Arguments: np.array
      Returns: bool, float, or int. See docstring for the Expect class
      for what different values in the output mean.
  
  Returns
  -------
  np.array
      Of bool, float, or int. See docstring for the Expect class
      for what different values in the output mean.
docstr_tok: ["aggregates","expectation","results","for","all","examples","in","each","test","case","Parameters","--","--","--","--","--","data",":","type","list","of","np.arrays","agg_fn",":","function","or","string","in","'all","'",",","'all_except_first'","Arguments",":","np.array","Returns",":","bool",",","float",",","or","int",".","See","docstring","for","the","Expect","class","for","what","different","values","in","the","output","mean",".","Returns","--","--","--","-","np.array","Of","bool",",","float",",","or","int",".","See","docstring","for","the","Expect","class","for","what","different","values","in","the","output","mean","."]
code: def aggregate(data, agg_fn="all"):
      """aggregates expectation results for all examples in each test case
  
      Parameters
      ----------
      data : type
          list of np.arrays
      agg_fn : function or string in 'all', 'all_except_first'
          Arguments: np.array
          Returns: bool, float, or int. See docstring for the Expect class
          for what different values in the output mean.
  
      Returns
      -------
      np.array
          Of bool, float, or int. See docstring for the Expect class
          for what different values in the output mean.
      """
      # data is a list of lists or list of np.arrays
      return np.array(
          [Expect.aggregate_testcase(x, agg_fn) for x in data]
      )
  
imports: import numpy
  import itertools
label_desc: Use image node_id 5 for calling the Expect obj's underlying member method code with example usage: obj.aggregate(data, agg_fn) and returns: np