in s3transfer/tasks.py [0:0]
def _get_all_main_kwargs(self):
# Copy over all of the kwargs that we know is available.
kwargs = copy.copy(self._main_kwargs)
# Iterate through the kwargs whose values are pending on the result
# of a future.
for key, pending_value in self._pending_main_kwargs.items():
# If the value is a list of futures, iterate though the list
# appending on the result from each future.
if isinstance(pending_value, list):
result = []
for future in pending_value:
result.append(future.result())
# Otherwise if the pending_value is a future, just wait for it.
else:
result = pending_value.result()
# Add the retrieved value to the kwargs to be sent to the
# main() call.
kwargs[key] = result
return kwargs