code: def istriu(am):
      r
      if am.shape[0] != am.shape[1]:
          print('Matrix is not square, triangularity is irrelevant')
          return False
      if am.format != 'coo':
          am = am.tocoo(copy=False)
      return sp.all(am.row <= am.col)
docs: r"""
      Returns ``True`` is the sparse adjacency matrix is upper triangular