def is_in_container(device, container="undefined_container"):
    """
    Check if device is attached to given container.

    Parameters
    ----------
    device : dict
        Device information from cv_facts
    container : str, optional
        Container name to check if device is attached to, by default 'undefined_container'

    Returns
    -------
    boolean
        True if attached to container, False if not.
    """
    if "parentContainerKey" in device:
        if container == device["parentContainerKey"]:
            return True
    return False