Execute Downloader
        :param Downloader self: this
979710
def _run(self):
        # type: (Downloader) -> None
        
        # mark start
        self._start_time = blobxfer.util.datetime_now()
        logger.info('blobxfer start time: {0}'.format(self._start_time))
        # ensure destination path
        blobxfer.operations.download.Downloader.ensure_local_destination(
            self._creds, self._spec, self._general_options.dry_run)
        logger.info('downloading blobs/files to local path: {}'.format(
            self._spec.destination.path))
        self._catalog_local_files_for_deletion()
        # initialize resume db if specified
        if self._general_options.resume_file is not None:
            self._resume = blobxfer.operations.resume.DownloadResumeManager(
                self._general_options.resume_file)
        # initialize MD5 processes
        if (self._spec.options.check_file_md5 and
                self._general_options.concurrency.md5_processes > 0):
            self._md5_offload = blobxfer.operations.md5.LocalFileMd5Offload(
                num_workers=self._general_options.concurrency.md5_processes)
            self._md5_offload.initialize_check_thread(
                self._check_for_downloads_from_md5)
        # initialize crypto processes
        if self._general_options.concurrency.crypto_processes > 0:
            self._crypto_offload = blobxfer.operations.crypto.CryptoOffload(
                num_workers=self._general_options.concurrency.crypto_processes)
            self._crypto_offload.initialize_check_thread(
                self._check_for_crypto_done)
        # initialize download threads
        self._initialize_transfer_threads()
        self._initialize_disk_threads()
        # initialize local counters
        files_processed = 0
        skipped_files = 0
        skipped_size = 0
        # iterate through source paths to download
        for src in self._spec.sources:
            for rfile in src.files(
                    self._creds, self._spec.options,
                    self._general_options.dry_run):
                # form local path for remote file
                if (not self._spec.destination.is_dir and
                        self._spec.options.rename):
                    lpath = pathlib.Path(self._spec.destination.path)
                else:
                    lpath = None
                    if self._spec.options.strip_components > 0:
                        _lparts = pathlib.Path(rfile.name).parts
                        _strip = min(
                            (len(_lparts) - 1,
                             self._spec.options.strip_components)
                        )
                        if _strip > 0:
                            lpath = pathlib.Path(*_lparts[_strip:])
                    if lpath is None:
                        lpath = pathlib.Path(rfile.name)
                    lpath = pathlib.Path(self._spec.destination.path) / lpath
                files_processed += 1
                # check on download conditions
                action = self._check_download_conditions(lpath, rfile)
                # remove from delete after set
                try:
                    self._delete_after.remove(lpath)
                except KeyError:
                    pass
                if action == DownloadAction.Skip:
                    skipped_files += 1
                    skipped_size += rfile.size
                    if self._general_options.dry_run:
                        logger.info('[DRY RUN] skipping: {} -> {}'.format(
                            lpath, rfile.path))
                    continue
                # add potential download to set
                dlid = (
                    blobxfer.operations.download.Downloader.
                    create_unique_transfer_operation_id(rfile)
                )
                with self._transfer_lock:
                    self._transfer_set.add(dlid)
                    self._download_total += 1
                    self._download_bytes_total += rfile.size
                # either MD5 check or download now
                if action == DownloadAction.CheckMd5:
                    self._pre_md5_skip_on_check(lpath, rfile)
                elif action == DownloadAction.Download:
                    if self._general_options.dry_run:
                        logger.info(
                            '[DRY RUN] download: {} -> {}'.format(
                                rfile.path, lpath))
                        with self._transfer_lock:
                            self._transfer_set.remove(dlid)
                            self._download_total -= 1
                            self._download_bytes_total -= rfile.size
                    else:
                        self._add_to_download_queue(lpath, rfile)
        # set remote files processed
        with self._md5_meta_lock:
            self._all_remote_files_processed = True
        with self._transfer_lock:
            download_size_mib = (
                self._download_bytes_total / blobxfer.util.MEGABYTE
            )
            logger.debug(
                ('{0} files {1:.4f} MiB filesize and/or lmt_ge '
                 'skipped').format(
                    skipped_files, skipped_size / blobxfer.util.MEGABYTE))
            logger.debug(
                ('{0} remote files processed, waiting for download '
                 'completion of approx. {1:.4f} MiB').format(
                     files_processed, download_size_mib))
        del files_processed
        del skipped_files
        del skipped_size
        # wait for downloads to complete
        self._wait_for_transfer_threads(terminate=False)
        self._wait_for_disk_threads(terminate=False)
        end_time = blobxfer.util.datetime_now()
        # update progress bar
        self._update_progress_bar()
        # check for exceptions
        if len(self._exceptions) > 0:
            logger.error('exceptions encountered while downloading')
            # raise the first one
            raise self._exceptions[0]
        # check for mismatches
        if (self._download_sofar != self._download_total or
                self._download_bytes_sofar != self._download_bytes_total):
            raise RuntimeError(
                'download mismatch: [count={}/{} bytes={}/{}]'.format(
                    self._download_sofar, self._download_total,
                    self._download_bytes_sofar, self._download_bytes_total))
        # delete all remaining local files not accounted for if
        # delete extraneous enabled
        self._delete_extraneous_files()
        # delete resume file if we've gotten this far
        if self._resume is not None:
            self._resume.delete()
        # output throughput
        if self._download_start_time is not None:
            dltime = (end_time - self._download_start_time).total_seconds()
            if dltime == 0:  # noqa
                dltime = 1e-9
            download_size_mib = (
                self._download_bytes_total / blobxfer.util.MEGABYTE
            )
            dlmibspeed = download_size_mib / dltime
            logger.info(
                ('elapsed download + verify time and throughput of {0:.4f} '
                 'GiB: {1:.3f} sec, {2:.4f} Mbps ({3:.3f} MiB/sec)').format(
                     download_size_mib / 1024, dltime, dlmibspeed * 8,
                     dlmibspeed))
        end_time = blobxfer.util.datetime_now()
        logger.info('blobxfer end time: {0} (elapsed: {1:.3f} sec)'.format(
            end_time, (end_time - self._start_time).total_seconds()))
380928
def do_execute(self):
        
        if self.storagehandler is None:
            return "No storage handler available!"
        self.storagehandler.storage[self.resolve_option("storage_name")] = self.input.payload
        self._output.append(self.input)
        return None
601229
void execute() {
    boolean scheduleTaskRunner = false;
    synchronized (this) {
      if (!isThreadScheduled) {
        isThreadScheduled = true;
        scheduleTaskRunner = true;
      }
    }
    if (scheduleTaskRunner) {
      try {
        executor.execute(this);
      } catch (RuntimeException e) {
        // reset state in case of an error so that later calls to execute will actually do something
        synchronized (this) {
          isThreadScheduled = false;
        }
        // Log it and keep going.
        logger.log(
            Level.SEVERE,
            "Exception while running callbacks for " + listener + " on " + executor, 
            e);
        throw e;
      }
    }
  }
561620
def Execute(self, http):
        

        self._Execute(http)

        for key in self.__request_response_handlers:
            response = self.__request_response_handlers[key].response
            callback = self.__request_response_handlers[key].handler

            exception = None

            if response.status_code >= 300:
                exception = exceptions.HttpError.FromResponse(response)

            if callback is not None:
                callback(response, exception)
            if self.__callback is not None:
                self.__callback(response, exception)
886424
def execute(self, *args, **kwargs):
        

        with self:
            self._cursor.execute(*args, **kwargs)
1006778
def execute(self, *args, **kwargs):
        
        args = self.parser.parse_args(*args, **kwargs)
        self.process(args)
496321
public function handle(Installer $installer)
    {
        if (!$this->confirm('Do you wish to continue? [y|N]')) {
            return;
        }

        $name      = $this->argument('name');
        $extension = $this->manager->getAvailableExtensions()->findByName($name);

        if ($extension instanceof ExtensionContract) {
            $installer->run($this, $extension, $this->getValidOptions());
        } else {
            $this->error("Unable to find extension [{$name}].");
        }
    }
1122965
function () {
            if (this._isProcessing) {
                return;
            }
            this.$assert(33, this._logicalPaths.length > 0);
            this._isProcessing = true;
            (require("./IO")).asyncRequest({
                sender : {
                    classpath : this.$classpath,
                    logicalPaths : this._logicalPaths
                },
                url : require("./DownloadMgr").getURLWithTimestamp(this._url), // add a timestamp to the URL if
                // required
                callback : {
                    fn : this._onFileReceive,
                    onerror : this._onFileReceive,
                    scope : this
                },
                expectedResponseType : "text"
            });
        }
784821
def do_execute(self):
        
        for f in self.resolve_option("files"):
            self._output.append(Token(f))
        return None
852462
def execute(self, logger: Logger, options: Dict[str, Dict[str, Any]]) -> T:
        
        in_root_call = False
        if logger is not None:
            # log only for the root object, not for the children that will be created by the code below
            if not hasattr(_BaseParsingPlan.thrd_locals, 'flag_exec') \
                    or _BaseParsingPlan.thrd_locals.flag_exec == 0:
                # print('Executing Parsing Plan for ' + str(self))
                logger.debug('Executing Parsing Plan for [{location}]'
                             ''.format(location=self.obj_on_fs_to_parse.get_pretty_location(append_file_ext=False)))
                _BaseParsingPlan.thrd_locals.flag_exec = 1
                in_root_call = True

        # Common log message
        logger.debug('(P) ' + get_parsing_plan_log_str(self.obj_on_fs_to_parse, self.obj_type,
                                                       log_only_last=not in_root_call, parser=self.parser))

        try:
            res = super(_BaseParsingPlan, self).execute(logger, options)
            if logger.isEnabledFor(DEBUG):
                logger.info('(P) {loc} -> {type} SUCCESS !'
                            ''.format(loc=self.obj_on_fs_to_parse.get_pretty_location(
                    blank_parent_part=not GLOBAL_CONFIG.full_paths_in_logs,
                    compact_file_ext=True),
                    type=get_pretty_type_str(self.obj_type)))
            else:
                logger.info('SUCCESS parsed [{loc}] as a [{type}] successfully. Parser used was [{parser}]'
                            ''.format(loc=self.obj_on_fs_to_parse.get_pretty_location(compact_file_ext=True),
                                      type=get_pretty_type_str(self.obj_type),
                                      parser=str(self.parser)))
            if in_root_call:
                # print('Completed parsing successfully')
                logger.debug('Completed parsing successfully')
            return res

        finally:
            # remove threadlocal flag if needed
            if in_root_call:
                _BaseParsingPlan.thrd_locals.flag_exec = 0
824026
def run(self):
        
        output = shellout('wget -q "{url}" -O {output}', url=self.url)
        luigi.LocalTarget(output).move(self.output().path)
182646
def execute(self):
        
        self.response = MetricsResponse.load_http_response(
            self.session.post(self.HTTP_ENDPOINT, data=self.json_payload)
        )
        return self.response.metrics
1088104
void start() {
    /* make sure any currently running dispatchers are stopped */
    stop();

    /* create the download dispatcher and start it. */
    for (int i = 0; i < dispatchers.length; i++) {
      DownloadDispatcher dispatcher = new DownloadDispatcher(downloadQueue, delivery, logger);
      dispatchers[i] = dispatcher;
      dispatcher.start();
    }

    logger.log("Thread pool size: " + dispatchers.length);
  }
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)
887939
def run(self):
        '''
        
        '''
        #Callback
        self._debug('Provider', 'run', 'Running pre-download callback.')
        self._pre_download()

        url = None
        out = None
        success = False

        try:
            url = Provider._download(self.get_download_url())

            #Callback
            self._debug('Provider', 'run', 'Running in-download callback.')
            self._in_download(url)

            #Invalid filename character fix
            if IS_WINDOWS:
                self.filename = re.sub(ur'[?\/\\<>:"*|]+', '_', self.filename, re.UNICODE)
            self.full_filename = '%s.%s' % (self.filename, self.fileext)
            self._debug('Provider', 'run', 'full_filename', self.full_filename)

            if not os.path.isfile(self.full_filename):
                #Save the stream to the output file
                out = open(self.full_filename, 'wb')
                out.write(url.read())
            else:
                #Skipping
                #TODO: warn
                pass

            #We are done therefore success!
            success = True
        finally:
            if out is not None:
                out.close()
            if url is not None:
                url.close()

            #Callback
            self._debug('Provider', 'run', 'Running post-download callback.')
            self._debug('Provider', 'run', 'success', success)
            self._post_download(success)
972217
def download_file(self, *args, **kwargs):
        """"""
        return download_file(*args, **self._merge_overrides(**kwargs)).run()
1218808
def execute(self):
        
        self.print_info()

        if not self._config.provisioner.playbooks.cleanup:
            msg = 'Skipping, cleanup playbook not configured.'
            LOG.warn(msg)
            return

        self._config.provisioner.cleanup()