def _align_nums(nums):
    """
    Given an array of numerator coefficient arrays [[a_1, a_2,...,
    a_n],..., [b_1, b_2,..., b_m]], this function pads shorter numerator
    arrays with zero's so that all numerators have the same length. Such
    alignment is necessary for functions like 'tf2ss', which needs the
    alignment when dealing with SIMO transfer functions.
    """
    try:
        # The statement can throw a ValueError if one
        # of the numerators is a single digit and another
        # is array-like e.g. if nums = [5, [1, 2, 3]]
        nums = asarray(nums)

        if not np.issubdtype(nums.dtype, np.number):
            raise ValueError("dtype of numerator is non-numeric")

        return nums

    except __HOLE__:
        nums = list(nums)
        maxwidth = len(max(nums, key=lambda num: atleast_1d(num).size))

        for index, num in enumerate(nums):
            num = atleast_1d(num).tolist()
            nums[index] = [0] * (maxwidth - len(num)) + num

        return atleast_1d(nums)
dataset/ETHPy150Open scipy/scipy/scipy/signal/filter_design.py/_align_nums