code: def testMultipleDevices(self):
      node1 = step_stats_pb2.NodeExecStats(
          node_name="Add/123",
          op_start_rel_micros=3,
          op_end_rel_micros=5,
          all_end_rel_micros=3,
      )
  
      run_metadata = config_pb2.RunMetadata()
      device1 = run_metadata.step_stats.dev_stats.add()
      device1.device = "deviceA"
      device1.node_stats.extend([node1])
  
      device2 = run_metadata.step_stats.dev_stats.add()
      device2.device = "deviceB"
      device2.node_stats.extend([node1])
  
      graph = test.mock.MagicMock()
      op = test.mock.MagicMock()
      op.name = "Add/123"
      op.traceback = [("a/b/file1", 10, "some_var")]
      op.type = "abc"
      graph.get_operations.return_value = [op]
  
      prof_analyzer = profile_analyzer_cli.ProfileAnalyzer(
          graph, run_metadata
      )
      prof_output = prof_analyzer.list_profile([]).lines
  
      _assert_at_least_one_line_matches(
          r"Device 1 of 2: deviceA", prof_output
      )
      _assert_at_least_one_line_matches(
          r"Device 2 of 2: deviceB", prof_output
      )
  
      # Try filtering by device.
      prof_output = prof_analyzer.list_profile(["-d", "deviceB"]).lines
      _assert_at_least_one_line_matches(
          r"Device 2 of 2: deviceB", prof_output
      )
      _assert_no_lines_match(r"Device 1 of 2: deviceA", prof_output)
  
imports: import re
  from tensorflow.core.framework import step_stats_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.debug.cli import debugger_cli_common
  from tensorflow.python.debug.cli import profile_analyzer_cli
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import googletest
  from tensorflow.python.platform import test
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 3 for calling the ProfileAnalyzerListProfileTest obj's underlying member method code with example usage: obj.testMultipleDevices() without return types