code: def get_encoding(input_string, guesses=None, is_html=False):
      
      converted = UnicodeDammit(input_string, override_encodings=[guesses] if guesses else [], is_html=is_html)
      return converted.original_encoding
docs: Return the encoding of a byte string. Uses bs4 UnicodeDammit.
  
      :param string input_string: Encoded byte string.
      :param list[string] guesses: (Optional) List of encoding guesses to prioritize.
      :param bool is_html: Whether the input is HTML.