def _attempt_YYYYMMDD(arg, errors):
 def calc(carg):
  carg = carg.astype(object)
  parsed = lib.try_parse_year_month_day((carg / 10000), ((carg / 100) % 100), (carg % 100))
  return tslib.array_to_datetime(parsed, errors=errors)
 def calc_with_mask(carg, mask):
  result = np.empty(carg.shape, dtype='M8[ns]')
  iresult = result.view('i8')
  iresult[(~ mask)] = tslib.iNaT
  result[mask] = calc(carg[mask].astype(np.float64).astype(np.int64)).astype('M8[ns]')
  return result
 try:
  return calc(arg.astype(np.int64))
 except:
  pass
 try:
  carg = arg.astype(np.float64)
  return calc_with_mask(carg, notnull(carg))
 except:
  pass
 try:
  mask = (~ lib.ismember(arg, tslib._nat_strings))
  return calc_with_mask(arg, mask)
 except:
  pass
 return None

def _attempt_YYYYMMDD ( arg , errors ) : def calc ( carg ) : carg = carg . astype ( object ) parsed = lib . try_parse_year_month_day ( ( carg / 10000 ) , ( ( carg / 100 ) % 100 ) , ( carg % 100 ) ) return tslib . array_to_datetime ( parsed , errors = errors ) def calc_with_mask ( carg , mask ) : result = np . empty ( carg . shape , dtype = 'M8[ns]' ) iresult = result . view ( 'i8' ) iresult [ ( ~ mask ) ] = tslib . iNaT result [ mask ] = calc ( carg [ mask ] . astype ( np . float64 ) . astype ( np . int64 ) ) . astype ( 'M8[ns]' ) return result try : return calc ( arg . astype ( np . int64 ) ) except : pass try : carg = arg . astype ( np . float64 ) return calc_with_mask ( carg , notnull ( carg ) ) except : pass try : mask = ( ~ lib . ismember ( arg , tslib . _nat_strings ) ) return calc_with_mask ( arg , mask ) except : pass return None
try to parse the yyyymmdd/%y%m%d format .