(func)
return result
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
Wraps an existing layout method to ensure that it returns a Layout
    instead of a list of lists.
Wraps an existing layout method to ensure that it returns a Layout instead of a list of lists .
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
def _layout_method_wrapper ( func ) : 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