code: def test_clone_to(self, _) -> None:
      experiment = get_experiment()
      experiment.status_quo = None
      batch = experiment.new_batch_trial(
          ttl_seconds=123, trial_type="foo"
      )
      arms = get_arms()
      weights = get_weights()
      status_quo = arms[0]
      arms = arms[1:]
      weights = weights[1:]
      batch.add_arms_and_weights(arms=arms, weights=weights)
      batch.update_run_metadata(metadata={"foo": "bar"})
      batch.update_stop_metadata(metadata={"bar": "baz"})
  
      # cloning the trial and attached it to the same experiment
      new_batch_trial_0 = batch.clone_to()
      # cloning the trial and attached it to a new experiment
      new_experiment = get_experiment()
      new_experiment.status_quo = None
      batch.clone_to(new_experiment)
      new_batch_trial_1 = checked_cast(
          BatchTrial, new_experiment.trials[0]
      )
  
      self.assertEqual(new_batch_trial_0.index, 1)
      # Set index to original trial's value for equality check.
      new_batch_trial_0._index = batch.index
      self.assertEqual(new_batch_trial_0, batch)
      self.assertEqual(new_batch_trial_1, batch)
  
      # make sure modifying the cloned batch trial does not affect original one
      new_batch_trial_1.add_arm(
          Arm(
              name="new_arm",
              parameters={"w": 2.6, "x": 2, "y": "baz", "z": True},
          )
      )
      self.assertEqual(len(new_batch_trial_1.arms), 3)
      self.assertEqual(len(batch.arms), 2)
  
      # cloning a trial that has status quo arm
      status_quo = Arm(
          name="status_quo",
          parameters={"w": 0.0, "x": 1, "y": "foo", "z": True},
      )
      batch.set_status_quo_and_optimize_power(status_quo)
      new_batch_trial = batch.clone_to()
      self.assertEqual(new_batch_trial.index, 2)
      # Set index to original trial's value for equality check.
      new_batch_trial._index = batch.index
      self.assertEqual(new_batch_trial, batch)
  
imports: import math
  from time import sleep
  from unittest import mock
  from unittest.mock import patch, PropertyMock
  import numpy
  from ax.core.arm import Arm
  from ax.core.base_trial import TrialStatus
  from ax.core.batch_trial import BatchTrial, GeneratorRunStruct
  from ax.core.experiment import Experiment
  from ax.core.generator_run import GeneratorRun, GeneratorRunType
  from ax.core.parameter import FixedParameter, ParameterType
  from ax.core.search_space import SearchSpace
  from ax.runners.synthetic import SyntheticRunner
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast
  from ax.utils.testing.core_stubs import get_abandoned_arm, get_arm, get_arm_weights1, get_arms, get_experiment, get_generator_run, get_generator_run2, get_weights
label_desc: Use image node_id 18 for calling the BatchTrialTest obj's underlying member method code with example usage: obj.test_clone_to(_) without return types