class_docstr: Action which implements and executes the form logic.
class_docstr_tok: ["Action","which","implements","and","executes","the","form","logic","."]
docstr: Extract entities for given name and optional role and group.
  
  Args:
      name: entity type (name) of interest
      tracker: the tracker
      slot_to_be_filled: Slot which is supposed to be filled by this entity.
      role: optional entity role of interest
      group: optional entity group of interest
  
  Returns:
      Value of entity.
docstr_tok: ["Extract","entities","for","given","name","and","optional","role","and","group",".","Args",":","name",":","entity","type","(","name",")","of","interest","tracker",":","the","tracker","slot_to_be_filled",":","Slot","which","is","supposed","to","be","filled","by","this","entity",".","role",":","optional","entity","role","of","interest","group",":","optional","entity","group","of","interest","Returns",":","Value","of","entity","."]
code: def get_entity_value_for_slot(
      name: Text,
      tracker: "DialogueStateTracker",
      slot_to_be_filled: Text,
      role: Optional[Text] = None,
      group: Optional[Text] = None,
  ) -> Any:
      """Extract entities for given name and optional role and group.
  
      Args:
          name: entity type (name) of interest
          tracker: the tracker
          slot_to_be_filled: Slot which is supposed to be filled by this entity.
          role: optional entity role of interest
          group: optional entity group of interest
  
      Returns:
          Value of entity.
      """
      # list is used to cover the case of list slot type
      value = list(
          tracker.get_latest_entity_values(
              name, entity_group=group, entity_role=role
          )
      )
  
      if isinstance(tracker.slots.get(slot_to_be_filled), ListSlot):
          return value
  
      if len(value) == 0:
          return None
  
      if len(value) == 1:
          return value[0]
  
      return value
  
imports: import copy
  from typing import Text, List, Optional, Union, Any, Dict, Set
  import itertools
  import logging
  import structlog
  import json
  from rasa.core.actions import action
  from rasa.core.actions.loops import LoopAction
  from rasa.core.channels import OutputChannel
  from rasa.shared.core.domain import Domain, KEY_SLOTS
  from rasa.shared.core.constants import SlotMappingType, SLOT_MAPPINGS, MAPPING_TYPE
  from rasa.core.actions.action import ActionExecutionRejection, RemoteAction
  from rasa.shared.core.constants import ACTION_EXTRACT_SLOTS, ACTION_LISTEN_NAME, REQUESTED_SLOT
  from rasa.shared.constants import UTTER_PREFIX
  from rasa.shared.core.events import Event, SlotSet, ActionExecuted, ActiveLoop, ActionExecutionRejected, Restarted
  from rasa.core.nlg import NaturalLanguageGenerator
  from rasa.shared.core.slot_mappings import SlotMapping
  from rasa.shared.core.slots import ListSlot
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.utils.endpoints import EndpointConfig
label_desc: Use image node_id 8 for calling the FormAction obj's underlying member method code with example usage: obj.get_entity_value_for_slot(name, tracker, slot_to_be_filled, role, group) and returns: value, value, None, value