class_docstr: Efficient basic implementation of nx `Graph' â€“ Undirected graphs with self loops
class_docstr_tok: ["Efficient","basic","implementation","of","nx","`","Graph","'","\u00e2\u20ac","\u201c","Undirected","graphs","with","self","loops"]
code: def subgraph(self, nodes={}):
      subgraph = Graph()
  
      for n in nodes:
          if n in self:
              subgraph[n] = [x for x in self[n] if x in nodes]
  
      return subgraph
  
imports: import logging
  import sys
  from io import open
  from os import path
  from time import time
  from glob import glob
  from six.moves import range, zip, zip_longest
  from six import iterkeys
  from collections import defaultdict, Iterable
  import random
  from random import shuffle
  from itertools import product, permutations
  from scipy.io import loadmat
  from scipy.sparse import issparse
label_desc: Use image node_id 4 for calling the Graph obj's underlying member method code with example usage: obj.subgraph(nodes) and returns: subgraph