code: def analyze_feature_to_dictionary(
      to_process: FeatureToProcess,
  ) -> dict:
      # start = time.perf_counter()
  
      # Validation: Make sure the targets are the same length as the series
      if (
          to_process.source_target is not None
          and to_process.source is not None
      ):
          if len(to_process.source_target) != len(to_process.source):
              raise ValueError
      if (
          to_process.compare_target is not None
          and to_process.compare is not None
      ):
          if len(to_process.compare_target) != len(to_process.compare):
              raise ValueError
  
      # Initialize some dictionary values
      returned_feature_dict = dict()
      returned_feature_dict["name"] = to_process.source.name
      returned_feature_dict["order_index"] = to_process.order
      returned_feature_dict["is_target"] = (
          True if to_process.order == -1 else False
      )
  
      # Determine SOURCE feature type
      to_process.source_counts = get_counts(to_process.source)
      returned_feature_dict["type"] = determine_feature_type(
          to_process.source,
          to_process.source_counts,
          to_process.predetermined_type,
          "SOURCE",
      )
      source_type = returned_feature_dict["type"]
  
      # Determine COMPARED feature type & initialize
      compare_dict = None
      if to_process.compare is not None:
          to_process.compare_counts = get_counts(to_process.compare)
          compare_type = determine_feature_type(
              to_process.compare,
              to_process.compare_counts,
              returned_feature_dict["type"],
              "COMPARED",
          )
          if (
              compare_type != FeatureType.TYPE_ALL_NAN
              and source_type != FeatureType.TYPE_ALL_NAN
          ):
              # Explicitly show missing categories on each set
              if (
                  compare_type == FeatureType.TYPE_CAT
                  or compare_type == FeatureType.TYPE_BOOL
              ):
                  fill_out_missing_counts_in_other_series(
                      to_process.compare_counts,
                      to_process.source_counts,
                  )
                  fill_out_missing_counts_in_other_series(
                      to_process.source_counts,
                      to_process.compare_counts,
                  )
          returned_feature_dict["compare"] = dict()
          compare_dict = returned_feature_dict["compare"]
          compare_dict["type"] = compare_type
  
      # Settle all-NaN series, depending on source versus compared
      if to_process.compare is not None:
          # Settle all-Nan WITH COMPARE: Must consider all cases between source and compare
          if (
              compare_type == FeatureType.TYPE_ALL_NAN
              and source_type == FeatureType.TYPE_ALL_NAN
          ):
              returned_feature_dict["type"] = FeatureType.TYPE_TEXT
              compare_dict["type"] = FeatureType.TYPE_TEXT
          elif compare_type == FeatureType.TYPE_ALL_NAN:
              compare_dict["type"] = source_type
          elif source_type == FeatureType.TYPE_ALL_NAN:
              returned_feature_dict["type"] = compare_type
      else:
          # Settle all-Nan WITHOUT COMPARE ( trivial: consider as TEXT )
          if source_type == FeatureType.TYPE_ALL_NAN:
              returned_feature_dict["type"] = FeatureType.TYPE_TEXT
  
      # Establish base stats
      add_series_base_stats_to_dict(
          to_process.source,
          to_process.source_counts,
          returned_feature_dict,
      )
      if to_process.compare is not None:
          add_series_base_stats_to_dict(
              to_process.compare,
              to_process.compare_counts,
              compare_dict,
          )
  
      # Perform full analysis on source/compare/target
      if returned_feature_dict["type"] == FeatureType.TYPE_NUM:
          sweetviz.series_analyzer_numeric.analyze(
              to_process, returned_feature_dict
          )
      elif returned_feature_dict["type"] == FeatureType.TYPE_CAT:
          sweetviz.series_analyzer_cat.analyze(
              to_process, returned_feature_dict
          )
      elif returned_feature_dict["type"] == FeatureType.TYPE_BOOL:
          sweetviz.series_analyzer_cat.analyze(
              to_process, returned_feature_dict
          )
      elif returned_feature_dict["type"] == FeatureType.TYPE_TEXT:
          sweetviz.series_analyzer_text.analyze(
              to_process, returned_feature_dict
          )
      else:
          raise ValueError
  
      # print(f"{to_process.source.name} PROCESSED ------> "
      #       f" {time.perf_counter() - start}")
  
      return returned_feature_dict
  
file_path: sweetviz/sweetviz/series_analyzer.py
imports: import pandas
  from sweetviz.sv_types import NumWithPercent, FeatureType, FeatureToProcess
  from sweetviz.type_detection import determine_feature_type
  import sweetviz.series_analyzer_numeric
  import sweetviz.series_analyzer_cat
  import sweetviz.series_analyzer_text
  from distutils.version import LooseVersion
label_desc: Use image node_id 4 for calling a global function with example usage: analyze_feature_to_dictionary(to_process) and returns: returned_feature_dict