Create a RunControl instance.

@param options Run control configuration options.
@param callback A callback function to pass to load.
962121
function rc(options, callback) {
  if(typeof options === 'function') {
    callback = options;
    options = null;
  }
  var r = new RunControl(options);
  if(typeof callback === 'function') r.load(callback);
  return r;
}
617917
function Timer (callback, start) {
  this.callback = callback;
  this.startDate = null;
  if (!exists(start) || start !== false) {
    this.start();
  }
}
1255159
function _runCallback(eventName, data) {
      for (var id in _mappings[eventName].callbacks) {
        var callbackObject = _mappings[eventName].callbacks[id];

        if (typeof callbackObject.cb === 'function') callbackObject.cb(data);
        if (typeof callbackObject.once === 'boolean' && callbackObject.once === true) _self.off(eventName, callbackObject.cb);
      }
    }
1243545
def _create_run_config(options):
        """"""
        values = {opt: getattr(options, opt) for opt in
                       RunConfiguration._fields}
        return RunConfiguration(**values)
505713
public void setChartEventsLoad(final Options options, final Function function) {
        if (options.getChartOptions() == null) {
            options.setChartOptions(new ChartOptions());
        }
        if (options.getChartOptions().getEvents() == null) {
            options.getChartOptions().setEvents(new Events());
        }
        if (options.getChartOptions().getEvents().getLoad() == null) {
            options.getChartOptions().getEvents().setLoad(function);
        }
    }
1261563
protected void createHelper(DataSourceOptions options) {
		if (KriptonLibrary.getContext() == null)
			throw new KriptonRuntimeException("Kripton library is not properly initialized. Please use KriptonLibrary.init(context) somewhere at application startup");
		
		if (options.inMemory) {
			Logger.info("In-memory database");
		} else {
			File dbFile=KriptonLibrary.getContext().getDatabasePath(name);
			Logger.info("Database file %s", dbFile.getAbsolutePath());
		}				

		sqliteHelper = new SQLiteOpenHelper(KriptonLibrary.getContext(), name, options.factory, version, options.errorHandler) {

			@Override
			public void onConfigure(SQLiteDatabase database) {
				AbstractDataSource.this.database = database;
				AbstractDataSource.this.onConfigure(database);
			}

			@Override
			public void onCreate(SQLiteDatabase database) {
				AbstractDataSource.this.onCreate(database);
			}

			@Override
			public void onDowngrade(SQLiteDatabase database, int oldVersion, int newVersion) {
				AbstractDataSource.this.onDowngrade(database, oldVersion, newVersion);
			}

			@Override
			public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
				AbstractDataSource.this.onUpgrade(database, oldVersion, newVersion);
			}
		};
	}
1346208
function(options) {
        OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
        this.addControls([
          new OpenLayers.Control.Navigation(),
          new OpenLayers.Control.ZoomBox()
        ]);
    }
555632
function (options, callback) {

                if (options instanceof Function) {
                    callback = options;
                    options = {};
                }

                if (this.initialized) {
                    callback && callback(null, this);
                    return;
                }
                var self = this;

                flow()
                    .seq(function (cb) {
                        if (self.isNew()) {
                            cb();
                        } else {
                            self.fetch(null, cb);
                        }
                    })
                    .seq(function (cb) {
                        var productType = self.$.productType;
                        productType.fetch(null, cb);
                    })
                    .seq(function () {
                        var productType = self.$.productType;

                        var appearance;

                        if (self.$.appearance) {
                            appearance = productType.getAppearanceById(self.$.appearance.$.id);
                        }

                        appearance = appearance || productType.getDefaultAppearance();

                        self.set({
                            appearance: appearance,
                            view: self.$.view || productType.getViewById(self.get("defaultValues.defaultView.id")) || productType.getDefaultView()
                        });
                    })
                    .seq(function (cb) {
                        flow()
                            .parEach(self.$.configurations.$items, function (configuration, cb) {
                                self._setUpConfiguration(configuration);
                                options.isExample = self.get('restrictions.example');
                                configuration.init(options, cb);
                            })
                            .exec(function (err) {
                                cb(err);
                            });
                    })
                    .exec(function (err) {
                        self.trigger("productInitialized");
                        self.trigger("priceChanged");

                        if (err) {
                            callback && callback(err);
                        } else {
                            self.initialized = true;
                            callback && callback(null, self);
                        }
                    });
            }
427934
public function AssignCallback($Callback, $Options = NULL) {
      if (!is_callable($Callback)) return FALSE;
      
      $this->Callback = $Callback;
      $this->CallbackOptions = $Options;
   }
600654
function (bind, callback) {
                var jsonChangeCallback = null;
                // register as listener for the bindings defined for this control:
                if (bind) {
                    jsonChangeCallback = {
                        fn : callback || this._notifyDataChange,
                        scope : this,
                        args : {
                            tplCtxt : this.tplCtxt,
                            animate : bind.animate
                        }
                    };

                    // addListener throws errors
                    try {
                        // normalize recursive
                        bind.recursive = bind.recursive !== false;
                        this.__json.addListener(bind.inside, bind.to, jsonChangeCallback, true, bind.recursive);
                        // save for disposal
                        this._bindings.push({
                            inside : bind.inside,
                            callback : jsonChangeCallback,
                            to : bind.to,
                            recursive : bind.recursive
                        });
                    } catch (e) {
                        this.$logError(this.SECTION_BINDING_ERROR, [bind.inside, bind.to, this.id,
                                this.tplCtxt.tplClasspath]);
                        jsonChangeCallback = null;
                    }
                    return jsonChangeCallback;
                }
            }
979134
function(options) {
        OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
        this.addControls([
            new OpenLayers.Control.ZoomIn(),
            new OpenLayers.Control.ZoomToMaxExtent(),
            new OpenLayers.Control.ZoomOut()
        ]);
    }
649680
function Startline(options) {

  event.call(this);
  var self = this; // closure
  var temp = '';
  this.options = options;
  this.head = 0;
  this.tail = 0;
  this.line = 0;
  this._stream = null;

  if (options.rc4 || options.autokey) { // cipher
    var cipher;
    this._stream = interfac(this.options, options.start, options.end);
    if (options.rc4) {
      cipher = require('arc4')('arc4', String(options.rc4), options.lodash);
      this._stream.on('data', function(callbacks) {

        var callback = cipher.decodeBuffer(callbacks).toString();
        for (var i = 0, ii = callback.length; i < ii; ++i) {
          if (callback[i] === eol) {
            self.tail = self.head + self.line;
            self.head = self.tail + temp.length;
            self.emit('line', temp);
            self.line = 1;
            temp = '';
          } else {
            temp += callback[i];
          }
        }
        if (temp.length > 0) {
          self.tail = self.head + self.line;
          self.head = self.tail + temp.length;
          self.emit('line', temp);
          self.line = 1;
        }
        return;
      });

    } else {
      cipher = require('autokey')(String(options.autokey), options.lodash);
      this._stream.on('data', function(callbacks) {

        var callback = cipher.decodeBuffer(callbacks).toString();
        for (var i = 0, ii = callback.length; i < ii; ++i) {
          if (callback[i] === eol) {
            self.tail = self.head + self.line;
            self.head = self.tail + temp.length;
            self.emit('line', temp);
            self.line = 1;
            temp = '';
          } else {
            temp += callback[i];
          }
        }
        if (temp.length > 0) {
          self.tail = self.head + self.line;
          self.head = self.tail + temp.length;
          self.emit('line', temp);
          self.line = 1;
        }
        return;
      });
    }

  } else if (options.end >= 0) { // no cipher, EOF
    this._stream = interfac(this.options, options.start, options.end);
    this._stream.on('data', function(callbacks) {

      var callback = callbacks.toString();
      for (var i = 0, ii = callback.length; i < ii; ++i) {
        if (callback[i] === eol) {
          self.tail = self.head + self.line;
          self.head = self.tail + temp.length;
          self.emit('line', temp);
          self.line = 1;
          temp = '';
        } else {
          temp += callback[i];
        }
      }
      if (temp.length > 0) {
        self.tail = self.head + self.line;
        self.head = self.tail + temp.length;
        self.emit('line', temp);
        self.line = 1;
      }
      return;
    });

  } else { // file
    this._stream = readlin(this.options, options.start, options.end);
    this._stream.on('line', function(callback) {

      self.tail = self.head + self.line;
      self.head = self.tail + callback.length;
      self.emit('line', callback);
      self.line = 1;
      return;
    });
  }

  // standard events
  this._stream.on('pause', function() {

    return self.emit('pause');
  }).on('resume', function() {

    return self.emit('resume');
  }).on('open', function(fd) {

    return self.emit('open', fd);
  }).on('close', function() {

    return self.emit('close');
  }).on('end', function() {

    return self.emit('end');
  }).on('error', function(err) {

    return self.emit('error', err);
  });
}
552055
def run_callback(self):
        

        if self._callback_func is not None:
            try:
                self._callback_func(self._request, self._result)
            except Exception:  # pylint: disable=broad-except
                LOGGER.exception('An unhandled error occurred while running '
                                 'future callback')
177139
function run(options, ast, cb) {
  var report = new Report(options, ast);
  report.run(cb);
}
666753
public static <T> void runWithCallback(Callable<T> job, final FutureCallback<T> callback)
  {
    final UI ui = UI.getCurrent();
    
    ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
    ListenableFuture<T> future = exec.submit(job);
    if(callback != null)
    {
      Futures.addCallback(future, new FutureCallback<T>()
      {

        @Override
        public void onSuccess(final T result)
        {
          ui.access(new Runnable()
          {

            @Override
            public void run()
            {
              callback.onSuccess(result);
            }
          });
        }

        @Override
        public void onFailure(final Throwable t)
        {
          ui.access(new Runnable()
          {

            @Override
            public void run()
            {
              callback.onFailure(t);
            }
          });
        }
      });
    }
  }
744749
public void run(String[] args) {
        String context = args.length > 0 ? args[0] : "";
        String action = args.length > 1 ? args[1] : "";
        String option = args.length > 2 ? args[2] : "";

        switch (context) {
            case "server":
                server(action, option);
                break;
            case "version":
                version();
                break;
            default:
                help();
        }
    }
940556
@GwtIncompatible("Unnecessary")
  protected void setRunOptions(CompilerOptions options) throws IOException {
    DiagnosticGroups diagnosticGroups = getDiagnosticGroups();

    setWarningGuardOptions(options, config.warningGuards, diagnosticGroups);

    if (!config.warningsWhitelistFile.isEmpty()) {
      addWhitelistWarningsGuard(options, new File(config.warningsWhitelistFile));
    }

    if (!config.hideWarningsFor.isEmpty()) {
      options.addWarningsGuard(new ShowByPathWarningsGuard(
          config.hideWarningsFor.toArray(new String[] {}),
          ShowByPathWarningsGuard.ShowType.EXCLUDE));
    }

    createDefineOrTweakReplacements(config.define, options, false);

    options.setTweakProcessing(config.tweakProcessing);
    createDefineOrTweakReplacements(config.tweak, options, true);

    // TODO(tjgq): Unconditionally set the options.
    if (config.dependencyOptions != null) {
      options.setDependencyOptions(config.dependencyOptions);
    }

    options.devMode = config.jscompDevMode;
    options.setCodingConvention(config.codingConvention);
    options.setSummaryDetailLevel(config.summaryDetailLevel);
    options.setTrustedStrings(true);

    legacyOutputCharset = options.outputCharset = getLegacyOutputCharset();
    outputCharset2 = getOutputCharset2();
    inputCharset = getInputCharset();

    if (config.jsOutputFile.length() > 0) {
      if (config.skipNormalOutputs) {
        throw new FlagUsageException("skip_normal_outputs and js_output_file"
            + " cannot be used together.");
      }
    }

    if (config.skipNormalOutputs && config.printAst) {
      throw new FlagUsageException("skip_normal_outputs and print_ast cannot"
          + " be used together.");
    }

    if (config.skipNormalOutputs && config.printTree) {
      throw new FlagUsageException("skip_normal_outputs and print_tree cannot"
          + " be used together.");
    }

    if (config.createSourceMap.length() > 0) {
      options.sourceMapOutputPath = config.createSourceMap;
    } else if (isOutputInJson()) {
      options.sourceMapOutputPath = "%outname%";
    }
    options.sourceMapDetailLevel = config.sourceMapDetailLevel;
    options.sourceMapFormat = config.sourceMapFormat;
    options.sourceMapLocationMappings = config.sourceMapLocationMappings;
    options.parseInlineSourceMaps = config.parseInlineSourceMaps;
    options.applyInputSourceMaps = config.applyInputSourceMaps;

    ImmutableMap.Builder<String, SourceMapInput> inputSourceMaps
        = new ImmutableMap.Builder<>();
    for (Map.Entry<String, String> files :
             config.sourceMapInputFiles.entrySet()) {
      SourceFile sourceMap = SourceFile.fromFile(files.getValue());
      inputSourceMaps.put(
          files.getKey(), new SourceMapInput(sourceMap));
    }
    options.inputSourceMaps = inputSourceMaps.build();

    if (!config.variableMapInputFile.isEmpty()) {
      options.inputVariableMap =
          VariableMap.load(config.variableMapInputFile);
    }

    if (!config.propertyMapInputFile.isEmpty()) {
      options.inputPropertyMap =
          VariableMap.load(config.propertyMapInputFile);
    }

    if (!config.outputManifests.isEmpty()) {
      Set<String> uniqueNames = new HashSet<>();
      for (String filename : config.outputManifests) {
        if (!uniqueNames.add(filename)) {
          throw new FlagUsageException("output_manifest flags specify " +
              "duplicate file names: " + filename);
        }
      }
    }

    if (!config.outputBundles.isEmpty()) {
      Set<String> uniqueNames = new HashSet<>();
      for (String filename : config.outputBundles) {
        if (!uniqueNames.add(filename)) {
          throw new FlagUsageException("output_bundle flags specify " +
              "duplicate file names: " + filename);
        }
      }
    }

    options.transformAMDToCJSModules = config.transformAMDToCJSModules;
    options.processCommonJSModules = config.processCommonJSModules;
    options.moduleRoots = config.moduleRoots;
    options.angularPass = config.angularPass;

    if (!config.jsonWarningsFile.isEmpty()) {
      options.addReportGenerator(
          new JsonErrorReportGenerator(new PrintStream(config.jsonWarningsFile), compiler));
    }

    if (config.errorFormat == CommandLineConfig.ErrorFormatOption.JSON) {
      JsonErrorReportGenerator errorGenerator =
          new JsonErrorReportGenerator(getErrorPrintStream(), compiler);
      compiler.setErrorManager(new SortingErrorManager(ImmutableSet.of(errorGenerator)));
    }
  }