code: def setup(app):
      app.add_directive(
          "htmlonly", html_only_directive, True, (0, 0, 0)
      )
      app.add_directive(
          "latexonly", latex_only_directive, True, (0, 0, 0)
      )
  
      # This will *really* never see the light of day As it turns out,
      # this results in "broken" image nodes since they never get
      # processed, so best not to do this.
      # app.connect('builder-inited', builder_inited)
  
      # Add visit/depart methods to HTML-Translator:
      def visit_perform(self, node):
          pass
  
      def depart_perform(self, node):
          pass
  
      def visit_ignore(self, node):
          node.children = []
  
      def depart_ignore(self, node):
          node.children = []
  
      app.add_node(
          html_only,
          html=(visit_perform, depart_perform),
          latex=(visit_ignore, depart_ignore),
      )
      app.add_node(
          latex_only,
          latex=(visit_perform, depart_perform),
          html=(visit_ignore, depart_ignore),
      )
  
      metadata = {
          "parallel_read_safe": True,
          "parallel_write_safe": True,
      }
      return metadata
  
file_path: catboost/contrib/python/matplotlib/py2/matplotlib/sphinxext/only_directives.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  from docutils.nodes import Body, Element
label_desc: Use image node_id 5 for calling a global function with example usage: setup(app) and returns: metadata