Execute cinch job with context and spark conf.
337340
@Override
    public void execute(StreamingCinchContext cinchContext, SparkConf sparkConf)  {
        JavaStreamingContext streamingContext = new JavaStreamingContext(sparkConf, new Duration(durationInMillis));

        defineJob(streamingContext, cinchContext);

        streamingContext.start();
        streamingContext.awaitTermination();
    }
267010
def run(entry_point, drivers, loop = None):
    ''' 
    '''
    program = setup(entry_point, drivers)
    dispose = program.run()
    if loop == None:
        loop = asyncio.get_event_loop()

    loop.run_forever()
    dispose()
901948
def run(context, port):
    
    global ctx
    ctx = context
    app.run(port=port)
877958
def main(conf):
    """"""
    global config
    config = load_configuration(conf)
    app.conf.update(config['celery'])
    run(host=config['valigator']['bind'], port=config['valigator']['port'])
1159442
def execute(self):
        

        self.browser_config = BrowserConfig(
            runner=self,
            browser_id=BROME_CONFIG['runner_args']['localhost_runner'],
            browsers_config=BROME_CONFIG['browsers_config']
        )

        try:
            self.run()
        except KeyboardInterrupt:
            self.info_log("Test batch interrupted")

        except:
            tb = traceback.format_exc()
            self.error_log("Exception in run of the grid runner: %s" % str(tb))
            raise
        finally:
            self.terminate()
368642
def run_mapper(self, stdin=sys.stdin, stdout=sys.stdout):
        
        self.init_hadoop()
        self.init_mapper()
        outputs = self._map_input((line[:-1] for line in stdin))
        if self.reducer == NotImplemented:
            self.writer(outputs, stdout)
        else:
            self.internal_writer(outputs, stdout)
572713
function RunnerContext(argv, config, env) {
  argv.tasks = argv._.length ? argv._ : ['default'];
  this.argv = argv;
  this.config = config;
  this.env = env;
  this.json = loadConfig(this.argv.cwd, this.env);
  this.pkg = loadPkg(this.argv.cwd, this.env);
  this.pkgConfig = this.pkg[env.name] || {};
  this.options = merge({}, this.pkgConfig.options, this.json.options);
}
249898
def do_execute(self):
        
        conv = self.config["setup"].shallow_copy()
        conv.input = self._input.payload
        result = conv.convert()
        if result is None:
            if conv.output is not None:
                self._output.append(Token(conv.output))
        return None
140324
def execute(self):
        
        self.print_info()
        linters = [
            l for l in [
                self._config.lint,
                self._config.verifier.lint,
                self._config.provisioner.lint,
            ] if l
        ]

        for l in linters:
            l.execute()
1151060
def execute(self, context):
        """"""
        for ware in self.middleware:
            ware.premessage(context)
            context = ware.bind(context)
            ware.postmessage(context)
        return context
1356212
def before_scenario(context, scenario):
    """"""

    # Prepare a new temporary directory.
    context.directory = testfixtures.TempDirectory(create=True)
    context.old_cwd = os.getcwd()
    context.new_cwd = context.directory.path

    # Move into our new working directory.
    os.chdir(context.new_cwd)
808279
def run_job_with_command(rdd, partitions, allow_local, command, *args)
      if !partitions.nil? && !partitions.is_a?(Array)
        raise Spark::ContextError, 'Partitions must be nil or Array'
      end

      partitions_size = rdd.partitions_size

      # Execute all parts
      if partitions.nil?
        partitions = (0...partitions_size).to_a
      end

      # Can happend when you use coalesce
      partitions.delete_if {|part| part >= partitions_size}

      # Rjb represent Fixnum as Integer but Jruby as Long
      partitions = to_java_array_list(convert_to_java_int(partitions))

      # File for result
      file = Tempfile.new('collect', temp_dir)

      mapped = rdd.new_rdd_from_command(command, *args)
      RubyRDD.runJob(rdd.context.sc, mapped.jrdd, partitions, allow_local, file.path)

      mapped.collect_from_file(file)
    end
1248799
def spawn_batch_jobs(job, shared_ids, input_args):
    
    samples = []
    config = input_args['config']
    with open(config, 'r') as f_in:
        for line in f_in:
            line = line.strip().split(',')
            uuid = line[0]
            urls = line[1:]
            samples.append((uuid, urls))
    for sample in samples:
        job.addChildJobFn(alignment, shared_ids, input_args, sample, cores=32, memory='20 G', disk='100 G')
1050856
def run
      program :name, 'RubySpark'
      program :version, Spark::VERSION
      program :description, 'Ruby wrapper for Spark'

      global_option('-d', '--debug', 'Logging message to stdout'){ $DEBUG = true }
      default_command :help


      # Build ---------------------------------------------------------------
      command :build do |c|
        c.syntax = 'build [options]'
        c.description = 'Build spark and gem extensions'
        c.option '--hadoop-version STRING', String, 'Version of hadoop which will assembled with the Spark'
        c.option '--spark-core-version STRING', String, 'Version of Spark core'
        c.option '--spark-version STRING', String, 'Version of Spark'
        c.option '--scala-version STRING', String, 'Version of Scala'
        c.option '--target STRING', String, 'Directory where Spark will be stored'
        c.option '--only-ext', 'Build only extension for RubySpark'

        c.action do |args, options|
          Spark::Build.build(options.__hash__)
          puts
          puts 'Everything is OK'
        end
      end
      alias_command :install, :build


      # Shell -----------------------------------------------------------------
      command :shell do |c|
        c.syntax = 'shell [options]'
        c.description = 'Start ruby shell for spark'
        c.option '--target STRING', String, 'Directory where Spark is stored'
        c.option '--properties-file STRING', String, 'Path to a file from which to load extra properties'
        c.option '--[no-]start', 'Start Spark immediately'
        c.option '--[no-]logger', 'Enable/disable logger (default: enable)'
        c.option '--auto-reload', 'Autoreload changed files'

        c.action do |args, options|
          options.default start: true, logger: true

          Spark.load_lib(options.target)
          Spark.logger.disable unless options.logger

          Spark.config do
            set_app_name 'RubySpark'
          end

          Spark.config.from_file(options.properties_file)

          if options.auto_reload
            require 'listen'
            listener = Listen.to(File.join(Spark.root, 'lib')) do |modified, added, removed|
              (modified+added).each do |file|
                silence_warnings { load(file) }
              end
            end
            listener.start
          end

          if options.start
            # Load Java and Spark
            Spark.start
            $sc = Spark.context

            Spark.print_logo('Spark context is loaded as $sc')
          else
            Spark.print_logo('You can start Spark with Spark.start')
          end

          # Load Pry
          require 'pry'
          Pry.start
        end
      end


      # # IRB -------------------------------------------------------------------
      # command :irb do |c|
      #   c.syntax = 'irb [options]'
      #   c.description = 'Start ruby shell for spark'
      #   c.option '--spark-home STRING', String, 'Directory where Spark is stored'
      #   c.option '--[no-]start', 'Start Spark immediately'
      #   c.option '--[no-]logger', 'Enable/disable logger (default: enable)'
      #
      #   c.action do |args, options|
      #     options.default start: true, logger: true
      #
      #     Spark.load_lib(options.spark_home)
      #     Spark::Logger.disable unless options.logger
      #
      #     Spark.config do
      #       set_app_name 'Pry RubySpark'
      #     end
      #
      #     if options.start
      #       # Load Java and Spark
      #       Spark.start
      #       $sc = Spark.context
      #
      #       Spark.print_logo('Spark context is loaded as $sc')
      #     else
      #       Spark.print_logo('You can start Spark with Spark.start')
      #     end
      #
      #     # Load IRB
      #     require 'irb'
      #     require 'irb/completion'
      #     require 'irb/ext/save-history'
      #
      #     begin
      #       file = File.expand_path(IRB_HISTORY_FILE)
      #       if File.exists?(file)
      #         lines = IO.readlines(file).collect { |line| line.chomp }
      #         Readline::HISTORY.push(*lines)
      #       end
      #       Kernel.at_exit do
      #         lines = Readline::HISTORY.to_a.reverse.uniq.reverse
      #         lines = lines[-IRB_HISTORY_SIZE, IRB_HISTORY_SIZE] if lines.nitems > IRB_HISTORY_SIZE
      #         File.open(IRB_HISTORY_FILE, File::WRONLY | File::CREAT | File::TRUNC) { |io| io.puts lines.join("\n") }
      #       end
      #     rescue
      #     end
      #
      #     ARGV.clear # Clear Thor ARGV, otherwise IRB will parse it
      #     ARGV.concat ['--readline', '--prompt-mode', 'simple']
      #     IRB.start
      #   end
      # end


      # Home ------------------------------------------------------------------
      command :home do |c|
        c.action do |args, options|
          puts Spark.home
          exit(0)
        end
      end


      # Ruby spark jar --------------------------------------------------------
      command :ruby_spark_jar do |c|
        c.action do |args, options|
          puts Spark.ruby_spark_jar
          exit(0)
        end
      end

      run!
    end
1027508
public function run()
	{
		$context = $this->getContext();
		$config = $context->getConfig();
		$logger = $context->getLogger();

		/** controller/jobs/catalog/import/xml/location
		 * File or directory where the content is stored which should be imported
		 *
		 * You need to configure the XML file or directory with the XML files that
		 * should be imported. It should be an absolute path to be sure but can be
		 * relative path if you absolutely know from where the job will be executed
		 * from.
		 *
		 * @param string Absolute file or directory path
		 * @since 2019.04
		 * @category Developer
		 * @category User
		 * @see controller/jobs/catalog/import/xml/container/type
		 * @see controller/jobs/catalog/import/xml/container/content
		 * @see controller/jobs/catalog/import/xml/container/options
		 */
		$location = $config->get( 'controller/jobs/catalog/import/xml/location' );

		try
		{
			$logger->log( sprintf( 'Started catalog import from "%1$s"', $location ), \Aimeos\MW\Logger\Base::INFO );

			if( !file_exists( $location ) )
			{
				$msg = sprintf( 'File or directory "%1$s" doesn\'t exist', $location );
				throw new \Aimeos\Controller\Jobs\Exception( $msg );
			}

			$files = [];

			if( is_dir( $location ) )
			{
				foreach( new \DirectoryIterator( $location ) as $entry )
				{
					if( strncmp( $entry->getFilename(), 'catalog', 7 ) === 0 && $entry->getExtension() === 'xml' ) {
						$files[] = $entry->getPathname();
					}
				}
			}
			else
			{
				$files[] = $location;
			}

			sort( $files );
			$context->__sleep();

			$fcn = function( $filepath ) {
				$this->import( $filepath );
			};

			foreach( $files as $filepath ) {
				$context->getProcess()->start( $fcn, [$filepath] );
			}

			$context->getProcess()->wait();

			$logger->log( sprintf( 'Finished catalog import from "%1$s"', $location ), \Aimeos\MW\Logger\Base::INFO );
		}
		catch( \Exception $e )
		{
			$logger->log( 'Catalog import error: ' . $e->getMessage() . "\n" . $e->getTraceAsString() );
			throw $e;
		}
	}
325790
def execute(self):
        
        self.print_info()
        self._config.provisioner.converge()
        self._config.state.change_state('converged', True)
149152
def do_execute(self):
        
        fname = str(self.input.payload)
        if not os.path.exists(fname):
            return "File '" + fname + "' does not exist!"
        if not os.path.isfile(fname):
            return "Location '" + fname + "' is not a file!"
        if self.resolve_option("use_custom_loader"):
            self._loader = self.resolve_option("custom_loader")
        else:
            self._loader = converters.loader_for_file(fname)
        dataset = self._loader.load_file(fname, incremental=bool(self.resolve_option("incremental")))
        if not self.resolve_option("incremental"):
            self._output.append(Token(dataset))
        else:
            self._iterator = self._loader.__iter__()
        return None