o
    Ch                     @   sh   d dl mZ d dlZzd dlmZ W n ey!   d dlmZ Y nw dd Zdd Zdd	 Z	d
d Z
dS )    )unicode_literalsN)Callablec                 C   s"   t | jtr|  }|S | j}|S N)
isinstanceis_authenticatedr   )userauthenticated r	   g/var/www/html/myvaluetrips/my_value_trip_new/venv/lib/python3.10/site-packages/rolepermissions/utils.pyuser_is_authenticated
   s
   r   c                 C   s0   t d}t d}|d| }|d| S )z
    https://gist.github.com/jaytaylor/3660565
    Is it ironic that this function is written in camel case, yet it
    converts to snake case? hmm..
    z(.)([A-Z][a-z]+)z([a-z0-9])([A-Z])z\1_\2)recompilesublower)s_underscorer1_underscorer2subbedr	   r	   r
   camelToSnake   s   

r   c                 C   s   d dd | dD S )N c                 s   s    | ]}|  V  qd S r   )
capitalize).0xr	   r	   r
   	<genexpr>!   s    z!snake_to_title.<locals>.<genexpr>_)joinsplitr   r	   r	   r
   snake_to_title    s   r   c                 C   s   t t| S r   )r   r   r   r	   r	   r
   camel_or_snake_to_title$   s   r   )
__future__r   r   collections.abcr   ImportErrorcollectionsr   r   r   r   r	   r	   r	   r
   <module>   s    	