Create an instance with id, code, config and external data.
@param {string} instanceId
@param {string} appCode
@param {object} config
@param {object} data
@param {object} env { info, config, services }
331781
function createInstance (
  instanceId,
  appCode,
  config,
  data,
  env
) {
  if ( appCode === void 0 ) appCode = '';
  if ( config === void 0 ) config = {};
  if ( env === void 0 ) env = {};

  // Set active instance id and put some information into `instances` map.
  activeId = instanceId;

  // Virtual-DOM object.
  var document = new renderer.Document(instanceId, config.bundleUrl);

  // All function/callback of parameters before sent to native
  // will be converted as an id. So `callbacks` is used to store
  // these real functions. When a callback invoked and won't be
  // called again, it should be removed from here automatically.
  var callbacks = [];

  // The latest callback id, incremental.
  var callbackId = 1;

  instances[instanceId] = {
    instanceId: instanceId, config: config, data: data,
    document: document, callbacks: callbacks, callbackId: callbackId
  };

  // Prepare native module getter and HTML5 Timer APIs.
  var moduleGetter = genModuleGetter(instanceId);
  var timerAPIs = getInstanceTimer(instanceId, moduleGetter);

  // Prepare `jud` instance variable.
  var judInstanceVar = {
    config: config,
    document: document,
    require: moduleGetter
  };
  Object.freeze(judInstanceVar);

  // Each instance has a independent `Vue` variable and it should have
  // all top-level public APIs.
  var subVue = Vue$2.extend({});

  // ensure plain-object components are extended from the subVue
  subVue.options._base = subVue

  // expose global utility
  ;['util', 'set', 'delete', 'nextTick', 'version', 'judVersion', 'config'].forEach(function (name) {
    subVue[name] = Vue$2[name];
  });

  // The function which create a closure the JS Bundle will run in.
  // It will declare some instance variables like `Vue`, HTML5 Timer APIs etc.
  var instanceVars = Object.assign({
    Vue: subVue,
    jud: judInstanceVar,
    __jud_require_module__: judInstanceVar.require // deprecated
  }, timerAPIs);
  callFunction(instanceVars, appCode);

  // Send `createFinish` signal to native.
  renderer.sendTasks(instanceId + '', [{ module: 'dom', method: 'createFinish', args: [] }], -1);
}
285969
function (instance, methodName, create) {
/*Line 229 - 'AtomUI.js' */        if (methodName && methodName.constructor != String)
/*Line 230 - 'AtomUI.js' */            throw new Error("methodName has to be string");
/*Line 231 - 'AtomUI.js' */        var d = instance.__delegates;
/*Line 232 - 'AtomUI.js' */        if (!d) {
/*Line 233 - 'AtomUI.js' */            if (!create)
/*Line 234 - 'AtomUI.js' */                return null;
/*Line 235 - 'AtomUI.js' */            d = {};
/*Line 236 - 'AtomUI.js' */            instance.__delegates = d;
/*Line 237 - 'AtomUI.js' */        }
/*Line 238 - 'AtomUI.js' */        var m = d[methodName];
/*Line 239 - 'AtomUI.js' */        if (!m) {
/*Line 240 - 'AtomUI.js' */            if (!create)
/*Line 241 - 'AtomUI.js' */                return null;
/*Line 242 - 'AtomUI.js' */            var f = instance[methodName];
/*Line 243 - 'AtomUI.js' */            if (!f) {
/*Line 244 - 'AtomUI.js' */                throw new Error("method " + methodName + " not found");
/*Line 245 - 'AtomUI.js' */            }
/*Line 246 - 'AtomUI.js' */            m = function () {
/*Line 247 - 'AtomUI.js' */                return f.apply(instance, arguments);
/*Line 248 - 'AtomUI.js' */            };
/*Line 249 - 'AtomUI.js' */            d[methodName] = m;
/*Line 250 - 'AtomUI.js' */        }
/*Line 251 - 'AtomUI.js' */        return m;
/*Line 252 - 'AtomUI.js' */    }
230165
private function callDelCreaServer(string $appname, string $env = null)
    {
        if ($appname == '#none' && $env == null) {
            Server::delete(
                FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                'directory'
            );
            Server::create(
                FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                'directory'
            );
            Server::delete(
                FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                'directory'
            );
            Server::create(
                FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                'directory'
            );
        } elseif ($appname == '#none' && in_array($env, array("dev", "prod", "all"))) {
            if ($env == "all") {
                Server::delete(
                    FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                    'directory'
                );
                Server::create(
                    FEnvFcm::get("framework.root")."/public/components/apps/dev/",
                    'directory'
                );
                Server::delete(
                    FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                    'directory'
                );
                Server::create(
                    FEnvFcm::get("framework.root")."/public/components/apps/prod/",
                    'directory'
                );
            } else {
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/".
                    strtolower($env)."/", 'directory');
                Server::create(FEnvFcm::get("framework.root")."/public/components/apps/".
                    strtolower($env)."/", 'directory');
            }
        } elseif ($appname !== '#none' && in_array($env, array("dev", "prod", "all"))) {
            if ($env == "all") {
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/dev/".
                    strtolower($appname), 'directory');
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/prod/".
                    strtolower($appname), 'directory');
            } else {
                Server::delete(FEnvFcm::get("framework.root")."/public/components/apps/".
                    strtolower($env)."/".
                    strtolower($appname), 'directory');
            }
        } elseif ($appname !== '#none' && $env == null) {
            Server::delete(
                FEnvFcm::get("framework.root") . "/public/components/apps/dev/" . strtolower($appname),
                'directory'
            );
            Server::delete(
                FEnvFcm::get("framework.root") . "/public/components/apps/prod/" . strtolower($appname),
                'directory'
            );
        } else {
            Output::displayAsRed("App name or env name does not exist. Referer to help command\n");
        }
    }
172324
function(config) {
			if (config.env && typeof config.env === "object") {
				return this.merge(this.createEnvironmentConfig(config.env), config);
			}

			return config;
		}
701534
function(appConfig, appManifest) {

		// make sure the container is configured for secure apps
		if (_config.secureAppPagePath) {
			if (_isPlaceholderElement(appConfig.root)) {
				jQuery(appConfig.root)
					.addClass(F2.Constants.Css.APP)
					.append(jQuery('<div></div>').addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId));
			}
			else if (!_bUsesAppHandlers) {
				// create the html container for the iframe
				appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '<div></div>'));
			}
			else {
				var $root = jQuery(appConfig.root);

				F2.AppHandlers.__trigger(
					_sAppHandlerToken,
					F2.Constants.AppHandlers.APP_RENDER,
					appConfig, // the app config
					_outerHtml(jQuery(appManifest.html).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId))
				);

				if ($root.parents('body:first').length === 0) {
					throw ('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.');
				}

				F2.AppHandlers.__trigger(
					_sAppHandlerToken,
					F2.Constants.AppHandlers.APP_RENDER_AFTER,
					appConfig // the app config
				);

				if (!appConfig.root) {
					throw ('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.');
				}

				if (!F2.isNativeDOMNode(appConfig.root)) {
					throw ('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.');
				}
			}

			// instantiate F2.UI
			appConfig.ui = new F2.UI(appConfig);
			// init events
			_initAppEvents(appConfig);
			// create RPC socket
			F2.Rpc.register(appConfig, appManifest);
		}
		else {
			F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.');
		}
	}
84868
function refreshInstance (
  instanceId,
  data
) {
  var instance = instanceOptions[instanceId];
  if (!instance || !(instance.app instanceof instance.Vue)) {
    return new Error(("refreshInstance: instance " + instanceId + " not found!"))
  }
  if (instance.Vue && instance.Vue.set) {
    for (var key in data) {
      instance.Vue.set(instance.app, key, data[key]);
    }
  }
  // Finally `refreshFinish` signal needed.
  instance.document.taskCenter.send('dom', { action: 'refreshFinish' }, []);
}
927762
function destroyInstance (instanceId) {
  var instance = instanceOptions[instanceId];
  if (instance && instance.app instanceof instance.Vue) {
    try {
      instance.app.$destroy();
      instance.document.destroy();
    } catch (e) {}
    delete instance.document;
    delete instance.app;
  }
  delete instanceOptions[instanceId];
}
569467
function(appConfig) {

		// check for valid app configurations
		if (!appConfig.appId) {
			F2.log('"appId" missing from app object');
			return false;
		}
		else if (!appConfig.root && !appConfig.manifestUrl) {
			F2.log('"manifestUrl" missing from app object');
			return false;
		}

		return true;
	}
169225
private String createRow(String key, String appid, Map<String, AttributeValue> row) {
		if (StringUtils.isBlank(key) || StringUtils.isBlank(appid) || row == null || row.isEmpty()) {
			return null;
		}
		try {
			key = getKeyForAppid(key, appid);
			setRowKey(key, row);
			PutItemRequest putItemRequest = new PutItemRequest(getTableNameForAppid(appid), row);
			client().putItem(putItemRequest);
		} catch (Exception e) {
			logger.error("Could not write row to DB - appid={}, key={}", appid, key, e);
			throwIfNecessary(e);
		}
		return key;
	}
926748
function(node) {
		var appConfig;

		if (node) {
			var appId = node.getAttribute('data-f2-appid');
			var manifestUrl = node.getAttribute('data-f2-manifesturl');

			if (appId && manifestUrl) {
				appConfig = {
					appId: appId,
					enableBatchRequests: node.hasAttribute('data-f2-enablebatchrequests'),
					isSecure: node.hasAttribute('data-f2-issecure'),
					manifestUrl: manifestUrl,
					root: node
				};

				// See if the user passed in a block of serialized json
				var contextJson = node.getAttribute('data-f2-context');

				if (contextJson) {
					try {
						appConfig.context = F2.parse(contextJson);
					}
					catch (e) {
						console.warn('F2: "data-f2-context" of node is not valid JSON', '"' + e + '"');
					}
				}
			}
		}

		return appConfig;
	}
927786
function(purpose) {
    const oThis = this;

    // Create empty ENV file
    fileManager.touch(setupConfig.env_vars_file, '#!/bin/sh');
    fileManager.append(setupConfig.env_vars_file, '#################');
    fileManager.append(setupConfig.env_vars_file, '# opentST Platform Environment file');
    fileManager.append(setupConfig.env_vars_file, '#################');

    logger.info('* writing env basic, geth, cache and addresses related env vars');

    // Create geth ENV variables
    oThis._gethVars(purpose);

    // Create cache ENV variables
    oThis._cacheVars();

    // Create notification ENV variables
    oThis._notificationVars();

    // Create miscellaneous ENV variables
    oThis._miscellaneousVars();

    // Create dynamodb ENV variables
    oThis._dynamodbVars();

    // Create dynamodb auto scaling ENV variables
    oThis._dynamodbAutoScalingVars();

    // Create contract address ENV variables
    oThis._contractAddressVars();

    // Create address ENV variables
    oThis._addressVars();
  }
2302
function(config){
        
        if(isString(config)){
            this.config.appBase = config;
        }else if(isObject(config)){// If the config object is provided
            this.config = Object.assign(this.config, config);
        }

        // If the app base isn't provided
        if(!this.config.appBase){
            this.config.appBase = utils.getAppLocalPath();
        }else if(this.config.appBase.length && this.config.appBase[this.config.appBase.length-1] !== '/'){
            this.config.appBase += '/';
        }

        // If the layouts list was passed in the config
        if(this.config.layouts && isObject(this.config.layouts)){
            Object.keys(this.config.layouts).forEach(key => {
                layouts.add(key, this.config.layouts[key]);
            });
        }

        // If the dev mode is on
        if(this.config.devMode === true){
            // Attach some shortcuts
            Application.on('ready', function(){

                // Ctrl+F12 to toggle the dev tools
                Shortcuts.register('CmdOrCtrl+F12', function(){
                    const window = windowManager.getCurrent();
                    if(window) window.toggleDevTools();
                });

                // Ctrl+R to reload the page
                Shortcuts.register('CmdOrCtrl+R', function(){
                    const window = windowManager.getCurrent();
                    if(window) window.reload();
                });

            });
        }

        // If a default setup is provided
        if(this.config.defaultSetup){
            this.setDefaultSetup(this.config.defaultSetup);
            delete this.config.defaultSetup;
        }
    }
458159
function(appConfig) {

		jQuery(appConfig.root).on('click', '.' + F2.Constants.Css.APP_VIEW_TRIGGER + '[' + F2.Constants.Views.DATA_ATTRIBUTE + ']', function(event) {

			event.preventDefault();

			var view = jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();

			// handle the special REMOVE view
			if (view == F2.Constants.Views.REMOVE) {
				F2.removeApp(appConfig.instanceId);
			}
			else {
				appConfig.ui.Views.change(view);
			}
		});
	}
1100370
public static RequestContext create(String projectId, String instanceId, String appProfileId) {
    return new AutoValue_RequestContext(projectId, instanceId, appProfileId);
  }
1175909
public static function initialize($app_id, $app_key, $master_key)
    {
        AVUser::registerSubclass();
        AVRole::registerSubclass();
        AVInstallation::registerSubclass();
        self::$applicationId = $app_id;
        self::$appKey = $app_key;
        self::$masterKey = $master_key;;
        if (!static::$storage)
        {
            if (session_status() === PHP_SESSION_ACTIVE)
            {
                self::setStorage(new AVSessionStorage());
            } else
            {
                self::setStorage(new AVMemoryStorage());
            }
        }
    }
572295
function create(instance, tx, callback) {
    var
        model = instance.__model,
        beforeCreate = model.__beforeCreate,
        params,
        value,
        sql;
    if (beforeCreate) {
        beforeCreate(instance);
    }
    // insert into TABLE () values (???)
    params = _.map(model.__insertAttributesArray, function (attr) {
        if (instance.hasOwnProperty(attr)) {
            return instance[attr];
        }
        var def = model.__attributes[attr];
        if (def.defaultValue !== undefined) {
            value = def.defaultValueIsFunction ? def.defaultValue() : def.defaultValue;
            instance[attr] = value;
            return value;
        }
        instance[attr] = null;
        return null;
    });
    sql = utils.format('insert into `%s` (%s) values(%s)', model.__table, model.__insertAttributesNames, utils.createPlaceholders(model.__insertAttributesArray.length));
    smartRunSQL(model.__pool, sql, params, tx, function (err, result) {
        if (err) {
            return callback(err);
        }
        if (model.__fetchInsertId) {
            instance[model.__primaryKey] = result.insertId;
        }
        callback(null, instance);
    });
}
868326
@SuppressWarnings("WeakerAccess")
  public ApiFuture<Instance> getInstanceAsync(String instanceId) {
    String name = NameUtil.formatInstanceName(projectId, instanceId);

    com.google.bigtable.admin.v2.GetInstanceRequest request =
        com.google.bigtable.admin.v2.GetInstanceRequest.newBuilder().setName(name).build();

    return ApiFutures.transform(
        stub.getInstanceCallable().futureCall(request),
        new ApiFunction<com.google.bigtable.admin.v2.Instance, Instance>() {
          @Override
          public Instance apply(com.google.bigtable.admin.v2.Instance proto) {
            return Instance.fromProto(proto);
          }
        },
        MoreExecutors.directExecutor());
  }