code: def _node_as_neighbor(example, neighbor_id, edge_weight):
      """Returns a `tf.train.Example` containing neighbor features."""
      result = tf.train.Example()
      nbr_prefix = "NL_nbr_{}_".format(neighbor_id)
  
      # Add the edge weight value as a new singleton float feature.
      weight_feature = nbr_prefix + "weight"
      result.features.feature[weight_feature].float_list.value.append(
          edge_weight
      )
  
      # Copy each of the neighbor Example's features, prefixed with 'nbr_prefix'.
      for feature_name, feature_val in example.features.feature.items():
          new_feature = result.features.feature[
              nbr_prefix + feature_name
          ]
          new_feature.CopyFrom(feature_val)
      return result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import absltest
  from neural_structured_learning.tools import graph_utils
  from neural_structured_learning.tools import pack_nbrs
  import tensorflow
  from google.protobuf import text_format
label_desc: Use image node_id 6 for calling a global function with example usage: _node_as_neighbor(example, neighbor_id, edge_weight) and returns: result