def get_doc_hooks():
 if (not hasattr(local, u'doc_events_hooks')):
  hooks = get_hooks(u'doc_events', {})
  out = {}
  for (key, value) in hooks.iteritems():
   if isinstance(key, tuple):
    for doctype in key:
     append_hook(out, doctype, value)
   else:
    append_hook(out, key, value)
  local.doc_events_hooks = out
 return local.doc_events_hooks

def get_doc_hooks ( ) : if ( not hasattr ( local , u'doc_events_hooks' ) ) : hooks = get_hooks ( u'doc_events' , { } ) out = { } for ( key , value ) in hooks . iteritems ( ) : if isinstance ( key , tuple ) : for doctype in key : append_hook ( out , doctype , value ) else : append_hook ( out , key , value ) local . doc_events_hooks = out return local . doc_events_hooks
returns hooked methods for given doc .