def clean_number(val):
    if val is not None and (isinstance(val, str) or isinstance(val, unicode)):
        try:  # it's an int
            return int(val)
        except __HOLE__:
            pass

        try:  # it's a float
            return float(val)
        except ValueError:
            pass

    # cannot convert to number, returns string or None
    return val
dataset/ETHPy150Open ExCiteS/geokey/geokey/contributions/migrations/0010_auto_20150511_1132.py/clean_number