#NEWLINE# def tril_indices_from( arr , k = 0 ) : #NEWLINE# #INDENT# '\n    Return the indices for the lower-triangle of an (n, n) array.\n\n    See `tril_indices` for full details.\n\n    Parameters\n    ----------\n    n : int\n      Sets the size of the arrays for which the returned indices will be valid.\n    k : int, optional\n      Diagonal offset (see `tril` for details).\n\n    See Also\n    --------\n    tril_indices, tril\n\n    Notes\n    -----\n    .. versionadded:: 1.4.0\n\n    ' #NEWLINE# if ( ( not ( arr . ndim == 2 ) ) and ( arr . shape [ 0 ] == arr . shape [ 1 ] ) ) : #NEWLINE# #INDENT# raise ValueError ( 'input array must be 2-d and square' ) #NEWLINE# #UNINDENT# return tril_indices ( arr . shape [ 0 ] , k )