import msgpack

with open('data/synonyms.msgpack', 'r') as f:
    SYNONYMS = msgpack.load(f, use_list=False)


def cached_synonyms(x, length=None):
    x = x.lower()
    if x in SYNONYMS:
        syns = [s for s in SYNONYMS[x] if (not length) or (len(s) <= length)]
        return set(syns)
    else:
        return set([])

8ecf56ddcff129c62cf754dfc0c810eb564576ae
<mask token>

<mask token>


def cached_synonyms(x, length=None):
    x = x.lower()
    if x in SYNONYMS:
        syns = [s for s in SYNONYMS[x] if not length or len(s) <= length]
        return set(syns)
    else:
        return set([])

<mask token>
with open('data/synonyms.msgpack', 'r') as f:
    SYNONYMS = msgpack.load(f, use_list=False)


def cached_synonyms(x, length=None):
    x = x.lower()
    if x in SYNONYMS:
        syns = [s for s in SYNONYMS[x] if not length or len(s) <= length]
        return set(syns)
    else:
        return set([])

import msgpack
with open('data/synonyms.msgpack', 'r') as f:
    SYNONYMS = msgpack.load(f, use_list=False)


def cached_synonyms(x, length=None):
    x = x.lower()
    if x in SYNONYMS:
        syns = [s for s in SYNONYMS[x] if not length or len(s) <= length]
        return set(syns)
    else:
        return set([])

import msgpack

with open('data/synonyms.msgpack', 'r') as f:
    SYNONYMS = msgpack.load(f, use_list=False)


def cached_synonyms(x, length=None):
    x = x.lower()
    if x in SYNONYMS:
        syns = [s for s in SYNONYMS[x] if (not length) or (len(s) <= length)]
        return set(syns)
    else:
        return set([])
