code: def test_pickle_functions_in_main(tmp_path):
      script = """
  from dask.distributed import Client
  if __name__ == "__main__":
      with Client(n_workers=1) as client:
          def func(df):
              return (df + 5)
          client.submit(func, 5).result()
          print("script successful", flush=True)
  """
      with open(tmp_path / "script.py", mode="w") as f:
          f.write(script)
      with popen(
          [sys.executable, tmp_path / "script.py"], capture_output=True
      ) as proc:
          out, _ = proc.communicate(timeout=60)
  
      assert "script successful" in out.decode("utf-8")
  
imports: from __future__ import annotations
  import pickle
  import sys
  import weakref
  from functools import partial
  from operator import add
  import cloudpickle
  import pytest
  from dask.utils import tmpdir
  from distributed import profile
  from distributed.protocol import deserialize, serialize
  from distributed.protocol.pickle import CLOUDPICKLE_GE_20, HIGHEST_PROTOCOL, dumps, loads
  from distributed.protocol.serialize import dask_deserialize, dask_serialize
  from distributed.utils_test import popen, save_sys_modules
label_desc: Use image node_id 11 for calling a global function with example usage: test_pickle_functions_in_main(tmp_path) without return types