<commit_before>import collections


SolutionBase = collections.namedtuple("SolutionBase",
                                      field_names=['basis_kwargs',
                                                   'domain',
                                                   'functions',
                                                   'nodes',
                                                   'problem',
                                                   'residuals',
                                                   'result',
                                                   ],
                                      )


class Solution(SolutionBase):
    """
    Represents the solution to a Two-Point Boundary Value Problem (BVP).

    Attributes
    ----------
    basis_kwargs : dict
    domain : tuple
    functions : list
    nodes : ndarray
    problem : TwoPointBVPLike
    residuals : callable
    result : OptimizeResult

    """
<commit_msg>Added method for computing normalized residuals.<commit_after>import collections


SolutionBase = collections.namedtuple("SolutionBase",
                                      field_names=['basis_kwargs',
                                                   'domain',
                                                   'functions',
                                                   'nodes',
                                                   'problem',
                                                   'residuals',
                                                   'result',
                                                   ],
                                      )


class Solution(SolutionBase):
    """
    Class representing the solution to a Boundary Value Problem (BVP).

    Attributes
    ----------
    basis_kwargs : dict
    domain : tuple
    functions : list
    nodes : ndarray
    problem : TwoPointBVPLike
    residuals : callable
    result : OptimizeResult

    """

    def normalized_residuals(self, points):
        """Normalize residuals by the level of the variable."""
        residuals = self.residuals(points)
        variables = [soln_func(points) for soln_func in self.functions]
        return [resid / variable for resid, variable in zip(residuals, variables)]

{'fraction_non_alphanumeric': 0.07022222222222223, 'fraction_numerical': 0.0, 'mean_word_length': 0.9076271186440678, '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': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7028013', 'n_tokens_mistral': 422, 'n_tokens_neox': 392, 'n_words': 109}