code: def test_read_params_py(tmp_dir, dvc):
      parameters_file = "parameters.py"
      tmp_dir.gen(
          parameters_file,
          (
              "INT: int = 5\n"
              "FLOAT = 0.001\n"
              "STR = 'abc'\n"
              "BOOL: bool = True\n"
              "DICT = {'a': 1}\n"
              "LIST = [1, 2, 3]\n"
              "SET = {4, 5, 6}\n"
              "TUPLE = (10, 100)\n"
              "NONE = None\n"
          ),
      )
      dep = ParamsDependency(
          Stage(dvc),
          parameters_file,
          [
              "INT",
              "FLOAT",
              "STR",
              "BOOL",
              "DICT",
              "LIST",
              "SET",
              "TUPLE",
              "NONE",
          ],
      )
      assert dep.read_params() == {
          "INT": 5,
          "FLOAT": 0.001,
          "STR": "abc",
          "BOOL": True,
          "DICT": {"a": 1},
          "LIST": [1, 2, 3],
          "SET": {4, 5, 6},
          "TUPLE": (10, 100),
          "NONE": None,
      }
  
      tmp_dir.gen(
          parameters_file,
          "class Train:\n    foo = 'val1'\n    bar = 'val2'\n",
      )
      dep = ParamsDependency(Stage(dvc), parameters_file, ["Train.foo"])
      assert dep.read_params() == {"Train.foo": "val1"}
  
      dep = ParamsDependency(Stage(dvc), parameters_file, ["Train"])
      assert dep.read_params() == {
          "Train": {"foo": "val1", "bar": "val2"}
      }
  
      tmp_dir.gen(
          parameters_file,
          (
              "x = 4\n"
              "config.x = 3\n"
              "class Klass:\n"
              "    def __init__(self):\n"
              "        self.a = 'val1'\n"
              "        container.a = 2\n"
              "        self.container.a = 1\n"
              "        a = 'val2'\n"
          ),
      )
      dep = ParamsDependency(
          Stage(dvc), parameters_file, ["x", "Klass.a"]
      )
      assert dep.read_params() == {"x": 4, "Klass.a": "val1"}
  
imports: import pytest
  from dvc.dependency import ParamsDependency, loadd_from, loads_params
  from dvc.dependency.param import BadParamFileError, MissingParamsError
  from dvc.stage import Stage
  from dvc.utils.serialize import dump_toml, dump_yaml, load_yaml
label_desc: Use image node_id 13 for calling a global function with example usage: test_read_params_py(tmp_dir, dvc) without return types