def contains_any(
    scene: trimesh.Scene, a: Union[str, list[str]], b: Union[str, list[str]]
) -> bool:
    """
    Check if any object in list 'a' contains any object in list 'b' within the given scene.

    Parameters:
    - scene: The trimesh.Scene instance.
    - a: Name or list of names of objects to check for containment.
    - b: Name or list of names of objects that might be contained.

    Returns:
    - True if any object in list 'a' contains any object in list 'b', False otherwise.
    """

    if isinstance(a, str):
        a = [a]
    if isinstance(b, str):
        b = [b]

    for obj_a in a:
        if any(contains(scene, obj_a, obj_b) for obj_b in b):
            return True

    return False

    Check if any object in list 'a' contains any object in list 'b' within the given scene.

    Parameters:
    - scene: The trimesh.Scene instance.
    - a: Name or list of names of objects to check for containment.
    - b: Name or list of names of objects that might be contained.

    Returns:
    - True if any object in list 'a' contains any object in list 'b', False otherwise.
    
infinigen/core/constraints/evaluator/node_impl/trimesh_geometry.py