code: def batched_ego_graphs(
      G, seeds, radius=1, center=True, undirected=None, distance=None
  ):
      """
      Compute the induced subgraph of neighbors for each node in seeds
      within a given radius.
  
      Parameters
      ----------
      G : cugraph.Graph, networkx.Graph, CuPy or SciPy sparse matrix
          Graph or matrix object, which should contain the connectivity
          information. Edge weights, if present, should be single or double
          precision floating point values.
  
      seeds : cudf.Series or list or cudf.DataFrame
          Specifies the seeds of the induced egonet subgraphs.
  
      radius: integer, optional (default=1)
          Include all neighbors of distance<=radius from n.
  
      center: bool, optional
          Defaults to True. False is not supported
  
      undirected: bool, optional
          Defaults to False. True is not supported
  
      distance: key, optional (default=None)
          Distances are counted in hops from n. Other cases are not supported.
  
      Returns
      -------
      ego_edge_lists : cudf.DataFrame or pandas.DataFrame
          GPU data frame containing all induced sources identifiers,
          destination identifiers, edge weights
      seeds_offsets: cudf.Series
          Series containing the starting offset in the returned edge list
          for each seed.
  
      Examples
      --------
      >>> from cugraph.datasets import karate
      >>> G = karate.get_graph(download=True)
      >>> b_ego_graph, offsets = cugraph.batched_ego_graphs(G, seeds=[1,5],
      ...                                                   radius=2)
  
      """
  
      (G, input_type) = ensure_cugraph_obj(G, nx_weight_attr="weight")
  
      if seeds is not None:
          if isinstance(seeds, int):
              seeds = [seeds]
          if isinstance(seeds, list):
              seeds = cudf.Series(seeds)
  
          if G.renumbered is True:
              if isinstance(seeds, cudf.DataFrame):
                  seeds = G.lookup_internal_vertex_id(
                      seeds, seeds.columns
                  )
              else:
                  seeds = G.lookup_internal_vertex_id(seeds)
  
      # Match the seed to the vertex dtype
      seeds_type = G.edgelist.edgelist_df["src"].dtype
      seeds = seeds.astype(seeds_type)
  
      do_expensive_check = False
      source, destination, weight, offset = pylibcugraph_ego_graph(
          resource_handle=ResourceHandle(),
          graph=G._plc_graph,
          source_vertices=seeds,
          radius=radius,
          do_expensive_check=do_expensive_check,
      )
  
      offsets = cudf.Series(offset)
  
      df = cudf.DataFrame()
      df["src"] = source
      df["dst"] = destination
      df["weight"] = weight
  
      if G.renumbered:
          df = G.unrenumber(df, "src", preserve_order=True)
          df = G.unrenumber(df, "dst", preserve_order=True)
  
      return _convert_df_series_to_output_type(df, offsets, input_type)
  
file_path: cugraph/python/cugraph/cugraph/community/egonet.py
imports: from cugraph.utilities import ensure_cugraph_obj, is_nx_graph_type
  from cugraph.utilities import cugraph_to_nx
  import cudf
  from pylibcugraph import ego_graph
  from pylibcugraph import ResourceHandle
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: batched_ego_graphs(G, seeds, radius, center, undirected, distance) and returns: _convert_df_series_to_output_type