a
    x=ic                     @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ eeZdee ee ed
ddZeedddZdS )z
Axes utility functions that are publicly available.

This module is separate for historical reasons
and offers a backwards compatible import path.
    )	getLogger)Optional)HttpRequest)settings)AxesProxyHandler)get_client_ip_addressNF)ipusernamereturnc                 C   s   t j| ||dS )
    Reset records that match IP or username, and return the count of removed attempts.

    This utility method is meant to be used from the CLI or via Python API.
    )
ip_addressr	   ip_or_username)r   Zreset_attempts)r   r	   r    r   [/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/axes/utils.pyreset   s    	r   )requestr
   c                 C   sP   t | }| jdd}tj}tjr(d}ntjs8tjs8d}|sD|sDdS t|||S )r   r	   Nr   )r   GETgetr   ZAXES_LOCK_OUT_BY_USER_OR_IPZAXES_ONLY_USER_FAILURESZ(AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IPr   )r   r   r	   r   r   r   r   reset_request"   s    r   )NNF)__doc__loggingr   typingr   Zdjango.httpr   Z	axes.confr   Zaxes.handlers.proxyr   Zaxes.helpersr   __name__logstrintr   r   r   r   r   r   <module>   s    