code: def __init__(
      self,
      task_dict: dict,
      rng: Union[int, np.random.RandomState],
      task_to_num_examples_dict: dict,
      temperature: float,
      examples_cap: Optional[int],
  ):
      super().__init__(task_dict=task_dict, rng=rng)
      assert task_dict.keys() == task_to_num_examples_dict.keys()
      self.task_to_num_examples_dict = task_to_num_examples_dict
      self.temperature = temperature
      self.examples_cap = examples_cap
      self.task_names = list(task_to_num_examples_dict.keys())
      self.task_num_examples = np.array(
          [task_to_num_examples_dict[k] for k in self.task_names]
      )
      raw_n = self.task_num_examples.clip(max=examples_cap) ** (
          1 / self.temperature
      )
      self.task_p = raw_n / raw_n.sum()
  
imports: import abc
  import numexpr
  import numpy
  from typing import Union, Optional, Dict
label_desc: Use image node_id 1 to create a new TemperatureMultiTaskSampler object from inherited base classes: BaseMultiTaskSampler with example: obj = TemperatureMultiTaskSampler(task_dict, rng, task_to_num_examples_dict, temperature, examples_cap)