Parses the new language questions catalog and indexes it.

@param data {string}
@param onProgress {function} an optional progress listener. This should receive progress id, total, completed
@returns {Promise}
766751
function(data, onProgress) {
        onProgress = onProgress || function() {};
        return new Promise(function(resolve, reject) {
            try {
                let obj = JSON.parse(data);
                _.forEach(obj.languages, function (questionnaire, index) {
                    // format
                    questionnaire.language_slug = questionnaire.slug;
                    questionnaire.language_name = questionnaire.name;
                    questionnaire.td_id = questionnaire.questionnaire_id;
                    questionnaire.language_direction = questionnaire.dir.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';

                    try {
                        let id = library.addQuestionnaire(questionnaire);
                        if (id > 0) {
                            // add questions
                            _.forEach(questionnaire.questions, function (question, n) {
                                // format question
                                question.is_required = question.required ? 1 : 0;
                                question.depends_on = question.depends_on === null ? -1 : question.depends_on;
                                question.td_id = question.id;

                                try {
                                    library.addQuestion(question, id);
                                } catch (err) {
                                    console.error('Failed to add question', question);
                                    reject(err);
                                    return;
                                }
                                // broadcast itemized progress if there is only one questionnaire
                                if (obj.languages.length == 1) {
                                    onProgress(questionnaire.questions.length, n + 1);
                                }
                            });
                        } else {
                            console.error('Failed to add questionnaire', questionnaire);
                        }
                    } catch (err) {
                        console.error('Failed to add questionnaire', questionnaire);
                        reject(err);
                        return;
                    }
                    // broadcast overall progress if there are multiple questionnaires.
                    if (obj.languages.length > 1) {
                        onProgress(obj.languages.length, index + 1);
                    }
                });
                resolve();
            } catch (err) {
                reject(err);
            }
        });
    }
1124148
function(url) {
			var plugin = this.settings.pluginRegistry.getPlugin(url);
			if (plugin) {
				var deferred = new Deferred();
				this.progressService.progress(deferred, messages.ReloadingPlugin);
				deferred.progress({type: "progress"});
				plugin.update().then(function() {
					this.render();
					this.statusService.setMessage( i18nUtil.formatMessage(messages["Reloaded"], url), 5000, true);
					deferred.resolve();
				}.bind(this), deferred.reject, deferred.progress);
			}
		}
421009
function updateClassInstance(current, workInProgress, priorityLevel) {
    var instance = workInProgress.stateNode;
    resetInputPointers(workInProgress, instance);

    var oldProps = workInProgress.memoizedProps;
    var newProps = workInProgress.pendingProps;
    if (!newProps) {
      // If there aren't any new props, then we'll reuse the memoized props.
      // This could be from already completed work.
      newProps = oldProps;
      !(newProps != null) ? invariant(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : void 0;
    }
    var oldContext = instance.context;
    var newUnmaskedContext = getUnmaskedContext$2(workInProgress);
    var newContext = getMaskedContext$2(workInProgress, newUnmaskedContext);

    // Note: During these life-cycles, instance.props/instance.state are what
    // ever the previously attempted to render - not the "current". However,
    // during componentDidUpdate we pass the "current" props.

    if (typeof instance.componentWillReceiveProps === 'function' && (oldProps !== newProps || oldContext !== newContext)) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, newContext);
    }

    // Compute the next state using the memoized state and the update queue.
    var oldState = workInProgress.memoizedState;
    // TODO: Previous state can be null.
    var newState = void 0;
    if (workInProgress.updateQueue !== null) {
      newState = beginUpdateQueue$2(current, workInProgress, workInProgress.updateQueue, instance, oldState, newProps, priorityLevel);
    } else {
      newState = oldState;
    }

    if (oldProps === newProps && oldState === newState && !hasContextChanged$2() && !(workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate)) {
      // If an update was already in progress, we should schedule an Update
      // effect even though we're bailing out, so that cWU/cDU are called.
      if (typeof instance.componentDidUpdate === 'function') {
        if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
          workInProgress.effectTag |= Update$1;
        }
      }
      return false;
    }

    var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext);

    if (shouldUpdate) {
      if (typeof instance.componentWillUpdate === 'function') {
        {
          startPhaseTimer$1(workInProgress, 'componentWillUpdate');
        }
        instance.componentWillUpdate(newProps, newState, newContext);
        {
          stopPhaseTimer$1();
        }
      }
      if (typeof instance.componentDidUpdate === 'function') {
        workInProgress.effectTag |= Update$1;
      }
    } else {
      // If an update was already in progress, we should schedule an Update
      // effect even though we're bailing out, so that cWU/cDU are called.
      if (typeof instance.componentDidUpdate === 'function') {
        if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
          workInProgress.effectTag |= Update$1;
        }
      }

      // If shouldComponentUpdate returned false, we should still update the
      // memoized props/state to indicate that this work can be reused.
      memoizeProps(workInProgress, newProps);
      memoizeState(workInProgress, newState);
    }

    // Update the existing instance's state, props, and context pointers even
    // if shouldComponentUpdate returns false.
    instance.props = newProps;
    instance.state = newState;
    instance.context = newContext;

    return shouldUpdate;
  }
1209534
function writeProgress(id, total, completed) {
    var percent = Math.round(10 * (100 * completed) / total) / 10;
    if(id == lastProgressId) {
        readline.cursorTo(process.stdout, 0);
        readline.clearLine(process.stdout, 0);
    } else {
        lastProgressId = id;
        process.stdout.write('\n');
    }
    var progressTitles = {
        projects: 'Indexing Projects',
        chunks: 'Indexing Chunks',
        ta: 'Indexing translationAcademy',
        resources: 'Indexing Resources',
        container: 'Downloading Containers',
        catalog: 'Indexing Catalogs',
        langnames: 'Indexing Target Languages',
        'temp-langnames': 'Indexing Temporary Target Languages',
        'approved-temp-langnames': 'Indexing Approved Temporary Target Languages',
        'new-language-questions': 'Indexing Questionnaire'
    };
    process.stdout.write((progressTitles[id] || id) + ' [' + total + '] ' + percent + '%');
}
1040612
function checkIfAnotherSessionInProgress() {
        var result = $.Deferred();
        if(updateJsonHandler) {
            var state = updateJsonHandler.state;

            updateJsonHandler.refresh()
                .done(function() {
                    var val = updateJsonHandler.get(updateProgressKey);
                    if(val !== null) {
                        result.resolve(val);
                    } else {
                        result.reject();
                    }
                })
                .fail(function() {
                    updateJsonHandler.state = state;
                    result.reject();
                });
        }
        return result.promise();
    }
269287
function (data) {
            if (!ready) {
                return;
            }
            var i;
            if (data.all === true) {
                data.upto = numPages;
            }
            if (data.page) {
                this.queuePageToLoad(data.page - 1);
            } else if (data.upto) {
                for (i = 0; i < data.upto; ++i) {
                    this.queuePageToLoad(i);
                }
            }
        }
571394
function onData( data ) {
		for ( var i = 0; i < data.length; i++ ) {
			this.queue( data[ i ] );
		}
	}
1170861
function GraphProgress(graph, graphDescription) {
        assert.object(graph, 'graph');
        assert.string(graphDescription, 'graphDescription');

        this.graph = graph;
        this.data = {
            graphId: graph.instanceId,
            nodeId: graph.node,
            graphName: graph.name || 'Not available',
            status: graph._status,
            progress: {
                description: graphDescription || 'Not available',
            }
        };
        this._calculateGraphProgress();
    }
735669
function(config, onload, onprogress, onerror) {

		var character = new THREE.MD2Character();

		character.onLoadComplete = function() {
			if (onload) onload( character );
		};

		character.loadParts( config );

	}
372813
function ProgressBarPreloadScene (opts) {
    ProgressBarPreloadScene.superclass.constructor.call(this, opts)
    var size = Director.sharedDirector.winSize

    // Setup 'please wait' label
    var label = new Label({
        fontSize: 14,
        fontName: 'Helvetica',
        fontColor: '#ffffff',
        string: 'Please wait...'
    })
    label.position = new geo.Point(size.width / 2, (size.height / 2) + 32)
    this.label = label
    this.addChild({child: label})

    // Preloader for the progress bar assets
    var loadingPreloader = new Preloader([this.emptyImage, this.fullImage])

    // When progress bar resources have loaded then draw them and load all the rest
    events.addListener(loadingPreloader, 'complete', function (preloader) {
        this.createProgressBar()
        this.load()
    }.bind(this))

    loadingPreloader.load()
}
683719
function (e, data) {
                if (data.context) {
                    var progress = Math.floor(data.loaded / data.total * 100);
                    data.context.find('.progress')
                        .attr('aria-valuenow', progress)
                        .find('.bar').css(
                            'width',
                            progress + '%'
                        );
                }
            }
74088
function(data){
						var name = data.parameters.valueFor("name");
						if(!name){
							return;
						}
						var url = data.parameters.valueFor("url");
						if(!url){
							return;
						}
						var item = forceSingleItem(data.items);
						fileClient.getWorkspace(item.Location).then(function(workspace) {
							progress.progress(projectClient.createProject(workspace.ChildrenLocation, {Name: name, ContentLocation: url}), i18nUtil.formatMessage( messages["Creating project ${0}"], name)).then(function(project){
								dispatchNewProject(workspace, project);
							});
						});
					}
62398
function(data, eventType) {
            switch(eventType) {
                case 'progress':
                    // Update UI loading bar
                    break;
                case 'timeout':
                    finish(new Error(data));
                    break;
                case 'result':
                    finish(null, {
                        value: data,
                        type: 'result'
                    });
                    break;
                case 'error':
                    if(ready) {
                        return finish(null, {
                            value: data,
                            type: 'error'
                        });
                    }
                    return finish(new Error(data));
                    break
                case 'ready':
                    // We're good to get results and stuff back now
                    ready = true;
                    // Eval our code now that the runtime is ready
                    repl.eval(code);
                    break;
                default:
                    console.log('Unhandled event =', eventType, 'data =', data);
            }
        }
293364
function(data) {
		//if (this.debug) console.log("Data: [" + data + "]");
		if (this.echo) process.stdout.write(data);
		this.instream = '' + this.instream + data.toString();

		for (;;) {		// peel off full lines of input containing JSON
			var m = this.instream.match(/\n/);
			if (!m) break;			// no more full lines
			var first_line = this.instream.slice(0, m.index + 1).trim();
			this.instream = this.instream.slice(m.index + 1);

			//if (this.debug) console.log('Line:', [first_line], [this.instream]);

			if (first_line.match(this.prompt)) {
				this.sendReply();
				first_line = first_line.slice(this.promptlength);
				this.instream = first_line + '\n' + this.instream;	// push back command text
				continue;
			}

			if (first_line.charAt(0) == '{') {			// detect JSON update sent by Bitlash
				var json_payload = JSON.parse(first_line);
				//console.log('JSON upstream:', json_payload);
				if (this.json_callback) this.json_callback(json_payload);
			}
			else this.reply.push(first_line);
		}

		// detect prompt indicating last command is complete
		if (this.instream.match(this.prompt)) {
			this.sendReply();
			this.instream = this.instream.slice(this.promptlength);
		}
	}
497684
function singleStringCoding(stream, string, on_finish, on_progress) {
  on_progress = on_progress || function() {};
  on_finish = on_finish || function() {};

  // possibly our input is an array of byte integers
  // or a typed array
  if (!Buffer.isBuffer(string))
    string = Buffer.from(string);

  var deferred = {}, failed = false;

  stream.once('error', function(err) {
    failed = true;
    on_finish(null, err);
  });

  // emulate Promise.defer()
  deferred.promise = new Promise(function(resolve, reject) {
    deferred.resolve = resolve;
    deferred.reject = reject;
  });

  // Since using the Promise API is optional, generating unhandled
  // rejections is not okay.
  deferred.promise.catch(noop);

  stream.once('error', function(e) {
    deferred.reject(e);
  });

  var buffers = [];

  stream.on('data', function(b) {
    buffers.push(b);
  });

  stream.once('end', function() {
    var result = Buffer.concat(buffers);

    if (!failed) {
      on_progress(1.0);
      on_finish(result);
    }

    if (deferred)
      deferred.resolve(result);
  });

  on_progress(0.0);

  stream.end(string);

  if (deferred)
    return deferred.promise;
}
437237
function (data) {

            if (!isLog()) {
                return undefined;
            }

            try {
                _fs.appendFileSync("pkgscript.log", (_utils.now() + "  " + data + "\n"), "utf8");

            } catch (e) {
                console.error(_utils.now + " [package-script] Package Script, ERROR:", e);
            }
        }
425242
protected function resolver(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null)
    {
        return function ($resolve, $reject, $notify) use ($onFulfilled, $onRejected, $onProgress) {
            if ($onProgress) {
                $progressHandler = function ($update) use ($notify, $onProgress) {
                    try {
                        $notify($onProgress($update), $this->sharedData);
                    } catch (\Throwable $e) {
                        $notify($e, $this->sharedData);
                    }
                };
            } else {
                $progressHandler = $notify;
            }

            $this->handlers[] = function (ExtendedPromiseInterface $promise) use ($onFulfilled, $onRejected, $resolve, $reject, $progressHandler) {
                $promise
                    ->then($onFulfilled, $onRejected)
                    ->done($resolve, $reject, $progressHandler);
            };

            $this->progressHandlers[] = $progressHandler;
        };
    }