so you can run Rango::Mini.app
424312
def app(&block)
      raise ArgumentError, "Block is required" unless block_given?
      lambda do |env|
        Rango::Router.set_rack_env(env)
        request = Rango::Request.new(env)
        response = Rack::Response.new
        body = block.call(request, response)
        # TODO: check how rack test if object is stringable, probably not this way
        raise ArgumentError, "It has to return a valid rack body, #{body.inspect} returned" unless body.respond_to?(:each) || body.is_a?(String)
        response.write(body)
        array = response.finish
        [array[0], array[1], body] # we don't want to have Rack::Response instance instead body, it's mess!
      end
    end
1035167
private static function runAppMiddleware()
    {
        $appMiddleware = Filter::$middleware;

        foreach ($appMiddleware as $middleware) {
            $middleware = instance($middleware);

            $middleware->handle(new Request());
        }

        return true;
    }
1246929
public static void main(String[] args) 
      throws NoSuchAlgorithmException, IOException, InvalidKeyException, XmlPullParserException {
    try {
      /* play.min.io for test and development. */
      MinioClient minioClient = new MinioClient("https://play.min.io:9000", "Q3AM3UQ867SPQQA43P2F",
                                                "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");

      /* Amazon S3: */
      // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
      //                                           "YOUR-SECRETACCESSKEY");

      // Create some content for the object.
      StringBuilder builder = new StringBuilder();
      for (int i = 0; i < 1000; i++) {
        builder.append("Sphinx of black quartz, judge my vow: Used by Adobe InDesign to display font samples. ");
        builder.append("(29 letters)\n");
        builder.append("Jackdaws love my big sphinx of quartz: Similarly, used by Windows XP for some fonts. ");
        builder.append("(31 letters)\n");
        builder.append("Pack my box with five dozen liquor jugs: According to Wikipedia, this one is used on ");
        builder.append("NASAs Space Shuttle. (32 letters)\n");
        builder.append("The quick onyx goblin jumps over the lazy dwarf: Flavor text from an Unhinged Magic Card. ");
        builder.append("(39 letters)\n");
        builder.append("How razorback-jumping frogs can level six piqued gymnasts!: Not going to win any brevity ");
        builder.append("awards at 49 letters long, but old-time Mac users may recognize it.\n");
        builder.append("Cozy lummox gives smart squid who asks for job pen: A 41-letter tester sentence for Mac ");
        builder.append("computers after System 7.\n");
        builder.append("A few others we like: Amazingly few discotheques provide jukeboxes; Now fax quiz Jack! my ");
        builder.append("brave ghost pled; Watch Jeopardy!, Alex Trebeks fun TV quiz game.\n");
        builder.append("---\n");
      }
      // Create a InputStream for object upload.
      ByteArrayInputStream bais = new ByteArrayInputStream(builder.toString().getBytes("UTF-8"));
        
      // Generate a new 256 bit AES key - This key must be remembered by the client.
      byte[] key = "01234567890123456789012345678901".getBytes("UTF-8"); 
      SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES");
        
      ServerSideEncryption ssePut = ServerSideEncryption.withCustomerKey(secretKeySpec);
      ServerSideEncryption sseSource = ServerSideEncryption.copyWithCustomerKey(secretKeySpec);
        
      byte[] keyTarget = "98765432100123456789012345678901".getBytes("UTF-8"); 
      SecretKeySpec secretKeySpecTarget = new SecretKeySpec(keyTarget, "AES");

      ServerSideEncryption sseTarget = ServerSideEncryption.withCustomerKey(secretKeySpecTarget);
        
      // Create object 'my-objectname' in 'my-bucketname' with content from the input stream.
      minioClient.putObject("my-bucketname", "my-objectname", bais, bais.available(), ssePut);
      System.out.println("my-objectname is uploaded successfully");
        
      minioClient.copyObject("my-bucketname", "my-objectname", sseSource, "my-destbucketname",
                             "my-objectname-copy", null, sseTarget);

      bais.close();

      System.out.println("my-objectname-copy copied to my-destbucketname successfully.");
    } catch (MinioException e) {
      System.out.println("Error occurred: " + e);
    }
    System.out.println("finished");
  }
71863
def main(app):
    
    c = app.config
    src = c.jinjaapi_srcdir

    if not src:
        return

    suffix = "rst"

    out = c.jinjaapi_outputdir or app.env.srcdir

    if c.jinjaapi_addsummarytemplate:
        tpath = pkg_resources.resource_filename(__package__, AUTOSUMMARYTEMPLATE_DIR)
        c.templates_path.append(tpath)

    tpath = pkg_resources.resource_filename(__package__, TEMPLATE_DIR)
    c.templates_path.append(tpath)

    prepare_dir(app, out, not c.jinjaapi_nodelete)
    generate(app, src, out,
             exclude=c.jinjaapi_exclude_paths,
             force=c.jinjaapi_force,
             followlinks=c.jinjaapi_followlinks,
             dryrun=c.jinjaapi_dryrun,
             private=c.jinjaapi_includeprivate,
             suffix=suffix,
             template_dirs=c.templates_path)
498432
def run(icon=None):
    
    app = wx.App()
    frame = myappframe.MyAppFrame(None,
                                  u'Lattice Viewer \u2014 Accelerator Online Modeling Tool')
    frame.SetSize((1024, 768))
    frame.Show()
    if icon is not None:
        frame.SetIcon(icon)
    app.MainLoop()
29689
async def startup(self, app):
        """"""
        if self.cfg.fake:
            if not FakeConnection:
                raise PluginException('Install fakeredis for fake connections.')

            self.conn = await FakeConnection.create()
            if self.cfg.pubsub:
                self.pubsub_conn = self.conn

        else:
            try:
                if self.cfg.poolsize <= 1:
                    self.conn = await asyncio.wait_for(
                        asyncio_redis.Connection.create(
                            host=self.cfg.host, port=self.cfg.port,
                            password=self.cfg.password, db=self.cfg.db,
                        ), self.cfg.timeout)
                else:
                    self.conn = await asyncio.wait_for(asyncio_redis.Pool.create(
                        host=self.cfg.host, port=self.cfg.port,
                        password=self.cfg.password, db=self.cfg.db,
                        poolsize=self.cfg.poolsize,
                    ), self.cfg.timeout)
                if self.cfg.pubsub:
                    self.pubsub_conn = await asyncio.wait_for(
                        asyncio_redis.Connection.create(
                            host=self.cfg.host, port=self.cfg.port,
                            password=self.cfg.password, db=self.cfg.db,
                        ), self.cfg.timeout
                    )
            except asyncio.TimeoutError:
                raise PluginException('Muffin-redis connection timeout.')

        if self.cfg.pubsub:
            self.pubsub_subscription = await self.pubsub_conn.start_subscribe()
            self.pubsub_reader = ensure_future(self._pubsub_reader_proc(), loop=self.app.loop)
630605
def run(self):
        """"""
        self._make_lib_file_symbolic_links()
        self._copy_each_include_files_to_include_dir()
        self._make_dep_lib_file_sym_links_and_copy_include_files()
        self.setup_py.add_patchs_to_build_without_pkg_config(
            self.rpm.lib_dir, self.rpm.include_dir
        )
        self.setup_py.apply_and_save()
        self._build_and_install()
361110
def run(**kwargs):
    
    from sampleproject.app import app

    app.update_settings(**kwargs)
    app.run()
1056421
def run(self, app):
        """"""
        project_path = os.getcwd()
        if self.args.name is not None:
            project_path = os.path.join(project_path, self.args.name)

        proto_path = paths.PROTO_PATH

        try:
            copytree(proto_path, project_path)
            print(colored('A new glim app created successfully! Happy coding :)', 'green'))
        except FolderExistsError as e:
            print(e)
            print(colored('App already exists', 'red'))
950929
def run(host='0.0.0.0', port=5000, reload=True, debug=True):
    
    from werkzeug.serving import run_simple

    app = bootstrap.get_app()
    return run_simple(
        hostname=host,
        port=port,
        application=app,
        use_reloader=reload,
        use_debugger=debug,
    )
1374324
def app_run(app_name_or_id, alias=None, input_params={}, always_retry=True, **kwargs):
    
    input_params_cp = Nonce.update_nonce(input_params)
    fully_qualified_version = app_name_or_id + (('/' + alias) if alias else '')
    return DXHTTPRequest('/%s/run' % fully_qualified_version, input_params_cp, always_retry=always_retry, **kwargs)
1266511
def run(config):
    ""
    app = make_app(config=config)

    app.run(
            host=app.config.get("HOST", '127.0.0.1'),
            port=app.config.get("PORT", 5000),
            use_reloader=True,
            )
1263409
def demo(quiet, shell, speed, prompt, commentecho):
    """"""
    run(
        DEMO,
        shell=shell,
        speed=speed,
        test_mode=TESTING,
        prompt_template=prompt,
        quiet=quiet,
        commentecho=commentecho,
    )
65078
def run
      program :version, AppRepo::VERSION
      program :description, AppRepo::DESCRIPTION
      program :help, 'Author', 'Matej Sychra <suculent@me.com>'
      program :help, 'Website', 'https://github.com/suculent/apprepo'
      program :help, 'GitHub', 'https://github.com/suculent/apprepo/tree/master/apprepo'
      program :help_formatter, :compact

      generator = FastlaneCore::CommanderGenerator.new
      generator.generate(AppRepo::Options.available_options)

      global_option('--verbose') { $verbose = true }

      always_trace!

      command :run do |c|
        c.syntax = 'apprepo'
        c.description = 'Upload IPA and metadata to SFTP (e.g. AppRepo)'
        c.action do |_args, options|
          config = FastlaneCore::Configuration
          available_opts = AppRepo::Options.available_options
          options = config.create(available_opts, options.__hash__)
          loaded = options.load_configuration_file('Repofile')
          loaded = true if options[:repo_description] || options[:ipa]

          unless loaded
            UI.message('[AppRepo::CommandsGenerator] configuration file not loaded')
            if UI.confirm('No Repofile found. Do you want to setup apprepo?')
              require 'apprepo/setup'
              AppRepo::Setup.new.run(options)
              return 0
            end
          end

          AppRepo::Runner.new(options).run
        end
      end

      command :download_manifest do |c|
        c.syntax = 'apprepo download_manifest'
        c.description = 'Download metadata only'
        c.action do |_args, options|
          config = FastlaneCore::Configuration
          available_opts = AppRepo::Options.available_options
          options = config.create(available_opts, options.__hash__)
          options.load_configuration_file('Repofile')
          AppRepo::Runner.new(options).download_manifest
        end
      end

      command :submit do |c|
        c.syntax = 'apprepo submit'
        c.description = 'Submit a specific build-nr, use latest.'
        c.action do |_args, options|
          config = FastlaneCore::Configuration
          available_opts = AppRepo::Options.available_options
          options = config.create(available_opts, options.__hash__)
          options.load_configuration_file('Repofile')
          AppRepo::Runner.new(options).run
        end
      end

      command :init do |c|
        c.syntax = 'apprepo init'
        c.description = 'Create the initial `apprepo` configuration'
        c.action do |_args, options|
          if File.exist?('Repofile') || File.exist?('fastlane/Repofile')
            UI.important('You already got a running apprepo setup.')
            return 0
          end

          require 'apprepo/setup'
          config = FastlaneCore::Configuration
          available_opts = AppRepo::Options.available_options
          options = config.create(available_opts, options.__hash__)
          AppRepo::Runner.new(options)
          AppRepo::Setup.new.run(options)
        end
      end

      # rubocop:enable Metrics/AbcSize
      # rubocop:enable Metrics/MethodLength

      default_command :run

      run!
    end
47943
def main(argv):
    """"""
    _, black_model, white_model = argv
    utils.ensure_dir_exists(FLAGS.eval_sgf_dir)
    play_match(black_model, white_model, FLAGS.num_evaluation_games, FLAGS.eval_sgf_dir)
647950
def run(self, app_input, *args, **kwargs):
        
        # Rename app_input to preserve API compatibility when calling
        # DXApp.run(app_input=...).
        return super(DXApp, self).run(app_input, *args, **kwargs)
1209357
def install():
    
    _version_re = re.compile(r"__version__\s+=\s+(.*)")  # pylint: disable=invalid-name

    with open('./fleaker/__init__.py', 'rb') as file_:
        version = ast.literal_eval(_version_re.search(  # pylint: disable=invalid-name
            file_.read().decode('utf-8')).group(1))

    download_url = ('https://github.com/croscon/fleaker/archive/'
                    'v{}.tar.gz'.format(version))

    setup(
        name='fleaker',
        version=version,
        download_url=download_url,
        description='Tools and extensions to make Flask development easier.',
        url='https://github.com/croscon/fleaker',
        author='Croscon Consulting',
        author_email='open.source@croscon.com',
        license='BSD',
        packages=[
            'fleaker',
            'fleaker.marshmallow',
            'fleaker.marshmallow.fields',
            'fleaker.peewee',
            'fleaker.peewee.fields',
            'fleaker.peewee.mixins',
            'fleaker.peewee.mixins.time',
        ],
        zip_safe=False,
        long_description=__doc__,
        include_package_data=True,
        platforms='any',
        install_requires=[
            'Flask',
            'Flask-Classful',
            'Flask-Login',
            'Flask-Marshmallow',
            'arrow',
            'bcrypt',
            'blinker',
            'marshmallow',
            'marshmallow-jsonschema',
            'peewee',
            'pendulum',
            'phonenumbers',
            'simplejson',
        ],
        classifiers=[
            'Development Status :: 2 - Pre-Alpha',
            'Environment :: Web Environment',
            'Framework :: Flask',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: BSD License',
            'Operating System :: OS Independent',
            'Programming Language :: Python',
            # @TODO: Pick specific Python versions; out of the gate flask does 2.6,
            # 2.7, 3.3, 3.4, and 3.5
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 3',
            'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
            'Topic :: Software Development :: Libraries :: Application Frameworks',
            'Topic :: Software Development :: Libraries :: Python Modules',
        ],
        keywords=['flask', 'web development', 'flask extension']
    )