code: def encode_sagemaker_parameters(decoded_params: dict) -> dict:
      """
      Encode a SageMaker parameters dictionary where all values are strings.
  
      Example:
  
      >>> encode_sagemaker_parameters({
      ...     "foo": [1, 2, 3],
      ...     "bar": "hello"
      ... })
      {'foo': '[1, 2, 3]', 'bar': 'hello'}
      """
      return valmap(encode_sagemaker_parameter, decoded_params)
  
file_path: gluonts/src/gluonts/shell/sagemaker/params.py
imports: from itertools import count
  from typing import Any, Union
  from toolz import valmap
  from gluonts.core.serde import dump_json, load_json
  from gluonts.itertools import batcher
label_desc: Use image node_id 4 for calling a global function with example usage: encode_sagemaker_parameters(decoded_params) and returns: valmap