class_docstr: Abstract class for wrapping suggesting algorithms.
  
  Custom algorithms can extend this class easily by overriding the
  `suggest` method provide generated parameters for the trials.
  
  Any subclass that implements ``__init__`` must also call the
  constructor of this class: ``super(Subclass, self).__init__(...)``.
  
  To track suggestions and their corresponding evaluations, the method
  `suggest` will be passed a trial_id, which will be used in
  subsequent notifications.
  
  Not all implementations support multi objectives.
  
  Note to Tune developers: If a new searcher is added, please update
  `air/_internal/usage.py`.
  
  Args:
      metric: The training result objective value attribute. If
          list then list of training result objective value attributes
      mode: If string One of {min, max}. If list then
          list of max and min, determines whether objective is minimizing
          or maximizing the metric attribute. Must match type of metric.
  
  .. code-block:: python
  
      class ExampleSearch(Searcher):
          def __init__(self, metric="mean_loss", mode="min", **kwargs):
              super(ExampleSearch, self).__init__(
                  metric=metric, mode=mode, **kwargs)
              self.optimizer = Optimizer()
              self.configurations = {}
  
          def suggest(self, trial_id):
              configuration = self.optimizer.query()
              self.configurations[trial_id] = configuration
  
          def on_trial_complete(self, trial_id, result, **kwargs):
              configuration = self.configurations[trial_id]
              if result and self.metric in result:
                  self.optimizer.update(configuration, result[self.metric])
  
      tuner = tune.Tuner(
          trainable_function,
          tune_config=tune.TuneConfig(
              search_alg=ExampleSearch()
          )
      )
      tuner.fit()
class_docstr_tok: ["Abstract","class","for","wrapping","suggesting","algorithms",".","Custom","algorithms","can","extend","this","class","easily","by","overriding","the","`","suggest","`","method","provide","generated","parameters","for","the","trials",".","Any","subclass","that","implements","``","__init__","``","must","also","call","the","constructor","of","this","class",":","``","super","(","Subclass",",","self",")",".__init__","(","...",")","``",".","To","track","suggestions","and","their","corresponding","evaluations",",","the","method","`","suggest","`","will","be","passed","a","trial_id",",","which","will","be","used","in","subsequent","notifications",".","Not","all","implementations","support","multi","objectives",".","Note","to","Tune","developers",":","If","a","new","searcher","is","added",",","please","update","`","air\/_internal\/usage.py","`",".","Args",":","metric",":","The","training","result","objective","value","attribute",".","If","list","then","list","of","training","result","objective","value","attributes","mode",":","If","string","One","of","{","min",",","max","}",".","If","list","then","list","of","max","and","min",",","determines","whether","objective","is","minimizing","or","maximizing","the","metric","attribute",".","Must","match","type","of","metric",".","..","code-block",":",":","python","class","ExampleSearch","(","Searcher",")",":","def","__init__","(","self",",","metric=","''","mean_loss","''",",","mode=","''","min","''",",","*","*","kwargs",")",":","super","(","ExampleSearch",",","self",")",".__init__","(","metric=metric",",","mode=mode",",","*","*","kwargs",")","self.optimizer","=","Optimizer","(",")","self.configurations","=","{","}","def","suggest","(","self",",","trial_id",")",":","configuration","=","self.optimizer.query","(",")","self.configurations","[","trial_id","]","=","configuration","def","on_trial_complete","(","self",",","trial_id",",","result",",","*","*","kwargs",")",":","configuration","=","self.configurations","[","trial_id","]","if","result","and","self.metric","in","result",":","self.optimizer.update","(","configuration",",","result","[","self.metric","]",")","tuner","=","tune.Tuner","(","trainable_function",",","tune_config=tune.TuneConfig","(","search_alg=ExampleSearch","(",")",")",")","tuner.fit","(",")"]
docstr: Notification for the completion of trial.
  
  Typically, this method is used for notifying the underlying
  optimizer of the result.
  
  Args:
      trial_id: A unique string ID for the trial.
      result: Dictionary of metrics for current training progress.
          Note that the result dict may include NaNs or
          may not include the optimization metric. It is up to the
          subclass implementation to preprocess the result to
          avoid breaking the optimization process. Upon errors, this
          may also be None.
      error: True if the training process raised an error.
docstr_tok: ["Notification","for","the","completion","of","trial",".","Typically",",","this","method","is","used","for","notifying","the","underlying","optimizer","of","the","result",".","Args",":","trial_id",":","A","unique","string","ID","for","the","trial",".","result",":","Dictionary","of","metrics","for","current","training","progress",".","Note","that","the","result","dict","may","include","NaNs","or","may","not","include","the","optimization","metric",".","It","is","up","to","the","subclass","implementation","to","preprocess","the","result","to","avoid","breaking","the","optimization","process",".","Upon","errors",",","this","may","also","be","None",".","error",":","True","if","the","training","process","raised","an","error","."]
code: def on_trial_complete(
      self,
      trial_id: str,
      result: Optional[Dict] = None,
      error: bool = False,
  ) -> None:
      """Notification for the completion of trial.
  
      Typically, this method is used for notifying the underlying
      optimizer of the result.
  
      Args:
          trial_id: A unique string ID for the trial.
          result: Dictionary of metrics for current training progress.
              Note that the result dict may include NaNs or
              may not include the optimization metric. It is up to the
              subclass implementation to preprocess the result to
              avoid breaking the optimization process. Upon errors, this
              may also be None.
          error: True if the training process raised an error.
  
      """
      raise NotImplementedError
  
imports: import copy
  import glob
  import logging
  import os
  import warnings
  from typing import Dict, Optional, List, Union, Any, TYPE_CHECKING
  from ray.air._internal.usage import tag_searcher
  from ray.tune.search.util import _set_search_properties_backwards_compatible
  from ray.util.annotations import DeveloperAPI, PublicAPI
  from ray.util.debug import log_once
label_desc: Use image node_id 4 for calling the Searcher obj's underlying member method code with example usage: obj.on_trial_complete(trial_id, result, error) without return types