human
Complete the below
def create_dataset(reactor, control_service, node_uuid, dataset_id, volume_size, timeout=DEFAULT_TIMEOUT):

    ''''Create a dataset, then wait for it to be mounted.
    :param IReactorTime reactor: Twisted Reactor.
    :param IFlockerAPIV1Client control_service: Benchmark control
    service.
    :param UUID node_uuid: Node on which to create dataset.
    :param UUID dataset_id: ID for created dataset.
    :param int volume_size: Size of volume in bytes.
    :param timedelta timeout: Maximum time to wait for dataset to be
    mounted.
    :return Deferred[DatasetState]: The state of the created dataset.'
    '''

Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.
    d = control_service.create_dataset(primary=node_uuid, maximum_size=volume_size, dataset_id=dataset_id)
    def dataset_matches(dataset, state):
        return ((state.dataset_id == dataset.dataset_id) and (state.primary == dataset.primary) and (state.path is not None))
    d.addCallback((lambda dataset: loop_until_state_found(reactor, control_service.list_datasets_state, partial(dataset_matches, dataset), timeout)))
    return d