class_docstr: HalfCheetah Environment with two diff tasks, moving forwards or backwards
  
  Direction is defined as a scalar: +1.0 (forwards) or -1.0 (backwards)
class_docstr_tok: ["HalfCheetah","Environment","with","two","diff","tasks",",","moving","forwards","or","backwards","Direction","is","defined","as","a","scalar",":","+1.0","(","forwards",")","or","-1.0","(","backwards",")"]
code: def sample_tasks(self, n_tasks):
      # For fwd/bwd env, goal direc is backwards if - 1.0, forwards if + 1.0
      return np.random.choice((-1.0, 1.0), (n_tasks,))
  
file_path: ray/python/ray/rllib/examples/env/halfcheetah_rand_direc.py
imports: from gymnasium.envs.mujoco.mujoco_env import MujocoEnv
  from gymnasium.utils import EzPickle
  import numpy
  from ray.rllib.env.apis.task_settable_env import TaskSettableEnv
label_desc: Use image node_id 2 for calling the HalfCheetahRandDirecEnv obj's underlying member method code with example usage: obj.sample_tasks(n_tasks) and returns: np