class_docstr: Resolving AutoDist DeviceSpec to TensorFlow DeviceSpec given a cluster.
code: def _get_address_to_tasks(cluster):
      d = defaultdict(list)
      for job_name, tasks in cluster.cluster_spec.items():
          for task_index, full_address in enumerate(tasks):
              address = full_address.split(":")[0]
              d[address].append(dict(job=job_name, task=task_index))
      return d
  
file_path: autodist/autodist/kernel/device/resolver.py
imports: from collections import defaultdict
  from google.protobuf.pyext._message import RepeatedScalarContainer
  from tensorflow.python.framework import device_spec
  from autodist.resource_spec import DeviceSpec
label_desc: Use image node_id 2 for calling the DeviceResolver obj's underlying member method code with example usage: obj._get_address_to_tasks(cluster) and returns: d