def instance_method_wrapper(obj, method_name, *args, **kwargs):
    """Wraps an object instance method within a static method.
    This can be used when pickling is needed such as for multiprocessing.
    Example:
        from sklearn.externals.joblib import Parallel, delayed
        pjobs = [delayed(instance_method_wrapper)(self, 'instance_method_name', arg1, arg2) for i in range(3)]
        return Parallel(n_jobs=1)(pjobs)
    """
    method = getattr(obj, method_name)
    return method(*args, **kwargs)