class_docstr: Base class for ask and tell optimizer derived from implementations with no ask and tell interface.
  The underlying optimizer implementation is a function which is supposed to call directly the function
  to optimize. It is tricked into optimizing a "fake" function in a thread:
  - calls to the fake functions are returned by the "ask()" interface
  - return values of the fake functions are provided to the thread when calling "tell(x, value)"
  
  Note
  ----
  These implementations are not necessarily robust. More specifically, one cannot "tell" any
  point which was not "asked" before.
  
  An optimization is performed by a third-party library in a background thread. This communicates
  with the main thread using two queue objects. Specifically:
  
      messages_ask is filled by the background thread with a candidate (or batch of candidates)
      it wants evaluated for, or None if the background thread is over, or an Exception
      which needs to be raised to the user.
  
      messages_tell supplies the background thread with a value to return from the fake function.
      A value of None means the background thread is no longer relevant and should exit.
class_docstr_tok: ["Base","class","for","ask","and","tell","optimizer","derived","from","implementations","with","no","ask","and","tell","interface",".","The","underlying","optimizer","implementation","is","a","function","which","is","supposed","to","call","directly","the","function","to","optimize",".","It","is","tricked","into","optimizing","a","``","fake","''","function","in","a","thread",":","-","calls","to","the","fake","functions","are","returned","by","the","``","ask","(",")","''","interface","-","return","values","of","the","fake","functions","are","provided","to","the","thread","when","calling","``","tell","(","x",",","value",")","''","Note","--","--","These","implementations","are","not","necessarily","robust",".","More","specifically",",","one","can","not","``","tell","''","any","point","which","was","not","``","asked","''","before",".","An","optimization","is","performed","by","a","third-party","library","in","a","background","thread",".","This","communicates","with","the","main","thread","using","two","queue","objects",".","Specifically",":","messages_ask","is","filled","by","the","background","thread","with","a","candidate","(","or","batch","of","candidates",")","it","wants","evaluated","for",",","or","None","if","the","background","thread","is","over",",","or","an","Exception","which","needs","to","be","raised","to","the","user",".","messages_tell","supplies","the","background","thread","with","a","value","to","return","from","the","fake","function",".","A","value","of","None","means","the","background","thread","is","no","longer","relevant","and","should","exit","."]
docstr: Return an optimization procedure function (taking a function to optimize as input)
  
  Note
  ----
  This optimization procedure must be a function or an object which is completely
  independent from self, otherwise deletion of the optimizer may hang indefinitely.
docstr_tok: ["Return","an","optimization","procedure","function","(","taking","a","function","to","optimize","as","input",")","Note","--","--","This","optimization","procedure","must","be","a","function","or","an","object","which","is","completely","independent","from","self",",","otherwise","deletion","of","the","optimizer","may","hang","indefinitely","."]
code: def get_optimization_function(
      self,
  ) -> tp.Callable[
      [tp.Callable[..., tp.Any]], tp.Optional[tp.ArrayLike]
  ]:
      """Return an optimization procedure function (taking a function to optimize as input)
  
      Note
      ----
      This optimization procedure must be a function or an object which is completely
      independent from self, otherwise deletion of the optimizer may hang indefinitely.
      """
      raise NotImplementedError(
          "You should define your optimizer! Also, be very careful to avoid "
          " reference to this instance in the returned object"
      )
  
imports: import warnings
  import threading
  import queue
  import numpy
  import nevergrad.common.typing
  from nevergrad.common.errors import NevergradError
  from nevergrad.parametrization import parameter
  from .None import base
  from .base import IntOrParameter
label_desc: Use image node_id 2 for calling the RecastOptimizer obj's underlying member method code with example usage: obj.get_optimization_function() without return types