def make_small_graph(graph_description, create_using=None):
 ltype = graph_description[0]
 name = graph_description[1]
 n = graph_description[2]
 G = empty_graph(n, create_using)
 nodes = G.nodes()
 if (ltype == 'adjacencylist'):
  adjlist = graph_description[3]
  if (len(adjlist) != n):
   raise NetworkXError('invalid graph_description')
  G.add_edges_from([((u - 1), v) for v in nodes for u in adjlist[v]])
 elif (ltype == 'edgelist'):
  edgelist = graph_description[3]
  for e in edgelist:
   v1 = (e[0] - 1)
   v2 = (e[1] - 1)
   if ((v1 < 0) or (v1 > (n - 1)) or (v2 < 0) or (v2 > (n - 1))):
    raise NetworkXError('invalid graph_description')
   else:
    G.add_edge(v1, v2)
 G.name = name
 return G

def make_small_graph ( graph_description , create_using = None ) : ltype = graph_description [ 0 ] name = graph_description [ 1 ] n = graph_description [ 2 ] G = empty_graph ( n , create_using ) nodes = G . nodes ( ) if ( ltype == 'adjacencylist' ) : adjlist = graph_description [ 3 ] if ( len ( adjlist ) != n ) : raise NetworkXError ( 'invalid graph_description' ) G . add_edges_from ( [ ( ( u - 1 ) , v ) for v in nodes for u in adjlist [ v ] ] ) elif ( ltype == 'edgelist' ) : edgelist = graph_description [ 3 ] for e in edgelist : v1 = ( e [ 0 ] - 1 ) v2 = ( e [ 1 ] - 1 ) if ( ( v1 < 0 ) or ( v1 > ( n - 1 ) ) or ( v2 < 0 ) or ( v2 > ( n - 1 ) ) ) : raise NetworkXError ( 'invalid graph_description' ) else : G . add_edge ( v1 , v2 ) G . name = name return G
return the small graph described by graph_description .