File: //home/arjun/projects/env/lib/python3.10/site-packages/pendulum/__pycache__/time.cpython-310.pyc
o
'we� � @ s� d dl mZ d dlmZ d dlmZ d dlZddlmZ ddlmZ ddlm Z dd l
mZ dd
l
mZ ddl
mZ G dd
� d
ee�Zed d d �e_edddd�e_edd�e_dS )� )�absolute_import)�time)� timedeltaN� )�
SECS_PER_HOUR)�SECS_PER_MIN)�
USECS_PER_SEC)�AbsoluteDuration)�Duration)�FormattableMixinc s� e Zd ZdZdd� Zdd� Zdd� Zd)d d
�Zd)dd�Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
d*dd�Zd+dd�Z d,� fdd� Zd d!� Zd-d#d$�Zd%d&� Zd'd(� Z� ZS ).�TimezJ
Represents a time instance as hour, minute, second, microsecond.
c C sN d}| j rd�| j �}d}| jrd�t| j��}d�| jj| j| j| j||�S )N� z, {}z, tzinfo={}z{}({}, {}, {}{}{})) �microsecond�format�tzinfo�repr� __class__�__name__�hour�minute�second)�self�usr � r �F/home/arjun/projects/env/lib/python3.10/site-packages/pendulum/time.py�__repr__ s �z
Time.__repr__c C sT | � |j|j|j|j�}| � |j|j|j|j�}| �|��� | �|��� k r(|S |S )z�
Get the closest time from the instance.
:type dt1: Time or time
:type dt2: Time or time
:rtype: Time
�r r r r r �diff�
in_seconds�r �dt1�dt2r r r �closest% �
zTime.closestc C sT | � |j|j|j|j�}| � |j|j|j|j�}| �|��� | �|��� kr(|S |S )z�
Get the farthest time from the instance.
:type dt1: Time or time
:type dt2: Time or time
:rtype: Time
r r r r r �farthest6 r# z
Time.farthestr c C �8 ddl m} |j�| j| j| j| j�j||||d�� � S �av
Add duration to the instance.
:param hours: The number of hours
:type hours: int
:param minutes: The number of minutes
:type minutes: int
:param seconds: The number of seconds
:type seconds: int
:param microseconds: The number of microseconds
:type microseconds: int
:rtype: Time
r )�DateTime)�hours�minutes�seconds�microseconds)
�datetimer'