def _assemble_from_unit_mappings(arg, errors, box, tz):
from pandas import to_timedelta, to_numeric, DataFrame<EOL>arg = DataFrame(arg)<EOL>if not arg.columns.is_unique:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>def f(value):<EOL><INDENT>if value in _unit_map:<EOL><INDENT>return _unit_map[value]<EOL><DEDENT>if value.lower() in _unit_map:<EOL><INDENT>return _unit_map[value.lower()]<EOL><DEDENT>return value<EOL><DEDENT>unit = {k: f(k) for k in arg.keys()}<EOL>unit_rev = {v: k for k, v in unit.items()}<EOL>required = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>req = sorted(list(set(required) - set(unit_rev.keys())))<EOL>if len(req):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(required='<STR_LIT:U+002C>'.join(req)))<EOL><DEDENT>excess = sorted(list(set(unit_rev.keys()) - set(_unit_map.values())))<EOL>if len(excess):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(excess='<STR_LIT:U+002C>'.join(excess)))<EOL><DEDENT>def coerce(values):<EOL><INDENT>values = to_numeric(values, errors=errors)<EOL>if is_integer_dtype(values):<EOL><INDENT>values = values.astype('<STR_LIT>', copy=False)<EOL><DEDENT>return values<EOL><DEDENT>values = (coerce(arg[unit_rev['<STR_LIT>']]) * <NUM_LIT> +<EOL>coerce(arg[unit_rev['<STR_LIT>']]) * <NUM_LIT:100> +<EOL>coerce(arg[unit_rev['<STR_LIT>']]))<EOL>try:<EOL><INDENT>values = to_datetime(values, format='<STR_LIT>', errors=errors, utc=tz)<EOL><DEDENT>except (TypeError, ValueError) as e:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>".format(error=e))<EOL><DEDENT>for u in ['<STR_LIT:h>', '<STR_LIT:m>', '<STR_LIT:s>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>value = unit_rev.get(u)<EOL>if value is not None and value in arg:<EOL><INDENT>try:<EOL><INDENT>values += to_timedelta(coerce(arg[value]),<EOL>unit=u,<EOL>errors=errors)<EOL><DEDENT>except (TypeError, ValueError) as e:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>".format(value=value, error=e))<EOL><DEDENT><DEDENT><DEDENT>if not box:<EOL><INDENT>return values.values<EOL><DEDENT>return values<EOL>
assemble the unit specified fields from the arg (DataFrame)
Return a Series for actual parsing

Parameters
----------
arg : DataFrame
errors : {'ignore', 'raise', 'coerce'}, default 'raise'

    - If 'raise', then invalid parsing will raise an exception
    - If 'coerce', then invalid parsing will be set as NaT
    - If 'ignore', then invalid parsing will return the input
box : boolean

    - If True, return a DatetimeIndex
    - If False, return an array
tz : None or 'utc'

Returns
-------
Series