def to_key(values):
    if values is None:
        return None

    if not isinstance(values, list):
        multiple = False
        values = [values]
    else:
        multiple = True

    res = []
    for value in values:
        if value is None:
            res.append(None)
        elif isinstance(value, db.Model):
            if value.has_key():
                res.append(value.key())
            else:
                res.append(None)
        elif isinstance(value, basestring):
            res.append(db.Key(value))
        elif isinstance(value, db.Key):
            res.append(value)
        else:
            raise datastore_errors.BadArgumentError('Expected model, key or '
                'string.')

    if multiple:
        return res

    return res[0]
PCA for each module within an experimental condition across
dataset/ETHPy150Open moraes/tipfy/tipfy/appengine/db/__init__.py/to_key--crossover with--dataset/ETHPy150Open CGATOxford/cgat/CGAT/Timeseries/__init__.py/clusterPCA