def leaf_queries(obj_json: JSON, query: Lens = None) -> Iterable[Lens]:
    """
    Get all queries for the given object that select all of its leaf values.
    """

    query = query or Lens()

    if isinstance(obj_json, JSON_BASES):
        yield query

    elif isinstance(obj_json, Dict):
        for k, v in obj_json.items():
            sub_query = query[k]
            yield from leaf_queries(obj_json[k], sub_query)

    elif isinstance(obj_json, Sequence):
        for i, v in enumerate(obj_json):
            sub_query = query[i]
            yield from leaf_queries(obj_json[i], sub_query)

    else:
        yield query

    Get all queries for the given object that select all of its leaf values.
    
src/core/trulens/core/utils/serial.py