# Path: modred/py2to3.py
# def run_script(path, globals=None, locals=None):
# def print_stdout(msg):
# def print_stderr(msg):
# def print_msg(msg, output_channel='stdout'):


import inspect
import os
import numpy as np
import scipy
import scipy.linalg
import scipy.signal
from numpy import polymul, polyadd
from .py2to3 import range
    elsewhere too."""
    assert len(list1) == len(list2)
    return [list1[i] + list2[i] for i in range(len(list1))]


def smart_eq(arg1, arg2):
    """Checks for equality, accounting for the fact that numpy's ``==`` doesn't
    return a bool. In that case, returns True only if all elements are equal."""
    if type(arg1) != type(arg2):
        return False
    if isinstance(arg1, np.ndarray):
        if arg1.shape != arg2.shape:
            return False
        return (arg1 == arg2).all()
    return arg1 == arg2


class InnerProductBlock(object):
    """Only used in tests. Takes inner product of all vectors."""
    def __init__(self, inner_product):
        self.inner_product = inner_product


    def __call__(self, vecs1, vecs2):
        n1 = len(vecs1)
        n2 = len(vecs2)
        IP_array = np.zeros(
            (n1, n2),
            dtype=type(self.inner_product(vecs1[0], vecs2[0])))
        for i in range(n1):

# Path: modred/py2to3.py
# def run_script(path, globals=None, locals=None):
# def print_stdout(msg):
# def print_stderr(msg):
# def print_msg(msg, output_channel='stdout'):


# Path: modred/util.py
import inspect
import os
import numpy as np
import scipy
import scipy.linalg
import scipy.signal
from numpy import polymul, polyadd
from .py2to3 import range

    elsewhere too."""
    assert len(list1) == len(list2)
    return [list1[i] + list2[i] for i in range(len(list1))]


def smart_eq(arg1, arg2):
    """Checks for equality, accounting for the fact that numpy's ``==`` doesn't
    return a bool. In that case, returns True only if all elements are equal."""
    if type(arg1) != type(arg2):
        return False
    if isinstance(arg1, np.ndarray):
        if arg1.shape != arg2.shape:
            return False
        return (arg1 == arg2).all()
    return arg1 == arg2


class InnerProductBlock(object):
    """Only used in tests. Takes inner product of all vectors."""
    def __init__(self, inner_product):
        self.inner_product = inner_product


    def __call__(self, vecs1, vecs2):
        n1 = len(vecs1)
        n2 = len(vecs2)
        IP_array = np.zeros(
            (n1, n2),
            dtype=type(self.inner_product(vecs1[0], vecs2[0])))
        for i in range(n1):

            for j in range(n2):