code: def uri_to_iri(value):
      
  
      if not isinstance(value, byte_cls):
          raise TypeError(unwrap(
              '''
              value must be a byte string, not %s
              ''',
              type_name(value)
          ))
  
      parsed = urlsplit(value)
  
      scheme = parsed.scheme
      if scheme is not None:
          scheme = scheme.decode('ascii')
  
      username = _urlunquote(parsed.username, remap=[':', '@'])
      password = _urlunquote(parsed.password, remap=[':', '@'])
      hostname = parsed.hostname
      if hostname:
          hostname = hostname.decode('idna')
      port = parsed.port
      if port and not isinstance(port, int_types):
          port = port.decode('ascii')
  
      netloc = ''
      if username is not None:
          netloc += username
          if password:
              netloc += ':' + password
          netloc += '@'
      if hostname is not None:
          netloc += hostname
      if port is not None:
          netloc += ':' + str_cls(port)
  
      path = _urlunquote(parsed.path, remap=['/'], preserve=True)
      query = _urlunquote(parsed.query, remap=['&', '='], preserve=True)
      fragment = _urlunquote(parsed.fragment)
  
      return urlunsplit((scheme, netloc, path, query, fragment))
docs: Converts an ASCII URI byte string into a unicode IRI
  
      :param value:
          An ASCII-encoded byte string of the URI
  
      :return:
          A unicode string of the IRI