<commit_before>import numpy as np
from numpy.testing import assert_allclose
from mock import MagicMock

from ..pv_slicer import _slice_from_path, _slice_label, _slice_index, PVSliceWidget

from ...qt.widgets.image_widget import StandaloneImageWidget

from ...core import Data

from ....tests.helpers import requires_astropy


@requires_astropy
class TestSliceExtraction(object):

    def setup_method(self, method):
        self.x = np.random.random((2, 3, 4))
        self.d = Data(x=self.x)

    def test_constant_y(self):

        slc = (0, 'y', 'x')
        x = [-0.5, 3.5]
        y = [0, 0]
        s, _ = _slice_from_path(x, y, self.d, 'x', slc)
        assert_allclose(s, self.x[:, 0, :])
<commit_msg>Fix test failure<commit_after>import numpy as np
from numpy.testing import assert_allclose
from mock import MagicMock

from ..pv_slicer import _slice_from_path, _slice_label, _slice_index, PVSliceWidget

from ...qt.widgets.image_widget import StandaloneImageWidget

from ...core import Data

from ...tests.helpers import requires_astropy


@requires_astropy
class TestSliceExtraction(object):

    def setup_method(self, method):
        self.x = np.random.random((2, 3, 4))
        self.d = Data(x=self.x)

    def test_constant_y(self):

        slc = (0, 'y', 'x')
        x = [-0.5, 3.5]
        y = [0, 0]
        s, _ = _slice_from_path(x, y, self.d, 'x', slc)
        assert_allclose(s, self.x[:, 0, :])

{'fraction_non_alphanumeric': 0.126056338028169, 'fraction_numerical': 0.015492957746478873, 'mean_word_length': 3.130813953488372, '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': '3076367', 'n_tokens_mistral': 518, 'n_tokens_neox': 494, 'n_words': 130}