code: def tensorflow_session():
      if hasattr(tensorflow_session, "cache"):
          session = tensorflow_session.cache
  
          if not session._closed:
              return session
  
      config = tf.ConfigProto(
          allow_soft_placement=True,
          inter_op_parallelism_threads=0,
          intra_op_parallelism_threads=0,
      )
      session = tf.Session(config=config)
  
      tensorflow_session.cache = session
      return session
  
file_path: neupy/neupy/utils/tf_utils.py
imports: from functools import wraps
  import numpy
  import tensorflow
  from neupy.utils.misc import as_tuple
  from neupy.utils.processing import asfloat
label_desc: Use image node_id 2 for calling a global function with example usage: tensorflow_session() and returns: session, session