Return the map data for a map by name or path.
964624
def map_data(self, map_name):
    """"""
    with gfile.Open(os.path.join(self.data_dir, "Maps", map_name), "rb") as f:
      return f.read()
384832
def get_as_map(self, key):
        
        if key == None:
            map = {}
            for (k, v) in self.items():
                map[k] = v
            return map
        else:
            value = self.get(key)
            return MapConverter.to_map(value)
275376
public String getMap(String word){
		if(nameMap==null||!nameMap.containsKey(word))
			return word;
		else
			return nameMap.get(word);
	}
947201
def mapping_of(cls):
    """"""
    def mapper(data):
        if not isinstance(data, Mapping):
            raise TypeError(
                "data must be a mapping, not %s"
                % type(data).__name__)
        return {
            key: cls(value)
            for key, value in data.items()
        }
    return mapper
16937
def _get(self):
        """"""

        data, stat = self.zk.get(self.path)
        if not len(data):
            return {}, stat.version
        if self.OLD_SEPARATOR in data:
            return self._get_old()
        return json.loads(data), stat.version
437864
def getIndex(folderPath=None):
    """"""
    try:    return cache.structure
    except AttributeError: pass # if it doesn't exist, generate and cache the map file data
    if folderPath == None:
        from sc2maptool.startup import setup
        folderPath = setup()
    ############################################################################
    def folderSearch(path, attrList=[]):
        ret = []
        for item in glob(os.path.join(path, '*')):
            if item == os.sep: continue
            itemName = os.path.basename(item)
            if   os.path.isdir(item):               ret += folderSearch(item, attrList + [itemName])
            elif itemName.endswith(c.SC2_MAP_EXT):  ret.append( MapRecord(itemName, item, attrList) )
        return ret
    ############################################################################
    cache.structure = folderSearch(folderPath)
    return cache.structure
800415
static <T> T get(Map<String, Object> olm, String path, T def) {
        Object ret = def;
        try {
            String[] parts = tokenizePath(path);
            Object o = olm;
            for (int i = 0; i < parts.length; i++) {
                int[] j = getNumber(parts[i]);
                String name = getLocalName(parts[i]);
                o = ((Map) o).get(name);
                if (j != null) {
                    for (int k = 0; k < j.length; k++) {
                        o = ((List) o).get(j[k]);
                    }
                }
            }
            if (o != null)
                ret = o;
            else
                ret = def;
        } catch (Throwable e) {
        }
        return (T) ret;
    }
544394
def sprite_map_name(map):
    
    map = map.render()
    sprite_maps = _get_cache('sprite_maps')
    sprite_map = sprite_maps.get(map)
    if not sprite_map:
        log.error("No sprite map found: %s", map, extra={'stack': True})
    if sprite_map:
        return String.unquoted(sprite_map['*n*'])
    return String.unquoted('')
484680
def _get_result_paths(self, data):
        

        # Swarm OTU map (mandatory output)
        return {'OtuMap': ResultPath(Path=self.Parameters['-o'].Value,
                                     IsWritten=True)}
243279
def _sprite_map_name(map):
    
    map = StringValue(map).value
    sprite_map = sprite_maps.get(map)
    if not sprite_map:
        log.error("No sprite map found: %s", map)
    if sprite_map:
        return StringValue(sprite_map['*n*'])
    return StringValue(None)
469566
function find(map, name) {
	name = name.toLowerCase();
	for (const key in map) {
		if (key.toLowerCase() === name) {
			return key;
		}
	}
	return undefined;
}
1132538
def show(self, id):
        
        map = self._get_map_from_user_by_id(c.user, id)
        if map is None:
            abort(404)
        mapfile = Mapfile()
        mapfile.from_file(os.path.join(config['mapfiles_dir'], map.filepath))
        return {
            'map': mapfile.to_dict(),
            'wmsproxyurl': h.url_for(controller='mapfiles', action='wms_proxy', id=id),
            'wmsurl': "%s?%s" %(config['mapserver_url'], urlencode({'map':os.path.join(config['mapfiles_dir'], map.filepath)}))
        }
1146083
def data(self, run_config):
    """"""
    try:
      return run_config.map_data(self.path)
    except (IOError, OSError) as e:  # Catch both for python 2/3 compatibility.
      if self.download and hasattr(e, "filename"):
        logging.error("Error reading map '%s' from: %s", self.name, e.filename)
        logging.error("Download the map from: %s", self.download)
      raise
155330
public static <A, B> Optional<Map<A, B>> getMap(final Map map, final Object... path) {
        return get(map, Map.class, path).map(m -> (Map<A, B>) m);
    }
228364
def _map_in_out(self, inside_var_name):
        """"""
        for out_name, in_name in self.outside_name_map.items():
            if inside_var_name == in_name:
                return out_name
        return None
1159154
def getmap(self, path, query=None):
        
        code, data, ctype = self.get(path, query)
        if ctype != 'application/json':
            self.log.error("Expecting JSON from GET of '%s', got '%s'", self.lastpath, ctype)
            raise HttpError(code=400, content_type='text/plain', content='Remote returned invalid content type: '+ctype)
        try:
            result = json.loads(data)
        except Exception as e:                                                                  # pragma: no cover
            self.log.error("Could not load JSON content from GET %r -- %s", self.lastpath, e)
            raise HttpError(code=400, content_type='text/plain', content='Could not load JSON content')
        return result
1126500
public <T> T get(Map<String, Object> data, String name, Class<T> clazz) {
    return convert(get(data, name), clazz);
  }