code: def _get_input_embedder(
      spaces: SpacesDefinition,
      input_name: str,
      embedder_params: InputEmbedderParameters,
  ) -> ModuleType:
      """
      Given an input embedder parameters class, creates the input embedder and returns it
      :param input_name: the name of the input to the embedder (used for retrieving the shape). The input should
                         be a value within the state or the action.
      :param embedder_params: the parameters of the class of the embedder
      :return: the embedder instance
      """
      allowed_inputs = copy.copy(spaces.state.sub_spaces)
      allowed_inputs["action"] = copy.copy(spaces.action)
      allowed_inputs["goal"] = copy.copy(spaces.goal)
  
      if input_name not in allowed_inputs.keys():
          raise ValueError(
              "The key for the input embedder ({}) must match one of the following keys: {}".format(
                  input_name, allowed_inputs.keys()
              )
          )
  
      type = "vector"
      if isinstance(allowed_inputs[input_name], TensorObservationSpace):
          type = "tensor"
      elif isinstance(
          allowed_inputs[input_name], PlanarMapsObservationSpace
      ):
          type = "image"
  
      def sanitize_params(params: InputEmbedderParameters):
          params_copy = _sanitize_activation(params)
          # params_copy.input_rescaling = params_copy.input_rescaling[type]
          # params_copy.input_offset = params_copy.input_offset[type]
          params_copy.name = input_name
          return params_copy
  
      embedder_params = sanitize_params(embedder_params)
      if type == "vector":
          module = VectorEmbedder(embedder_params)
      elif type == "image":
          module = ImageEmbedder(embedder_params)
      elif type == "tensor":
          module = TensorEmbedder(embedder_params)
      else:
          raise KeyError("Unsupported embedder type: {}".format(type))
      return module
  
imports: import copy
  from itertools import chain
  from typing import List, Tuple, Union
  from types import ModuleType
  import numpy
  import mxnet
  from mxnet import nd, sym
  from mxnet.gluon import HybridBlock
  from mxnet.ndarray import NDArray
  from mxnet.symbol import Symbol
  from rl_coach.base_parameters import NetworkParameters
  from rl_coach.architectures.embedder_parameters import InputEmbedderParameters
  from rl_coach.architectures.head_parameters import HeadParameters, PPOHeadParameters
  from rl_coach.architectures.head_parameters import PPOVHeadParameters, VHeadParameters, QHeadParameters
  from rl_coach.architectures.middleware_parameters import MiddlewareParameters
  from rl_coach.architectures.middleware_parameters import FCMiddlewareParameters, LSTMMiddlewareParameters
  from rl_coach.architectures.mxnet_components.architecture import MxnetArchitecture
  from rl_coach.architectures.mxnet_components.embedders import ImageEmbedder, TensorEmbedder, VectorEmbedder
  from rl_coach.architectures.mxnet_components.heads import Head, HeadLoss, PPOHead, PPOVHead, VHead, QHead
  from rl_coach.architectures.mxnet_components.middlewares import FCMiddleware, LSTMMiddleware
  from rl_coach.architectures.mxnet_components import utils
  from rl_coach.base_parameters import AgentParameters, Device, DeviceType, EmbeddingMergerType
  from rl_coach.spaces import SpacesDefinition, PlanarMapsObservationSpace, TensorObservationSpace
label_desc: Use image node_id 3 for calling a global function with example usage: _get_input_embedder(spaces, input_name, embedder_params) and returns: module, params_copy