code: def _table_filename(tbl_filename):
      
      tbl_filename = str(tbl_filename)  # convert any Path objects
  
      txfn = _normalize_table_path(tbl_filename)
      gzfn = txfn + '.gz'
  
      if os.path.exists(txfn):
          if (os.path.exists(gzfn) and
                  os.stat(gzfn).st_mtime > os.stat(txfn).st_mtime):
              tbl_filename = gzfn
          else:
              tbl_filename = txfn
      elif os.path.exists(gzfn):
          tbl_filename = gzfn
      else:
          raise ItsdbError(
              'Table does not exist at {}(.gz)'
              .format(tbl_filename)
          )
  
      return tbl_filename
docs: Determine if the table path should end in .gz or not and return it.
  
      A .gz path is preferred only if it exists and is newer than any
      regular text file path.
  
      Raises:
          :class:`delphin.exceptions.ItsdbError`: when neither the .gz
              nor text file exist.