def bitmask_get(bm, mn, f):
    """
     returns True if flag f in bitmask bm is set in magic number mn
     throws KeyError if f is not defined in bitmask
     :param bm: bitmask
     :param mn: magic number
     :param f: flag to retrieve
     :returns: defined names
    """
    return int(bm[f] & mn == bm[f])
