code: def istriangular(am):
      r
      if am.format != 'coo':
          am = am.tocoo(copy=False)
      return istril(am) or istriu(am)
docs: r"""
      Returns ``True`` is the sparse adjacency matrix is either upper or lower
      triangular