This function will take the given name and split it into components
        weight, width, customName, and possibly the full name.
        This is what Glyphs 1113 seems to be doing, approximately.
163621
def name(self, name):
        
        weight, width, custom_name = self._splitName(name)
        self.set_all_name_components(name, weight, width, custom_name)
1277022
function(name) {
		var i, lookup;

		// Replace diacritics
		lookup = [
			/[\300-\306]/g, 'A', /[\340-\346]/g, 'a',
			/\307/g, 'C', /\347/g, 'c',
			/[\310-\313]/g, 'E', /[\350-\353]/g, 'e',
			/[\314-\317]/g, 'I', /[\354-\357]/g, 'i',
			/\321/g, 'N', /\361/g, 'n',
			/[\322-\330]/g, 'O', /[\362-\370]/g, 'o',
			/[\331-\334]/g, 'U', /[\371-\374]/g, 'u'
		];

		for (i = 0; i < lookup.length; i += 2) {
			name = name.replace(lookup[i], lookup[i + 1]);
		}

		// Replace whitespace
		name = name.replace(/\s+/g, '_');

		// Remove anything else
		name = name.replace(/[^a-z0-9_\-\.]+/gi, '');

		return name;
	}
301849
def simple_tokenize(name):
    """"""
    last_names, first_names = name.split(',')
    last_names = _RE_NAME_TOKEN_SEPARATOR.split(last_names)
    first_names = _RE_NAME_TOKEN_SEPARATOR.split(first_names)

    first_names = [NameToken(n) if len(n) > 1 else NameInitial(n)
                   for n in first_names if n]
    last_names = [NameToken(n) if len(n) > 1 else NameInitial(n)
                  for n in last_names if n]
    return {'lastnames': last_names,
            'nonlastnames': first_names}
1199934
def com_google_fonts_check_glyphnames_max_length(ttFont):
  """"""
  if ttFont.sfntVersion == b'\x00\x01\x00\x00' and ttFont.get(
      "post") and ttFont["post"].formatType == 3.0:
    yield PASS, ("TrueType fonts with a format 3.0 post table contain no "
                 "glyph names.")
  else:
    failed = False
    for name in ttFont.getGlyphOrder():
      if len(name) > 109:
        failed = True
        yield FAIL, ("Glyph name is too long:" " '{}'").format(name)
    if not failed:
      yield PASS, "No glyph names exceed max allowed length."
867765
private static void formatNames(Iterable<List<String>> names) {
    if (names != null) {
      for (List<String> list : names) {
        String name = list.get(0);
        String[] components = new String[5];
        int start = 0;
        int end;
        int componentIndex = 0;
        while (componentIndex < components.length - 1 && (end = name.indexOf(';', start)) >= 0) {
          components[componentIndex] = name.substring(start, end);
          componentIndex++;
          start = end + 1;
        }
        components[componentIndex] = name.substring(start);
        StringBuilder newName = new StringBuilder(100);
        maybeAppendComponent(components, 3, newName);
        maybeAppendComponent(components, 1, newName);
        maybeAppendComponent(components, 2, newName);
        maybeAppendComponent(components, 0, newName);
        maybeAppendComponent(components, 4, newName);
        list.set(0, newName.toString().trim());
      }
    }
  }
1359031
def join_name(parts,
                  separator: ObjectInspector.configuration.name_separator)
      the_parts = Array(parts).tap(&:compact!)
      the_parts.join(separator) if the_parts.any?
    end
821645
function (name, separator) {
                var sep = separator || (name.indexOf(".") !== -1 ? "." : "/"),
                    fullName = this.fullSchemaName(name, sep);
                return fullName.substring(fullName.lastIndexOf(sep) + 1);
            }
954435
function nameuniquize(stringDirty) {
	var allowedChars  = [
		"a",
		"b",
		"c",
		"d",
		"e",
		"f",
		"g",
		"h",
		"i",
		"j",
		"k",
		"l",
		"m",
		"n",
		"o",
		"p",
		"q",
		"r",
		"s",
		"t",
		"u",
		"v",
		"w",
		"x",
		"y",
		"z",
		"0",
		"1",
		"2",
		"3",
		"4",
		"5",
		"6",
		"7",
		"8",
		"9",
		"_",
		"-"
	];
	var nameuniquizedString = '';
	for(var i=0; i<stringDirty.length; i++) {
		var dirtyChar = stringDirty.charAt(i).toLowerCase();
		if (dirtyChar == ' ') dirtyChar = '_';
		if ( in_array(allowedChars,dirtyChar) ) {
			nameuniquizedString += dirtyChar;
		}
	}
	return nameuniquizedString;
}
1358322
def canonicalize_name(name)
      if name == nil or name == SEP
        return name
      elsif name[0] == SEP[0]
        return name.split(/\/+/).join(SEP)
      else
        return SEP + name.split(/\/+/).join(SEP)
      end
    end
314865
def split_qname(qname):
        """"""
        res = qname.split(YinParser.ns_sep)
        if len(res) == 1:       # no namespace
            return None, res[0]
        else:
            return res
29990
function parseGlyfTable(data, start, loca) {
    var glyphs, i, j, offset, nextOffset, glyph,
        component, componentGlyph, transformedPoints;
    glyphs = [];
    // The last element of the loca table is invalid.
    for (i = 0; i < loca.length - 1; i += 1) {
        offset = loca[i];
        nextOffset = loca[i + 1];
//        console.log('pg: ', offset, nextOffset);
        if (offset !== nextOffset) {
            glyphs.push(parseGlyph(data,  i, start + offset));
        } else {
            glyphs.push(new Glyph(i));
        }
    }
//    console.log(start);
    // Go over the glyphs again, resolving the composite glyphs.
    for (i = 0; i < glyphs.length; i += 1) {
        glyph = glyphs[i];
        if (glyph.isComposite) {
            for (j = 0; j < glyph.components.length; j += 1) {
                component = glyph.components[j];
                componentGlyph = glyphs[component.glyphIndex];
                if (componentGlyph.points) {
                    transformedPoints = transformPoints(componentGlyph.points, component);
                    glyph.points = glyph.points.concat(transformedPoints);
                }
            }
        }
        glyph.path = getPath(glyph.points);
    }
    return glyphs;
}
107080
def com_google_fonts_check_whitespace_glyphnames(ttFont):
  """"""
  from fontbakery.utils import get_glyph_name

  def getGlyphEncodings(font, names):
    result = set()
    for subtable in font['cmap'].tables:
      if subtable.isUnicode():
        for codepoint, name in subtable.cmap.items():
          if name in names:
            result.add(codepoint)
    return result

  if ttFont['post'].formatType == 3.0:
    yield SKIP, "Font has version 3 post table."
  else:
    failed = False
    space_enc = getGlyphEncodings(ttFont, ["uni0020", "space"])
    nbsp_enc = getGlyphEncodings(
        ttFont, ["uni00A0", "nonbreakingspace", "nbspace", "nbsp"])
    space = get_glyph_name(ttFont, 0x0020)
    if 0x0020 not in space_enc:
      failed = True
      yield FAIL, Message("bad20", ("Glyph 0x0020 is called \"{}\":"
                                    " Change to \"space\""
                                    " or \"uni0020\"").format(space))

    nbsp = get_glyph_name(ttFont, 0x00A0)
    if 0x00A0 not in nbsp_enc:
      if 0x00A0 in space_enc:
        # This is OK.
        # Some fonts use the same glyph for both space and nbsp.
        pass
      else:
        failed = True
        yield FAIL, Message("badA0", ("Glyph 0x00A0 is called \"{}\":"
                                      " Change to \"nbsp\""
                                      " or \"uni00A0\"").format(nbsp))

    if failed is False:
      yield PASS, "Font has **proper** whitespace glyph names."
293365
function nameToAst(name) {
        name =
          (!wrapInFunction &&
            aliasByGlobalName.hasOwnProperty(name) &&
            aliasByGlobalName[name]) ||
          name;
        const nameFragments = name.split('.');
        if (nameFragments.length > 1) {
          return {
            type: 'MemberExpression',
            computed: false,
            object:
              nameToAst(
                nameFragments.slice(0, nameFragments.length - 1).join('.')
              ) || 'wat1',
            property: {
              type: 'Identifier',
              name: nameFragments[nameFragments.length - 1]
            }
          };
        } else {
          return { type: 'Identifier', name: nameFragments[0] };
        }
      }
1220616
def get_definitive_name(self, unique_ajps, join_character = '-', prepend_label = True):
        
        name = ''
        for ajp in unique_ajps:
            if len(name) > 0:
                name += join_character
            if prepend_label:
                name += str(ajp) + '_'
            name += str(self.additional_join_parameters[ajp]['short_name'])
        if name == '':
            name = 'ddg-benchmark'
        return name
243197
function stringDotToObj(result, prop, name, value) {
        if (!result[prop]) {
            result[prop] = {};
        }
        name = name.substring((prop + '.').length, name.length);
        result[prop][name] = value;
    }
1322902
public String toGraphiteName() {
		StringBuilder sb = new StringBuilder(GraphiteSanitizer.sanitizeGraphiteMetricSegment(name));
		for (String value : tags.values()) {
			sb.append('.').append(GraphiteSanitizer.sanitizeGraphiteMetricSegment(value));
		}
		return sb.toString();
	}
114862
function elementaryName (name) {
  if (name.startsWith('int[')) {
    return 'int256' + name.slice(3)
  } else if (name === 'int') {
    return 'int256'
  } else if (name.startsWith('uint[')) {
    return 'uint256' + name.slice(4)
  } else if (name === 'uint') {
    return 'uint256'
  } else if (name.startsWith('fixed[')) {
    return 'fixed128x128' + name.slice(5)
  } else if (name === 'fixed') {
    return 'fixed128x128'
  } else if (name.startsWith('ufixed[')) {
    return 'ufixed128x128' + name.slice(6)
  } else if (name === 'ufixed') {
    return 'ufixed128x128'
  }
  return name
}