# Path: mla/metrics/base.py
# def check_data(a, b):
#     if not isinstance(a, np.ndarray):
#         a = np.array(a)
# 
#     if not isinstance(b, np.ndarray):
#         b = np.array(b)
# 
#     if type(a) != type(b):
#         raise ValueError("Type mismatch: %s and %s" % (type(a), type(b)))
# 
#     if a.size != b.size:
#         raise ValueError("Arrays must be equal in length.")
#     return a, b
# 
# def validate_input(function):
#     def wrapper(a, b):
#         a, b = check_data(a, b)
#         return function(a, b)
# 
#     return wrapper
# 
# Path: mla/metrics/metrics.py
# def get_metric(name):
#     """Return metric function by name"""
#     try:
#         return globals()[name]
#     except Exception:
#         raise ValueError("Invalid metric function.")


import numpy as np
import pytest
from numpy.testing import assert_almost_equal
from mla.metrics.base import check_data, validate_input
from mla.metrics.metrics import get_metric
from __future__ import division




def test_data_validation():
    with pytest.raises(ValueError):

# Path: mla/metrics/base.py
# def check_data(a, b):
#     if not isinstance(a, np.ndarray):
#         a = np.array(a)
# 
#     if not isinstance(b, np.ndarray):
#         b = np.array(b)
# 
#     if type(a) != type(b):
#         raise ValueError("Type mismatch: %s and %s" % (type(a), type(b)))
# 
#     if a.size != b.size:
#         raise ValueError("Arrays must be equal in length.")
#     return a, b
# 
# def validate_input(function):
#     def wrapper(a, b):
#         a, b = check_data(a, b)
#         return function(a, b)
# 
#     return wrapper
# 
# Path: mla/metrics/metrics.py
# def get_metric(name):
#     """Return metric function by name"""
#     try:
#         return globals()[name]
#     except Exception:
#         raise ValueError("Invalid metric function.")


# Path: mla/metrics/tests/test_metrics.py
import numpy as np
import pytest
from numpy.testing import assert_almost_equal
from mla.metrics.base import check_data, validate_input
from mla.metrics.metrics import get_metric

from __future__ import division




def test_data_validation():
    with pytest.raises(ValueError):

        check_data([], 1)