@classmethod<EOL><INDENT>def _try_convert_to_int_index(cls, data, copy, name, dtype):<DEDENT>
from .numeric import Int64Index, UInt64Index<EOL>if not is_unsigned_integer_dtype(dtype):<EOL><INDENT>try:<EOL><INDENT>res = data.astype('<STR_LIT>', copy=False)<EOL>if (res == data).all():<EOL><INDENT>return Int64Index(res, copy=copy, name=name)<EOL><DEDENT><DEDENT>except (OverflowError, TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>try:<EOL><INDENT>res = data.astype('<STR_LIT>', copy=False)<EOL>if (res == data).all():<EOL><INDENT>return UInt64Index(res, copy=copy, name=name)<EOL><DEDENT><DEDENT>except (OverflowError, TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT>raise ValueError<EOL>
Attempt to convert an array of data into an integer index.

Parameters
----------
data : The data to convert.
copy : Whether to copy the data or not.
name : The name of the index returned.

Returns
-------
int_index : data converted to either an Int64Index or a
            UInt64Index

Raises
------
ValueError if the conversion was not successful.