code: def test_trim_request_dict():
      config = PipelineDefinitionConfig(use_custom_job_prefix=True)
      _pipeline_config = _PipelineConfig(
          pipeline_name="test",
          step_name="test-step",
          sagemaker_session=None,
          code_hash="123467890",
          config_hash="123467890",
          pipeline_build_time="some_time",
          pipeline_definition_config=config,
      )
      custom_job_prefix = "MyTrainingJobNamePrefix"
      sample_training_job_name = (
          f"{custom_job_prefix}-2023-06-22-23-39-36-766"
      )
      request_dict = {"TrainingJobName": sample_training_job_name}
      assert (
          custom_job_prefix
          == trim_request_dict(
              request_dict=request_dict,
              job_key="TrainingJobName",
              config=_pipeline_config,
          )["TrainingJobName"]
      )
      request_dict = {"TrainingJobName": custom_job_prefix}
      assert (
          custom_job_prefix
          == trim_request_dict(
              request_dict=request_dict,
              job_key="TrainingJobName",
              config=_pipeline_config,
          )["TrainingJobName"]
      )
      request_dict = {"NotSupportedJobName": custom_job_prefix}
      # noop in the case our job_key is invalid
      assert request_dict == trim_request_dict(
          request_dict=request_dict,
          job_key="NotSupportedJobName",
          config=_pipeline_config,
      )
  
imports: from __future__ import absolute_import
  import tempfile
  from sagemaker.workflow.pipeline_context import _PipelineConfig
  from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
  from sagemaker.workflow.utilities import hash_file, hash_files_or_dirs, trim_request_dict, _collect_parameters
  from pathlib import Path
  import unittest
label_desc: Use image node_id 9 for calling a global function with example usage: test_trim_request_dict() without return types