def getem(arr, chunks, shape=None, out_name=None, fancy=True, lock=False):
 out_name = (out_name or arr)
 chunks = normalize_chunks(chunks, shape)
 keys = list(product([out_name], *[range(len(bds)) for bds in chunks]))
 slices = slices_from_chunks(chunks)
 getter = (getarray if fancy else getarray_nofancy)
 if lock:
  values = [(getter, arr, x, lock) for x in slices]
 else:
  values = [(getter, arr, x) for x in slices]
 return dict(zip(keys, values))

def getem ( arr , chunks , shape = None , out_name = None , fancy = True , lock = False ) : out_name = ( out_name or arr ) chunks = normalize_chunks ( chunks , shape ) keys = list ( product ( [ out_name ] , * [ range ( len ( bds ) ) for bds in chunks ] ) ) slices = slices_from_chunks ( chunks ) getter = ( getarray if fancy else getarray_nofancy ) if lock : values = [ ( getter , arr , x , lock ) for x in slices ] else : values = [ ( getter , arr , x ) for x in slices ] return dict ( zip ( keys , values ) )
dask getting various chunks from an array-like .