code: def test_tril_triu_dtype():
      # Issue 4916
      # tril and triu should return the same dtype as input
      for c in np.typecodes["All"]:
          if c == "V":
              continue
          arr = np.zeros((3, 3), dtype=c)
          assert_equal(np.triu(arr).dtype, arr.dtype)
          assert_equal(np.tril(arr).dtype, arr.dtype)
  
      # check special cases
      arr = np.array(
          [
              ["2001-01-01T12:00", "2002-02-03T13:56"],
              ["2004-01-01T12:00", "2003-01-03T13:45"],
          ],
          dtype="datetime64",
      )
      assert_equal(np.triu(arr).dtype, arr.dtype)
      assert_equal(np.tril(arr).dtype, arr.dtype)
  
      arr = np.zeros((3, 3), dtype="f4,f4")
      assert_equal(np.triu(arr).dtype, arr.dtype)
      assert_equal(np.tril(arr).dtype, arr.dtype)
  
imports: from numpy.testing import assert_equal, assert_array_equal, assert_array_max_ulp, assert_array_almost_equal, assert_raises, assert_
  from numpy import arange, add, fliplr, flipud, zeros, ones, eye, array, diag, histogram2d, tri, mask_indices, triu_indices, triu_indices_from, tril_indices, tril_indices_from, vander
  import numpy
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_tril_triu_dtype() without return types