code: def quick_detect_encoding(string):
      
      assert isinstance(string, bytes)
      try:
          detected = cchardet.detect(string)
          if detected:
              return detected.get('encoding') or detect_encoding(string)
      except Exception as e:
          pass
      return detect_encoding(string)
docs: Tries to detect the encoding of the passed string.
  
      Uses cchardet. Fallbacks to detect_encoding.