[array_cate_in_sub 获取input的中对应total的所有父级信息,并组织好结构]
@param  [type] $input   [输入的儿子的pid]
@param  [type] $total   [总分类]
@param  string $pidname [pid名]
@param  string $subname [子分类名]
@return [type]          [返回值]
962911
public static function array_cate_in_sub($input,$total,$pid=0,$pidname='pid',$subname='sub'){

        $result=self::array_cate_as_subarray_killold($input,$pid,$pidname,$subname);
        $total =self::array_cate_as_subarray($total,$pid,$pidname,$subname);

        if($input){
            $pid_input=[];
            $sub=[];
            foreach($input as $key=>$value){
                if(in_array($value[$pidname], $pid_input)){
                    $sub[$value[$pidname]][]=$value;
                }else{
                    $pid_input[]=$value[$pidname];
                    $sub[$value[$pidname]][]=$value;
                }
            }
            foreach ($sub as $key => $value) {

                $result[]=self::array_all_father($key,$total,$value,$pidname,$subname);
            }
        }
        return self::array_cate_merge_father($result,$subname);
    }
1098206
public function downloadBill($input, $time_out = 6)
	{
		$url = 'https://api.mch.weixin.qq.com/pay/downloadbill';
		//检测必填参数
		if (! $input->isBillDateSet()) {
			throw new WxPayException('对账单接口中，缺少必填参数bill_date！');
		}
		$input->setAppid(Wxpay::getConfig('appid')); //公众账号ID
		$input->setMchId(Wxpay::getConfig('mchid')); //商户号
		$input->setSubMchId(Wxpay::getConfig('sub_mch_id')); //子商户号
		$input->setNonceStr($this->getNonceStr()); //随机字符串


		$input->setSign(); //签名
		$xml = $input->toXml();

		$response = $this->postXmlCurl($xml, $url, false, $time_out);
		if (substr($response, 0, 5) == '<xml>') {
			return '';
		}
		return $response;
	}
1277198
public static function only(array $input, $included = [])
    {
        Arguments::define(
            Boa::either(
                Boa::arrOf(Boa::either(
                    Boa::string(),
                    Boa::integer()
                )),
                Boa::null()
            )
        )->check($included);

        if (is_null($included)) {
            return $input;
        }

        if (count($included) == 0) {
            return [];
        }

        return array_intersect_key($input, array_flip($included));
    }
1085843
protected String getSubstitutionValue(String input)
   {
      if (input == null || input.trim().equals(""))
         return input;

      while (input.indexOf("${") != -1)
      {
         int from = input.indexOf("${");
         int to = input.indexOf("}");
         int dv = input.indexOf(":", from + 2);

         if (dv != -1 && dv > to)
         {
            dv = -1;
         }
         
         String systemProperty = "";
         String defaultValue = "";
         if (dv == -1)
         {
            String s = input.substring(from + 2, to);
            if ("/".equals(s))
            {
               systemProperty = File.separator;
            }
            else if (":".equals(s))
            {
               systemProperty = File.pathSeparator;
            }
            else
            {
               systemProperty = SecurityActions.getSystemProperty(s);
            }
         }
         else
         {
            systemProperty = SecurityActions.getSystemProperty(input.substring(from + 2, dv));
            defaultValue = input.substring(dv + 1, to);
         }
         String prefix = "";
         String postfix = "";

         if (from != 0)
         {
            prefix = input.substring(0, from);
         }
         
         if (to + 1 < input.length() - 1)
         {
            postfix = input.substring(to + 1);
         }

         if (systemProperty != null && !systemProperty.trim().equals(""))
         {
            input = prefix + systemProperty + postfix;
         }
         else if (!defaultValue.trim().equals(""))
         {
            input = prefix + defaultValue + postfix;
         }
         else
         {
            input = prefix + postfix;
         }
      }
      return input;
   }
518559
public function input($filename, $input)
    {
        if (substr($filename, strlen($this->_settings['ext']) * -1) !== $this->_settings['ext']) {
            return $input;
        }

        $tmpFile = tempnam(TMP, 'TYPESCRIPT');
        $cmd = $this->_settings['typescript'] . " " . escapeshellarg($filename) . " --out " . $tmpFile;
        $this->_runCmd($cmd, null);
        $output = file_get_contents($tmpFile);
        unlink($tmpFile);
        return $output;
    }
53795
public function counting($name, $hit, $total = null)
    {
        if (!is_string($name) || empty($name)) {
            return;
        }
        if (!isset($this->_countings[$name])) {
            $this->_countings[$name] = ['hit' => 0, 'total' => 0];
        }
        $this->_countings[$name]['hit'] += intval($hit);
        if ($total !== null) {
            $this->_countings[$name]['total'] += intval($total);
        }
    }
834198
private function parseRequiredValue($name, array $input)
    {
        if (isset($input[$name])) {
            return $input[$name];
        }

        throw new Exception(sprintf("'%s' is required.", $name));
    }
883727
public function input($filename, $input)
    {
        if (substr($filename, strlen($this->_settings['ext']) * -1) !== $this->_settings['ext']) {
            return $input;
        }

        $tmpfile = tempnam(TMP, 'asset_compress_less');
        $this->_generateScript($tmpfile, $input);

        $bin = $this->_settings['node'] . ' ' . $tmpfile;
        $env = array('NODE_PATH' => $this->_settings['node_path']);
        $return = $this->_runCmd($bin, '', $env);
        unlink($tmpfile);
        return $return;
    }
400623
private function inputInOpenStringOrComment($input)
    {
        if (!$this->hasCode()) {
            return;
        }

        $code = $this->codeBuffer;
        \array_push($code, $input);
        $tokens = @\token_get_all('<?php ' . \implode("\n", $code));
        $last = \array_pop($tokens);

        return $last === '"' || $last === '`' ||
            (\is_array($last) && \in_array($last[0], [T_ENCAPSED_AND_WHITESPACE, T_START_HEREDOC, T_COMMENT]));
    }
741836
private function withParam( string$input )
	{
		return str_replace('$_FLAG_$',"__HTSL_CTRL_FLAG_{$this->id}__",preg_replace_callback('/(?<!%)%s((?:\\/.+?(?<!\\\\)\\/.+?(?<!\\\\)\\/)+)?/',function( array$matches ){
			$param= $this->param;

			if( isset($matches[1]) ){
				array_map(...[
					function($replacer)use(&$param){
						list($pattern,$replacement,)= preg_split('/(?<!\\\\)\\//',$replacer);
						$param= preg_replace(...[
							"/$pattern/",
							preg_replace('/^\\\\_$/','',$replacement),
							$param,
						]);
					},
					preg_split(
						'/(?<!\\\\)\\/\\//'
						,
						trim($matches[1],'/')
					),
				]);
			}
			return $param;
		},$input));
	}
165025
public static String qsub(String input) {
        final CommandLine cmdLine = new CommandLine(COMMAND_QSUB);
        cmdLine.addArgument(input);

        final OutputStream out = new ByteArrayOutputStream();
        final OutputStream err = new ByteArrayOutputStream();

        DefaultExecuteResultHandler resultHandler;
        try {
            resultHandler = execute(cmdLine, null, out, err);
            resultHandler.waitFor(DEFAULT_TIMEOUT);
        } catch (ExecuteException e) {
            throw new PBSException("Failed to execute qsub command: " + e.getMessage(), e);
        } catch (IOException e) {
            throw new PBSException("Failed to execute qsub command: " + e.getMessage(), e);
        } catch (InterruptedException e) {
            throw new PBSException("Failed to execute qsub command: " + e.getMessage(), e);
        }

        final int exitValue = resultHandler.getExitValue();
        LOGGER.info("qsub exit value: " + exitValue);
        LOGGER.fine("qsub output: " + out.toString());

        if (exitValue != 0)
            throw new PBSException("Failed to submit job script " + input + ". Error output: " + err.toString());

        String jobId = out.toString();
        return jobId.trim();
    }
752024
protected function parseTemplateRecursive(&$input, &$template)
    {
        if (!is_array($input) || empty($input)) {
            return;
        }

        while (true) {
            $tag = current($input);
            next($input);

            if ($tag === false) {
                break;
            }

            $firstChar = substr($tag, 0, 1);

            switch ($firstChar) {
                // is closing TAG
                case '/':
                    return substr($tag, 1);
                break;

                // is TAG
                case '$':

                    $tag = substr($tag, 1);

                    $full_tag = $this->regTag($tag);
                    $template[$full_tag] = '';  // empty value
                    $this->tags[$tag][] = &$template[$full_tag];

                    // eat next chunk
                    $chunk = current($input); next($input);
                    if ($chunk !== false && $chunk !== null) {
                        $template[] = $chunk;
                    }

                break;

                // recurse
                default:

                    $full_tag = $this->regTag($tag);

                    // next would be prefix
                    $prefix = current($input); next($input);
                    $template[$full_tag] = ($prefix === false || $prefix === null) ? [] : [$prefix];

                    $this->tags[$tag][] = &$template[$full_tag];

                    $this->parseTemplateRecursive($input, $template[$full_tag]);

                    $chunk = current($input); next($input);
                    if ($chunk !== false && !empty($chunk)) {
                        $template[] = $chunk;
                    }

                break;
            }
        }
    }
595228
private function convertInputToSubmittedData(InputInterface $input, FormInterface $form)
    {
        $submittedData = [];

        // we don't need to do this recursively, since command options are one-dimensional (or are they?)
        foreach ($form->all() as $name => $field) {
            if ($input->hasOption($name)) {
                $submittedData[$name] = $input->getOption($name);
            }
        }

        return $submittedData;
    }
140926
public function parse($source, Input $input)
    {
        if (! $this->sourceAllowed()) {
            return $source;
        }

        if ($this->hasMatches($source)) {
            $matches = $this->getMatches($source);
            $stars   = synapse()->memory->shortTerm()->get('stars');

            foreach ($matches as $key => $match) {
                $needle = $match[0];
                $index  = (empty($match[1]) ? 0 : $match[1] - 1);

                $source = str_replace($match[0], $stars[$index], $source);
            }
        }

        return $source;
    }
306228
public function parseOneFromArray(array $input)
    {
        if (true !== ($result = $this->hasRequiredKeys($input)))
        {
            throw new \Exception('Required elements not present: ' . print_r($result, true) . ' missing.' . PHP_EOL);
        }

        //Initialize item
        try
        {
            $item = $this->itemInit($input);
        } catch (\Exception $e)
        {
            throw new \Exception('Unable to initialize Item: ' . $e->getMessage() . PHP_EOL);
        }

        //Append data
        if (isset($input[static::DATA_KEY]))
        {
            $data = $input[static::DATA_KEY];
            if (true !== $this->isValidDataArray($data))
            {
                throw new \Exception('Item data cannot be parsed. Check it\'s format is the following
                \'data\' => array( array( \'name\', \'value\', \'prompt\') ). You can add as many inner arrays as you
                like, name and value are required fields.');
            }
            foreach ($data as $object)
            {
                $name = current($object);
                next($object);
                $value  = current($object);
                $prompt = '';
                if (next($object))
                {
                    $prompt = current($object);
                }
                $item->addData($name, $value, $prompt);
            }
        }

        return $item;
    }
102888
private int subParse(String text, int start, char ch, int count,
            boolean obeyCount, boolean allowNegative,
            boolean[] ambiguousYear, Calendar cal,
            MessageFormat numericLeapMonthFormatter, Output<TimeType> tzTimeType) {
        return subParse(text, start, ch, count, obeyCount, allowNegative, ambiguousYear, cal, null, null, null);
    }
241401
public function setInput($input)
    {
        if (is_resource($input)) {
            $input = stream_get_contents($input);
        }

        if (is_string($input)) {
            $reader = new SabreXml\Reader();
            $reader->elementMap['{'.self::XCAL_NAMESPACE.'}period']
                = 'Sabre\VObject\Parser\XML\Element\KeyValue';
            $reader->elementMap['{'.self::XCAL_NAMESPACE.'}recur']
                = 'Sabre\VObject\Parser\XML\Element\KeyValue';
            $reader->xml($input);
            $input = $reader->parse();
        }

        $this->input = $input;
    }