code: def copy(obj, byref=False, recurse=False):
      if byref:
          try:
              return dill.copy(obj, byref=byref, recurse=recurse)
          except Exception:
              pass
          else:
              raise AssertionError(
                  "Copy of %s with byref=True should have given a warning!"
                  % (obj,)
              )
  
          warnings.simplefilter("ignore")
          val = dill.copy(obj, byref=byref, recurse=recurse)
          warnings.simplefilter("error")
          return val
      else:
          return dill.copy(obj, byref=byref, recurse=recurse)
  
imports: import dill
  from functools import partial
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: copy(obj, byref, recurse) and returns: val, dill, dill