def store(sources, targets, lock=True, regions=None, compute=True, **kwargs):
 if isinstance(sources, Array):
  sources = [sources]
  targets = [targets]
 if any(((not isinstance(s, Array)) for s in sources)):
  raise ValueError('All sources must be dask array objects')
 if (len(sources) != len(targets)):
  raise ValueError(('Different number of sources [%d] and targets [%d]' % (len(sources), len(targets))))
 if (isinstance(regions, tuple) or (regions is None)):
  regions = [regions]
 if ((len(sources) > 1) and (len(regions) == 1)):
  regions *= len(sources)
 if (len(sources) != len(regions)):
  raise ValueError(('Different number of sources [%d] and targets [%d] than regions [%d]' % (len(sources), len(targets), len(regions))))
 updates = [insert_to_ooc(tgt, src, lock=lock, region=reg) for (tgt, src, reg) in zip(targets, sources, regions)]
 dsk = merge(([src.dask for src in sources] + updates))
 keys = [key for u in updates for key in u]
 if compute:
  Array._get(dsk, keys, **kwargs)
 else:
  from ..delayed import Delayed
  name = ('store-' + tokenize(*keys))
  dsk[name] = keys
  return Delayed(name, [dsk])

def store ( sources , targets , lock = True , regions = None , compute = True , ** kwargs ) : if isinstance ( sources , Array ) : sources = [ sources ] targets = [ targets ] if any ( ( ( not isinstance ( s , Array ) ) for s in sources ) ) : raise ValueError ( 'All sources must be dask array objects' ) if ( len ( sources ) != len ( targets ) ) : raise ValueError ( ( 'Different number of sources [%d] and targets [%d]' % ( len ( sources ) , len ( targets ) ) ) ) if ( isinstance ( regions , tuple ) or ( regions is None ) ) : regions = [ regions ] if ( ( len ( sources ) > 1 ) and ( len ( regions ) == 1 ) ) : regions *= len ( sources ) if ( len ( sources ) != len ( regions ) ) : raise ValueError ( ( 'Different number of sources [%d] and targets [%d] than regions [%d]' % ( len ( sources ) , len ( targets ) , len ( regions ) ) ) ) updates = [ insert_to_ooc ( tgt , src , lock = lock , region = reg ) for ( tgt , src , reg ) in zip ( targets , sources , regions ) ] dsk = merge ( ( [ src . dask for src in sources ] + updates ) ) keys = [ key for u in updates for key in u ] if compute : Array . _get ( dsk , keys , ** kwargs ) else : from . . delayed import Delayed name = ( 'store-' + tokenize ( * keys ) ) dsk [ name ] = keys return Delayed ( name , [ dsk ] )
store the object x and returns a new object descriptor for it .