def _prep_create_using(create_using):
 if (create_using is None):
  return nx.Graph()
 try:
  create_using.clear()
 except:
  raise TypeError('Input graph is not a networkx graph type')
 return create_using

def _prep_create_using ( create_using ) : if ( create_using is None ) : return nx . Graph ( ) try : create_using . clear ( ) except : raise TypeError ( 'Input graph is not a networkx graph type' ) return create_using
return a graph object ready to be populated .