Run func, assumed to have dependencies as its first argument.
437346
def _stamped_deps(stamp_directory, func, dependencies, *args, **kwargs):
    """"""
    if not isinstance(dependencies, list):
        jobstamps_dependencies = [dependencies]
    else:
        jobstamps_dependencies = dependencies

    kwargs.update({
        "jobstamps_cache_output_directory": stamp_directory,
        "jobstamps_dependencies": jobstamps_dependencies
    })
    return jobstamp.run(func, dependencies, *args, **kwargs)
697964
def require_self(func, *args, **kwargs):
    """"""

    try:
        __import__(package['name'])
    except ImportError:
        sys.stderr.write(
            "This component needs to be installed first. Run " +
            "`invoke install`\n")
        sys.exit(1)
    return func(*args, **kwargs)
244440
def _run_exitfuncs():
    

    while _exithandlers:
        func, targs, kargs =  _exithandlers.pop()
        func(*targs, **kargs)
1132282
def execute_function(self, func, *nargs, **kwargs):
        
        # makes a copy of the func
        import types
        fn = types.FunctionType(func.func_code,
                                func.func_globals.copy(),
                                name=func.func_name,
                                argdefs=func.func_defaults,
                                closure=func.func_closure)
        fn.func_globals.update(self.globals)

        error_class = Exception if config.catch_rex_errors else None

        try:
            return fn(*nargs, **kwargs)
        except RexError:
            raise
        except error_class as e:
            from inspect import getfile

            stack = traceback.format_exc()
            filename = getfile(func)

            raise RexError("Failed to exec %s:\n\n%s" % (filename, stack))
1226967
def run_once(func):
    '''  '''
    def wrapper(*args, **kwargs):
        if not wrapper.has_run:
            wrapper.has_run = True
            return func(*args, **kwargs)
    wrapper.has_run = False
    return wrapper
1166708
def run(*args, **kwargs):
    '''
    
    '''
    lib = sys.modules[asynclib.lib_name]
    lib.run(*args, **kwargs)
544170
def run(self, name):
        """"""
        for entry in self.entries:
            if entry.name == name:
                run_func(entry)
                break
1275836
def _run_path_dependencies(self, parsed_args):
        
        deps = self.path[-1].dependencies(parsed_args)

        lang.Command('dependencies', deps, parsed_args).run()
1222386
def _execute_if_not_empty(func):
    
    def wrapper(*args, **kwargs):
        if any(args[1:]) or any(kwargs.items()):
            return func(*args, **kwargs)
    return wrapper
374696
def prepare(self, setup_func):
        
        assert inspect.isfunction(setup_func)
        argsspec = inspect.getargspec(setup_func)
        if argsspec.args:
            raise ValueError("prepare function shouldn't have any arguments")

        def decorator(command_func):
            @functools.wraps(command_func)
            def wrapper(*args, **kwgs):
                # Run setup_func before command_func
                setup_func()
                return command_func(*args, **kwgs)
            return wrapper
        return decorator
1038058
def function_dependency_graph(self, func):
        

        if self._function_data_dependencies is None:
            self._build_function_dependency_graphs()

        if func in self._function_data_dependencies:
            return self._function_data_dependencies[func]

        # Not found
        return None
792555
def run(self):
        ""
        # load files from source directory
        files = self.get_files()

        # loop through each middleware
        for func in self.middleware:

            # call each one, ignoring return value
            func(files, self)

        # store and return the result
        self.files.update(files)
        return files
257258
def _needs_git(func):
    

    @wraps(func)
    def myfunc(*args, **kwargs):
        if not WITH_GIT:
            raise RuntimeError(
                "Dulwich library not available, can't extract info from the "
                "git repos."
            )
        return func(*args, **kwargs)

    return myfunc
1014391
def build_function(name, args=None, defaults=None, doc=None):
    """"""
    args, defaults = args or [], defaults or []
    # first argument is now a list of decorators
    func = nodes.FunctionDef(name, doc)
    func.args = argsnode = nodes.Arguments()
    argsnode.args = []
    for arg in args:
        argsnode.args.append(nodes.Name())
        argsnode.args[-1].name = arg
        argsnode.args[-1].parent = argsnode
    argsnode.defaults = []
    for default in defaults:
        argsnode.defaults.append(nodes.const_factory(default))
        argsnode.defaults[-1].parent = argsnode
    argsnode.kwarg = None
    argsnode.vararg = None
    argsnode.parent = func
    if args:
        register_arguments(func)
    return func
550896
def call_once(func):
  
  argspec = inspect.getargspec(func)
  if argspec.args or argspec.varargs or argspec.keywords:
    raise ValueError('Can only decorate functions with no args', func, argspec)

  @functools.wraps(func)
  def _wrapper():
    # If we haven't been called yet, actually invoke func and save the result.
    if not _wrapper.HasRun():
      _wrapper.MarkAsRun()
      _wrapper.return_value = func()
    return _wrapper.return_value

  _wrapper.has_run = False
  _wrapper.HasRun = lambda: _wrapper.has_run
  _wrapper.MarkAsRun = lambda: setattr(_wrapper, 'has_run', True)
  return _wrapper
1366942
def run_on(*, event: str):
        """"""

        def decorator(callback):
            @functools.wraps(callback)
            def decorator_wrapper():
                RTMClient.on(event=event, callback=callback)

            return decorator_wrapper()

        return decorator
463290
def run(arguments: typing.List[str] = None):
    """"""
    initialize()

    from cauldron.invoke import parser
    from cauldron.invoke import invoker

    args = parser.parse(arguments)
    exit_code = invoker.run(args.get('command'), args)
    sys.exit(exit_code)