docstr: Compute vertex in-degree. Vertex in-degree is the number of edges
  pointing into the vertex. 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 or dask_cudf object, iterable container,
      opt. (default=None)
      A container of vertices for displaying corresponding in-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 in_degree.
      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[degree] : dask_cudf.Series
          The computed in-degree of the corresponding 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.in_degree([0,9,12])
docstr_tok: ["Compute","vertex","in-degree",".","Vertex","in-degree","is","the","number","of","edges","pointing","into","the","vertex",".","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","or","dask_cudf","object",",","iterable","container",",","opt",".","(","default=None",")","A","container","of","vertices","for","displaying","corresponding","in-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","in_degree",".","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","[","degree","]",":","dask_cudf.Series","The","computed","in-degree","of","the","corresponding","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.in_degree","(","[","0,9,12","]",")"]
code: def in_degree(self, vertex_subset=None):
      """
      Compute vertex in-degree. Vertex in-degree is the number of edges
      pointing into the vertex. 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 or dask_cudf object, iterable container,
          opt. (default=None)
          A container of vertices for displaying corresponding in-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 in_degree.
          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[degree] : dask_cudf.Series
              The computed in-degree of the corresponding 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.in_degree([0,9,12])
  
      """
      src_col_name = self.source_columns
      dst_col_name = self.destination_columns
  
      # select only the vertex columns
      if not isinstance(src_col_name, list) and not isinstance(
          dst_col_name, list
      ):
          vertex_col_names = [src_col_name] + [dst_col_name]
  
      df = self.input_df[vertex_col_names]
      df = df.drop(columns=src_col_name)
  
      nodes = self.nodes()
      if isinstance(nodes, dask_cudf.Series):
          nodes = nodes.to_frame()
  
      if not isinstance(dst_col_name, list):
          df = df.rename(columns={dst_col_name: "vertex"})
          dst_col_name = "vertex"
  
      vertex_col_names = df.columns
      nodes.columns = vertex_col_names
  
      df["degree"] = 1
  
      # FIXME: leverage the C++ in_degree for optimal performance
      in_degree = (
          df.groupby(dst_col_name)
          .degree.count(split_out=df.npartitions)
          .reset_index()
      )
  
      # Add vertices with zero in_degree
      in_degree = nodes.merge(in_degree, how="outer").fillna(0)
  
      # Convert vertex_subset to dataframe.
      if vertex_subset is not None:
          if not isinstance(
              vertex_subset, (dask_cudf.DataFrame, cudf.DataFrame)
          ):
              if isinstance(vertex_subset, dask_cudf.Series):
                  vertex_subset = vertex_subset.to_frame()
              else:
                  df = cudf.DataFrame()
                  if isinstance(vertex_subset, (cudf.Series, list)):
                      df["vertex"] = vertex_subset
                      vertex_subset = df
          if isinstance(
              vertex_subset, (dask_cudf.DataFrame, cudf.DataFrame)
          ):
              vertex_subset.columns = vertex_col_names
              in_degree = in_degree.merge(vertex_subset, how="inner")
          else:
              raise TypeError(
                  f"Expected type are: cudf, dask_cudf objects, "
                  f"iterable container, got "
                  f"{type(vertex_subset)}"
              )
      return in_degree
  
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 11 for calling the simpleDistributedGraphImpl obj's underlying member method code with example usage: obj.in_degree(vertex_subset) and returns: in_degree