docstr: Compute vertex in-degree and out-degree. By default, this method
  computes vertex degrees for the entire set of vertices. If
  vertex_subset is provided, this method optionally filters out all but
  those listed in vertex_subset.
  
  Parameters
  ----------
  vertex_subset : cudf.Series or iterable container, optional
      A container of vertices for displaying corresponding degree. If not
      set, degrees are computed for the entire set of vertices.
  
  Returns
  -------
  df : dask_cudf.DataFrame
      Distributed GPU DataFrame of size N (the default) or the size of
      the given vertices (vertex_subset) containing the degrees.
      The ordering is relative to the adjacency list, or that given by
      the specified vertex_subset.
      df['vertex'] : dask_cudf.Series
          The vertex IDs (will be identical to vertex_subset if
          specified).
      df['in_degree'] : dask_cudf.Series
          The in-degree of the vertex.
      df['out_degree'] : dask_cudf.Series
          The out-degree of the vertex.
  
  Examples
  --------
  >>> M = dask_cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
  ...                   dtype=['int32', 'int32', 'float32'], header=None)
  >>> G = cugraph.Graph()
  >>> G.from_dask_cudf_edgelist(M, '0', '1')
  >>> df = G.degrees([0,9,12])
docstr_tok: ["Compute","vertex","in-degree","and","out-degree",".","By","default",",","this","method","computes","vertex","degrees","for","the","entire","set","of","vertices",".","If","vertex_subset","is","provided",",","this","method","optionally","filters","out","all","but","those","listed","in","vertex_subset",".","Parameters","--","--","--","--","--","vertex_subset",":","cudf.Series","or","iterable","container",",","optional","A","container","of","vertices","for","displaying","corresponding","degree",".","If","not","set",",","degrees","are","computed","for","the","entire","set","of","vertices",".","Returns","--","--","--","-","df",":","dask_cudf.DataFrame","Distributed","GPU","DataFrame","of","size","N","(","the","default",")","or","the","size","of","the","given","vertices","(","vertex_subset",")","containing","the","degrees",".","The","ordering","is","relative","to","the","adjacency","list",",","or","that","given","by","the","specified","vertex_subset",".","df","[","'vertex","'","]",":","dask_cudf.Series","The","vertex","IDs","(","will","be","identical","to","vertex_subset","if","specified",")",".","df","[","'in_degree","'","]",":","dask_cudf.Series","The","in-degree","of","the","vertex",".","df","[","'out_degree","'","]",":","dask_cudf.Series","The","out-degree","of","the","vertex",".","Examples","--","--","--","--",">",">",">","M","=","dask_cudf.read_csv","(","datasets_path","\/","'karate.csv","'",",","delimiter=","'","'",",","...","dtype=","[","'int32","'",",","'int32","'",",","'float32","'","]",",","header=None",")",">",">",">","G","=","cugraph.Graph","(",")",">",">",">","G.from_dask_cudf_edgelist","(","M",",","'","0","'",",","'","1","'",")",">",">",">","df","=","G.degrees","(","[","0,9,12","]",")"]
code: def degrees(self, vertex_subset=None):
      """
      Compute vertex in-degree and out-degree. By default, this method
      computes vertex degrees for the entire set of vertices. If
      vertex_subset is provided, this method optionally filters out all but
      those listed in vertex_subset.
  
      Parameters
      ----------
      vertex_subset : cudf.Series or iterable container, optional
          A container of vertices for displaying corresponding degree. If not
          set, degrees are computed for the entire set of vertices.
  
      Returns
      -------
      df : dask_cudf.DataFrame
          Distributed GPU DataFrame of size N (the default) or the size of
          the given vertices (vertex_subset) containing the degrees.
          The ordering is relative to the adjacency list, or that given by
          the specified vertex_subset.
          df['vertex'] : dask_cudf.Series
              The vertex IDs (will be identical to vertex_subset if
              specified).
          df['in_degree'] : dask_cudf.Series
              The in-degree of the vertex.
          df['out_degree'] : dask_cudf.Series
              The out-degree of the vertex.
  
      Examples
      --------
      >>> M = dask_cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
      ...                   dtype=['int32', 'int32', 'float32'], header=None)
      >>> G = cugraph.Graph()
      >>> G.from_dask_cudf_edgelist(M, '0', '1')
      >>> df = G.degrees([0,9,12])
  
      """
      raise NotImplementedError("Not supported for distributed graph")
  
imports: import gc
  from typing import Union
  import warnings
  import cudf
  import cupy
  import dask
  import dask_cudf
  from dask import delayed
  from dask.distributed import wait, default_client
  import numpy
  from pylibcugraph import MGGraph, ResourceHandle, GraphProperties, get_two_hop_neighbors, select_random_vertices
  from cugraph.structure import graph_primtypes_wrapper
  from cugraph.structure.graph_primtypes_wrapper import Direction
  from cugraph.structure.number_map import NumberMap
  from cugraph.structure.symmetrize import symmetrize
  from cugraph.dask.common.part_utils import get_persisted_df_worker_map, persist_dask_df_equal_parts_per_worker
  from cugraph.dask.common.mg_utils import run_gc_on_dask_cluster
  from cugraph.dask import get_n_workers
  import cugraph.dask.comms.comms
label_desc: Use image node_id 14 for calling the simpleDistributedGraphImpl obj's underlying member method code with example usage: obj.degrees(vertex_subset) without return types