parameters: (cls, origin_graph, nodeset, graph_name)
return_statement: return subgraph
docstring: create a subgraph from nodeset belong to origin graph
docstring_summary: create a subgraph from nodeset belong to origin graph
docstring_tokens: create a subgraph from nodeset belong to origin graph
function: def create_subgraph_from_nodeset(cls, origin_graph, nodeset, graph_name):
      """
      create a subgraph from nodeset belong to origin graph
  
      """
      sorted_nodeset = origin_graph.top_sort_nodeset(nodeset)
      subgraph = cls(graph_name)
      for node in sorted_nodeset:
        subgraph.add_node(node)
  
      return subgraph
function_tokens: def create_subgraph_from_nodeset ( cls , origin_graph , nodeset , graph_name ) : sorted_nodeset = origin_graph . top_sort_nodeset ( nodeset ) subgraph = cls ( graph_name ) for node in sorted_nodeset : subgraph . add_node ( node ) return subgraph