def get_collection_sample(collection_type, datatype):
 if (collection_type == 'list'):
  return [get_sample(datatype), get_sample(datatype)]
 elif (collection_type == 'set'):
  return sortedset([get_sample(datatype)])
 elif (collection_type == 'map'):
  return OrderedMap([(get_sample(datatype), get_sample(datatype))])
 elif (collection_type == 'tuple'):
  return (get_sample(datatype),)
 else:
  raise Exception('Missing handling of non-primitive type {0}.'.format(collection_type))

def get_collection_sample ( collection_type , datatype ) : if ( collection_type == 'list' ) : return [ get_sample ( datatype ) , get_sample ( datatype ) ] elif ( collection_type == 'set' ) : return sortedset ( [ get_sample ( datatype ) ] ) elif ( collection_type == 'map' ) : return OrderedMap ( [ ( get_sample ( datatype ) , get_sample ( datatype ) ) ] ) elif ( collection_type == 'tuple' ) : return ( get_sample ( datatype ) , ) else : raise Exception ( 'Missing handling of non-primitive type {0}.' . format ( collection_type ) )
helper method to access created sample data for collection types .