code: def list_to_request(
      entities: Sequence[Union[Entity, "StepCollection"]]
  ) -> List[RequestType]:
      """Get the request structure for list of entities.
  
      Args:
          entities (Sequence[Entity]): A list of entities.
      Returns:
          list: A request structure for a workflow service call.
      """
      from sagemaker.workflow.step_collections import StepCollection
  
      request_dicts = []
      for entity in entities:
          if isinstance(entity, Entity):
              request_dicts.append(entity.to_request())
          elif isinstance(entity, StepCollection):
              request_dicts.extend(entity.request_dicts())
      return request_dicts
  
imports: from __future__ import absolute_import
  import inspect
  import logging
  from functools import wraps
  from pathlib import Path
  from typing import List, Sequence, Union, Set, TYPE_CHECKING, Optional
  import hashlib
  from urllib.parse import unquote, urlparse
  from contextlib import contextmanager
  from _hashlib import HASH
  from sagemaker.utils import base_from_name
  from sagemaker.workflow.parameters import Parameter
  from sagemaker.workflow.pipeline_context import _StepArguments, _PipelineConfig
  from sagemaker.workflow.entities import Entity, RequestType
  from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
label_desc: Use image node_id 1 for calling a global function with example usage: list_to_request(entities) and returns: request_dicts