def _check_type(par, par_type):
    """function for checking if python parameter 'par' and DBASIC type 'par_type' are compatible"""
    if par_type == 'String':
        if type(par) == str:
            return True
        else:
            raise TypeError(
                "Parameter of DBASIC type 'String' must be of python type 'str'"
                )
    elif par_type == 'Uint64':
        if type(par) == int:
            if par >= 0:
                return True
            else:
                raise TypeError(
                    "Parameter of DBASIC type 'Uint64' can not be negative")
        else:
            raise TypeError(
                "Parameter of DBASIC type 'Uint64' must be of python type 'int'"
                )
    else:
        raise TypeError("Parameter DBASIC type should be 'Uint64' or 'String'")
