def get_number(s, cast=int):
    import string
    d = "".join(x for x in str(s) if x in string.digits)
    return cast(d)
Try to get a number out of a string, and cast it.
dataset/ETHPy150Open tanghaibao/jcvi/formats/base.py/get_number