def method_caller(obj, methodname, *args, **kwargs):
    """Helper function to workaround Python 2 pickle limitations to parallelize
    methods and generator objects"""
    return getattr(obj, methodname)(*args, **kwargs)
