code: def make_session(num_cpu=None, make_default=False, graph=None):
      """
      Returns a session that will use <num_cpu> CPU's only
  
      :param num_cpu: (int) number of CPUs to use for TensorFlow
      :param make_default: (bool) if this should return an InteractiveSession or a normal Session
      :param graph: (TensorFlow Graph) the graph of the session
      :return: (TensorFlow session)
      """
      if num_cpu is None:
          num_cpu = int(
              os.getenv("RCALL_NUM_CPU", multiprocessing.cpu_count())
          )
      tf_config = tf.ConfigProto(
          allow_soft_placement=True,
          inter_op_parallelism_threads=num_cpu,
          intra_op_parallelism_threads=num_cpu,
      )
      # Prevent tensorflow from taking all the gpu memory
      tf_config.gpu_options.allow_growth = True
      if make_default:
          return tf.InteractiveSession(config=tf_config, graph=graph)
      else:
          return tf.Session(config=tf_config, graph=graph)
  
imports: import os
  import collections
  import functools
  import multiprocessing
  from typing import Set
  import numpy
  import tensorflow
label_desc: Use image node_id 12 for calling a global function with example usage: make_session(num_cpu, make_default, graph) and returns: tf, tf