<commit_before># -*- coding: utf-8 -*-


class Euclid:
    """
    A class to compute the Euclidean algorithm and extended Euclidean algorithm.
    """

    def __init__(self):
        """
        The constructor of this class does nothing
        """
        pass

    @staticmethod
    def algorithm(a, b):
        """
        the Euclidean algorithm is an efficient method for computing the greatest common divisor (GCD) of two numbers,
        the largest number that divides both of them without leaving a remainder.

        :param self: instance of the class
        :param a: first divisor
        :param b: second divisor
        :return: greatest common divisor
        :rtype: int
        """
        while b != 0:
            (a, b) = (b, a % b)
        return abs(a)

    @staticmethod
    def extended_algorithm(a, b):
        """
         The extended Euclidean algorithm is an extension to the Euclidean algorithm, in addition to the
         greatest common divisor of integers a and b, also the coefficients of Bézout's identity,
         which are integers u and v such that a * u + b * v = gcd ( a , b )

        :param self: instance of the class
        :param a: first divisor
        :param b: second divisor
        :return: greatest common divisor and the coefficients of Bézout's identity u and v
        :rtype: int, int, int
        """
        u, v, s, t = 1, 0, 0, 1
        while b > 0:
            q = a // b
            a, b = b, a - q * b
            u, s = s, u - q * s
            v, t = t, v - q * t
        return a, u, v<commit_msg>Fixing wrong docstrings<commit_after># -*- coding: utf-8 -*-


class Euclid:
    """
    A class to compute the Euclidean algorithm and extended Euclidean algorithm.
    """

    def __init__(self):
        """
        The constructor of this class does nothing
        """
        pass

    @staticmethod
    def algorithm(a, b):
        """
        the Euclidean algorithm is an efficient method for computing the greatest common divisor (GCD) of two numbers,
        the largest number that divides both of them without leaving a remainder.

        :param a: first divisor
        :param b: second divisor
        :return: greatest common divisor
        :rtype: int
        """
        while b != 0:
            (a, b) = (b, a % b)
        return abs(a)

    @staticmethod
    def extended_algorithm(a, b):
        """
         The extended Euclidean algorithm is an extension to the Euclidean algorithm, in addition to the
         greatest common divisor of integers a and b, also the coefficients of Bézout's identity,
         which are integers u and v such that a * u + b * v = gcd ( a , b )

        :param a: first divisor
        :param b: second divisor
        :return: greatest common divisor and the coefficients of Bézout's identity u and v
        :rtype: (int, int, int)
        """
        u, v, s, t = 1, 0, 0, 1
        while b > 0:
            q = a // b
            a, b = b, a - q * b
            u, s = s, u - q * s
            v, t = t, v - q * t
        return a, u, v
{'fraction_non_alphanumeric': 0.08469055374592833, 'fraction_numerical': 0.004560260586319218, 'mean_word_length': 1.7346393588601958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5574559', 'n_tokens_mistral': 907, 'n_tokens_neox': 828, 'n_words': 397}