def is_fits(origin, filepath, fileobj, *args, **kwargs):
 if (fileobj is not None):
  pos = fileobj.tell()
  sig = fileobj.read(30)
  fileobj.seek(pos)
  return (sig == FITS_SIGNATURE)
 elif (filepath is not None):
  if filepath.lower().endswith(('.fits', '.fits.gz', '.fit', '.fit.gz', '.fts', '.fts.gz')):
   return True
 elif isinstance(args[0], (HDUList, TableHDU, BinTableHDU, GroupsHDU)):
  return True
 else:
  return False

def is_fits ( origin , filepath , fileobj , * args , ** kwargs ) : if ( fileobj is not None ) : pos = fileobj . tell ( ) sig = fileobj . read ( 30 ) fileobj . seek ( pos ) return ( sig == FITS_SIGNATURE ) elif ( filepath is not None ) : if filepath . lower ( ) . endswith ( ( '.fits' , '.fits.gz' , '.fit' , '.fit.gz' , '.fts' , '.fts.gz' ) ) : return True elif isinstance ( args [ 0 ] , ( HDUList , TableHDU , BinTableHDU , GroupsHDU ) ) : return True else : return False
determine whether origin is a fits file .