code: def get_string_from_layer_name(
      all_layers, current_layer, full_layer_name
  ):
      layer_name, auxiliary_output = split_layer_name(full_layer_name)
      for layer in all_layers:
          if layer is current_layer:
              break
  
          # The following if-statement is needed to handle the case where the
          # layer is an 'existing' layer, derived from an existing trained
          # neural network supplied via the --existing-model option, that we are
          # adding layers to.  In this case the name of the layer will actually
          # be of the form xxx.yyy, e.g. 'tdnn1.affine'.
          # The code path will also be taken for regular (non-'existing') layer
          # names where the 'auxiliary_output' field is not used, which is actually
          # the normal case (e.g. when 'full_layer_name' is 'lstm1',
          # as opposed to, say, 'lstm1.c'
          if layer.get_name() == full_layer_name:
              return layer.output_name()
  
          if layer.get_name() == layer_name:
              if (
                  not auxiliary_output in layer.auxiliary_outputs()
                  and auxiliary_output is not None
              ):
                  raise RuntimeError(
                      "Layer '{0}' has no such auxiliary output: "
                      "'{1}' ({0}.{1})".format(
                          layer_name, auxiliary_output
                      )
                  )
              return layer.output_name(auxiliary_output)
      # No such layer was found.
      if layer_name in [layer.get_name() for layer in all_layers]:
          raise RuntimeError(
              "Layer '{0}' was requested before it appeared in "
              "the xconfig file (circular dependencies or out-of-order "
              "layers".format(layer_name)
          )
      else:
          raise RuntimeError("No such layer: '{0}'".format(layer_name))
  
imports: from __future__ import print_function
  from __future__ import division
  import re
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: get_string_from_layer_name(all_layers, current_layer, full_layer_name) and returns: layer, layer