rename -flatMapCharSequence
550862
public final static <T> Stream<Character> flatMapCharSequence(final Stream<T> stream, final Function<? super T, CharSequence> fn) {
        return stream.flatMap(fn.andThen(CharSequence::chars)
                                .andThen(s->s.mapToObj(i->Character.toChars(i)[0])));
    }
641595
private void preprocess_RenameMemberShapes(String shapeName, Shape shape) {
        if (shape.getListMember() != null) {
            preprocess_RenameMemberShape(shape.getListMember());
        }
        if (shape.getMapKeyType() != null) {
            preprocess_RenameMemberShape(shape.getMapKeyType());
        }
        if (shape.getMapValueType() != null) {
            preprocess_RenameMemberShape(shape.getMapValueType());
        }
        if (shape.getMembers() != null) {
            for (Entry<String, Member> entry : shape.getMembers().entrySet()) {
                preprocess_RenameMemberShape(entry.getValue());
            }
        }
    }
844054
static Map<String, List<Integer>> updateParameterNamesToIndexes(Map<String, List<Integer>> parametersNameToIndex,
                                                                    List<ArrayParameter> arrayParametersSortedAsc) {
        for(Map.Entry<String, List<Integer>> parameterNameToIndexes : parametersNameToIndex.entrySet()) {
            List<Integer> newParameterIndex = new ArrayList<>(parameterNameToIndexes.getValue().size());
            for(Integer parameterIndex : parameterNameToIndexes.getValue()) {
                newParameterIndex.add(computeNewIndex(parameterIndex, arrayParametersSortedAsc));
            }
            parameterNameToIndexes.setValue(newParameterIndex);
        }

        return parametersNameToIndex;
    }
1245384
void renameCache(Path oldhdfsPath, Path newhdfsPath,
    Path localPath) throws IOException {
    CacheEntry found = cacheMap.remove(oldhdfsPath);
    if (found == null) {
      String msg = "LookasideCache error renaming path: " + oldhdfsPath +
                   " to: " + newhdfsPath +
                   " Path " + newhdfsPath +
                   " because it does not exists in the cache.";
      LOG.warn(msg);
      return;
    }
    // Update its timestamp and localPath
    found.hdfsPath = newhdfsPath;
    found.setGenstamp(globalStamp.incrementAndGet());
    found.localPath = localPath;

    // add it back to the cache
    CacheEntry empty = cacheMap.putIfAbsent(newhdfsPath, found);
    if (empty != null) {
      String msg = "LookasideCache error renaming path: " + oldhdfsPath +
                   " to: " + newhdfsPath +
                   " Path " + newhdfsPath +
                   " already exists in the cache.";
      LOG.warn(msg);
      throw new IOException(msg);
    }
    localMetrics.numRename++;
    if (LOG.isDebugEnabled()) {
      LOG.debug("LookasideCache renamed path:" + oldhdfsPath +
                " to:" + newhdfsPath +
                " cachedPath: " + localPath);
    }
  }
573868
private void renameIndexTables(AccumuloTable oldTable, AccumuloTable newTable)
    {
        if (!oldTable.isIndexed()) {
            return;
        }

        if (!tableManager.exists(oldTable.getIndexTableName())) {
            throw new PrestoException(ACCUMULO_TABLE_DNE, format("Table %s does not exist", oldTable.getIndexTableName()));
        }

        if (tableManager.exists(newTable.getIndexTableName())) {
            throw new PrestoException(ACCUMULO_TABLE_EXISTS, format("Table %s already exists", newTable.getIndexTableName()));
        }

        if (!tableManager.exists(oldTable.getMetricsTableName())) {
            throw new PrestoException(ACCUMULO_TABLE_DNE, format("Table %s does not exist", oldTable.getMetricsTableName()));
        }

        if (tableManager.exists(newTable.getMetricsTableName())) {
            throw new PrestoException(ACCUMULO_TABLE_EXISTS, format("Table %s already exists", newTable.getMetricsTableName()));
        }

        tableManager.renameAccumuloTable(oldTable.getIndexTableName(), newTable.getIndexTableName());
        tableManager.renameAccumuloTable(oldTable.getMetricsTableName(), newTable.getMetricsTableName());
    }
1215943
public String rename(Object oldkey, Object newkey) {
		Jedis jedis = getJedis();
		try {
			return jedis.rename(keyToBytes(oldkey), keyToBytes(newkey));
		}
		finally {close(jedis);}
	}
957197
function convertPropertyNamesAndValues (context, pkg, map, root, waiting) {
	if(!map) {
		return map;
	}
	var clone = {}, val, name;
	for(var property in map ) {
		val = map[property];
		name = convertName(context, pkg, map, root, property, waiting); 
		val = typeof val === "object"
			? convertPropertyNamesAndValues(context, pkg, val, root, waiting)
			: convertName(context, pkg, map, root, val, waiting);
		if(typeof name !== 'undefined' && typeof val !== 'undefined') {
			clone[name] = val;
		}
	}
	return clone;
}
665334
def rename(self, old_key, new_key):
        
        return lib.zhashx_rename(self._as_parameter_, old_key, new_key)
971245
def _get_rename_function(mapper):
    
    if isinstance(mapper, (abc.Mapping, ABCSeries)):

        def f(x):
            if x in mapper:
                return mapper[x]
            else:
                return x
    else:
        f = mapper

    return f
487582
@SuppressWarnings("unchecked")
    private void updateMap(Map<String, Object> parentMap, String paramName, Object paramValue) {
        Object currentValue = parentMap.get(paramName);
        if (currentValue == null || !(currentValue instanceof Map)) {
            if (paramValue instanceof Map) {
                parentMap.put(paramName, paramValue);
            } else {
                parentMap.put(paramName, paramValue.toString());
            }
        } else {
            Utils.require(paramValue instanceof Map,
                          "Parameter '%s' must be a map: %s", paramName, paramValue.toString());
            Map<String, Object> currentMap = (Map<String, Object>)currentValue;
            Map<String, Object> updateMap = (Map<String, Object>)paramValue;
            for (String subParam : updateMap.keySet()) {
                updateMap(currentMap, subParam, updateMap.get(subParam));
            }
        }
    }
747241
def flatMap(f: Callable, xs: Iterable) -> List:
    
    return flatten(lmap(f, xs))
653489
function defaultSourceMapProvider(fileName) {
	const code = fs.readFileSync(fileName, 'utf8');
	return sourceMapResolve.resolveSourceMapSync(code, fileName, fs.readFileSync);
}
1096714
@Override
  public String rename(final byte[] oldkey, final byte[] newkey) {
    checkIsInMultiOrPipeline();
    client.rename(oldkey, newkey);
    return client.getStatusCodeReply();
  }
419634
def _rename_coords(ds, attrs):
    """"""
    for name_int, names_ext in attrs.items():
        # Check if coord is in dataset already.
        ds_coord_name = set(names_ext).intersection(set(ds.coords))
        if ds_coord_name:
            # Rename to the aospy internal name.
            try:
                ds = ds.rename({list(ds_coord_name)[0]: name_int})
                logging.debug("Rename coord from `{0}` to `{1}` for "
                              "Dataset `{2}`".format(ds_coord_name,
                                                     name_int, ds))
            # xarray throws a ValueError if the name already exists
            except ValueError:
                ds = ds
    return ds
701184
private void reusePreviouslyUsedVariableMap(SortedSet<Assignment> varsToRename) {
    // If prevUsedRenameMap had duplicate values then this pass would be
    // non-deterministic.
    // In such a case, the following will throw an IllegalArgumentException.
    checkNotNull(prevUsedRenameMap.getNewNameToOriginalNameMap());
    for (Assignment a : varsToRename) {
      String prevNewName = prevUsedRenameMap.lookupNewName(a.oldName);
      if (prevNewName == null || reservedNames.contains(prevNewName)) {
        continue;
      }

      if (a.isLocal
          || (!externNames.contains(a.oldName)
              && prevNewName.startsWith(prefix))) {
        reservedNames.add(prevNewName);
        finalizeNameAssignment(a, prevNewName);
      }
    }
  }
1102260
function remapLoadRecord(load, mapFunction) {
    load = extend({}, load);
    load.name = mapFunction(load.name, load.name);
    var depMap = {};
    Object.keys(load.depMap).forEach(function(dep) {
      depMap[dep] = mapFunction(load.depMap[dep], dep);
    });
    load.depMap = depMap;
    return load;
  }
496675
private void rename(CmisObject object, String name){
        Map<String, Object> newName = new HashMap<String, Object>();
        newName.put("cmis:name", name);

        object.updateProperties(newName);
    }