code: def create(graph, verbose=True):
      """
      Compute the number of weakly connected components in the graph. Return a
      model object with total number of weakly connected components as well as the
      component ID for each vertex in the graph.
  
      Parameters
      ----------
      graph : SGraph
          The graph on which to compute the triangle counts.
  
      verbose : bool, optional
          If True, print progress updates.
  
      Returns
      -------
      out : ConnectedComponentsModel
  
      References
      ----------
      - `Mathworld Wolfram - Weakly Connected Component
        <http://mathworld.wolfram.com/WeaklyConnectedComponent.html>`_
  
      Examples
      --------
      If given an :class:`~turicreate.SGraph` ``g``, we can create
      a :class:`~turicreate.connected_components.ConnectedComponentsModel` as
      follows:
  
      >>> g = turicreate.load_sgraph('http://snap.stanford.edu/data/email-Enron.txt.gz', format='snap')
      >>> cc = turicreate.connected_components.create(g)
      >>> cc.summary()
  
      We can obtain the ``component id`` corresponding to each vertex in the
      graph ``g`` as follows:
  
      >>> cc_ids = cc['component_id']  # SFrame
  
      We can obtain a graph with additional information about the ``component
      id`` corresponding to each vertex as follows:
  
      >>> cc_graph = cc['graph']      # SGraph
  
      We can add the new component_id field to the original graph g using:
  
      >>> g.vertices['component_id'] = cc['graph'].vertices['component_id']
  
      Note that the task above does not require a join because the vertex
      ordering is preserved through ``create()``.
  
  
      See Also
      --------
      ConnectedComponentsModel
      """
      from turicreate._cython.cy_server import QuietProgress
  
      if not isinstance(graph, _SGraph):
          raise TypeError('"graph" input must be a SGraph object.')
  
      with QuietProgress(verbose):
          params = _tc.extensions._toolkits.graph.connected_components.create(
              {"graph": graph.__proxy__}
          )
      return ConnectedComponentsModel(params["model"])
  
file_path: turicreate/src/python/turicreate/toolkits/graph_analytics/connected_components.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate
  from turicreate.data_structures.sgraph import SGraph
  from turicreate.toolkits.graph_analytics._model_base import GraphAnalyticsModel
label_desc: Use image node_id 1 for calling a global function with example usage: create(graph, verbose) and returns: ConnectedComponentsModel