code: def _layout_method_wrapper(func):
      """Wraps an existing layout method to ensure that it returns a Layout
      instead of a list of lists.
  
      @param func: the method to wrap. Must be a method of the Graph object.
      @return: a new method
      """
  
      def result(*args, **kwds):
          layout = func(*args, **kwds)
          if not isinstance(layout, Layout):
              layout = Layout(layout)
          return layout
  
      result.__name__ = func.__name__
      result.__doc__ = func.__doc__
      return result
  
imports: from math import sin, cos, pi
  from igraph._igraph import GraphBase
  from igraph.drawing.utils import BoundingBox
  from igraph.statistics import RunningMean
label_desc: Use image node_id 4 for calling a global function with example usage: _layout_method_wrapper(func) and returns: result, layout