Code Duplication    Length = 2-2 lines in 3 locations

pyclustering/cluster/syncnet.py 2 locations

@@ 314-315 (lines=2) @@
311
            if (self._ena_conn_weight is True):
312
                conn_weight = self._conn_weight[index][k];
313
                
314
            phase += conn_weight * self._weight * math.sin(self._phases[k] - teta);
315
        
316
        divider = len(neighbors);
317
        if (divider == 0):
318
            divider = 1.0;
@@ 309-310 (lines=2) @@
306
        phase = 0.0;      # phase of a specified oscillator that will calculated in line with current env. states.
307
        
308
        neighbors = self.get_neighbors(index);
309
        for k in neighbors:
310
            conn_weight = 1.0;
311
            if (self._ena_conn_weight is True):
312
                conn_weight = self._conn_weight[index][k];
313
                

pyclustering/nnet/cnn.py 1 location

@@ 406-407 (lines=2) @@
403
        
404
        points = numpy.array(stimulus);
405
        triangulation = Delaunay(points);
406
        
407
        for triangle in triangulation.simplices:
408
            for index_tri_point1 in range(len(triangle)):
409
                for index_tri_point2 in range(index_tri_point1 + 1, len(triangle)):
410
                    index_point1 = triangle[index_tri_point1];