docstr: Compute current values.
  
  Args:
      current_values: The preliminary current values.
      possible_values: All possible values.
      prefer_with: Function determining which values to prefer as default.
  
  Returns:
      A list
docstr_tok: ["Compute","current","values",".","Args",":","current_values",":","The","preliminary","current","values",".","possible_values",":","All","possible","values",".","prefer_with",":","Function","determining","which","values","to","prefer","as","default",".","Returns",":","A","list"]
code: def _compute_current_values(
      current_values: List[str],
      possible_values: List[str],
      prefer_with: Optional[Callable[[str], bool]] = None,
  ) -> List[str]:
      """
      Compute current values.
  
      Args:
          current_values: The preliminary current values.
          possible_values: All possible values.
          prefer_with: Function determining which values to prefer as default.
  
      Returns:
          A list
      """
      if len(possible_values) == 0:
          return [""]
  
      # allow only values which are in the possible values
      current_values = list(
          filter(lambda value: value in possible_values, current_values)
      )
  
      if len(current_values) == 0:
          # if the values are empty, take all the values where `prefer_with` is true
          for c in possible_values:
              if prefer_with is not None and prefer_with(c):
                  current_values.append(c)
  
          # if they are still empty, just take the first possible value
          if len(current_values) == 0:
              current_values = [possible_values[0]]
  
      return current_values
  
imports: import os
  from abc import abstractmethod
  from dataclasses import dataclass
  from typing import Any, Callable, List, Optional, Sequence, Set, Tuple, Union
  from llm_studio.src.nesting import Dependency
label_desc: Use image node_id 2 for calling the DatasetValue obj's underlying member method code with example usage: obj._compute_current_values(current_values, possible_values, prefer_with) and returns: current_values, list