Функция создаёт заголовки файлов
в зависимости от расширения файла
перед отправкой их клиенту
@param pParams
name - имя файла
gzip - данные сжаты gzip'ом
query
https://developers.google.com/speed/docs/best-practices/caching?hl=ru#LeverageProxyCaching
515107
function generateHeaders(params) {
    let header, isContain, cmp,
        maxAge          = 31337 * 21;
    
    const p = params;
    const extension = path.extname(p.name);
    let type = p.mime || ext[extension] || 'text/plain';
    let encoding = '';
    
    isContain = /img|image|audio/.test(type);
    if (!isContain)
        encoding = '; charset=UTF-8';
    
    isContain = /download/.test(p.query);
    if (isContain)
        type = 'application/octet-stream';
    
    header          = {
        'Access-Control-Allow-Origin'   : '*',
        'Content-Type'                  : type  + encoding,
        'Vary'                          : 'Accept-Encoding',
        'Accept-Ranges'                 : 'bytes'
    };
    
    if (p.time)
        assign(header, {
            'Last-Modified' : p.time
        });
    
    if (p.range)
        assign(header, {
            'Content-Range' :   'bytes '    + p.range.start + 
                                '-'         + p.range.end   + 
                                '/'         + p.range.sizeTotal,
            
            'Content-Length':   p.range.size
        });
    else if (p.length)
        assign(header, {
            'Content-Length':   p.length
        });
    
    cmp = extension === '.appcache';
    if (!p.cache || cmp)
        maxAge  = 0;
    
    header['Cache-Control'] = 'max-age=' + maxAge;
    
    if (p.gzip)
        header['Content-Encoding']  = 'gzip';
    
    return header;
}
373641
public static Map<String, Object> loadParseResources(
      final TrainingParameters params) throws IOException {
    final Map<String, Object> resources = new HashMap<String, Object>();
    @SuppressWarnings("rawtypes")
    final Map<String, ArtifactSerializer> artifactSerializers = SequenceLabelerModel
        .createArtifactSerializers();

    if (Flags.isBrownFeatures(params)) {
      final String ClusterLexiconPath = Flags.getBrownFeatures(params);
      final String serializerId = "brownserializer";
      final List<File> ClusterLexiconFiles = Flags
          .getClusterLexiconFiles(ClusterLexiconPath);
      for (final File ClusterLexiconFile : ClusterLexiconFiles) {
        final String brownFilePath = ClusterLexiconFile.getCanonicalPath();
        artifactSerializers.put(serializerId,
            new WordCluster.WordClusterSerializer());
        loadResource(serializerId, artifactSerializers, brownFilePath,
            resources);
      }
    }
    if (Flags.isClarkFeatures(params)) {
      final String clarkClusterPath = Flags.getClarkFeatures(params);
      final String serializerId = "clarkserializer";
      final List<File> clarkClusterFiles = Flags
          .getClusterLexiconFiles(clarkClusterPath);
      for (final File clarkClusterFile : clarkClusterFiles) {
        final String clarkFilePath = clarkClusterFile.getCanonicalPath();
        artifactSerializers.put(serializerId,
            new WordCluster.WordClusterSerializer());
        loadResource(serializerId, artifactSerializers, clarkFilePath,
            resources);
      }
    }
    if (Flags.isWord2VecClusterFeatures(params)) {
      final String ClusterLexiconPath = Flags
          .getWord2VecClusterFeatures(params);
      final String serializerId = "word2vecserializer";
      final List<File> ClusterLexiconFiles = Flags
          .getClusterLexiconFiles(ClusterLexiconPath);
      for (final File ClusterLexiconFile : ClusterLexiconFiles) {
        final String word2vecFilePath = ClusterLexiconFile.getCanonicalPath();
        artifactSerializers.put(serializerId,
            new WordCluster.WordClusterSerializer());
        loadResource(serializerId, artifactSerializers, word2vecFilePath,
            resources);
      }
    }
    if (Flags.isPOSTagModelFeatures(params)) {
      final String morphoResourcesPath = Flags.getPOSTagModelFeatures(params);
      final String posSerializerId = "seqmodelserializer";
      artifactSerializers.put(posSerializerId,
          new SequenceModelResource.SequenceModelResourceSerializer());
      loadResource(posSerializerId, artifactSerializers, morphoResourcesPath,
          resources);
    }
    if (Flags.isLemmaModelFeatures(params)) {
      final String lemmaModelPath = Flags.getLemmaModelFeatures(params);
      final String lemmaSerializerId = "seqmodelserializer";
      artifactSerializers.put(lemmaSerializerId,
          new SequenceModelResource.SequenceModelResourceSerializer());
      loadResource(lemmaSerializerId, artifactSerializers, lemmaModelPath,
          resources);
    }
    if (Flags.isLemmaDictionaryFeatures(params)) {
      final String lemmaDictPath = Flags.getLemmaDictionaryFeatures(params);
      final String[] lemmaDictResources = Flags
          .getLemmaDictionaryResources(lemmaDictPath);
      final String posSerializerId = "seqmodelserializer";
      final String lemmaDictSerializerId = "lemmadictserializer";
      artifactSerializers.put(posSerializerId,
          new SequenceModelResource.SequenceModelResourceSerializer());
      loadResource(posSerializerId, artifactSerializers, lemmaDictResources[0],
          resources);
      artifactSerializers.put(lemmaDictSerializerId,
          new DictionaryLemmatizer.DictionaryLemmatizerSerializer());
      loadResource(lemmaDictSerializerId, artifactSerializers,
          lemmaDictResources[1], resources);
    }
    return resources;
  }
16601
public JSONAware handleGetRequest(String pUri, String pPathInfo, Map<String, String[]> pParameterMap) {
        String pathInfo = extractPathInfo(pUri, pPathInfo);

        JmxRequest jmxReq =
                JmxRequestFactory.createGetRequest(pathInfo,getProcessingParameter(pParameterMap));

        if (backendManager.isDebug()) {
            logHandler.debug("URI: " + pUri);
            logHandler.debug("Path-Info: " + pathInfo);
            logHandler.debug("Request: " + jmxReq.toString());
        }
        return executeRequest(jmxReq);
    }
1184174
private function gzipCompressOptimizedResourceFiles(): void
  {
    $this->logInfo('Gzip compressing files.');

    foreach ($this->getResourcesInfo() as $file_info)
    {
      $this->logVerbose("Gzip compressing file '%s' to '%s'.",
                        $file_info['full_path_name_with_hash'],
                        $file_info['full_path_name_with_hash'].'.gz');

      // Get data from the file.
      $data_opt = file_get_contents($file_info['full_path_name_with_hash']);
      if ($data_opt===false)
      {
        $this->logError("Can not read the file '%s' or file does not exist.", $file_info['full_path_name_with_hash']);
      }

      // Compress data with gzip
      $data_gzip = gzencode($data_opt, 9);
      if ($data_gzip===false)
      {
        $this->logError("Can not write the file '%s' or file does not exist.",
                        $file_info['full_path_name_with_hash'].'.gz');
      }

      if (strlen($data_gzip)<strlen($data_opt))
      {
        // Write data to the file.
        $status = file_put_contents($file_info['full_path_name_with_hash'].'.gz', $data_gzip);
        if ($status===false)
        {
          $this->logError("Unable to write to file '%s", $file_info['full_path_name_with_hash'].'.gz');
        }

        // If required preserve mtime.
        if ($this->preserveModificationTime)
        {
          $info  = $this->getResourceInfoByHash($file_info['full_path_name_with_hash']);
          $mtime = $info['mtime'];
          $this->setModificationTime($file_info['full_path_name_with_hash'].'.gz', $mtime);
        }

        // If required preserve file permissions.
        clearstatcache();
        if ($this->preserveModificationTime && fileperms($file_info['full_path_name_with_hash'])!==false)
        {
          $this->setFilePermissions($file_info['full_path_name_with_hash'].'.gz', $file_info['full_path_name_with_hash']);
        }
      }
    }
  }
435929
static Map<ConfigKey, String> convertToConfigMap(Map<String, String> pParams) {
        Map<ConfigKey,String> config = new HashMap<ConfigKey, String>();
        if (pParams != null) {
            for (Map.Entry<String,?> entry : pParams.entrySet()) {
                ConfigKey cKey = ConfigKey.getRequestConfigKey(entry.getKey());
                if (cKey != null) {
                    Object value = entry.getValue();
                    config.put(cKey, value != null ? value.toString() : null);
                }
            }
        }
        return config;
    }
948558
private void initParameters(ProcessingParameters pParams) {
        processingConfig = pParams;
        String ignoreErrors = processingConfig.get(ConfigKey.IGNORE_ERRORS);
        if (ignoreErrors != null && ignoreErrors.matches("^(true|yes|on|1)$")) {
            valueFaultHandler = ValueFaultHandler.IGNORING_VALUE_FAULT_HANDLER;
        } else {
            valueFaultHandler = ValueFaultHandler.THROWING_VALUE_FAULT_HANDLER;
        }
    }
900078
protected void appendMapKey(StringBuilder buffer, Map<String, Object> params) {
        if (params==null || params.isEmpty()) {
            buffer.append(EMPTY_MAP_STRING);
            buffer.append(OPENING_BRACKET);
        } else {
            buffer.append(OPENING_BRACKET);
            Map map = new LinkedHashMap<>(params);
            final String requestControllerName = getRequestStateLookupStrategy().getControllerName();
            if (map.get(UrlMapping.ACTION) != null && map.get(UrlMapping.CONTROLLER) == null && map.get(RESOURCE_PREFIX) == null) {
                Object action = map.remove(UrlMapping.ACTION);
                map.put(UrlMapping.CONTROLLER, requestControllerName);
                map.put(UrlMapping.ACTION, action);
            }
            if (map.get(UrlMapping.NAMESPACE) == null && map.get(UrlMapping.CONTROLLER) == requestControllerName) {
                String namespace = getRequestStateLookupStrategy().getControllerNamespace();
                if (GrailsStringUtils.isNotEmpty(namespace)) {
                    map.put(UrlMapping.NAMESPACE, namespace);
                }
            }
            boolean first = true;
            for (Object o : map.entrySet()) {
                Map.Entry entry = (Map.Entry) o;
                Object value = entry.getValue();
                if (value == null) continue;
                first = appendCommaIfNotFirst(buffer, first);
                Object key = entry.getKey();
                if (RESOURCE_PREFIX.equals(key)) {
                    value = getCacheKeyValueForResource(value);
                }
                appendKeyValue(buffer, map, key, value);
            }
        }
        buffer.append(CLOSING_BRACKET);
    }
966189
public com.google.api.ads.adwords.axis.v201809.cm.CustomParameters getPromotionUrlCustomParameters() {
        return promotionUrlCustomParameters;
    }
335190
public final void mPARAM() throws RecognitionException {
		try {
			int _type = PARAM;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:760:6: ( '?' )
			// hql.g:760:8: '?'
			{
			match('?'); if (state.failed) return;
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
551423
public void pushParameterStack(Map parameters)
    {
        if (parameters == null)
        {
            _paramStack.push(null);
        } else {
            _paramStack.push(((Hashtable)parameters).clone());
        }
    }
15710
public static void addToParameters(final IRequestParameters parameters,
		final Map<String, List<StringValue>> parameterMap)
	{
		for (final String parameterName : parameters.getParameterNames())
		{
			final List<StringValue> parameterValues = parameters.getParameterValues(parameterName);
			parameterMap.put(parameterName, parameterValues);
		}
	}
966167
private void loadParserTrainingParameters() {
    this.parserTrainerParser.addArgument("-p", "--params").required(true)
        .help("Load the parsing training parameters file.\n");
    this.parserTrainerParser.addArgument("-t", "--taggerParams").required(true)
        .help(
            "Load the tagger training parameters file or an already trained POS tagger model.\n");
    this.parserTrainerParser.addArgument("-c", "--chunkerParams").required(true)
        .help("Load the chunker training parameters file.\n");
  }
593382
protected void buildConfigParams(final Map<String, String> params){
        params.put(WepayField.APP_ID, wepay.getAppId());
        params.put(WepayField.MCH_ID, wepay.getMchId());
    }
13390
@Nonnull
  public FineUploaderBasic addParams (@Nullable final Map <String, String> aParams)
  {
    m_aRequestParams.addAll (aParams);
    return this;
  }
339766
public function setGlobalSearchParameters($searchKeywordParameters, $searchCategoryParameters)
    {
        Piwik::checkUserHasSuperUserAccess();
        Option::set(self::OPTION_SEARCH_KEYWORD_QUERY_PARAMETERS_GLOBAL, $searchKeywordParameters);
        Option::set(self::OPTION_SEARCH_CATEGORY_QUERY_PARAMETERS_GLOBAL, $searchCategoryParameters);
        Cache::deleteTrackerCache();
        return true;
    }
663902
@Override
    public boolean parseParameters(Object params)
    {
        if (params == null || !(params instanceof BuildBattleDecorator))
            return false;

        this.params = (BuildBattleDecorator) params;

        this.sourceBounds = this.params.getGoalStructureBounds();
        this.destBounds = this.params.getPlayerStructureBounds();
        this.delta = new Vec3i(destBounds.getMin().getX() - sourceBounds.getMin().getX(),
                               destBounds.getMin().getY() - sourceBounds.getMin().getY(),
                               destBounds.getMin().getZ() - sourceBounds.getMin().getZ());
        
        this.structureVolume = volumeOfBounds(this.sourceBounds);
        assert(this.structureVolume == volumeOfBounds(this.destBounds));
        this.dest = new ArrayList<IBlockState>(Collections.nCopies(this.structureVolume, (IBlockState)null));
        this.source = new ArrayList<IBlockState>(Collections.nCopies(this.structureVolume, (IBlockState)null));
        
        DrawBlockBasedObjectType tickBlock = this.params.getBlockTypeOnCorrectPlacement();
        DrawBlockBasedObjectType crossBlock = this.params.getBlockTypeOnIncorrectPlacement();

        this.blockTypeOnCorrectPlacement = (tickBlock != null) ? new XMLBlockState(tickBlock.getType(), tickBlock.getColour(), tickBlock.getFace(), tickBlock.getVariant()) : null;
        this.blockTypeOnIncorrectPlacement = (crossBlock != null) ? new XMLBlockState(crossBlock.getType(), crossBlock.getColour(), crossBlock.getFace(), crossBlock.getVariant()) : null;
        return true;
    }
844827
@Override
  public void destroyProxy(ProxyDestroyParams params) {

    if (params.getProxyFile() == null) {

      params.setProxyFile(VOMSProxyPathBuilder.buildProxyPath());
    }

    File file = new File(params.getProxyFile());

    if (!file.exists()) {

      listener.notifyProxyNotFound();

      System.exit(1);
    }

    if (params.isDryRun()) {

      listener.warnProxyToRemove(params.getProxyFile());

      System.exit(0);
    }

    file.delete();

  }