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: Queries the algorithm to retrieve the next set of parameters.
  
  Arguments:
      trial_id: Trial ID used for subsequent notifications.
  
  Returns:
      dict | FINISHED | None: Configuration for a trial, if possible.
          If FINISHED is returned, Tune will be notified that
          no more suggestions/configurations will be provided.
          If None is returned, Tune will skip the querying of the
          searcher for this step.
docstr_tok: ["Queries","the","algorithm","to","retrieve","the","next","set","of","parameters",".","Arguments",":","trial_id",":","Trial","ID","used","for","subsequent","notifications",".","Returns",":","dict","|","FINISHED","|","None",":","Configuration","for","a","trial",",","if","possible",".","If","FINISHED","is","returned",",","Tune","will","be","notified","that","no","more","suggestions\/configurations","will","be","provided",".","If","None","is","returned",",","Tune","will","skip","the","querying","of","the","searcher","for","this","step","."]
code: def suggest(self, trial_id: str) -> Optional[Dict]:
      """Queries the algorithm to retrieve the next set of parameters.
  
      Arguments:
          trial_id: Trial ID used for subsequent notifications.
  
      Returns:
          dict | FINISHED | None: Configuration for a trial, if possible.
              If FINISHED is returned, Tune will be notified that
              no more suggestions/configurations will be provided.
              If None is returned, Tune will skip the querying of the
              searcher for this step.
  
      """
      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 5 for calling the Searcher obj's underlying member method code with example usage: obj.suggest(trial_id) without return types