<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def active_knocks(obj):
 """ Checks whether knocks are enabled for the model given as argument :param obj: model instance :return True if knocks are active """

    if not hasattr(_thread_locals, 'knock_enabled'):
        return True
    return _thread_locals.knock_enabled.get(obj.__class__, True)