class_docstr: Represents an entry in database/trials collection.
  
  Attributes
  ----------
  experiment: str
     Unique identifier for the experiment that produced this trial.
     Same as an `Experiment._id`.
  id_override: str
      Trial id returned by the database. It should be unique for a given
      set of parameters
  heartbeat: datetime.datetime
      Last time trial was identified as being alive.
  status: str
     Indicates how this trial is currently being used. Can take the following
     values:
  
     * 'new' : Denotes a fresh set of parameters suggested by an algorithm,
        not yet tried out.
     * 'reserved' : Indicates that this trial is currently being evaluated by
        a worker process, it was a 'new' trial that got selected.
     * 'suspended' : Means that an algorithm decided to stop the evaluation of
        a 'reserved' trial prematurely.
     * 'completed' : is the status of a previously 'reserved' trial that
        successfully got evaluated. `Trial.results` must contain the evaluation.
     * 'interrupted' : Indicates trials that are stopped from being evaluated
        by external *actors* (e.g. cluster timeout, KeyboardInterrupt, killing
        of the worker process).
     * 'broken' : Indicates a trial that was not successfully evaluated for not
        expected reason.
  worker: str
     Corresponds to worker's unique id that handled this trial.
  submit_time: `datetime.datetime`
     When was this trial suggested?
  start_time: `datetime.datetime`
     When was this trial first reserved?
  end_time: `datetime.datetime`
     When was this trial evaluated successfully?
  results: list of `Trial.Result`
     List of evaluated metrics for this particular set of params. One and only
     one of them is necessarily an *objective* function value. The other are
     *constraints*, the value of an expression desired to be larger/equal to 0.
  params: dict of params
     Dict of suggested values for the `Experiment` parameter space.
     Consists a sample to be evaluated.
class_docstr_tok: ["Represents","an","entry","in","database\/trials","collection",".","Attributes","--","--","--","--","--","experiment",":","str","Unique","identifier","for","the","experiment","that","produced","this","trial",".","Same","as","an","`","Experiment._id","`",".","id_override",":","str","Trial","id","returned","by","the","database",".","It","should","be","unique","for","a","given","set","of","parameters","heartbeat",":","datetime.datetime","Last","time","trial","was","identified","as","being","alive",".","status",":","str","Indicates","how","this","trial","is","currently","being","used",".","Can","take","the","following","values",":","*","'new","'",":","Denotes","a","fresh","set","of","parameters","suggested","by","an","algorithm",",","not","yet","tried","out",".","*","'reserved","'",":","Indicates","that","this","trial","is","currently","being","evaluated","by","a","worker","process",",","it","was","a","'new","'","trial","that","got","selected",".","*","'suspended","'",":","Means","that","an","algorithm","decided","to","stop","the","evaluation","of","a","'reserved","'","trial","prematurely",".","*","'completed","'",":","is","the","status","of","a","previously","'reserved","'","trial","that","successfully","got","evaluated",".","`","Trial.results","`","must","contain","the","evaluation",".","*","'interrupted","'",":","Indicates","trials","that","are","stopped","from","being","evaluated","by","external","*","actors","*","(","e.g",".","cluster","timeout",",","KeyboardInterrupt",",","killing","of","the","worker","process",")",".","*","'broken","'",":","Indicates","a","trial","that","was","not","successfully","evaluated","for","not","expected","reason",".","worker",":","str","Corresponds","to","worker","'s","unique","id","that","handled","this","trial",".","submit_time",":","`","datetime.datetime","`","When","was","this","trial","suggested","?","start_time",":","`","datetime.datetime","`","When","was","this","trial","first","reserved","?","end_time",":","`","datetime.datetime","`","When","was","this","trial","evaluated","successfully","?","results",":","list","of","`","Trial.Result","`","List","of","evaluated","metrics","for","this","particular","set","of","params",".","One","and","only","one","of","them","is","necessarily","an","*","objective","*","function","value",".","The","other","are","*","constraints","*",",","the","value","of","an","expression","desired","to","be","larger\/equal","to","0.","params",":","dict","of","params","Dict","of","suggested","values","for","the","`","Experiment","`","parameter","space",".","Consists","a","sample","to","be","evaluated","."]
docstr: Copy the trial and modify given attributes
  
  The status attributes will be reset as if trial was new.
  
  Parameters
  ----------
  status: str, optional
      The status of the new trial. Defaults to 'new'.
  params: dict, optional
      Some parameters to update. A subset of params may be passed. Passing
      non-existing params in current trial will lead to a ValueError.
      Defaults to `None`.
  
  Raises
  ------
  ValueError
      If some parameters are not present in current trial.
  AttributeError
      If some attribute does not exist in Trial objects.
code: def branch(self, status="new", params=None):
      """Copy the trial and modify given attributes
  
      The status attributes will be reset as if trial was new.
  
      Parameters
      ----------
      status: str, optional
          The status of the new trial. Defaults to 'new'.
      params: dict, optional
          Some parameters to update. A subset of params may be passed. Passing
          non-existing params in current trial will lead to a ValueError.
          Defaults to `None`.
  
      Raises
      ------
      ValueError
          If some parameters are not present in current trial.
      AttributeError
          If some attribute does not exist in Trial objects.
      """
      if params is None:
          params = {}
  
      params = copy.deepcopy(params)
  
      config_params = []
      for param in self._params:
          config_param = param.to_dict()
          if param.name in params:
              config_param["value"] = params.pop(param.name)
          config_params.append(config_param)
  
      if params:
          raise ValueError(
              f"Some parameters are not part of base trial: {params}"
          )
  
      return Trial(
          experiment=self.experiment,
          status=status,
          params=config_params,
          parent=self.id,
          exp_working_dir=self.exp_working_dir,
      )
  
imports: from __future__ import annotations
  import copy
  import hashlib
  import logging
  import os
  import warnings
  from datetime import timedelta
  from orion.core.utils.exceptions import InvalidResult
  from orion.core.utils.flatten import unflatten
label_desc: Use image node_id 3 for calling the Trial obj's underlying member method code with example usage: obj.branch(status, params) and returns: Trial