parameters: (self, nbunch=None)
return_statement: return bunch
docstring: PORTED FROM NETWORKX
          Returns an iterator over nodes contained in nbunch that are
          also in the graph.
          The nodes in nbunch are checked for membership in the graph
          and if not are silently ignored.
          Parameters
          ----------
          nbunch : single node, container, or all nodes (default= all nodes)
              The view will only report edges incident to these nodes.
          Returns
          -------
          niter : iterator
              An iterator over nodes in nbunch that are also in the graph.
              If nbunch is None, iterate over all nodes in the graph.
          Raises
          ------
          NetworkXError
              If nbunch is not a node or or sequence of nodes.
              If a node in nbunch is not hashable.
          See Also
          --------
          Graph.__iter__
          Notes
          -----
          When nbunch is an iterator, the returned iterator yields values
          directly from nbunch, becoming exhausted when nbunch is exhausted.
          To test whether nbunch is a single node, one can use
          "if nbunch in self:", even after processing with this routine.
          If nbunch is not a node or a (possibly empty) sequence/iterator
          or None, a :exc:`NetworkXError` is raised.  Also, if any object in
          nbunch is not hashable, a :exc:`NetworkXError` is raised.
docstring_summary: PORTED FROM NETWORKX
          Returns an iterator over nodes contained in nbunch that are
          also in the graph.
          The nodes in nbunch are checked for membership in the graph
          and if not are silently ignored.
          Parameters
          ----------
          nbunch : single node, container, or all nodes (default= all nodes)
              The view will only report edges incident to these nodes.
          Returns
          -------
          niter : iterator
              An iterator over nodes in nbunch that are also in the graph.
              If nbunch is None, iterate over all nodes in the graph.
          Raises
          ------
          NetworkXError
              If nbunch is not a node or or sequence of nodes.
              If a node in nbunch is not hashable.
          See Also
          --------
          Graph.__iter__
          Notes
          -----
          When nbunch is an iterator, the returned iterator yields values
          directly from nbunch, becoming exhausted when nbunch is exhausted.
          To test whether nbunch is a single node, one can use
          "if nbunch in self:", even after processing with this routine.
          If nbunch is not a node or a (possibly empty) sequence/iterator
          or None, a :exc:`NetworkXError` is raised.  Also, if any object in
          nbunch is not hashable, a :exc:`NetworkXError` is raised.
docstring_tokens: PORTED FROM NETWORKX Returns an iterator over nodes contained in nbunch that are also in the graph . The nodes in nbunch are checked for membership in the graph and if not are silently ignored . Parameters ---------- nbunch : single node container or all nodes ( default = all nodes ) The view will only report edges incident to these nodes . Returns ------- niter : iterator An iterator over nodes in nbunch that are also in the graph . If nbunch is None iterate over all nodes in the graph . Raises ------ NetworkXError If nbunch is not a node or or sequence of nodes . If a node in nbunch is not hashable . See Also -------- Graph . __iter__ Notes ----- When nbunch is an iterator the returned iterator yields values directly from nbunch becoming exhausted when nbunch is exhausted . To test whether nbunch is a single node one can use if nbunch in self : even after processing with this routine . If nbunch is not a node or a ( possibly empty ) sequence / iterator or None a : exc : NetworkXError is raised . Also if any object in nbunch is not hashable a : exc : NetworkXError is raised .
function: def nbunch_iter(self, nbunch=None):
          """PORTED FROM NETWORKX
          Returns an iterator over nodes contained in nbunch that are
          also in the graph.
          The nodes in nbunch are checked for membership in the graph
          and if not are silently ignored.
          Parameters
          ----------
          nbunch : single node, container, or all nodes (default= all nodes)
              The view will only report edges incident to these nodes.
          Returns
          -------
          niter : iterator
              An iterator over nodes in nbunch that are also in the graph.
              If nbunch is None, iterate over all nodes in the graph.
          Raises
          ------
          NetworkXError
              If nbunch is not a node or or sequence of nodes.
              If a node in nbunch is not hashable.
          See Also
          --------
          Graph.__iter__
          Notes
          -----
          When nbunch is an iterator, the returned iterator yields values
          directly from nbunch, becoming exhausted when nbunch is exhausted.
          To test whether nbunch is a single node, one can use
          "if nbunch in self:", even after processing with this routine.
          If nbunch is not a node or a (possibly empty) sequence/iterator
          or None, a :exc:`NetworkXError` is raised.  Also, if any object in
          nbunch is not hashable, a :exc:`NetworkXError` is raised.
          """
          if nbunch is None:
              bunch = iter(self)
          elif nbunch in self:
              bunch = iter([nbunch])
          else:
  
              def bunch_iter(nlist, adj):
                  try:
                      for n in nlist:
                          if n in adj:
                              yield n
                  except TypeError as e:
                      message = e.args[0]
                      # capture error for non-sequence/iterator nbunch.
                      if "iter" in message:
                          msg = "nbunch is not a node or a sequence of nodes."
                          raise SnapXError(msg)
                      else:
                          raise
  
              bunch = bunch_iter(nbunch, self.adj)
          return bunch
function_tokens: def nbunch_iter ( self , nbunch = None ) : if nbunch is None : bunch = iter ( self ) elif nbunch in self : bunch = iter ( [ nbunch ] ) else : def bunch_iter ( nlist , adj ) : try : for n in nlist : if n in adj : yield n except TypeError as e : message = e . args [ 0 ] # capture error for non-sequence/iterator nbunch. if "iter" in message : msg = "nbunch is not a node or a sequence of nodes." raise SnapXError ( msg ) else : raise bunch = bunch_iter ( nbunch , self . adj ) return bunch