class_docstr: This analyzer class analyzes datetime data and generates key stats for values fed into it
docstr: Args:
      resolution_list:
  
  Returns:
code: def get_statistics(
      self, resolution_list: Optional[List[str]] = None
  ) -> DatetimeStats:
      """
  
      Args:
          resolution_list:
  
      Returns:
  
      """
      if resolution_list is None:
          resolution_list = [
              DatetimeResolution.YEAR,
              DatetimeResolution.MONTH,
          ]
      resolution_list = sorted(resolution_list)
      _time_df = DataFrame.from_records(self._time_records)
  
      group_count_dict = _time_df.groupby(by=resolution_list).groups
  
      frequency_count = dict()
      group_dict = frequency_count
      for groups, index in group_count_dict.items():
          if len(groups) != len(resolution_list):
              raise InconsistentSize(
                  column_A="group title",
                  column_B="time resolution",
                  length_A=len(groups),
                  length_B=len(resolution_list),
              )
          for group in groups[:-1]:
              if group not in group_dict.keys():
                  group_dict[group] = dict()
              group_dict = group_dict[group]
          group_dict[groups[-1]] = len(index)
          group_dict = frequency_count
  
      stats = DatetimeStats(
          frequency_count=frequency_count,
          resolution_list=resolution_list,
      )
      return stats
  
file_path: contextual-ai/xai/data/explorer/datetime/datetime_analyzer.py
imports: import dateutil
  from pandas import DataFrame
  from typing import List, Optional
  from xai.data.constants import DatetimeResolution
  from xai.data.exceptions import ItemDataTypeNotSupported, InconsistentSize
  from xai.data.explorer.abstract_analyzer import AbstractDataAnalyzer
  from xai.data.explorer.datetime.datetime_stats import DatetimeStats
label_desc: Use image node_id 3 for calling the DatetimeDataAnalyzer obj's underlying member method code with example usage: obj.get_statistics(resolution_list) and returns: stats