*populate placeholders in file names, folder names and content*
541585
def _populate_placeholders_in_files(
            self):
        
        self.log.info(
            'starting the ``_populate_placeholders_in_files`` method')

        rev = reversed(self.directoryContents)
        phs = self.settings["frankenstein"]["placeholder delimiters"]

        # FILE CONTENT FIRST
        for i in self.directoryContents:
            if os.path.isfile(i):
                pathToReadFile = i
                if ".DS_Store" in i:
                    os.remove(i)
                    continue
                try:
                    self.log.debug(
                        "attempting to open the file %s" % (pathToReadFile,))
                    if i[-4:] in [".png", ".jpg", ".gif"]:
                        continue
                    readFile = codecs.open(
                        pathToReadFile, encoding='ISO-8859-1', mode='r')
                    thisData = readFile.read()
                    readFile.close()
                except IOError, e:
                    message = 'could not open the file %s' % (pathToReadFile,)
                    self.log.critical(message)
                    raise IOError(message)

                newContent = thisData
                for k, v in self.phDict.iteritems():
                    for ph in phs:
                        fullPH = ph + k + ph
                        if fullPH in thisData:
                            newContent = newContent.replace(fullPH, v)

                if newContent != thisData:
                    writeFile = codecs.open(
                        pathToReadFile, encoding='ISO-8859-1', mode='w')
                    writeFile.write(newContent)
                    writeFile.close()

        # NOW FILE NAMES
        for i in self.directoryContents:
            if os.path.isfile(i):
                newPath = i
                newFile = i.split("/")[-1]
                for k, v in self.phDict.iteritems():
                    for ph in phs:
                        fullPH = ph + k + ph
                        if fullPH in newFile:
                            newFile = newFile.replace(fullPH, v)
                            newPath = "/".join(i.split("/")
                                               [:-1]) + "/" + newFile
                if newPath != i:
                    try:
                        self.log.debug("attempting to rename file %s to %s" %
                                       (i, newPath))
                        shutil.move(i, newPath)
                    except Exception, e:
                        self.log.error(
                            "could not rename file %s to %s - failed with this error: %s " % (i, newPath, str(e),))
                        sys.exit(0)

        # NOW DRIECTORY NAMES
        theseDirs = []
        for i in reversed(self.directoryContents):
            if os.path.isdir(i):
                theseDirs.append(i)
        for i in theseDirs:
            newPath = i
            newFolder = i.split("/")[-1]
            for k, v in self.phDict.iteritems():
                for ph in phs:
                    fullPH = ph + k + ph
                    if fullPH in newFolder:
                        newFolder = newFolder.replace(fullPH, v)
                        newPath = "/".join(i.split("/")[:-1]) + "/" + newFolder
            if newPath != i:
                try:
                    self.log.debug("attempting to rename file %s to %s" %
                                   (i, newPath))
                    shutil.move(i, newPath)
                except Exception, e:
                    self.log.error(
                        "could not rename file %s to %s - failed with this error: %s " % (i, newPath, str(e),))
                    sys.exit(0)

        self.log.info(
            'completed the ``_populate_placeholders_in_files`` method')
        return None
538114
def _resolve_placeholder(placeholder, original):
    
    new = copy.deepcopy(original)
    # The name remains the same.
    new["name"] = placeholder["name"]
    new["full_name"] = placeholder["full_name"]
    # Record where the placeholder originally came from.
    new["original_path"] = original["full_name"]
    # The source lines for this placeholder do not exist in this file.
    # The keys might not exist if original is a resolved placeholder.
    new.pop("from_line_no", None)
    new.pop("to_line_no", None)

    # Resolve the children
    stack = list(new.get("children", ()))
    while stack:
        child = stack.pop()
        # Relocate the child to the new location
        assert child["full_name"].startswith(original["full_name"])
        suffix = child["full_name"][len(original["full_name"]) :]
        child["full_name"] = new["full_name"] + suffix
        # The source lines for this placeholder do not exist in this file.
        # The keys might not exist if original is a resolved placeholder.
        child.pop("from_line_no", None)
        child.pop("to_line_no", None)
        # Resolve the remaining children
        stack.extend(child.get("children", ()))

    placeholder.clear()
    placeholder.update(new)
461329
def _placeholders_recursif(nodelist, plist, blist):
    """"""
    # I needed to do this lazy import to compile the documentation
    from django.template.loader_tags import BlockNode

    if len(blist):
        block = blist[-1]
    else:
        block = None

    for node in nodelist:

        if isinstance(node, BlockNode):
            if node not in blist:
                blist.append(node)
            if not block:
                block = node

        if block:
            if isinstance(node, template.base.VariableNode):
                if(node.filter_expression.var.var == u'block.super'):
                    block.has_super_var = True

        # extends node?
        if hasattr(node, 'parent_name'):
            # I do not know why I did this... but the tests are guarding it
            dummy_context2 = Context()
            dummy_context2.template = template.Template("")
            _placeholders_recursif(node.get_parent(dummy_context2).nodelist,
                                   plist, blist)
        # include node?
        elif hasattr(node, 'template') and hasattr(node.template, 'nodelist'):
            _placeholders_recursif(node.template.nodelist, plist, blist)

        # Is it a placeholder?
        if hasattr(node, 'page') and hasattr(node, 'parsed') and \
                hasattr(node, 'as_varname') and hasattr(node, 'name') \
                and hasattr(node, 'section'):
            if block:
                node.found_in_block = block
            plist.append(node)
            node.render(dummy_context)

        for key in ('nodelist', 'nodelist_true', 'nodelist_false'):

            if hasattr(node, key):
                try:
                    _placeholders_recursif(getattr(node, key), plist, blist)
                except:
                    pass
431015
function _getFileContents(values) {
  const env = getDefaultSlateEnv();

  for (const key in values) {
    if (values.hasOwnProperty(key) && env.hasOwnProperty(key)) {
      env[key] = values[key];
    }
  }

  return Object.entries(env)
    .map((keyValues) => {
      return `${keyValues.join('=')}\r\n`;
    })
    .join('\r\n\r\n');
}
848228
private static function getPlaceholders(string $content): array
    {
        $result = [];
        $matchCount = preg_match_all(static::getPlaceholderPattern(), $content, $result);

        if (false !== $matchCount && 0 < $matchCount) {
            foreach ($result as $index => $placeholders) {
                $result[$index] = array_unique($placeholders);
            }
        }

        return $result;
    }
1319113
def _populate_list(self, value):
        
        # Nothing to do if the value is rubbish.
        if value is None:
            return

        # Stop any recursion - no more returns from here to end of fn please!
        if self._in_update:
            return
        self._in_update = True

        # We need to update the tree view.
        self._root = os.path.abspath(value if os.path.isdir(value) else os.path.dirname(value))

        # The absolute expansion of "/" or "\" is the root of the disk, so is a cross-platform
        # way of spotting when to insert ".." or not.
        tree_view = []
        if len(self._root) > len(os.path.abspath(os.sep)):
            tree_view.append((["|-+ .."], os.path.abspath(os.path.join(self._root, ".."))))

        tree_dirs = []
        tree_files = []
        try:
            files = os.listdir(self._root)
        except OSError:
            # Can fail on Windows due to access permissions
            files = []
        for my_file in files:
            full_path = os.path.join(self._root, my_file)
            try:
                details = os.lstat(full_path)
            except OSError:
                # Can happen on Windows due to access permissions
                details = namedtuple("stat_type", "st_size st_mtime")
                details.st_size = 0
                details.st_mtime = 0
            name = "|-- {}".format(my_file)
            tree = tree_files
            if os.path.isdir(full_path):
                tree = tree_dirs
                if os.path.islink(full_path):
                    # Show links separately for directories
                    real_path = os.path.realpath(full_path)
                    name = "|-+ {} -> {}".format(my_file, real_path)
                else:
                    name = "|-+ {}".format(my_file)
            elif self._file_filter and not self._file_filter.match(my_file):
                # Skip files that don't match the filter (if present)
                continue
            elif os.path.islink(full_path):
                # Check if link target exists and if it does, show statistics of the
                # linked file, otherwise just display the link
                try:
                    real_path = os.path.realpath(full_path)
                except OSError:
                    # Can fail on Linux prof file system.
                    real_path = None
                if real_path and os.path.exists(real_path):
                    details = os.stat(real_path)
                    name = "|-- {} -> {}".format(my_file, real_path)
                else:
                    # Both broken directory and file links fall to this case.
                    # Actually using the files will cause a FileNotFound exception
                    name = "|-- {} -> {}".format(my_file, real_path)

            # Normalize names for MacOS and then add to the list.
            tree.append(([unicodedata.normalize("NFC", name),
                          readable_mem(details.st_size),
                          readable_timestamp(details.st_mtime)], full_path))

        tree_view.extend(sorted(tree_dirs))
        tree_view.extend(sorted(tree_files))

        self.options = tree_view
        self._titles[0] = self._root

        # We're out of the function - unset recursion flag.
        self._in_update = False
692397
def placeholders(cls,dic):
        """"""
        keys = [str(x) for x in dic]
        entete = ",".join(keys)
        placeholders = ",".join(cls.named_style.format(x) for x in keys)
        entete = f"({entete})"
        placeholders = f"({placeholders})"
        return entete, placeholders
196892
function wrapPlaceholders(placeholders) {
  const keys = Object.keys(placeholders);
  const wrappedPlaceholders = {};

  for (let i = 0; i < keys.length; i++) {
    wrappedPlaceholders['<'+keys[i]+'>'] = placeholders[keys[i]];
  }

  return wrappedPlaceholders;
}
916170
function getFileNames(fileNames = [], componentName) {
  const defaultFileNames = {
    testFileName: `${defaultOptions.testFileName}.${componentName}`,
    componentFileName: componentName,
    styleFileName: componentName,
  }

  const formattedFileNames = Object.keys(fileNames).reduce(
    (acc, curr) => {
      acc[curr] = replaceKeys(fileNames[curr], componentName)
      return acc
    },
    { ...defaultFileNames }
  )

  return formattedFileNames
}
846451
def path_placeholders(self):
        

        parser = string.Formatter()
        return [placeholder_name for _, placeholder_name, _, _ in parser.parse(self.path) if placeholder_name]
47141
def populate
      # Display progressbar with the number of files as countdown
      progressbar = init_progressbar(current_files.count)

      # Extract the blame history from all checked in files
      current_files.each do |file|
        progressbar.increment

        # Skip this file if non wanted type
        next unless check_file?(file)

        # -w ignore whitespaces (defined in @wopt)
        # -M detect moved or copied lines.
        # -p procelain mode (parsed by BlameParser)
        execute("git #{git_directory_params} blame #{encoding_opt} -p -M #{default_params} #{commit_range.to_s} #{@wopt} -- '#{file}'") do |result|
          BlameParser.new(result.to_s).parse.each do |row|
            next if row[:boundary]

            email = get(row, :author, :mail)
            name = get(row, :author, :name)

            # Create or find user
            author = author_by_email(email, name)

            # Get author by name and increase the number of loc by 1
            author.inc(:loc, get(row, :num_lines))

            # Store the files and authors together
            associate_file_with_author(author, file)
          end
        end
      end

      # Get repository summery and update each author accordingly
      execute("git #{git_directory_params} shortlog #{encoding_opt} #{default_params} -se #{commit_range.to_s}") do |result|
        result.to_s.split("\n").map do |line|
          _, commits, name, email = line.match(/(\d+)\s+(.+)\s+<(.+?)>/).to_a
          author = author_by_email(email)

          author.name = name

          author.update({
            raw_commits: commits.to_i,
            raw_files: files_from_author(author).count,
            files_list: files_from_author(author)
          })
        end
      end

      progressbar.finish
    end
419759
function extractPlaceholders(messageBundle) {
	      var messageMap = messageBundle.getMessageMap();
	      var placeholders = {};
	      Object.keys(messageMap).forEach(function (msgId) {
	          placeholders[msgId] = messageMap[msgId].placeholders;
	      });
	      return placeholders;
	  }
941046
def _create_placeholders(self, n_features, n_classes):
        
        self.input_data = tf.placeholder(
            tf.float32, [None, n_features], name='x-input')
        self.input_labels = tf.placeholder(
            tf.float32, [None, n_classes], name='y-input')
        self.keep_prob = tf.placeholder(
            tf.float32, name='keep-probs')
374351
def complete_filename(text):
    ''''''

    #ensure directories have trailing slashes:
    list = glob.glob(text+'*')
    for idx, val in enumerate(list):
        if os.path.isdir(val):
            list[idx] = (val + os.path.sep)

    return list
827000
def _placeholders_recursif(nodelist, plist, blist):
    """"""
    # I needed to do this lazy import to compile the documentation
    from django.template.loader_tags import BlockNode

    for node in nodelist:

        # extends node?
        if hasattr(node, 'parent_name'):
            _placeholders_recursif(node.get_parent(dummy_context).nodelist,
                                                        plist, blist)
        # include node?
        elif hasattr(node, 'template') and hasattr(node.template, 'nodelist'):
            _placeholders_recursif(node.template.nodelist, plist, blist)

        # Is it a placeholder?
        if hasattr(node, 'page') and hasattr(node, 'parsed') and \
                hasattr(node, 'as_varname') and hasattr(node, 'name'):
            already_in_plist = False
            for placeholder in plist:
                if placeholder.name == node.name:
                    already_in_plist = True
            if not already_in_plist:
                if len(blist):
                    node.found_in_block = blist[len(blist) - 1]
                plist.append(node)
            node.render(Context())

        for key in ('nodelist', 'nodelist_true', 'nodelist_false'):
            if isinstance(node, BlockNode):
                # delete placeholders found in a block of the same name
                offset = 0
                _plist = [(i, v) for i, v in enumerate(plist)]
                for index, pl in _plist:
                    if pl.found_in_block and \
                            pl.found_in_block.name == node.name \
                            and pl.found_in_block != node:
                        del plist[index - offset]
                        offset += 1
                blist.append(node)

            if hasattr(node, key):
                try:
                    _placeholders_recursif(getattr(node, key), plist, blist)
                except:
                    pass
            if isinstance(node, BlockNode):
                blist.pop()
408150
def glob(self, filename):
        """"""
        if isinstance(filename, six.string_types):
            return [
                # Convert the filenames to string from bytes.
                compat.as_str_any(matching_filename)
                for matching_filename in py_glob.glob(
                    compat.as_bytes(filename))
            ]
        else:
            return [
                # Convert the filenames to string from bytes.
                compat.as_str_any(matching_filename)
                for single_filename in filename
                for matching_filename in py_glob.glob(
                    compat.as_bytes(single_filename))
            ]
176363
def _create_placeholders(self):
        """"""
        self.input_data = tf.placeholder(
            tf.int32, [self.batch_size, self.num_steps])
        self.input_labels = tf.placeholder(
            tf.int32, [self.batch_size, self.num_steps])