def fix_val(val, type):
    if not type in ("int", "float"): return val
    if isinstance(val, (int, float)): return val

    if type == "int": fn = int
    else: fn = float
    if not val:
        return None
    try:
        return fn(val)
    except __HOLE__:
        sys.exit('Non %s value found in annotation file: %s\n' % (type, val))
dataset/ETHPy150Open arq5x/gemini/gemini/gemini_annotate.py/fix_val