code: def test_globalmethod():
      x = Foo()
  
      assert x.f() == 1
  
      with dask.config.set(f=lambda: 2):
          assert x.f() == 2
  
      with dask.config.set(f=foo):
          assert x.f is foo
          assert x.f() == "foo"
  
      assert x.g is foo
      assert x.g() == "foo"
  
      with dask.config.set(g=False):
          assert x.g is bar
          assert x.g() == "bar"
  
file_path: dask/dask/tests/test_context.py
imports: from __future__ import annotations
  import pytest
  import dask
  from dask.context import globalmethod
label_desc: Use image node_id 4 for calling a global function with example usage: test_globalmethod() without return types