(self, field, items, transform = None)
return transform(flattened) if transform is not None else flattened
Extracts the entry `field` from each item in the supplied iterable, flattening any nested lists
Extracts the entry `field` from each item in the supplied iterable, flattening any nested lists
Extracts the entry field from each item in the supplied iterable flattening any nested lists
def _flatten(self, field, items, transform = None):
		"""
		Extracts the entry `field` from each item in the supplied iterable, flattening any nested lists
		"""
		
		# Retrieve the value for each item in the iterable
		values = [item[field] for item in items]
		
		# Flatten any nested lists
		flattened = []
		for value in values:
			flattened.extend([value] if isinstance(value, str) else value)
		
		# Apply any supplied transformation function
		return transform(flattened) if transform is not None else flattened
def _flatten ( self , field , items , transform = None ) : # Retrieve the value for each item in the iterable values = [ item [ field ] for item in items ] # Flatten any nested lists flattened = [ ] for value in values : flattened . extend ( [ value ] if isinstance ( value , str ) else value ) # Apply any supplied transformation function return transform ( flattened ) if transform is not None else flattened