parameters: (self,
                 baseline_input_file, observed_input_file,
                 output_file,
                 preserve_whitespace = False)
docstring: Read input files and open the output file and construct a new `io_manager`
      object.
  
      If `preserve_whitespace` is `False`, leading and trailing whitespace is
      stripped from each CSV cell.
  
      Raises
        AssertionError :
          If `type(preserve_whitespace) != bool`.
docstring_summary: Read input files and open the output file and construct a new `io_manager`
      object.
docstring_tokens: Read input files and open the output file and construct a new io_manager object .
function: def __init__(self,
                 baseline_input_file, observed_input_file,
                 output_file,
                 preserve_whitespace = False):
      """Read input files and open the output file and construct a new `io_manager`
      object.
  
      If `preserve_whitespace` is `False`, leading and trailing whitespace is
      stripped from each CSV cell.
  
      Raises
        AssertionError :
          If `type(preserve_whitespace) != bool`.
      """
      assert type(preserve_whitespace) == bool
  
      self.preserve_whitespace = preserve_whitespace
  
      # Open baseline results.
      self.baseline_input_file = open(baseline_input_file)
      self.baseline_reader = csv_dict_reader(
        filter_comments(self.baseline_input_file)
      )
  
      if not self.preserve_whitespace:
        strip_list(self.baseline_reader.fieldnames)
  
      self.variable_names = list(self.baseline_reader.fieldnames) # Copy.
      self.variable_units = self.baseline_reader.next()
  
      if not self.preserve_whitespace:
        strip_dict(self.variable_units)
  
      # Open observed results.
      self.observed_input_file = open(observed_input_file)
      self.observed_reader = csv_dict_reader(
        filter_comments(self.observed_input_file)
      )
  
      if not self.preserve_whitespace:
        strip_list(self.observed_reader.fieldnames)
  
      # Make sure all inputs have the same variables schema.
      assert self.variable_names == self.observed_reader.fieldnames,             \
        "Observed results input file (`" + observed_input_file + "`) "         + \
        "variable schema `" + str(self.observed_reader.fieldnames) + "` does " + \
        "not match the baseline results input file (`" + baseline_input_file   + \
        "`) variable schema `" + str(self.variable_names) + "`."
  
      # Consume the next row, which should be the second line of the header.
      observed_variable_units = self.observed_reader.next()
  
      if not self.preserve_whitespace:
        strip_dict(observed_variable_units)
  
      # Make sure all inputs have the same units schema.
      assert self.variable_units == observed_variable_units,                    \
        "Observed results input file (`" + observed_input_file + "`) "        + \
        "units schema `" + str(observed_variable_units) + "` does not "       + \
        "match the baseline results input file (`" + baseline_input_file      + \
        "`) units schema `" + str(self.variable_units) + "`."
  
      if   output_file == "-": # Output to stdout.
        self.output_file = stdout
      else:                    # Output to user-specified file.
        self.output_file = open(output_file, "w")
  
      self.writer = csv_dict_writer(
        self.output_file, fieldnames = self.variable_names
      )
function_tokens: def __init__ ( self , baseline_input_file , observed_input_file , output_file , preserve_whitespace = False ) : assert type ( preserve_whitespace ) == bool self . preserve_whitespace = preserve_whitespace # Open baseline results. self . baseline_input_file = open ( baseline_input_file ) self . baseline_reader = csv_dict_reader ( filter_comments ( self . baseline_input_file ) ) if not self . preserve_whitespace : strip_list ( self . baseline_reader . fieldnames ) self . variable_names = list ( self . baseline_reader . fieldnames ) # Copy. self . variable_units = self . baseline_reader . next ( ) if not self . preserve_whitespace : strip_dict ( self . variable_units ) # Open observed results. self . observed_input_file = open ( observed_input_file ) self . observed_reader = csv_dict_reader ( filter_comments ( self . observed_input_file ) ) if not self . preserve_whitespace : strip_list ( self . observed_reader . fieldnames ) # Make sure all inputs have the same variables schema. assert self . variable_names == self . observed_reader . fieldnames , "Observed results input file (`" + observed_input_file + "`) " + "variable schema `" + str ( self . observed_reader . fieldnames ) + "` does " + "not match the baseline results input file (`" + baseline_input_file + "`) variable schema `" + str ( self . variable_names ) + "`." # Consume the next row, which should be the second line of the header. observed_variable_units = self . observed_reader . next ( ) if not self . preserve_whitespace : strip_dict ( observed_variable_units ) # Make sure all inputs have the same units schema. assert self . variable_units == observed_variable_units , "Observed results input file (`" + observed_input_file + "`) " + "units schema `" + str ( observed_variable_units ) + "` does not " + "match the baseline results input file (`" + baseline_input_file + "`) units schema `" + str ( self . variable_units ) + "`." if output_file == "-" : # Output to stdout. self . output_file = stdout else : # Output to user-specified file. self . output_file = open ( output_file , "w" ) self . writer = csv_dict_writer ( self . output_file , fieldnames = self . variable_names )