Instantiates {Runner} for a given git object, runs it, and stores the result
490960
def run_commit(commit)
      result = @runner_class.new(
        working_dir: @working_dir,                           
        commit: commit[:sha],
        time: commit[:time],
        logger: @logger
      ).run!
      
      set_result(commit, result)
    end
843496
def action_runner(parser, args):
    """"""

    ux_actions(parser, args)
    client = aomi.vault.Client(args)

    if args.operation == 'extract_file':
        aomi.render.raw_file(client.connect(args),
                             args.vault_path, args.destination, args)
        sys.exit(0)
    elif args.operation == 'environment':
        aomi.render.env(client.connect(args),
                        args.vault_paths, args)
        sys.exit(0)
    elif args.operation == 'aws_environment':
        aomi.render.aws(client.connect(args),
                        args.vault_path, args)
        sys.exit(0)
    elif args.operation == 'seed':
        aomi.validation.gitignore(args)
        aomi.seed_action.seed(client.connect(args), args)
        sys.exit(0)
    elif args.operation == 'render':
        aomi.seed_action.render(args.directory, args)
        sys.exit(0)
    elif args.operation == 'export':
        aomi.seed_action.export(client.connect(args), args)
        sys.exit(0)
    elif args.operation == 'diff':
        aomi.seed_action.diff(client.connect(args), args)
        sys.exit(0)
    elif args.operation == 'template':
        template_runner(client.connect(args), parser, args)
    elif args.operation == 'token':
        print(client.connect(args).token)
        sys.exit(0)
    elif args.operation == 'set_password':
        aomi.util.password(client.connect(args), args.vault_path)
        sys.exit(0)
    elif args.operation == 'freeze':
        aomi.filez.freeze(args.icefile, args)
        sys.exit(0)
    elif args.operation == 'thaw':
        do_thaw(client, args)

    parser.print_usage()
    sys.exit(2)
1370624
def run(client, outputs, no_output, success_codes, isolation, command_line):
    """"""
    working_dir = client.repo.working_dir
    mapped_std = _mapped_std_streams(client.candidate_paths)
    factory = CommandLineToolFactory(
        command_line=command_line,
        directory=os.getcwd(),
        working_dir=working_dir,
        successCodes=success_codes,
        **{
            name: os.path.relpath(path, working_dir)
            for name, path in mapped_std.items()
        }
    )

    with client.with_workflow_storage() as wf:
        with factory.watch(
            client, no_output=no_output, outputs=outputs
        ) as tool:
            # Make sure all inputs are pulled from a storage.
            client.pull_paths_from_storage(
                *(
                    path
                    for _, path in tool.iter_input_files(client.workflow_path)
                )
            )

            returncode = call(
                factory.command_line,
                cwd=os.getcwd(),
                **{key: getattr(sys, key)
                   for key in mapped_std.keys()},
            )

            if returncode not in (success_codes or {0}):
                raise errors.InvalidSuccessCode(
                    returncode, success_codes=success_codes
                )

            sys.stdout.flush()
            sys.stderr.flush()

            wf.add_step(run=tool)
965716
function runWithAfter (ret, runWith) {
    // after original promise resolves then run after methods
    return ret.then(res => {
        // wait for all extension methods to complete
        return Promise.all(runWith)
        // merge returned data into original
        .then(function (results) {
            // either merge or replace result
            _.each(results, result => {
                // both original res and after result are objects
                if (typeof res === 'object' && res !== null && typeof result === 'object' && result !== null) {
                    // merge after into original
                    _.merge(res, result)
                }
                // one is not an object
                else if (result !== undefined) {
                    // replace original with after
                    res = result
                }
            })
            // return final result
            return res
        })
    })
}
421683
def run(model, collect, filename, location, ignore_git, pytest_args, exclusive,
        skip, solver, experimental, custom_tests, deployment,
        skip_unchanged):
    
    def is_verbose(arg):
        return (arg.startswith("--verbosity") or
                arg.startswith("-v") or arg.startswith("--verbose") or
                arg.startswith("-q") or arg.startswith("--quiet"))

    if ignore_git:
        repo = None
    else:
        callbacks.git_installed()
        repo = callbacks.probe_git()
    if collect:
        if repo is not None:
            if location is None:
                LOGGER.critical(
                    "Working with a repository requires a storage location.")
                sys.exit(1)
    if not any(a.startswith("--tb") for a in pytest_args):
        pytest_args = ["--tb", "short"] + pytest_args
    if not any(is_verbose(a) for a in pytest_args):
        pytest_args.append("-vv")
    # Check if the model was changed in this commit. Exit `memote run` if this
    # was not the case.
    if skip_unchanged and repo is not None:
        commit = repo.head.commit
        if not is_modified(model, commit):
            LOGGER.info("The model was not modified in commit '%s'. Skipping.",
                        commit.hexsha)
            sys.exit(0)
    # Add further directories to search for tests.
    pytest_args.extend(custom_tests)
    # Check if the model can be loaded at all.
    model, sbml_ver, notifications = api.validate_model(model)
    if model is None:
        LOGGER.critical(
            "The model could not be loaded due to the following SBML errors.")
        stdout_notifications(notifications)
        sys.exit(1)
    model.solver = solver
    # Load the experimental configuration using model information.
    if experimental is not None:
        experimental.load(model)
    code, result = api.test_model(
        model=model, sbml_version=sbml_ver, results=True,
        pytest_args=pytest_args, skip=skip,
        exclusive=exclusive, experimental=experimental)
    if collect:
        if repo is None:
            manager = ResultManager()
            manager.store(result, filename=filename)
        else:
            LOGGER.info("Checking out deployment branch.")
            # If the repo HEAD is pointing to the most recent branch then
            # GitPython's `repo.active_branch` works. Yet, if the repo is in
            # detached HEAD state, i.e., when a user has checked out a specific
            # commit as opposed to a branch, this won't work and throw a
            # `TypeError`, which we are circumventing below.
            try:
                previous = repo.active_branch
                previous_cmt = previous.commit
                is_branch = True
            except TypeError:
                previous_cmt = repo.head.commit
                is_branch = False
            repo.git.checkout(deployment)
            try:
                manager = SQLResultManager(repository=repo, location=location)
            except (AttributeError, ArgumentError):
                manager = RepoResultManager(repository=repo, location=location)
            LOGGER.info(
                "Committing result and changing back to working branch.")
            manager.store(result, commit=previous_cmt.hexsha)
            repo.git.add(".")
            check_call(
                ['git', 'commit',
                 '-m', "chore: add result for {}".format(previous_cmt.hexsha)]
            )
            if is_branch:
                previous.checkout()
            else:
                repo.commit(previous_cmt)
721801
def run(command, get_output=False, cwd=None):
    
    if cwd is None:
        cwd = GITPATH

    cprint('===')
    cprint('===  Command: ', command)
    cprint('===  CWD:     ', cwd)
    cprint('===')

    if get_output:
        proc = capture_stdout(command, cwd=cwd)
        out = proc.stdout.read().decode()
        print(out, end='')
        check_exit_code(proc.returncode)
        return out
    else:
        proc = sarge_run(command, cwd=cwd)
        check_exit_code(proc.returncode)
421705
async function run() {
  const fetcher = new ChangelogFetcher({ base, futureRelease, futureReleaseTag, labels, owner, repo, token });
  const releases = await fetcher.fetchChangelog();

  formatChangelog(releases).forEach(line => process.stdout.write(line));
}
460258
function clone(url, target, ref, key, log, fn) {
  var urlObj = parseurl(url);
  urlObj.auth = key + ':x-oauth-basic';
  var authurl = formaturl(urlObj) + '.git';

  var dir = target + '/.git';

  log('creating dir ' + dir);
  mkdirp(dir, function(err) {
    if (err) return fn(err);

    var remote = git.remote(authurl);
    var repo = git.repo(dir);
    var opts = {};
    opts.want = ref;
    log('fetching ' + url);
    repo.fetch(remote, opts, function(err) {
      if (err) return fn(err);
      log('checking out ' + ref);
      repo.resolveHashish(ref, function(err, hash) {
        if (err) return fn(err);
        log('updating head to ' + hash);
        repo.updateHead(hash, function(err) {
          if (err) return fn(err);
          exec('git checkout ' + hash, {cwd: target}, function(err, stdout, stderr) {
            fn(err);
          });
        });
      });
    });
  });
}
1260752
def run(self, cmd):
        """"""
        cmd = ['git', '--git-dir=%s' % self.path] + cmd
        print("cmd list", cmd)
        print("cmd", ' '.join(cmd))
        res = None
        try:
            res = subprocess.check_output(cmd)
        except BaseException:
            pass
        if res:
            try:
                res = res.decode()
            except UnicodeDecodeError:
                res = res.decode('utf-8')
        return res
15054
def run
      options.staged = options.staged.nil? ? true : options.staged

      if options.skip_pre
        puts 'Skipping PreRun Executables'
      else
        run_externals('pre-run-execute')
      end

      if script && !(options.ignore_script || GitHooks.ignore_script)
        command = "#{script} #{Pathname.new($0)} #{Shellwords.join(ARGV)};"
        puts "Kernel#exec(#{command.inspect})" if GitHooks.verbose
        exec(command)
      elsif hook_path
        load_tests && start
      else
        puts %q"I can't figure out what to run! Specify either path or script to give me a hint..."
      end

      if options.skip_post
        puts 'Skipping PostRun Executables'
      else
        run_externals('post-run-execute')
      end
    rescue SystemStackError => e
      puts "#{e.class.name}: #{e.message}\n\t#{e.backtrace.join("\n\t")}"
    rescue GitHooks::Error::NotAGitRepo => e
      puts "Unable to find a valid git repo in #{repository}."
      puts 'Please specify path to repository via --repo <path>' if GitHooks::SCRIPT_NAME == 'githooks'
      raise e
    end
974433
function runHooks(hooks, args, callback) {
    console.log('*** git-hooks.js runHooks', hooks, args);
    if (!hooks.length) {
        callback(0);
        return;
    }
    try {
        var hook = spawnHook(hooks.shift(), args);
        hook.on('close', function (code) {
            if (code === 0) {
                runHooks(hooks, args, callback);
            } else {
                callback(code);
            }
        });
    } catch (e) {
        callback(1, e);
    }
}
1289297
def init_runner(**kwargs):
    '''
    
    '''
    dump_artifacts(kwargs)

    debug = kwargs.pop('debug', None)
    logfile = kwargs.pop('logfile', None)

    if not kwargs.pop("ignore_logging", True):
        output.configure()
        if debug in (True, False):
            output.set_debug('enable' if debug is True else 'disable')

        if logfile:
            output.set_logfile(logfile)

    if kwargs.get("process_isolation", False):
        check_isolation_executable_installed(kwargs.get("process_isolation_executable", "bwrap"))

    event_callback_handler = kwargs.pop('event_handler', None)
    status_callback_handler = kwargs.pop('status_handler', None)
    cancel_callback = kwargs.pop('cancel_callback', None)
    finished_callback = kwargs.pop('finished_callback',  None)

    rc = RunnerConfig(**kwargs)
    rc.prepare()

    return Runner(rc,
                  event_handler=event_callback_handler,
                  status_handler=status_callback_handler,
                  cancel_callback=cancel_callback,
                  finished_callback=finished_callback)
1053276
function createRunner(builderInstance) {
    
    var runnerInstance={
        name:builderInstance.name,
        builder:builderInstance,
        run: function (input,callback) {
            
            var context =
                createContext(null, (input==null) ? {} : input);
            
            exec(builderInstance.root, context, function(err,result){
                if (callback){
                    callback(err,result);
                }
            });
        },
    };
    
    return runnerInstance;
}
1099879
def __run_git(cmd, path=None):
    
    exe = [__get_git_bin()] + cmd
    try:
        proc = subprocess.Popen(exe, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    except subprocess.CalledProcessError:
        return None, None
    except ValueError:
        return None, None
    except OSError:
        return None, None

    out, err = proc.communicate()
    if IS_PYTHON3:
        out = out.decode("utf-8")
    if err:
        print("Cmd ('%s') fails: %s" % (' '.join(exe), err))
        return None, proc.returncode
    return out.strip(), proc.returncode
834249
def main():
    
    logging.basicConfig(
        format='[%(asctime)s] %(levelname)s -- %(message)s',
        level=logging.DEBUG)

    parser = argparse.ArgumentParser(description='')
    parser.add_argument('git_url', help='Url of the repo to sync')
    parser.add_argument('branch_name', default='master', help='Branch of repo to sync', nargs='?')
    parser.add_argument('repo_dir', default='.', help='Path to clone repo under', nargs='?')
    args = parser.parse_args()

    for line in GitPuller(
        args.git_url,
        args.branch_name,
        args.repo_dir
    ).pull():
        print(line)
1239408
def run(*extractor_list, **kwargs):
    """"""
    args = _get_args(kwargs.get('args'))
    n_extractors = len(extractor_list)
    log.info('Going to run list of {} FeatureExtractors'.format(n_extractors))
    collection = fex.Collection(cache_path=args.cache_path)
    for extractor in extractor_list:
        collection.add_feature_extractor(extractor)

    out_path = args.path
    if args.deploy:
        out_path = _prefix_git_hash(out_path)
    collection.run(out_path)
926914
def run(self):
        
        logger = logging.getLogger(__name__)
        try:
            # Check repository GPG settings before starting workers
            # Handling this here prevents subprocesses from needing stdin access
            repo_conf = self.config['repository']
            repo = None
            if repo_conf['enabled'] and repo_conf['gpg_verify']:
                try:
                    repo = Repository(repo_conf['url'],
                                      repo_conf['gpg_verify'])
                    repo.init_gpg()
                except Exception as ex:
                    # Do not prompt to install gpg keys unless running interactively
                    if repo is not None and self.library is False:
                        if isinstance(ex, RepositoryUntrustedSigningKeyError):
                            installed = repo.prompt_for_install()
                            if installed is False:
                                logger.critical(("repository signature not "
                                                 "installed, install the "
                                                 "signature manually or use "
                                                 "the --gpg-no-verify flag "
                                                 "to bypass this check"))
                                quit(1)
                    else:
                        logger.critical(ex)
                        quit(1)

            conf = self.map_config()
            workers = Workers(conf, self.config['workers'], name=self.name, library=self.library)
            description = 'memory capture action'
            results = workers.spawn(description)

            self.statistics(results)
            if self.library is True:
                return dict([('total', self.total),
                             ('completed', self.completed_addresses),
                             ('failed', self.failed_addresses)])
            else:
                logger.info(("{0} hosts processed. completed: {1} "
                             "failed {2}".format(self.total, self.completed,
                                                 self.failed)))
                logger.info("completed_hosts: {0}".format(self.completed_addresses))
                logger.info("failed_hosts: {0}".format(self.failed_addresses))
                quit()
        except KeyboardInterrupt:
            workers.cleanup(terminate=True)
            if self.library:
                raise
            else:
                quit(1)