Schedule a mass mail blast from previous blast

@param String|Integer $blast_id
@param String $schedule_time
@param array $options
@link http://docs.sailthru.com/api/blast
@return array API result
545748
public function scheduleBlastFromBlast($blast_id, $schedule_time, $options = [ ]) {
        $data = $options;
        $data['copy_blast'] = $blast_id;
        $data['schedule_time'] = $schedule_time;
        return $this->apiPost('blast', $data);
    }
1338595
public function remove(string $schedule, array $params = [])
    {
        $path = $this->buildSchedulesPath($schedule);

        return $this->delete($path, $params);
    }
1135638
public function schedule($doAt, $class, $args = [], $retry = true, $queue = self::QUEUE)
    {
        $jobId = $this->idGenerator->generate();
        $this->atomicPush($jobId, $class, $args, $queue, $retry, $doAt);

        return $jobId;
    }
1132361
public function timeFieldRow(IFormModel $model, $property, array $options = [])
    {
        $element = $this->getField($model, $property);
        $options['id'] = $element['id'];

        return Html::openTag('div', $this->getBlock('block', $options)).
        Html::label($model->getLabel($property), $element['id'], $this->getBlock('label', $options)).
        $this->timeField($model, $property, $options).
        Html::closeTag('div');
    }
328545
public JsonResponse scheduleBlastFromTemplate(String template, String list, Date scheduleTime, Blast blast) throws IOException {
        blast.setCopyTemplate(template);
        blast.setList(list);
        blast.setScheduleTime(scheduleTime);
        return apiPost(blast);
    }
1198694
protected function _fetchCmd(Horde_Imap_Client_Fetch_Results $results,
                                 $options)
    {
        // Grab sequence IDs - IDs will always be the message number for
        // POP3 fetch commands.
        $seq_ids = $this->_getSeqIds($options['ids']);
        if (empty($seq_ids)) {
            return;
        }

        $lookup = $options['ids']->sequence
            ? array_combine($seq_ids, $seq_ids)
            : $this->_pop3Cache('uidl');

        foreach ($options['_query'] as $type => $c_val) {
            switch ($type) {
            case Horde_Imap_Client::FETCH_FULLMSG:
                foreach ($seq_ids as $id) {
                    $tmp = $this->_pop3Cache('msg', $id);

                    if (empty($c_val['start']) && empty($c_val['length'])) {
                        $tmp2 = fopen('php://temp', 'r+');
                        stream_copy_to_stream($tmp, $tmp2, empty($c_val['length']) ? -1 : $c_val['length'], empty($c_val['start']) ? 0 : $c_val['start']);
                        $results->get($lookup[$id])->setFullMsg($tmp2);
                    } else {
                        $results->get($lookup[$id])->setFullMsg($tmp);
                    }
                }
                break;

            case Horde_Imap_Client::FETCH_HEADERTEXT:
                // Ignore 'peek' option
                foreach ($c_val as $key => $val) {
                    foreach ($seq_ids as $id) {
                        /* Message header can be retrieved via TOP, if the
                         * command is available. */
                        try {
                            $tmp = ($key == 0)
                                ? $this->_pop3Cache('hdr', $id)
                                : Horde_Mime_Part::getRawPartText(stream_get_contents($this->_pop3Cache('msg', $id)), 'header', $key);
                            $results->get($lookup[$id])->setHeaderText($key, $this->_processString($tmp, $c_val));
                        } catch (Horde_Mime_Exception $e) {}
                    }
                }
                break;

            case Horde_Imap_Client::FETCH_BODYTEXT:
                // Ignore 'peek' option
                foreach ($c_val as $key => $val) {
                    foreach ($seq_ids as $id) {
                        try {
                            $results->get($lookup[$id])->setBodyText($key, $this->_processString(Horde_Mime_Part::getRawPartText(stream_get_contents($this->_pop3Cache('msg', $id)), 'body', $key), $val));
                        } catch (Horde_Mime_Exception $e) {}
                    }
                }
                break;

            case Horde_Imap_Client::FETCH_MIMEHEADER:
                // Ignore 'peek' option
                foreach ($c_val as $key => $val) {
                    foreach ($seq_ids as $id) {
                        try {
                            $results->get($lookup[$id])->setMimeHeader($key, $this->_processString(Horde_Mime_Part::getRawPartText(stream_get_contents($this->_pop3Cache('msg', $id)), 'header', $key), $val));
                        } catch (Horde_Mime_Exception $e) {}
                    }
                }
                break;

            case Horde_Imap_Client::FETCH_BODYPART:
                // Ignore 'decode', 'peek'
                foreach ($c_val as $key => $val) {
                    foreach ($seq_ids as $id) {
                        try {
                            $results->get($lookup[$id])->setBodyPart($key, $this->_processString(Horde_Mime_Part::getRawPartText(stream_get_contents($this->_pop3Cache('msg', $id)), 'body', $key), $val));
                        } catch (Horde_Mime_Exception $e) {}
                    }
                }
                break;

            case Horde_Imap_Client::FETCH_HEADERS:
                // Ignore 'length', 'peek'
                foreach ($seq_ids as $id) {
                    $ob = $this->_pop3Cache('hdrob', $id);
                    foreach ($c_val as $key => $val) {
                        $tmp = $ob;

                        if (empty($val['notsearch'])) {
                            $tmp2 = $tmp->toArray(array('nowrap' => true));
                            foreach (array_keys($tmp2) as $hdr) {
                                if (!in_array($hdr, $val['headers'])) {
                                    unset($tmp[$hdr]);
                                }
                            }
                        } else {
                            foreach ($val['headers'] as $hdr) {
                                unset($tmp[$hdr]);
                            }
                        }

                        $results->get($lookup[$id])->setHeaders($key, $tmp);
                    }
                }
                break;

            case Horde_Imap_Client::FETCH_STRUCTURE:
                foreach ($seq_ids as $id) {
                    if ($ptr = $this->_pop3Cache('msg', $id)) {
                        try {
                            $results->get($lookup[$id])->setStructure(Horde_Mime_Part::parseMessage(stream_get_contents($ptr), array('no_body' => true)));
                        } catch (Horde_Exception $e) {}
                    }
                }
                break;

            case Horde_Imap_Client::FETCH_ENVELOPE:
                foreach ($seq_ids as $id) {
                    $tmp = $this->_pop3Cache('hdrob', $id);
                    $results->get($lookup[$id])->setEnvelope(array(
                        'date' => $tmp['Date'],
                        'subject' => $tmp['Subject'],
                        'from' => ($h = $tmp['From']) ? $h->getAddressList(true) : null,
                        'sender' => ($h = $tmp['Sender']) ? $h->getAddressList(true) : null,
                        'reply_to' => ($h = $tmp['Reply-to']) ? $h->getAddressList(true) : null,
                        'to' => ($h = $tmp['To']) ? $h->getAddressList(true) : null,
                        'cc' => ($h = $tmp['Cc']) ? $h->getAddressList(true) : null,
                        'bcc' => ($h = $tmp['Bcc']) ? $h->getAddressList(true) : null,
                        'in_reply_to' => $tmp['In-Reply-To'],
                        'message_id' => $tmp['Message-ID']
                    ));
                }
                break;

            case Horde_Imap_Client::FETCH_IMAPDATE:
                foreach ($seq_ids as $id) {
                    $tmp = $this->_pop3Cache('hdrob', $id);
                    $results->get($lookup[$id])->setImapDate($tmp['Date']);
                }
                break;

            case Horde_Imap_Client::FETCH_SIZE:
                $sizelist = $this->_pop3Cache('size');
                foreach ($seq_ids as $id) {
                    $results->get($lookup[$id])->setSize($sizelist[$id]);
                }
                break;

            case Horde_Imap_Client::FETCH_SEQ:
                foreach ($seq_ids as $id) {
                    $results->get($lookup[$id])->setSeq($id);
                }
                break;

            case Horde_Imap_Client::FETCH_UID:
                $uidllist = $this->_pop3Cache('uidl');
                foreach ($seq_ids as $id) {
                    if (isset($uidllist[$id])) {
                        $results->get($lookup[$id])->setUid($uidllist[$id]);
                    }
                }
                break;
            }
        }
    }
129304
public function schedule($postId)
    {
        if ($postId !== 'options' || !isset($_GET['page']) || $_GET['page'] !== 'acf-options-feedback-options') {
            return;
        }

        wp_unschedule_hook('customer-feedback/email_summary');
        wp_clear_scheduled_hook('customer-feedback/email_summary');

        $summaries = get_field('customer_feedback_summary', 'option');

        if (empty($summaries)) {
            return;
        }

        foreach ($summaries as $summary) {
            wp_schedule_event(
                strtotime('tomorrow midnight -3 hour'),
                $summary['interval'],
                'customer-feedback/email_summary',
                array(
                    $summary['email_address'],
                    $summary['interval']
                )
            );
        }
    }
996800
public Scheduler schedule(String id, String pattern, Task task) {
		return schedule(id, new CronPattern(pattern), task);
	}
1158764
protected function timefield_pagination_from(
        $field,
        $timefrom,
        $lastseentime = null,
        $lastseenid = null,
        $withduration = true
    ) {
        $where = '';
        $params = [];

        if ($lastseentime && $lastseentime >= $timefrom) {
            $where = '((timesort = :timefrom1 AND e.id > :timefromid) OR timesort > :timefrom2)';
            if ($field === 'timestart') {
                $where = '((timestart = :timefrom1 AND e.id > :timefromid) OR timestart > :timefrom2' .
                       ($withduration ? ' OR timestart + timeduration > :timefrom3' : '') . ')';
            }
            $params['timefromid'] = $lastseenid;
            $params['timefrom1'] = $lastseentime;
            $params['timefrom2'] = $lastseentime;
            $params['timefrom3'] = $lastseentime;
        } else {
            $where = 'timesort >= :timefrom';
            if ($field === 'timestart') {
                $where = '(timestart >= :timefrom' .
                       ($withduration ? ' OR timestart + timeduration > :timefrom2' : '') . ')';
            }

            $params['timefrom'] = $timefrom;
            $params['timefrom2'] = $timefrom;
        }

        return ['where' => [$where], 'params' => $params];
    }
7351
public function removeScheduledCancellation(string $id, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/remove_scheduled_cancellation', $id);

        return $this->post($url, [], $headers);
    }
677175
def run(self, schedule_id, **kwargs):
        
        subscriptions = Subscription.objects.filter(
            schedule_id=schedule_id, active=True, completed=False, process_status=0
        ).values("id")
        for subscription in subscriptions.iterator():
            send_next_message.delay(str(subscription["id"]))
528221
public function opts(array $options)
    {
        // provide a new instance of the scheduler class if this
        // is the first method that was called.  This allows for
        // $scheduler->opts() to return a new instance of the
        // scheduler when it's first called
        if (count($this->arguments) == 0) {
            $scheduler = App::make(get_called_class());
            $scheduler->setOptions($options);

            return $scheduler;
        }

        $this->setOptions($options);

        return $this;
    }
241629
public function get($teamId, $jobId, $optParams = array()) {
      $params = array('teamId' => $teamId, 'jobId' => $jobId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Google_Schedule($data);
      } else {
        return $data;
      }
    }
611156
public function processBlastQueryJob($blast_id, $report_email = false, $postback_url = false, array $options = [ ]) {
        return $this->processJob('blast_query', [ 'blast_id' => $blast_id ], $report_email, $postback_url, [ ], $options);
    }
818189
def get_scheduling_block_ids():
    """"""
    ids = [key.split('/')[-1]
           for key in DB.keys(pattern='scheduling_block/*')]
    return sorted(ids)
460526
public function schedule($schedule_time, $schedule_time_b = null) {
        $payload = array(
            'cid' => $this->cid,
            'schedule_time' => $schedule_time,
            'schedule_time_b' => $schedule_time_b
        );
        $apiCall = 'campaigns/schedule';
        $data = $this->requestMonkey($apiCall, $payload);
        $data = json_decode($data, true);
        if (isset($data['error']))
            throw new MailchimpAPIException($data);
        else
            return true;
    }
211305
def run_blast_commands(ncbicommandline_method, **keywords):
    

    # temporary files for output
    blast_out_tmp = tempfile.NamedTemporaryFile(mode="w+",delete=False)
    keywords['out'] = blast_out_tmp.name

    # unpack query temp file object
    query_file_object_tmp = keywords['query']
    keywords['query'] = query_file_object_tmp.name

    stderr = ''
    error_string = ''
    try:
        # formating blastplus command
        blastplusx_cline = ncbicommandline_method(**keywords)
        stdout, stderr = blastplusx_cline()

    except ApplicationError as e:
        error_string = "Runtime error: " + stderr + "\n" + e.cmd

    # remove query temp file
    os.unlink(query_file_object_tmp.name)
    # os.remove(query_file_object_tmp.name)

    return blast_out_tmp, error_string