def all_objects(obj: Any, query: Lens = None) -> Iterable[Tuple[Lens, Any]]:
    """
    Get all queries for the given object.
    """

    query = query or Lens()

    yield (query, obj)

    if isinstance(obj, JSON_BASES):
        pass

    elif isinstance(obj, pydantic.BaseModel):
        for k in type(obj).model_fields:
            v = getattr(obj, k)
            sub_query = query[k]
            yield from all_objects(v, sub_query)

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

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

    elif isinstance(obj, Iterable):
        logger.debug(
            f"Cannot create query for Iterable types like {obj.__class__.__name__} at query {query}. Convert the iterable to a sequence first."
        )

    else:
        logger.debug(f"Unhandled object type {obj} {type(obj)}")

    Get all queries for the given object.
    
src/core/trulens/core/utils/serial.py