class_docstr: TriggerContext is a utility for handling Trigger invocations. It can be reused by setting the
  key and window fields. No internal state must be kept in the TriggerContext.
class_docstr_tok: ["TriggerContext","is","a","utility","for","handling","Trigger","invocations",".","It","can","be","reused","by","setting","the","key","and","window","fields",".","No","internal","state","must","be","kept","in","the","TriggerContext","."]
code: def get_partitioned_state(
      self, state_descriptor: StateDescriptor
  ) -> State:
      if isinstance(state_descriptor, ValueStateDescriptor):
          state = self._state_backend.get_value_state(
              state_descriptor.name,
              from_type_info(state_descriptor.type_info),
          )
      elif isinstance(state_descriptor, ListStateDescriptor):
          array_coder = from_type_info(
              state_descriptor.type_info
          )  # type: GenericArrayCoder
          state = self._state_backend.get_list_state(
              state_descriptor.name, array_coder._elem_coder
          )
      elif isinstance(state_descriptor, MapStateDescriptor):
          map_coder = from_type_info(
              state_descriptor.type_info
          )  # type: MapCoder
          key_coder = map_coder._key_coder
          value_coder = map_coder._value_coder
          state = self._state_backend.get_map_state(
              state_descriptor.name, key_coder, value_coder
          )
      else:
          raise Exception(
              "Unknown supported StateDescriptor %s" % state_descriptor
          )
      state.set_current_namespace(self.window)
      return state
  
imports: from abc import ABC, abstractmethod
  from typing import Generic, TypeVar, List, Iterable
  from pyflink.common.constants import MAX_LONG_VALUE
  from pyflink.datastream.state import StateDescriptor, State, ValueStateDescriptor, ListStateDescriptor, MapStateDescriptor
  from pyflink.datastream.window import TimeWindow, CountWindow
  from pyflink.fn_execution.datastream.process.timerservice_impl import LegacyInternalTimerServiceImpl
  from pyflink.fn_execution.coders import from_type_info, MapCoder, GenericArrayCoder
  from pyflink.fn_execution.internal_state import InternalMergingState
label_desc: Use image node_id 14 for calling the TriggerContext obj's underlying member method code with example usage: obj.get_partitioned_state(state_descriptor) and returns: state