code: def test_load_from(mocker):
      d = {"x": {"y": {"z": 5}, "lst": [1, 2, 3]}, "foo": "foo"}
      fs = mocker.Mock(
          open=mocker.mock_open(read_data=dumps_yaml(d)),
          **{"exists.return_value": True, "isdir.return_value": False},
      )
      file = "params.yaml"
      c = Context.load_from(fs, file)
  
      assert asdict(c["x"].meta) == {
          "source": file,
          "dpaths": ["x"],
          "local": False,
      }
      assert asdict(c["foo"].meta) == {
          "source": file,
          "local": False,
          "dpaths": ["foo"],
      }
      assert asdict(c["x"]["y"].meta) == {
          "source": file,
          "dpaths": ["x", "y"],
          "local": False,
      }
      assert asdict(c["x"]["y"]["z"].meta) == {
          "source": file,
          "dpaths": ["x", "y", "z"],
          "local": False,
      }
      assert asdict(c["x"]["lst"].meta) == {
          "source": file,
          "dpaths": ["x", "lst"],
          "local": False,
      }
      assert asdict(c["x"]["lst"][0].meta) == {
          "source": file,
          "dpaths": ["x", "lst", "0"],
          "local": False,
      }
  
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 12 for calling a global function with example usage: test_load_from(mocker) without return types