def get_user_overwritten_connection_mode() -> Optional[ConnectionMode]:
    """
    Return the user overwritten connection mode.
    """
    connection_mode: Union[str, None] = environ.get("TESTCONTAINERS_CONNECTION_MODE")
    if connection_mode:
        try:
            return ConnectionMode(connection_mode)
        except ValueError as e:
            raise ValueError(f"Error parsing TESTCONTAINERS_CONNECTION_MODE: {e}") from e
    return None

    Return the user overwritten connection mode.
    
core/testcontainers/core/config.py