code: def sync_view_results(f, self, *args, **kwargs):
      """sync relevant results from self.client to our results attribute.
  
      This is a clone of view.sync_results, but for remote functions
      """
      view = self.view
      if view._in_sync_results:
          return f(self, *args, **kwargs)
      view._in_sync_results = True
      try:
          ret = f(self, *args, **kwargs)
      finally:
          view._in_sync_results = False
          view._sync_results()
      return ret
  
file_path: ipyparallel/ipyparallel/client/remotefunction.py
imports: import sys
  import warnings
  from inspect import signature
  from decorator import decorator
  from ..serialize import PrePickled
  from .None import map
  from .asyncresult import AsyncMapResult
label_desc: Use image node_id 4 for calling a global function with example usage: sync_view_results(f, ) and returns: ret, f