def _ensure_term(where, scope_level):

    # only consider list/tuple here as an ndarray is automaticaly a coordinate
    # list
    level = scope_level + 1
    if isinstance(where, (list, tuple)):
        wlist = []
        for w in filter(lambda x: x is not None, where):
            if not maybe_expression(w):
                wlist.append(w)
            else:
                wlist.append(Term(w, scope_level=level))
        where = wlist
    elif maybe_expression(where):
        where = Term(where, scope_level=level)
    return where
Returns a metric and it's datapoints in order determined by the
dataset/ETHPy150Open pydata/pandas/pandas/io/pytables.py/_ensure_term--crossover with--dataset/ETHPy150Open graphite-project/carbon/lib/carbon/cache.py/_MetricCache.drain_metric