docstr: Flatten test cases into individual examples and print them to file.
  Indices of example to test case will be stored in self.result_indexes.
  If n is not None, self.run_idxs will store the test case indexes.
  
  Parameters
  ----------
  path : string
      File path
  file_format : string, must be one of 'jsonl', 'tsv', or None
      None just calls str(x) for each example in self.data
  format_fn : function or None
      If not None, call this function to format each example in self.data
  header : string
      If not None, first line of file
  n : int
      If not None, number of samples to draw
  seed : int
      Seed to use if n is not None
docstr_tok: ["Flatten","test","cases","into","individual","examples","and","print","them","to","file",".","Indices","of","example","to","test","case","will","be","stored","in","self.result_indexes",".","If","n","is","not","None",",","self.run_idxs","will","store","the","test","case","indexes",".","Parameters","--","--","--","--","--","path",":","string","File","path","file_format",":","string",",","must","be","one","of","'jsonl","'",",","'tsv","'",",","or","None","None","just","calls","str","(","x",")","for","each","example","in","self.data","format_fn",":","function","or","None","If","not","None",",","call","this","function","to","format","each","example","in","self.data","header",":","string","If","not","None",",","first","line","of","file","n",":","int","If","not","None",",","number","of","samples","to","draw","seed",":","int","Seed","to","use","if","n","is","not","None"]
code: def to_raw_file(
      self,
      path,
      file_format=None,
      format_fn=str,
      header=None,
      n=None,
      seed=None,
  ):
      """Flatten test cases into individual examples and print them to file.
      Indices of example to test case will be stored in self.result_indexes.
      If n is not None, self.run_idxs will store the test case indexes.
  
      Parameters
      ----------
      path : string
          File path
      file_format : string, must be one of 'jsonl', 'tsv', or None
          None just calls str(x) for each example in self.data
      format_fn : function or None
          If not None, call this function to format each example in self.data
      header : string
          If not None, first line of file
      n : int
          If not None, number of samples to draw
      seed : int
          Seed to use if n is not None
      """
      # file_format can be jsonl, TODO
      # format_fn takes an example and outputs a line in the file
      ret = ""
      if header is not None:
          ret += header.strip("\n") + "\n"
      examples = self.to_raw_examples(
          file_format=file_format, format_fn=format_fn, n=n, seed=seed
      )
      ret += "\n".join(examples)
      f = open(path, "w")
      f.write(ret)
      f.close()
  
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 12 for calling the AbstractTest obj's underlying member method code with example usage: obj.to_raw_file(path, file_format, format_fn, header, n, seed) without return types