def record_magic(dct, magic_kind, magic_name, func):
 if (magic_kind == 'line_cell'):
  dct['line'][magic_name] = dct['cell'][magic_name] = func
 else:
  dct[magic_kind][magic_name] = func

def record_magic ( dct , magic_kind , magic_name , func ) : if ( magic_kind == 'line_cell' ) : dct [ 'line' ] [ magic_name ] = dct [ 'cell' ] [ magic_name ] = func else : dct [ magic_kind ] [ magic_name ] = func
utility function to store a function as a magic of a specific kind .