# Path: hftools/testing/common.py
# class TestCase(unittest.TestCase):
#     def assertAllclose(self, a, b, rtol=1e-05, atol=1e-08, msg=None):
#         a = np.asanyarray(a)
#         b = np.asanyarray(b)
#         if msg is None:
#             msg = "a (%s) not close to b (%s)" % (a, b)
#         self.assertTrue(np.allclose(a, b, rtol, atol), msg)
# 
#     def assertIsNotInstance(self, obj, cls):
#         self.assertFalse(isinstance(obj, cls))
# 
#     def assertIsInstance(self, obj, cls, msg=None):
#         """Same as self.assertTrue(isinstance(obj, cls)), with a nicer
#         default message."""
#         if not isinstance(obj, cls):
#             arg = (unittest.case.safe_repr(obj), cls)
#             standardMsg = '%s is not an instance of %r' % arg
#             self.fail(self._formatMessage(msg, standardMsg))
# 
#     def assertHFToolsWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsWarning)
#         self.assertRaises(HFToolsWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsWarning)
# 
#     def assertHFToolsDeprecationWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsDeprecationWarning)
#         self.assertRaises(HFToolsDeprecationWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsDeprecationWarning)
# 
# Path: hftools/testing/common.py
# def random_value_array_from_dims(dims, mean=0, scale=1):
#     shape = tuple(dim.data.shape[0] for dim in dims)
#     return hfarray(normal(size=shape) * scale + mean, dims)
# 
# Path: hftools/py3compat.py
# PY3 = True


import operator
import os
import numpy as np
import hftools.dataset.arrayobj as aobj
from numpy import newaxis
from hftools.testing import TestCase
from hftools.testing import random_value_array_from_dims
from hftools.py3compat import PY3

    def test_7(self):
        v1 = VArray(self.randfunc[0]((self.fi, self.gi, self.ri), mean=10))
        v2 = 5.
        a1 = np.array(v1)

        self._check(v1, v2, a1, v2)


class Test_binary_ops_sub(Test_binary_ops):
    op = operator.sub


class Test_binary_ops_mul(Test_binary_ops):
    op = operator.mul

if not PY3:
    class Test_binary_ops_div(Test_binary_ops):
        op = operator.div


class Test_binary_ops_tdiv(Test_binary_ops):
    op = operator.truediv


class Test_binary_ops_pow(Test_binary_ops):
    op = operator.pow


def rand_bool(dims, mean):

# Path: hftools/testing/common.py
# class TestCase(unittest.TestCase):
#     def assertAllclose(self, a, b, rtol=1e-05, atol=1e-08, msg=None):
#         a = np.asanyarray(a)
#         b = np.asanyarray(b)
#         if msg is None:
#             msg = "a (%s) not close to b (%s)" % (a, b)
#         self.assertTrue(np.allclose(a, b, rtol, atol), msg)
# 
#     def assertIsNotInstance(self, obj, cls):
#         self.assertFalse(isinstance(obj, cls))
# 
#     def assertIsInstance(self, obj, cls, msg=None):
#         """Same as self.assertTrue(isinstance(obj, cls)), with a nicer
#         default message."""
#         if not isinstance(obj, cls):
#             arg = (unittest.case.safe_repr(obj), cls)
#             standardMsg = '%s is not an instance of %r' % arg
#             self.fail(self._formatMessage(msg, standardMsg))
# 
#     def assertHFToolsWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsWarning)
#         self.assertRaises(HFToolsWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsWarning)
# 
#     def assertHFToolsDeprecationWarning(self, funk, *k, **kw):
#         warnings.resetwarnings()
#         warnings.simplefilter("error", HFToolsDeprecationWarning)
#         self.assertRaises(HFToolsDeprecationWarning, funk, *k, **kw)
#         warnings.simplefilter("ignore", HFToolsDeprecationWarning)
# 
# Path: hftools/testing/common.py
# def random_value_array_from_dims(dims, mean=0, scale=1):
#     shape = tuple(dim.data.shape[0] for dim in dims)
#     return hfarray(normal(size=shape) * scale + mean, dims)
# 
# Path: hftools/py3compat.py
# PY3 = True


# Path: hftools/dataset/tests/test_arrayobj_ops.py
import operator
import os
import numpy as np
import hftools.dataset.arrayobj as aobj
from numpy import newaxis
from hftools.testing import TestCase
from hftools.testing import random_value_array_from_dims
from hftools.py3compat import PY3


    def test_7(self):
        v1 = VArray(self.randfunc[0]((self.fi, self.gi, self.ri), mean=10))
        v2 = 5.
        a1 = np.array(v1)

        self._check(v1, v2, a1, v2)


class Test_binary_ops_sub(Test_binary_ops):
    op = operator.sub


class Test_binary_ops_mul(Test_binary_ops):
    op = operator.mul

if not PY3:
    class Test_binary_ops_div(Test_binary_ops):
        op = operator.div


class Test_binary_ops_tdiv(Test_binary_ops):
    op = operator.truediv


class Test_binary_ops_pow(Test_binary_ops):
    op = operator.pow


def rand_bool(dims, mean):

    values = random_value_array_from_dims(dims, mean=mean)