#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest

import numpy as np
import scipy.sparse as sps

from mars.tensor.execution.core import Executor
from mars import tensor as mt
from mars.tensor.expressions.datasource import tensor, ones, zeros, arange
from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, \
    expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, \
    hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, \
    flip, flipud, fliplr, repeat, tile, isin
from mars.tensor.expressions.merge import stack
from mars.tensor.expressions.reduction import all as tall


class Test(unittest.TestCase):
    def setUp(self):
        self.executor = Executor('numpy')

    def testRechunkExecution(self):
        raw = np.random.random((11, 8))
        arr = tensor(raw, chunks=3)
        arr2 = arr.rechunk(4)

        res = self.executor.execute_tensor(arr2)

        self.assertTrue(np.array_equal(res[0], raw[:4, :4]))
        self.assertTrue(np.array_equal(res[1], raw[:4, 4:]))
        self.assertTrue(np.array_equal(res[2], raw[4:8, :4]))
        self.assertTrue(np.array_equal(res[3], raw[4:8, 4:]))
        self.assertTrue(np.array_equal(res[4], raw[8:, :4]))
        self.assertTrue(np.array_equal(res[5], raw[8:, 4:]))

    def testCopytoExecution(self):
        a = ones((2, 3), chunks=1)
        b = tensor([3, -1, 3], chunks=2)

        copyto(a, b, where=b > 1)

        res = self.executor.execute_tensor(a, concat=True)[0]
        expected = np.array([[3, 1, 3], [3, 1, 3]])

        np.testing.assert_equal(res, expected)

    def testAstypeExecution(self):
        raw = np.random.random((10, 5))
        arr = tensor(raw, chunks=3)
        arr2 = arr.astype('i8')

        res = self.executor.execute_tensor(arr2, concat=True)
        self.assertTrue(np.array_equal(res[0], raw.astype('i8')))

        raw = sps.random(10, 5, density=.2)
        arr = tensor(raw, chunks=3)
        arr2 = arr.astype('i8')

        res = self.executor.execute_tensor(arr2, concat=True)
        self.assertTrue(np.array_equal(res[0].toarray(), raw.astype('i8').toarray()))

    def testTransposeExecution(self):
        raw = np.random.random((11, 8, 5))
        arr = tensor(raw, chunks=3)
        arr2 = transpose(arr)

        res = self.executor.execute_tensor(arr2, concat=True)

        self.assertTrue(np.array_equal(res[0], raw.T))

        arr3 = transpose(arr, axes=(-2, -1, -3))

        res = self.executor.execute_tensor(arr3, concat=True)

        self.assertTrue(np.array_equal(res[0], raw.transpose(1, 2, 0)))

        raw = sps.random(11, 8)
        arr = tensor(raw, chunks=3)
        arr2 = transpose(arr)

        self.assertTrue(arr2.issparse())

        res = self.executor.execute_tensor(arr2, concat=True)

        self.assertTrue(np.array_equal(res[0].toarray(), raw.T.toarray()))

    def testSwapaxesExecution(self):
        raw = np.random.random((11, 8, 5))
        arr = tensor(raw, chunks=3)
        arr2 = arr.swapaxes(2, 0)

        res = self.executor.execute_tensor(arr2, concat=True)

        self.assertTrue(np.array_equal(res[0], raw.swapaxes(2, 0)))

        raw = sps.random(11, 8, density=.2)
        arr = tensor(raw, chunks=3)
        arr2 = arr.swapaxes(1, 0)

        res = self.executor.execute_tensor(arr2, concat=True)

        self.assertTrue(np.array_equal(res[0].toarray(), raw.toarray().swapaxes(1, 0)))

    def testMoveaxisExecution(self):
        x = zeros((3, 4, 5), chunks=2)

        t = moveaxis(x, 0, -1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        self.assertEqual(res.shape, (4, 5, 3))

        t = moveaxis(x, -1, 0)

        res = self.executor.execute_tensor(t, concat=True)[0]
        self.assertEqual(res.shape, (5, 3, 4))

        t = moveaxis(x, [0, 1], [-1, -2])

        res = self.executor.execute_tensor(t, concat=True)[0]
        self.assertEqual(res.shape, (5, 4, 3))

        t = moveaxis(x, [0, 1, 2], [-1, -2, -3])

        res = self.executor.execute_tensor(t, concat=True)[0]
        self.assertEqual(res.shape, (5, 4, 3))

    def testBroadcastToExecution(self):
        raw = np.random.random((10, 5, 1))
        arr = tensor(raw, chunks=2)
        arr2 = broadcast_to(arr, (5, 10, 5, 6))

        res = self.executor.execute_tensor(arr2, concat=True)

        self.assertTrue(np.array_equal(res[0], np.broadcast_to(raw, (5, 10, 5, 6))))

    def testBroadcastArraysExecutions(self):
        x_data = [[1, 2, 3]]
        x = tensor(x_data, chunks=1)
        y_data = [[1], [2], [3]]
        y = tensor(y_data, chunks=2)

        a = broadcast_arrays(x, y)

        res = [self.executor.execute_tensor(arr, concat=True)[0] for arr in a]
        expected = np.broadcast_arrays(x_data, y_data)

        for r, e in zip(res, expected):
            np.testing.assert_equal(r, e)

    def testWhereExecution(self):
        raw_cond = np.random.randint(0, 2, size=(4, 4), dtype='?')
        raw_x = np.random.rand(4, 1)
        raw_y = np.random.rand(4, 4)

        cond, x, y = tensor(raw_cond, chunks=2), tensor(raw_x, chunks=2), tensor(raw_y, chunks=2)

        arr = where(cond, x, y)
        res = self.executor.execute_tensor(arr, concat=True)
        self.assertTrue(np.array_equal(res[0], np.where(raw_cond, raw_x, raw_y)))

        raw_cond = sps.csr_matrix(np.random.randint(0, 2, size=(4, 4), dtype='?'))
        raw_x = sps.random(4, 1, density=.1)
        raw_y = sps.random(4, 4, density=.1)

        cond, x, y = tensor(raw_cond, chunks=2), tensor(raw_x, chunks=2), tensor(raw_y, chunks=2)

        arr = where(cond, x, y)
        res = self.executor.execute_tensor(arr, concat=True)[0]
        self.assertTrue(np.array_equal(res.toarray(),
                                       np.where(raw_cond.toarray(), raw_x.toarray(), raw_y.toarray())))

    def testReshapeExecution(self):
        raw_data = np.random.rand(10, 20, 30)
        x = tensor(raw_data, chunks=6)

        y = x.reshape(-1, 30)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], raw_data.reshape(-1, 30)))

        y2 = x.reshape(10, -1)

        res = self.executor.execute_tensor(y2, concat=True)
        self.assertTrue(np.array_equal(res[0], raw_data.reshape(10, -1)))

        y3 = x.reshape(-1)

        res = self.executor.execute_tensor(y3, concat=True)
        self.assertTrue(np.array_equal(res[0], raw_data.reshape(-1)))

        y4 = x.ravel()

        res = self.executor.execute_tensor(y4, concat=True)
        self.assertTrue(np.array_equal(res[0], raw_data.ravel()))

        raw_data = np.random.rand(30, 100, 20)
        x = tensor(raw_data, chunks=6)

        y = x.reshape(-1, 20, 5, 5, 4)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], raw_data.reshape(-1, 20, 5, 5, 4)))

        y2 = x.reshape(3000, 10, 2)

        res = self.executor.execute_tensor(y2, concat=True)
        self.assertTrue(np.array_equal(res[0], raw_data.reshape(3000, 10, 2)))

        y3 = x.reshape(60, 25, 40)

        res = self.executor.execute_tensor(y3, concat=True)
        self.assertTrue(np.array_equal(res[0], raw_data.reshape(60, 25, 40)))

    def testExpandDimsExecution(self):
        raw_data = np.random.rand(10, 20, 30)
        x = tensor(raw_data, chunks=6)

        y = expand_dims(x, 1)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], np.expand_dims(raw_data, 1)))

        y = expand_dims(x, 0)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], np.expand_dims(raw_data, 0)))

        y = expand_dims(x, 3)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], np.expand_dims(raw_data, 3)))

        y = expand_dims(x, -1)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], np.expand_dims(raw_data, -1)))

        y = expand_dims(x, -4)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], np.expand_dims(raw_data, -4)))

        with self.assertRaises(np.AxisError):
            expand_dims(x, -5)

        with self.assertRaises(np.AxisError):
            expand_dims(x, 4)

    def testRollAxisExecution(self):
        x = ones((3, 4, 5, 6), chunks=1)
        y = rollaxis(x, 3, 1)

        res = self.executor.execute_tensor(y, concat=True)
        self.assertTrue(np.array_equal(res[0], np.rollaxis(np.ones((3, 4, 5, 6)), 3, 1)))

    def testAtleast1dExecution(self):
        x = 1
        y = ones(3, chunks=2)
        z = ones((3, 4), chunks=2)

        t = atleast_1d(x, y, z)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in t]

        self.assertTrue(np.array_equal(res[0], np.array([1])))
        self.assertTrue(np.array_equal(res[1], np.ones(3)))
        self.assertTrue(np.array_equal(res[2], np.ones((3, 4))))

    def testAtleast2dExecution(self):
        x = 1
        y = ones(3, chunks=2)
        z = ones((3, 4), chunks=2)

        t = atleast_2d(x, y, z)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in t]

        self.assertTrue(np.array_equal(res[0], np.array([[1]])))
        self.assertTrue(np.array_equal(res[1], np.atleast_2d(np.ones(3))))
        self.assertTrue(np.array_equal(res[2], np.ones((3, 4))))

    def testAtleast3dExecution(self):
        x = 1
        y = ones(3, chunks=2)
        z = ones((3, 4), chunks=2)

        t = atleast_3d(x, y, z)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in t]

        self.assertTrue(np.array_equal(res[0], np.atleast_3d(x)))
        self.assertTrue(np.array_equal(res[1], np.atleast_3d(np.ones(3))))
        self.assertTrue(np.array_equal(res[2], np.atleast_3d(np.ones((3, 4)))))

    def testArgwhereExecution(self):
        x = arange(6, chunks=2).reshape(2, 3)
        t = argwhere(x > 1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.argwhere(np.arange(6).reshape(2, 3) > 1)

        self.assertTrue(np.array_equal(res, expected))

    def testArraySplitExecution(self):
        x = arange(48, chunks=3).reshape(2, 3, 8)
        ss = array_split(x, 3, axis=2)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.array_split(np.arange(48).reshape(2, 3, 8), 3, axis=2)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r, e) for r, e in zip(res, expected)]

        ss = array_split(x, [3, 5, 6, 10], axis=2)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.array_split(np.arange(48).reshape(2, 3, 8), [3, 5, 6, 10], axis=2)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r, e) for r, e in zip(res, expected)]

    def testSplitExecution(self):
        x = arange(48, chunks=3).reshape(2, 3, 8)
        ss = split(x, 4, axis=2)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.split(np.arange(48).reshape(2, 3, 8), 4, axis=2)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r, e) for r, e in zip(res, expected)]

        ss = split(x, [3, 5, 6, 10], axis=2)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.split(np.arange(48).reshape(2, 3, 8), [3, 5, 6, 10], axis=2)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r, e) for r, e in zip(res, expected)]

        # hsplit
        x = arange(120, chunks=3).reshape(2, 12, 5)
        ss = hsplit(x, 4)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.hsplit(np.arange(120).reshape(2, 12, 5), 4)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r, e) for r, e in zip(res, expected)]

        # vsplit
        x = arange(48, chunks=3).reshape(8, 3, 2)
        ss = vsplit(x, 4)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.vsplit(np.arange(48).reshape(8, 3, 2), 4)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r, e) for r, e in zip(res, expected)]

        # dsplit
        x = arange(48, chunks=3).reshape(2, 3, 8)
        ss = dsplit(x, 4)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.dsplit(np.arange(48).reshape(2, 3, 8), 4)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r, e) for r, e in zip(res, expected)]

        x_data = sps.random(12, 8, density=.1)
        x = tensor(x_data, chunks=3)
        ss = split(x, 4, axis=0)

        res = [self.executor.execute_tensor(i, concat=True)[0] for i in ss]
        expected = np.split(x_data.toarray(), 4, axis=0)
        self.assertEqual(len(res), len(expected))
        [np.testing.assert_equal(r.toarray(), e) for r, e in zip(res, expected)]

    def testRollExecution(self):
        x = arange(10, chunks=2)

        t = roll(x, 2)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.roll(np.arange(10), 2)
        np.testing.assert_equal(res, expected)

        x2 = x.reshape(2, 5)

        t = roll(x2, 1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.roll(np.arange(10).reshape(2, 5), 1)
        np.testing.assert_equal(res, expected)

        t = roll(x2, 1, axis=0)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.roll(np.arange(10).reshape(2, 5), 1, axis=0)
        np.testing.assert_equal(res, expected)

        t = roll(x2, 1, axis=1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.roll(np.arange(10).reshape(2, 5), 1, axis=1)
        np.testing.assert_equal(res, expected)

    def testSqueezeExecution(self):
        data = np.array([[[0], [1], [2]]])
        x = tensor(data, chunks=1)

        t = squeeze(x)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.squeeze(data)
        np.testing.assert_equal(res, expected)

        t = squeeze(x, axis=2)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.squeeze(data, axis=2)
        np.testing.assert_equal(res, expected)

    def testPtpExecution(self):
        x = arange(4, chunks=1).reshape(2, 2)

        t = ptp(x, axis=0)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.ptp(np.arange(4).reshape(2, 2), axis=0)
        np.testing.assert_equal(res, expected)

        t = ptp(x, axis=1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.ptp(np.arange(4).reshape(2, 2), axis=1)
        np.testing.assert_equal(res, expected)

        t = ptp(x)

        res = self.executor.execute_tensor(t)[0]
        expected = np.ptp(np.arange(4).reshape(2, 2))
        np.testing.assert_equal(res, expected)

    def testDiffExecution(self):
        data = np.array([1, 2, 4, 7, 0])
        x = tensor(data, chunks=2)

        t = diff(x)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.diff(data)
        np.testing.assert_equal(res, expected)

        t = diff(x, n=2)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.diff(data, n=2)
        np.testing.assert_equal(res, expected)

        data = np.array([[1, 3, 6, 10], [0, 5, 6, 8]])
        x = tensor(data, chunks=2)

        t = diff(x)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.diff(data)
        np.testing.assert_equal(res, expected)

        t = diff(x, axis=0)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.diff(data, axis=0)
        np.testing.assert_equal(res, expected)

        x = mt.arange('1066-10-13', '1066-10-16', dtype=mt.datetime64)
        t = diff(x)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.diff(np.arange('1066-10-13', '1066-10-16', dtype=np.datetime64))
        np.testing.assert_equal(res, expected)

    def testEdiff1d(self):
        data = np.array([1, 2, 4, 7, 0])
        x = tensor(data, chunks=2)

        t = ediff1d(x)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.ediff1d(data)
        np.testing.assert_equal(res, expected)

        to_begin = tensor(-99, chunks=2)
        to_end = tensor([88, 99], chunks=2)
        t = ediff1d(x, to_begin=to_begin, to_end=to_end)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.ediff1d(data, to_begin=-99, to_end=np.array([88, 99]))
        np.testing.assert_equal(res, expected)

        data = [[1, 2, 4], [1, 6, 24]]

        t = ediff1d(tensor(data, chunks=2))

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.ediff1d(data)
        np.testing.assert_equal(res, expected)

    def testDigitizeExecution(self):
        data = np.array([0.2, 6.4, 3.0, 1.6])
        x = tensor(data, chunks=2)
        bins = np.array([0.0, 1.0, 2.5, 4.0, 10.0])
        inds = digitize(x, bins)

        res = self.executor.execute_tensor(inds, concat=True)[0]
        expected = np.digitize(data, bins)
        np.testing.assert_equal(res, expected)

        b = tensor(bins, chunks=2)
        inds = digitize(x, b)

        res = self.executor.execute_tensor(inds, concat=True)[0]
        expected = np.digitize(data, bins)
        np.testing.assert_equal(res, expected)

        data = np.array([1.2, 10.0, 12.4, 15.5, 20.])
        x = tensor(data, chunks=2)
        bins = np.array([0, 5, 10, 15, 20])
        inds = digitize(x, bins, right=True)

        res = self.executor.execute_tensor(inds, concat=True)[0]
        expected = np.digitize(data, bins, right=True)
        np.testing.assert_equal(res, expected)

        inds = digitize(x, bins, right=False)

        res = self.executor.execute_tensor(inds, concat=True)[0]
        expected = np.digitize(data, bins, right=False)
        np.testing.assert_equal(res, expected)

        data = sps.random(10, 1, density=.1) * 12
        x = tensor(data, chunks=2)
        bins = np.array([1.0, 2.0, 2.5, 4.0, 10.0])
        inds = digitize(x, bins)

        res = self.executor.execute_tensor(inds, concat=True)[0]
        expected = np.digitize(data.toarray(), bins, right=False)
        np.testing.assert_equal(res.toarray(), expected)

    def testAverageExecution(self):
        data = arange(1, 5, chunks=1)
        t = average(data)

        res = self.executor.execute_tensor(t)[0]
        expected = np.average(np.arange(1, 5))
        self.assertEqual(res, expected)

        t = average(arange(1, 11, chunks=2), weights=arange(10, 0, -1, chunks=2))

        res = self.executor.execute_tensor(t)[0]
        expected = np.average(range(1, 11), weights=range(10, 0, -1))
        self.assertEqual(res, expected)

        data = arange(6, chunks=2).reshape((3, 2))
        t = average(data, axis=1, weights=tensor([1./4, 3./4], chunks=2))

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.average(np.arange(6).reshape(3, 2), axis=1, weights=(1./4, 3./4))
        np.testing.assert_equal(res, expected)

        with self.assertRaises(TypeError):
            average(data, weights=tensor([1./4, 3./4], chunks=2))

    def testCovExecution(self):
        data = np.array([[0, 2], [1, 1], [2, 0]]).T
        x = tensor(data, chunks=1)

        t = cov(x)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.cov(data)
        np.testing.assert_equal(res, expected)

        data_x = [-2.1, -1, 4.3]
        data_y = [3,  1.1,  0.12]
        x = tensor(data_x, chunks=1)
        y = tensor(data_y, chunks=1)

        X = stack((x, y), axis=0)
        t = cov(x, y)
        r = tall(t == cov(X))
        self.assertTrue(self.executor.execute_tensor(r)[0])

    def testCorrcoefExecution(self):
        data_x = [-2.1, -1, 4.3]
        data_y = [3, 1.1, 0.12]
        x = tensor(data_x, chunks=1)
        y = tensor(data_y, chunks=1)

        t = corrcoef(x, y)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.corrcoef(data_x, data_y)
        np.testing.assert_equal(res, expected)

    def testFlipExecution(self):
        a = arange(8, chunks=2).reshape((2, 2, 2))

        t = flip(a, 0)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.flip(np.arange(8).reshape(2, 2, 2), 0)
        np.testing.assert_equal(res, expected)

        t = flip(a, 1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.flip(np.arange(8).reshape(2, 2, 2), 1)
        np.testing.assert_equal(res, expected)

        t = flipud(a)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.flipud(np.arange(8).reshape(2, 2, 2))
        np.testing.assert_equal(res, expected)

        t = fliplr(a)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.fliplr(np.arange(8).reshape(2, 2, 2))
        np.testing.assert_equal(res, expected)

    def testRepeatExecution(self):
        a = repeat(3, 4)

        res = self.executor.execute_tensor(a)[0]
        expected = np.repeat(3, 4)
        np.testing.assert_equal(res, expected)

        x_data = np.random.randn(20, 30)
        x = tensor(x_data, chunks=(3, 4))

        t = repeat(x, 2)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.repeat(x_data, 2)
        np.testing.assert_equal(res, expected)

        t = repeat(x, 3, axis=1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.repeat(x_data, 3, axis=1)
        np.testing.assert_equal(res, expected)

        t = repeat(x, np.arange(20), axis=0)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.repeat(x_data, np.arange(20), axis=0)
        np.testing.assert_equal(res, expected)

        t = repeat(x, arange(20, chunks=5), axis=0)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.repeat(x_data, np.arange(20), axis=0)
        np.testing.assert_equal(res, expected)

        x_data = sps.random(20, 30, density=.1)
        x = tensor(x_data, chunks=(3, 4))

        t = repeat(x, 2, axis=1)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.repeat(x_data.toarray(), 2, axis=1)
        np.testing.assert_equal(res.toarray(), expected)

    def testTileExecution(self):
        a_data = np.array([0, 1, 2])
        a = tensor(a_data, chunks=2)

        t = tile(a, 2)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.tile(a_data, 2)
        np.testing.assert_equal(res, expected)

        t = tile(a, (2, 2))

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.tile(a_data, (2, 2))
        np.testing.assert_equal(res, expected)

        t = tile(a, (2, 1, 2))

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.tile(a_data, (2, 1, 2))
        np.testing.assert_equal(res, expected)

        b_data = np.array([[1, 2], [3, 4]])
        b = tensor(b_data, chunks=1)

        t = tile(b, 2)

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.tile(b_data, 2)
        np.testing.assert_equal(res, expected)

        t = tile(b, (2, 1))

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.tile(b_data, (2, 1))
        np.testing.assert_equal(res, expected)

        c_data = np.array([1, 2, 3, 4])
        c = tensor(c_data, chunks=3)

        t = tile(c, (4, 1))

        res = self.executor.execute_tensor(t, concat=True)[0]
        expected = np.tile(c_data, (4, 1))
        np.testing.assert_equal(res, expected)

    def testIsInExecution(self):
        element = 2 * arange(4, chunks=1).reshape((2, 2))
        test_elements = [1, 2, 4, 8]

        mask = isin(element, test_elements)

        res = self.executor.execute_tensor(mask, concat=True)[0]
        expected = np.isin(2 * np.arange(4).reshape((2, 2)), test_elements)
        np.testing.assert_equal(res, expected)

        res = self.executor.execute_tensor(element[mask], concat=True)[0]
        expected = np.array([2, 4])
        np.testing.assert_equal(res, expected)

        mask = isin(element, test_elements, invert=True)

        res = self.executor.execute_tensor(mask, concat=True)[0]
        expected = np.isin(2 * np.arange(4).reshape((2, 2)), test_elements, invert=True)
        np.testing.assert_equal(res, expected)

        res = self.executor.execute_tensor(element[mask], concat=True)[0]
        expected = np.array([0, 6])
        np.testing.assert_equal(res, expected)

        test_set = {1, 2, 4, 8}
        mask = isin(element, test_set)

        res = self.executor.execute_tensor(mask, concat=True)[0]
        expected = np.isin(2 * np.arange(4).reshape((2, 2)), test_set)
        np.testing.assert_equal(res, expected)

[((1394, 1411), 'mars.tensor.execution.core.Executor', 'Executor', (['"""numpy"""'], {}), "('numpy')\n", (1402, 1411), False, 'from mars.tensor.execution.core import Executor\n'), ((1463, 1488), 'numpy.random.random', 'np.random.random', (['(11, 8)'], {}), '((11, 8))\n', (1479, 1488), True, 'import numpy as np\n'), ((1503, 1524), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(3)'}), '(raw, chunks=3)\n', (1509, 1524), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((2022, 2044), 'mars.tensor.expressions.datasource.ones', 'ones', (['(2, 3)'], {'chunks': '(1)'}), '((2, 3), chunks=1)\n', (2026, 2044), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((2057, 2085), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['[3, -1, 3]'], {'chunks': '(2)'}), '([3, -1, 3], chunks=2)\n', (2063, 2085), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((2095, 2120), 'mars.tensor.expressions.base.copyto', 'copyto', (['a', 'b'], {'where': '(b > 1)'}), '(a, b, where=b > 1)\n', (2101, 2120), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((2203, 2235), 'numpy.array', 'np.array', (['[[3, 1, 3], [3, 1, 3]]'], {}), '([[3, 1, 3], [3, 1, 3]])\n', (2211, 2235), True, 'import numpy as np\n'), ((2245, 2283), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (2268, 2283), True, 'import numpy as np\n'), ((2334, 2359), 'numpy.random.random', 'np.random.random', (['(10, 5)'], {}), '((10, 5))\n', (2350, 2359), True, 'import numpy as np\n'), ((2374, 2395), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(3)'}), '(raw, chunks=3)\n', (2380, 2395), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((2572, 2602), 'scipy.sparse.random', 'sps.random', (['(10)', '(5)'], {'density': '(0.2)'}), '(10, 5, density=0.2)\n', (2582, 2602), True, 'import scipy.sparse as sps\n'), ((2616, 2637), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(3)'}), '(raw, chunks=3)\n', (2622, 2637), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((2872, 2900), 'numpy.random.random', 'np.random.random', (['(11, 8, 5)'], {}), '((11, 8, 5))\n', (2888, 2900), True, 'import numpy as np\n'), ((2915, 2936), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(3)'}), '(raw, chunks=3)\n', (2921, 2936), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((2952, 2966), 'mars.tensor.expressions.base.transpose', 'transpose', (['arr'], {}), '(arr)\n', (2961, 2966), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((3102, 3135), 'mars.tensor.expressions.base.transpose', 'transpose', (['arr'], {'axes': '(-2, -1, -3)'}), '(arr, axes=(-2, -1, -3))\n', (3111, 3135), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((3287, 3304), 'scipy.sparse.random', 'sps.random', (['(11)', '(8)'], {}), '(11, 8)\n', (3297, 3304), True, 'import scipy.sparse as sps\n'), ((3319, 3340), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(3)'}), '(raw, chunks=3)\n', (3325, 3340), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((3356, 3370), 'mars.tensor.expressions.base.transpose', 'transpose', (['arr'], {}), '(arr)\n', (3365, 3370), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((3604, 3632), 'numpy.random.random', 'np.random.random', (['(11, 8, 5)'], {}), '((11, 8, 5))\n', (3620, 3632), True, 'import numpy as np\n'), ((3647, 3668), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(3)'}), '(raw, chunks=3)\n', (3653, 3668), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((3850, 3880), 'scipy.sparse.random', 'sps.random', (['(11)', '(8)'], {'density': '(0.2)'}), '(11, 8, density=0.2)\n', (3860, 3880), True, 'import scipy.sparse as sps\n'), ((3894, 3915), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(3)'}), '(raw, chunks=3)\n', (3900, 3915), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((4152, 4178), 'mars.tensor.expressions.datasource.zeros', 'zeros', (['(3, 4, 5)'], {'chunks': '(2)'}), '((3, 4, 5), chunks=2)\n', (4157, 4178), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((4192, 4210), 'mars.tensor.expressions.base.moveaxis', 'moveaxis', (['x', '(0)', '(-1)'], {}), '(x, 0, -1)\n', (4200, 4210), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((4334, 4352), 'mars.tensor.expressions.base.moveaxis', 'moveaxis', (['x', '(-1)', '(0)'], {}), '(x, -1, 0)\n', (4342, 4352), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((4476, 4505), 'mars.tensor.expressions.base.moveaxis', 'moveaxis', (['x', '[0, 1]', '[-1, -2]'], {}), '(x, [0, 1], [-1, -2])\n', (4484, 4505), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((4629, 4665), 'mars.tensor.expressions.base.moveaxis', 'moveaxis', (['x', '[0, 1, 2]', '[-1, -2, -3]'], {}), '(x, [0, 1, 2], [-1, -2, -3])\n', (4637, 4665), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((4831, 4859), 'numpy.random.random', 'np.random.random', (['(10, 5, 1)'], {}), '((10, 5, 1))\n', (4847, 4859), True, 'import numpy as np\n'), ((4874, 4895), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw'], {'chunks': '(2)'}), '(raw, chunks=2)\n', (4880, 4895), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((4911, 4943), 'mars.tensor.expressions.base.broadcast_to', 'broadcast_to', (['arr', '(5, 10, 5, 6)'], {}), '(arr, (5, 10, 5, 6))\n', (4923, 4943), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((5180, 5204), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['x_data'], {'chunks': '(1)'}), '(x_data, chunks=1)\n', (5186, 5204), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((5250, 5274), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['y_data'], {'chunks': '(2)'}), '(y_data, chunks=2)\n', (5256, 5274), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((5288, 5310), 'mars.tensor.expressions.base.broadcast_arrays', 'broadcast_arrays', (['x', 'y'], {}), '(x, y)\n', (5304, 5310), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((5410, 5445), 'numpy.broadcast_arrays', 'np.broadcast_arrays', (['x_data', 'y_data'], {}), '(x_data, y_data)\n', (5429, 5445), True, 'import numpy as np\n'), ((5583, 5630), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)'], {'size': '(4, 4)', 'dtype': '"""?"""'}), "(0, 2, size=(4, 4), dtype='?')\n", (5600, 5630), True, 'import numpy as np\n'), ((5647, 5667), 'numpy.random.rand', 'np.random.rand', (['(4)', '(1)'], {}), '(4, 1)\n', (5661, 5667), True, 'import numpy as np\n'), ((5684, 5704), 'numpy.random.rand', 'np.random.rand', (['(4)', '(4)'], {}), '(4, 4)\n', (5698, 5704), True, 'import numpy as np\n'), ((5819, 5836), 'mars.tensor.expressions.base.where', 'where', (['cond', 'x', 'y'], {}), '(cond, x, y)\n', (5824, 5836), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((6080, 6109), 'scipy.sparse.random', 'sps.random', (['(4)', '(1)'], {'density': '(0.1)'}), '(4, 1, density=0.1)\n', (6090, 6109), True, 'import scipy.sparse as sps\n'), ((6125, 6154), 'scipy.sparse.random', 'sps.random', (['(4)', '(4)'], {'density': '(0.1)'}), '(4, 4, density=0.1)\n', (6135, 6154), True, 'import scipy.sparse as sps\n'), ((6268, 6285), 'mars.tensor.expressions.base.where', 'where', (['cond', 'x', 'y'], {}), '(cond, x, y)\n', (6273, 6285), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((6564, 6590), 'numpy.random.rand', 'np.random.rand', (['(10)', '(20)', '(30)'], {}), '(10, 20, 30)\n', (6578, 6590), True, 'import numpy as np\n'), ((6603, 6629), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_data'], {'chunks': '(6)'}), '(raw_data, chunks=6)\n', (6609, 6629), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((7292, 7319), 'numpy.random.rand', 'np.random.rand', (['(30)', '(100)', '(20)'], {}), '(30, 100, 20)\n', (7306, 7319), True, 'import numpy as np\n'), ((7332, 7358), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_data'], {'chunks': '(6)'}), '(raw_data, chunks=6)\n', (7338, 7358), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((7953, 7979), 'numpy.random.rand', 'np.random.rand', (['(10)', '(20)', '(30)'], {}), '(10, 20, 30)\n', (7967, 7979), True, 'import numpy as np\n'), ((7992, 8018), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_data'], {'chunks': '(6)'}), '(raw_data, chunks=6)\n', (7998, 8018), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((8032, 8049), 'mars.tensor.expressions.base.expand_dims', 'expand_dims', (['x', '(1)'], {}), '(x, 1)\n', (8043, 8049), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((8200, 8217), 'mars.tensor.expressions.base.expand_dims', 'expand_dims', (['x', '(0)'], {}), '(x, 0)\n', (8211, 8217), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((8368, 8385), 'mars.tensor.expressions.base.expand_dims', 'expand_dims', (['x', '(3)'], {}), '(x, 3)\n', (8379, 8385), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((8536, 8554), 'mars.tensor.expressions.base.expand_dims', 'expand_dims', (['x', '(-1)'], {}), '(x, -1)\n', (8547, 8554), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((8706, 8724), 'mars.tensor.expressions.base.expand_dims', 'expand_dims', (['x', '(-4)'], {}), '(x, -4)\n', (8717, 8724), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((9068, 9096), 'mars.tensor.expressions.datasource.ones', 'ones', (['(3, 4, 5, 6)'], {'chunks': '(1)'}), '((3, 4, 5, 6), chunks=1)\n', (9072, 9096), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((9109, 9126), 'mars.tensor.expressions.base.rollaxis', 'rollaxis', (['x', '(3)', '(1)'], {}), '(x, 3, 1)\n', (9117, 9126), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((9342, 9359), 'mars.tensor.expressions.datasource.ones', 'ones', (['(3)'], {'chunks': '(2)'}), '(3, chunks=2)\n', (9346, 9359), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((9372, 9394), 'mars.tensor.expressions.datasource.ones', 'ones', (['(3, 4)'], {'chunks': '(2)'}), '((3, 4), chunks=2)\n', (9376, 9394), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((9408, 9427), 'mars.tensor.expressions.base.atleast_1d', 'atleast_1d', (['x', 'y', 'z'], {}), '(x, y, z)\n', (9418, 9427), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((9758, 9775), 'mars.tensor.expressions.datasource.ones', 'ones', (['(3)'], {'chunks': '(2)'}), '(3, chunks=2)\n', (9762, 9775), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((9788, 9810), 'mars.tensor.expressions.datasource.ones', 'ones', (['(3, 4)'], {'chunks': '(2)'}), '((3, 4), chunks=2)\n', (9792, 9810), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((9824, 9843), 'mars.tensor.expressions.base.atleast_2d', 'atleast_2d', (['x', 'y', 'z'], {}), '(x, y, z)\n', (9834, 9843), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((10191, 10208), 'mars.tensor.expressions.datasource.ones', 'ones', (['(3)'], {'chunks': '(2)'}), '(3, chunks=2)\n', (10195, 10208), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((10221, 10243), 'mars.tensor.expressions.datasource.ones', 'ones', (['(3, 4)'], {'chunks': '(2)'}), '((3, 4), chunks=2)\n', (10225, 10243), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((10257, 10276), 'mars.tensor.expressions.base.atleast_3d', 'atleast_3d', (['x', 'y', 'z'], {}), '(x, y, z)\n', (10267, 10276), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((10671, 10686), 'mars.tensor.expressions.base.argwhere', 'argwhere', (['(x > 1)'], {}), '(x > 1)\n', (10679, 10686), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((10972, 10997), 'mars.tensor.expressions.base.array_split', 'array_split', (['x', '(3)'], {'axis': '(2)'}), '(x, 3, axis=2)\n', (10983, 10997), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((11287, 11324), 'mars.tensor.expressions.base.array_split', 'array_split', (['x', '[3, 5, 6, 10]'], {'axis': '(2)'}), '(x, [3, 5, 6, 10], axis=2)\n', (11298, 11324), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((11710, 11729), 'mars.tensor.expressions.base.split', 'split', (['x', '(4)'], {'axis': '(2)'}), '(x, 4, axis=2)\n', (11715, 11729), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((12013, 12044), 'mars.tensor.expressions.base.split', 'split', (['x', '[3, 5, 6, 10]'], {'axis': '(2)'}), '(x, [3, 5, 6, 10], axis=2)\n', (12018, 12044), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((12409, 12421), 'mars.tensor.expressions.base.hsplit', 'hsplit', (['x', '(4)'], {}), '(x, 4)\n', (12415, 12421), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((12767, 12779), 'mars.tensor.expressions.base.vsplit', 'vsplit', (['x', '(4)'], {}), '(x, 4)\n', (12773, 12779), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((13123, 13135), 'mars.tensor.expressions.base.dsplit', 'dsplit', (['x', '(4)'], {}), '(x, 4)\n', (13129, 13135), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((13416, 13446), 'scipy.sparse.random', 'sps.random', (['(12)', '(8)'], {'density': '(0.1)'}), '(12, 8, density=0.1)\n', (13426, 13446), True, 'import scipy.sparse as sps\n'), ((13458, 13482), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['x_data'], {'chunks': '(3)'}), '(x_data, chunks=3)\n', (13464, 13482), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((13496, 13515), 'mars.tensor.expressions.base.split', 'split', (['x', '(4)'], {'axis': '(0)'}), '(x, 4, axis=0)\n', (13501, 13515), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((13827, 13847), 'mars.tensor.expressions.datasource.arange', 'arange', (['(10)'], {'chunks': '(2)'}), '(10, chunks=2)\n', (13833, 13847), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((13861, 13871), 'mars.tensor.expressions.base.roll', 'roll', (['x', '(2)'], {}), '(x, 2)\n', (13865, 13871), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((13988, 14026), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (14011, 14026), True, 'import numpy as np\n'), ((14070, 14081), 'mars.tensor.expressions.base.roll', 'roll', (['x2', '(1)'], {}), '(x2, 1)\n', (14074, 14081), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((14212, 14250), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (14235, 14250), True, 'import numpy as np\n'), ((14264, 14283), 'mars.tensor.expressions.base.roll', 'roll', (['x2', '(1)'], {'axis': '(0)'}), '(x2, 1, axis=0)\n', (14268, 14283), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((14422, 14460), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (14445, 14460), True, 'import numpy as np\n'), ((14474, 14493), 'mars.tensor.expressions.base.roll', 'roll', (['x2', '(1)'], {'axis': '(1)'}), '(x2, 1, axis=1)\n', (14478, 14493), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((14632, 14670), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (14655, 14670), True, 'import numpy as np\n'), ((14723, 14750), 'numpy.array', 'np.array', (['[[[0], [1], [2]]]'], {}), '([[[0], [1], [2]]])\n', (14731, 14750), True, 'import numpy as np\n'), ((14763, 14785), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(1)'}), '(data, chunks=1)\n', (14769, 14785), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((14799, 14809), 'mars.tensor.expressions.base.squeeze', 'squeeze', (['x'], {}), '(x)\n', (14806, 14809), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((14892, 14908), 'numpy.squeeze', 'np.squeeze', (['data'], {}), '(data)\n', (14902, 14908), True, 'import numpy as np\n'), ((14917, 14955), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (14940, 14955), True, 'import numpy as np\n'), ((14969, 14987), 'mars.tensor.expressions.base.squeeze', 'squeeze', (['x'], {'axis': '(2)'}), '(x, axis=2)\n', (14976, 14987), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((15070, 15094), 'numpy.squeeze', 'np.squeeze', (['data'], {'axis': '(2)'}), '(data, axis=2)\n', (15080, 15094), True, 'import numpy as np\n'), ((15103, 15141), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (15126, 15141), True, 'import numpy as np\n'), ((15234, 15248), 'mars.tensor.expressions.base.ptp', 'ptp', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (15237, 15248), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((15382, 15420), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (15405, 15420), True, 'import numpy as np\n'), ((15434, 15448), 'mars.tensor.expressions.base.ptp', 'ptp', (['x'], {'axis': '(1)'}), '(x, axis=1)\n', (15437, 15448), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((15582, 15620), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (15605, 15620), True, 'import numpy as np\n'), ((15634, 15640), 'mars.tensor.expressions.base.ptp', 'ptp', (['x'], {}), '(x)\n', (15637, 15640), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((15753, 15791), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (15776, 15791), True, 'import numpy as np\n'), ((15841, 15866), 'numpy.array', 'np.array', (['[1, 2, 4, 7, 0]'], {}), '([1, 2, 4, 7, 0])\n', (15849, 15866), True, 'import numpy as np\n'), ((15879, 15901), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(2)'}), '(data, chunks=2)\n', (15885, 15901), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((15915, 15922), 'mars.tensor.expressions.base.diff', 'diff', (['x'], {}), '(x)\n', (15919, 15922), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((16005, 16018), 'numpy.diff', 'np.diff', (['data'], {}), '(data)\n', (16012, 16018), True, 'import numpy as np\n'), ((16027, 16065), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (16050, 16065), True, 'import numpy as np\n'), ((16079, 16091), 'mars.tensor.expressions.base.diff', 'diff', (['x'], {'n': '(2)'}), '(x, n=2)\n', (16083, 16091), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((16174, 16192), 'numpy.diff', 'np.diff', (['data'], {'n': '(2)'}), '(data, n=2)\n', (16181, 16192), True, 'import numpy as np\n'), ((16201, 16239), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (16224, 16239), True, 'import numpy as np\n'), ((16256, 16295), 'numpy.array', 'np.array', (['[[1, 3, 6, 10], [0, 5, 6, 8]]'], {}), '([[1, 3, 6, 10], [0, 5, 6, 8]])\n', (16264, 16295), True, 'import numpy as np\n'), ((16308, 16330), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(2)'}), '(data, chunks=2)\n', (16314, 16330), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((16344, 16351), 'mars.tensor.expressions.base.diff', 'diff', (['x'], {}), '(x)\n', (16348, 16351), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((16434, 16447), 'numpy.diff', 'np.diff', (['data'], {}), '(data)\n', (16441, 16447), True, 'import numpy as np\n'), ((16456, 16494), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (16479, 16494), True, 'import numpy as np\n'), ((16508, 16523), 'mars.tensor.expressions.base.diff', 'diff', (['x'], {'axis': '(0)'}), '(x, axis=0)\n', (16512, 16523), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((16606, 16627), 'numpy.diff', 'np.diff', (['data'], {'axis': '(0)'}), '(data, axis=0)\n', (16613, 16627), True, 'import numpy as np\n'), ((16636, 16674), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (16659, 16674), True, 'import numpy as np\n'), ((16688, 16746), 'mars.tensor.arange', 'mt.arange', (['"""1066-10-13"""', '"""1066-10-16"""'], {'dtype': 'mt.datetime64'}), "('1066-10-13', '1066-10-16', dtype=mt.datetime64)\n", (16697, 16746), True, 'from mars import tensor as mt\n'), ((16759, 16766), 'mars.tensor.expressions.base.diff', 'diff', (['x'], {}), '(x)\n', (16763, 16766), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((16925, 16963), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (16948, 16963), True, 'import numpy as np\n'), ((17007, 17032), 'numpy.array', 'np.array', (['[1, 2, 4, 7, 0]'], {}), '([1, 2, 4, 7, 0])\n', (17015, 17032), True, 'import numpy as np\n'), ((17045, 17067), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(2)'}), '(data, chunks=2)\n', (17051, 17067), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((17081, 17091), 'mars.tensor.expressions.base.ediff1d', 'ediff1d', (['x'], {}), '(x)\n', (17088, 17091), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((17174, 17190), 'numpy.ediff1d', 'np.ediff1d', (['data'], {}), '(data)\n', (17184, 17190), True, 'import numpy as np\n'), ((17199, 17237), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (17222, 17237), True, 'import numpy as np\n'), ((17258, 17279), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['(-99)'], {'chunks': '(2)'}), '(-99, chunks=2)\n', (17264, 17279), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((17297, 17323), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['[88, 99]'], {'chunks': '(2)'}), '([88, 99], chunks=2)\n', (17303, 17323), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((17336, 17380), 'mars.tensor.expressions.base.ediff1d', 'ediff1d', (['x'], {'to_begin': 'to_begin', 'to_end': 'to_end'}), '(x, to_begin=to_begin, to_end=to_end)\n', (17343, 17380), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((17529, 17567), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (17552, 17567), True, 'import numpy as np\n'), ((17735, 17751), 'numpy.ediff1d', 'np.ediff1d', (['data'], {}), '(data)\n', (17745, 17751), True, 'import numpy as np\n'), ((17760, 17798), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (17783, 17798), True, 'import numpy as np\n'), ((17852, 17882), 'numpy.array', 'np.array', (['[0.2, 6.4, 3.0, 1.6]'], {}), '([0.2, 6.4, 3.0, 1.6])\n', (17860, 17882), True, 'import numpy as np\n'), ((17895, 17917), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(2)'}), '(data, chunks=2)\n', (17901, 17917), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((17933, 17969), 'numpy.array', 'np.array', (['[0.0, 1.0, 2.5, 4.0, 10.0]'], {}), '([0.0, 1.0, 2.5, 4.0, 10.0])\n', (17941, 17969), True, 'import numpy as np\n'), ((17985, 18002), 'mars.tensor.expressions.base.digitize', 'digitize', (['x', 'bins'], {}), '(x, bins)\n', (17993, 18002), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((18088, 18111), 'numpy.digitize', 'np.digitize', (['data', 'bins'], {}), '(data, bins)\n', (18099, 18111), True, 'import numpy as np\n'), ((18120, 18158), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (18143, 18158), True, 'import numpy as np\n'), ((18172, 18194), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['bins'], {'chunks': '(2)'}), '(bins, chunks=2)\n', (18178, 18194), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((18210, 18224), 'mars.tensor.expressions.base.digitize', 'digitize', (['x', 'b'], {}), '(x, b)\n', (18218, 18224), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((18310, 18333), 'numpy.digitize', 'np.digitize', (['data', 'bins'], {}), '(data, bins)\n', (18321, 18333), True, 'import numpy as np\n'), ((18342, 18380), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (18365, 18380), True, 'import numpy as np\n'), ((18397, 18436), 'numpy.array', 'np.array', (['[1.2, 10.0, 12.4, 15.5, 20.0]'], {}), '([1.2, 10.0, 12.4, 15.5, 20.0])\n', (18405, 18436), True, 'import numpy as np\n'), ((18448, 18470), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(2)'}), '(data, chunks=2)\n', (18454, 18470), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((18486, 18514), 'numpy.array', 'np.array', (['[0, 5, 10, 15, 20]'], {}), '([0, 5, 10, 15, 20])\n', (18494, 18514), True, 'import numpy as np\n'), ((18530, 18559), 'mars.tensor.expressions.base.digitize', 'digitize', (['x', 'bins'], {'right': '(True)'}), '(x, bins, right=True)\n', (18538, 18559), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((18645, 18680), 'numpy.digitize', 'np.digitize', (['data', 'bins'], {'right': '(True)'}), '(data, bins, right=True)\n', (18656, 18680), True, 'import numpy as np\n'), ((18689, 18727), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (18712, 18727), True, 'import numpy as np\n'), ((18744, 18774), 'mars.tensor.expressions.base.digitize', 'digitize', (['x', 'bins'], {'right': '(False)'}), '(x, bins, right=False)\n', (18752, 18774), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((18860, 18896), 'numpy.digitize', 'np.digitize', (['data', 'bins'], {'right': '(False)'}), '(data, bins, right=False)\n', (18871, 18896), True, 'import numpy as np\n'), ((18905, 18943), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (18928, 18943), True, 'import numpy as np\n'), ((19007, 19029), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(2)'}), '(data, chunks=2)\n', (19013, 19029), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((19045, 19081), 'numpy.array', 'np.array', (['[1.0, 2.0, 2.5, 4.0, 10.0]'], {}), '([1.0, 2.0, 2.5, 4.0, 10.0])\n', (19053, 19081), True, 'import numpy as np\n'), ((19097, 19114), 'mars.tensor.expressions.base.digitize', 'digitize', (['x', 'bins'], {}), '(x, bins)\n', (19105, 19114), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((19356, 19378), 'mars.tensor.expressions.datasource.arange', 'arange', (['(1)', '(5)'], {'chunks': '(1)'}), '(1, 5, chunks=1)\n', (19362, 19378), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((19391, 19404), 'mars.tensor.expressions.base.average', 'average', (['data'], {}), '(data)\n', (19398, 19404), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((20070, 20108), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (20093, 20108), True, 'import numpy as np\n'), ((20316, 20338), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(1)'}), '(data, chunks=1)\n', (20322, 20338), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((20352, 20358), 'mars.tensor.expressions.base.cov', 'cov', (['x'], {}), '(x)\n', (20355, 20358), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((20441, 20453), 'numpy.cov', 'np.cov', (['data'], {}), '(data)\n', (20447, 20453), True, 'import numpy as np\n'), ((20462, 20500), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (20485, 20500), True, 'import numpy as np\n'), ((20581, 20605), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data_x'], {'chunks': '(1)'}), '(data_x, chunks=1)\n', (20587, 20605), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((20618, 20642), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data_y'], {'chunks': '(1)'}), '(data_y, chunks=1)\n', (20624, 20642), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((20656, 20677), 'mars.tensor.expressions.merge.stack', 'stack', (['(x, y)'], {'axis': '(0)'}), '((x, y), axis=0)\n', (20661, 20677), False, 'from mars.tensor.expressions.merge import stack\n'), ((20690, 20699), 'mars.tensor.expressions.base.cov', 'cov', (['x', 'y'], {}), '(x, y)\n', (20693, 20699), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((20905, 20929), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data_x'], {'chunks': '(1)'}), '(data_x, chunks=1)\n', (20911, 20929), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((20942, 20966), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data_y'], {'chunks': '(1)'}), '(data_y, chunks=1)\n', (20948, 20966), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((20980, 20994), 'mars.tensor.expressions.base.corrcoef', 'corrcoef', (['x', 'y'], {}), '(x, y)\n', (20988, 20994), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((21077, 21104), 'numpy.corrcoef', 'np.corrcoef', (['data_x', 'data_y'], {}), '(data_x, data_y)\n', (21088, 21104), True, 'import numpy as np\n'), ((21113, 21151), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (21136, 21151), True, 'import numpy as np\n'), ((21250, 21260), 'mars.tensor.expressions.base.flip', 'flip', (['a', '(0)'], {}), '(a, 0)\n', (21254, 21260), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((21393, 21431), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (21416, 21431), True, 'import numpy as np\n'), ((21445, 21455), 'mars.tensor.expressions.base.flip', 'flip', (['a', '(1)'], {}), '(a, 1)\n', (21449, 21455), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((21588, 21626), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (21611, 21626), True, 'import numpy as np\n'), ((21640, 21649), 'mars.tensor.expressions.base.flipud', 'flipud', (['a'], {}), '(a)\n', (21646, 21649), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((21781, 21819), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (21804, 21819), True, 'import numpy as np\n'), ((21833, 21842), 'mars.tensor.expressions.base.fliplr', 'fliplr', (['a'], {}), '(a)\n', (21839, 21842), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((21974, 22012), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (21997, 22012), True, 'import numpy as np\n'), ((22061, 22073), 'mars.tensor.expressions.base.repeat', 'repeat', (['(3)', '(4)'], {}), '(3, 4)\n', (22067, 22073), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((22143, 22158), 'numpy.repeat', 'np.repeat', (['(3)', '(4)'], {}), '(3, 4)\n', (22152, 22158), True, 'import numpy as np\n'), ((22167, 22205), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (22190, 22205), True, 'import numpy as np\n'), ((22224, 22247), 'numpy.random.randn', 'np.random.randn', (['(20)', '(30)'], {}), '(20, 30)\n', (22239, 22247), True, 'import numpy as np\n'), ((22260, 22289), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['x_data'], {'chunks': '(3, 4)'}), '(x_data, chunks=(3, 4))\n', (22266, 22289), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((22303, 22315), 'mars.tensor.expressions.base.repeat', 'repeat', (['x', '(2)'], {}), '(x, 2)\n', (22309, 22315), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((22398, 22418), 'numpy.repeat', 'np.repeat', (['x_data', '(2)'], {}), '(x_data, 2)\n', (22407, 22418), True, 'import numpy as np\n'), ((22427, 22465), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (22450, 22465), True, 'import numpy as np\n'), ((22479, 22499), 'mars.tensor.expressions.base.repeat', 'repeat', (['x', '(3)'], {'axis': '(1)'}), '(x, 3, axis=1)\n', (22485, 22499), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((22582, 22610), 'numpy.repeat', 'np.repeat', (['x_data', '(3)'], {'axis': '(1)'}), '(x_data, 3, axis=1)\n', (22591, 22610), True, 'import numpy as np\n'), ((22619, 22657), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (22642, 22657), True, 'import numpy as np\n'), ((22835, 22873), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (22858, 22873), True, 'import numpy as np\n'), ((23058, 23096), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (23081, 23096), True, 'import numpy as np\n'), ((23115, 23146), 'scipy.sparse.random', 'sps.random', (['(20)', '(30)'], {'density': '(0.1)'}), '(20, 30, density=0.1)\n', (23125, 23146), True, 'import scipy.sparse as sps\n'), ((23158, 23187), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['x_data'], {'chunks': '(3, 4)'}), '(x_data, chunks=(3, 4))\n', (23164, 23187), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((23201, 23221), 'mars.tensor.expressions.base.repeat', 'repeat', (['x', '(2)'], {'axis': '(1)'}), '(x, 2, axis=1)\n', (23207, 23221), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((23451, 23470), 'numpy.array', 'np.array', (['[0, 1, 2]'], {}), '([0, 1, 2])\n', (23459, 23470), True, 'import numpy as np\n'), ((23483, 23507), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['a_data'], {'chunks': '(2)'}), '(a_data, chunks=2)\n', (23489, 23507), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((23521, 23531), 'mars.tensor.expressions.base.tile', 'tile', (['a', '(2)'], {}), '(a, 2)\n', (23525, 23531), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((23614, 23632), 'numpy.tile', 'np.tile', (['a_data', '(2)'], {}), '(a_data, 2)\n', (23621, 23632), True, 'import numpy as np\n'), ((23641, 23679), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (23664, 23679), True, 'import numpy as np\n'), ((23693, 23708), 'mars.tensor.expressions.base.tile', 'tile', (['a', '(2, 2)'], {}), '(a, (2, 2))\n', (23697, 23708), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((23791, 23814), 'numpy.tile', 'np.tile', (['a_data', '(2, 2)'], {}), '(a_data, (2, 2))\n', (23798, 23814), True, 'import numpy as np\n'), ((23823, 23861), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (23846, 23861), True, 'import numpy as np\n'), ((23875, 23893), 'mars.tensor.expressions.base.tile', 'tile', (['a', '(2, 1, 2)'], {}), '(a, (2, 1, 2))\n', (23879, 23893), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((23976, 24002), 'numpy.tile', 'np.tile', (['a_data', '(2, 1, 2)'], {}), '(a_data, (2, 1, 2))\n', (23983, 24002), True, 'import numpy as np\n'), ((24011, 24049), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (24034, 24049), True, 'import numpy as np\n'), ((24068, 24094), 'numpy.array', 'np.array', (['[[1, 2], [3, 4]]'], {}), '([[1, 2], [3, 4]])\n', (24076, 24094), True, 'import numpy as np\n'), ((24107, 24131), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['b_data'], {'chunks': '(1)'}), '(b_data, chunks=1)\n', (24113, 24131), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((24145, 24155), 'mars.tensor.expressions.base.tile', 'tile', (['b', '(2)'], {}), '(b, 2)\n', (24149, 24155), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((24238, 24256), 'numpy.tile', 'np.tile', (['b_data', '(2)'], {}), '(b_data, 2)\n', (24245, 24256), True, 'import numpy as np\n'), ((24265, 24303), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (24288, 24303), True, 'import numpy as np\n'), ((24317, 24332), 'mars.tensor.expressions.base.tile', 'tile', (['b', '(2, 1)'], {}), '(b, (2, 1))\n', (24321, 24332), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((24415, 24438), 'numpy.tile', 'np.tile', (['b_data', '(2, 1)'], {}), '(b_data, (2, 1))\n', (24422, 24438), True, 'import numpy as np\n'), ((24447, 24485), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (24470, 24485), True, 'import numpy as np\n'), ((24504, 24526), 'numpy.array', 'np.array', (['[1, 2, 3, 4]'], {}), '([1, 2, 3, 4])\n', (24512, 24526), True, 'import numpy as np\n'), ((24539, 24563), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['c_data'], {'chunks': '(3)'}), '(c_data, chunks=3)\n', (24545, 24563), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((24577, 24592), 'mars.tensor.expressions.base.tile', 'tile', (['c', '(4, 1)'], {}), '(c, (4, 1))\n', (24581, 24592), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((24675, 24698), 'numpy.tile', 'np.tile', (['c_data', '(4, 1)'], {}), '(c_data, (4, 1))\n', (24682, 24698), True, 'import numpy as np\n'), ((24707, 24745), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (24730, 24745), True, 'import numpy as np\n'), ((24891, 24919), 'mars.tensor.expressions.base.isin', 'isin', (['element', 'test_elements'], {}), '(element, test_elements)\n', (24895, 24919), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((25070, 25108), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (25093, 25108), True, 'import numpy as np\n'), ((25203, 25219), 'numpy.array', 'np.array', (['[2, 4]'], {}), '([2, 4])\n', (25211, 25219), True, 'import numpy as np\n'), ((25228, 25266), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (25251, 25266), True, 'import numpy as np\n'), ((25283, 25324), 'mars.tensor.expressions.base.isin', 'isin', (['element', 'test_elements'], {'invert': '(True)'}), '(element, test_elements, invert=True)\n', (25287, 25324), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((25488, 25526), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (25511, 25526), True, 'import numpy as np\n'), ((25621, 25637), 'numpy.array', 'np.array', (['[0, 6]'], {}), '([0, 6])\n', (25629, 25637), True, 'import numpy as np\n'), ((25646, 25684), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (25669, 25684), True, 'import numpy as np\n'), ((25733, 25756), 'mars.tensor.expressions.base.isin', 'isin', (['element', 'test_set'], {}), '(element, test_set)\n', (25737, 25756), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((25902, 25940), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['res', 'expected'], {}), '(res, expected)\n', (25925, 25940), True, 'import numpy as np\n'), ((1630, 1665), 'numpy.array_equal', 'np.array_equal', (['res[0]', 'raw[:4, :4]'], {}), '(res[0], raw[:4, :4])\n', (1644, 1665), True, 'import numpy as np\n'), ((1691, 1726), 'numpy.array_equal', 'np.array_equal', (['res[1]', 'raw[:4, 4:]'], {}), '(res[1], raw[:4, 4:])\n', (1705, 1726), True, 'import numpy as np\n'), ((1752, 1788), 'numpy.array_equal', 'np.array_equal', (['res[2]', 'raw[4:8, :4]'], {}), '(res[2], raw[4:8, :4])\n', (1766, 1788), True, 'import numpy as np\n'), ((1814, 1850), 'numpy.array_equal', 'np.array_equal', (['res[3]', 'raw[4:8, 4:]'], {}), '(res[3], raw[4:8, 4:])\n', (1828, 1850), True, 'import numpy as np\n'), ((1876, 1911), 'numpy.array_equal', 'np.array_equal', (['res[4]', 'raw[8:, :4]'], {}), '(res[4], raw[8:, :4])\n', (1890, 1911), True, 'import numpy as np\n'), ((1937, 1972), 'numpy.array_equal', 'np.array_equal', (['res[5]', 'raw[8:, 4:]'], {}), '(res[5], raw[8:, 4:])\n', (1951, 1972), True, 'import numpy as np\n'), ((3055, 3084), 'numpy.array_equal', 'np.array_equal', (['res[0]', 'raw.T'], {}), '(res[0], raw.T)\n', (3069, 3084), True, 'import numpy as np\n'), ((5499, 5528), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (5522, 5528), True, 'import numpy as np\n'), ((5727, 5753), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_cond'], {'chunks': '(2)'}), '(raw_cond, chunks=2)\n', (5733, 5753), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((5755, 5778), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_x'], {'chunks': '(2)'}), '(raw_x, chunks=2)\n', (5761, 5778), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((5780, 5803), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_y'], {'chunks': '(2)'}), '(raw_y, chunks=2)\n', (5786, 5803), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((6015, 6062), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)'], {'size': '(4, 4)', 'dtype': '"""?"""'}), "(0, 2, size=(4, 4), dtype='?')\n", (6032, 6062), True, 'import numpy as np\n'), ((6176, 6202), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_cond'], {'chunks': '(2)'}), '(raw_cond, chunks=2)\n', (6182, 6202), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((6204, 6227), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_x'], {'chunks': '(2)'}), '(raw_x, chunks=2)\n', (6210, 6227), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((6229, 6252), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['raw_y'], {'chunks': '(2)'}), '(raw_y, chunks=2)\n', (6235, 6252), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((8922, 8940), 'mars.tensor.expressions.base.expand_dims', 'expand_dims', (['x', '(-5)'], {}), '(x, -5)\n', (8933, 8940), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((9000, 9017), 'mars.tensor.expressions.base.expand_dims', 'expand_dims', (['x', '(4)'], {}), '(x, 4)\n', (9011, 9017), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((10838, 10867), 'numpy.array_equal', 'np.array_equal', (['res', 'expected'], {}), '(res, expected)\n', (10852, 10867), True, 'import numpy as np\n'), ((11211, 11240), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (11234, 11240), True, 'import numpy as np\n'), ((11550, 11579), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (11573, 11579), True, 'import numpy as np\n'), ((11937, 11966), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (11960, 11966), True, 'import numpy as np\n'), ((12264, 12293), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (12287, 12293), True, 'import numpy as np\n'), ((12624, 12653), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (12647, 12653), True, 'import numpy as np\n'), ((12980, 13009), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (13003, 13009), True, 'import numpy as np\n'), ((13336, 13365), 'numpy.testing.assert_equal', 'np.testing.assert_equal', (['r', 'e'], {}), '(r, e)\n', (13359, 13365), True, 'import numpy as np\n'), ((13962, 13975), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (13971, 13975), True, 'import numpy as np\n'), ((16857, 16915), 'numpy.arange', 'np.arange', (['"""1066-10-13"""', '"""1066-10-16"""'], {'dtype': 'np.datetime64'}), "('1066-10-13', '1066-10-16', dtype=np.datetime64)\n", (16866, 16915), True, 'import numpy as np\n'), ((17629, 17651), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['data'], {'chunks': '(2)'}), '(data, chunks=2)\n', (17635, 17651), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((18960, 18990), 'scipy.sparse.random', 'sps.random', (['(10)', '(1)'], {'density': '(0.1)'}), '(10, 1, density=0.1)\n', (18970, 18990), True, 'import scipy.sparse as sps\n'), ((19485, 19500), 'numpy.arange', 'np.arange', (['(1)', '(5)'], {}), '(1, 5)\n', (19494, 19500), True, 'import numpy as np\n'), ((19563, 19586), 'mars.tensor.expressions.datasource.arange', 'arange', (['(1)', '(11)'], {'chunks': '(2)'}), '(1, 11, chunks=2)\n', (19569, 19586), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((20267, 20301), 'numpy.array', 'np.array', (['[[0, 2], [1, 1], [2, 0]]'], {}), '([[0, 2], [1, 1], [2, 0]])\n', (20275, 20301), True, 'import numpy as np\n'), ((22681, 22694), 'numpy.arange', 'np.arange', (['(20)'], {}), '(20)\n', (22690, 22694), True, 'import numpy as np\n'), ((22804, 22817), 'numpy.arange', 'np.arange', (['(20)'], {}), '(20)\n', (22813, 22817), True, 'import numpy as np\n'), ((22897, 22917), 'mars.tensor.expressions.datasource.arange', 'arange', (['(20)'], {'chunks': '(5)'}), '(20, chunks=5)\n', (22903, 22917), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((23027, 23040), 'numpy.arange', 'np.arange', (['(20)'], {}), '(20)\n', (23036, 23040), True, 'import numpy as np\n'), ((5055, 5090), 'numpy.broadcast_to', 'np.broadcast_to', (['raw', '(5, 10, 5, 6)'], {}), '(raw, (5, 10, 5, 6))\n', (5070, 5090), True, 'import numpy as np\n'), ((5945, 5977), 'numpy.where', 'np.where', (['raw_cond', 'raw_x', 'raw_y'], {}), '(raw_cond, raw_x, raw_y)\n', (5953, 5977), True, 'import numpy as np\n'), ((8157, 8184), 'numpy.expand_dims', 'np.expand_dims', (['raw_data', '(1)'], {}), '(raw_data, 1)\n', (8171, 8184), True, 'import numpy as np\n'), ((8325, 8352), 'numpy.expand_dims', 'np.expand_dims', (['raw_data', '(0)'], {}), '(raw_data, 0)\n', (8339, 8352), True, 'import numpy as np\n'), ((8493, 8520), 'numpy.expand_dims', 'np.expand_dims', (['raw_data', '(3)'], {}), '(raw_data, 3)\n', (8507, 8520), True, 'import numpy as np\n'), ((8662, 8690), 'numpy.expand_dims', 'np.expand_dims', (['raw_data', '(-1)'], {}), '(raw_data, -1)\n', (8676, 8690), True, 'import numpy as np\n'), ((8832, 8860), 'numpy.expand_dims', 'np.expand_dims', (['raw_data', '(-4)'], {}), '(raw_data, -4)\n', (8846, 8860), True, 'import numpy as np\n'), ((9552, 9565), 'numpy.array', 'np.array', (['[1]'], {}), '([1])\n', (9560, 9565), True, 'import numpy as np\n'), ((9615, 9625), 'numpy.ones', 'np.ones', (['(3)'], {}), '(3)\n', (9622, 9625), True, 'import numpy as np\n'), ((9675, 9690), 'numpy.ones', 'np.ones', (['(3, 4)'], {}), '((3, 4))\n', (9682, 9690), True, 'import numpy as np\n'), ((9968, 9983), 'numpy.array', 'np.array', (['[[1]]'], {}), '([[1]])\n', (9976, 9983), True, 'import numpy as np\n'), ((10108, 10123), 'numpy.ones', 'np.ones', (['(3, 4)'], {}), '((3, 4))\n', (10115, 10123), True, 'import numpy as np\n'), ((10401, 10417), 'numpy.atleast_3d', 'np.atleast_3d', (['x'], {}), '(x)\n', (10414, 10417), True, 'import numpy as np\n'), ((10625, 10644), 'mars.tensor.expressions.datasource.arange', 'arange', (['(6)'], {'chunks': '(2)'}), '(6, chunks=2)\n', (10631, 10644), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((10921, 10941), 'mars.tensor.expressions.datasource.arange', 'arange', (['(48)'], {'chunks': '(3)'}), '(48, chunks=3)\n', (10927, 10941), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((11659, 11679), 'mars.tensor.expressions.datasource.arange', 'arange', (['(48)'], {'chunks': '(3)'}), '(48, chunks=3)\n', (11665, 11679), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((12356, 12377), 'mars.tensor.expressions.datasource.arange', 'arange', (['(120)'], {'chunks': '(3)'}), '(120, chunks=3)\n', (12362, 12377), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((12716, 12736), 'mars.tensor.expressions.datasource.arange', 'arange', (['(48)'], {'chunks': '(3)'}), '(48, chunks=3)\n', (12722, 12736), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((13072, 13092), 'mars.tensor.expressions.datasource.arange', 'arange', (['(48)'], {'chunks': '(3)'}), '(48, chunks=3)\n', (13078, 13092), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((15187, 15206), 'mars.tensor.expressions.datasource.arange', 'arange', (['(4)'], {'chunks': '(1)'}), '(4, chunks=1)\n', (15193, 15206), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((17501, 17519), 'numpy.array', 'np.array', (['[88, 99]'], {}), '([88, 99])\n', (17509, 17519), True, 'import numpy as np\n'), ((19596, 19623), 'mars.tensor.expressions.datasource.arange', 'arange', (['(10)', '(0)', '(-1)'], {'chunks': '(2)'}), '(10, 0, -1, chunks=2)\n', (19602, 19623), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((19801, 19820), 'mars.tensor.expressions.datasource.arange', 'arange', (['(6)'], {'chunks': '(2)'}), '(6, chunks=2)\n', (19807, 19820), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((19879, 19915), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['[1.0 / 4, 3.0 / 4]'], {'chunks': '(2)'}), '([1.0 / 4, 3.0 / 4], chunks=2)\n', (19885, 19915), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((20722, 20728), 'mars.tensor.expressions.base.cov', 'cov', (['X'], {}), '(X)\n', (20725, 20728), False, 'from mars.tensor.expressions.base import copyto, transpose, moveaxis, broadcast_to, broadcast_arrays, where, expand_dims, rollaxis, atleast_1d, atleast_2d, atleast_3d, argwhere, array_split, split, hsplit, vsplit, dsplit, roll, squeeze, ptp, diff, ediff1d, digitize, average, cov, corrcoef, flip, flipud, fliplr, repeat, tile, isin\n'), ((21198, 21217), 'mars.tensor.expressions.datasource.arange', 'arange', (['(8)'], {'chunks': '(2)'}), '(8, chunks=2)\n', (21204, 21217), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((9246, 9267), 'numpy.ones', 'np.ones', (['(3, 4, 5, 6)'], {}), '((3, 4, 5, 6))\n', (9253, 9267), True, 'import numpy as np\n'), ((10047, 10057), 'numpy.ones', 'np.ones', (['(3)'], {}), '(3)\n', (10054, 10057), True, 'import numpy as np\n'), ((10481, 10491), 'numpy.ones', 'np.ones', (['(3)'], {}), '(3)\n', (10488, 10491), True, 'import numpy as np\n'), ((10556, 10571), 'numpy.ones', 'np.ones', (['(3, 4)'], {}), '((3, 4))\n', (10563, 10571), True, 'import numpy as np\n'), ((11109, 11122), 'numpy.arange', 'np.arange', (['(48)'], {}), '(48)\n', (11118, 11122), True, 'import numpy as np\n'), ((11436, 11449), 'numpy.arange', 'np.arange', (['(48)'], {}), '(48)\n', (11445, 11449), True, 'import numpy as np\n'), ((11835, 11848), 'numpy.arange', 'np.arange', (['(48)'], {}), '(48)\n', (11844, 11848), True, 'import numpy as np\n'), ((12150, 12163), 'numpy.arange', 'np.arange', (['(48)'], {}), '(48)\n', (12159, 12163), True, 'import numpy as np\n'), ((12528, 12542), 'numpy.arange', 'np.arange', (['(120)'], {}), '(120)\n', (12537, 12542), True, 'import numpy as np\n'), ((12886, 12899), 'numpy.arange', 'np.arange', (['(48)'], {}), '(48)\n', (12895, 12899), True, 'import numpy as np\n'), ((13242, 13255), 'numpy.arange', 'np.arange', (['(48)'], {}), '(48)\n', (13251, 13255), True, 'import numpy as np\n'), ((14172, 14185), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (14181, 14185), True, 'import numpy as np\n'), ((14374, 14387), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (14383, 14387), True, 'import numpy as np\n'), ((14584, 14597), 'numpy.arange', 'np.arange', (['(10)'], {}), '(10)\n', (14593, 14597), True, 'import numpy as np\n'), ((15338, 15350), 'numpy.arange', 'np.arange', (['(4)'], {}), '(4)\n', (15347, 15350), True, 'import numpy as np\n'), ((15538, 15550), 'numpy.arange', 'np.arange', (['(4)'], {}), '(4)\n', (15547, 15550), True, 'import numpy as np\n'), ((15717, 15729), 'numpy.arange', 'np.arange', (['(4)'], {}), '(4)\n', (15726, 15729), True, 'import numpy as np\n'), ((20004, 20016), 'numpy.arange', 'np.arange', (['(6)'], {}), '(6)\n', (20013, 20016), True, 'import numpy as np\n'), ((20187, 20223), 'mars.tensor.expressions.datasource.tensor', 'tensor', (['[1.0 / 4, 3.0 / 4]'], {'chunks': '(2)'}), '([1.0 / 4, 3.0 / 4], chunks=2)\n', (20193, 20223), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((21351, 21363), 'numpy.arange', 'np.arange', (['(8)'], {}), '(8)\n', (21360, 21363), True, 'import numpy as np\n'), ((21546, 21558), 'numpy.arange', 'np.arange', (['(8)'], {}), '(8)\n', (21555, 21558), True, 'import numpy as np\n'), ((21742, 21754), 'numpy.arange', 'np.arange', (['(8)'], {}), '(8)\n', (21751, 21754), True, 'import numpy as np\n'), ((21935, 21947), 'numpy.arange', 'np.arange', (['(8)'], {}), '(8)\n', (21944, 21947), True, 'import numpy as np\n'), ((24802, 24821), 'mars.tensor.expressions.datasource.arange', 'arange', (['(4)'], {'chunks': '(1)'}), '(4, chunks=1)\n', (24808, 24821), False, 'from mars.tensor.expressions.datasource import tensor, ones, zeros, arange\n'), ((10781, 10793), 'numpy.arange', 'np.arange', (['(6)'], {}), '(6)\n', (10790, 10793), True, 'import numpy as np\n'), ((25017, 25029), 'numpy.arange', 'np.arange', (['(4)'], {}), '(4)\n', (25026, 25029), True, 'import numpy as np\n'), ((25422, 25434), 'numpy.arange', 'np.arange', (['(4)'], {}), '(4)\n', (25431, 25434), True, 'import numpy as np\n'), ((25854, 25866), 'numpy.arange', 'np.arange', (['(4)'], {}), '(4)\n', (25863, 25866), True, 'import numpy as np\n')]