from typing import Dict
from typing import Set


def filter_least_used_disks(disk_to_copy_processes_count: Dict[str, int]) -> Set[str]:
    """Filters for the least used disk

    Parameters
    ----------
    disk_to_lockfile_count : Dict[str, int]
        Dictionary of disks with lockfile count

    Returns
    -------
    available_dirs : Set[str]
        Available directories with minimal lockfile count. In case of
        equal lockfile count then the disks are given randomly.
    """
    minimum_number_of_lockfiles = min(disk_to_copy_processes_count.values())
    available_target_dirpaths = {
        dirpath
        for dirpath in disk_to_copy_processes_count
        if disk_to_copy_processes_count[dirpath] == minimum_number_of_lockfiles
    }
    return available_target_dirpaths