code: def _extract_examples_per_testcase(
      self,
      xs,
      preds,
      confs,
      expect_results,
      labels,
      meta,
      nsamples,
      only_include_fail=True,
  ):
      iters = list(iter_with_optional(xs, preds, confs, labels, meta))
      idxs = [0] if self.print_first else []
      idxs = [
          i
          for i in np.argsort(expect_results)
          if not only_include_fail or expect_results[i] <= 0
      ]
      if (
          preds is None
          or (type(preds) == list and len(preds) == 0)
          or len(idxs) > len(iters)
      ):
          return None
      if self.print_first:
          if 0 in idxs:
              idxs.remove(0)
          idxs.insert(0, 0)
      idxs = idxs[:nsamples]
      iters = [iters[i] for i in idxs]
      return idxs, iters, [expect_results[i] for i in idxs]
  
imports: from abc import ABC, abstractmethod
  import dill
  from munch import Munch
  import numpy
  import inspect
  from .expect import iter_with_optional, Expect
  from .viewer.test_summarizer import TestSummarizer
label_desc: Use image node_id 4 for calling the AbstractTest obj's underlying member method code with example usage: obj._extract_examples_per_testcase(xs, preds, confs, expect_results, labels, meta, nsamples, only_include_fail) and returns: idxs,  iters,  unknown, None