code: def tri(N, M=None, k=0, dtype="float64", *, like=None):
      if M is None:
          M = N
      ones = ivy.ones((N, M), dtype=dtype)
      return ivy.tril(ones, k=k)
  
file_path: ivy/ivy/functional/frontends/numpy/creation_routines/building_matrices.py
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, handle_numpy_dtype
label_desc: Use image node_id 3 for calling a global function with example usage: tri(N, M, k, dtype) and returns: ivy