class_docstr: A Spark RDD counterpart.
  
  PrivateRDD guarantees that only data that has been aggregated 
  in a DP manner, using no more than the specified privacy 
  budget, can be extracted from it through its API.
  
  PrivateRDD keeps a `privacy_id` for each element
  in order to guarantee correct DP computations.
docstr: Computes a collection of partition keys in a DP manner.
  
  Args:
      select_partitions_params: parameters for calculation
      partition_extractor: function for extracting partition key from each input element
docstr_tok: ["Computes","a","collection","of","partition","keys","in","a","DP","manner",".","Args",":","select_partitions_params",":","parameters","for","calculation","partition_extractor",":","function","for","extracting","partition","key","from","each","input","element"]
code: def select_partitions(
      self,
      select_partitions_params: aggregate_params.SelectPartitionsParams,
      partition_extractor: Callable,
  ) -> RDD:
      """Computes a collection of partition keys in a DP manner.
  
      Args:
          select_partitions_params: parameters for calculation
          partition_extractor: function for extracting partition key from each input element
      """
  
      backend = pipeline_dp.SparkRDDBackend(self._rdd.context)
      dp_engine = pipeline_dp.DPEngine(self._budget_accountant, backend)
  
      params = pipeline_dp.SelectPartitionsParams(
          max_partitions_contributed=select_partitions_params.max_partitions_contributed
      )
  
      data_extractors = pipeline_dp.DataExtractors(
          partition_extractor=lambda x: partition_extractor(x[1]),
          privacy_id_extractor=lambda x: x[0],
      )
  
      return dp_engine.select_partitions(
          self._rdd, params, data_extractors
      )
  
file_path: pipelinedp/pipeline_dp/private_spark.py
imports: from pyspark import RDD
  from typing import Callable, Optional
  import pipeline_dp
  from pipeline_dp import aggregate_params, budget_accounting
label_desc: Use image node_id 9 for calling the PrivateRDD obj's underlying member method code with example usage: obj.select_partitions(select_partitions_params, partition_extractor) and returns: dp_engine