class_docstr: Performs sampling based on input seeds grouped into batches by
  a batch id.  Writes the output minibatches to parquet, with
  partition sizes specified by the user.  Allows controlling the
  number of input seeds per sampling function call.  Supports
  basic logging.
  
  Batches in each partition that are empty are discarded, and the remaining non-empty
  batches are renumbered to be contiguous starting from the first
  batch id in the partition.
  This means that the output batch ids may not match the input batch ids.
  See GitHub issue #3794 for more details.
class_docstr_tok: ["Performs","sampling","based","on","input","seeds","grouped","into","batches","by","a","batch","id",".","Writes","the","output","minibatches","to","parquet",",","with","partition","sizes","specified","by","the","user",".","Allows","controlling","the","number","of","input","seeds","per","sampling","function","call",".","Supports","basic","logging",".","Batches","in","each","partition","that","are","empty","are","discarded",",","and","the","remaining","non-empty","batches","are","renumbered","to","be","contiguous","starting","from","the","first","batch","id","in","the","partition",".","This","means","that","the","output","batch","ids","may","not","match","the","input","batch","ids",".","See","GitHub","issue","#","3794","for","more","details","."]
docstr: Constructs a new BulkSampler
  
  Parameters
  ----------
  batch_size: int
      The size of each batch.
  output_path: str
      The directory where results will be stored.
  graph: cugraph.Graph
      The cugraph graph to operate upon.
  seeds_per_call: int (optional, default=200,000)
      The number of seeds (start vertices) that can be processed by
      a single sampling call.
  batches_per_partition: int (optional, default=100)
      The number of batches outputted to a single parquet partition.
  renumber: bool (optional, default=False)
      Whether to renumber vertices.  Currently only supported for
      homogeneous graphs.
  log_level: int (optional, default=None)
      Whether to enable logging for this sampler. Supports 3 levels
      of logging if enabled (INFO, WARNING, ERROR).  If not provided,
      defaults to WARNING.
  kwargs: kwargs
      Keyword arguments to be passed to the sampler (i.e. fanout).
docstr_tok: ["Constructs","a","new","BulkSampler","Parameters","--","--","--","--","--","batch_size",":","int","The","size","of","each","batch",".","output_path",":","str","The","directory","where","results","will","be","stored",".","graph",":","cugraph.Graph","The","cugraph","graph","to","operate","upon",".","seeds_per_call",":","int","(","optional",",","default=200,000",")","The","number","of","seeds","(","start","vertices",")","that","can","be","processed","by","a","single","sampling","call",".","batches_per_partition",":","int","(","optional",",","default=100",")","The","number","of","batches","outputted","to","a","single","parquet","partition",".","renumber",":","bool","(","optional",",","default=False",")","Whether","to","renumber","vertices",".","Currently","only","supported","for","homogeneous","graphs",".","log_level",":","int","(","optional",",","default=None",")","Whether","to","enable","logging","for","this","sampler",".","Supports","3","levels","of","logging","if","enabled","(","INFO",",","WARNING",",","ERROR",")",".","If","not","provided",",","defaults","to","WARNING",".","kwargs",":","kwargs","Keyword","arguments","to","be","passed","to","the","sampler","(","i.e",".","fanout",")","."]
code: def __init__(
      self,
      batch_size: int,
      output_path: str,
      graph,
      seeds_per_call: int = 200_000,
      batches_per_partition: int = 100,
      renumber: bool = False,
      log_level: int = None,
      **kwargs,
  ):
      """
      Constructs a new BulkSampler
  
      Parameters
      ----------
      batch_size: int
          The size of each batch.
      output_path: str
          The directory where results will be stored.
      graph: cugraph.Graph
          The cugraph graph to operate upon.
      seeds_per_call: int (optional, default=200,000)
          The number of seeds (start vertices) that can be processed by
          a single sampling call.
      batches_per_partition: int (optional, default=100)
          The number of batches outputted to a single parquet partition.
      renumber: bool (optional, default=False)
          Whether to renumber vertices.  Currently only supported for
          homogeneous graphs.
      log_level: int (optional, default=None)
          Whether to enable logging for this sampler. Supports 3 levels
          of logging if enabled (INFO, WARNING, ERROR).  If not provided,
          defaults to WARNING.
      kwargs: kwargs
          Keyword arguments to be passed to the sampler (i.e. fanout).
      """
  
      self.__logger = logging.getLogger(__name__)
      self.__logger.setLevel(log_level or logging.WARNING)
  
      max_batches_per_partition = seeds_per_call // batch_size
      if batches_per_partition > max_batches_per_partition:
          warnings.warn(
              f"batches_per_partition ({batches_per_partition}) is >"
              f" seeds_per_call / batch size ({max_batches_per_partition})"
              "; automatically setting batches_per_partition to "
              "{max_batches_per_partition}"
          )
          batches_per_partition = max_batches_per_partition
  
      self.__batch_size = batch_size
      self.__output_path = output_path
      self.__graph = graph
      self.__seeds_per_call = seeds_per_call
      self.__batches_per_partition = batches_per_partition
      self.__renumber = renumber
      self.__batches = None
      self.__sample_call_args = kwargs
  
imports: import os
  from typing import Union
  import cudf
  import dask_cudf
  from dask.distributed import wait
  from dask.distributed import futures_of
  import cugraph
  import pylibcugraph
  from cugraph.gnn.data_loading.bulk_sampler_io import write_samples
  import warnings
  import logging
  import time
label_desc: Use image node_id 1 to create a new BulkSampler object  with example: obj = BulkSampler(batch_size, output_path, graph, seeds_per_call, batches_per_partition, renumber, log_level)