code: def infer_date_time_format(list_dates):
      """
      This is a generic algorithm that can infer date and time formats by checking repeatedly against a list.
      Make sure you give it a list of datetime formats since there can be many formats in a list.
      You can take the first of the returned list of formats or the majority or whatever you wish.
      # THE DATE FORMATS tested so far by this algorithm are:
          # 19JAN1990
          # JAN191990
          # 19/jan/1990
          # jan/19/1990
          # Jan 19, 1990
          # January 19, 1990
          # Jan 19,1990
          # 01/19/1990
          # 01/19/90
          # 1990
          # Jan 1990
          # January1990
          # YOU CAN ADD MORE FORMATS above IN THE "fmts" section.
      """
  
      date_time_fmts = []
      try:
          for each_datetime in list_dates:
              date1 = is_date(each_datetime)
              if date1 and not date1 in date_time_fmts:
                  date_time_fmts.append(date1)
              else:
                  date2 = is_time(each_datetime)
                  if date2 and not date2 in date_time_fmts:
                      date_time_fmts.append(date2)
                  else:
                      date3 = is_date_and_time(each_datetime)
                      if date3 and not date3 in date_time_fmts:
                          date_time_fmts.append(date3)
              if not date1 and not date2 and not date3:
                  print(
                      "date time format cannot be inferred. Please check input and try again."
                  )
      except:
          print("Error in inferring date time format. Returning...")
      return date_time_fmts
  
imports: from typing import List
  import numpy
  import pandas
  import copy
  import pdb
  from sklearn.model_selection import TimeSeriesSplit
  import dask
  import dask.dataframe
  import datetime
  from datetime import datetime, date, time
label_desc: Use image node_id 13 for calling a global function with example usage: infer_date_time_format(list_dates) and returns: date_time_fmts