Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
>>> var_replace("$session_id", "aoeuidhtns")
({'$session_id': 'aoeuidhtns'}, 'aoeuidhtns')

>>> var_replace({'session_id': '$session_id'}, {'session_id': 'aoeuidhtns'})
({'$session_id': 'aoeuidhtns'}, {'session_id': 'aoeuidhtns'})

>>> var_replace(['$count1','$count2', '$count3'], [4, 5, 6])
({'$count1': 4, '$count2': 5, '$count3': 6}, [4, 5, 6])

>>> var_replace({'counts': ['$count1','$count2', '$count3']}, {'counts': [4, 5, 6]})(more...)

        def var_replace(with_variables, with_values):
    """
    >>> var_replace("$session_id", "aoeuidhtns")
    ({'$session_id': 'aoeuidhtns'}, 'aoeuidhtns')

    >>> var_replace({'session_id': '$session_id'}, {'session_id': 'aoeuidhtns'})
    ({'$session_id': 'aoeuidhtns'}, {'session_id': 'aoeuidhtns'})

    >>> var_replace(['$count1','$count2', '$count3'], [4, 5, 6])
    ({'$count1': 4, '$count2': 5, '$count3': 6}, [4, 5, 6])

    >>> var_replace({'counts': ['$count1','$count2', '$count3']}, {'counts': [4, 5, 6]})
    ({'$count1': 4, '$count2': 5, '$count3': 6}, {'counts': [4, 5, 6]})

    """
    vars = {}
    output = var_replace_helper(vars, with_variables, with_values)
    return vars, output
        


src/m/a/majd-HEAD/test.py   majd(Download)
import string
import time
from utils import var_replace, load_json_with_includes
from data_diff import data_diff
 
 
        try:
            new_vars, replaced_output = var_replace(step['output'], actual_output)
        except Exception, e:
            fail(filename, str(i + 1), step['method'], input, step['output'], actual_output)