code: def get_date_format(atrv):
      r_date = re.compile(r"[Dd][Aa][Tt][Ee]\s+[\"']?(.+?)[\"']?$")
      m = r_date.match(atrv)
      if m:
          pattern = m.group(1).strip()
          # convert time pattern from Java's SimpleDateFormat to C's format
          datetime_unit = None
          if "yyyy" in pattern:
              pattern = pattern.replace("yyyy", "%Y")
              datetime_unit = "Y"
          elif "yy":
              pattern = pattern.replace("yy", "%y")
              datetime_unit = "Y"
          if "MM" in pattern:
              pattern = pattern.replace("MM", "%m")
              datetime_unit = "M"
          if "dd" in pattern:
              pattern = pattern.replace("dd", "%d")
              datetime_unit = "D"
          if "HH" in pattern:
              pattern = pattern.replace("HH", "%H")
              datetime_unit = "h"
          if "mm" in pattern:
              pattern = pattern.replace("mm", "%M")
              datetime_unit = "m"
          if "ss" in pattern:
              pattern = pattern.replace("ss", "%S")
              datetime_unit = "s"
          if "z" in pattern or "Z" in pattern:
              raise ValueError(
                  "Date type attributes with time zone not "
                  "supported, yet"
              )
  
          if datetime_unit is None:
              raise ValueError("Invalid or unsupported date format")
  
          return pattern, datetime_unit
      else:
          raise ValueError("Invalid or no date format")
  
imports: from __future__ import division, print_function, absolute_import
  import re
  import itertools
  import datetime
  from functools import partial
  import numpy
  from scipy._lib.six import next
label_desc: Use image node_id 7 for calling a global function with example usage: get_date_format(atrv) and returns: pattern,  datetime_unit