code: def test_pickle_by_value_when_registered():
      with save_sys_modules():
          with tmpdir() as d:
              try:
                  sys.path.insert(0, d)
                  module = f"{d}/mymodule.py"
                  with open(module, "w") as f:
                      f.write("def myfunc(x):\n    return x + 1")
                  import mymodule  # noqa
  
                  assert dumps(mymodule.myfunc) == pickle.dumps(
                      mymodule.myfunc, protocol=HIGHEST_PROTOCOL
                  )
                  cloudpickle.register_pickle_by_value(mymodule)
                  assert len(dumps(mymodule.myfunc)) > len(
                      pickle.dumps(mymodule.myfunc)
                  )
  
              finally:
                  sys.path.pop(0)
  
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 6 for calling a global function with example usage: test_pickle_by_value_when_registered() without return types