def ensure_int64_or_float64(arr, copy=False):
try:<EOL><INDENT>return arr.astype('<STR_LIT>', copy=copy, casting='<STR_LIT>')<EOL><DEDENT>except TypeError:<EOL><INDENT>return arr.astype('<STR_LIT>', copy=copy)<EOL><DEDENT>
Ensure that an dtype array of some integer dtype
has an int64 dtype if possible
If it's not possible, potentially because of overflow,
convert the array to float64 instead.

Parameters
----------
arr : array-like
      The array whose data type we want to enforce.
copy: boolean
      Whether to copy the original array or reuse
      it in place, if possible.

Returns
-------
out_arr : The input array cast as int64 if
          possible without overflow.
          Otherwise the input array cast to float64.