def METHOD_NAME(
    self,
    study: Study,
    dto: DistrictCreationDTO,
) -> DistrictInfoDTO:
    """
    Create a new district in the study and possibly attach areas to it.
    Args:
        study: Study selected from the database.
        dto: Data Transfer Objects (DTO) used for creation.
    Returns:
        the Data Transfer Objects (DTO) representing the newly created district.
    Raises:
        DistrictAlreadyExist: exception raised when district already exists (duplicate).
        AreaNotFound: exception raised when one (or more) area(s) don't exist in the study.
    """
    file_study = self.storage_service.get_storage(study).get_raw(study)
    district_id = transform_name_to_id(dto.name)
    if district_id in file_study.config.sets:
        raise DistrictAlreadyExist(district_id)
    areas = frozenset(dto.areas or [])
    all_areas = frozenset(file_study.config.areas)
    if invalid_areas := areas - all_areas:
        raise AreaNotFound(*invalid_areas)
    command = CreateDistrict(
        name=dto.name,
        output=dto.output,
        comments=dto.comments,
        base_filter=DistrictBaseFilter.remove_all,
        filter_items=areas,
        command_context=self.storage_service.variant_study_service.command_factory.command_context,
    )
    execute_or_add_commands(study, file_study, [command], self.storage_service)
    return DistrictInfoDTO(
        id=district_id,
        name=dto.name,
        areas=list(areas),
        output=dto.output,
        comments=dto.comments,
    )