@staticmethod
def _parse_verbose(verbose: Union[(str, int, bool)]) -> int:
    if isinstance(verbose, bool):
        verbose = (2 if verbose else 1)
    elif isinstance(verbose, str):
        if (verbose.lower() == 'silent'):
            verbose = 0
        elif (verbose.lower() == 'debug'):
            verbose = 2
        else:
            raise ValueError(f'Unknown verbose mode {verbose}')
    else:
        try:
            verbose = int(verbose)
            if ((verbose > 2) or (verbose < 0)):
                raise ValueError(f'verbose should be one of 0, 1 or 2, received {verbose}')
        except Exception as e:
            raise ValueError(f'Cannot cast verbose = {verbose} to int')
    return verbose
@staticmethod
def _parse_verbose(verbose: Union[(str, int, bool)]) -> int:
    if isinstance(verbose, bool):
        verbose = (2 if verbose else 1)
    elif isinstance(verbose, str):
        if (verbose.lower() == 'silent'):
            verbose = 0
        elif (verbose.lower() == 'debug'):
            verbose = 2
        else:
            raise ValueError(f'Unknown verbose mode {verbose}')
    else:
        try:
            verbose = int(verbose)
            if ((verbose > 2) or (verbose < 0)):
                raise ValueError(f'verbose should be one of 0, 1 or 2, received {verbose}')
        except Exception as e:
            raise ValueError(f'Cannot cast verbose = {verbose} to int')
    return verbose