Provide a convenient excuse
486349
def pmxbot_excuse(self, rest):
        ""
        args = rest.split(' ')[:2]
        parser = argparse.ArgumentParser()
        parser.add_argument('word', nargs="?")
        parser.add_argument('index', type=int, nargs="?")
        args = parser.parse_args(args)
        if not args.word:
            return self.get()
        return self.find(args.word, args.index)
768637
private Throwable getCause(Throwable t) {
        Throwable cause = t.getCause();
        if (t.getCause() != null) {
            return cause;
        } else {
            return t;
        }
    }
816047
def cancel(self):
        """"""
        d = self.request('post', self.instance_url() + '/cancel')
        return d.addCallback(self.refresh_from)
1016963
def message(self, message, item, extra):
        """"""
        return (
            super(CoconutInternalException, self).message(message, item, extra)
            + " " + report_this_text
        )
1257649
def throw_if_bad_response(response):
    """"""
    try:
        response.raise_for_status()
    except RequestException:
        try:
            msg = 'Response code: {}; response body:\n{}'.format(response.status_code, json.dumps(response.json(), indent=2))
            raise CerberusClientException(msg)
        except ValueError:
            msg = 'Response code: {}; response body:\n{}'.format(response.status_code, response.text)
            raise CerberusClientException(msg)
526309
def make_ready(self):
        """"""
        SCons.Taskmaster.OutOfDateTask.make_ready(self)
        if self.out_of_date and self.options.debug_explain:
            explanation = self.out_of_date[0].explain()
            if explanation:
                sys.stdout.write("scons: " + explanation)
491435
def _raise_exception(cls, reason, data=None):
    
    text_dict = {
        "error": reason
    }

    if data is not None:
        text_dict["errors"] = data

    raise cls(
        text=json.dumps(text_dict),
        content_type="application/json"
    )
1010948
public static <O extends Object> void notEmpty(Iterable<O> coll)  {
		if(!validation) return;
		notNull(coll);
		if(!coll.iterator().hasNext())
			throw new ParameterException(ErrorCode.EMPTY);
	}
724946
def strip_prompt(self, a_string):
        """"""
        expect_string = r"^(OK|ERROR|Command not recognized\.)$"
        response_list = a_string.split(self.RESPONSE_RETURN)
        last_line = response_list[-1]
        if re.search(expect_string, last_line):
            return self.RESPONSE_RETURN.join(response_list[:-1])
        else:
            return a_string
724634
def request(order_Id,amount,billing_cust_name,billing_cust_address,billing_cust_city,billing_zip_code,billing_cust_state,billing_cust_country,billing_cust_email,billing_cust_tel,billing_cust_notes="",delivery_cust_name="",delivery_cust_address="",delivery_cust_city="",delivery_zip_code="",delivery_cust_state="",delivery_cust_country="",delivery_cust_email="",delivery_cust_tel="",delivery_cust_notes="")
  		checksum = getChecksum(order_Id,amount)
  		raw_request = "Merchant_Id=#{@merchant_Id}&Amount=#{amount}&Order_Id=#{order_Id}&Redirect_Url=#{@redirect_Url}&billing_cust_name=#{billing_cust_name}&billing_cust_address=#{billing_cust_address}&billing_cust_country=#{billing_cust_country}&billing_cust_state=#{billing_cust_state}&billing_cust_city=#{billing_cust_city}&billing_zip_code=#{billing_zip_code}&billing_cust_tel=#{billing_cust_tel}&billing_cust_email=#{billing_cust_email}&billing_cust_notes=#{billing_cust_notes}&delivery_cust_name=#{delivery_cust_name}&delivery_cust_address=#{delivery_cust_address}&delivery_cust_country=#{delivery_cust_country}&delivery_cust_state=#{delivery_cust_state}&delivery_cust_city=#{delivery_cust_city}&delivery_zip_code=#{delivery_zip_code}&delivery_cust_tel=#{delivery_cust_tel}&billing_cust_notes=#{delivery_cust_notes}&Checksum=#{checksum.to_s}"
  		return encrypt_data(raw_request,@working_Key,"AES-128-CBC")[0]
  	end
1154625
function provide() {
    if (console) console.warn('@provide is now deprecated. Use @connect instead');
    return composeWithContext(Array.prototype.slice.call(arguments))
}
1062634
def onOffset(self, date):
        """"""
        return date.day == _days_in_month(date) and date.month == self.month
295696
private static String formatCause(Throwable cause) {
    if(cause == null) {
      return "";
    }
    String message = cause.getMessage();
    return "\n" + (message != null ? message : cause.toString());
  }
494950
def reject(self, reason):
        """"""
        if self._state != 'pending':
            raise RuntimeError('Promise is no longer pending.')

        self.reason = reason
        self._state = 'rejected'
        errbacks = self._errbacks
        self._errbacks = None
        for errback in errbacks:
            errback(reason)
226311
def wait(self, **kwargs):
        """"""
        if self.request:
            self.request.wait(**kwargs)
            self.request = None
        return self.inflate()
1085569
def away(self, message=None):
        """"""
        cmd = 'AWAY'
        if message:
            cmd += ' :' + message
        self.send_line(cmd)
844112
def handle(self, **options):
        """"""

        with open('eighth_absentees.csv', 'r') as absopen:
            absences = csv.reader(absopen)
            for row in absences:
                bid, uid = row
                try:
                    usr = User.objects.get(id=uid)
                except User.DoesNotExist:
                    self.stdout.write("User {} doesn't exist, bid {}".format(usr, bid))
                else:
                    try:
                        blk = EighthBlock.objects.get(id=bid)
                    except EighthBlock.DoesNotExist:
                        self.stdout.write("Block {} doesn't exist, with user {}".format(bid, uid))
                    else:
                        usr_signup = EighthSignup.objects.filter(user=usr, scheduled_activity__block=blk)
                        self.stdout.write("{} signup: {}".format(usr, usr_signup))
                        if usr_signup.count() == 0:
                            other_abs_act, _ = EighthActivity.objects.get_or_create(name="z-OTHER ABSENCE (transferred from Iodine)",
                                                                                    administrative=True)
                            other_abs_sch, _ = EighthScheduledActivity.objects.get_or_create(block=blk, activity=other_abs_act)
                            other_abs_su = EighthSignup.objects.create(user=usr, scheduled_activity=other_abs_sch, was_absent=True)
                            self.stdout.write("{} Signup on {} created: {}".format(usr, bid, other_abs_su))
                        else:
                            s = usr_signup[0]
                            s.was_absent = True
                            s.save()
                            sa = s.scheduled_activity
                            sa.attendance_taken = True
                            sa.save()
                            self.stdout.write("{} Signup on {} modified: {}".format(usr, bid, usr_signup[0]))

        self.stdout.write("Done.")