code: def read(self, file_or_filename):
          
          self.file_or_filename = file_or_filename
  
          logger.info("Parsing PSAT case file [%s]." % file_or_filename)
  
          t0 = time.time()
  
          self.case = Case()
  
          # Name the case
          if isinstance(file_or_filename, basestring):
              name, _ = splitext(basename(file_or_filename))
          else:
              name, _ = splitext(file_or_filename.name)
  
          self.case.name = name
  
          bus_array = self._get_bus_array_construct()
          line_array = self._get_line_array_construct()
          # TODO: Lines.con - Alternative line data format
          slack_array = self._get_slack_array_construct()
          pv_array = self._get_pv_array_construct()
          pq_array = self._get_pq_array_construct()
          demand_array = self._get_demand_array_construct()
          supply_array = self._get_supply_array_construct()
          # TODO: Varname.bus (Bus names)
  
          # Pyparsing case:
          case = \
              ZeroOrMore(matlab_comment) + bus_array + \
              ZeroOrMore(matlab_comment) + line_array + \
              ZeroOrMore(matlab_comment) + slack_array + \
              ZeroOrMore(matlab_comment) + pv_array + \
              ZeroOrMore(matlab_comment) + pq_array + \
              ZeroOrMore(matlab_comment) + demand_array + \
              ZeroOrMore(matlab_comment) + supply_array
  
          case.parseFile(file_or_filename)
  
          elapsed = time.time() - t0
          logger.info("PSAT case file parsed in %.3fs." % elapsed)
  
          return self.case
docs: Parses a PSAT data file and returns a case object
  
              file_or_filename: File object or path to PSAT data file
              return: Case object