Replace place pattern with concated properties
@param text {String}
@param properties {Array}
@param filePath {String}
@returns {String}
971943
function addPropertiesToText(text, properties, filePath) {

        if (!properties.length) {
            return text;
        }

        var placeRegexp = patterns.getPlacePattern(properties[0].isFromPrototype),
            matchedData = placeRegexp.exec(text);

        // Can`t find properties place
        if (!matchedData) {
            grunt.log.error("No " + (properties[0].isFromPrototype ? "prototype" : "inline") + " properties place definition at " + filePath +
                '   (properties: ' + properties.map(function (p) {return p.name + ' at ' + p.filePath; }).join(', ') + ')');

            return text;
        }

        // don`t use .replace with "$" at replacement text
        return text.replace(placeRegexp, function () {
            return (matchedData[1] ?  matchedData[1] + ',' : '') +
                ('\n\n' + concatProperties(properties))
                    .replace(/\n(?!\r?\n)/g, '\n' + matchedData[2]);
        });
    }
347341
function(filepath, fn) {
      fn = fn || lazy.dashify;
      if (typeof filepath === 'undefined') {
        var ctx = this.context();
        filepath = ctx.slug || this.path;
      }
      return fn(filepath);
    }
1122936
function rename(filepath, options) {
	var base = filepath.substr(0, filepath.lastIndexOf('.'));
	return base + (options.extname || '.html');
}
1245553
public static Map<String, String> parseProperties(String text) {

        String[] lines = text.split("\n");
        Map<String, String> result = new HashMap<String, String>();
        for (String line : lines) {
            line = line.replaceFirst("^ +", "");
            line = line.replaceAll("\r", "");
            if (line.startsWith("#")) {
                continue;
            }
            int eqPos = line.indexOf('=');
            if (eqPos > 0) {
                String key = line.substring(0, eqPos);
                String value = line.substring(eqPos + 1);
                result.put(key, value);
            }
        }
        return result;
    }
1345637
function ruleSync(filePath) {
  var ruleId = path.basename(filePath)
  var result = {}
  var tests = {}
  var description
  var code
  var tags
  var name

  ruleId = ruleId.slice('remark-lint-'.length)
  code = fs.readFileSync(path.join(filePath, 'index.js'), 'utf-8')
  tags = dox.parseComments(code)[0].tags
  description = find(tags, 'fileoverview')
  name = find(tags, 'module')

  /* istanbul ignore if */
  if (name !== ruleId) {
    throw new Error(ruleId + ' has an invalid `@module`: ' + name)
  }

  /* istanbul ignore if */
  if (!description) {
    throw new Error(ruleId + ' is missing a `@fileoverview`')
  }

  description = strip(description)

  result.ruleId = ruleId
  result.description = trim(description)
  result.tests = tests
  result.filePath = filePath

  find
    .all(tags, 'example')
    .map(strip)
    .forEach(check)

  return result

  function check(example) {
    var lines = example.split('\n')
    var value = strip(lines.slice(1).join('\n'))
    var info
    var setting
    var context
    var name

    try {
      info = JSON.parse(lines[0])
    } catch (error) {
      /* istanbul ignore next */
      throw new Error(
        'Could not parse example in ' + ruleId + ':\n' + error.stack
      )
    }

    setting = JSON.stringify(info.setting || true)
    context = tests[setting]
    name = info.name

    if (!context) {
      context = []
      tests[setting] = context
    }

    if (!info.label) {
      context[name] = {
        config: info.config || {},
        setting: setting,
        input: value,
        output: []
      }

      return
    }

    /* istanbul ignore if */
    if (info.label !== 'input' && info.label !== 'output') {
      throw new Error(
        'Expected `input` or `ouput` for `label` in ' +
          ruleId +
          ', not `' +
          info.label +
          '`'
      )
    }

    if (!context[name]) {
      context[name] = {config: info.config || {}}
    }

    context[name].setting = setting

    if (info.label === 'output') {
      value = value.split('\n')
    }

    context[name][info.label] = value
  }
}
889804
@Nullable
  public static String searchPropertiesFile(String propertiesFile,
      String[] confPathList) {
    if (propertiesFile == null || confPathList == null) {
      return null;
    }
    for (String path : confPathList) {
      String file = PathUtils.concatPath(path, propertiesFile);
      Properties properties = loadPropertiesFromFile(file);
      if (properties != null) {
        // If a site conf is successfully loaded, stop trying different paths.
        return file;
      }
    }
    return null;
  }
589617
@SuppressWarnings("unused")
	private String removeLastToken(String propertyPath) {
		String[] propertyKeyArray = propertyPath.split("\\.");

		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < propertyKeyArray.length - 2; i++) {
			sb.append(propertyKeyArray[i]);
			sb.append('.');
		}
		sb.append(propertyKeyArray[propertyKeyArray.length - 2]);
		return sb.toString();
	}
887028
public static final String property(String text)
    {
        CamelSpliterator cs = new CamelSpliterator(text);
        StringBuilder sb = new StringBuilder();
        cs.tryAdvance((s)->sb.append(lower(s)));
        StreamSupport.stream(cs, false).forEach((s)->sb.append(s));
        return sb.toString();
    }
369409
function removeUnderscore (filepath) {
  const parts = filepath.split(path.sep)
  const filename = parts.pop().replace(/^_/, '')
  return parts.concat([filename]).join(path.sep)
}
676359
function replacePlaceholders(src, options) {
	return Object.keys(placeholders).reduce((out, placeholder) => {
		return out.replace(new RegExp(`${placeholder}`, 'g'), placeholders[placeholder]);
	}, src);
}
661307
function lintOneFile(text, fullPath) {
        // If a line contains only whitespace (here spaces or tabs), remove the whitespace
        text = text.replace(/^[ \t]+$/gm, "");

        var options = prefs.get("options");

        _lastRunOptions = _.clone(options);

        if (!options) {
            options = {};
        } else {
            options = _.clone(options);
        }

        if (!options.indent) {
            // default to using the same indentation value that the editor is using
            options.indent = _getIndentSize(fullPath);
        }

        // If the user has not defined the environment, we use browser by default.
        var hasEnvironment = _.some(ENVIRONMENTS, function (env) {
            return options[env] !== undefined;
        });

        if (!hasEnvironment) {
            options.browser = true;
        }

        var jslintResult = JSLINT(text, options);

        if (!jslintResult) {
            // Remove any trailing null placeholder (early-abort indicator)
            var errors = JSLINT.errors.filter(function (err) { return err !== null; });

            errors = errors.map(function (jslintError) {
                return {
                    // JSLint returns 1-based line/col numbers
                    pos: { line: jslintError.line - 1, ch: jslintError.character - 1 },
                    message: jslintError.reason,
                    type: CodeInspection.Type.WARNING
                };
            });

            var result = { errors: errors };

            // If array terminated in a null it means there was a stop notice
            if (errors.length !== JSLINT.errors.length) {
                result.aborted = true;
                errors[errors.length - 1].type = CodeInspection.Type.META;
            }

            return result;
        }
        return null;
    }
366014
static String replace(final String text, final boolean toReference)
	{
		return toReference ? replaceWithRef(text) : replaceFromRef(text);
	}
142983
private static Properties loadWithNormalMode(final String propertyFilePath)
            throws Exception {

        Properties props = new Properties();
        props.load(new InputStreamReader(new FileInputStream(propertyFilePath), "utf-8"));
        return props;
    }
1296178
private String replaceParameters(String text) {
    	Map<String, Object> params  = bean.getParametersBean().getParamValues();
        for  (String param : params.keySet()) {
             text = StringUtil.replace(text, "\\$P\\{" + param + "\\}", StringUtil.getValueAsString(params.get(param), null));
        }
        return text;
    }
233985
function parseProperties(text, parsedPropertiesCallback) {
      var dictionary = {};

      // token expressions
      var reBlank = /^\s*|\s*$/;
      var reComment = /^\s*#|^\s*$/;
      var reSection = /^\s*\[(.*)\]\s*$/;
      var reImport = /^\s*@import\s+url\((.*)\)\s*$/i;
      var reSplit = /^([^=\s]*)\s*=\s*(.+)$/; // TODO: escape EOLs with '\'

      // parse the *.properties file into an associative array
      function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {
        var entries = rawText.replace(reBlank, '').split(/[\r\n]+/);
        var currentLang = '*';
        var genericLang = lang.split('-', 1)[0];
        var skipLang = false;
        var match = '';

        function nextEntry() {
          // Use infinite loop instead of recursion to avoid reaching the
          // maximum recursion limit for content with many lines.
          while (true) {
            if (!entries.length) {
              parsedRawLinesCallback();
              return;
            }
            var line = entries.shift();

            // comment or blank line?
            if (reComment.test(line))
              continue;

            // the extended syntax supports [lang] sections and @import rules
            if (extendedSyntax) {
              match = reSection.exec(line);
              if (match) { // section start?
                // RFC 4646, section 4.4, "All comparisons MUST be performed
                // in a case-insensitive manner."

                currentLang = match[1].toLowerCase();
                skipLang = (currentLang !== '*') &&
                    (currentLang !== lang) && (currentLang !== genericLang);
                continue;
              } else if (skipLang) {
                continue;
              }
              match = reImport.exec(line);
              if (match) { // @import rule?
                loadImport(baseURL + match[1], nextEntry);
                return;
              }
            }

            // key-value pair
            var tmp = line.match(reSplit);
            if (tmp && tmp.length == 3) {
              dictionary[tmp[1]] = evalString(tmp[2]);
            }
          }
        }
        nextEntry();
      }

      // import another *.properties file
      function loadImport(url, callback) {
        xhrLoadText(url, function(content) {
          parseRawLines(content, false, callback); // don't allow recursive imports
        }, null);
      }

      // fill the dictionary
      parseRawLines(text, true, function() {
        parsedPropertiesCallback(dictionary);
      });
    }
615641
function loadFileAsString(path, replaceWhiteSpaces){

	var file = new java.io.File(path);
	var fr = new java.io.FileReader(file);
	var br = new java.io.BufferedReader(fr);

	var line;
	var lines = "";

	while((line = br.readLine()) != null){

		if(replaceWhiteSpaces){

			lines = lines + line.replace(" ", "");

		}else{

			lines = lines + line;
		}
	}

	return lines;
}
1310132
def translate_paths (properties, path):
    
    assert is_iterable_typed(properties, Property)
    result = []

    for p in properties:

        if p.feature.path:
            values = __re_two_ampersands.split(p.value)

            new_value = "&&".join(os.path.normpath(os.path.join(path, v)) for v in values)

            if new_value != p.value:
                result.append(Property(p.feature, new_value, p.condition))
            else:
                result.append(p)

        else:
            result.append (p)

    return result