code: def _try_parse_datetime(time_str, fmts):
      '''
      A helper function that attempts to parse the input time_str as a date.
  
      Args:
  
          time_str (str): A string representing the time
  
          fmts (list): A list of date format strings
  
      Returns:
          datetime: Returns a datetime object if parsed properly, otherwise None
      '''
      result = None
      for fmt in fmts:
          try:
              result = datetime.strptime(time_str, fmt)
              break
          except ValueError:
              pass
      return resulf _try_parse_datetime(time_str, fmts):
      '''
      A helper function that attempts to parse the input time_str as a date.
  
      Args:
  
          time_str (str): A string representing the time
  
          fmts (list): A list of date format strings
  
      Returns:
          datetime: Returns a datetime object if parsed properly, otherwise None
      '''
      result = None
      for fmt in fmts:
          try:
              result = datetime.strptime(time_str, fmt)
              break
          except ValueError:
              pass
      return result
docs: A helper function that attempts to parse the input time_str as a date.
  
      Args:
  
          time_str (str): A string representing the time
  
          fmts (list): A list of date format strings
  
      Returns:
          datetime: Returns a datetime object if parsed properly, otherwise None