docstr: Creates a SamplingCreateRequest
  
  First, it checks how many samples are already labeled by
      getting the number of samples in the preselected_tag_id.
  Then the stopping_condition.n_samples
      is set to be the number of already labeled samples + the selection_config.batch_size.
  Last the SamplingCreateRequest is created with the necessary nested class instances.
docstr_tok: ["Creates","a","SamplingCreateRequest","First",",","it","checks","how","many","samples","are","already","labeled","by","getting","the","number","of","samples","in","the","preselected_tag_id",".","Then","the","stopping_condition.n_samples","is","set","to","be","the","number","of","already","labeled","samples","+","the","selection_config.batch_size",".","Last","the","SamplingCreateRequest","is","created","with","the","necessary","nested","class","instances","."]
code: def _create_selection_create_request(
      self,
      selection_config: SelectionConfig,
      preselected_tag_id: Optional[str],
      query_tag_id: Optional[str],
  ) -> SamplingCreateRequest:
      """Creates a SamplingCreateRequest
  
      First, it checks how many samples are already labeled by
          getting the number of samples in the preselected_tag_id.
      Then the stopping_condition.n_samples
          is set to be the number of already labeled samples + the selection_config.batch_size.
      Last the SamplingCreateRequest is created with the necessary nested class instances.
  
      """
  
      sampling_config = SamplingConfig(
          stopping_condition=SamplingConfigStoppingCondition(
              n_samples=selection_config.n_samples,
              min_distance=selection_config.min_distance,
          )
      )
      sampling_create_request = SamplingCreateRequest(
          new_tag_name=selection_config.name,
          method=selection_config.method,
          config=sampling_config,
          preselected_tag_id=preselected_tag_id,
          query_tag_id=query_tag_id,
      )
      return sampling_create_request
  
file_path: lightly/lightly/api/api_workflow_selection.py
imports: import time
  import warnings
  from typing import Dict, List, Optional, Union
  import numpy
  from numpy.typing import NDArray
  from lightly.active_learning.config.selection_config import SelectionConfig
  from lightly.openapi_generated.swagger_client.models import ActiveLearningScoreCreateRequest, JobState, JobStatusData, SamplingConfig, SamplingConfigStoppingCondition, SamplingCreateRequest, TagData
label_desc: Use image node_id 3 for calling the _SelectionMixin obj's underlying member method code with example usage: obj._create_selection_create_request(selection_config, preselected_tag_id, query_tag_id) and returns: sampling_create_request