Do the things!


    Return: 0
    Exceptions:
339185
def main():
    
    description = 'Letter - a commandline interface'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('--gmail', action='store_true', help='Send via Gmail', )
    args = parser.parse_args()

    to       = raw_input('To address > ')
    subject  = raw_input('Subject > ')
    body     = raw_input('Your Message > ')


    if args.gmail:
        user = fromaddr = raw_input('Gmail Address > ')
        pw   = getpass.getpass()
        postie = letter.GmailPostman(user=user, pw=pw)
    else:
        postie = letter.Postman() # Unauthorized SMTP, localhost:25
        fromaddr = raw_input('From address > ')

    class Message(letter.Letter):
        Postie     = postie

        From       = fromaddr
        To         = to
        Subject    = subject
        Body       = body

    return 0
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
463896
def perform(self):
        
        last_value = None
        last_step = None

        while self.items.qsize():

            item = self.items.get()

            if item.flag == self.do:
                last_value = item.item(*item.args, **item.kwargs)
                last_step = item.message
            elif item.flag == self.expect:
                message = item.message
                local = {'value': last_value, 'expectation': item.item}
                expression = 'value {operator} expectation'.format(operator=item.operator)
                result = eval(expression, local)

                # Format the error message
                format_vars = {
                    'actual': last_value,
                    'expected': item.item,
                    'step': last_step,
                    'operator': item.operator
                }

                for var, val in format_vars.iteritems():
                    message = message.replace('{' + str(var) + '}', str(val))

                assert result, message

        return last_value
197342
public void execute() {

    while (!steps.isEmpty()) {
      currentStep = steps.remove(0);

      try {
        LOG.debugPerformOperationStep(currentStep.getName());

        currentStep.performOperationStep(this);
        successfulSteps.add(currentStep);

        LOG.debugSuccessfullyPerformedOperationStep(currentStep.getName());
      }
      catch (Exception e) {

        if(isRollbackOnFailure) {

          try {
            rollbackOperation();
          }
          catch(Exception e2) {
            LOG.exceptionWhileRollingBackOperation(e2);
          }
          // re-throw the original exception
          throw LOG.exceptionWhilePerformingOperationStep(name, currentStep.getName(), e);
        }

        else {
          LOG.exceptionWhilePerformingOperationStep(currentStep.getName(), e);
        }

      }
    }

  }
699640
def execute(self):
        
        func_params = []
        exec_str = self.func.__name__ + '(' 
        for p in self.params:
            if p[0][0:2] != '__':   # ignore custom param names
                exec_str += p[0] + '="' + self._force_str(p[1]) + '", '
                func_params.append(p[1])
        exec_str = exec_str[:-2]
        exec_str += ')  # task' + str(self.task_id) + ': ' + self.name
        
        
        self.result = self.func(*func_params)
        print(exec_str + ' loaded ', self.result)
202008
def performAction(self, action):
        
#        print "ACTION:", action
        self.t += 1
        Task.performAction(self, action)
#        self.addReward()
        self.samples += 1
325790
def execute(self):
        
        self.print_info()
        self._config.provisioner.converge()
        self._config.state.change_state('converged', True)
582623
def _execute_handling(self, *eopatches, **kwargs):
        
        self.private_task_config.start_time = datetime.datetime.now()

        caught_exception = None
        try:
            return_value = self.execute(*eopatches, **kwargs)
        except BaseException as exception:
            caught_exception = exception, sys.exc_info()[2]

        if caught_exception is not None:  # Exception is not raised in except statement to prevent duplicated traceback
            exception, traceback = caught_exception
            raise type(exception)('During execution of task {}: {}'.format(self.__class__.__name__,
                                                                           exception)).with_traceback(traceback)

        self.private_task_config.end_time = datetime.datetime.now()
        return return_value
246638
def do(self, changes, task_handle=taskhandle.NullTaskHandle()):
        
        self.history.do(changes, task_handle=task_handle)
87273
def run(self):
        
        failed_result = None
        for rule in self.rules_list:
            for check, deny in rule:
                if not check():
                    failed_result = (False, deny)
                    break
            else:
                return (True, None)
        return failed_result
303559
def do_actions(self, target_filename, dry_run=False):
        
        for rule in self.action_rules:
            target_filename = rule.do_action(target_filename, dry_run)

        raise StopProcessingException
324329
def _execute(self, *args: str, **kwargs: Any) -> tuple:
        ''''''
        return self.execute(args=args, options=merge_dict(self.options, kwargs)).communicate()
234444
def execute(self):
        
        if self.args and self.argument(0) == "help":
            self.error(self.usage() + "\n\n" + self.help())
            return False

        return True
849857
def run(self, f, *args, **kwargs):
        
        parent = _ACTION_CONTEXT.set(self)
        try:
            return f(*args, **kwargs)
        finally:
            _ACTION_CONTEXT.reset(parent)
190108
def execute(self, i, o):
        
        self.set_style("question", fg="blue")

        if self.needs_config and not self.resolver:
            self._handle_config(self.option("config"))

        return self.handle()
1343931
def perform_action(
            self, action, machines, params, progress_title, success_title):
        """"""
        if len(machines) == 0:
            return 0
        with utils.Spinner() as context:
            return self._async_perform_action(
                context, action, list(machines), params,
                progress_title, success_title)
1167683
def _execute(self, code):
        
        self.globals['example'] = self.example
        eval(code, self.globals)