Create lookup table for process arguments
@result object
164350
function() {
    var cmdArguments = process.argv.slice(2)
    var lookup = {
        values: [],
        keyValues: {}
    };
    
    cmdArguments.forEach(function(cmdArgument) {
        var keyValue = cmdArgument.split('=');
        //Flag of key value type
        if(typeof keyValue[0] === 'string' && keyValue[0].charAt(0) === '-') {
            var value = keyValue.length === 2 ? _removeQuotes(keyValue[1]) : true;
            var keyName = keyValue[0];
            lookup.keyValues[keyName] = value;
        //Value type
        } else {
            lookup.values.push(_removeQuotes(cmdArgument));
        }
    })
    
    return lookup;
}
498379
function(result) {

		LOG.warn('execute ' + fullname + ' result: ', l_name);
		LOG.warn(result, l_name);

		var res_obj = {
			func: fullname,
			res: result
		};

		res_str = JSON.stringify(res_obj);
		callback();
	}
425750
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $params = $functionParameters;
        $loop = null;
        if ( isset( $params["loop"] ) )
        {
            $loop = $tpl->elementValue( $params["loop"], $rootNamespace, $currentNamespace, $functionPlacement );
        }
        if ( $loop !== null and !is_array( $loop ) )
        {
            $tpl->error( $functionName, "Can only loop arrays", $functionPlacement );
            return;
        }

        $name = "";
        if ( !isset( $params["name"] ) )
        {
            $tpl->missingParameter( $functionName, "name" );
            return;
        }
        $name = $tpl->elementValue( $params["name"], $rootNamespace, $currentNamespace, $functionPlacement );
        $seq_var =& $GLOBALS["eZTemplateSequence-$name"];
        if ( !is_array( $seq_var ) )
            $seq_var = array();
        if ( $loop !== null )
        {
            $seq_var["loop"] = $loop;
            $seq_var["iteration"] = 0;
            $seq_var["index"] = 0;
        }
        else
        {
            $index =& $seq_var["index"];
            $iteration =& $seq_var["iteration"];
            ++$iteration;
            ++$index;
            if ( $index >= count( $seq_var["loop"] ) )
                $index = 0 ;
        }
        $tpl->setVariable( "item", $seq_var["loop"][$seq_var["index"]], $tpl->mergeNamespace( $rootNamespace, $name ) );
        $tpl->setVariable( "iteration", $seq_var["iteration"], $tpl->mergeNamespace( $rootNamespace, $name ) );
    }
643089
protected function processResults($results, $object = false)
    {
        $processor = new DataProcessor(
            $results,
            $this->getColumnsDefinition(),
            $this->templates,
            $this->request->input('start')
        );

        return $processor->process($object);
    }
653444
def add_result(self, scan_id, result_type, host='', name='', value='',
                   port='', test_id='', severity='', qod=''):
        

        assert scan_id
        assert len(name) or len(value)
        result = dict()
        result['type'] = result_type
        result['name'] = name
        result['severity'] = severity
        result['test_id'] = test_id
        result['value'] = value
        result['host'] = host
        result['port'] = port
        result['qod'] = qod
        results = self.scans_table[scan_id]['results']
        results.append(result)
        # Set scan_info's results to propagate results to parent process.
        self.scans_table[scan_id]['results'] = results
321931
private String processSqlParams(Object value) {

        Object[] arr = null;
        if (value != null) {
            arr = TypeMappingsFactory.toObjectArray(value);
        }

        if (value == null || (arr != null && arr.length == 0)) {
            return "";
        } else if (arr != null) {
            StringBuilder result = new StringBuilder();
            for (int i = 0; i < arr.length; i++) {
                if (i > 0) {
                    result.append(',');
                    result.append(arr[i].toString());
                } else {
                    result.append(arr[i].toString());
                }
            }
            return result.toString();
        } else {
            return value.toString();
        }
    }
1023827
private function createProcess()
    {
        $descriptorSpec = [
            ['pipe', 'r'], // stdin
            ['pipe', 'w'], // stdout
            ['pipe', 'r']  // stderr
        ];

        $this->process = proc_open($this->cmd, $descriptorSpec, $this->pipes, $this->cwd);

        if (!is_resource($this->process)) {
            throw new \RuntimeException('Could not create the process.');
        }
    }
869790
private function postProcessResults($post_query, $results, $meta) {
        if(is_null($post_query)) {
            return $results;
        }

        $ret = [];
        switch($post_query[0]) {
            // Join up all results with a given key:value.
            case Token::C_TRANS:
                $key = $post_query[1];

                $ret_map = [];
                foreach($results as $result) {
                    if(!array_key_exists($key, $result)) {
                        continue;
                    }

                    $value = $result[$key];
                    if(!array_key_exists($value, $ret_map)) {
                        $ret_map[$value] = [];
                    }
                    $ret_map[$value] = array_merge($ret_map[$value], $result);
                }

                $ret = array_values($ret_map);
                break;
            default:
                throw new Exception('Unexpected command');
        }

        // If we wanted a count, generate it now.
        if($meta['count']) {
            $ret = ['count' => count($ret)];
        }

        return $ret;
    }
960369
public function _prep_args($result, $is_key=FALSE) {
		if (is_null($result)) {
			return 'null';
		} elseif (is_bool($result)) {
			return ($result===TRUE) ? 'true' : 'false';
		} elseif (is_string($result)||$is_key) {
			return '"'.str_replace(array (
					'\\',"\t","\n","\r",'"','/'
			), array (
					'\\\\','\\t','\\n',"\\r",'\"','\/'
			), $result).'"';
		} elseif (is_scalar($result)) {
			return $result;
		}
	}
438652
function referenced( $name, $where = null, $params = array() ) {

        $result = $this->db->createResult( $this, $name );

        if ( $where !== null ) {

            if ( !is_array( $params ) ) $params = array_slice( func_get_args(), 2 );
            $result = $result->where( $where, $params );

        }

        return $result;

    }
738752
private function processHitResultsRecurse($results, $prefix=null) {
        if(!is_array($results)) {
            return [$prefix => $results];
        }

        $ret = [];
        foreach($results as $key=>$result) {
            // Flatten arrays.
            $sub_prefix = is_null($prefix) ? $key:"$prefix.$key";
            $ret = array_merge($ret, $this->processHitResultsRecurse($result, $sub_prefix));
        }
        return $ret;
    }
1309638
def process_result
      input, output = @options[:input], @options[:output]
      args = @args.dup
      input ||=
        begin
          filename = args.shift
          @options[:filename] = filename
          open_file(filename) || $stdin
        end
      @options[:output_filename] = args.shift
      output ||= @options[:output_filename] || $stdout
      @options[:input], @options[:output] = input, output
    end
238345
def result(*params, &parser)
      Result.new(
        @client,
        host,
        path,
        merged_params(*params),
        &parser
      ).result
    end
1350639
function lookupArgs (args, cb) {
  if (!args.length) return readInstalled([], function (er, inst) {
    if (er) return cb(er)
    var a = []
    asyncMap(Object.keys(inst), function (p, cb) {
      cb(null, Object.keys(inst[p]).map(function (v) {
        var o = {}
        o[p] = {}
        o[p][v] = inst[p][v]
        if (o[p][v].active) o[p].active = v
        return o
      }))
    }, cb)
  })
  var req = {}
  args.forEach(function (a) {
    a = a.split("@")
    var n = a.shift()
      , v = a.join("@")
    ;(req[n] = req[n] || []).push(v)
  })
  log.silly(req, "rebuild request")
  readInstalled(Object.keys(req), function (er, inst) {
    asyncMap(Object.keys(inst), function (p, cb) {
      if (!req.hasOwnProperty(p)) return cb()
      var matches = []
      Object.keys(inst[p]).forEach(function (v) {
        req[p].forEach(function (r) {
          var o = {}
          o[p] = {}
          if (inst[p][v].active) o[p].active = v
          if (semver.satisfies(v, r)) o[p][v] = inst[p][v]
          matches.push(o)
        })
      })
      log.verbose(p, "rebuild")
      cb(null, matches)
    }, cb)
  })
}
779143
function (args) {
    var i, val, akey, result = {};
    Object.keys(args).forEach(function (key) {
        val = args[key];
        if (Array.isArray(val)) {
            for (i = 0; i < val.length; i++) {
                akey = key + '[' + i + ']';
                result[akey] = val[i];
            }
        }
        else {
            result[key] = val;
        }
    });
    return result;
}
311745
function getArgs(){

    var params, args = [], wasFlag, posIndex;
    if(!hasWindow && hasProcess){
        params = process.argv.slice(2);

        if(!params.length) return [];

        if((posIndex = params.indexOf('--')) !== -1){
            return params.slice(posIndex + 1);
        }

        for(var i=0; i<params.length; i++){

            if(isFlag(params[i])){
                wasFlag = params[i];
                if(hasEqual(params[i])){
                    if(i+1 < params.length - 1 && !isFlag(params[i+1])){
                        i++;
                        args.push(toJSValue(params[i]));
                        wasFlag = false;
                    }
                }
            }else{

                if(!wasFlag){
                    args.push(toJSValue(params[i]));
                }
                wasFlag = false;
            }
        }

        return args;
    }else if(hasWindow){
        return window.location.pathname.split('/');
    }

    return [];
}
147765
public function processColumnListing($results)
	{
		return array_map(function ($result) {
			return is_object($result) ? $result->column_name : $result['column_name'];
		}, $results);
	}