code: def _parse_datetime_index(index):
      """Given an instance of `pandas.DatetimeIndex`, parse its `freq` and
      return a `numpy.dtype` that corresponds to the unit it should be parsed in.
  
      Because `pandas.DataFrame`s cannot store datetimes in anything other than
      `datetime64[ns]`, we need to examine the `DatetimeIndex` itself to
      understand what unit it needs to be parsed as.
  
      Args:
          index (pandas.DatetimeIndex)
  
      Returns:
          `numpy.dtype`: a datetime64 dtype with the correct units depending on
              `index.freq`.
      """
      if index.freq is None:
          return np.dtype("datetime64[ns]")
  
      freq = str(index.freq).lower()
      new_type = None
  
      if (
          any(s in freq for s in ["businessday", "day"])
          or freq == "sm"
          or freq == "sms"
      ):
          # days
          new_type = "D"
      elif freq == "w" or "week" in freq:
          # weeks
          new_type = "W"
      elif any(s in freq for s in ["month", "quarter"]):
          # months
          new_type = "M"
      elif "year" in freq or freq == "a":
          new_type = "Y"
      else:
          # default to datetime
          new_type = "ns"
  
      return np.dtype("datetime64[{0}]".format(new_type))
  
label_desc: Use image node_id 1 for calling a global function with example usage: _parse_datetime_index(index) and returns: np, np