code: def test_issue_510():
      # A very bizzare use of functions and methods that pickle doesn't get
      # correctly for odd reasons.
      class Foo:
          def __init__(self):
              def f2(self):
                  return self
  
              self.f2 = f2.__get__(self)
  
      import dill, pickletools
  
      f = Foo()
      f1 = dill.copy(f)
      assert f1.f2() is f1
  
file_path: dill/dill/tests/test_functions.py
imports: import functools
  import dill
  import sys
label_desc: Use image node_id 7 for calling a global function with example usage: test_issue_510() and returns: self