def CreateTasksFilter(pc, tasks):
    if not tasks:
        return None

    # First create the object specification as the task object.
    objspecs = [Vmodl.Query.PropertyCollector.ObjectSpec(obj=task)
                for task in tasks]

    # Next, create the property specification as the state.
    propspec = Vmodl.Query.PropertyCollector.PropertySpec(
        type=Vim.Task, pathSet=[], all=True)

    # Create a filter spec with the specified object and property spec.
    filterspec = Vmodl.Query.PropertyCollector.FilterSpec()
    filterspec.objectSet = objspecs
    filterspec.propSet = [propspec]

    # Create the filter
    return pc.CreateFilter(filterspec, True)
This test is meant to cover multi-part uploads in the AWSJobStore but it doesn't hurt
dataset/ETHPy150Open vmware/pyvmomi/pyVim/task.py/CreateTasksFilter--crossover with--dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/jobStores/jobStoreTest.py/hidden.AbstractJobStoreTest.testMultipartUploads