docstr: Subsamples test cases
  
  Parameters
  ----------
  n : int
      Number of testcases to sample
  seed : int
      Seed to use
  
  Returns
  -------
  tuple(list, list)
      First list is a list of examples
      Second list maps examples to testcases.
  
  For example, let's say we have two testcases: [a, b, c] and [d, e].
  The first list will be [a, b, c, d, e]
  the second list will be [0, 0, 0, 1, 1]
  
  Also updates self.run_idxs if n is not None to indicate which testcases
  were run. Also updates self.result_indexes with the second list.
docstr_tok: ["Subsamples","test","cases","Parameters","--","--","--","--","--","n",":","int","Number","of","testcases","to","sample","seed",":","int","Seed","to","use","Returns","--","--","--","-","tuple","(","list",",","list",")","First","list","is","a","list","of","examples","Second","list","maps","examples","to","testcases",".","For","example",",","let","'s","say","we","have","two","testcases",":","[","a",",","b",",","c","]","and","[","d",",","e","]",".","The","first","list","will","be","[","a",",","b",",","c",",","d",",","e","]","the","second","list","will","be","[","0",",","0",",","0",",","1",",","1","]","Also","updates","self.run_idxs","if","n","is","not","None","to","indicate","which","testcases","were","run",".","Also","updates","self.result_indexes","with","the","second","list","."]
code: def example_list_and_indices(self, n=None, seed=None):
      """Subsamples test cases
  
      Parameters
      ----------
      n : int
          Number of testcases to sample
      seed : int
          Seed to use
  
      Returns
      -------
      tuple(list, list)
          First list is a list of examples
          Second list maps examples to testcases.
  
      For example, let's say we have two testcases: [a, b, c] and [d, e].
      The first list will be [a, b, c, d, e]
      the second list will be [0, 0, 0, 1, 1]
  
      Also updates self.run_idxs if n is not None to indicate which testcases
      were run. Also updates self.result_indexes with the second list.
  
      """
      if seed is not None:
          np.random.seed(seed)
      self.run_idxs = None
      idxs = list(range(len(self.data)))
      if n is not None:
          idxs = np.random.choice(
              idxs, min(n, len(idxs)), replace=False
          )
          self.run_idxs = idxs
      if type(self.data[0]) in [list, np.array, np.ndarray]:
          all = [(i, y) for i in idxs for y in self.data[i]]
          result_indexes, examples = map(list, list(zip(*all)))
      else:
          examples = [self.data[i] for i in idxs]
          result_indexes = idxs  # list(range(len(self.data)))
      self.result_indexes = result_indexes
      return examples, result_indexes
  
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 8 for calling the AbstractTest obj's underlying member method code with example usage: obj.example_list_and_indices(n, seed) and returns: examples,  result_indexes