code: def get_layer_by_name(name_or_scope):
      """get_layer.
  
      Retrieve the output tensor of a layer with the given name or scope.
  
      Arguments:
          name_or_scope: `str`. The name (or scope) given to the layer to
              retrieve.
  
      Returns:
          A Tensor.
  
      """
      # Track output tensor.
      c = tf.get_collection(
          tf.GraphKeys.LAYER_TENSOR + "/" + name_or_scope
      )
      if len(c) == 0:
          raise Exception("No layer found for this name.")
      if len(c) > 1:
          return c
      return c[0]
  
imports: from __future__ import division, print_function, absolute_import
  import six
  import string
  import random
  import numpy
  import tensorflow.compat.v1
  from tensorflow.python import pywrap_tensorflow
  import tflearn.variables
label_desc: Use image node_id 2 for calling a global function with example usage: get_layer_by_name(name_or_scope) and returns: c, c