code: def sched_request(
      node_type_configs: Dict[NodeType, NodeTypeConfig],
      max_num_worker_nodes: Optional[int] = None,
      resource_requests: Optional[List[ResourceRequestByCount]] = None,
      gang_resource_requests: Optional[
          List[GangResourceRequest]
      ] = None,
      cluster_resource_constraints: Optional[
          List[ClusterResourceConstraint]
      ] = None,
      current_nodes: Optional[List[NodeState]] = None,
      current_instances: Optional[List[Instance]] = None,
  ) -> SchedulingRequest:
      if resource_requests is None:
          resource_requests = []
      if gang_resource_requests is None:
          gang_resource_requests = []
      if cluster_resource_constraints is None:
          cluster_resource_constraints = []
      if current_nodes is None:
          current_nodes = []
      if current_instances is None:
          current_instances = []
  
      return SchedulingRequest(
          resource_requests=resource_requests,
          gang_resource_requests=gang_resource_requests,
          cluster_resource_constraints=cluster_resource_constraints,
          current_nodes=current_nodes,
          current_instances=current_instances,
          node_type_configs=node_type_configs,
          max_num_worker_nodes=max_num_worker_nodes,
      )
  
file_path: ray/python/ray/autoscaler/v2/tests/test_scheduler.py
imports: import os
  import sys
  from typing import Dict, List, Optional
  import pytest
  from ray.autoscaler.v2.scheduler import NodeTypeConfig, ResourceDemandScheduler, SchedulingRequest
  from ray.autoscaler.v2.schema import NodeType
  from ray.core.generated.autoscaler_pb2 import ClusterResourceConstraint, GangResourceRequest, NodeState, ResourceRequestByCount
  from ray.core.generated.instance_manager_pb2 import Instance
label_desc: Use image node_id 1 for calling a global function with example usage: sched_request(node_type_configs, max_num_worker_nodes, resource_requests, gang_resource_requests, cluster_resource_constraints, current_nodes, current_instances) and returns: SchedulingRequest