class_docstr: Allows constant time lookups of graphdef nodes by common properties.
class_docstr_tok: ["Allows","constant","time","lookups","of","graphdef","nodes","by","common","properties","."]
docstr: Am I really handcoding graph traversal please no
docstr_tok: ["Am","I","really","handcoding","graph","traversal","please","no"]
code: def neighborhood(self, node, degree=4):
      """Am I really handcoding graph traversal please no"""
      assert self.by_name[node.name] == node
      already_visited = frontier = set([node.name])
      for _ in range(degree):
          neighbor_names = set()
          for node_name in frontier:
              outgoing = set(n.name for n in self.by_input[node_name])
              incoming = set(self.by_name[node_name].input)
              neighbor_names |= incoming | outgoing
          frontier = neighbor_names - already_visited
          already_visited |= neighbor_names
      return [self.by_name[name] for name in already_visited]
  
imports: from __future__ import absolute_import, division, print_function
  import tensorflow
  import json
  from google.protobuf.message import DecodeError
  import logging
  import warnings
  from collections import defaultdict
  from itertools import chain
  from lucid.misc.io import load
  from lucid.misc.io.saving import ClarityJSONEncoder
label_desc: Use image node_id 2 for calling the GraphDefHelper obj's underlying member method code with example usage: obj.neighborhood(node, degree) and returns: unknown