code: def test_spdiags(self):
      diags1 = array([[1, 2, 3, 4, 5]])
      diags2 = array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
      diags3 = array(
          [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15]]
      )
  
      cases = []
      cases.append((diags1, 0, 1, 1, [[1]]))
      cases.append((diags1, [0], 1, 1, [[1]]))
      cases.append((diags1, [0], 2, 1, [[1], [0]]))
      cases.append((diags1, [0], 1, 2, [[1, 0]]))
      cases.append((diags1, [1], 1, 2, [[0, 2]]))
      cases.append((diags1, [-1], 1, 2, [[0, 0]]))
      cases.append((diags1, [0], 2, 2, [[1, 0], [0, 2]]))
      cases.append((diags1, [-1], 2, 2, [[0, 0], [1, 0]]))
      cases.append((diags1, [3], 2, 2, [[0, 0], [0, 0]]))
      cases.append(
          (
              diags1,
              [0],
              3,
              4,
              [[1, 0, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0]],
          )
      )
      cases.append(
          (
              diags1,
              [1],
              3,
              4,
              [[0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]],
          )
      )
      cases.append(
          (
              diags1,
              [2],
              3,
              5,
              [[0, 0, 3, 0, 0], [0, 0, 0, 4, 0], [0, 0, 0, 0, 5]],
          )
      )
  
      cases.append(
          (diags2, [0, 2], 3, 3, [[1, 0, 8], [0, 2, 0], [0, 0, 3]])
      )
      cases.append(
          (
              diags2,
              [-1, 0],
              3,
              4,
              [[6, 0, 0, 0], [1, 7, 0, 0], [0, 2, 8, 0]],
          )
      )
      cases.append(
          (
              diags2,
              [2, -3],
              6,
              6,
              [
                  [0, 0, 3, 0, 0, 0],
                  [0, 0, 0, 4, 0, 0],
                  [0, 0, 0, 0, 5, 0],
                  [6, 0, 0, 0, 0, 0],
                  [0, 7, 0, 0, 0, 0],
                  [0, 0, 8, 0, 0, 0],
              ],
          )
      )
  
      cases.append(
          (
              diags3,
              [-1, 0, 1],
              6,
              6,
              [
                  [6, 12, 0, 0, 0, 0],
                  [1, 7, 13, 0, 0, 0],
                  [0, 2, 8, 14, 0, 0],
                  [0, 0, 3, 9, 15, 0],
                  [0, 0, 0, 4, 10, 0],
                  [0, 0, 0, 0, 5, 0],
              ],
          )
      )
      cases.append(
          (
              diags3,
              [-4, 2, -1],
              6,
              5,
              [
                  [0, 0, 8, 0, 0],
                  [11, 0, 0, 9, 0],
                  [0, 12, 0, 0, 10],
                  [0, 0, 13, 0, 0],
                  [1, 0, 0, 14, 0],
                  [0, 2, 0, 0, 15],
              ],
          )
      )
  
      for d, o, m, n, result in cases:
          assert_equal(construct.spdiags(d, o, m, n).todense(), result)
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy import array
  from numpy.testing import assert_equal, assert_, assert_array_equal, assert_array_almost_equal_nulp
  import pytest
  from pytest import raises
  from scipy._lib._testutils import check_free_memory
  from scipy.sparse import csr_matrix, coo_matrix, construct
  from scipy.sparse.construct import rand
  from scipy.sparse.sputils import matrix
label_desc: Use image node_id 1 for calling the TestConstructUtils obj's underlying member method code with example usage: obj.test_spdiags() without return types