code: def tri(N, M=None, k=0, dtype=float):
      """Creates an array with ones at and below the given diagonal.
  
      Args:
          N (int): Number of rows.
          M (int): Number of columns. ``M == N`` by default.
          k (int): The sub-diagonal at and below which the array is filled. Zero
              is the main diagonal, a positive value is above it, and a negative
              value is below.
          dtype: Data type specifier.
  
      Returns:
          cupy.ndarray: An array with ones at and below the given diagonal.
  
      .. seealso:: :func:`numpy.tri`
  
      """
      if M is None:
          M = N
      out = cupy.empty((N, M), dtype=dtype)
  
      return _tri_kernel(M, k, out)
  
file_path: cupy/cupy/_creation/matrix.py
imports: import numpy
  import cupy
  from cupy import _core
label_desc: Use image node_id 3 for calling a global function with example usage: tri(N, M, k, dtype) and returns: _tri_kernel