code: def degree(G, nbunch=None, weight=None):
      """Returns a degree view of single node or of nbunch of nodes.
      If nbunch is omitted, then return degrees of *all* nodes.
  
      This function wraps the :func:`G.degree <networkx.Graph.degree>` property.
      """
      return G.degree(nbunch, weight)
  
imports: from collections import Counter
  from itertools import chain
  import networkx
  from networkx.utils import not_implemented_for, pairwise
label_desc: Use image node_id 3 for calling a global function with example usage: degree(G, nbunch, weight) and returns: G