def octetparts(msg):
    """Return a set of all msg parts with type 'application/octet-stream'."""
    return set(filter(lambda part: part.get_content_type() ==
        'application/octet-stream', msg.walk()))
