code: def maximum_spanning_tree(
      G, weight=None, algorithm="boruvka", ignore_nan=False
  ):
      """
      Returns a maximum spanning tree (MST) or forest (MSF) on an undirected
      graph. Also computes the adjacency list if G does not have one.
  
      Parameters
      ----------
      G : cuGraph.Graph or networkx.Graph
          cuGraph graph descriptor with connectivity information.
  
      weight : string
          default to the weights in the graph, if the graph edges do not have a
          weight attribute a default weight of 1 will be used.
  
      algorithm : string
          Default to 'boruvka'. The parallel algorithm to use when finding a
          maximum spanning tree.
  
      ignore_nan : bool
          Default to False
  
      Returns
      -------
      G_mst : cuGraph.Graph or networkx.Graph
          A graph descriptor with a maximum spanning tree or forest.
          The networkx graph will not have all attributes copied over
  
      Examples
      --------
      >>> from cugraph.datasets import netscience
      >>> G = netscience.get_graph(download=True)
      >>> G_mst = cugraph.maximum_spanning_tree(G)
  
      """
      G, isNx = ensure_cugraph_obj_for_nx(G)
  
      if isNx is True:
          mst = _maximum_spanning_tree_subgraph(G)
          return cugraph_to_nx(mst)
      else:
          return _maximum_spanning_tree_subgraph(G)
  
imports: from cugraph.tree import minimum_spanning_tree_wrapper
  from cugraph.structure.graph_classes import Graph
  from cugraph.utilities import ensure_cugraph_obj_for_nx, cugraph_to_nx
label_desc: Use image node_id 4 for calling a global function with example usage: maximum_spanning_tree(G, weight, algorithm, ignore_nan) and returns: cugraph_to_nx, _maximum_spanning_tree_subgraph