def shift(node, target=None, values=None, shift_sets=None):
    if _profiling_enabled:
        stop_time = time.clock()

    thread_id = PyThread_get_thread_ident()
    ctx = _get_current_context(thread_id)

    if _profiling_enabled:
        timer = ctx._pause_current_timer(stop_time)

    shifted_ctx = cython.declare(MDFContext)
    results = cython.declare(list)

    # get the calling node now to avoid _get_node_value having to get it each time
    calling_node = ctx._get_calling_node(ctx)

    try:
        if shift_sets is not None:
            results = []
            for shift_set in shift_sets:
                shifted_ctx = ctx._shift(shift_set)
                results.append(shifted_ctx._get_node_value(node,
                                                           calling_node,
                                                           ctx,
                                                           thread_id))
        else:
            results = []
            for value in values:
                shifted_ctx = ctx._shift({target : value})
                results.append(shifted_ctx._get_node_value(node,
                                                           calling_node,
                                                           ctx,
                                                           thread_id))
        return results
    finally:
        if _profiling_enabled:
            timer.resume()
This function is for use inside node functions.
dataset/ETHPy150Open manahl/mdf/mdf/context.py/shift