def convert_to_int(s):
    'Turn ANES data entry into an integer.\n    \n    >>> convert_to_int("1. Govt should provide many fewer services")\n    1\n    >>> convert_to_int("2")\n    2\n    '
    try:
        return int(s.partition('.')[0])
    except ValueError:
        warnings.warn(("Couldn't convert: " + s))
        return np.nan
    except AttributeError:
        return s
Turn ANES data entry into an integer.

>>> convert_to_int("1. Govt should provide many fewer services")
1
>>> convert_to_int("2")
2
def convert_to_int(s):
    'Turn ANES data entry into an integer.\n    \n    >>> convert_to_int("1. Govt should provide many fewer services")\n    1\n    >>> convert_to_int("2")\n    2\n    '
    try:
        return int(s.partition('.')[0])
    except ValueError:
        warnings.warn(("Couldn't convert: " + s))
        return np.nan
    except AttributeError:
        return s