code: def summary_function(self, file):
      # RP: every time we compile a function a ProfileStats is created for
      # that function. This means that every time a optimization replaces
      # some scan op, some orphane ProfileStats remains in the air ..
      # also even without any optimization, scan compiles a dummy function
      # that will produce a ProfileStats that will correspond to a
      # function that will never be called. Printing several empty
      # Function profiling is just extremely confusing
      if self.callcount == 0:
          return
      print("", file=file)
  
      if self.name is not None:
          print("Scan Op profiling (", self.name, ")", file=file)
      else:
          print("Scan Op profiling", file=file)
      print("==================", file=file)
      print("  Message: %s" % self.message, file=file)
  
      print(
          (
              "  Time in %i calls of the op (for a total of %i "
              "steps) %es"
              % (self.callcount, self.nbsteps, self.call_time)
          ),
          file=file,
      )
      print("", file=file)
      val = 0
      if self.call_time > 0:
          val = self.vm_call_time * 100 / self.call_time
      print(
          "  Total time spent in calling the VM %es (%.3f%%)"
          % (self.vm_call_time, val),
          file=file,
      )
      val = 100
      if self.call_time > 0:
          val = 100.0 - self.vm_call_time * 100 / self.call_time
      print(
          "  Total overhead (computing slices..) %es (%.3f%%)"
          % (self.call_time - self.vm_call_time, val),
          file=file,
      )
      print("", file=file)
  
imports: from __future__ import absolute_import, print_function, division
  import atexit
  import copy
  import logging
  import operator
  import os
  import sys
  import time
  from collections import defaultdict
  from six import iteritems
  import warnings
  import numpy
  import theano
  from theano.gof import graph
label_desc: Use image node_id 3 for calling the ScanProfileStats obj's underlying member method code with example usage: obj.summary_function(file) without return types