<commit_before>import numpy as np
import itertools
import cv2


def get_2d_coordinates_grid(shape):
    """
    Given a 2 element tuple, return a 2D matrix of grid coordinates.
    Each element of the grid is a point [x, y] where x and y are coordinate values
    """

    y = range(0, shape[0])
    x = range(0, shape[1])

    yx_list = list(itertools.product(y, x))
    yx_vector = np.array(yx_list)

    yx_matrix = np.array(yx_vector).reshape((shape[0], shape[1], 2))
    return yx_matrix


class SOCMTrainer:
    """
    A class for training a Self Organizing Color Map
    """

    def __init__(self, shape, iterations_number):
        """
        :param shape: a 2 elements list that specifies map size
        :param iterations_number: number of iterations map will be trained on iput
        """
        if len(shape) != 2:
            raise ValueError("Shape must have 2 dimensions")

        # Each color has 3 elements<commit_msg>Fixed docstrings<commit_after>import numpy as np
import itertools
import cv2


def get_2d_coordinates_grid(shape):
    """
    Given a 2 element tuple, return a 2D matrix of grid coordinates.
    Each element of the grid is a point [x, y] where x and y are coordinate values
    """

    y = range(0, shape[0])
    x = range(0, shape[1])

    yx_list = list(itertools.product(y, x))
    yx_vector = np.array(yx_list)

    yx_matrix = np.array(yx_vector).reshape((shape[0], shape[1], 2))
    return yx_matrix


class SOCMTrainer:
    """
    A class for training a Self Organizing Color Map
    """

    def __init__(self, shape, iterations_number):
        """
        :param shape: a 2 elements list that specifies map size
        :param iterations_number: number of iterations map will be trained on input
        """
        if len(shape) != 2:
            raise ValueError("Shape must have 2 dimensions")

        # Each color has 3 elements
{'fraction_non_alphanumeric': 0.09216101694915255, 'fraction_numerical': 0.015889830508474576, 'mean_word_length': 2.7931726907630523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2052094', 'n_tokens_mistral': 600, 'n_tokens_neox': 559, 'n_words': 212}