�
���g� � � � d dl Z d dlZd dlZd dlmZ d dlmZmZ d dlm Z mZm
Z
d dlmZ d dl
mZ d dlZd dlmZmZ e j d� � Zd � Zd
� Zd� Zd� Zd
� Zd� Zd� Zd� Zd� Zdefd�Z G d� de� � Z d� Z!d� Z"d� Z#dS )� N)�defaultdict)�asdict�is_dataclass)�date�datetime�timezone)�Decimal)�UUID)�tzlocal�tzutc�posthogc �L � | j du p| j � | � � du S )z1Determines if a given datetime.datetime is naive.N)�tzinfo� utcoffset)�dts �]/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/posthog/utils.py�is_naiver s) � �
�9���?�� � 3� 3�B� 7� 7�4� ?�?� c �H � | j | j | j dz dz z dz z dz S )z2Determines total seconds with python < 2.7 compat.� i g ��.A)�microseconds�seconds�days)�deltas r �
total_secondsr s/ � �
��%�-�%�*�r�/�D�2H�"H�C�!O�O�SV�V�Vr c �� � t | � � rmt j � � | z
}t |� � dk r"| � t � � �� � S | � t
� � �� � S | S )z:Attempts to convert a naive datetime to an aware datetime.� �r )r r �nowr �replacer r )r r s r �guess_timezoner! sn � ���|�|�
.� �����#������!�#�#� �:�:�W�Y�Y�:�/�/�/� �:�:�U�W�W�:�-�-�-�
�Ir c �D � | � d� � r
| d d� S | S )N�/�����)�endswith)�hosts r �remove_trailing_slashr'