docstr: Generate time series cohorts based on time series ID columns.
docstr_tok: ["Generate","time","series","cohorts","based","on","time","series","ID","columns","."]
code: def _generate_time_series_cohorts(self):
      """Generate time series cohorts based on time series ID columns."""
      cohort_list = []
      ts_id_cols = (
          self._analysis._feature_metadata.time_series_id_features
      )
      all_time_series = (
          self._analysis.test[ts_id_cols].value_counts().index
      )
      for time_series_id_values in all_time_series:
          column_value_combinations = zip(
              ts_id_cols, time_series_id_values
          )
          id_columns_name_value_mapping = []
          filters = []
          for col, val in column_value_combinations:
              id_columns_name_value_mapping.append(f"{col} = {val}")
              filters.append(
                  CohortFilter(
                      method=CohortFilterMethods.METHOD_INCLUDES,
                      arg=[val],
                      column=col,
                  )
              )
          time_series = Cohort(", ".join(id_columns_name_value_mapping))
          for filter in filters:
              time_series.add_cohort_filter(filter)
          cohort_list.append(time_series)
      return cohort_list
  
imports: import traceback
  from typing import List, Optional
  import numpy
  import pandas
  from erroranalysis._internal.constants import display_name_to_metric
  from raiutils.cohort import Cohort, CohortFilter, CohortFilterMethods
  from raiutils.data_processing import convert_to_list, serialize_json_safe
  from raiutils.exceptions import UserConfigValidationException
  from raiutils.models import ModelTask, is_classifier
  from raiwidgets.constants import ErrorMessages
  from raiwidgets.error_handling import _format_exception
  from raiwidgets.interfaces import WidgetRequestResponseConstants
  from responsibleai import RAIInsights
  from responsibleai._internal.constants import ManagerNames
label_desc: Use image node_id 2 for calling the ResponsibleAIDashboardInput obj's underlying member method code with example usage: obj._generate_time_series_cohorts() and returns: cohort_list