def METHOD_NAME(weights):
    gene = []
    n = 2
    start = 0
    cnn_structure_count = 0
    for i in range(self._steps):
        end = start + n
        W = weights[start:end].copy()
        edges = sorted(
            range(i + 2),
            key=lambda x: -max(
                W[x][k]
                for k in range(len(W[x]))
                if k != PRIMITIVES.index("none")
            ),
        )[:2]
        for j in edges:
            k_best = None
            for k in range(len(W[j])):
                if k != PRIMITIVES.index("none"):
                    if k_best is None or W[j][k] > W[j][k_best]:
                        k_best = k
            if _isCNNStructure(k_best):
                cnn_structure_count += 1
            gene.append((PRIMITIVES[k_best], j))
        start = end
        n += 1
    return gene, cnn_structure_count