code: def list_local_logical_devices(device_type):
      """Returns a list of local logial devices."""
  
      # When coordinator service is enabled, list_logical_devices returns
      # a global list.
      devices = tf_config.list_logical_devices(device_type)
  
      def is_local(device):
          spec = tf_device.DeviceSpec.from_string(device.name)
          if spec.job is None or spec.job == "localhost":
              return True
          elif (
              spec.job == config.job_name()
              and spec.task == config.client_id()
          ):
              return True
          return False
  
      return [d for d in devices if is_local(d)]
  
imports: import collections
  import copy
  import itertools
  import json
  import os
  import typing
  from absl import flags
  from absl.testing import parameterized
  import numpy
  from tensorflow.dtensor.python import accelerator_util
  from tensorflow.dtensor.python import api
  from tensorflow.dtensor.python import config
  from tensorflow.dtensor.python import layout
  from tensorflow.dtensor.python import numpy_util
  from tensorflow.dtensor.python.config import is_gpu_present
  from tensorflow.dtensor.python.config import is_tpu_present
  from tensorflow.dtensor.python.config import preferred_device_type
  from tensorflow.dtensor.python.config import use_multi_device_mode
  from tensorflow.dtensor.python.tests import test_backend_util
  from tensorflow.dtensor.python.tests.test_backend_name import DTENSOR_TEST_UTIL_BACKEND
  from tensorflow.dtensor.python.tests.test_backend_name import DTensorTestUtilBackend
  from tensorflow.dtensor.python.tests.test_backend_util import DTensorTestBackendConfigurator
  from tensorflow.python.compat import v2_compat
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import device
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 7 for calling a global function with example usage: list_local_logical_devices(device_type) and returns: unknown, False, True, True