def detect_snappy(contents):
 try:
  import snappy
  return snappy.isValidCompressed(contents)
 except:
  logging.exception('failed to detect snappy')
  return False

def detect_snappy ( contents ) : try : import snappy return snappy . isValidCompressed ( contents ) except : logging . exception ( 'failed to detect snappy' ) return False
this is a silly small function which checks to see if the file is snappy .