code: def possible_encoding(text, encoding):
      """
      Given text and a single-byte encoding, check whether that text could have
      been decoded from that single-byte encoding.
  
      In other words, check whether it can be encoded in that encoding, possibly
      sloppily.
      """
      return bool(ENCODING_REGEXES[encoding].match(text))
  
file_path: python-ftfy/ftfy/chardata.py
imports: from __future__ import annotations
  import html
  import itertools
  import re
  import unicodedata
label_desc: Use image node_id 3 for calling a global function with example usage: possible_encoding(text, encoding) and returns: bool