class_docstr: Code callout directive with annotations for Sphinx.
  
  Use this `callout` directive by wrapping either `code-block` or `literalinclude`
  directives. Each line that's supposed to be equipped with an annotation should
  have an inline comment of the form "# <x>" where x is an integer.
  
  Afterwards use the `annotations` directive to add annotations to the previously
  defined code labels ("<x>") by using the syntax "<x> my annotation" to produce an
  annotation "my annotation" for x.
  Note that annotation lines have to be separated by a new line, i.e.
  
  .. annotations::
  
      <1> First comment followed by a newline,
  
      <2> second comment after the newline.
  
  
  Usage example:
  -------------
  
  .. callout::
  
      .. code-block:: python
  
          from ray import tune
          from ray.tune.search.hyperopt import HyperOptSearch
          import keras
  
          def objective(config):  # <1>
              ...
  
          search_space = {"activation": tune.choice(["relu", "tanh"])}  # <2>
          algo = HyperOptSearch()
  
          tuner = tune.Tuner(  # <3>
              ...
          )
          results = tuner.fit()
  
      .. annotations::
  
          <1> Wrap a Keras model in an objective function.
  
          <2> Define a search space and initialize the search algorithm.
  
          <3> Start a Tune run that maximizes accuracy.
class_docstr_tok: ["Code","callout","directive","with","annotations","for","Sphinx",".","Use","this","`","callout","`","directive","by","wrapping","either","`","code-block","`","or","`","literalinclude","`","directives",".","Each","line","that","'s","supposed","to","be","equipped","with","an","annotation","should","have","an","inline","comment","of","the","form","``","#","<","x",">","''","where","x","is","an","integer",".","Afterwards","use","the","`","annotations","`","directive","to","add","annotations","to","the","previously","defined","code","labels","(","``","<","x",">","''",")","by","using","the","syntax","``","<","x",">","my","annotation","''","to","produce","an","annotation","``","my","annotation","''","for","x",".","Note","that","annotation","lines","have","to","be","separated","by","a","new","line",",","i.e",".","..","annotations",":",":","<","1",">","First","comment","followed","by","a","newline",",","<","2",">","second","comment","after","the","newline",".","Usage","example",":","--","--","--","--","--","--","-","..","callout",":",":","..","code-block",":",":","python","from","ray","import","tune","from","ray.tune.search.hyperopt","import","HyperOptSearch","import","keras","def","objective","(","config",")",":","#","<","1",">","...","search_space","=","{","``","activation","''",":","tune.choice","(","[","``","relu","''",",","``","tanh","''","]",")","}","#","<","2",">","algo","=","HyperOptSearch","(",")","tuner","=","tune.Tuner","(","#","<","3",">","...",")","results","=","tuner.fit","(",")","..","annotations",":",":","<","1",">","Wrap","a","Keras","model","in","an","objective","function",".","<","2",">","Define","a","search","space","and","initialize","the","search","algorithm",".","<","3",">","Start","a","Tune","run","that","maximizes","accuracy","."]
code: def run(self):
      self.assert_has_content()
  
      content = self.content
      content = _replace_numbers(content)
  
      callout_node = callout("\n".join(content))
      _parse_recursively(self, callout_node)
  
      return [callout_node]
  
imports: from docutils import nodes
  from sphinx.util.docutils import SphinxDirective
  from sphinx.transforms import SphinxTransform
  from docutils.nodes import Node
label_desc: Use image node_id 1 for calling the CalloutDirective obj's underlying member method code with example usage: obj.run() and returns: list