def build_collection(type, dataset_instances):
 dataset_collection = model.DatasetCollection()
 set_collection_elements(dataset_collection, type, dataset_instances)
 return dataset_collection

def build_collection ( type , dataset_instances ) : dataset_collection = model . DatasetCollection ( ) set_collection_elements ( dataset_collection , type , dataset_instances ) return dataset_collection
build datasetcollection with populated datasetcollectionelement objects corresponding to the supplied dataset instances or throw exception if this is not a valid collection of the specified type .