code: def test_degree_functionality(graph_file):
      M = utils.read_csv_for_nx(graph_file)
      cu_M = utils.read_csv_file(graph_file)
  
      G = cugraph.Graph(directed=True)
      G.from_cudf_edgelist(
          cu_M, source="0", destination="1", edge_attr="2"
      )
  
      Gnx = nx.from_pandas_edgelist(
          M, source="0", target="1", create_using=nx.DiGraph()
      )
  
      cu_in_degree = G.in_degree().sort_values(
          by="vertex", ignore_index=True
      )
      cu_out_degree = G.out_degree().sort_values(
          by="vertex", ignore_index=True
      )
      cu_degree = G.degree().sort_values(by="vertex", ignore_index=True)
  
      cu_results = cu_degree
      cu_results["in_degree"] = cu_in_degree["degree"]
      cu_results["out_degree"] = cu_out_degree["degree"]
  
      nx_in_degree = list(Gnx.in_degree())
      nx_out_degree = list(Gnx.out_degree())
      nx_degree = list(Gnx.degree())
  
      nx_in_degree.sort(key=lambda v: v[0])
      nx_out_degree.sort(key=lambda v: v[0])
      nx_degree.sort(key=lambda v: v[0])
  
      nx_results = cudf.DataFrame()
      nx_results["vertex"] = dict(nx_degree).keys()
      nx_results["degree"] = dict(nx_degree).values()
      nx_results["in_degree"] = dict(nx_in_degree).values()
      nx_results["out_degree"] = dict(nx_out_degree).values()
  
      assert_series_equal(
          cu_results["in_degree"],
          nx_results["in_degree"],
          check_names=False,
          check_dtype=False,
      )
  
      assert_series_equal(
          cu_results["out_degree"],
          nx_results["out_degree"],
          check_names=False,
          check_dtype=False,
      )
  
      assert_series_equal(
          cu_results["degree"],
          nx_results["degree"],
          check_names=False,
          check_dtype=False,
      )
  
      # testing degrees functionality
      df = G.degrees().sort_values(by="vertex", ignore_index=True)
      assert_series_equal(
          df["in_degree"],
          nx_results["in_degree"],
          check_names=False,
          check_dtype=False,
      )
  
      assert_series_equal(
          df["out_degree"],
          nx_results["out_degree"],
          check_names=False,
          check_dtype=False,
      )
  
imports: import gc
  import time
  import pytest
  import pandas
  import scipy
  import networkx
  import cupy
  import cudf
  import cugraph
  from cugraph.testing import utils
  from cudf.testing import assert_series_equal
  from cudf.testing.testing import assert_frame_equal
  import dask_cudf
  import cugraph.dask
  from dask.distributed import Client
  from dask_cuda import LocalCUDACluster
  from pylibcugraph import ResourceHandle
  from pylibcugraph import bfs
  from cugraph.dask.traversal.bfs import convert_to_cudf
  from cugraph.dask.common.mg_utils import is_single_gpu
label_desc: Use image node_id 17 for calling a global function with example usage: test_degree_functionality(graph_file) without return types