def _removeHook(klass, name, phase, func):
 phaselistname = phase(klass, name)
 if (not hasattr(klass, ORIG(klass, name))):
  raise HookError('no hooks present!')
 phaselist = getattr(klass, phase(klass, name))
 try:
  phaselist.remove(func)
 except ValueError:
  raise HookError(('hook %s not found in removal list for %s' % (name, klass)))
 if ((not getattr(klass, PRE(klass, name))) and (not getattr(klass, POST(klass, name)))):
  _dehook(klass, name)

def _removeHook ( klass , name , phase , func ) : phaselistname = phase ( klass , name ) if ( not hasattr ( klass , ORIG ( klass , name ) ) ) : raise HookError ( 'no hooks present!' ) phaselist = getattr ( klass , phase ( klass , name ) ) try : phaselist . remove ( func ) except ValueError : raise HookError ( ( 'hook %s not found in removal list for %s' % ( name , klass ) ) ) if ( ( not getattr ( klass , PRE ( klass , name ) ) ) and ( not getattr ( klass , POST ( klass , name ) ) ) ) : _dehook ( klass , name )
removes a hook from a method on a class .