def _convert_and_box_cache(arg, cache_array, box, errors, name=None):
from pandas import Series, DatetimeIndex, Index<EOL>result = Series(arg).map(cache_array)<EOL>if box:<EOL><INDENT>if errors == '<STR_LIT:ignore>':<EOL><INDENT>return Index(result, name=name)<EOL><DEDENT>else:<EOL><INDENT>return DatetimeIndex(result, name=name)<EOL><DEDENT><DEDENT>return result.values<EOL>
Convert array of dates with a cache and box the result

Parameters
----------
arg : integer, float, string, datetime, list, tuple, 1-d array, Series
cache_array : Series
    Cache of converted, unique dates
box : boolean
    True boxes result as an Index-like, False returns an ndarray
errors : string
    'ignore' plus box=True will convert result to Index
name : string, default None
    Name for a DatetimeIndex

Returns
-------
result : datetime of converted dates
    Returns:

    - Index-like if box=True
    - ndarray if box=False