Creates a new app object from the specified applet.

    .. deprecated:: 0.204.0
       Use :func:`create_app_multi_region()` instead.
554238
def create_app(applet_id, applet_name, src_dir, publish=False, set_default=False, billTo=None, try_versions=None,
               try_update=True, confirm=True, regional_options=None):
    
    # In this case we don't know the region of the applet, so we use the
    # legacy API {"applet": applet_id} without specifying a region
    # specifically.
    return _create_app(dict(applet=applet_id), applet_name, src_dir, publish=publish, set_default=set_default,
                       billTo=billTo, try_versions=try_versions, try_update=try_update, confirm=confirm)
698604
def create_app(self):
        
        self.appinfo['accounts'] = self.get_accounts()
        self.log.debug('Pipeline Config\n%s', pformat(self.pipeline_config))
        self.log.debug('App info:\n%s', pformat(self.appinfo))
        jsondata = self.retrieve_template()
        wait_for_task(jsondata)

        self.log.info("Successfully created %s application", self.appname)
        return jsondata
427750
public ApiApp createApiApp(ApiApp app) throws HelloSignException {
        return new ApiApp(
                httpClient.withAuth(auth).withPostFields(app.getPostFields()).post(BASE_URI + API_APP_URI).asJson());
    }
12833
def create(cls, address, ospf_area=None, **kwargs):
        
        return super(LoopbackClusterInterface, cls).create(
            address=address,
            network_value='{}/32'.format(address),
            interface_id='Loopback Interface',
            ospfv2_area_ref=ospf_area,
            **kwargs)
335336
def create(self, **kwargs):
        
        resource = self.resource.create(kwargs)
        if 'admin_token' in kwargs:
            resource.context.authorize('Gem-Application',
                                       api_token=resource.api_token,
                                       admin_token=kwargs['admin_token'])
        app = self.wrap(resource)
        return self.add(app)
1193286
protected void createOrUpdateFunctionApp() throws Exception {
        final FunctionApp app = getFunctionApp();
        if (app == null) {
            createFunctionApp();
        } else {
            updateFunctionApp(app);
        }
    }
1055579
async function createApp(middlewareConfig) {
  const app = new Koa()

  const middleware = await setupMiddleware(middlewareConfig, app)

  if (app.env == 'production') {
    app.proxy = true
  }

  return {
    app,
    middleware,
  }
}
1264812
def _create_app(self, color_depth, term='xterm'):
        
        output = Vt100_Output(_SocketStdout(self._send_packet),
                              lambda: self.size,
                              term=term,
                              write_binary=False)

        self.client_state = self.pymux.add_client(
            input=self._pipeinput, output=output, connection=self, color_depth=color_depth)

        print('Start running app...')
        future = self.client_state.app.run_async()
        print('Start running app got future...', future)

        @future.add_done_callback
        def done(_):
            print('APP DONE.........')
            print(future.result())
            self._close_connection()
220348
def create_window(self, pane, name=None, set_active=True):
        
        assert isinstance(pane, Pane)
        assert name is None or isinstance(name, six.text_type)

        # Take the first available index.
        taken_indexes = [w.index for w in self.windows]

        index = self.base_index
        while index in taken_indexes:
            index += 1

        # Create new window and add it.
        w = Window(index)
        w.add_pane(pane)
        self.windows.append(w)

        # Sort windows by index.
        self.windows = sorted(self.windows, key=lambda w: w.index)

        app = get_app(return_none=True)

        if app is not None and set_active:
            self.set_active_window(w)

        if name is not None:
            w.chosen_name = name

        assert w.active_pane == pane
        assert w._get_parent(pane)
1145753
def app_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/apps.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
1183553
def create_app(metadata, processors=None, pipes=None):
    """"""

    instance = Application(metadata)

    # In order to avoid code duplication, we use existing built-in import
    # processor to import and register built-in processors on the application
    # instance. This is, to be honest, the main purpose of this factory
    # function, because otherwise one must create an Application instance
    # directly.
    import_processors.process(instance, [], imports=[
        "archive = holocron.processors.archive:process",
        "commonmark = holocron.processors.commonmark:process",
        "feed = holocron.processors.feed:process",
        "frontmatter = holocron.processors.frontmatter:process",
        "import-processors = holocron.processors.import_processors:process",
        "jinja2 = holocron.processors.jinja2:process",
        "markdown = holocron.processors.markdown:process",
        "metadata = holocron.processors.metadata:process",
        "pipe = holocron.processors.pipe:process",
        "prettyuri = holocron.processors.prettyuri:process",
        "restructuredtext = holocron.processors.restructuredtext:process",
        "save = holocron.processors.save:process",
        "sitemap = holocron.processors.sitemap:process",
        "source = holocron.processors.source:process",
        "todatetime = holocron.processors.todatetime:process",
        "when = holocron.processors.when:process",
    ])

    for name, processor in (processors or {}).items():
        instance.add_processor(name, processor)

    for name, pipeline in (pipes or {}).items():
        instance.add_pipe(name, pipeline)

    return instance
945255
def init_app(cls, app, callback=None):
        
        processed = set()
        cls.__views__ = set()
        cls.is_always_available = False
        for base in cls.__mro__:
            for name, attr in base.__dict__.items():
                if name in processed:
                    continue
                processed.add(name)
                if isinstance(attr, ViewHandler):
                    if base != cls:  # Copy ViewHandler instances into subclasses
                        # TODO: Don't do this during init_app. Use a metaclass
                        # and do this when the class is defined.
                        attr = attr.copy_for_subclass()
                        setattr(cls, name, attr)
                    attr.__set_name__(cls, name)  # Required for Python < 3.6
                    cls.__views__.add(name)
                    attr.init_app(app, cls, callback=callback)
                    if not hasattr(attr.wrapped_func, 'is_available'):
                        cls.is_always_available = True
1132894
function createApp (appname, spec, cb, resourceModules) {
  var moduleNames = resourceModules
  async.parallel([ function (cb) {
    async.each(spec.agents, function (agent, cb) {
      moduleNames.push(agent.name)
      createAgent(appname, spec, agent, cb)
    }, cb)
  }, function (cb) {
    async.each(spec.crud, function (crud, cb) {
      var crudName = crud.name
      if (crudName.charAt(0) == '/') {
        crudName = crudName.substr(1)
      }
      crud.name = crudName.replace(/\//g, '_')
      moduleNames.push(crud.name)
      createCrud(appname, spec, crud, cb)
    }, cb)
  }, function (cb) {
    createTemplate(appname, 'app.js', {
      moduleNames: moduleNames,
      agents: spec.agents
    })
    cb()
  }, function (cb) {
    createTemplate(appname, 'appConfig.js', {
      moduleNames: moduleNames,
      agents: spec.agents
    })
    cb()
  } ], function (err) {
    fs.mkdir(path.join(path.resolve(appname), 'generated', 'locale'), function (response) {
      createLocale(appname)
      cb()
    })
  })
}
597120
def create_app():
    
    app = App.create_app(__name__)
    app.configure('.configs.settings')

    # yes, I should use blueprints; but I don't really care for such a small
    # toy app
    @app.route('/config')
    def get_config():
        """Get the current configuration of the app."""
        return jsonify(app.config)

    @app.route('/put_config', methods=['PUT'])
    def put_config():
        """Add to the current configuration of the app.

        Takes any JSON body and adds all keys to the configs with the provided
        values.
        """
        data = request.json()

        for key, val in data.items():
            app.config[key] = val

        return jsonify({'message': 'Config updated!'})

    return app
981913
def _create_application(self):
        
        # Create Application.
        application = Application(
            input=self.input,
            output=self.output,
            editing_mode=EditingMode.VI,
            layout=self.editor_layout.layout,
            key_bindings=self.key_bindings,
#            get_title=lambda: get_terminal_title(self),
            style=DynamicStyle(lambda: self.current_style),
            paste_mode=Condition(lambda: self.paste_mode),
#            ignore_case=Condition(lambda: self.ignore_case),  # TODO
            include_default_pygments_style=False,
            mouse_support=Condition(lambda: self.enable_mouse_support),
            full_screen=True,
            enable_page_navigation_bindings=True)

        # Handle command line previews.
        # (e.g. when typing ':colorscheme blue', it should already show the
        # preview before pressing enter.)
        def preview(_):
            if self.application.layout.has_focus(self.command_buffer):
                self.previewer.preview(self.command_buffer.text)
        self.command_buffer.on_text_changed += preview

        return application
567638
def init_app(self, app):
        
        self.app = app
        self.__blueprint__ = Blueprint(
            self.__name__,
            self.__name__,
            url_prefix=self.__prefix__,
        )

        for url, name, methods in self.__urls__:
            self.blueprint.add_url_rule(
                url,
                view_func=getattr(self, name),
                endpoint=name.replace("r_", ""),
                methods=methods
            )
        self.app = self.app.register_blueprint(self.blueprint)

        return self.blueprint
304579
function createApp(root, options) {
  root = root || '';
  options = _.defaults(options || {}, {
    views: path.join(root, 'views', path.sep),
    public: path.join(root, 'public'),
    configdir: root,
    configOverrides: {},
    cacheviews: false,
  });
  var app = express();
  app.rootDir = root;
  if (!__theApp) {
    __theApp = app;
  }
  //options.appmethods overrides appmethods
  var methods = _.defaults(options.appmethods || {}, appmethods);
  //the express application object's prototype chain is funky so manually mix-in
  //our application methods
  Object.keys(methods).forEach( function(name) {
    app[name] = methods[name];
  });

  app.log = log; //use simple logger before log configuration

  app._beforeStart = app._setupBeforeStartListeners();
  app.addBeforeStartListener(app._connectToDb.bind(app));
  app._beforeStop = app._setupBeforeStopListeners();
  app.addBeforeStopListener(app._disconnectFromDb.bind(app));

  app.loadConfig = getConfigLoader(options);
  app.userModel = options.userModel;
  var config = app.loadConfig('app');
  app.config = config;
  if (config.settings) {
    Object.keys(config.settings).forEach( function(name) {
      app.set(name, config.settings[name]);
    });
  }
  app.initializeLogging();

  app.email = require('./email')(app);
  require('./passport')(passport, app); // pass passport for configuration
  app.passport = passport;

  app.setupViews(options);

  ///////////////install initial middleware///////////////
  app.useGracefulExiting();

  // adds req.id and req.log
  app.use(log.useReqLog(config.requests && config.requests.hideInternals));

  // configure request logging
  app.configRequestLogging();

  app.use(bodyParser.urlencoded());
  app.use(bodyParser.json());

  app._configureSession();

  app.use(passport.initialize());
  app.use(passport.session()); // persistent login sessions

  app.use(flash()); // use connect-flash for flash messages stored in session

  //now that passport is initialized expose the user to views
  app.use(function(req, res, next) {
    if (req.isAuthenticated && req.isAuthenticated())
      res.locals.user = req.user;
    if (req.session.impersonated)
      res.locals.impersonated = true;
    res.locals.query = req.query;
    //automatically expose flash messages to views, do with
    //a function instead of variable because we only want to consume the
    //flash message if the view requests it.
    res.locals.popAlertMessages = _.partial(utils.popAlertMessages, req.flash.bind(req));
    return next();
  });

  // development only
  if ('development' == app.get('env')) {
    // add development vars to res.locals (enables debug_footer)
    app.use(function debugFooterHandler(req, res, next) {
      res.locals.debug = {
        req: req
      };
      next();
    });
  }
  ////////end initial middleware (see start() for more) //////////

  app.setupPrivateMode();
  app.saveCurrentNamedRoute();
  app.setupAccessControlPolicy();
  app.createDefaultAdmin();

  app.set('dburl', config.dburl);
  if (options.public)
    app.set('publicpath', options.public);

  if (process.env.PORT || config.port)
    app.set('port', process.env.PORT || config.port);

  //set up the base app's named routes
  app.updateNamedRoutes(routes(app, passport));
  if (options.routes)
    app.updateNamedRoutes(options.routes);

  return app;
}