def _pairs(X,reversed=False):
    """Return pairs (x,i) for x in list X, where i is
    the index of x in the data, in forward or reverse order.
    """
    indices = range(len(X))
    if reversed:
        indices.reverse()
    return [(X[i],i) for i in indices]
Return pairs (x,i) for x in list X, where i is
    the index of x in the data, in forward or reverse order.
    
recipes/Python/252123_Range_minimleast/recipe-252123.py