<commit_before>#!/usr/bin/python
""" Classes and functions for fitting the diffusion kurtosis model """
from __future__ import division, print_function, absolute_import

import numpy as np
import scipy.optimize as opt
from dipy.reconst.dti import (TensorFit, mean_diffusivity, axial_diffusivity,
                              radial_diffusivity, from_lower_triangular,
                              lower_triangular, decompose_tensor,
                              MIN_POSITIVE_SIGNAL)

from dipy.reconst.utils import dki_design_matrix as design_matrix
from dipy.utils.six.moves import range
from dipy.reconst.base import ReconstModel
from dipy.core.geometry import (sphere2cart, cart2sphere)
from dipy.reconst.recspeed import local_maxima
from dipy.core.ndindex import ndindex


def _positive_evals(L1, L2, L3, er=2e-7):
    """ Helper function that indentifies which voxels in a array have all
    eigenvalues significantly larger than zero

    Parameters
    ----------<commit_msg>NF: Complete version of diffusion_components function (test needed)<commit_after>#!/usr/bin/python
""" Classes and functions for fitting the diffusion kurtosis model """
from __future__ import division, print_function, absolute_import

import numpy as np
import scipy.optimize as opt
from dipy.reconst.dti import (TensorFit, mean_diffusivity, axial_diffusivity,
                              radial_diffusivity, from_lower_triangular,
                              lower_triangular, decompose_tensor,
                              MIN_POSITIVE_SIGNAL)

from dipy.reconst.utils import dki_design_matrix as design_matrix
from dipy.utils.six.moves import range
from dipy.reconst.base import ReconstModel
from dipy.core.geometry import (sphere2cart, cart2sphere)
from dipy.reconst.recspeed import local_maxima
from dipy.core.ndindex import ndindex
from dipy.reconst.vec_val_sum import vec_val_vect

def _positive_evals(L1, L2, L3, er=2e-7):
    """ Helper function that indentifies which voxels in a array have all
    eigenvalues significantly larger than zero

    Parameters
    ----------
{'fraction_non_alphanumeric': 0.06512301013024602, 'fraction_numerical': 0.006753497346840328, 'mean_word_length': 3.422174840085288, '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': '874994', 'n_tokens_mistral': 608, 'n_tokens_neox': 589, 'n_words': 179}