code: def _make_fast_url_quote(charset="utf-8", errors="strict", safe="/:", unsafe=""):
      
      if isinstance(safe, text_type):
          safe = safe.encode(charset, errors)
  
      if isinstance(unsafe, text_type):
          unsafe = unsafe.encode(charset, errors)
  
      safe = (frozenset(bytearray(safe)) | _always_safe) - frozenset(bytearray(unsafe))
      table = [chr(c) if c in safe else "%%%02X" % c for c in range(256)]
  
      if not PY2:
  
          def quote(string):
              return "".join([table[c] for c in string])
  
      else:
  
          def quote(string):
              return "".join([table[c] for c in bytearray(string)])
  
      return quote
docs: Precompile the translation table for a URL encoding function.
  
      Unlike :func:`url_quote`, the generated function only takes the
      string to quote.
  
      :param charset: The charset to encode the result with.
      :param errors: How to handle encoding errors.
      :param safe: An optional sequence of safe characters to never encode.
      :param unsafe: An optional sequence of unsafe characters to always encode.