def intern_string(string):
    return _string_cache.setdefault(string, string)
Takes a (potentially) unicode string and interns using custom cache
dataset/ETHPy150Open matrix-org/synapse/synapse/util/caches/__init__.py/intern_string