code: def get_graph_nbrhd_text(train_graph, ent, max_text_len):
      """Helper to get neighbor text relations."""
      neighborhood = []
      for nbr in train_graph.kg_text_data[ent]:
          for text in train_graph.kg_text_data[ent][nbr]:
              text_edge = [nbr] + text
              text_edge = text_edge[: max_text_len + 1]
              len_to_pad = max_text_len + 1 - len(text_edge)
              if len_to_pad:
                  text_edge += [
                      train_graph.vocab[train_graph.mask_token]
                  ] * len_to_pad
              neighborhood.append(text_edge)
      if not neighborhood:
          neighborhood = [[]]
      # if train_graph.add_reverse_graph:
      #   rev_nighborhood = [nbr for nbr in train_graph.reverse_kg_data[ent]
      #                      if ent != et or nbr != es or
      #                      # er not in train_graph.reverse_kg_data[ent][nbr]]
      #                      (train_graph.reverse_kg_data[ent][nbr] - set([er]))]
      #   neighborhood += rev_nighborhood
      neighborhood = np.array(neighborhood, dtype=int)
      return neighborhood
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import clueweb_text_graph
  import numpy
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: get_graph_nbrhd_text(train_graph, ent, max_text_len) and returns: neighborhood