Should handle execution of the task, taking as much (optional) parameters as needed

The parameters should be optional and failing to provide them should be handled by
the task
495859
public function execute($roundId = null, $roundDescription = null)
    {
        $batch  = $this->getBatch();

        if ($batch->hasVariable('trackEngine')) {
            $trackEngine = $batch->getVariable('trackEngine');
            if ($trackEngine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {

                $model = $trackEngine->getRoundModel(true, 'delete');

                $roundData['gro_id_round'] = $roundId;
                $roundData['gro_active']   = 0;
                $roundData = $model->save($roundData);

                $batch->addMessage(sprintf(
                        $this->_('Deactivated round %s.'),
                        ($roundDescription ? $roundDescription : $roundId)
                        ));
            }
        }
    }
202374
@Override
    public void execute() {
        if ((str == null || str.isEmpty()) && !FindContext.isAvailable()) {
            try {
                str = editor.readLine("Find previous:");
                editor.findPrevious(str);
                FindContext.setLastSearch(str);
            } catch (IOException e) {
                //noop
            }
        } else if (FindContext.isAvailable()) {
            editor.findPrevious(FindContext.getLastSearch());
        } else {
            editor.findPrevious(str);
            FindContext.setLastSearch(str);
        }
    }
440409
private void doProcessNext()
	{
		int _position = getPosition();
		Node _current = getSource().item(_position);

		if (getActionPool().containsKey(_current.getNodeName()))
		{
			getActionPool().get(_current.getNodeName()).execute(_current, _position);
		}
		else if (getActionPool().containsKey(NODE_NAME__DEFAULT))
		{
			getActionPool().get(NODE_NAME__DEFAULT).execute(_current, _position);
		}
		// else do nothing...

		// done
		_position++;
		setPosition(_position);
	}
383223
def do_execute(self):
        
        if self.storagehandler is None:
            return "No storage handler available!"
        self.storagehandler.storage[self.resolve_option("storage_name")] = eval(str(self.resolve_option("value")))
        self._output.append(self.input)
        return None
1330263
protected void doExecuteCommand() {
        if (this.commandExecutor instanceof ParameterizableActionCommandExecutor) {
            ((ParameterizableActionCommandExecutor) this.commandExecutor).execute(getParameters());
        }
        else {
        	if (this.commandExecutor != null) {
        		this.commandExecutor.execute();
        	}
        }
    }
1374853
public void execute() {

        checkParameters();

        if (loadCommandOptions.data != null) {

            if (loadCommandOptions.loaderParams.containsKey("mongodb-index-folder")) {
                configuration.getDatabases().getMongodb().getOptions().put("mongodb-index-folder",
                        loadCommandOptions.loaderParams.get("mongodb-index-folder"));
            }
            // If 'authenticationDatabase' is not passed by argument then we read it from configuration.json
            if (loadCommandOptions.loaderParams.containsKey("authenticationDatabase")) {
                configuration.getDatabases().getMongodb().getOptions().put("authenticationDatabase",
                        loadCommandOptions.loaderParams.get("authenticationDatabase"));
            }

//                loadRunner = new LoadRunner(loader, database, loadCommandOptions.loaderParams, numThreads, configuration);
            loadRunner = new LoadRunner(loader, database, numThreads, configuration);

            String[] loadOptions;
            if (loadCommandOptions.data.equals("all")) {
                loadOptions = new String[]{EtlCommons.GENOME_DATA, EtlCommons.GENE_DATA, EtlCommons.CONSERVATION_DATA,
                        EtlCommons.REGULATION_DATA, EtlCommons.PROTEIN_DATA, EtlCommons.PPI_DATA,
                        EtlCommons.PROTEIN_FUNCTIONAL_PREDICTION_DATA, EtlCommons.VARIATION_DATA,
                        EtlCommons.VARIATION_FUNCTIONAL_SCORE_DATA, EtlCommons.CLINICAL_VARIANTS_DATA,
                        EtlCommons.REPEATS_DATA, EtlCommons.STRUCTURAL_VARIANTS_DATA, };
            } else {
                loadOptions = loadCommandOptions.data.split(",");
            }

            for (int i = 0; i < loadOptions.length; i++) {
                String loadOption = loadOptions[i];
                try {
                    switch (loadOption) {
                        case EtlCommons.GENOME_DATA:
                            loadIfExists(input.resolve("genome_info.json"), "genome_info");
                            loadIfExists(input.resolve("genome_sequence.json.gz"), "genome_sequence");
                            loadIfExists(input.resolve("genomeVersion.json"), METADATA);
                            loadRunner.index("genome_sequence");
                            break;
                        case EtlCommons.GENE_DATA:
                            loadIfExists(input.resolve("gene.json.gz"), "gene");
                            loadIfExists(input.resolve("dgidbVersion.json"), METADATA);
                            loadIfExists(input.resolve("ensemblCoreVersion.json"), METADATA);
                            loadIfExists(input.resolve("uniprotXrefVersion.json"), METADATA);
                            loadIfExists(input.resolve("geneExpressionAtlasVersion.json"), METADATA);
                            loadIfExists(input.resolve("hpoVersion.json"), METADATA);
                            loadIfExists(input.resolve("disgenetVersion.json"), METADATA);
                            loadRunner.index("gene");
                            break;
                        case EtlCommons.VARIATION_DATA:
                            loadVariationData();
                            break;
                        case EtlCommons.VARIATION_FUNCTIONAL_SCORE_DATA:
                            loadIfExists(input.resolve("cadd.json.gz"), "cadd");
                            loadIfExists(input.resolve("caddVersion.json"), METADATA);
                            loadRunner.index("variation_functional_score");
                            break;
                        case EtlCommons.CONSERVATION_DATA:
                            loadConservation();
                            break;
                        case EtlCommons.REGULATION_DATA:
                            loadIfExists(input.resolve("regulatory_region.json.gz"), "regulatory_region");
                            loadIfExists(input.resolve("ensemblRegulationVersion.json"), METADATA);
                            loadIfExists(input.resolve("mirbaseVersion.json"), METADATA);
                            loadIfExists(input.resolve("targetScanVersion.json"), METADATA);
                            loadIfExists(input.resolve("miRTarBaseVersion.json"), METADATA);
                            loadRunner.index("regulatory_region");
                            break;
                        case EtlCommons.PROTEIN_DATA:
                            loadIfExists(input.resolve("protein.json.gz"), "protein");
                            loadIfExists(input.resolve("uniprotVersion.json"), METADATA);
                            loadIfExists(input.resolve("interproVersion.json"), METADATA);
                            loadRunner.index("protein");
                            break;
                        case EtlCommons.PPI_DATA:
                            loadIfExists(input.resolve("protein_protein_interaction.json.gz"), "protein_protein_interaction");
                            loadIfExists(input.resolve("intactVersion.json"), METADATA);
                            loadRunner.index("protein_protein_interaction");
                            break;
                        case EtlCommons.PROTEIN_FUNCTIONAL_PREDICTION_DATA:
                            loadProteinFunctionalPrediction();
                            break;
                        case EtlCommons.CLINICAL_VARIANTS_DATA:
                            loadClinical();
                            break;
                        case EtlCommons.REPEATS_DATA:
                            loadRepeats();
                            break;
                        case EtlCommons.STRUCTURAL_VARIANTS_DATA:
                            loadStructuralVariants();
                            break;
                        default:
                            logger.warn("Not valid 'data'. We should not reach this point");
                            break;
                    }
                } catch (IllegalAccessException | InstantiationException | InvocationTargetException | ExecutionException
                        | NoSuchMethodException | InterruptedException | ClassNotFoundException | LoaderException | IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
1069098
def execute_handler params={},path=nil
     case @type
     when :handlers
       @handlers.each do |handler_ident|
         handler = @context_ref.handlers.fetch(handler_ident) {raise "handler #{handler_ident} doesn't exist in context #{@context_ref.ref}"}
         component = handler.(params,path||@url,&:call)
         Context.current_context = @context_ref.ref
         if component.class == Proc
           component.call
         else
           Context.renderer.call(component,handler_ident)
         end
         Context.current_context = :no_context
       end
     when :context
       Context.wipe
       Context.render handlers
       History.push(@context_ref.ref,"",[],@context_ref.ref)
     end
    end
326297
@SafeVarargs
    public static <T> void execute(AsyncTask<T, ?, ?> task, T... args) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.DONUT) {
            throw new UnsupportedOperationException("This class can only be used on API 4 and newer.");
        }
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
            task.execute(args);
        } else {
            task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
        }
    }
617787
@Override
   public void execute() throws BuildException 
   {
      ClassLoader oldCL = SecurityActions.getThreadContextClassLoader();
      try 
      {
         SecurityActions.setThreadContextClassLoader(SecurityActions.getClassLoader(ValidatorTask.class));

         Validation.validate(new File(getRarFile()).toURI().toURL(), 
            getOutputDir(), getCommandLine().getClasspath().list());
      }
      catch (Throwable t) 
      {
         throw new BuildException(t.getMessage(), t);
      }
      finally
      {
         SecurityActions.setThreadContextClassLoader(oldCL);
      }
   }
1115660
async def run(self, kwargs=None):
        
        task = self._prepare(kwargs)

        try:
            await task
        except Exception as e:
            # FIXME: write a better Exception handler.
            raise e
307765
public function execute() {
    if (count($this->getInputParameters())) {
      if ($this->isSubmitComplete()) {
        $this->formValues = $this->getFormValues();
        $this->run();
      } else {
        $this->renderInputForm();
      }
    } else {
      $this->run();
    }
  }
626708
public void execute(DelegateExecution execution) {
    boolean isSkipExpressionEnabled = SkipExpressionUtil.isSkipExpressionEnabled(execution, skipExpression);
    if (!isSkipExpressionEnabled || (isSkipExpressionEnabled && !SkipExpressionUtil.shouldSkipFlowElement(execution, skipExpression))) {

      if (Context.getProcessEngineConfiguration().isEnableProcessDefinitionInfoCache()) {
        ObjectNode taskElementProperties = Context.getBpmnOverrideElementProperties(serviceTaskId, execution.getProcessDefinitionId());
        if (taskElementProperties != null && taskElementProperties.has(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME)) {
          String overrideClassName = taskElementProperties.get(DynamicBpmnConstants.SERVICE_TASK_CLASS_NAME).asText();
          if (StringUtils.isNotEmpty(overrideClassName) && !overrideClassName.equals(className)) {
            className = overrideClassName;
            activityBehaviorInstance = null;
          }
        }
      }
      
      if (activityBehaviorInstance == null) {
        activityBehaviorInstance = getActivityBehaviorInstance();
      }

      try {
        activityBehaviorInstance.execute(execution);
      } catch (BpmnError error) {
        ErrorPropagation.propagateError(error, execution);
      } catch (RuntimeException e) {
        if (!ErrorPropagation.mapException(e, (ExecutionEntity) execution, mapExceptions))
          throw e;
      }
    }
  }
996293
def handle(self, **options):
        
        self.flushdb = options.get('flushdb')
        self._pre_tasks()
        self._create_users()
        self._create_badges()
        self._create_awards()
559705
public final void execute()
  {
    _log.debug( _sqlString );

    CallableStatement lCallableStatement = null;

    try
    {
      lCallableStatement = _callableStatementProvider.createCallableStatement( _sqlString );

      useCallableStatement( lCallableStatement );
    }
    catch( SQLException e )
    {
      _log.debug( e + ": " + _sqlString, e );

      throw ExceptionManager.createException( e, _sqlString );
    }
    finally
    {
      if( lCallableStatement != null )
      {
        try
        {
          lCallableStatement.close();
        }
        catch( SQLException e )
        {
          _log.debug( e, e );

          throw ExceptionManager.createException( e, _sqlString );
        }
      }
    }
  }
65425
@Override
    public void execute() {
        logger = new DITAOTAntLogger(getProject());
        logger.info(message);

        new Properties();
        //ensure tempdir is absolute
        if (!tempdir.isAbsolute()) {
            tempdir = new File(basedir, tempdir.getPath()).getAbsoluteFile();
        }
        //ensure outdir is absolute
        if (!outputdir.isAbsolute()) {
            outputdir = new File(basedir, outputdir.getPath()).getAbsoluteFile();
        }
        //ensure inputmap is absolute
        if (!new File(inputmap).isAbsolute()) {
            inputmap = new File(tempdir, inputmap).getAbsolutePath();
        }

        final Job job = getJob(tempdir, getProject());

        final LangParser parser = new LangParser();

        try {

            final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
            final SAXParser saxParser = saxParserFactory.newSAXParser();
            //parse the user input file(usually a map)
            saxParser.parse(inputmap, parser);
            String langCode = parser.getLangCode();
            if (!StringUtils.isEmptyString(langCode)) {
                setActiveProjectProperty("htmlhelp.locale", langCode);
            } else {
                //parse topic files
                for (final FileInfo f: job.getFileInfo()) {
                    if (ATTR_FORMAT_VALUE_DITA.equals(f.format)) {
                        final File topicFile = new File(tempdir, f.file.getPath());
                        if (topicFile.exists()) {
                            saxParser.parse(topicFile, parser);
                            langCode = parser.getLangCode();
                            if (!StringUtils.isEmptyString(langCode)) {
                                setActiveProjectProperty("htmlhelp.locale", langCode);
                                break;
                            }
                        }
                    }
                }
                //no lang is set
                if (StringUtils.isEmptyString(langCode)) {
                    //use default lang code
                    setActiveProjectProperty("htmlhelp.locale", "en-us");
                }
            }



        } catch (final Exception e) {
            /* Since an exception is used to stop parsing when the search
             * is successful, catch the exception.
             */
            if (e.getMessage() != null &&
                    e.getMessage().equals("Search finished")) {
                System.out.println("Lang search finished");
            } else {
                e.printStackTrace();
            }
        }
    }
1288866
def handle(self, *arguments, **options):
        
        self.arguments = arguments
        self.options = options
        self.arguments = self.parse_arguments(arguments)
        self.options = self.parse_options(options)
        
        for name in self.get_actions():
            validate = getattr(self, "validate_{name:s}".format(
                name=name), None)
            if validate is not None and isinstance(validate, collections.Callable):
                validate(*arguments, **options)
        for name in self.get_actions():
            handle = getattr(self, "handle_{name:s}".format(
                name=name), None)
            if handle is not None and isinstance(handle, collections.Callable):
                handle(*self.arguments, **self.options)
1370116
public void execute() throws ActivityException {
        EventWaitInstance received = registerWaitEvents(false, true);
        if (received!=null) {
            setReturnCodeAndExitStatus(received.getCompletionCode());
            processMessage(getExternalEventInstanceDetails(received.getMessageDocumentId()));
            boolean toFinish = handleCompletionCode();
            if (toFinish && exitStatus==null)
                exitStatus = WorkStatus.STATUS_COMPLETED;
        } else {
            exitStatus = WorkStatus.STATUS_COMPLETED;
            setReturnCode(null);
        }
    }