def get_masteries(ids=None):
    """
    Gets a bunch of masteries (or all of them)

    Args:
        ids (list<int>): the IDs of the masteries to get (or None to get all masteries) (default None)

    Returns:
        list<Mastery>: the masteries
    """
    if ids is not None:
        masteries = {mastery.id: mastery for mastery in get_masteries()}
        results = []
        for id_ in ids:
            try:
                mastery = masteries[id_]
            except __HOLE__:
                mastery = None
            results.append(mastery)
        return results
    else:
        if cassiopeia.core.requests.data_store.has_all(cassiopeia.type.core.staticdata.Mastery):
            return cassiopeia.core.requests.data_store.get_all(cassiopeia.type.core.staticdata.Mastery)

        masteries = cassiopeia.dto.staticdataapi.get_masteries()
        masteries = [cassiopeia.type.core.staticdata.Mastery(mastery[1]) for mastery in masteries.data.items()]

        cassiopeia.core.requests.data_store.store(masteries, [mastery.id for mastery in masteries], [cassiopeia.type.core.staticdata.Mastery])
        return masteries
dataset/ETHPy150Open meraki-analytics/cassiopeia/cassiopeia/core/staticdataapi.py/get_masteries