code: def quote_from_bytes(bs, safe='/'):
      
      if not isinstance(bs, (bytes, bytearray)):
          raise TypeError("quote_from_bytes() expected bytes")
      if not bs:
          return str('')
      ### For Python-Future:
      bs = bytes(bs)
      ###
      if isinstance(safe, str):
          # Normalize 'safe' by converting to bytes and removing non-ASCII chars
          safe = str(safe).encode('ascii', 'ignore')
      else:
          ### For Python-Future:
          safe = bytes(safe)
          ###
          safe = bytes([c for c in safe if c < 128])
      if not bs.rstrip(_ALWAYS_SAFE_BYTES + safe):
          return bs.decode()
      try:
          quoter = _safe_quoters[safe]
      except KeyError:
          _safe_quoters[safe] = quoter = Quoter(safe).__getitem__
      return str('').join([quoter(char) for char in bs])
docs: Like quote(), but accepts a bytes object rather than a str, and does
      not perform string-to-bytes encoding.  It always returns an ASCII string.
      quote_from_bytes(b'abc def\x3f') -> 'abc%20def%3f'