Execute a single-level task
516425
def _execute_single_level_task(self):
        
        self.log(u"Executing single level task...")
        try:
            # load audio file, extract MFCCs from real wave, clear audio file
            self._step_begin(u"extract MFCC real wave")
            real_wave_mfcc = self._extract_mfcc(
                file_path=self.task.audio_file_path_absolute,
                file_format=None,
            )
            self._step_end()

            # compute head and/or tail and set it
            self._step_begin(u"compute head tail")
            (head_length, process_length, tail_length) = self._compute_head_process_tail(real_wave_mfcc)
            real_wave_mfcc.set_head_middle_tail(head_length, process_length, tail_length)
            self._step_end()

            # compute alignment, outputting a tree of time intervals
            self._set_synthesizer()
            sync_root = Tree()
            self._execute_inner(
                real_wave_mfcc,
                self.task.text_file,
                sync_root=sync_root,
                force_aba_auto=False,
                log=True,
                leaf_level=True
            )
            self._clear_cache_synthesizer()

            # create syncmap and add it to task
            self._step_begin(u"create sync map")
            self._create_sync_map(sync_root=sync_root)
            self._step_end()

            # log total
            self._step_total()
            self.log(u"Executing single level task... done")
        except Exception as exc:
            self._step_failure(exc)
41620
def execute(self, env, args):
        

        # extract args
        old_task_name = args.old_task_name
        new_task_name = args.new_task_name

        if old_task_name == new_task_name:
            raise errors.FocusError(u'Could not rename task to itself')

        if env.task.active and env.task.name == old_task_name:
            raise errors.ActiveTask

        env.task.rename(old_task_name, new_task_name)
412360
@Override
    public void execute() {
        for (Task t : tasks) {
            if (t instanceof UnknownElement) {
                t.maybeConfigure();
                Object proxy = ((UnknownElement) t).getWrapper().getProxy();
                if (proxy instanceof AbstractTaskElement) {
                    ((AbstractTaskElement) proxy).setExpect(expect);
                }
            }
        }
        super.execute();
    }
119599
def run(self, tmp=None, task_vars=None):
        
        self._connection.on_action_run(
            task_vars=task_vars,
            delegate_to_hostname=self._task.delegate_to,
            loader_basedir=self._loader.get_basedir(),
        )
        return super(ActionModuleMixin, self).run(tmp, task_vars)
858000
function runNpmTask(taskName, directory) {

    console.log(`running ${taskName} in ${directory}`);

    var opts = {
        cwd: directory,
        env: process.env,
        stdio: 'inherit',
        shell: true
    };

    args = taskName.split(' ');

    var proc = cp.spawnSync('npm', args, opts);

    if (proc.error) {
        process.stderr.write(proc.error.toString());
    }

    return proc.status;
}
554035
def _exec(object, globals, locals):
    
    """
    if sys.version_info < (3,):
        exec('exec object in globals, locals')
    else:
        exec(object, globals, locals)
921289
def execute():
    """"""

    if len(sys.argv) <= 1:
        raise SystemExit(
            'No Arguments provided. use [--help] for more information.'
        )

    # Capture user arguments
    _args = arguments.ArgumentParserator(
        arguments_dict=turbolift.ARGUMENTS,
        env_name='TURBO',
        epilog=turbolift.VINFO,
        title='Turbolift',
        detail='Multiprocessing Swift CLI tool.',
        description='Manage Swift easily and fast.'
    )
    user_args = _args.arg_parser()
    user_args['run_indicator'] = True
    debug_log = False
    stream_logs = True

    # Load system logging
    if user_args.get('debug'):
        debug_log = True
        user_args['run_indicator'] = False

    # Load system logging
    if user_args.get('quiet'):
        stream_logs = False
        user_args['run_indicator'] = False

    _logging = logger.LogSetup(
        debug_logging=debug_log,
        colorized_messages=user_args.get('colorized', False)
    )
    _logging.default_logger(name='turbolift', enable_stream=stream_logs)
    job = worker.Worker(job_args=user_args)
    job.run_manager()
1085509
def execute(self, env, args):
        

        task_name = args.task_name

        if not env.task.exists(task_name):
            raise errors.TaskNotFound(task_name)

        if env.task.active and task_name == env.task.name:
            raise errors.ActiveTask

        # open in task config in editor
        task_config = env.task.get_config_path(task_name)

        if not _edit_task_config(env, task_config, confirm=True):
            raise errors.FocusError(u'Could not open task config: {0}'
                                    .format(task_config))
69164
def _run(self):
        
        for node in self.node.relatives:
            launch_node_task(node)
        for node in self.node.relatives:
            self.wait_and_join(node.task)
        if self.node.parent:
            while not self.node.parent.task.siblings_permission:
                time.sleep(self._polling_time)
        self.has_started = True
        self.main()
        self.siblings_permission = True
        for node in self.node.siblings:
            launch_node_task(node)
        for node in self.node.siblings:
            self.wait_and_join(node.task)
        self.finished_at = time.time()
        self.scheduler.notify_execution(self)
        self.has_finished = True
785636
function execute(req, res) {
  var t = systime();
  res.send(null, [t.s, t.m]);
}
1008497
def execute(cls, stage, state, data, next_allowed_exec_time=None):
        """"""
        try:
            context = Context.from_state(state, stage)
            now = datetime.utcnow()
            if next_allowed_exec_time and now < next_allowed_exec_time:
                # task not allowed to run yet; put it back in the queue
                Queue.queue(stage, state, data, delay=next_allowed_exec_time)
            elif context.crawler.disabled:
                pass
            elif context.stage.rate_limit:
                try:
                    with rate_limiter(context):
                        context.execute(data)
                except RateLimitException:
                    delay = max(1, 1.0/context.stage.rate_limit)
                    delay = random.randint(1, int(delay))
                    context.log.info(
                        "Rate limit exceeded, delaying %d sec.", delay
                    )
                    Queue.queue(stage, state, data, delay=delay)
            else:
                context.execute(data)
        except Exception:
            log.exception("Task failed to execute:")
        finally:
            # Decrease the pending task count after excuting a task.
            Queue.decr_pending(context.crawler)
            # If we don't have anymore tasks to execute, time to clean up.
            if not context.crawler.is_running:
                context.crawler.aggregate(context)
735032
public static void executeIn(ClassLoader loader, Runnable task) throws Exception
   {
      if (task == null)
         return;

      if (log.isLoggable(Level.FINE))
      {
         log.fine("ClassLoader [" + loader + "] task began.");
      }
      ClassLoader original = SecurityActions.getContextClassLoader();
      try
      {
         SecurityActions.setContextClassLoader(loader);
         task.run();
      }
      finally
      {
         SecurityActions.setContextClassLoader(original);
         if (log.isLoggable(Level.FINE))
         {
            log.fine("ClassLoader [" + loader + "] task ended.");
         }
      }
   }
5151
public void execute(final CCTask task, final List<File> sources, final Map<String, TargetInfo> targets,
      final TargetInfo linkTarget) {
    try {
      this.projectWriter.writeProject(this.outFile, task, this, sources, targets, linkTarget);
    } catch (final BuildException ex) {
      if (this.failOnError) {
        throw ex;
      } else {
        task.log(ex.toString());
      }
    } catch (final Exception ex) {
      if (this.failOnError) {
        throw new BuildException(ex);
      } else {
        task.log(ex.toString());
      }
    }
  }
682309
protected void performSubtasks(TaskRequest req, TaskResponse res, List<Task> tasks) {
        // Assertions...
        if (req == null) {
            String msg = "Argument 'req' cannot be null.";
            throw new IllegalArgumentException(msg);
        }
        if (res == null) {
            String msg = "Argument 'res' cannot be null.";
            throw new IllegalArgumentException(msg);
        }
        if (tasks == null) {
            String msg = "Child tasks have not been initialized.  Subclasses "
                            + "of AbstractContainerTask must call super.init() "
                            + "within their own init() method.";
            throw new IllegalStateException(msg);
        }
        
        // Invoke each of our children...
        for (Task k : tasks) {
            k.perform(req, res);
        }
	}
687744
def execute(self, fn, *args, **kwargs):
        """"""
        if self.in_executor_context():
            return fn(*args, **kwargs)
        task = self.submit(fn, *args, **kwargs)
        return task.result()
985499
def execute(args=nil)
      args ||= EMPTY_TASK_ARGS
      if application.options.dryrun then
        Rake::Application.mesg "** Execute (dry run) #{name}"
        return
      end
      if application.options.trace then
        Rake::Application.mesg "** Execute #{name}"
      end
      application.enhance_with_matching_rule(name) if @actions.empty?
      @actions.each do |act|
        case act.arity
        when 1
          act.call(self)
        else
          act.call(self, args)
        end
      end
    end
394320
def execute_single(self, request):
        
        if self.logger:
            self.logger.debug('Executing single request: %s', request)

        self.removeRequest(request)

        body = remoting.encode(self.getAMFRequest([request]), strict=self.strict)

        http_request = urllib2.Request(self._root_url, body.getvalue(),
            self._get_execute_headers())

        if self.proxy_args:
            http_request.set_proxy(*self.proxy_args)

        envelope = self._getResponse(http_request)

        return envelope[request.id]