def require_exp_directory(f):
    """Decorator to verify that a command is run inside a valid Dallinger
    experiment directory.
    """
    error = "The current directory is not a valid Dallinger experiment."

    @wraps(f)
    def wrapper(**kwargs):
        if not verify_directory(kwargs.get("verbose")):
            raise click.UsageError(error)
        return f(**kwargs)

    return wrapper
Decorator to verify that a command is run inside a valid Dallinger
    experiment directory.