Append a Remind command generated from the iCalendar to the file
175799
def append_vobject(self, ical, filename=None):
        """"""
        if not filename:
            filename = self._filename
        elif filename not in self._reminders:
            return

        with self._lock:
            outdat = self.to_reminders(ical)
            open(filename, 'a').write(outdat)

        return Remind._get_uid(outdat)
618013
def send_reminder(self, user, sender=None, **kwargs):
        """"""
        if user.is_active:
            return False
        token = RegistrationTokenGenerator().make_token(user)
        kwargs.update({"token": token})
        self.email_message(
            user, self.reminder_subject, self.reminder_body, sender, **kwargs
        ).send()
150105
function(callback) {

			fs.appendFileSync(outputFile,"\r\n")
			fs.appendFileSync(outputFile,"    return puglatizer;\r\n")
			fs.appendFileSync(outputFile,"}));\r\n")
			return callback()
		}
633673
function(arg) {
  var args = Array.isArray(arg) ? arg : [].slice.call(arguments);
  last = new Date();
  fs.write(tmpfile, JSON.stringify(args) + '\n', 'a');
}
175895
public function remind()
    {
        $uri = $this->uri() . $this->id . '/' . self::REMIND;

        return static::put($this->client, $uri);
    }
78651
def append(self, item):
        
        self.real_list.append(item)
        self.observer(UpdateType.CREATED, item, len(self.real_list) - 1)
1253220
def to_reminders(self, ical, label=None, priority=None, tags=None,
                     tail=None, sep=" ", postdate=None, posttime=None):
        """"""
        if not hasattr(ical, 'vevent_list'):
            return ''

        reminders = [self.to_remind(vevent, label, priority, tags, tail, sep,
                                    postdate, posttime)
                     for vevent in ical.vevent_list]
        return ''.join(reminders)
639002
def append(self, data):
        """"""
        index = self.n_blocks # note off by one so use as index
        self[index] = data
        self.refs.append(data)
1213253
private void performNextWrite() {
        Append append = getNextAppend();
        if (append == null) {
            return;
        }
        long traceId = LoggerHelpers.traceEnter(log, "storeAppend", append);
        Timer timer = new Timer();
        storeAppend(append)
                .whenComplete((v, e) -> {
                    handleAppendResult(append, e, timer);
                    LoggerHelpers.traceLeave(log, "storeAppend", traceId, v, e);
                })
                .whenComplete((v, e) -> append.getData().release());
    }
711511
protected void generatePreamble(IStyleAppendable it) {
		clearHilights();
		final String nm = getLanguageSimpleName().toLowerCase();
		final String cmd = Strings.toFirstUpper(getLanguageSimpleName().toLowerCase()) + "HiLink"; //$NON-NLS-1$
		appendComment(it, "Quit when a syntax file was already loaded"); //$NON-NLS-1$
		appendCmd(it, false, "if !exists(\"main_syntax\")").increaseIndentation().newLine(); //$NON-NLS-1$
		appendCmd(it, false, "if exists(\"b:current_syntax\")").increaseIndentation().newLine(); //$NON-NLS-1$
		appendCmd(it, false, "finish").decreaseIndentation().newLine(); //$NON-NLS-1$
		appendCmd(it, "endif"); //$NON-NLS-1$
		appendComment(it, "we define it here so that included files can test for it"); //$NON-NLS-1$
		appendCmd(it, "let main_syntax='" + nm + "'"); //$NON-NLS-1$ //$NON-NLS-2$
		appendCmd(it, false, "syn region " + nm + "Fold start=\"{\" end=\"}\" transparent fold"); //$NON-NLS-1$ //$NON-NLS-2$
		it.decreaseIndentation().newLine();
		appendCmd(it, "endif"); //$NON-NLS-1$
		it.newLine();
		appendCmd(it, "let s:cpo_save = &cpo"); //$NON-NLS-1$
		appendCmd(it, "set cpo&vim"); //$NON-NLS-1$
		it.newLine();
		appendComment(it, "don't use standard HiLink, it will not work with included syntax files"); //$NON-NLS-1$
		appendCmd(it, false, "if version < 508").increaseIndentation().newLine(); //$NON-NLS-1$
		appendCmd(it, false, "command! -nargs=+ " + cmd + " hi link <args>").decreaseIndentation().newLine(); //$NON-NLS-1$ //$NON-NLS-2$
		appendCmd(it, false, "else").increaseIndentation().newLine(); //$NON-NLS-1$
		appendCmd(it, false, "command! -nargs=+ " + cmd + " hi def link <args>").decreaseIndentation().newLine(); //$NON-NLS-1$ //$NON-NLS-2$
		appendCmd(it, "endif"); //$NON-NLS-1$
		it.newLine();
		appendComment(it, "some characters that cannot be in a SARL program (outside a string)"); //$NON-NLS-1$
		appendMatch(it, nm + "Error", "[\\\\`]"); //$NON-NLS-1$ //$NON-NLS-2$
		it.newLine();
	}
429443
def add_timeline_callback(self, timeline_events, callback):
        """"""
        if not timeline_events:
            return False

        if not isinstance(timeline_events, (tuple, list)):
            timeline_events = [timeline_events]

        for timeline_event in timeline_events:
            if not isinstance(timeline_event, dict):
                raise AbodeException((ERROR.EVENT_CODE_MISSING))

            event_code = timeline_event.get('event_code')

            if not event_code:
                raise AbodeException((ERROR.EVENT_CODE_MISSING))

            _LOGGER.debug("Subscribing to timeline event: %s", timeline_event)

            self._timeline_callbacks[event_code].append((callback))

        return True
137649
def get_reminder(self, reminder_key):
		'''
		'''
		#required sanity check
		if reminder_key:
			return requests.codes.bad_request, None
		
		uri = '/'.join([
						self.api_uri,
						self.reminders_suffix,
						reminder_key
						])

		return self._req('get', uri)
847902
public void addAppointments(Anniversary recAnniversary, Calendar calStart, Calendar calEnd)
    {
        try {
            Converter.initGlobals();
            Calendar calendar = Converter.gCalendar;
            
            Record recRepeat = ((ReferenceField)this.getField(AnnivMaster.REPEAT_INTERVAL_ID)).getReference();
            String strRepeat = null;
            if (recRepeat != null)
                strRepeat = recRepeat.getField(RepeatInterval.DESCRIPTION).toString();
            char chRepeat;
            if ((strRepeat == null) || (strRepeat.length() == 0))
                chRepeat = 'Y';
            else
                chRepeat = strRepeat.toUpperCase().charAt(0);
            int iRepeatCode;
            if (chRepeat == 'D')
                iRepeatCode = Calendar.DATE;
            else if (chRepeat == 'W')
                iRepeatCode = Calendar.WEEK_OF_YEAR;
            else if (chRepeat == 'M')
                iRepeatCode = Calendar.MONTH;
            else
                iRepeatCode = Calendar.YEAR;
            short sRepeatCount = (short)this.getField(AnnivMaster.REPEAT_COUNT).getValue();
            if (sRepeatCount == 0)
                sRepeatCount = 1;
            Date timeStart = ((DateTimeField)this.getField(AnnivMaster.START_DATE_TIME)).getDateTime();
            Date timeEnd = ((DateTimeField)this.getField(AnnivMaster.END_DATE_TIME)).getDateTime();
            long lTimeLength = -1;
            if (timeEnd != null)
                lTimeLength = timeEnd.getTime() - timeStart.getTime();
        
            calendar.setTime(timeStart);
            for (int i = 0; i < 100; i++)
            {
                if ((calendar.after(calStart))
                    && (calendar.before(calEnd)))
                {
                    timeStart = calendar.getTime();
                    timeEnd = null;
                    if (lTimeLength != -1)
                        timeEnd = new Date(timeStart.getTime() + lTimeLength);
        
                    recAnniversary.addNew();
                    ((DateTimeField)recAnniversary.getField(Anniversary.START_DATE_TIME)).setDateTime(timeStart, false, DBConstants.SCREEN_MOVE);
                    if (timeEnd != null)
                        ((DateTimeField)recAnniversary.getField(Anniversary.END_DATE_TIME)).setDateTime(timeEnd, false, DBConstants.SCREEN_MOVE);
                    recAnniversary.getField(Anniversary.DESCRIPTION).moveFieldToThis(this.getField(AnnivMaster.DESCRIPTION));
                    ((ReferenceField)recAnniversary.getField(Anniversary.ANNIV_MASTER_ID)).setReference(this);
                    recAnniversary.getField(Anniversary.CALENDAR_CATEGORY_ID).moveFieldToThis(this.getField(AnnivMaster.CALENDAR_CATEGORY_ID));
                    recAnniversary.getField(Anniversary.HIDDEN).moveFieldToThis(this.getField(AnnivMaster.HIDDEN));
                    // Don't move properties (you will have to read the AnnivMaster to get the properties)
                    recAnniversary.add();
                }
                calendar.add(iRepeatCode, sRepeatCount);
            }
        } catch (DBException ex) {
            ex.printStackTrace();
        }
    }
689987
function touch(file) {
  if (!exists(file)) {
    write(file, '');
  }
  const now = new Date();
  setAttrs(file, {atime: now, mtime: now});
}
421452
def _callback(self):
        """"""
        if self.debug:
            # Show the number of open file descriptors
            print(">>>>> _callback: Number of open file descriptors: %s" % get_open_fds())

        self._runem_all()

        # Mission accomplished. Shutdown the scheduler.
        all_ok = self.flow.all_ok
        if all_ok:
            return self.shutdown(msg="All tasks have reached S_OK. Will shutdown the scheduler and exit")

        # Handle failures.
        err_lines = []

        # Shall we send a reminder to the user?
        delta_etime = self.get_delta_etime()

        if delta_etime.total_seconds() > self.num_reminders * self.remindme_s:
            self.num_reminders += 1
            msg = ("Just to remind you that the scheduler with pid %s, flow %s\n has been running for %s " %
                  (self.pid, self.flow, delta_etime))
            retcode = self.send_email(msg, tag="[REMINDER]")

            if retcode:
                # Cannot send mail, shutdown now!
                msg += ("\nThe scheduler tried to send an e-mail to remind the user\n" +
                        " but send_email returned %d. Error is not critical though!" % retcode)
                print(msg)
                #err_lines.append(msg)

        #if delta_etime.total_seconds() > self.max_etime_s:
        #    err_lines.append("\nExceeded max_etime_s %s. Will shutdown the scheduler and exit" % self.max_etime_s)

        # Too many exceptions. Shutdown the scheduler.
        if self.num_excs > self.max_num_pyexcs:
            msg = "Number of exceptions %s > %s. Will shutdown the scheduler and exit" % (
                self.num_excs, self.max_num_pyexcs)
            err_lines.append(boxed(msg))

        # Paranoid check: disable the scheduler if we have submitted
        # too many jobs (it might be due to some bug or other external reasons
        # such as race conditions between difference callbacks!)
        if self.nlaunch > self.safety_ratio * self.flow.num_tasks:
            msg = "Too many jobs launched %d. Total number of tasks = %s, Will shutdown the scheduler and exit" % (
                self.nlaunch, self.flow.num_tasks)
            err_lines.append(boxed(msg))

        # Count the number of tasks with status == S_ERROR.
        if self.flow.num_errored_tasks > self.max_num_abierrs:
            msg = "Number of tasks with ERROR status %s > %s. Will shutdown the scheduler and exit" % (
                self.flow.num_errored_tasks, self.max_num_abierrs)
            err_lines.append(boxed(msg))

        # Test on the presence of deadlocks.
        g = self.flow.find_deadlocks()
        if g.deadlocked:
            # Check the flow again so that status are updated.
            self.flow.check_status()

            g = self.flow.find_deadlocks()
            #print("deadlocked:\n", g.deadlocked, "\nrunnables:\n", g.runnables, "\nrunning\n", g.running)
            print("deadlocked:", len(g.deadlocked), ", runnables:", len(g.runnables), ", running:", len(g.running))
            if g.deadlocked and not g.runnables and not g.running:
                err_lines.append("No runnable job with deadlocked tasks:\n%s." % str(g.deadlocked))

        if not g.runnables and not g.running:
            # Check the flow again so that status are updated.
            self.flow.check_status()
            g = self.flow.find_deadlocks()
            if not g.runnables and not g.running:
                err_lines.append("No task is running and cannot find other tasks to submit.")

        # Something wrong. Quit
        if err_lines:
            # Cancel all jobs.
            if self.killjobs_if_errors:
                cprint("killjobs_if_errors set to 'yes' in scheduler file. Will kill jobs before exiting.", "yellow")
                try:
                    num_cancelled = 0
                    for task in self.flow.iflat_tasks():
                        num_cancelled += task.cancel()
                    cprint("Killed %d tasks" % num_cancelled, "yellow")
                except Exception as exc:
                    cprint("Exception while trying to kill jobs:\n%s" % str(exc), "red")

            self.shutdown("\n".join(err_lines))

        return len(self.exceptions)
451099
def reminders_complete(self, *, reminder: str, **kwargs) -> SlackResponse:
        
        self._validate_xoxp_token()
        kwargs.update({"reminder": reminder})
        return self.api_call("reminders.complete", json=kwargs)
530239
private void appendPersistentIndex(short[] code) {
		// write id and code
		TupleOutput output = new TupleOutput();
		for (int i = 0; i < numSubVectors; i++) {
			output.writeShort(code[i]);
		}
		DatabaseEntry data = new DatabaseEntry();
		TupleBinding.outputToEntry(output, data);
		DatabaseEntry key = new DatabaseEntry();
		IntegerBinding.intToEntry(loadCounter, key);
		iidToPqDB.put(null, key, data);
	}