parameters: (netloc)
return_statement: return '{user}{password}@{netloc}'.format(user=user,
                                                password=password,
                                                netloc=netloc)
docstring: Replace the sensitive data in a netloc with "****", if it exists.
  
      For example:
          - "user:pass@example.com" returns "user:****@example.com"
          - "accesstoken@example.com" returns "****@example.com"
docstring_summary: Replace the sensitive data in a netloc with "****", if it exists.
docstring_tokens: Replace the sensitive data in a netloc with **** if it exists .
function: def redact_netloc(netloc):
      # type: (str) -> str
      """
      Replace the sensitive data in a netloc with "****", if it exists.
  
      For example:
          - "user:pass@example.com" returns "user:****@example.com"
          - "accesstoken@example.com" returns "****@example.com"
      """
      netloc, (user, password) = split_auth_from_netloc(netloc)
      if user is None:
          return netloc
      if password is None:
          user = '****'
          password = ''
      else:
          user = urllib.parse.quote(user)
          password = ':****'
      return '{user}{password}@{netloc}'.format(user=user,
                                                password=password,
                                                netloc=netloc)
function_tokens: def redact_netloc ( netloc ) : # type: (str) -> str netloc , ( user , password ) = split_auth_from_netloc ( netloc ) if user is None : return netloc if password is None : user = '****' password = '' else : user = urllib . parse . quote ( user ) password = ':****' return '{user}{password}@{netloc}' . format ( user = user , password = password , netloc = netloc )