<commit_before>"""Runge--Kutta integration and collocation."""


import collections.abc

import numpy as np
import scipy
from numpy import linalg, polynomial


def lgl_points(n):
    """Legendre Gauss Lobatto collocation points.
    
    Parameters
    ----------
    n : int
        The collocation order, which equals the number of points.
    
    Returns
    -------
    points : (n,) array
        The collocation points, beginning at 0 and ending at 1.

    >>> lgl_points(2)
    array([ 0.,  1.])
    >>> lgl_points(3)
    array([ 0. ,  0.5,  1. ])
    
    """
    if n < 2:
        raise ValueError("Collocation order of Lobatto methods must be > 1.")
    
    ln = polynomial.Legendre([0]*(n - 1) + [1], [0, 1])
    return np.r_[0.0, ln.deriv().roots(), 1.0]<commit_msg>Adding missing import.<commit_after>"""Runge--Kutta integration and collocation."""


import collections.abc

import numpy as np
import scipy
import scipy.linalg
from numpy import linalg, polynomial


def lgl_points(n):
    """Legendre Gauss Lobatto collocation points.
    
    Parameters
    ----------
    n : int
        The collocation order, which equals the number of points.
    
    Returns
    -------
    points : (n,) array
        The collocation points, beginning at 0 and ending at 1.

    >>> lgl_points(2)
    array([ 0.,  1.])
    >>> lgl_points(3)
    array([ 0. ,  0.5,  1. ])
    
    """
    if n < 2:
        raise ValueError("Collocation order of Lobatto methods must be > 1.")
    
    ln = polynomial.Legendre([0]*(n - 1) + [1], [0, 1])
    return np.r_[0.0, ln.deriv().roots(), 1.0]
{'fraction_non_alphanumeric': 0.144745122718691, 'fraction_numerical': 0.02643171806167401, 'mean_word_length': 2.212121212121212, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '7098566', 'n_tokens_mistral': 556, 'n_tokens_neox': 518, 'n_words': 165}