def checkNameValidity(n):
    global __name_validator

    if n is not None:
        if type(n) is not str:
            raise TypeError("Name/prefix/branch must be string.")
        elif __name_validator.match(n) is None:
            raise NameError("'%s' not a valid preset tag/name." % n)
dataset/ETHPy150Open hoytak/lazyrunner/lazyrunner/parameters/common.py/checkNameValidity/original