(netloc)
return '{user}{password}@{netloc}'.format(user=urllib_parse.quote(user),
                                              password=password,
                                              netloc=netloc)
Replace the password in a netloc with "****", if it exists.

    For example, "user:pass@example.com" returns "user:****@example.com".
Replace the password in a netloc with "****", if it exists.
Replace the password in a netloc with **** if it exists .
def redact_netloc(netloc):
    # type: (str) -> str
    """
    Replace the password in a netloc with "****", if it exists.

    For example, "user:pass@example.com" returns "user:****@example.com".
    """
    netloc, (user, password) = split_auth_from_netloc(netloc)
    if user is None:
        return netloc
    password = '' if password is None else ':****'
    return '{user}{password}@{netloc}'.format(user=urllib_parse.quote(user),
                                              password=password,
                                              netloc=netloc)
def redact_netloc ( netloc ) : # type: (str) -> str netloc , ( user , password ) = split_auth_from_netloc ( netloc ) if user is None : return netloc password = '' if password is None else ':****' return '{user}{password}@{netloc}' . format ( user = urllib_parse . quote ( user ) , password = password , netloc = netloc )