def METHOD_NAME(filename, format):
    from OpenSSL import crypto
    types = {
        FILETYPE_PEM: crypto.FILETYPE_PEM,
        FILETYPE_DER: crypto.FILETYPE_ASN1
    }
    if filename == '-':
        crl = crypto.load_crl(types[format], sys.stdin.buffer.read())
    else:
        with open(filename, 'rb') as f:
            crl = crypto.load_crl(types[format], f.read())
    return set(int(r.get_serial(), 16) for r in crl.get_revoked())