HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/tweepy/__pycache__/api.cpython-310.pyc
o

+weG�@s�ddlZddlZddlZddlZddlZddlmZddlZddlZddl	m
Z
ddlZddlZddl
mZmZmZmZmZmZmZmZddlmZddlmZmZddlmZe�e�Zdd	�Z d
d�Z!Gdd
�d
�Z"dS)�N)�python_version)�	urlencode)�
BadRequest�	Forbidden�
HTTPException�NotFound�TooManyRequests�TweepyException�TwitterServerError�Unauthorized)�Model)�ModelParser�Parser)�list_to_csvcs�fdd�}|S)Ncs t����fdd��}�|_|S)Ncs�|i|��S�N���args�kwargs��methodr�C/home/arjun/projects/env/lib/python3.10/site-packages/tweepy/api.py�wrappersz.pagination.<locals>.decorator.<locals>.wrapper)�	functools�wraps�pagination_mode�rr��moderr�	decoratorszpagination.<locals>.decoratorr)rrrrr�
paginationsr cs|�dd����fdd�}|S)N�listFcs*t������fdd��}�|_�|_|S)Ncs�|d<�|d<�|i|��S)N�payload_list�payload_typerr)rr"r#rrr*sz+payload.<locals>.decorator.<locals>.wrapper)rrr"r#r�r"r#rrr)s
zpayload.<locals>.decorator)�get)r#�payload_kwargsrrr$r�payload's	r'c@s�eZdZdZ	d�dddddddddddd�d	d
�Zdddddddddddddd
�
dd�Zedd�eddd�dd���Zedd�eddd�dd���Z	edd�eddd�dd���Z
edd�eddd�dd���Zeddd�dd��Zed�dd ��Z
ed!d�ed"�d#d$���Zeddd�d%d&��Zedd�eddd�d'd(���Zed�d)d*��Zed�d+d,��Zed�d-d.��Zed�d/d0��Zed�d1d2��Zed�d3d4��Zed�d5d6��Zed�dd7�d8d9��Zedd�ed:�d;d<���Zed=dd�d>d?��Zed!d�ed@dd�dAdB���Zed@�dCdD��Zed!d�ed=dd�dEdF���Zed!d�ed=dd�dGdH���Zed=�dIdJ��Zedd�eddd�dKdL���Z ed!d�ed@dd�dMdN���Z!ed@�dOdP��Z"ed!d�ed=dd�dQdR���Z#ed=�dSdT��Z$ed=�dUdV��Z%ed=�dWdX��Z&ed=�dYdZ��Z'ed=�d[d\��Z(ed=�d]d^��Z)ed=�d_d`��Z*ed=�dadb��Z+ed=�dcdd��Z,ed!d�ed"�dedf���Z-ed!d�ed@dd�dgdh���Z.ed!d�ed"�didj���Z/ed!d�ed@dd�dkdl���Z0ed!d�ed"�dmdn���Z1edodd�dddp�dqdr��Z2ed"�dsdt��Z3ed!d�ed"�dudv���Z4edw�dxdy��Z5ed@dd�dddp�dzd{��Z6ed|d�ed@dd�d}d~���Z7ed@�dd���Z8ed@�d�d���Z9ed@�d�d���Z:edw�d�d���Z;ed�d�d���Z<ed@�d�d���Z=ed�dd�d�d���Z>ed��d�d���Z?ed�d�d���Z@d�d��ZAed�d�d���ZBed@�d�d���ZCdd7�d�d��ZDed@�dd7�d�d���ZEed��d�d���ZFed��d�d���ZGed!d�ed"�d�d����ZHed!d�ed@dd�d�d����ZIed!d�ed"�d�d����ZJed!d�ed@dd�d�d����ZKed@�d�d���ZLed@�d�d���ZMed@�d�d���ZNed@�d�d���ZOed@�d�d���ZPd�d��ZQed�d�ed�dd�d�d����ZRed��d�d���ZSed��ddddd��d�d���ZTd�d��ZUd�d��ZVed��d�dÄ�ZWd�dńZXdddddƜd�dȄZYed��ddddɜd�d˄�ZZdddddd̜d�d΄Z[d�dЄZ\ed��d�d҄�Z]ed��dddӜd�dՄ�Z^ed�d�dׄ�Z_ed�d�dل�Z`ed�d�dۄ�Zaed܃d�dބ�Zbed�dd�d�d��Zced�dd�d�d��Zded�d�d��Zeed�d�d��ZfdS)��APIa�Twitter API v1.1 Interface

    .. versionchanged:: 4.11
        Added support for ``include_ext_edit_control`` endpoint/method
        parameter

    .. versionchanged:: 4.14
        Removed ``search_30_day`` and ``search_full_archive`` methods, as
        `the Premium v1.1 API has been deprecated`_

    Parameters
    ----------
    auth
        The authentication handler to be used
    cache
        The cache to query if a GET method is used
    host
        The general REST API host server URL
    parser
        The Parser instance to use for parsing the response from Twitter;
        defaults to an instance of ModelParser
    proxy
        The full url to an HTTPS proxy to use for connecting to Twitter
    retry_count
        Number of retries to attempt when an error occurs
    retry_delay
        Number of seconds to wait between retries
    retry_errors
        Which HTTP status codes to retry
    timeout
        The maximum amount of time to wait for a response from Twitter
    upload_host
        The URL of the upload server
    wait_on_rate_limit
        Whether or not to automatically wait for rate limits to replenish

    Raises
    ------
    TypeError
        If the given parser is not a Parser instance

    References
    ----------
    https://developer.twitter.com/en/docs/api-reference-index

    .. _the Premium v1.1 API has been deprecated: https://twittercommunity.com/t/deprecating-the-premium-v1-1-api/191092
    Nzapi.twitter.comr�<zupload.twitter.comF)�cache�host�parser�proxy�retry_count�retry_delay�retry_errors�timeout�upload_host�
user_agent�wait_on_rate_limitc
Cs�||_||_||_|durt�}||_i|_|dur||jd<||_||_||_|	|_	|
|_
|dur@dt��dtj
�dtj
��}||_||_t|jt�sWtdtt|j����t��|_dS)N�httpszPython/z
 Requests/z Tweepy/z,parser should be an instance of Parser, not )�authr*r+r
r,r-r.r/r0r1r2r�requests�__version__�tweepyr3r4�
isinstancer�	TypeError�str�type�Session�session)
�selfr6r*r+r,r-r.r/r0r1r2r3r4rrr�__init__fs<

�����zAPI.__init__rT)
�endpoint_parameters�params�headers�json_payloadr,r"r#�	post_data�files�require_auth�return_cursors�
upload_api�	use_cachec
 Ks4|r	|js	td��d|_|duri}|j|d<d|�d�}|r'd|j|}nd|j|}|dur4i}|��D]\}}|durAq8||dvrOt�d|���t	|�||<q8t�
d	|�|r�|jr�|d
kr�|j�|�dt
|����}|r�t|t�r�|D]
}t|t�r�||_q{nt|t�r�||_d|_|Sd}d}|dur�|j}�zsd
}||jk�r�|jr�|dur�|dur�|dkr�|tt���}|d
kr�t�d|���t�|d�d}|jr�|j��}z|jj|||||
|||j||jd�
}Wnt�y}ztd|����t� �d��d}~wwd|j!k�rdk�rnnnc|j"�d�}|du�r-t|�}n	|du�r6|d8}|j"�d�}|du�rEt|�}|j#}|j!dv�rf|j�rf|d
k�rXq�d|j"v�ret$|j"d�}n|j%�rr|j!|j%v�rrnt�|�|d7}||jks�||_&|j!dk�r�t'|��|j!dk�r�t(|��|j!dk�r�t)|��|j!dk�r�t*|��|j!dk�r�t+|��|j!dk�r�t,|��|j!�r�d|j!k�r�dk�s�t-|��t-|��|
�p�d|v�p�d |v}
|j.|j/|||	|
d!�}|�r|j�r|d
k�r|�r|j�0|�dt
|���|�|W|j�1�S|j�1�w)"NzAuthentication required!Fz
User-Agentz/1.1/z.jsonzhttps://)�include_ext_edit_control�
tweet_modezUnexpected parameter: z
PARAMS: %r�GET�?Tr�z"Rate limit reached. Sleeping for: )rCrD�datarG�jsonr1r6�proxieszFailed to send request: ���i,zx-rate-limit-remainingzx-rate-limit-reset)i��zretry-afteri�i�i�i�rVi��cursor�next)�apir"r#rI)2r6r	�
cached_resultr3r2r+�items�log�warningr<�debugr*r%rr:r!r�_apir,r.r4�int�time�sleep�
apply_authr?�requestr1r-�	Exception�with_traceback�sys�exc_info�status_coderDr/�floatr0�
last_responserrrrrr
r�parse�text�store�close) r@r�endpointrBrCrDrEr,r"r#rFrGrHrIrJrKr�path�url�k�arg�cache_result�result�remaining_calls�
reset_time�retries_performed�
sleep_timer6�resp�e�	rem_callsr/rrrrd�s�



��



���




�

�6 ��zAPI.request�idr�status)r!cK�|j	dddi|��S)aahome_timeline(*, count, since_id, max_id, trim_user,                          exclude_replies, include_entities)

        Returns the 20 most recent statuses, including retweets, posted by
        the authenticating user and that user's friends. This is the equivalent
        of /timeline/home on the Web.

        Parameters
        ----------
        count
            |count|
        since_id
            |since_id|
        max_id
            |max_id|
        trim_user
            |trim_user|
        exclude_replies
            |exclude_replies|
        include_entities
            |include_entities|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-home_timeline
        rN�statuses/home_timelinerB)�count�since_id�max_id�	trim_user�exclude_replies�include_entitiesN)rNr��rd�r@rrrr�
home_timeline*�!���zAPI.home_timelinecKr�)a�mentions_timeline(*, count, since_id, max_id, trim_user,                              include_entities)

        Returns the 20 most recent mentions, including retweets.

        Parameters
        ----------
        count
            |count|
        since_id
            |since_id|
        max_id
            |max_id|
        trim_user
            |trim_user|
        include_entities
            |include_entities|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline
        rN�statuses/mentions_timelinerB)r�r�r�r�r�N)rNr�r�r�rrr�mentions_timelineR����zAPI.mentions_timelinecKr�)a#user_timeline(*, user_id, screen_name, since_id, count, max_id,                          trim_user, exclude_replies, include_rts)

        Returns the 20 most recent statuses posted from the authenticating user
        or the user specified. It's also possible to request another user's
        timeline via the id parameter.

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        since_id
            |since_id|
        count
            |count|
        max_id
            |max_id|
        trim_user
            |trim_user|
        exclude_replies
            |exclude_replies|
        include_rts
            When set to ``false``, the timeline will strip any native retweets
            (though they will still count toward both the maximal length of the
            timeline and the slice selected by the count parameter). Note: If
            you're using the trim_user parameter in conjunction with
            include_rts, the retweets will still contain a full user object.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline
        rN�statuses/user_timelinerB)�user_id�screen_namer�r�r�r�r��include_rtsN)rNr�r�r�rrr�
user_timelineu�)���zAPI.user_timelinecKr�)aIget_favorites(*, user_id, screen_name, count, since_id, max_id,                          include_entities)

        Returns the favorite statuses for the authenticating user or user
        specified by the ID parameter.

        .. versionchanged:: 4.0
            Renamed from ``API.favorites``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        count
            |count|
        since_id
            |since_id|
        max_id
            |max_id|
        include_entities
            |include_entities|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list
        rN�favorites/listrB)r�r�r�r�r�r�N)rNr�r�r�rrr�
get_favorites��#���zAPI.get_favoritescKs|j	ddt|�d�|��S)alookup_statuses(id, *, include_entities, trim_user, map,                            include_ext_alt_text, include_card_uri)

        Returns full Tweet objects for up to 100 Tweets per request, specified
        by the ``id`` parameter.

        .. versionchanged:: 4.0
            Renamed from ``API.statuses_lookup``

        Parameters
        ----------
        id
            A list of Tweet IDs to lookup, up to 100
        include_entities
            |include_entities|
        trim_user
            |trim_user|
        map
            A boolean indicating whether or not to include Tweets that cannot
            be shown. Defaults to False.
        include_ext_alt_text
            |include_ext_alt_text|
        include_card_uri
            |include_card_uri|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup
        rN�statuses/lookup)r~r�r��map�include_ext_alt_text�include_card_uri�rBr~N)rNr��rdr�r@r~rrrr�lookup_statuses�s#���zAPI.lookup_statusesrRcKs|j	dd|dd�|��S)a>get_oembed(             url, *, maxwidth, hide_media, hide_thread, omit_script, align,             related, lang, theme, link_color, widget_type, dnt         )

        Returns a single Tweet, specified by either a Tweet web URL or the
        Tweet ID, in an oEmbed-compatible format. The returned HTML snippet will
        be automatically recognized as an Embedded Tweet when Twitter's widget
        JavaScript is included on the page.

        The oEmbed endpoint allows customization of the final appearance of an
        Embedded Tweet by setting the corresponding properties in HTML markup
        to be interpreted by Twitter's JavaScript bundled with the HTML
        response by default. The format of the returned markup may change over
        time as Twitter adds new features or adjusts its Tweet representation.

        The Tweet fallback markup is meant to be cached on your servers for up
        to the suggested cache lifetime specified in the ``cache_age``.

        Parameters
        ----------
        url
            The URL of the Tweet to be embedded
        maxwidth
            The maximum width of a rendered Tweet in whole pixels. A supplied
            value under or over the allowed range will be returned as the
            minimum or maximum supported width respectively; the reset width
            value will be reflected in the returned ``width`` property. Note
            that Twitter does not support the oEmbed ``maxheight`` parameter.
            Tweets are fundamentally text, and are therefore of unpredictable
            height that cannot be scaled like an image or video. Relatedly, the
            oEmbed response will not provide a value for ``height``.
            Implementations that need consistent heights for Tweets should
            refer to the ``hide_thread`` and ``hide_media`` parameters below.
        hide_media
            When set to ``true``, ``"t"``, or ``1``, links in a Tweet are not
            expanded to photo, video, or link previews.
        hide_thread
            When set to ``true``, ``"t"``, or ``1``, a collapsed version of the
            previous Tweet in a conversation thread will not be displayed when
            the requested Tweet is in reply to another Tweet.
        omit_script
            When set to ``true``, ``"t"``, or ``1``, the ``<script>``
            responsible for loading ``widgets.js`` will not be returned. Your
            webpages should include their own reference to ``widgets.js`` for
            use across all Twitter widgets including Embedded Tweets.
        align
            Specifies whether the embedded Tweet should be floated left, right,
            or center in the page relative to the parent element.
        related
            A comma-separated list of Twitter usernames related to your
            content. This value will be forwarded to Tweet action intents if a
            viewer chooses to reply, like, or retweet the embedded Tweet.
        lang
            Request returned HTML and a rendered Tweet in the specified Twitter
            language supported by embedded Tweets.
        theme
            When set to ``dark``, the Tweet is displayed with light text over a
            dark background.
        link_color
            Adjust the color of Tweet text links with a hexadecimal color
            value.
        widget_type
            Set to ``video`` to return a Twitter Video embed for the given
            Tweet.
        dnt
            When set to ``true``, the Tweet and its embedded page on your site
            are not used for purposes that include personalized suggestions and
            personalized ads.

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed
        rN�statuses/oembed)rr�maxwidth�
hide_media�hide_thread�omit_script�align�related�lang�theme�
link_color�widget_type�dntF)rBrrrHN)rNr�r�)r@rrrrrr�
get_oembed�sQ���zAPI.get_oembedrW�idscK�|j	dd|d�|��S)a�get_retweeter_ids(id, *, count, cursor, stringify_ids)

        Returns up to 100 user IDs belonging to users who have retweeted the
        Tweet specified by the ``id`` parameter.

        .. versionchanged:: 4.0
            Renamed from ``API.retweeters``

        Parameters
        ----------
        id
            |sid|
        count
            |count|
        cursor
            |cursor|
        stringify_ids
            |stringify_ids|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-retweeters-ids
        rN�statuses/retweeters/ids)r~r�rW�
stringify_idsr�N)rNr�r�r�rrr�get_retweeter_idsTs���zAPI.get_retweeter_idscK�|jdd|��fddi|��S)aKget_retweets(id, *, count, trim_user)

        Returns up to 100 of the first Retweets of the given Tweet.

        .. versionchanged:: 4.0
            Renamed from ``API.retweets``

        Parameters
        ----------
        id
            |sid|
        count
            |count|
        trim_user
            |trim_user|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-retweets-id
        rNzstatuses/retweets/rB)r�r�r�r�rrr�get_retweetsxs
���zAPI.get_retweetscKr�)a�get_retweets_of_me(*, count, since_id, max_id, trim_user,                               include_entities, include_user_entities)

        Returns the 20 most recent Tweets of the authenticated user that have
        been retweeted by others.

        .. versionchanged:: 4.0
            Renamed from ``API.retweets_of_me``

        Parameters
        ----------
        count
            |count|
        since_id
            |since_id|
        max_id
            |max_id|
        trim_user
            |trim_user|
        include_entities
            |include_entities|
        include_user_entities
            |include_user_entities|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-retweets_of_me
        rN�statuses/retweets_of_merB)r�r�r�r�r��include_user_entitiesN)rNr�r�r�rrr�get_retweets_of_me�r�zAPI.get_retweets_of_mecKr�)a�get_status(id, *, trim_user, include_my_retweet, include_entities,                       include_ext_alt_text, include_card_uri)

        Returns a single status specified by the ID parameter.

        Parameters
        ----------
        id:
            |sid|
        trim_user
            |trim_user|
        include_my_retweet:
            A boolean indicating if any Tweets returned that have been
            retweeted by the authenticating user should include an additional
            current_user_retweet node, containing the ID of the source status
            for the retweet.
        include_entities
            |include_entities|
        include_ext_alt_text
            |include_ext_alt_text|
        include_card_uri
            |include_card_uri|

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id
        rN�
statuses/show)r~r��include_my_retweetr�r�r�r�N)rNr�r�r�rrr�
get_status�s!���zAPI.get_statuscKr�)a�create_favorite(id, *, include_entities)

        Favorites the status specified in the ``id`` parameter as the
        authenticating user.

        Parameters
        ----------
        id
            |sid|
        include_entities
            |include_entities|

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-create
        �POST�favorites/create�r~r�r�N)r�r�r�r�rrr�create_favorite�����zAPI.create_favoritecKr�)a�destroy_favorite(id, *, include_entities)

        Un-favorites the status specified in the ``id`` parameter as the
        authenticating user.

        Parameters
        ----------
        id
            |sid|
        include_entities
            |include_entities|

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-destroy
        r��favorites/destroyr�r�N)r�r�r�r�rrr�destroy_favoriter�zAPI.destroy_favoritecKr�)adestroy_status(id, *, trim_user)

        Destroy the status specified by the ``id`` parameter. The authenticated
        user must be the author of the status to destroy.

        Parameters
        ----------
        id
            |sid|
        trim_user
            |trim_user|

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id
        r�zstatuses/destroy/rB�r�r�r�rrr�destroy_status"�
���zAPI.destroy_statuscKr�)a�retweet(id, *, trim_user)

        Retweets a Tweet. Requires the ID of the Tweet you are retweeting.

        Parameters
        ----------
        id
            |sid|
        trim_user
            |trim_user|

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-retweet-id
        r�zstatuses/retweet/rBr�r�r�rrr�retweet>s
���zAPI.retweetcKr�)a�unretweet(id, *, trim_user)

        Untweets a retweeted status. Requires the ID of the retweet to
        unretweet.

        Parameters
        ----------
        id
            |sid|
        trim_user
            |trim_user|

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-unretweet-id
        r�zstatuses/unretweet/rBr�r�r�rrr�	unretweetYr�z
API.unretweetcKs0d|vrt|d�|d<|j	dd|d�|��S)a"update_status(             status, *, in_reply_to_status_id, auto_populate_reply_metadata,             exclude_reply_user_ids, attachment_url, media_ids,             possibly_sensitive, lat, long, place_id, display_coordinates,             trim_user, card_uri         )

        Updates the authenticating user's current status, also known as
        Tweeting.

        For each update attempt, the update text is compared with the
        authenticating user's recent Tweets. Any attempt that would result in
        duplication will be blocked, resulting in a 403 error. A user cannot
        submit the same status twice in a row.

        While not rate limited by the API, a user is limited in the number of
        Tweets they can create at a time. If the number of updates posted by
        the user reaches the current allowed limit this method will return an
        HTTP 403 error.

        Parameters
        ----------
        status
            The text of your status update.
        in_reply_to_status_id
            The ID of an existing status that the update is in reply to. Note:
            This parameter will be ignored unless the author of the Tweet this
            parameter references is mentioned within the status text.
            Therefore, you must include @username, where username is the author
            of the referenced Tweet, within the update.
        auto_populate_reply_metadata
            If set to true and used with in_reply_to_status_id, leading
            @mentions will be looked up from the original Tweet, and added to
            the new Tweet from there. This wil append @mentions into the
            metadata of an extended Tweet as a reply chain grows, until the
            limit on @mentions is reached. In cases where the original Tweet
            has been deleted, the reply will fail.
        exclude_reply_user_ids
            When used with auto_populate_reply_metadata, a comma-separated list
            of user ids which will be removed from the server-generated
            @mentions prefix on an extended Tweet. Note that the leading
            @mention cannot be removed as it would break the
            in-reply-to-status-id semantics. Attempting to remove it will be
            silently ignored.
        attachment_url
            In order for a URL to not be counted in the status body of an
            extended Tweet, provide a URL as a Tweet attachment. This URL must
            be a Tweet permalink, or Direct Message deep link. Arbitrary,
            non-Twitter URLs must remain in the status text. URLs passed to the
            attachment_url parameter not matching either a Tweet permalink or
            Direct Message deep link will fail at Tweet creation and cause an
            exception.
        media_ids
            A list of media_ids to associate with the Tweet. You may include up
            to 4 photos or 1 animated GIF or 1 video in a Tweet.
        possibly_sensitive
            If you upload Tweet media that might be considered sensitive
            content such as nudity, or medical procedures, you must set this
            value to true.
        lat
            The latitude of the location this Tweet refers to. This parameter
            will be ignored unless it is inside the range -90.0 to +90.0 (North
            is positive) inclusive. It will also be ignored if there is no
            corresponding long parameter.
        long
            The longitude of the location this Tweet refers to. The valid
            ranges for longitude are -180.0 to +180.0 (East is positive)
            inclusive. This parameter will be ignored if outside that range, if
            it is not a number, if geo_enabled is disabled, or if there no
            corresponding lat parameter.
        place_id
            A place in the world.
        display_coordinates
            Whether or not to put a pin on the exact coordinates a Tweet has
            been sent from.
        trim_user
            |trim_user|
        card_uri
            Associate an ads card with the Tweet using the card_uri value from
            any ads card response.

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update
        �	media_idsr��statuses/update)
r�in_reply_to_status_id�auto_populate_reply_metadata�exclude_reply_user_ids�attachment_urlr��possibly_sensitive�lat�long�place_id�display_coordinatesr��card_uri)rBrN)r�r��rrd)r@rrrrr�
update_statusus[���zAPI.update_status)�filecKspt���*}|durd||fi}n
d|�t|d��i}|j	dd||d�|��Wd�S1s1wYdS)	a�update_status_with_media(             status, filename, *, file, possibly_sensitive,             in_reply_to_status_id, lat, long, place_id, display_coordinates         )

        Update the authenticated user's status. Statuses that are duplicates or
        too long will be silently ignored.

        .. deprecated:: 3.7.0
            Use :func:`API.media_upload` instead.

        .. versionchanged:: 4.0
            Renamed from ``API.update_with_media``

        Parameters
        ----------
        status
            The text of your status update.
        filename
            |filename|
        file
            |file|
        possibly_sensitive
            Set to true for content which may not be suitable for every
            audience.
        in_reply_to_status_id
            The ID of an existing status that the update is in reply to.
        lat
            The location's latitude that this tweet refers to.
        long
            The location's longitude that this tweet refers to.
        place_id
            Twitter ID of location which is listed in the Tweet if geolocation
            is enabled for the user.
        display_coordinates
            Whether or not to put a pin on the exact coordinates a Tweet has
            been sent from.

        Returns
        -------
        :class:`~tweepy.models.Status`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update_with_media
        Nzmedia[]�rbr��statuses/update_with_media)rr�r�r�r�r�r�)rBrrG)r�r���
contextlib�	ExitStack�
enter_context�openrd)r@r�filenamer�r�stackrGrrr�update_status_with_media�s
1���$�zAPI.update_status_with_media�search_resultscKr�)usearch_tweets(q, *, geocode, lang, locale, result_type, count,                          until, since_id, max_id, include_entities)

        Returns a collection of relevant Tweets matching a specified query.

        Please note that Twitter's search service and, by extension, the Search
        API is not meant to be an exhaustive source of Tweets. Not all Tweets
        will be indexed or made available via the search interface.

        .. note::

            Twitter's standard search API only "searches against a sampling of
            recent Tweets published in the past 7 days."

            If you're specifying an ID range beyond the past 7 days or there
            are no results from the past 7 days, then no results will be
            returned.

            See `Twitter's documentation on the standard search API`_ for more
            information.

        .. note::

            In API v1.1, the response format of the Search API has been
            improved to return Tweet objects more similar to the objects you’ll
            find across the REST API and platform. However, perspectival
            attributes (fields that pertain to the perspective of the
            authenticating user) are not currently supported on this endpoint.
            [#]_\ [#]_

        .. versionchanged:: 4.0
            Renamed from ``API.search``

        Parameters
        ----------
        q
            The search query string of 500 characters maximum, including
            operators. Queries may additionally be limited by complexity.
        geocode
            Returns tweets by users located within a given radius of the given
            latitude/longitude.  The location is preferentially taking from the
            Geotagging API, but will fall back to their Twitter profile. The
            parameter value is specified by "latitude,longitude,radius", where
            radius units must be specified as either "mi" (miles) or "km"
            (kilometers). Note that you cannot use the near operator via the
            API to geocode arbitrary locations; however you can use this
            geocode parameter to search near geocodes directly. A maximum of
            1,000 distinct "sub-regions" will be considered when using the
            radius modifier.
        lang
            Restricts tweets to the given language, given by an ISO 639-1 code.
            Language detection is best-effort.
        locale
            Specify the language of the query you are sending (only ja is
            currently effective). This is intended for language-specific
            consumers and the default should work in the majority of cases.
        result_type
            Specifies what type of search results you would prefer to receive.
            The current default is "mixed." Valid values include:

            * mixed : include both popular and real time results in the                       response
            * recent : return only the most recent results in the response
            * popular : return only the most popular results in the response
        count
            |count|
        until
            Returns tweets created before the given date. Date should be
            formatted as YYYY-MM-DD. Keep in mind that the search index has a
            7-day limit. In other words, no tweets will be found for a date
            older than one week.
        since_id
            |since_id| There are limits to the number of Tweets which can be
            accessed through the API. If the limit of Tweets has occurred since
            the since_id, the since_id will be forced to the oldest ID
            available.
        max_id
            |max_id|
        include_entities
            |include_entities|

        Returns
        -------
        :class:`SearchResults`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/api-reference/get-search-tweets

        .. _Twitter's documentation on the standard search API: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/overview
        rN�
search/tweets)
�q�geocoder��locale�result_typer��untilr�r�r��rBr�N)rNr�r��r@r�rrrr�
search_tweetss^���zAPI.search_tweetsr!cKr�)a`get_lists(*, user_id, screen_name, reverse)

        Returns all lists the authenticating or specified user subscribes to,
        including their own. The user is specified using the ``user_id`` or
        ``screen_name`` parameters. If no user is given, the authenticating
        user is used.

        A maximum of 100 results will be returned by this call. Subscribed
        lists are returned first, followed by owned lists. This means that if a
        user subscribes to 90 lists and owns 20 lists, this method returns 90
        subscriptions and 10 owned lists. The ``reverse`` method returns owned
        lists first, so with ``reverse=true``, 20 owned lists and 80
        subscriptions would be returned.

        .. versionchanged:: 4.0
            Renamed from ``API.lists_all``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        reverse
            A boolean indicating if you would like owned lists to be returned
            first. See description above for information on how this parameter
            works.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.List`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list
        rN�
lists/listrB)r�r��reverseN)rNr�r�r�rrr�	get_lists�s&���z
API.get_lists�usercKr�)a�get_list_members(*, list_id, slug, owner_screen_name, owner_id,                             count, cursor, include_entities, skip_status)

        Returns the members of the specified list.

        .. versionchanged:: 4.0
            Renamed from ``API.list_members``

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|
        count
            |count|
        cursor
            |cursor|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members
        rN�
lists/membersrB��list_id�slug�owner_screen_name�owner_idr�rWr��skip_statusN)rNr�r�r�rrr�get_list_members��&���zAPI.get_list_memberscKr�)a2get_list_member(             *, list_id, slug, user_id, screen_name, owner_screen_name,             owner_id, include_entities, skip_status         )

        Check if the specified user is a member of the specified list.

        .. versionchanged:: 4.0
            Renamed from ``API.show_list_member``

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        user_id
            |user_id|
        screen_name
            |screen_name|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Raises
        ------
        :class:`~tweepy.errors.NotFound`
            The user is not a member of the list.

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show
        rN�lists/members/showrB)r�r�r�r�r�r�r�r�N)rNr�r�r�rrr�get_list_member�s,���zAPI.get_list_membercKr�)a5get_list_memberships(*, user_id, screen_name, count, cursor,                                 filter_to_owned_lists)

        Returns the lists the specified user has been added to. If ``user_id``
        or ``screen_name`` are not provided, the memberships for the
        authenticating user are returned.

        .. versionchanged:: 4.0
            Renamed from ``API.lists_memberships``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        count
            |count|
        cursor
            |cursor|
        filter_to_owned_lists
            A boolean indicating whether to return just lists the
            authenticating user owns, and the user represented by ``user_id``
            or ``screen_name`` is a member of.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.List`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships
        rN�lists/membershipsrB)r�r�r�rW�filter_to_owned_listsN)rNr�r�r�rrr�get_list_membershipss$���zAPI.get_list_membershipscKr�)a%get_list_ownerships(*, user_id, screen_name, count, cursor)

        Returns the lists owned by the specified user. Private lists will only
        be shown if the authenticated user is also the owner of the lists. If
        ``user_id`` and ``screen_name`` are not provided, the ownerships for
        the authenticating user are returned.

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        count
            |count|
        cursor
            |cursor|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.List`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships
        rN�lists/ownershipsrB�r�r�r�rWN)rNr�r�r�rrr�get_list_ownerships;r�zAPI.get_list_ownershipscKr�)a~get_list(*, list_id, slug, owner_screen_name, owner_id)

        Returns the specified list. Private lists will only be shown if the
        authenticated user owns the specified list.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show
        rN�
lists/showrB�r�r�r�r�N)rNr�r�r�rrr�get_list^����zAPI.get_listcKr�)alist_timeline(             *, list_id, slug, owner_screen_name, owner_id, since_id, max_id,             count, include_entities, include_rts         )

        Returns a timeline of Tweets authored by members of the specified list.
        Retweets are included by default. Use the ``include_rts=false``
        parameter to omit retweets.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|
        since_id
            |since_id|
        max_id
            |max_id|
        count
            |count|
        include_entities
            |include_entities|
        include_rts
            A boolean indicating whether the list timeline will contain native
            retweets (if they exist) in addition to the standard stream of
            Tweets. The output format of retweeted Tweets is identical to the
            representation you see in home_timeline.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Status`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses
                rN�lists/statusesrB)	r�r�r�r�r�r�r�r�r�N)rNrr�r�rrr�
list_timeline~�,���zAPI.list_timelinecKr�)aget_list_subscribers(             *, list_id, slug, owner_screen_name, owner_id, count, cursor,             include_entities, skip_status         )

        Returns the subscribers of the specified list. Private list subscribers
        will only be shown if the authenticated user owns the specified list.

        .. versionchanged:: 4.0
            Renamed from ``API.list_subscribers``

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|
        count
            |count|
        cursor
            |cursor|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers
        rN�lists/subscribersrBr�N)rNrr�r�rrr�get_list_subscribers�r�zAPI.get_list_subscriberscKr�)aFget_list_subscriber(             *, owner_screen_name, owner_id, list_id, slug, user_id,             screen_name, include_entities, skip_status         )

        Check if the specified user is a subscriber of the specified list.

        .. versionchanged:: 4.0
            Renamed from ``API.show_list_subscriber``

        Parameters
        ----------
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|
        list_id
            |list_id|
        slug
            |slug|
        user_id
            |user_id|
        screen_name
            |screen_name|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Raises
        ------
        :class:`~tweepy.errors.NotFound`
            The user is not a subscriber of the list.

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show
        rN�lists/subscribers/showrB)r�r�r�r�r�r�r�r�N)rNrr�r�rrr�get_list_subscriber�rzAPI.get_list_subscribercKr�)aget_list_subscriptions(*, user_id, screen_name, count, cursor)

        Obtain a collection of the lists the specified user is subscribed to,
        20 lists per page by default. Does not include the user's own lists.

        .. versionchanged:: 4.0
            Renamed from ``API.lists_subscriptions``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        count
            |count|
        cursor
            |cursor|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.List`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions
        rN�lists/subscriptionsrBr�N)rNr	r�r�rrr�get_list_subscriptionss���zAPI.get_list_subscriptionscKr�)aecreate_list(name, *, mode, description)

        Creates a new list for the authenticated user.
        Note that you can create up to 1000 lists per account.

        Parameters
        ----------
        name
            The name of the new list.
        mode
            |list_mode|
        description
            The description of the list you are creating.

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create
        r��lists/create)�namer�description)rBrN)r�rr�)r@rrrrr�create_list8s���zAPI.create_listcKr�)audestroy_list(*, owner_screen_name, owner_id, list_id, slug)

        Deletes the specified list.
        The authenticated user must own the list to be able to destroy it.

        Parameters
        ----------
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|
        list_id
            |list_id|
        slug
            |slug|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy
        r��
lists/destroyrB�r�r�r�r�N)r�rr�r�rrr�destroy_listVrzAPI.destroy_listcKr�)a+add_list_member(*, list_id, slug, user_id, screen_name,                            owner_screen_name, owner_id)

        Add a member to a list. The authenticated user must own the list to be
        able to add members to it. Lists are limited to 5,000 members.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        user_id
            |user_id|
        screen_name
            |screen_name|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create
        r��lists/members/createrB�r�r�r�r�r�r�N)r�rr�r�rrr�add_list_memberv����zAPI.add_list_membercK�Fd|vrt|d�|d<d|vrt|d�|d<|j	dddi|��S)	a�add_list_members(*, list_id, slug, user_id, screen_name,                             owner_screen_name, owner_id)

        Add up to 100 members to a list. The authenticated user must own the
        list to be able to add members to it. Lists are limited to 5,000
        members.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        user_id
            A comma separated list of user IDs, up to 100 are allowed in a
            single request
        screen_name
            A comma separated list of screen names, up to 100 are allowed in a
            single request
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create_all
        r�r�r��lists/members/create_allrBrN)r�rr�r�rrr�add_list_members��"���zAPI.add_list_memberscKr�)a)remove_list_member(*, list_id, slug, user_id, screen_name,                               owner_screen_name, owner_id)

        Removes the specified member from the list. The authenticated user must
        be the list's owner to remove members from the list.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        user_id
            |user_id|
        screen_name
            |screen_name|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy
        r��lists/members/destroyrBrN)r�rr�r�rrr�remove_list_member�rzAPI.remove_list_membercKr)	a�remove_list_members(*, list_id, slug, user_id, screen_name,                                owner_screen_name, owner_id)

        Remove up to 100 members from a list. The authenticated user must own
        the list to be able to remove members from it. Lists are limited to
        5,000 members.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        user_id
            A comma separated list of user IDs, up to 100 are allowed in a
            single request
        screen_name
            A comma separated list of screen names, up to 100 are allowed in a
            single request
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy_all
        r�r�r��lists/members/destroy_allrBrN)r�rr�r�rrr�remove_list_members�rzAPI.remove_list_memberscKr�)aTsubscribe_list(*, owner_screen_name, owner_id, list_id, slug)

        Subscribes the authenticated user to the specified list.

        Parameters
        ----------
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|
        list_id
            |list_id|
        slug
            |slug|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-create
        r��lists/subscribers/createrBrN)r�rr�r�rrr�subscribe_list����zAPI.subscribe_listcKr�)a[unsubscribe_list(*, list_id, slug, owner_screen_name, owner_id)

        Unsubscribes the authenticated user from the specified list.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-destroy
        r��lists/subscribers/destroyrBr�N)r�r!r�r�rrr�unsubscribe_list;r zAPI.unsubscribe_listcKr�)a9update_list(*, list_id, slug, name, mode, description,                        owner_screen_name, owner_id)

        Updates the specified list.
        The authenticated user must own the list to be able to update it.

        Parameters
        ----------
        list_id
            |list_id|
        slug
            |slug|
        name
            The name for the list.
        mode
            |list_mode|
        description
            The description to give the list.
        owner_screen_name
            |owner_screen_name|
        owner_id
            |owner_id|

        Returns
        -------
        :class:`~tweepy.models.List`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-update
        r��lists/updaterB)r�r�rrr
r�r�N)r�r#r�r�rrr�update_listZr�zAPI.update_listcKr�)aget_follower_ids(*, user_id, screen_name, cursor, stringify_ids,                             count)

        Returns an array containing the IDs of users following the specified
        user.

        .. versionchanged:: 4.0
            Renamed from ``API.followers_ids``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        cursor
            |cursor|
        stringify_ids
            |stringify_ids|
        count
            |count|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids
        rN�
followers/idsrB�r�r�rWr�r�N)rNr%r�r�rrr�get_follower_ids��!���zAPI.get_follower_idscKr�)a�get_followers(*, user_id, screen_name, cursor, count, skip_status,                          include_user_entities)

        Returns a user's followers ordered in which they were added. If no user
        is specified by id/screen name, it defaults to the authenticated user.

        .. versionchanged:: 4.0
            Renamed from ``API.followers``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        cursor
            |cursor|
        count
            |count|
        skip_status
            |skip_status|
        include_user_entities
            |include_user_entities|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-list
        rN�followers/listrB�r�r�rWr�r�r�N)rNr)r�r�rrr�
get_followers�r�zAPI.get_followerscKr�)aget_friend_ids(*, user_id, screen_name, cursor, stringify_ids,                           count)

        Returns an array containing the IDs of users being followed by the
        specified user.

        .. versionchanged:: 4.0
            Renamed from ``API.friends_ids``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        cursor
            |cursor|
        stringify_ids
            |stringify_ids|
        count
            |count|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids
        rN�friends/idsrBr&N)rNr,r�r�rrr�get_friend_ids�r(zAPI.get_friend_idscKr�)a�get_friends(*, user_id, screen_name, cursor, count, skip_status,                        include_user_entities)

        Returns a user's friends ordered in which they were added 100 at a
        time. If no user is specified it defaults to the authenticated user.

        .. versionchanged:: 4.0
            Renamed from ``API.friends``

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        cursor
            |cursor|
        count
            |count|
        skip_status
            |skip_status|
        include_user_entities
            |include_user_entities|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-list
        rN�friends/listrBr*N)rNr.r�r�rrr�get_friends�r�zAPI.get_friendscKr�)a�incoming_friendships(*, cursor, stringify_ids)

        Returns a collection of numeric IDs for every user who has a pending
        request to follow the authenticating user.

        .. versionchanged:: 4.0
            Renamed from ``API.friendships_incoming``

        Parameters
        ----------
        cursor
            |cursor|
        stringify_ids
            |stringify_ids|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming
        rN�friendships/incomingrB�rWr�N)rNr0r�r�rrr�incoming_friendships&rzAPI.incoming_friendships�relationship�r�r�cK�"|j	ddt|�t|�d�|��S)a�lookup_friendships(*, screen_name, user_id)

        Returns the relationships of the authenticated user to the list of up
        to 100 screen_name or user_id provided.

        Parameters
        ----------
        screen_name
            A list of screen names, up to 100 are allowed in a single request.
        user_id
            A list of user IDs, up to 100 are allowed in a single request.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Relationship`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup
        rN�friendships/lookupr4�rBr�r�N)rNr6r��r@r�r�rrrr�lookup_friendshipsFs���zAPI.lookup_friendshipscKr�)ano_retweets_friendships(*, stringify_ids)

        Returns a collection of user_ids that the currently authenticated user
        does not want to receive retweets from.

        Parameters
        ----------
        stringify_ids
            |stringify_ids|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-no_retweets-ids
        rN�friendships/no_retweets/idsrB)r�N)rNr:r�r�rrr�no_retweets_friendshipscs���zAPI.no_retweets_friendshipscKr�)a�outgoing_friendships(*, cursor, stringify_ids)

        Returns a collection of numeric IDs for every protected user for whom
        the authenticating user has a pending follow request.

        .. versionchanged:: 4.0
            Renamed from ``API.friendships_outgoing``

        Parameters
        ----------
        cursor
            |cursor|
        stringify_ids
            |stringify_ids|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-outgoing
        rN�friendships/outgoingrBr1N)rNr<r�r�rrr�outgoing_friendships}rzAPI.outgoing_friendships�
friendshipcKr�)aMget_friendship(*, source_id, source_screen_name, target_id,                           target_screen_name)

        Returns detailed information about the relationship between two users.

        .. versionchanged:: 4.0
            Renamed from ``API.show_friendship``

        Parameters
        ----------
        source_id
            The user_id of the subject user.
        source_screen_name
            The screen_name of the subject user.
        target_id
            The user_id of the target user.
        target_screen_name
            The screen_name of the target user.

        Returns
        -------
        :class:`~tweepy.models.Friendship`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show
        rN�friendships/showrB)�	source_id�source_screen_name�	target_id�target_screen_nameN)rNr?r�r�rrr�get_friendship�s���zAPI.get_friendshipcKr5)alookup_users(*, screen_name, user_id, include_entities, tweet_mode)

        Returns fully-hydrated user objects for up to 100 users per request.

        There are a few things to note when using this method.

        * You must be following a protected user to be able to see their most             recent status update. If you don't follow a protected user their             status will be removed.
        * The order of user IDs or screen names may not match the order of             users in the returned array.
        * If a requested user is unknown, suspended, or deleted, then that             user will not be returned in the results list.
        * If none of your lookup criteria can be satisfied by returning a             user object, a HTTP 404 will be thrown.

        Parameters
        ----------
        screen_name
            A list of screen names, up to 100 are allowed in a single request.
        user_id
            A list of user IDs, up to 100 are allowed in a single request.
        include_entities
            |include_entities|
        tweet_mode
            Valid request values are compat and extended, which give
            compatibility mode and extended mode, respectively for Tweets that
            contain over 140 characters.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup
        r��users/lookup)r�r�r�rMr7N)r�rEr�r8rrr�lookup_users�s'���zAPI.lookup_users�pagecKr�)aTsearch_users(q, *, page, count, include_entities)

        Run a search for users similar to Find People button on Twitter.com;
        the same results returned by people search on Twitter.com will be
        returned by using this API (about being listed in the People Search).
        It is only possible to retrieve the first 1000 matches from this API.

        Parameters
        ----------
        q
            The query to run against people search.
        page
            |page|
        count
            |count|
        include_entities
            |include_entities|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-search
        rN�users/search)r�rGr�r�r�N)rNrHr�r�rrr�search_users�s���zAPI.search_userscKr�)aget_user(*, user_id, screen_name, include_entities)

        Returns information about the specified user.

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|
        include_entities
            |include_entities|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show
        rN�
users/showrB)r�r�r�N)rNrJr�r�rrr�get_user	s���zAPI.get_usercKr�)aicreate_friendship(*, screen_name, user_id, follow)

        Create a new friendship with the specified user (aka follow).

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|
        follow
            Enable notifications for the target user in addition to becoming
            friends.

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-create
        r��friendships/createrB)r�r��followN)r�rLr�r�rrr�create_friendship/	����zAPI.create_friendshipcKr�)a�destroy_friendship(*, screen_name, user_id)

        Destroy a friendship with the specified user (aka unfollow).

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy
        r��friendships/destroyrBr4N)r�rPr�r�rrr�destroy_friendshipM	s���zAPI.destroy_friendshipcKr�)a�update_friendship(*, screen_name, user_id, device, retweets)

        Turn on/off Retweets and device notifications from the specified user.

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|
        device
            Turn on/off device notifications from the target user.
        retweets
            Turn on/off Retweets from the target user.

        Returns
        -------
        :class:`~tweepy.models.Friendship`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-update
        r��friendships/updaterB)r�r��device�retweetsN)r�rRr�r�rrr�update_friendshiph	r zAPI.update_friendshipcKr�)a�get_settings()

        Returns settings (including current trend, geo and sleep time
        information) for the authenticating user.

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings
        rN�account/settingsrKFN)rNrVr�r�rrr�get_settings�	s���zAPI.get_settingscKs2d|vrt|d���|d<|j	dddi|��S)a�verify_credentials(*, include_entities, skip_status, include_email)

        Verify the supplied user credentials are valid.

        Parameters
        ----------
        include_entities
            |include_entities|
        skip_status
            |skip_status|
        include_email
            When set to true email will be returned in the user objects as a
            string.

        Raises
        ------
        :class:`~tweepy.errors.Unauthorized`
            Authentication unsuccessful

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials
        �
include_emailrN�account/verify_credentialsrB)r�r�rXN)rNrY)r<�lowerrdr�rrr�verify_credentials�	s���zAPI.verify_credentials�saved_searchcK�|jdi|��S)a�get_saved_searches()

        Returns the authenticated user's saved search queries.

        .. versionchanged:: 4.0
            Renamed from ``API.saved_searches``

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.SavedSearch`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list
        rN�saved_searches/listN)rNr^r�r�rrr�get_saved_searches�	szAPI.get_saved_searchescK�|jdd|��fi|��S)a�get_saved_search(id)

        Retrieve the data for a saved search owned by the authenticating user
        specified by the given ID.

        Parameters
        ----------
        id
            The ID of the saved search to be retrieved.

        Returns
        -------
        :class:`~tweepy.models.SavedSearch`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-show-id
        rNzsaved_searches/show/r�r�rrr�get_saved_search�	�zAPI.get_saved_searchcKr�)a�get_profile_banner(*, user_id, screen_name)

        Returns a map of the available size variations of the specified user's
        profile banner. If the user has not uploaded a profile banner, a HTTP
        404 will be served instead.

        The profile banner data available at each size variant's URL is in PNG
        format.

        Parameters
        ----------
        user_id
            |user_id|
        screen_name
            |screen_name|

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-users-profile_banner
        rN�users/profile_bannerrB)r�r�N)rNrcr�r�rrr�get_profile_banner�	����zAPI.get_profile_bannercKr])a*remove_profile_banner()

        Removes the uploaded profile banner for the authenticating user.

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-remove_profile_banner
        r��account/remove_profile_bannerN)r�rfr�r�rrr�remove_profile_banner
s	zAPI.remove_profile_bannercK�|j	dddd�|��S)a�set_settings(*, sleep_time_enabled, start_sleep_time,                         end_sleep_time, time_zone, trend_location_woeid, lang)

        Updates the authenticating user's settings.

        Parameters
        ----------
        sleep_time_enabled
            When set to ``true``, ``t`` or ``1`` , will enable sleep time for
            the user. Sleep time is the time when push or SMS notifications
            should not be sent to the user.
        start_sleep_time
            The hour that sleep time should begin if it is enabled. The value
            for this parameter should be provided in `ISO 8601`_ format (i.e.
            00-23). The time is considered to be in the same timezone as the
            user's ``time_zone`` setting.
        end_sleep_time
            The hour that sleep time should end if it is enabled. The value for
            this parameter should be provided in `ISO 8601`_ format (i.e.
            00-23). The time is considered to be in the same timezone as the
            user's ``time_zone`` setting.
        time_zone
            The timezone dates and times should be displayed in for the user.
            The timezone must be one of the `Rails TimeZone`_ names.
        trend_location_woeid
            The Yahoo! Where On Earth ID to use as the user's default trend
            location. Global information is available by using 1 as the WOEID.
        lang
            The language which Twitter should render in for this user. The
            language must be specified by the appropriate two letter ISO 639-1
            representation.

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-settings

        .. _ISO 8601: https://en.wikipedia.org/wiki/ISO_8601
        .. _Rails TimeZone: https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html
        r�rV)�sleep_time_enabled�start_sleep_time�end_sleep_time�	time_zone�trend_location_woeidr�F�rBrKN)r�rVr�r�rrr�set_settings
s.���zAPI.set_settingscKr�)aVupdate_profile(*, name, url, location, description,                           profile_link_color, include_entities, skip_status)

        Sets values that users are able to set under the "Account" tab of their
        settings page.

        Parameters
        ----------
        name
            Full name associated with the profile.
        url
            URL associated with the profile. Will be prepended with ``http://``
            if not present
        location
            The city or country describing where the user of the account is
            located. The contents are not normalized or geocoded in any way.
        description
            A description of the user owning the account.
        profile_link_color
            Sets a hex value that controls the color scheme of links used on
            the authenticating user's profile page on twitter.com. This must be
            a valid hexadecimal value, and may be either three or six
            characters (ex: F00 or FF0000).
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile
        r��account/update_profilerB)rrr�locationr
�profile_link_colorr�r�N)r�rpr�r�rrr�update_profileL
r�zAPI.update_profilecKsnt���)}|durd||fi}n
d|�t|d��i}|j	dd|d�|��Wd�S1s0wYdS)	a�update_profile_banner(filename, *, file, width, height,                                  offset_left, offset_top)

        Uploads a profile banner on behalf of the authenticating user.

        Parameters
        ----------
        filename
            |filename|
        file:
            |file|
        width
            The width of the preferred section of the image being uploaded in
            pixels. Use with ``height``, ``offset_left``, and ``offset_top`` to
            select the desired region of the image to use.
        height
            The height of the preferred section of the image being uploaded in
            pixels. Use with ``width``, ``offset_left``, and ``offset_top`` to
            select the desired region of the image to use.
        offset_left
            The number of pixels by which to offset the uploaded image from the
            left. Use with ``height``, ``width``, and ``offset_top`` to select
            the desired region of the image to use.
        offset_top
            The number of pixels by which to offset the uploaded image from the
            top. Use with ``height``, ``width``, and ``offset_left`` to select
            the desired region of the image to use.

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner
        N�bannerr�r��account/update_profile_banner)�width�height�offset_left�
offset_top�rBrG)r�rur�)r@r�r�rr�rGrrr�update_profile_bannery
s
!���$�zAPI.update_profile_bannercKs<|durd||fi}ndt|d�i}|j	dd|d�|��S)	a�update_profile_image(filename, *, file, include_entities,                                 skip_status)

        Update the authenticating user's profile image. Valid formats: GIF,
        JPG, or PNG

        Parameters
        ----------
        filename
            |filename|
        file
            |file|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image
        N�imager�r��account/update_profile_image)r�r�rz)r�r})r�rd)r@r�r�rrGrrr�update_profile_image�
s���zAPI.update_profile_imagecKr�)a�create_saved_search(query)

        Creates a saved search for the authenticated user.

        Parameters
        ----------
        query
            The query of the search the user would like to save.

        Returns
        -------
        :class:`~tweepy.models.SavedSearch`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-create
        r��saved_searches/create)�query)rBr�N)r�rr�)r@r�rrrr�create_saved_search�
����zAPI.create_saved_searchcKr`)adestroy_saved_search(id)

        Destroys a saved search for the authenticated user. The search
        specified by ID must be owned by the authenticating user.

        Parameters
        ----------
        id
            The ID of the saved search to be deleted.

        Returns
        -------
        :class:`~tweepy.models.SavedSearch`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-saved_searches-destroy-id
        r�zsaved_searches/destroy/r�r�rrr�destroy_saved_search�
rbzAPI.destroy_saved_searchcKr�)aLget_blocked_ids(*, stringify_ids, cursor)

        Returns an array of numeric user IDs the authenticating user is
        blocking.

        .. versionchanged:: 4.0
            Renamed from ``API.blocks_ids``

        Parameters
        ----------
        stringify_ids
            |stringify_ids|
        cursor
            |cursor|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-blocks-ids
        rN�
blocks/idsrB�r�rWN)rNr�r�r�rrr�get_blocked_ids�
rzAPI.get_blocked_idscKr�)a�get_blocks(*, include_entities, skip_status, cursor)

        Returns an array of user objects that the authenticating user is
        blocking.

        .. versionchanged:: 4.0
            Renamed from ``API.blocks``

        Parameters
        ----------
        include_entities
            |include_entities|
        skip_status
            |skip_status|
        cursor
            |cursor|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-blocks-list
        rN�blocks/listrB)r�r�rWN)rNr�r�r�rrr�
get_blocks����zAPI.get_blockscKr�)aDget_muted_ids(*, stringify_ids, cursor)

        Returns an array of numeric user IDs the authenticating user has muted.

        .. versionchanged:: 4.0
            Renamed from ``API.mutes_ids``

        Parameters
        ----------
        stringify_ids
            |stringify_ids|
        cursor
            |cursor|

        Returns
        -------
        :py:class:`List`\[:class:`int`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-ids
        rN�mutes/users/idsrBr�N)rNr�r�r�rrr�
get_muted_ids=r zAPI.get_muted_idscKr�)a�get_mutes(*, cursor, include_entities, skip_status)

        Returns an array of user objects the authenticating user has muted.

        .. versionchanged:: 4.0
            Renamed from ``API.mutes``

        Parameters
        ----------
        cursor
            |cursor|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.User`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list
        rN�mutes/users/listrB)rWr�r�N)rNr�r�r�rrr�	get_mutes\rez
API.get_mutescKr�)aBcreate_block(*, screen_name, user_id, include_entities, skip_status)

        Blocks the specified user from following the authenticating user. In
        addition the blocked user will not show in the authenticating users
        mentions or timeline (unless retweeted by another user). If a follow or
        friend relationship exists it is destroyed.

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-blocks-create
        r��
blocks/createrB�r�r�r�r�N)r�r�r�r�rrr�create_block}r�zAPI.create_blockcKr�)a�destroy_block(*, screen_name, user_id, include_entities,                          skip_status)

        Un-blocks the user specified in the ID parameter for the authenticating
        user.

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|
        include_entities
            |include_entities|
        skip_status
            |skip_status|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-blocks-destroy
        r��blocks/destroyrBr�N)r�r�r�r�rrr�
destroy_block�rezAPI.destroy_blockcKr�)a�create_mute(*, screen_name, user_id)

        Mutes the user specified in the ID parameter for the authenticating
        user.

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-create
        r��mutes/users/createrBr4N)r�r�r�r�rrr�create_mute�����zAPI.create_mutecKr�)adestroy_mute(*, screen_name, user_id)

        Un-mutes the user specified in the ID parameter for the authenticating
        user.

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-mutes-users-destroy
        r��mutes/users/destroyrBr4N)r�r�r�r�rrr�destroy_mute�r�zAPI.destroy_mutecKr�)arreport_spam(*, screen_name, user_id, perform_block)

        Report the specified user as a spam account to Twitter.

        Parameters
        ----------
        screen_name
            |screen_name|
        user_id
            |user_id|
        perform_block
            A boolean indicating if the reported account should be blocked.
            Defaults to True.

        Returns
        -------
        :class:`~tweepy.models.User`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-users-report_spam
        r��users/report_spamrB)r�r��
perform_blockN)r�r�r�r�rrr�report_spam�rOzAPI.report_spamcKr�)a�delete_direct_message(id)

        Deletes the direct message specified in the required ID parameter. The
        authenticating user must be the recipient of the specified direct
        message. Direct Messages are only removed from the interface of the
        user context provided. Other members of the conversation can still
        access the Direct Messages.

        .. versionchanged:: 4.0
            Renamed from ``API.destroy_direct_message``

        Parameters
        ----------
        id
            The ID of the Direct Message that should be deleted.

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/delete-message-event
        �DELETE�direct_messages/events/destroy�r~r�N)r�r�r�r�rrr�delete_direct_messages���zAPI.delete_direct_message�	dm_cursor�direct_messagecKr�)a�get_direct_messages(*, count, cursor)

        Returns all Direct Message events (both sent and received) within the
        last 30 days. Sorted in reverse-chronological order.

        .. versionchanged:: 4.0
            Renamed from ``API.list_direct_messages``

        Parameters
        ----------
        count
            |count|
        cursor
            |cursor|

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.DirectMessage`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events
        rN�direct_messages/events/listrB)r�rWN)rNr�r�r�rrr�get_direct_messages3rzAPI.get_direct_messagescKr�)a�get_direct_message(id)

        Returns a specific direct message.

        Parameters
        ----------
        id
            The ID of the Direct Message event that should be returned.

        Returns
        -------
        :class:`~tweepy.models.DirectMessage`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/get-event
        rN�direct_messages/events/showr�r�N)rNr�r�r�rrr�get_direct_messageSr�zAPI.get_direct_message)�quick_reply_options�attachment_type�attachment_media_id�ctasc
Ks�ddd|id|id�d�i}|ddd}	|dur!d	|d
�|	d<|dur2|dur2|d|id
�|	d<|dur:||	d<|j	dd|i|��S)a>send_direct_message(recipient_id, text, *, quick_reply_options,                                attachment_type, attachment_media_id, ctas)

        Sends a new direct message to the specified user from the
        authenticating user.

        Parameters
        ----------
        recipient_id
            The ID of the user who should receive the direct message.
        text
            The text of your Direct Message. Max length of 10,000 characters.
        quick_reply_options
            Array of Options objects (20 max).
        attachment_type
            The attachment type. Can be media or location.
        attachment_media_id
            A media id to associate with the message. A Direct Message may only
            reference a single media_id.
        ctas
            Array of 1-3 call-to-action (CTA) button objects

        Returns
        -------
        :class:`~tweepy.models.DirectMessage`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event
        �event�message_create�recipient_idrm)�target�message_data)r=r�r�N�options)r=r��quick_replyr~)r=�media�
attachmentr�r��direct_messages/events/newrE)r�r�r�)
r@r�rmr�r�r�r�rrEr�rrr�send_direct_messagels0$���
�
����zAPI.send_direct_messagecKr�)udindicate_direct_message_typing(recipient_id)

        Displays a visual typing indicator in the recipient’s Direct Message
        conversation view with the sender. Each request triggers a typing
        indicator animation with a duration of ~3 seconds.

        .. versionadded:: 4.9

        Parameters
        ----------
        recipient_id
            The user ID of the user to receive the typing indicator.

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-typing-indicator
        r��direct_messages/indicate_typing)r�)rBr�N)r�r�r�)r@r�rrrr�indicate_direct_message_typing�s���z"API.indicate_direct_message_typingcK�|j	dd||d�|��S)u�mark_direct_message_read(last_read_event_id, recipient_id)

        Marks a message as read in the recipient’s Direct Message conversation
        view with the sender.

        .. versionadded:: 4.9

        Parameters
        ----------
        last_read_event_id
            The message ID of the most recent message to be marked read. All
            messages before it will be marked read as well.
        recipient_id
            The user ID of the user the message is from.

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-read-receipt
        r��direct_messages/mark_read)�last_read_event_idr�)rBr�r�N)r�r�r�)r@r�r�rrrr�mark_direct_message_read�s���zAPI.mark_direct_message_readr�cKs|j	ddd|dd�|��S)	aget_media_upload_status(media_id)

        Check on the progress of a chunked media upload. If the upload has
        succeeded, it's safe to create a Tweet with this ``media_id``.

        Parameters
        ----------
        media_id
            The ID of the media to check.

        Returns
        -------
        :class:`~tweepy.models.Media`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/get-media-upload-status
        rN�media/upload��command�media_id�STATUST)rBr�r�rJN)rNr�r�)r@r�rrrr�get_media_upload_status�s���zAPI.get_media_upload_statuscKs&|d|id�}|j	d|dd�|��S)	a�create_media_metadata(media_id, alt_text)

        This endpoint can be used to provide additional information about the
        uploaded ``media_id``. This feature is currently only supported for
        images and GIFs. Call this endpoint to attach additional metadata such
        as image alt text.

        Parameters
        ----------
        media_id
            The ID of the media to add alt text to.
        alt_text
            The alt text to add to the image.

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-metadata-create
        rm)r��alt_textr��media/metadata/createT)rErJN)r�r�r�)r@r�r�rrErrr�create_media_metadata�s����zAPI.create_media_metadata)r��chunked�media_category�additional_ownersc
Ks�d}|dur|��}|�d�}|�|�tj||d�}	|	dur$d|	}	nt�|�d}	|s2|	�d�r@|j|f||	||d�|��S|j	|f|||d�|��S)	a!media_upload(filename, *, file, chunked, media_category,                         additional_owners)

        Use this to upload media to Twitter. This calls either
        :func:`API.simple_upload` or :func:`API.chunked_upload`. Chunked media
        upload is automatically used for videos. If ``chunked`` is set or the
        media is a video, ``wait_for_async_finalize`` can be specified as a
        keyword argument to be passed to :func:`API.chunked_upload`.

        Parameters
        ----------
        filename
            |filename|
        file
            |file|
        chunked
            Whether or not to use chunked media upload. Videos use chunked
            upload regardless of this parameter. Defaults to ``False``.
        media_category
            |media_category|
        additional_owners
            |additional_owners|

        Returns
        -------
        :class:`~tweepy.models.Media`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/overview
        N� )�hzimage/rzvideo/)r��	file_typer�r��r�r�r�)
�tell�read�seek�imghdr�what�	mimetypes�
guess_type�
startswith�chunked_upload�
simple_upload)
r@r�r�r�r�r�rr�rqr�rrr�media_upload
s6!


������zAPI.media_uploadr�c	Ks�t���<}|durd||fi}n
d|�t|d��i}i}|dur$||d<|dur,||d<|j	d
||dd	�|��Wd�S1sCwYdS)avsimple_upload(filename, *, file, media_category, additional_owners)

        Use this endpoint to upload media to Twitter. This does not use the
        chunked upload endpoints.

        Parameters
        ----------
        filename
            |filename|
        file
            |file|
        media_category
            |media_category|
        additional_owners
            |additional_owners|

        Returns
        -------
        :class:`~tweepy.models.Media`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload
        Nr�r�r�r�r�r�T�rFrGrJ�r�r�r�)	r@r�r�r�r�rr�rGrFrrrr�P
s$
���$�zAPI.simple_upload)r�r��wait_for_async_finalizer�r�cKsR|pt|d�}|��}	|�dd�|��|	}
|�|	�t|
d�\}}|t|�7}|�dd�}
tt|
d�|�}
t|
|
�\}}|t|�7}|j|
|f||d�|��j	}t
|�D]}|j|||�|
�f|fi|��qV|�
�|j|fi|��}|r�t|d	�r�|jd
dvr�d|jvr�t�|jd
�|j|j	fi|��}|jd
dvr�d|jvs�|S)awchunked_upload(             filename, *, file, file_type, wait_for_async_finalize,             media_category, additional_owners         )

        Use this to upload media to Twitter. This uses the chunked upload
        endpoints and calls :func:`API.chunked_upload_init`,
        :func:`API.chunked_upload_append`, and
        :func:`API.chunked_upload_finalize`. If ``wait_for_async_finalize`` is
        set, this calls :func:`API.get_media_upload_status` as well.

        Parameters
        ----------
        filename
            |filename|
        file
            |file|
        file_type
            The MIME type of the media being uploaded.
        wait_for_async_finalize
            Whether to wait for Twitter's API to finish processing the media.
            Defaults to ``True``.
        media_category
            |media_category|
        additional_owners
            |additional_owners|

        Returns
        -------
        :class:`~tweepy.models.Media`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/uploading-media/chunked-media-upload
        r�rrTi��
chunk_sizeiiP�r�r��processing_info�state)�pending�in_progress�error�check_after_secs)r�r�r��divmod�bool�pop�max�min�chunked_upload_initr��range�chunked_upload_appendr�ro�chunked_upload_finalize�hasattrr�rarbr�)r@r�r�r�r�r�r�r�fp�start�	file_size�min_chunk_size�	remainderr��segmentsr��
segment_indexr�rrrr�|
sJ&
������
�
zAPI.chunked_uploadcKs.d||d�}d|i}|j	d	||dd�|��S)
a�chunked_upload_append(media_id, media, segment_index)

        Use this endpoint to upload a chunk (consecutive byte range) of the
        media file.

        Parameters
        ----------
        media_id
            The ``media_id`` returned from the initialization.
        media
            The raw binary file content being uploaded. It must be <= 5 MB.
        segment_index
            An ordered index of file chunk. It must be between 0-999 inclusive.
            The first segment has index 0, second segment has index 1, and so
            on.

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload-append
        �APPEND)r�r�r�r�r�r�Tr�Nr�r�)r@r�r�r�rrFrGrrrr��
s����zAPI.chunked_upload_appendcKs,ddi}d|d�}|j	d
||dd�|��S)a�chunked_upload_finalize(media_id)

        Use this endpoint after the entire media file is uploaded via
        appending. If (and only if) the response contains a
        ``processing_info field``, it may also be necessary to check its status
        and wait for it to return success before proceeding to Tweet creation.

        Parameters
        ----------
        media_id
            The ``media_id`` returned from the initialization.

        Returns
        -------
        :class:`~tweepy.models.Media`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload-finalize
        �Content-Type�!application/x-www-form-urlencoded�FINALIZEr�r�r�T�rDrFrJNr�r�)r@r�rrDrFrrrr��
s����zAPI.chunked_upload_finalizer�cKsRddi}d||d�}|dur||d<|durt|�|d<|j		d||d
d�|��S)
a�chunked_upload_init(total_bytes, media_type, *, media_category,                                additional_owners)

        Use this endpoint to initiate a chunked file upload session.

        Parameters
        ----------
        total_bytes
            The size of the media being uploaded in bytes.
        media_type
            The MIME type of the media being uploaded.
        media_category
            |media_category|
        additional_owners
            |additional_owners|

        Returns
        -------
        :class:`~tweepy.models.Media`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload-init
        r�r��INIT)r��total_bytes�
media_typeNr�r�r�r�Tr�r�r�)r@r�r�r�r�rrDrFrrrr�s"����zAPI.chunked_upload_initcKr])a�available_trends()

        Returns the locations that Twitter has trending topic information for.
        The response is an array of "locations" that encode the location's
        WOEID (a Yahoo! Where On Earth ID) and some other human-readable
        information such as a canonical name and country the location belongs
        in.

        .. versionchanged:: 4.0
            Renamed from ``API.trends_available``

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-available
        rN�trends/availableN)rNr�r�r�rrr�available_trends=szAPI.available_trendscKr�)uXclosest_trends(lat, long)

        Returns the locations that Twitter has trending topic information for,
        closest to a specified location.

        The response is an array of “locations” that encode the location’s
        WOEID and some other human-readable information such as a canonical
        name and country the location belongs in.

        A WOEID is a Yahoo! Where On Earth ID.

        .. versionchanged:: 4.0
            Renamed from ``API.trends_closest``

        Parameters
        ----------
        lat
            If provided with a long parameter the available trend locations
            will be sorted by distance, nearest to furthest, to the co-ordinate
            pair. The valid ranges for longitude is -180.0 to +180.0 (West is
            negative, East is positive) inclusive.
        long
            If provided with a lat parameter the available trend locations will
            be sorted by distance, nearest to furthest, to the co-ordinate
            pair. The valid ranges for longitude is -180.0 to +180.0 (West is
            negative, East is positive) inclusive.

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-closest
        rN�trends/closest)r�r��rBr�r�N)rNr�r��r@r�r�rrrr�closest_trendsUs&���zAPI.closest_trendscKr�)u/get_place_trends(id *, exclude)

        Returns the top 50 trending topics for a specific WOEID, if trending
        information is available for it.

        The response is an array of “trend” objects that encode the name of the
        trending topic, the query parameter that can be used to search for the
        topic on Twitter Search, and the Twitter Search URL.

        This information is cached for 5 minutes. Requesting more frequently
        than that will not return any more data, and will count against your
        rate limit usage.

        The tweet_volume for the last 24 hours is also returned for many trends
        if this is available.

        .. versionchanged:: 4.0
            Renamed from ``API.trends_place``

        Parameters
        ----------
        id
            The Yahoo! Where On Earth ID of the location to return trending
            information for. Global information is available by using 1 as the
            WOEID.
        exclude
            Setting this equal to hashtags will remove all hashtags from the
            trends list.

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/trends/trends-for-location/api-reference/get-trends-place
        rN�trends/place)r~�excluder�N)rNr�r�r�rrr�get_place_trends�s(���zAPI.get_place_trends�placecKr`)a�geo_id(place_id)

        Given ``place_id``, provide more details about that place.

        Parameters
        ----------
        place_id
            Valid Twitter ID of a location.

        Returns
        -------
        :class:`~tweepy.models.Place`

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/geo/place-information/api-reference/get-geo-id-place_id
        rNzgeo/id/r�)r@r�rrrr�geo_id�sz
API.geo_idcKr�)a�reverse_geocode(lat, long, *, accuracy, granularity, max_results)

        Given a latitude and a longitude, searches for up to 20 places that can
        be used as a ``place_id`` when updating a status.

        This request is an informative call and will deliver generalized
        results about geography.

        Parameters
        ----------
        lat
            The location's latitude.
        long
            The location's longitude.
        accuracy
            Specify the "region" in which to search, such as a number (then
            this is a radius in meters, but it can also take a string that is
            suffixed with ft to specify feet). If this is not passed in, then
            it is assumed to be 0m
        granularity
            Assumed to be ``neighborhood`` by default; can also be ``city``.
        max_results
            A hint as to the maximum number of results to return. This is only
            a guideline, which may not be adhered to.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Place`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-reverse_geocode
        rN�geo/reverse_geocode)r�r��accuracy�granularity�max_resultsr�N)rNrr�r�rrr�reverse_geocode�s#���zAPI.reverse_geocodecKr�)a�search_geo(*, lat, long, query, ip, granularity, max_results)

        Search for places that can be attached to a Tweet via
        :func:`API.update_status`. Given a latitude and a longitude pair, an IP
        address, or a name, this request will return a list of all the valid
        places that can be used as the ``place_id`` when updating a status.

        Conceptually, a query can be made from the user's location, retrieve a
        list of places, have the user validate the location they are at, and
        then send the ID of this location with a call to
        :func:`API.update_status`.

        This is the recommended method to use find places that can be attached
        to :func:`API.update_status`. Unlike :func:`API.reverse_geocode` which
        provides raw data access, this endpoint can potentially re-order places
        with regards to the user who is authenticated. This approach is also
        preferred for interactive place matching with the user.

        Some parameters in this method are only required based on the existence
        of other parameters. For instance, ``lat`` is required if ``long`` is
        provided, and vice-versa.

        .. versionchanged:: 4.0
            Renamed from ``API.geo_search``

        Parameters
        ----------
        lat
            The latitude to search around. This parameter will be ignored
            unless it is inside the range -90.0 to +90.0 (North is positive)
            inclusive. It will also be ignored if there isn't a corresponding
            ``long`` parameter.
        long
            The longitude to search around. The valid ranges for longitude are
            -180.0 to +180.0 (East is positive) inclusive. This parameter will
            be ignored if outside that range, if it is not a number, if
            ``geo_enabled`` is turned off, or if there not a corresponding
            ``lat`` parameter.
        query
            Free-form text to match against while executing a geo-based query,
            best suited for finding nearby locations by name.
        ip
            An IP address. Used when attempting to fix geolocation based off of
            the user's IP address.
        granularity
            This is the minimal granularity of place types to return and must
            be one of: ``neighborhood``, ``city``, ``admin`` or ``country``.
            If no granularity is provided for the request ``neighborhood`` is
            assumed.

            Setting this to ``city``, for example, will find places which have
            a type of ``city``, ``admin`` or ``country``.
        max_results
            A hint as to the number of results to return. This does not
            guarantee that the number of results returned will equal
            ``max_results``, but instead informs how many "nearby" results to
            return. Ideally, only pass in the number of places you intend to
            display to the user here.

        Returns
        -------
        :py:class:`List`\[:class:`~tweepy.models.Place`]

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-search
        rN�
geo/searchrB)r�r�r��iprrN)rNr	r�r�rrr�
search_geo�sE���zAPI.search_geocKr])aUsupported_languages()

        Returns the list of languages supported by Twitter along with the
        language code supported by Twitter.

        The language code may be formatted as ISO 639-1 alpha-2 (``en``), ISO
        639-3 alpha-3 (``msa``), or ISO 639-1 alpha-2 combined with an ISO
        3166-1 alpha-2 localization (``zh-tw``).

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages
        rN�help/languagesN)rNrr�r�rrr�supported_languages@szAPI.supported_languagescKrh)a�rate_limit_status(*, resources)

        Returns the current rate limits for methods belonging to the specified
        resource families. When using application-only auth, this method's
        response indicates the application-only auth rate limiting context.

        Parameters
        ----------
        resources
            A comma-separated list of resource families you want to know the
            current rate limit disposition for.

        Returns
        -------
        :class:`dict`
            JSON

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status
        rN�application/rate_limit_status)�	resourcesFrnN)rNrr�r�rrr�rate_limit_statusXs���zAPI.rate_limit_statusr)g�__name__�
__module__�__qualname__�__doc__rArdr r'r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr
rrrrrrrr"r$r'r+r-r/r2r9r;r=rDrFrIrKrNrQrUrWr[r_rardrgrorsr{r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr
rrrrrr(5s�1��.�
&
!
0

(
)
X
"

(
'





g>
e
+
+
3
)
!

1
.
2
"


%
,
%
,


)%
(%
(



#-
!



 


$


 
4
,,$


 

!
 




�>
�8�+�R 
�.

-
/



(
L
r()#r�rr��loggingr��platformrrgra�urllib.parserr7r9�
tweepy.errorsrrrrrr	r
r�
tweepy.modelsr�tweepy.parsersr
r�tweepy.utilsr�	getLoggerrr\r r'r(rrrr�<module>s&(