def magics_class(cls):
 cls.registered = True
 cls.magics = dict(line=magics['line'], cell=magics['cell'])
 magics['line'] = {}
 magics['cell'] = {}
 return cls

def magics_class ( cls ) : cls . registered = True cls . magics = dict ( line = magics [ 'line' ] , cell = magics [ 'cell' ] ) magics [ 'line' ] = { } magics [ 'cell' ] = { } return cls
class decorator for all subclasses of the main magics class .