code: def get_profiles(graph, run_metadata):
      """Generate profiles in pprof format.
  
      See https://github.com/google/pprof/blob/master/proto/profile.proto
      for pprof proto format.
  
      Args:
        graph: A `Graph` object.
        run_metadata: A `RunMetadata` proto.
  
      Returns:
        A dictionary mapping from device name to pprof proto for that device.
      """
      return PprofProfiler(graph, run_metadata).profile()
  
imports: from collections import defaultdict
  from collections import namedtuple
  import gzip
  import os
  import string
  import sys
  import time
  from proto import profile_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: get_profiles(graph, run_metadata) and returns: PprofProfiler