code: def print_global_stats():
      """
      Print the following stats:
        -- Time elapsed since Theano was imported
        -- Time spent inside Theano functions
        -- Time spent in compiling Theano functions
             -- on graph optimization
             -- on linker
      """
  
      if config.profiling.destination == "stderr":
          destination_file = sys.stderr
      elif config.profiling.destination == "stdout":
          destination_file = sys.stdout
      else:
          destination_file = open(config.profiling.destination, "w")
  
      print("=" * 50, file=destination_file)
      print(
          "Global stats: ",
          "Time elasped since Theano import = %6.3fs, "
          "Time spent in Theano functions = %6.3fs, "
          "Time spent compiling Theano functions: "
          " optimzation = %6.3fs, linker = %6.3fs "
          % (
              time.time() - theano_imported_time,
              total_fct_exec_time,
              total_graph_opt_time,
              total_time_linker,
          ),
          file=destination_file,
      )
      print("=" * 50, file=destination_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 2 for calling a global function with example usage: print_global_stats() without return types