def _adjust_to_origin(arg, origin, unit):
if origin == '<STR_LIT>':<EOL><INDENT>original = arg<EOL>j0 = Timestamp(<NUM_LIT:0>).to_julian_date()<EOL>if unit != '<STR_LIT:D>':<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>arg = arg - j0<EOL><DEDENT>except TypeError:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>j_max = Timestamp.max.to_julian_date() - j0<EOL>j_min = Timestamp.min.to_julian_date() - j0<EOL>if np.any(arg > j_max) or np.any(arg < j_min):<EOL><INDENT>raise tslibs.OutOfBoundsDatetime(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(original=original))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if not ((is_scalar(arg) and (is_integer(arg) or is_float(arg))) or<EOL>is_numeric_dtype(np.asarray(arg))):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>arg=arg,<EOL>origin=origin))<EOL><DEDENT>try:<EOL><INDENT>offset = Timestamp(origin)<EOL><DEDENT>except tslibs.OutOfBoundsDatetime:<EOL><INDENT>raise tslibs.OutOfBoundsDatetime(<EOL>"<STR_LIT>".format(origin=origin))<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>".format(origin=origin))<EOL><DEDENT>if offset.tz is not None:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(offset))<EOL><DEDENT>offset -= Timestamp(<NUM_LIT:0>)<EOL>offset = offset // tslibs.Timedelta(<NUM_LIT:1>, unit=unit)<EOL>if is_list_like(arg) and not isinstance(<EOL>arg, (ABCSeries, ABCIndexClass, np.ndarray)):<EOL><INDENT>arg = np.asarray(arg)<EOL><DEDENT>arg = arg + offset<EOL><DEDENT>return arg<EOL>
Helper function for to_datetime.
Adjust input argument to the specified origin

Parameters
----------
arg : list, tuple, ndarray, Series, Index
    date to be adjusted
origin : 'julian' or Timestamp
    origin offset for the arg
unit : string
    passed unit from to_datetime, must be 'D'

Returns
-------
ndarray or scalar of adjusted date(s)