code: def _urlunquote(byte_string, remap=None, preserve=None):
      
  
      if byte_string is None:
          return byte_string
  
      if byte_string == b'':
          return ''
  
      if preserve:
          replacements = ['\x1A', '\x1C', '\x1D', '\x1E', '\x1F']
          preserve_unmap = {}
          for char in remap:
              replacement = replacements.pop(0)
              preserve_unmap[replacement] = char
              byte_string = byte_string.replace(char.encode('ascii'), replacement.encode('ascii'))
  
      byte_string = unquote_to_bytes(byte_string)
  
      if remap:
          for char in remap:
              byte_string = byte_string.replace(char.encode('ascii'), ('%%%02x' % ord(char)).encode('ascii'))
  
      output = byte_string.decode('utf-8', 'iriutf8')
  
      if preserve:
          for replacement, original in preserve_unmap.items():
              output = output.replace(replacement, original)
  
      return output
docs: Unquotes a URI portion from a byte string into unicode using UTF-8
  
      :param byte_string:
          A byte string of the data to unquote
  
      :param remap:
          A list of characters (as unicode) that should be re-mapped to a
          %XX encoding. This is used when characters are not valid in part of a
          URL.
  
      :param preserve:
          A bool - indicates that the chars to be remapped if they occur in
          non-hex form, should be preserved. E.g. / for URL path.
  
      :return:
          A unicode string