def __pickle_method__(m):
    """
    Pickling override for using pickle with instance methods.
    """
    if m.__self__ is None:
        return getattr, (m.__self__.__class__, m.__func__.__name__)
    else:
        return getattr, (m.__self__, m.__func__.__name__)
