# 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
"""A group of useful functions"""



class UndefinedError(Exception): pass

def atleast_2d_row(array):
    """Converts 1d arrays to 2d arrays, but always as row vectors"""
    array = np.array(array)
    if array.ndim < 2:
        return np.atleast_2d(array)
    else:
        return array


def atleast_2d_col(array):
    """Converts 1d arrays to 2d arrays, but always as column vectors"""
    array = np.array(array)
    if array.ndim < 2:
        return np.atleast_2d(array).T
    else:
        return array


def make_iterable(arg):
    """Checks if ``arg`` is iterable. If not, makes it a one-element list.
    Otherwise returns ``arg``."""
    try:
        iterator = iter(arg)
        return arg

# 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

"""A group of useful functions"""



class UndefinedError(Exception): pass

def atleast_2d_row(array):
    """Converts 1d arrays to 2d arrays, but always as row vectors"""
    array = np.array(array)
    if array.ndim < 2:
        return np.atleast_2d(array)
    else:
        return array


def atleast_2d_col(array):
    """Converts 1d arrays to 2d arrays, but always as column vectors"""
    array = np.array(array)
    if array.ndim < 2:
        return np.atleast_2d(array).T
    else:
        return array


def make_iterable(arg):
    """Checks if ``arg`` is iterable. If not, makes it a one-element list.
    Otherwise returns ``arg``."""
    try:
        iterator = iter(arg)
        return arg

    except TypeError: