code: def test_tril_triu_with_inf():
      # Issue 4859
      arr = np.array([[1, 1, np.inf], [1, 1, 1], [np.inf, 1, 1]])
      out_tril = np.array([[1, 0, 0], [1, 1, 0], [np.inf, 1, 1]])
      out_triu = out_tril.T
      assert_array_equal(np.triu(arr), out_triu)
      assert_array_equal(np.tril(arr), out_tril)
  
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 4 for calling a global function with example usage: test_tril_triu_with_inf() without return types