def METHOD_NAME(filename, format):
    args = ['openssl', 'crl', '-inform', format, '-text']
    if filename != '-':
        args += ['-in', filename]
    serials = set()
    for line in check_output(args, universal_newlines=True).splitlines():
        _, _, serial = line.partition('Serial Number:')
        if serial:
            serials.add(int(serial.strip(), 16))
    return serials