def redact_http_basic_auth(output):
 url_re = '(https?)://.*@'
 redacted = '\\1://<redacted>@'
 if (sys.version_info >= (2, 7)):
  return re.sub(url_re, redacted, output, flags=re.IGNORECASE)
 elif re.search(url_re, output.lower()):
  return re.sub(url_re, redacted, output.lower())
 return output

def redact_http_basic_auth ( output ) : url_re = '(https?)://.*@' redacted = '\\1://<redacted>@' if ( sys . version_info >= ( 2 , 7 ) ) : return re . sub ( url_re , redacted , output , flags = re . IGNORECASE ) elif re . search ( url_re , output . lower ( ) ) : return re . sub ( url_re , redacted , output . lower ( ) ) return output
remove http user and password .