def option_hook(self, function):
        """
        Decorator for adding an option hook function.

        An option hook is a function that is called right before a run
        is created. It receives (and potentially modifies) the options
        dictionary. That is, the dictionary of commandline options used for
        this run.

        Notes
        -----
        The decorated function MUST have an argument called options.

        The options also contain ``'COMMAND'`` and ``'UPDATE'`` entries,
        but changing them has no effect. Only modification on
        flags (entries starting with ``'--'``) are considered.
        """
        sig = Signature(function)
        if "options" not in sig.arguments:
            raise KeyError(
                "option_hook functions must have an argument called"
                " 'options', but got {}".format(sig.arguments)
            )
        self.option_hooks.append(function)
        return function

        Decorator for adding an option hook function.

        An option hook is a function that is called right before a run
        is created. It receives (and potentially modifies) the options
        dictionary. That is, the dictionary of commandline options used for
        this run.

        Notes
        -----
        The decorated function MUST have an argument called options.

        The options also contain ``'COMMAND'`` and ``'UPDATE'`` entries,
        but changing them has no effect. Only modification on
        flags (entries starting with ``'--'``) are considered.
        
sacred/experiment.py