code: def active_knocks(obj):
      
      if not hasattr(_thread_locals, 'knock_enabled'):
          return True
      return _thread_locals.knock_enabled.get(obj.__class__, True)
docs: Checks whether knocks are enabled for the model given as argument
  
      :param obj: model instance
      :return True if knocks are active