def _remove_empty(xs):
    if isinstance(xs, (list, tuple)):
        return filter(lambda x: x is not None, [_remove_empty(x) for x in xs])
    elif isinstance(xs, dict):
        out = {}
        for k, v in xs.items():
            v = _remove_empty(v)
            if v is not None:
                out[k] = v
        return out if out else None
    else:
        return xs
Produce median binning of a flux vector
dataset/ETHPy150Open chapmanb/bcbio-nextgen-vm/bcbiovm/ship/pack.py/_remove_empty--crossover with--dataset/ETHPy150Open OSCAAR/OSCAAR/oscaar/mathMethods.py/medianBin