def is_directive(headers, data):
    """
    checks if a part (of multi-part body) looks like a directive

    directives have application/json content-type and key 'directive' in the top-level JSON payload object
    :param headers: dict of Part headers (from network, bytes key/values)
    :param data: dict part content, type depends on content-type (dict if application/json)
    :return: True if part looks like a directive, False otherwise
    """
    return b'application/json' in headers[b'Content-Type'] and 'directive' in data