'Pipeline'

def pipeline(self, pipeline, *args, **kwargs):

    out = kwargs.copy()
    if ('pipeline_index' in kwargs):
        base_index = int(kwargs['pipeline_index'])
    else:
        base_index = 0
    for (idx, name) in enumerate(pipeline):
        out['pipeline_index'] = (base_index + idx)
        (mod_name, func_name) = name.rsplit('.', 1)
        mod = __import__(mod_name, {}, {}, [func_name])
        func = getattr(mod, func_name, None)
        try:
            result = (func(*args, **out) or {})
        except StopPipeline:
            if ('request' in kwargs):
                clean_partial_pipeline(kwargs['request'])
            break
        if isinstance(result, dict):
            out.update(result)
        else:
            return result
    if ('request' in kwargs):
        clean_partial_pipeline(kwargs['request'])
    return out
