code: def create(graph, verbose=True):
      """
      Compute the number of triangles each vertex belongs to, ignoring edge
      directions. A triangle is a complete subgraph with only three vertices.
      Return a model object with total number of triangles as well as the triangle
      counts for each vertex in the graph.
  
      Parameters
      ----------
      graph : SGraph
          The graph on which to compute triangle counts.
  
      verbose : bool, optional
          If True, print progress updates.
  
      Returns
      -------
      out : TriangleCountingModel
  
      References
      ----------
      - T. Schank. (2007) `Algorithmic Aspects of Triangle-Based Network Analysis
        <http://digbib.ubka.uni-karlsruhe.de/volltexte/documents/4541>`_.
  
      Examples
      --------
      If given an :class:`~turicreate.SGraph` ``g``, we can create a
      :class:`~turicreate.triangle_counting.TriangleCountingModel` as follows:
  
      >>> g =
      >>> turicreate.load_sgraph('http://snap.stanford.edu/data/email-Enron.txt.gz',
              >>> format='snap') tc = turicreate.triangle_counting.create(g)
  
      We can obtain the number of triangles that each vertex in the graph ``g``
      is present in:
  
      >>> tc_out = tc['triangle_count']  # SFrame
  
      We can add the new "triangle_count" field to the original graph g using:
  
      >>> g.vertices['triangle_count'] = tc['graph'].vertices['triangle_count']
  
      Note that the task above does not require a join because the vertex
      ordering is preserved through ``create()``.
  
      See Also
      --------
      TriangleCountingModel
      """
      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.triangle_counting.create(
                  {"graph": graph.__proxy__}
              )
          )
      return TriangleCountingModel(params["model"])
  
file_path: turicreate/src/python/turicreate/toolkits/graph_analytics/triangle_counting.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: TriangleCountingModel