def __update_clusters(self, medoids):
self.__belong = [<NUM_LIT:0>] * len(self.__pointer_data)<EOL>self.__clusters = [[] for i in range(len(medoids))]<EOL>for index_point in range(len(self.__pointer_data)):<EOL><INDENT>index_optim = -<NUM_LIT:1><EOL>dist_optim = <NUM_LIT:0.0><EOL>for index in range(len(medoids)):<EOL><INDENT>dist = euclidean_distance_square(self.__pointer_data[index_point], self.__pointer_data[medoids[index]])<EOL>if (dist < dist_optim) or (index is <NUM_LIT:0>):<EOL><INDENT>index_optim = index<EOL>dist_optim = dist<EOL><DEDENT><DEDENT>self.__clusters[index_optim].append(index_point)<EOL>self.__belong[index_point] = index_optim<EOL><DEDENT>self.__clusters = [cluster for cluster in self.__clusters if len(cluster) > <NUM_LIT:0>]<EOL>
!
        @brief Forms cluster in line with specified medoids by calculation distance from each point to medoids.