docs: def get_data_xls(file_name, file_contents=None, on_demand=False):
      '''
      Loads the old excel format files. New format files will automatically
      get loaded as well.
  
      Args:
          file_name: The name of the local file, or the holder for the
              extension type when the file_contents are supplied.
          file_contents: The file-like object holding contents of file_name.
              If left as None, then file_name is directly loaded.
          on_demand: Requests that a yielder be used in place of a full data
              copy.
      '''
      def tuple_to_iso_date(tuple_date):
          '''
          Turns a gregorian (year, month, day, hour, minute, nearest_second) into a
          standard YYYY-MM-DDTHH:MM:SS ISO date.  If the date part is all zeros, it's
          assumed to be a time; if the time part is all zeros it's assumed to be a date;
          if all of it is zeros it's taken to be a time, specifically 00:00:00 (midnight).
  
          Note that datetimes of midnight will come back as date-only strings.  A date
          of month=0 and day=0 is meaningless, so that part of the coercion is safe.
          For more on the hairy nature of Excel date/times see
          http://www.lexicon.net/sjmachin/xlrd.html
          '''
          (y,m,d, hh,mm,ss) = tuple_date
          non_zero = lambda n: n!=0
          date = "%04d-%02d-%02d"  % (y,m,d)    if list(filter(non_zero, (y,m,d)))               else ''
          time = "T%02d:%02d:%02d" % (hh,mm,ss) if list(filter(non_zero, (hh,mm,ss))) or not date else ''
          return date+time
  
      def format_excel_val(book, val_type, value, want_tuple_date):
          '''Cleans up the incoming excel data'''
          #  Data val_type Codes:
          #  EMPTY   0
          #  TEXT    1 a Unicode string
          #  NUMBER  2 float
          #  DATE    3 float
          #  BOOLEAN 4 int; 1 means TRUE, 0 means FALSE
          #  ERROR   5
          if   val_type == 2: # TEXT
              if value == int(value): value = int(value)
          elif val_type == 3: # NUMBER
              datetuple = xlrd.xldate_as_tuple(value, book.datemode)
              value = datetuple if want_tuple_date else tuple_to_iso_date(datetuple)
          elif val_type == 5: # ERROR
              value = xlrd.error_text_from_code[value]
          return value
  
      def xlrd_xsl_to_array(file_name, file_contents=None):
          '''
          Returns:
              A list of 2-D tables holding the converted cells of each sheet
          '''
          book = xlrd.open_workbook(file_name, file_contents=file_contents, on_demand=on_demand)
          formatter = lambda t_v: format_excel_val(book, t_v[0], t_v[1], False)
          row_builder = lambda s, r: list(map(formatter, zip(s.row_types(r), s.row_values(r))))
  
          data = [SheetYielder(book, index, row_builder) for index in range(book.nsheets)]
          if not on_demand:
              for sheet in data:
                  sheet.load()
              book.release_resources()
          return data
  
      return xlrd_xsl_to_array(file_name, file_contents)