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: See docstring for aggregate
docstr_tok: ["See","docstring","for","aggregate"]
code: def aggregate_testcase(expect_results, agg_fn="all"):
      """See docstring for aggregate"""
      if agg_fn == "all":
          agg_fn = Expect.all()
      if agg_fn == "all_except_first":
          agg_fn = Expect.all(ignore_first=True)
      if expect_results is None:
          return None
      r = [x for x in expect_results if x is not None]
      if not r:
          return None
      else:
          return agg_fn(np.array(r))
  
imports: import numpy
  import itertools
label_desc: Use image node_id 6 for calling the Expect obj's underlying member method code with example usage: obj.aggregate_testcase(expect_results, agg_fn) and returns: None, None, agg_fn