Return the name of the map in the good format
15461
def _format_name_map(self, lonc, latc):
        '''  '''

        return '_'.join(['WAC', 'GLOBAL'] +
                        ['E' + latc + lonc, "{0:0>3}".format(self.ppd) + 'P'])
724952
def name(self):
        
        names = self.names.split()
        if len(names) == 1:
            return names[0]
        elif len(names) == 2:
            return ' '.join(names)
        else:
            return ' '.join([names[0], '...', names[-1]])
347225
private Extractors getExtractorsForMapName(String mapNameOrNull) {
        if (mapNameOrNull == null) {
            return Extractors.newBuilder(serializationService)
                    .build();
        }
        return mapServiceContext.getExtractors(mapNameOrNull);
    }
800525
def get_label_map(opts):
    '''  '''
    results = {}
    try:
        for entry in os.scandir(diskdir):
            target = normpath(join(diskdir, os.readlink(entry.path)))
            decoded_name = entry.name.encode('utf8').decode('unicode_escape')
            results[target] = decoded_name
        if opts.debug:
            print('\n\nlabel_map:', results)
    except FileNotFoundError:
        pass
    return results
1211062
def standardizeMapName(mapName):
    """"""
    #print("foreignName: %s  (%s)"%(mapName, mapName in c.mapNameTranslations))
    #if mapName in c.mapNameTranslations:
    #    return c.mapNameTranslations[mapName]
    newName = os.path.basename(mapName)
    newName = newName.split(".")[0]
    newName = newName.split("(")[0]
    newName = re.sub("[LT]E+$", "", newName)
    newName = re.sub("-", "", newName)
    newName = re.sub(' ', '', newName, flags=re.UNICODE)
    foreignName = newName#bytes(mapName, 'utf-16')
    #print("foreignName: %s  (%s)"%(foreignName, foreignName in c.mapNameTranslations))
    if foreignName in c.mapNameTranslations:
        return c.mapNameTranslations[foreignName]
    return newName
247436
def _format_key_name(self) -> str:
        """"""
        key_name = 'ld:{0}:{1}:features'.format(
            self.project_key,
            self.environment_key
        )
        return key_name
675993
def _get_proj4_name(self, projection):
        """"""
        gmap_name = projection.attrs['grid_mapping_name']
        proj = {
            'geostationary': 'geos',
            'lambert_conformal_conic': 'lcc',
            'polar_stereographic': 'stere',
            'mercator': 'merc',
        }.get(gmap_name, gmap_name)
        return proj
22422
Map<String, String> packageNameMap() {
        if (packageNames == null) {
            return emptyMap();
        }

        Map<String, String> names = new LinkedHashMap<String, String>();
        for (PackageName name : packageNames) {
            names.put(name.getUri(), name.getPackage());
        }
        return names;
    }
1225984
def get_label_map(opts):
    '''  '''
    result = {}
    try:  # get labels from filesystem
        for entry in os.scandir(diskdir):
            if entry.name.startswith('.'):
                continue
            if islink(entry.path):
                target = os.readlink(entry.path)
            else:
                target = entry.path
            result[target] = entry.name
        if opts.debug:
            print('\n\nlabel_map:', result)
    except FileNotFoundError:
        pass

    return result
795318
function buildMap( map, part ){

    var name =          makeName( part.fileName );

    if ( map[name] ){
        map[name].parts.push( part );
    } else {
        map[name] = {
            name:       name,
            parts:      [ part ],
        };
    }

    return map;
}
395283
def list_names(cls):
        """"""
        response = subwrap.run(['lxc-ls'])
        output = response.std_out
        return map(str.strip, output.splitlines())
804847
private String _serializeMap(String name, Map map, StringBuilder sb, Set<Object> done) throws ConverterException {

	if (useShortcuts) sb.append("{}");
	else sb.append("new Object();");
	Iterator it = map.keySet().iterator();
	while (it.hasNext()) {
	    Object key = it.next();
	    String skey = StringUtil.toLowerCase(StringUtil.escapeJS(key.toString(), '"'));
	    sb.append(name + "[" + skey + "]=");
	    _serialize(name + "[" + skey + "]", map.get(key), sb, done);
	    // sb.append(";");
	}
	return sb.toString();
    }
238063
public static String getMapContents(Map m) {
        StringBuffer sb = new StringBuffer(1000);
        Object[] sortedArray = m.keySet().toArray();
        Arrays.sort(sortedArray);

        for (Object element : sortedArray) {
            sb.append(element.toString() + " - " + m.get(element) + System.getProperty("line.separator"));
        }
        return sb.toString();
    }
925737
protected synchronized String getWthFileName(Map data) {

//        String agmipFileHack = getValueOr(wthFile, "wst_name", "");
//        if (agmipFileHack.length() == 8) {
//            return agmipFileHack;
//        }
        String ret = getObjectOr(data, "wst_id", "");
        if (ret.equals("") || ret.length() > 8) {
            ret = wthHelper.createWthFileName(getObjectOr(data, "weather", data));
            if (ret.equals("")) {
                ret = "AGMP";
            }
        }

        return ret;
    }
659358
function getMapOption(from) {
        if (typeof options.map === 'string') {
            var mapPath = options.map + path.basename(from) + '.map';

            if (grunt.file.exists(mapPath)) {
                return grunt.file.read(mapPath);
            }
        }

        return options.map;
    }
807942
protected String getExName(Map result) {

        String ret = getValueOr(result, "exname", "");
        if (ret.matches("\\w+\\.\\w{2}[Xx]")) {
            ret = ret.substring(0, ret.length() - 1).replace(".", "");
        }
        // TODO need to be updated with a translate rule for other models' exname
        if (ret.matches(".+(_+\\d+)+$")) {
            ret = ret.replaceAll("(_+\\d+)+$", "");
        }

        return ret;
    }
909702
def get_symbol_map(self):
        
        # todo: make sure we return a list of strings!
        sm = _libxdo.xdo_get_symbol_map()

        # Return value is like:
        # ['alt', 'Alt_L', ..., None, None, None, ...]
        # We want to return only values up to the first None.
        # todo: any better solution than this?
        i = 0
        ret = []
        while True:
            c = sm[i]
            if c is None:
                return ret
            ret.append(c)
            i += 1