def _attempt_YYYYMMDD(arg, errors):
def calc(carg):<EOL><INDENT>carg = carg.astype(object)<EOL>parsed = parsing.try_parse_year_month_day(carg / <NUM_LIT>,<EOL>carg / <NUM_LIT:100> % <NUM_LIT:100>,<EOL>carg % <NUM_LIT:100>)<EOL>return tslib.array_to_datetime(parsed, errors=errors)[<NUM_LIT:0>]<EOL><DEDENT>def calc_with_mask(carg, mask):<EOL><INDENT>result = np.empty(carg.shape, dtype='<STR_LIT>')<EOL>iresult = result.view('<STR_LIT>')<EOL>iresult[~mask] = tslibs.iNaT<EOL>masked_result = calc(carg[mask].astype(np.float64).astype(np.int64))<EOL>result[mask] = masked_result.astype('<STR_LIT>')<EOL>return result<EOL><DEDENT>try:<EOL><INDENT>return calc(arg.astype(np.int64))<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>carg = arg.astype(np.float64)<EOL>return calc_with_mask(carg, notna(carg))<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>mask = ~algorithms.isin(arg, list(tslib.nat_strings))<EOL>return calc_with_mask(arg, mask)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>return None<EOL>
try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like,
arg is a passed in as an object dtype, but could really be ints/strings
with nan-like/or floats (e.g. with nan)

Parameters
----------
arg : passed value
errors : 'raise','ignore','coerce'