code: def test_degree_count(self):
      if "degree_count" in get_unity().list_toolkit_functions():
          m = tc.degree_counting.create(self.graph)
          m.summary()
          self.__test_model_save_load_helper__(m)
  
          g = m.graph
          expected_out_deg = g.edges.groupby(
              "__src_id", {"expected": tc.aggregate.COUNT}
          )
          expected_out_deg = expected_out_deg.join(
              g.vertices[["__id"]], on={"__src_id": "__id"}, how="right"
          ).fillna("expected", 0)
          expected_out_deg = expected_out_deg.sort("__src_id")[
              "expected"
          ]
          expected_in_deg = g.edges.groupby(
              "__dst_id", {"expected": tc.aggregate.COUNT}
          )
          expected_in_deg = expected_in_deg.join(
              g.vertices[["__id"]], on={"__dst_id": "__id"}, how="right"
          ).fillna("expected", 0)
          expected_in_deg = expected_in_deg.sort("__dst_id")["expected"]
  
          sf = g.vertices.sort("__id")
          actual_out_deg = sf["out_degree"]
          actual_in_deg = sf["in_degree"]
          actual_all_deg = sf["total_degree"]
          self.assertEqual((expected_in_deg - actual_in_deg).sum(), 0)
          self.assertEqual((expected_out_deg - actual_out_deg).sum(), 0)
          self.assertEqual(
              (actual_all_deg - (actual_out_deg + actual_in_deg)).sum(),
              0,
          )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from .None import util
  import unittest
  import pandas
  from pandas.util.testing import assert_frame_equal
  import turicreate
  from turicreate._connect.main import get_unity
  from turicreate.toolkits._main import ToolkitError
  from turicreate.data_structures.sgraph import SGraph
  from turicreate.data_structures.sframe import SFrame
  import sys
label_desc: Use image node_id 3 for calling the GraphAnalyticsTest obj's underlying member method code with example usage: obj.test_degree_count() without return types