def is_number(s, cast=float):
    """
    Check if a string is a number. Use cast=int to check if s is an integer.
    """
    try:
        cast(s) # for int, long and float
    except __HOLE__:
        return False

    return True
dataset/ETHPy150Open tanghaibao/jcvi/formats/base.py/is_number