def _int_or_float(s):
    """
    Converts an a string to an int if possible, or to a float.

    If the string is neither a string or a float a value error is raised.
    """

    if isinstance(s, float):
        # Already a float so just pass through
        return s

    try:
        return int(s)
    except (ValueError, __HOLE__):
        try:
            return float(s)
        except (ValueError, TypeError) as exc:
            raise ValueError(*exc.args)
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/card.py/_int_or_float