def handle_sample_id(
    state: fos.StateDescription, sample_id: t.Optional[str] = None
):
    """Handle a sample id.

    Args:
        state: the state description
        sample_id (None): an optional sample ID


    Returns:
        True/False indicating if a state update event should be dispatched
    """
    if state.sample_id != sample_id:
        if sample_id is not None:
            state.sample_id = sample_id
            return True

    return False
Handle a sample id.

    Args:
        state: the state description
        sample_id (None): an optional sample ID


    Returns:
        True/False indicating if a state update event should be dispatched
    
fiftyone/server/events/initialize.py