def is_safe_username(username, whitelist=None, blacklist=None,
                     regex=username_regex):
    if not re.match(regex, username):
        return False
    wordlist = get_reserved_wordlist()
    whitelist = whitelist or set()
    blacklist = blacklist or set()
    wordlist = wordlist - whitelist
    wordlist = wordlist.union(blacklist)
    return False if username.lower() in wordlist else True
dataset/ETHPy150Open theskumar/python-usernames/usernames/validators.py/is_safe_username/original