code: def test_select():
      context = Context(foo="foo", bar="bar", lst=[1, 2, 3])
  
      assert context.select("foo") == Value("foo")
      assert context.select("bar") == Value("bar")
      assert context.select("lst") == CtxList([1, 2, 3])
      assert context.select("lst.0") == Value(1)
  
      with pytest.raises(KeyNotInContext):
          context.select("baz")
  
      d = {
          "lst": [
              {"foo0": "foo0", "bar0": "bar0"},
              {"foo1": "foo1", "bar1": "bar1"},
          ]
      }
      context = Context(d)
      assert context.select("lst") == CtxList(d["lst"])
      assert context.select("lst.0") == CtxDict(d["lst"][0])
      assert context.select("lst.1") == CtxDict(d["lst"][1])
  
      with pytest.raises(KeyNotInContext):
          context.select("lst.2")
  
      for i, _ in enumerate(d["lst"]):
          assert context.select(f"lst.{i}.foo{i}") == Value(f"foo{i}")
          assert context.select(f"lst.{i}.bar{i}") == Value(f"bar{i}")
  
imports: from dataclasses import asdict
  from math import pi
  import pytest
  from dvc.fs import LocalFileSystem
  from dvc.parsing import DEFAULT_PARAMS_FILE
  from dvc.parsing.context import Context, CtxDict, CtxList, KeyNotInContext, MergeError, ParamsLoadError, Value, recurse_not_a_node
  from dvc.utils import relpath
  from dvc.utils.serialize import dumps_yaml
label_desc: Use image node_id 7 for calling a global function with example usage: test_select() without return types