code: def get_logical_id_to_device(
      devices: List[Device],
  ) -> Dict[int, Device]:
      """Get a mapping from device logical ID to Device object."""
      logical_id_to_device: Dict[int, Device] = {}
      for d in devices:
          logical_id_to_device[d.logical_id] = d
      return logical_id_to_device
  
imports: import operator
  from collections import deque
  from typing import Dict, List, Set, NamedTuple, Tuple, Deque
  import torch
  from torch.fx.passes.graph_manipulation import get_size_of_all_nodes
  from torch.fx.experimental.partitioner_utils import Partition, Device, PartitionerConfig, get_partition_to_latency_mapping, get_latency_of_partitioned_graph, NodeLatency, get_extra_size_of, PartitionMode
  from torch.fx.graph_module import GraphModule
  from torch.fx.node import Node, map_arg
  from torch.fx.passes.split_module import split_module
label_desc: Use image node_id 7 for calling a global function with example usage: get_logical_id_to_device(devices) and returns: logical_id_to_device