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 : cudf.DataFrame
      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'] : cudf.Series
          The vertex IDs (will be identical to vertex_subset if
          specified).
  
      df['in_degree'] : cudf.Series
          The in-degree of the vertex.
  
      df['out_degree'] : cudf.Series
          The out-degree of the vertex.
  
  Examples
  --------
  >>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
  ...                   dtype=['int32', 'int32', 'float32'], header=None)
  >>> G = cugraph.Graph()
  >>> G.from_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",":","cudf.DataFrame","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","'","]",":","cudf.Series","The","vertex","IDs","(","will","be","identical","to","vertex_subset","if","specified",")",".","df","[","'in_degree","'","]",":","cudf.Series","The","in-degree","of","the","vertex",".","df","[","'out_degree","'","]",":","cudf.Series","The","out-degree","of","the","vertex",".","Examples","--","--","--","--",">",">",">","M","=","cudf.read_csv","(","datasets_path","\/","'karate.csv","'",",","delimiter=","'","'",",","...","dtype=","[","'int32","'",",","'int32","'",",","'float32","'","]",",","header=None",")",">",">",">","G","=","cugraph.Graph","(",")",">",">",">","G.from_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 : cudf.DataFrame
          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'] : cudf.Series
              The vertex IDs (will be identical to vertex_subset if
              specified).
  
          df['in_degree'] : cudf.Series
              The in-degree of the vertex.
  
          df['out_degree'] : cudf.Series
              The out-degree of the vertex.
  
      Examples
      --------
      >>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
      ...                   dtype=['int32', 'int32', 'float32'], header=None)
      >>> G = cugraph.Graph()
      >>> G.from_cudf_edgelist(M, '0', '1')
      >>> df = G.degrees([0,9,12])
  
      """
      (
          vertex_col,
          in_degree_col,
          out_degree_col,
      ) = graph_primtypes_wrapper._degrees(self)
  
      df = cudf.DataFrame()
      df["vertex"] = vertex_col
      df["in_degree"] = in_degree_col
      df["out_degree"] = out_degree_col
  
      if self.properties.renumbered:
          # Get the internal vertex IDs
          nodes = self.renumber_map.df_internal_to_external["id"]
      else:
          nodes = self.nodes()
      # If the vertex IDs are not contiguous, remove results for the
      # isolated vertices
      df = df[df["vertex"].isin(nodes.to_cupy())]
  
      if vertex_subset is not None:
          if not isinstance(vertex_subset, cudf.Series):
              vertex_subset = cudf.Series(vertex_subset)
              if self.properties.renumbered:
                  vertex_subset = (
                      self.renumber_map.to_internal_vertex_id(
                          vertex_subset
                      )
                  )
              vertex_subset = vertex_subset.to_cupy()
          df = df[df["vertex"].isin(vertex_subset)]
  
      if self.properties.renumbered:
          df = self.renumber_map.unrenumber(df, "vertex")
  
      return df
  
imports: from cugraph.structure import graph_primtypes_wrapper
  from cugraph.structure.graph_primtypes_wrapper import Direction
  from cugraph.structure.symmetrize import symmetrize
  from cugraph.structure.number_map import NumberMap
  import cugraph.dask.common.mg_utils
  import cudf
  import dask_cudf
  import cugraph.dask.comms.comms
  import pandas
  import numpy
  import warnings
  from cugraph.dask.structure import replication
  from typing import Union, Dict
  from pylibcugraph import get_two_hop_neighbors, select_random_vertices
  from pylibcugraph import ResourceHandle, GraphProperties, SGGraph
label_desc: Use image node_id 25 for calling the simpleGraphImpl obj's underlying member method code with example usage: obj.degrees(vertex_subset) and returns: df