code: def capture(self, function=None, prefix=None):
          
          if function in self.captured_functions:
              return function
          captured_function = create_captured_function(function, prefix=prefix)
          self.captured_functions.append(captured_function)
          return captured_function
docs: Decorator to turn a function into a captured function.
  
          The missing arguments of captured functions are automatically filled
          from the configuration if possible.
          See :ref:`captured_functions` for more information.
  
          If a ``prefix`` is specified, the search for suitable
          entries is performed in the corresponding subtree of the configuration.