def from_castra(x, columns=None, index=False):
 from castra import Castra
 if (not isinstance(x, Castra)):
  x = Castra(x, readonly=True)
 elif (not x._readonly):
  x = Castra(x.path, readonly=True)
 if (columns is None):
  columns = x.columns
 name = ('from-castra-' + tokenize(os.path.getmtime(x.path), x.path, columns, index))
 dsk = dict((((name, i), (load_castra_partition, x, part, columns, index)) for (i, part) in enumerate(x.partitions)))
 return Bag(dsk, name, len(x.partitions))

def from_castra ( x , columns = None , index = False ) : from castra import Castra if ( not isinstance ( x , Castra ) ) : x = Castra ( x , readonly = True ) elif ( not x . _readonly ) : x = Castra ( x . path , readonly = True ) if ( columns is None ) : columns = x . columns name = ( 'from-castra-' + tokenize ( os . path . getmtime ( x . path ) , x . path , columns , index ) ) dsk = dict ( ( ( ( name , i ) , ( load_castra_partition , x , part , columns , index ) ) for ( i , part ) in enumerate ( x . partitions ) ) ) return Bag ( dsk , name , len ( x . partitions ) )
load a dask bag from a castra .