403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/nltk/twitter/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/nltk/twitter/__pycache__/api.cpython-311.pyc
�

 T�c����dZddlZddlmZmZddlmZmZmZm	Z	Gd�de	��Z
e
��ZGd�de�	��ZGd
�de��Z
dS)zY
This module provides an interface for TweetHandlers, and support for timezone
handling.
�N)�ABCMeta�abstractmethod)�datetime�	timedelta�timezone�tzinfoc�t�eZdZdZeej���Zejreej	���Z
neZ
d�ZdS)�LocalTimezoneOffsetWithUTCa�
    This is not intended to be a general purpose class for dealing with the
    local timezone. In particular:

    * it assumes that the date passed has been created using
      `datetime(..., tzinfo=Local)`, where `Local` is an instance of
      the object `LocalTimezoneOffsetWithUTC`;
    * for such an object, it returns the offset with UTC, used for date comparisons.

    Reference: https://docs.python.org/3/library/datetime.html
    )�secondsc��|jS)z2
        Access the relevant time offset.
        )�	DSTOFFSET)�self�dts  �2/usr/lib/python3/dist-packages/nltk/twitter/api.py�	utcoffsetz$LocalTimezoneOffsetWithUTC.utcoffset's���~��N)�__name__�
__module__�__qualname__�__doc__r�_timer�	STDOFFSET�daylight�altzoner
r�rrr
r
sl������
�
��	�5�>�/�2�2�2�I��~���I�u�}�n�5�5�5�	�	��	�����rr
c� �eZdZdZdd�Zd�ZdS)�BasicTweetHandlerz�
    Minimal implementation of `TweetHandler`.

    Counts the number of Tweets and decides when the client should stop
    fetching them.
    �c�B�||_d|_	d|_	d|_dS)NrF)�limit�counter�do_stop�max_id)rr s  r�__init__zBasicTweetHandler.__init__9s0����
����	����	�����rc�2�|j|jko|jS)zL
        Returns `False` if the client should stop fetching Tweets.
        )r!r r"�rs r�do_continuezBasicTweetHandler.do_continueHs���|�d�j�(�=���-=�=rN)r)rrrrr$r'rrrrr1sA��������
�
�
�
�>�>�>�>�>rr)�	metaclassc�N�eZdZdZd	d�Zed���Zed���Zd
d�ZdS)�
TweetHandlerIzu
    Interface class whose subclasses should implement a handle method that
    Twitter clients can delegate to.
    rNc���t�||��d|_d|_|rt	|dt
i�|_|rt	|dt
i�|_d|_dS)a
        :param int limit: The number of data items to process in the current        round of processing.

        :param tuple upper_date_limit: The date at which to stop collecting        new data. This should be entered as a tuple which can serve as the        argument to `datetime.datetime`.        E.g. `date_limit=(2015, 4, 1, 12, 40)` for 12:30 pm on April 1 2015.

        :param tuple lower_date_limit: The date at which to stop collecting        new data. See `upper_data_limit` for formatting.
        NrT)rr$�upper_date_limit�lower_date_limitr�LOCAL�
startingup)rr r,r-s    rr$zTweetHandlerI.__init__Uss��	�"�"�4��/�/�/� $��� $����	N�$,�.>�$M�u�$M�$M�D�!��	N�$,�.>�$M�u�$M�$M�D�!�����rc��dS)zJ
        Deal appropriately with data returned by the Twitter API
        Nr)r�datas  r�handlezTweetHandlerI.handlem����rc��dS)z?
        Actions when the tweet limit has been reached
        Nrr&s r�	on_finishzTweetHandlerI.on_finishsr3rFc�z�|js|jr�d}tj|d|���t
j���}|jr||jks|jrV||jkrM|jr
d}|j}n	d}|j}|r$td�|||����d|_	dSdSdSdS)	z'
        Validate date limits.
        z%a %b %d %H:%M:%S +0000 %Y�
created_at)r�earlier�laterz1Date limit {} is {} than date of current tweet {}TN)
r,r-r�strptime�replacer�utc�print�formatr")rr1�verbose�date_fmt�
tweet_date�message�
date_limits       r�check_date_limitzTweetHandlerI.check_date_limitys��� �	$�D�$9�	$�3�H�!�*�4��+=�x�H�H�P�P��|�Q���J��%�
$�*�t�7L�*L�*L��%�+M�*4�t�7L�*L�*L��(�7�'�G�!%�!6�J�J�%�G�!%�!6�J����K�R�R�&��������
 $�����)	$�	$�
+M�*L�*L�*Lr)rNN)F)	rrrrr$rr2r5rDrrrr*r*Os|��������
����0����^��
����^��
$�$�$�$�$�$rr*)r�timer�abcrrrrrrr
r.rr*rrr�<module>rGs����
����'�'�'�'�'�'�'�'�:�:�:�:�:�:�:�:�:�:�:�:����������6	#�"�$�$��>�>�>�>�>�'�>�>�>�>�<B$�B$�B$�B$�B$�%�B$�B$�B$�B$�B$r

Youez - 2016 - github.com/yon3zu
LinuXploit