def ints_to_td64ns(data, unit="<STR_LIT>"):
copy_made = False<EOL>unit = unit if unit is not None else "<STR_LIT>"<EOL>if data.dtype != np.int64:<EOL><INDENT>data = data.astype(np.int64)<EOL>copy_made = True<EOL><DEDENT>if unit != "<STR_LIT>":<EOL><INDENT>dtype_str = "<STR_LIT>".format(unit=unit)<EOL>data = data.view(dtype_str)<EOL>data = data.astype("<STR_LIT>")<EOL>copy_made = True<EOL><DEDENT>else:<EOL><INDENT>data = data.view("<STR_LIT>")<EOL><DEDENT>return data, copy_made<EOL>
Convert an ndarray with integer-dtype to timedelta64[ns] dtype, treating
the integers as multiples of the given timedelta unit.

Parameters
----------
data : numpy.ndarray with integer-dtype
unit : str, default "ns"
    The timedelta unit to treat integers as multiples of.

Returns
-------
numpy.ndarray : timedelta64[ns] array converted from data
bool : whether a copy was made