Fix issues with Jochem names.
178917
def _process_name(name):
    """"""

    # Unescape HTML entities
    name = unescape(name)

    # Remove bracketed stuff on the end
    name = NG_RE.sub('', name).strip()  # Nomenclature groups
    name = END_RE.sub('', name).strip(', ')  # Words
    name = RATIO_RE.sub('', name).strip(', ')  # Ratios

    # Remove stuff off start
    name = START_RE.sub('', name).strip()

    # Remove balanced start and end brackets if none in between
    name = BRACKET_RE.sub('\g<1>', name)

    # Un-invert CAS style names
    comps = name.split(', ')
    if len(comps) == 2:
        if comps[1].endswith('-'):
            name = comps[0]
            name = '%s%s' % (comps[1], name)
    elif len(comps) > 2:
        name = comps[0]
        for i in range(1, len(comps)):
            if comps[i].endswith('-'):
                name = '%s%s' % (comps[i], name)
            else:
                name = '%s %s' % (name, comps[i])
    return name
1205114
public String fixPropertyName(String name) {
    if ("float".equalsIgnoreCase(name)) {
      return "cssFloat";
    } else if ("for".equalsIgnoreCase(name)) {
      return "htmlFor";
    }
    return JsUtils.camelize(name);
  }
1161861
def resolveFilenameConflicts(self, dialog=True):
        """"""
        resolved = self.wdplv.resolveFilenameConflicts()
        if resolved and dialog:
            QMessageBox.warning(self, "Filename conflicts", """<P>
        <NOBR>PURR has found duplicate destination filenames among your data products.</NOBR>
        This is not allowed, so some filenames have been adjusted to avoid name clashes.
        Please review the changes before saving this entry.
        </P>""",
                                QMessageBox.Ok, 0)
        return resolved
1139544
def avoid_name_collisions(filehandle, meta):
    
    if meta.get('avoid_name_collision', True):
        filename = filehandle.filename
        original, ext = os.path.splitext(filehandle.filename)
        counter = count()
        while os.path.exists(get_save_path(filename)):
            fixer = str(next(counter))
            filename = '{}_{}{}'.format(original, fixer, ext)
        filehandle.filename = filename
    return filehandle
1086749
def fix_e271(self, result):
        """"""
        line_index = result['line'] - 1
        target = self.source[line_index]
        offset = result['column'] - 1

        fixed = fix_whitespace(target,
                               offset=offset,
                               replacement=' ')

        if fixed == target:
            return []
        else:
            self.source[line_index] = fixed
26502
protected function updateFilenames(): void
    {
        $this->files->setFlags(\FilesystemIterator::KEY_AS_FILENAME
            | \FilesystemIterator::CURRENT_AS_FILEINFO
            | \FilesystemIterator::SKIP_DOTS);
        $this->filenames = array_keys(iterator_to_array($this->files));
    }
26121
function fixPrjConf(projects) {
	var p, conf;
	for (p in projects) {
		conf = projects[p];
		conf.path && conf.path.slice(-1)!=='/' && (conf.path += '/');
		conf.build_path && conf.build_path.slice(-1)!=='/' && (conf.build_path += '/');
		conf.charset || (conf.charset = 'utf8');
	}
}
773397
def rename(idf, objkey, objname, newname):
    """"""
    refnames = getrefnames(idf, objkey)
    for refname in refnames:
        objlists = getallobjlists(idf, refname)
        # [('OBJKEY', refname, fieldindexlist), ...]
        for refname in refnames:
        # TODO : there seems to be a duplication in this loop. Check.
        # refname appears in both loops
            for robjkey, refname, fieldindexlist in objlists:
                idfobjects = idf.idfobjects[robjkey]
                for idfobject in idfobjects:
                    for findex in fieldindexlist:  # for each field
                        if idfobject[idfobject.objls[findex]] == objname:
                            idfobject[idfobject.objls[findex]] = newname
    theobject = idf.getobject(objkey, objname)
    fieldname = [item for item in theobject.objls if item.endswith('Name')][0]
    theobject[fieldname] = newname
    return theobject
378288
def _update_names(self):
        """"""

        d = dict(
            table=self.table_name,
            time=self.time,
            space=self.space,
            grain=self.grain,
            variant=self.variant,
            segment=self.segment
        )

        assert self.dataset

        name = PartialPartitionName(**d).promote(self.dataset.identity.name)

        self.name = str(name.name)
        self.vname = str(name.vname)
        self.cache_key = name.cache_key
        self.fqname = str(self.identity.fqname)
408954
def fix_multi_T1w_source_name(in_files):
    
    import os
    from nipype.utils.filemanip import filename_to_list
    base, in_file = os.path.split(filename_to_list(in_files)[0])
    subject_label = in_file.split("_", 1)[0].split("-")[1]
    return os.path.join(base, "sub-%s_T1w.nii.gz" % subject_label)
1307511
def fix(args):
    
    p = OptionParser(fix.__doc__)
    p.add_option("--ignore_sym_pat", default=False, action="store_true",
        help="Do not fix names matching symbol patterns i.e." + \
        " names beginning or ending with gene symbols or a series of numbers." + \
        " e.g. `ARM repeat superfamily protein`, `beta-hexosaminidase 3`," + \
        " `CYCLIN A3;4`, `WALL ASSOCIATED KINASE (WAK)-LIKE 10`")
    p.set_outfile()
    opts, args = p.parse_args(args)

    if len(args) < 1:
        sys.exit(not p.print_help())

    csvfile, = args
    fp = open(csvfile)
    fw = must_open(opts.outfile, "w")
    for row in fp:
        if row[0] == '#':
            continue
        if row.strip() == "":
            continue
        atoms = row.rstrip("\r\n").split("\t")
        name, hit, ahrd_code, desc = atoms[:4] \
                if len(atoms) > 2 else \
                (atoms[0], None, None, atoms[-1])

        newdesc = fix_text(desc, ignore_sym_pat=opts.ignore_sym_pat)
        if hit and hit.strip() != "" and newdesc == Hypothetical:
            newdesc = "conserved " + newdesc
        print("\t".join(atoms[:4] + [newdesc] + atoms[4:]), file=fw)
520633
@Override
  public String fixPropertyName(String name) {
    name = super.fixPropertyName(name);
    if ("cssFloat".equals(name)) {
      return "styleFloat";
    } else if ("class".equals(name)) {
      return "className";
    }
    return name;
  }
662953
void fixRepeatedly(String filename, ImmutableSet<DiagnosticType> unfixableErrors)
      throws IOException {
    for (int i = 0; i < MAX_FIXES; i++) {
      if (!fix(filename, unfixableErrors)) {
        break;
      }
    }
  }
238493
def fix_parameters(self):
        """"""
        for W, b in zip(self.W_list, self.b_list):
            W.fix()
            b.fix()
232065
def _stable_names(self):
        '''
        

        '''
        stable_names=[]
        for i in range(len(self.stable_el)):
            stable_names.append(self.stable_el[i][0])
        self.stable_names=stable_names
809209
def fix_plugin_name(name)
      name = name.to_s.downcase
      fixes = {
        /[\- ]/ => '_', # dashes and spaces become underscores
        /[^a-z0-9_]/ => '', # anything other than lower case letters, numbers and underscores is removed
        /fastlane[_]?/ => '', # 'fastlane' or 'fastlane_' is removed
        /plugin[_]?/ => '' # 'plugin' or 'plugin_' is removed
      }
      fixes.each do |regex, replacement|
        name = name.gsub(regex, replacement)
      end
      name
    end
784140
def fix_config(self, options):
        
        options = super(RenameRelation, self).fix_config(options)

        opt = "name"
        if opt not in options:
            options[opt] = "newname"
        if opt not in self.help:
            self.help[opt] = "The new relation name to use (string)."

        return options