def METHOD_NAME(give_env, use_rlock):
    ls = rinterface.baseenv['ls']
    get = rinterface.baseenv['get']
    if give_env:
        env = rinterface.baseenv['new.env']()
    else:
        env = None
    assert 'foo' not in ls()
    with rinterface.local_context(env=env, use_rlock=use_rlock) as lc:
        lc['foo'] = 123
        assert tuple(get('foo')) == (123, )
    assert 'foo' not in ls()