def move_individual(destination_rank, destination_index, source_rank,
    source_index):
    """
    Move an archive individual from one rank to another rank.
    This function does not check bounds or make any other safety guarantees.
    This function assumes that the individual is valid and adjusts
    occupancy accordingly.

    destination_rank (Rank)
    destination_index (int): index into destination_rank
    source_rank (Rank)
    source_index (int): index into source_rank

    Returns an updated destination rank and source rank.
    """
    individual = source_rank.individuals[source_index]
    destination_rank.individuals[destination_index] = individual
    destination_rank = destination_rank._replace(occupancy=destination_rank
        .occupancy + 1)
    source_rank.individuals[source_index] = individual._replace(valid=False)
    source_rank = source_rank._replace(occupancy=source_rank.occupancy - 1)
    return destination_rank, source_rank
