Checks replace string values for :project_name and replaces these with the value of @project_name if found. This enables PROJECT_NAME entries in projects to be dynamically populated with the current project name.
519271
def check_replace_string_pairs_for_project_name_sub(hash)
      unless @project_name.nil?
        hash.each do |key, value|
          if key == :project_name
            hash[key] = @project_name
          end
        end
      end
      hash
    end
943000
def fixchars(self):
        """"""
        for key in Config.CHARFIXES:
            self.project.set_search_string(key)
            self.project.set_search_replacement(Config.CHARFIXES[key])
            self.project.replace_all()
1021172
def _replace_placeholder(self, string, custom_id):
        
        if string is None:
            return None
        self.log([u"Replacing '%s' with '%s' in '%s'", gc.PPV_OS_TASK_PREFIX, custom_id, string])
        return string.replace(gc.PPV_OS_TASK_PREFIX, custom_id)
1323788
def _update_strl_names(self):
        """"""
        # Update convert_strl if names changed
        for orig, new in self._converted_names.items():
            if orig in self._convert_strl:
                idx = self._convert_strl.index(orig)
                self._convert_strl[idx] = new
473753
private void replaceStringWithAliasName(StringOccurrence occurrence,
                                          String name,
                                          StringInfo info) {
    Node nameNode = IR.name(name);
    occurrence.parent.replaceChild(occurrence.node,
                                   nameNode);
    info.isAliased = true;
    compiler.reportChangeToEnclosingScope(nameNode);
  }
1228013
public static String replace(String string, String strOldParam, String strNewData)
    {
        if (string == null)
            return null;
        StringBuilder sb = new StringBuilder(string);
        return Utility.replace(sb, strOldParam, strNewData).toString();
    }
452797
def replace_string_node(target, value)
      quote = target.loc.begin.source
      rewriter.replace(target.loc.expression, "#{quote}#{value}#{quote}")
    end
807574
private String stringReplace(String text, String target, String replacement) {
		return Pattern.compile(target.toString(), Pattern.LITERAL).matcher(
				text).replaceAll(replacement);
	}
479885
void updateReplace() {

        boolean replace = m_replace.getValue().booleanValue();

        m_replaceResource.setVisible(replace ? SearchType.resourcetype.equals(m_searchType.getValue()) : replace);
        m_replacePattern.setVisible(
            replace
            ? !SearchType.resourcetype.equals(m_searchType.getValue())
                & !SearchType.renameContainer.equals(m_searchType.getValue())
            : replace);

        m_newName.setVisible(replace ? SearchType.renameContainer.equals(m_searchType.getValue()) : replace);
        m_oldName.setVisible(replace ? SearchType.renameContainer.equals(m_searchType.getValue()) : replace);

        m_workProject.setVisible(replace);

        m_search.setCaption(
            replace
            ? CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_REPLACE_0)
            : CmsVaadinUtils.getMessageText(Messages.GUI_SOURCESEARCH_SEARCH_0));

    }
702177
def contains_project_name(name, link):
    
    def unclutter(string):
        # strip out all python references and remove all excessive characters
        string = string.lower().replace("_", "-").replace(".", "-")
        for replace in ["python-", "py-", "-py", "-python"]:
            string = string.replace(replace, "")
        return re.sub("[^0123456789 a-zA-Z]", "", string).strip()
    return unclutter(name) in unclutter(link)
730765
public void updateTitle() {
        Project project = getProject();
        String name = project.getProjectName();
        if ((name == null || "".equals(name.trim())) && saveFile != null) {
            name = saveFile.getAbsolutePath();
        }
        if (name == null) {
            name = "";//Project.UNNAMED_PROJECT;
        }
        String oldTitle = this.getTitle();
        String newTitle = TITLE_START_TXT + ("".equals(name.trim()) ? "" : " - " + name);
        if (oldTitle.equals(newTitle)) {
            return;
        }
        this.setTitle(newTitle);
    }
1374757
private String stringReplace(final String source, final String find, final String replace) {
    if (source == null || find == null || replace == null)
      return source;
    final int index = source.indexOf(find);
    if (index == -1)
      return source; // no occurence, don't do anything;
    if (index == 0)
      return replace + source.substring(find.length());
    return source.substring(0, index) + replace + source.substring(index + find.length());
  }
1086628
def get_project(self, project):
        
        project = format_string(project)

        return self.get(
            '/projects/{project}'.format(project=project))
544235
def vary_name(name: Text):
    

    snake = re.match(r'^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$', name)

    if not snake:
        fail('The project name is not a valid snake-case Python variable name')

    camel = [x[0].upper() + x[1:] for x in name.split('_')]

    return {
        'project_name_snake': name,
        'project_name_camel': ''.join(camel),
        'project_name_readable': ' '.join(camel),
    }
514171
function replaceVars(value, vars) {
        if (typeof value != "string") {
          value = value(vars);
        } else if (vars) {
          value = value.replace(/%(\w+)/g, function (str, name) {
            return vars[name] || str;
          });
        }

        return value;
      }
110063
static void replaceHeredocStrings(ASTTemplate tnode,
            List<StringProperty> strings) {

        // Only something to do if there were heredoc strings defined.
        if (strings.size() > 0) {
            processHeredocStrings(tnode, strings);
        }
    }
582514
def update_config(updated_project):
    '''
    

    '''

    home = os.path.expanduser('~')
    if os.path.isfile(os.path.join(home, '.transfer', 'config.yaml')):
        with open(os.path.join(home, '.transfer', 'config.yaml'), 'r') as fp:
            projects = yaml.load(fp.read())
        replace_index = -1
        for i, project in enumerate(projects):
            if project['name'] == updated_project['name']:
                replace_index = i

        if replace_index > -1:
            projects[replace_index] = updated_project
            store_config(projects)
        else:
            print('Not saving configuration')
            print(colored('Project: ' + updated_project['name'] + ' was not found in configured projects!', 'red'))

    else:
        print('Transfer is not configured.')
        print('Please run:')
        print('')
        print(colored('    transfer --configure', 'cyan'))
        return