def from_networkx(G):
	Gdest = None
	if type(G) == networkx.DiGraph:
		Gdest = DiGraph()
	elif type(G) == networkx.Graph:
		Gdest = Graph()
	else:
		raise Exception, 'Unable to convert graph object type %s' % str(type(G))
	
	# add nodes	
	for n,nd in G.nodes_iter(data=True):
		Gdest.add_node(n,nd)
		
	# add edges
	for x,y,ed in G.edges_iter(data=True):
		Gdest.add_edge(x,y,ed)
		
	return Gdest
Return a queryset of all instances of this model for which the given user has
dataset/ETHPy150Open networkdynamics/zenlib/src/zen/nx.py/from_networkx--crossover with--dataset/ETHPy150Open torchbox/wagtail/wagtail/wagtailcore/permission_policies/base.py/BasePermissionPolicy.instances_user_has_permission_for