code: def _attempt_YYYYMMDD(arg, errors):
      """
      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'
      """
  
      def calc(carg):
          # calculate the actual result
          carg = carg.astype(object)
          parsed = parsing.try_parse_year_month_day(
              carg / 10000, carg / 100 % 100, carg % 100
          )
          return tslib.array_to_datetime(parsed, errors=errors)[0]
  
      def calc_with_mask(carg, mask):
          result = np.empty(carg.shape, dtype="M8[ns]")
          iresult = result.view("i8")
          iresult[~mask] = tslibs.iNaT
  
          masked_result = calc(
              carg[mask].astype(np.float64).astype(np.int64)
          )
          result[mask] = masked_result.astype("M8[ns]")
          return result
  
      # try intlike / strings that are ints
      try:
          return calc(arg.astype(np.int64))
      except ValueError:
          pass
  
      # a float with actual np.nan
      try:
          carg = arg.astype(np.float64)
          return calc_with_mask(carg, notna(carg))
      except ValueError:
          pass
  
      # string with NaN-like
      try:
          mask = ~algorithms.isin(arg, list(tslib.nat_strings))
          return calc_with_mask(arg, mask)
      except ValueError:
          pass
  
      return None
  
imports: from datetime import datetime, time
  from functools import partial
  import numpy
  from pandas._libs import tslib, tslibs
  from pandas._libs.tslibs import Timestamp, conversion, parsing
  from pandas._libs.tslibs.parsing import DateParseError, _format_is_iso, _guess_datetime_format, parse_time_string
  from pandas._libs.tslibs.strptime import array_strptime
  from pandas.compat import zip
  from pandas.core.dtypes.common import ensure_object, is_datetime64_dtype, is_datetime64_ns_dtype, is_datetime64tz_dtype, is_float, is_integer, is_integer_dtype, is_list_like, is_numeric_dtype, is_object_dtype, is_scalar
  from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
  from pandas.core.dtypes.missing import notna
  from pandas import compat
  from pandas.core import algorithms
label_desc: Use image node_id 9 for calling a global function with example usage: _attempt_YYYYMMDD(arg, errors) and returns: None, tslib, result, calc, calc_with_mask, calc_with_mask