def _ensure_element(tup, elem):
    try:
        return tup, tup.index(elem)
    except ValueError:
        return tuple(chain(tup, (elem,))), len(tup)
Create a tuple containing all elements of tup, plus elem.
dataset/ETHPy150Open quantopian/zipline/zipline/pipeline/expression.py/_ensure_element