code: def sanitize_df(df):
      # Using a sampling method to identify dates for efficiency with
      # large datasets
      if len(df) > 100:
          indexes = random.sample(range(0, len(df) - 1), 100)
      elif len(df) > 1:
          indexes = range(0, len(df) - 1)
      else:
          indexes = [
              0,
          ]
  
      for column in df.columns:
          is_date = False
          for index in indexes:
              value = df[column].iloc[index]
              if not isinstance(value, string_types):
                  continue
  
              # TODO: assuming that the date is at least daily
              exp = re.compile(r"^\d{4}-\d{2}-\d{2}.*$")
              matches = exp.findall(value)
  
              if matches:
                  is_date = True
                  break
  
          if is_date:
              df[column] = pd.to_datetime(df[column])
  
      return df
  
file_path: catalyst/catalyst/marketplace/utils/bundle_utils.py
imports: import os
  import random
  import re
  import shutil
  import bcolz
  import numpy
  import pandas
  from six import string_types
label_desc: Use image node_id 2 for calling a global function with example usage: sanitize_df(df) and returns: df