code: def _SGraphFromJsonTree(json_str):
      """
      Convert the Json Tree to SGraph
      """
      g = json.loads(json_str)
      vertices = [
          _Vertex(
              x["id"],
              dict(
                  [
                      (str(k), v)
                      for k, v in _six.iteritems(x)
                      if k != "id"
                  ]
              ),
          )
          for x in g["vertices"]
      ]
      edges = [
          _Edge(
              x["src"],
              x["dst"],
              dict(
                  [
                      (str(k), v)
                      for k, v in _six.iteritems(x)
                      if k != "src" and k != "dst"
                  ]
              ),
          )
          for x in g["edges"]
      ]
      sg = _SGraph().add_vertices(vertices)
      if len(edges) > 0:
          sg = sg.add_edges(edges)
      return sg
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from ..data_structures.sframe import SArray
  from ..data_structures.sframe import SFrame
  from ..data_structures.sgraph import SGraph
  from ..data_structures.sgraph import Vertex
  from ..data_structures.sgraph import Edge
  from .._cython.cy_sarray import UnitySArrayProxy
  from .._cython.cy_sframe import UnitySFrameProxy
  from .._cython.cy_graph import UnityGraphProxy
  from ..toolkits._main import ToolkitError
  import json
  import six
label_desc: Use image node_id 6 for calling a global function with example usage: _SGraphFromJsonTree(json_str) and returns: sg