def _task_info(clazz):
    """
    from a provided class instance extract task metadata.
    This will error if any of the expected fields of the task are missing.
    :param clazz: class object you need metadata for
    :return: a metadata dictionary
    """
    params = []
    for e in clazz.parameters:
        params += [{
            "name": e.name,
            "display_name": e.display_name,
            "type": e.d_type,
            "description": e.description,
            "valid_values": e.valid
        }]

    return {
        "name": clazz.name,
        "display_name": clazz.display_name,
        "description": clazz.description,
        "args": params,
        "img_url": clazz.img_url,
        "info_url": clazz.info_url,
    }