clearml_agent/commands/worker.py
def _sanitize_urls(s: str) -> Tuple[str, bool]:
        """ Replaces passwords in URLs with asterisks """
        regex = re.compile("^([^:]*:)[^@]+(.*)$")
        tokens = re.split(r"\s", s)
        changed = False
        for k in range(len(tokens)):
            if "@" in tokens[k]:
                res = urlparse(tokens[k])
                if regex.match(res.netloc):
                    changed = True
                    tokens[k] = urlunparse((
                        res.scheme,
                        regex.sub("\\1********\\2", res.netloc),
                        res.path,
                        res.params,
                        res.query,
                        res.fragment
                    ))
        return " ".join(tokens) if changed else s, changed
 Replaces passwords in URLs with asterisks 
Replaces passwords in URLs with asterisks
Replaces passwords in URLs with asterisks
def _sanitize_urls(s: str) -> Tuple[str, bool]:
        regex = re.compile("^([^:]*:)[^@]+(.*)$")
        tokens = re.split(r"\s", s)
        changed = False
        for k in range(len(tokens)):
            if "@" in tokens[k]:
                res = urlparse(tokens[k])
                if regex.match(res.netloc):
                    changed = True
                    tokens[k] = urlunparse((
                        res.scheme,
                        regex.sub("\\1********\\2", res.netloc),
                        res.path,
                        res.params,
                        res.query,
                        res.fragment
                    ))
        return " ".join(tokens) if changed else s, changed
def _sanitize_urls ( s : str ) -> Tuple [ str , bool ] : regex = re . compile ( "^([^:]*:)[^@]+(.*)$" ) tokens = re . split ( r"\s" , s ) changed = False for k in range ( len ( tokens ) ) : if "@" in tokens [ k ] : res = urlparse ( tokens [ k ] ) if regex . match ( res . netloc ) : changed = True tokens [ k ] = urlunparse ( ( res . scheme , regex . sub ( "\\1********\\2" , res . netloc ) , res . path , res . params , res . query , res . fragment ) ) return " " . join ( tokens ) if changed else s , changed
Replaces passwords in URLs with asterisks
Replaces passwords in URLs with asterisks
""" Replaces passwords in URLs with asterisks """
s
str