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: Pass search properties to searcher.
  
  This method acts as an alternative to instantiating search algorithms
  with their own specific search spaces. Instead they can accept a
  Tune config through this method. A searcher should return ``True``
  if setting the config was successful, or ``False`` if it was
  unsuccessful, e.g. when the search space has already been set.
  
  Args:
      metric: Metric to optimize
      mode: One of ["min", "max"]. Direction to optimize.
      config: Tune config dict.
      **spec: Any kwargs for forward compatiblity.
          Info like Experiment.PUBLIC_KEYS is provided through here.
docstr_tok: ["Pass","search","properties","to","searcher",".","This","method","acts","as","an","alternative","to","instantiating","search","algorithms","with","their","own","specific","search","spaces",".","Instead","they","can","accept","a","Tune","config","through","this","method",".","A","searcher","should","return","``","True","``","if","setting","the","config","was","successful",",","or","``","False","``","if","it","was","unsuccessful",",","e.g",".","when","the","search","space","has","already","been","set",".","Args",":","metric",":","Metric","to","optimize","mode",":","One","of","[","``","min","''",",","``","max","''","]",".","Direction","to","optimize",".","config",":","Tune","config","dict",".","*","*","spec",":","Any","kwargs","for","forward","compatiblity",".","Info","like","Experiment.PUBLIC_KEYS","is","provided","through","here","."]
code: def set_search_properties(
      self,
      metric: Optional[str],
      mode: Optional[str],
      config: Dict,
      **spec,
  ) -> bool:
      """Pass search properties to searcher.
  
      This method acts as an alternative to instantiating search algorithms
      with their own specific search spaces. Instead they can accept a
      Tune config through this method. A searcher should return ``True``
      if setting the config was successful, or ``False`` if it was
      unsuccessful, e.g. when the search space has already been set.
  
      Args:
          metric: Metric to optimize
          mode: One of ["min", "max"]. Direction to optimize.
          config: Tune config dict.
          **spec: Any kwargs for forward compatiblity.
              Info like Experiment.PUBLIC_KEYS is provided through here.
      """
      return False
  
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 2 for calling the Searcher obj's underlying member method code with example usage: obj.set_search_properties(metric, mode, config) and returns: False