def items(self): """Flattens the data in all of the buckets into a single list.""" # for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)] # zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8] return filter(None, chain_from_iterable( zip_longest(*[bucket.items for bucket in self.buckets.values()])), )
def flatten_links(self): return list( chain_from_iterable( _chain( [[self]], (link.flatten_links() for link in maybe_list(self.options.get("link")) or []))))
def items(self): # for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)] # zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8] return filter( None, chain_from_iterable( izip_longest( *[bucket.items for bucket in self.buckets.values()])))
def flatten_links(self): """Gives a recursive list of dependencies (unchain if you will, but with links intact).""" return list( chain_from_iterable( _chain([[self]], (link.flatten_links() for link in maybe_list(self.options.get("link")) or [])) ) )
def flatten_links(self): return list(chain_from_iterable(_chain([[self]], (link.flatten_links() for link in maybe_list(self.options.get('link')) or []))))
def items(self): # for queues with contents [(1, 2), (3, 4), (5, 6), (7, 8)] # zips and flattens to [1, 3, 5, 7, 2, 4, 6, 8] return filter(None, chain_from_iterable(izip_longest(*[bucket.items for bucket in self.buckets.values()])))
def flatten_links(self): """Gives a recursive list of dependencies (unchain if you will, but with links intact).""" return list(chain_from_iterable(_chain([[self]], (link.flatten_links() for link in maybe_list(self.options.get("link")) or []))))