
    _Og                       S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	Jr  SSK	Jr  SSK	Jr  SSKJr  SSKJr  \R<                  " S5      r " S S\R@                  5      r! " S S\!5      r"g)z4This module contains the main interfaces to the API.    N   )apps)auths)
decorators)events)gists)issues)licenses)models)notifications)orgs)projects)pulls)searchsession)structs)users)utils)requires_app_credentials)requires_auth)requires_basic_auth)
invitation)repoz6https?://[\w\d\-\.\:]+/\w[\w-]+\w/[\w\._-]+/events/\w+c                     ^  \ rS rSrSr SoU 4S jjrS r\S 5       r\/ 4S j5       r	SpS jr
 SqS	 jr SqS
 jrSqS jrS r\R                   S 5       r\R                   SrS j5       r\R                   S 5       r\R                   S 5       r\R                   S 5       r\R,                  SpS j5       r\R                   S 5       r\S 5       r\SpS j5       r     SsS jr\ SpS\S\R>                  \    S\RB                  \"RF                  SS4   4S jj5       r$\S\"RJ                  S\&4S j5       r'\S\"RJ                  S\&4S j5       r(\S\"RJ                  S\&4S j5       r)S r*\StS  j5       r+\S! 5       r,\SSS/ S4S" j5       r-\SuS# j5       r.\        SvS$ j5       r/\/ 4S% j5       r0\SpS& j5       r1S' r2\S( 5       r3\S) 5       r4SpS* jr5\SpS+ j5       r6SpS, jr7\SpS- j5       r8S. r9\SpS/ j5       r:SpS0 jr;S1 r<S2 r=\S3 5       r>\SpS4 j5       r?\S5 5       r@\S6 5       rAS7 rB\        SwS8 j5       rC          SxS9 jrD\S: 5       rE\SpS; j5       rFS< rGSpS= jrH    SyS> jrI\JR                  4S? jrL SzS@ jrMS{SA jrN\SB 5       rO\SC 5       rPSD rQ\ S|SE j5       rRS}SF jrSSG rT\        SwSH j5       rU\SpSI j5       rVSpSJ jrWSK rXSL rYSM rZS~SN jr[\SSO j5       r\\SSP j5       r]SQ r^SR r_\ SSS j5       r`     SST jraSU rb\SpSV j5       rcSW rd\eSX 5       rf\eSY 5       rg      SSZ jrh      SS[ jri      SS\ jrj      SS] jrk      SS^ jrlS_ rmS` rn\Sa 5       ro\SSb j5       rp SSc jrq\SpSd j5       rrSpSe jrs\Sf 5       rt\Sg 5       ru\       SSh j5       rvSi rw\         SSj j5       rx\SpSk j5       rySl rzSm r{Snr|U =r}$ )GitHub%   a   Stores all the session information.

There are two ways to log into the GitHub API

.. code-block:: python

    from github3 import login
    g = login(user, password)
    g = login(token=token)
    g = login(user, token=token)

or

.. code-block:: python

    from github3 import GitHub
    g = GitHub(user, password)
    g = GitHub(token=token)
    g = GitHub(user, token=token)

This is simple backward compatibility since originally there was no way to
call the GitHub object with authentication parameters.
Nc                    > [         TU ]  0 U=(       d    U R                  5       5        U(       a'  U R                  R                  R                  SU05        U(       a  U R                  XS9  gU(       a  U(       a  U R                  X5        ggg)zCreate a new GitHub instance to talk to the API.

:param str api_version:
    API version to send with X-GitHub-Api-Version header.
    See https://docs.github.com/en/rest/overview/api-versions
    for details about API versions.
zX-GitHub-Api-Version)tokenN)super__init__new_sessionr   headersupdatelogin)selfusernamepasswordr   r   api_version	__class__s         S/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/github.pyr!   GitHub.__init__>   sl     	W:(8(8(:;LL  '')?(MNJJxJ-(JJx* #X    c                     U R                   R                  (       a  SU R                   R                  < S3$ S[        U 5      S S3$ )Nz	<GitHub []>z<Anonymous GitHub at 0xx>)r   authidr&   s    r+   _reprGitHub._reprR   s>    <<t||003266(D!A66r-   c                     [        USU5      nU R                  SSSU5      nSS0nU R                  U R                  U[        R
                  " U5      S9S5      nU R                  [        R                  U5      $ )	aC  Activate the membership to an organization.

:param organization:
    the organization or organization login for which to activate the
    membership
:type organization:
    str
:type organization:
    :class:`~github3.orgs.Organization`
:returns:
    the activated membership
:rtype:
    :class:`~github3.orgs.Membership`
r%   usermembershipsr   stateactivedata   )	getattr
_build_url_json_patchjsondumps_instance_or_nullr   
Membership)r&   organizationorganization_nameurlr=   rA   s         r+   activate_membershipGitHub.activate_membershipW   st      $L'<HooM6+<
 "

4;;sD1A;BCH%%doou==r-   c                     / nU(       a1  U R                  SS5      nU R                  U R                  X1S9S5      nU(       a'  U Vs/ s H  n[        R                  " X@5      PM     sn$ / $ s  snf )zAdd the addresses to the authenticated user's account.

:param list addresses:
    (optional), email addresses to be added
:returns:
    list of email objects
:rtype:
    [:class:`~github3.users.Email`]
r8   emailsr<      )r@   rA   _postr   Email)r&   	addressesrC   rI   emails        r+   add_email_addressesGitHub.add_email_addresseso   s_     //&(3C::djjj=sCD?Cd;dUE(d;KK;s    A+c                 v    U R                  S5      nU R                  [        U5      U[        R                  US9$ )a)  Iterate over public events.

:param int number:
    (optional), number of events to return. Default: -1
    returns all available events
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of events
:rtype:
    :class:`~github3.events.Event`
r   etag)r@   _iterintr   Eventr&   numberrW   rI   s       r+   
all_eventsGitHub.all_events   s1     ooh'zz#f+sFLLtzDDr-   c                 |    U R                  S5      nU R                  [        U5      U[        R                  X$S.US9$ )a  Iterate over every organization in the order they were created.

:param int number:
    (optional), number of organizations to return.
    Default: -1, returns all of them
:param int since:
    (optional), last organization id seen (allows restarting an
    iteration)
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:param int per_page:
    (optional), number of organizations to list per request
:returns:
    generator of organizations
:rtype:
    :class:`~github3.orgs.ShortOrganization`
organizationssinceper_pageparamsrW   r@   rX   rY   r   ShortOrganizationr&   r\   rb   rW   rc   rI   s         r+   all_organizationsGitHub.all_organizations   sD    ( ooo.zzK"""9  
 	
r-   c                 |    U R                  S5      nU R                  [        U5      U[        R                  X$S.US9$ )a  Iterate over every repository in the order they were created.

:param int number:
    (optional), number of repositories to return.
    Default: -1, returns all of them
:param int since:
    (optional), last repository id seen (allows restarting an
    iteration)
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:param int per_page:
    (optional), number of repositories to list per request
:returns:
    generator of repositories
:rtype:
    :class:`~github3.repos.repo.ShortRepository`
repositoriesra   rd   r@   rX   rY   r   ShortRepositoryrh   s         r+   all_repositoriesGitHub.all_repositories   sD    ( oon-zzK  "9  
 	
r-   c           	      |    U R                  S5      nU R                  [        U5      U[        R                  UX4S.S9$ )a8  Iterate over every user in the order they signed up for GitHub.

.. versionchanged:: 1.0.0

    Inserted the ``since`` parameter after the ``number`` parameter.

:param int number:
    (optional), number of users to return. Default: -1, returns all of
    them
:param int since:
    (optional), ID of the last user that you've seen.
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:param int per_page:
    (optional), number of users to list per request
:returns:
    generator of users
:rtype:
    :class:`~github3.users.ShortUser`
r   )rc   rb   )rW   re   r@   rX   rY   r   	ShortUser)r&   r\   rW   rc   rb   rI   s         r+   	all_usersGitHub.all_users   sB    * oog&zzKOO (9  
 	
r-   c                     [         R                  nU R                  S[        U5      5      nU R	                  U R                  X2S9S5      nU R                  [         R                  U5      $ )a  Retrieve information about a specific app using its "slug".

.. versionadded:: 1.2.0

.. seealso::

    `Get a single GitHub App`_
        API Documentation

:param app_slug:
    The identifier for the specific slug, e.g.,
    ``test-github3-py-apps``.
:returns:
    The app if and only if it is public.
:rtype:
    :class:`~github3.apps.App`

.. _Get a single GitHub App:
    https://developer.github.com/v3/apps/#get-a-single-github-app
r   r#   r>   )r   APP_PREVIEW_HEADERSr@   strrA   _getrE   App)r&   app_slugr#   rI   rC   s        r+   app
GitHub.app   sU    * **oofc(m4zz$))C)93?%%dhh55r-   c                     U R                  SS[        U5      5      nU R                  U R                  U[        R
                  S9S5      nU R                  [        R                  U5      $ )a  Retrieve a specific App installation by its ID.

.. versionadded: 1.2.0

.. seealso::

    `Get a single installation`_
        API Documentation

:param int installation_id:
    The ID of the specific installation.
:returns:
    The installation.
:rtype:
    :class:`~github3.apps.Installation`

.. _Get a single installation:
    https://developer.github.com/v3/apps/#get-a-single-installation
r}   installationsrw   r>   )r@   ry   rA   rz   r   rx   rE   Installation)r&   installation_idrI   rC   s       r+   app_installationGitHub.app_installation  s\    * ooe_c/6JKzzIIc4#;#;I<c
 %%d&7&7>>r-   c                     U R                  SS5      nU R                  [        U5      U[        R                  [        R
                  S9$ )a[  Retrieve the list of installations for the authenticated app.

.. versionadded:: 1.2.0

.. seealso::

    `Find installations`_
        API Documentation

:returns:
    The installations of the authenticated App.
:rtype:
    :class:`~github3.apps.Installation`

.. _Find installations:
    https://developer.github.com/v3/apps/#find-installations
r}   r   rw   )r@   rX   rY   r   r   rx   )r&   r\   rI   s      r+   app_installationsGitHub.app_installations  sF    & ooe_5zzK,,	  
 	
r-   c                     U R                  SUS5      nU R                  U R                  U[        R                  S9S5      nU R                  [        R                  U5      $ )a  Retrieve an App installation for a specific organization.

.. versionadded:: 1.2.0

.. seealso::

    `Find organization installation`_
        API Documentation

:param str organization:
    The name of the organization.
:returns:
    The installation
:rtype:
    :class:`~github3.apps.Installation`

.. _Find organization installation:
    https://developer.github.com/v3/apps/#find-organization-installation
r   installationrw   r>   )r@   rA   rz   r   rx   rE   r   )r&   rG   rI   rC   s       r+   !app_installation_for_organization(GitHub.app_installation_for_organization8  sW    * ooflNCzzIIc4#;#;I<c
 %%d&7&7>>r-   c                 
   [        US[        U5      5      n[        USU5      nU R                  SXS5      nU R                  U R	                  U[
        R                  S9S5      nU R                  [
        R                  U5      $ )a  Retrieve an App installation for a specific repository.

.. versionadded:: 1.2.0

.. seealso::

    `Find repository installation`_
        API Documentation

:param str owner:
    The name of the owner.
:param str repostory:
    The name of the repository.
:returns:
    The installation
:rtype:
    :class:`~github3.apps.Installation`

.. _Find repository installation:
    https://developer.github.com/v3/apps/#find-repository-installation
r%   namereposr   rw   r>   	r?   ry   r@   rA   rz   r   rx   rE   r   )r&   owner
repositoryrI   rC   s        r+   app_installation_for_repository&GitHub.app_installation_for_repositoryS  sw    . wE
3Z<
oogu.IzzIIc4#;#;I<c
 %%d&7&7>>r-   c                     [        US[        U5      5      nU R                  SUS5      nU R                  U R	                  U[
        R                  S9S5      nU R                  [
        R                  U5      $ )aq  Retrieve an App installation for a specific repository.

.. versionadded:: 1.2.0

.. seealso::

    `Find user installation`_
        API Documentation

:param str user:
    The name of the user.
:returns:
    The installation
:rtype:
    :class:`~github3.apps.Installation`

.. _Find user installation:
    https://developer.github.com/v3/apps/#find-user-installation
r%   r   r   rw   r>   r   )r&   r8   rI   rC   s       r+   app_installation_for_user GitHub.app_installation_for_userr  si    * tWc$i0oogt^<zzIIc4#;#;I<c
 %%d&7&7>>r-   c           	      |    U R                  SS5      nU R                  [        U5      U[        R                  SUSS9$ )a  Retrieve repositories accessible by app installation.

.. versionadded:: 3.2.1

.. seealso::

    `List repositories accessible to the app installation`_
        API Documentation

:returns:
    The repositories accessible to the app installation
:rtype:
    :class:`~github3.repos.repo.ShortRepository`

.. _List repositories accessible to the app installation:
    https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation
r   rl   N)countrI   clsre   rW   list_keyrm   r[   s       r+   app_installation_reposGitHub.app_installation_repos  sF    & oonn=zzf+$$#  
 	
r-   c                     [         R                  nU R                  U R                  U R	                  S5      US9S5      nU R                  [         R                  U5      $ )a]  Retrieve information about the current app.

.. versionadded:: 1.2.0

.. seealso::

    `Get the authenticated GitHub App`_
        API Documentation

:returns:
    Metadata about the application
:rtype:
    :class:`~github3.apps.App`

.. _Get the authenticated GitHub App:
    https://developer.github.com/v3/apps/#get-the-authenticated-github-app
r}   rw   r>   )r   rx   rA   rz   r@   rE   r{   )r&   r#   rC   s      r+   authenticated_appGitHub.authenticated_app  sQ    & **zzIIdooe,gI>
 %%dhh55r-   c                     Sn[        U5      S:  a<  U R                  S[        U5      5      nU R                  U R	                  U5      S5      nU R                  [        R                  U5      $ )zGet information about authorization ``id``.

:param int id_num:
    (required), unique id of the authorization
:returns:
    :class:`~github3.auths.Authorization`
Nr   authorizationsr>   )rY   r@   ry   rA   rz   rE   r   Authorizationr&   id_numrC   rI   s       r+   authorizationGitHub.authorization  sZ     v;?//"2CK@C::diinc2D%%e&9&94@@r-   c                 v    U R                  S5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over authorizations for the authenticated user.

.. note::

    This will return a 404 if you are using a token for
    authentication.

:param int number:
    (optional), number of authorizations to return.
    Default: -1 returns all available authorizations
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of authorizations
:rtype:
    :class:`~github3.auths.Authorization`
r   rV   )r@   rX   rY   r   r   r[   s       r+   r   GitHub.authorizations  s4    & oo./zz#f+sE,?,?dzKKr-   c                 P   SnU(       am  U(       af  U R                  S5      n	UUUUS.n
U(       a  X:S'   U R                  R                  X5         U R                  U R	                  XS9S5      nSSS5        U R                  [        R                  U5      $ ! , (       d  f       N.= f)a  Obtain an authorization token.

The retrieved token will allow future consumers to use the API without
a username and password.

:param str username:
    (required)
:param str password:
    (required)
:param list scopes:
    (optional), areas you want this token to apply to, i.e., 'gist',
    'user'
:param str note:
    (optional), note about the authorization
:param str note_url:
    (optional), url for the application
:param str client_id:
    (optional), 20 character OAuth client key for which to create a
    token
:param str client_secret:
    (optional), 40 character OAuth client secret for which to create
    the token
:returns:
    created authorization
:rtype:
    :class:`~github3.auths.Authorization`
Nr   )notenote_url	client_idclient_secretscopesr<   rN   )r@   r   temporary_basic_authrA   rO   rE   r   r   )r&   r'   r(   r   r   r   r   r   rC   rI   r=   s              r+   	authorizeGitHub.authorize  s    J //"23C$&!.	D !'X228Fzz$**S*"<cB G %%e&9&94@@ GFs    B
B%r\   rW   returnc                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )ar  Iterate over the users blocked by this organization.

.. versionadded:: 2.1.0

:param int number:
    (optional), number of users to iterate over.  Default: -1 iterates
    over all values
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of the members of this team
:rtype:
    :class:`~github3.users.ShortUser`
r8   blocksrV   rr   r[   s       r+   blocked_usersGitHub.blocked_users   s3    $ oofh/zz#f+sEOO$zGGr-   r'   c                 ~    U R                  SS[        U5      5      nU R                  U R                  U5      SS5      $ )zBlock a specific user from an organization.

.. versionadded:: 2.1.0

:parameter str username:
    Name (or user-like instance) of the user to block.
:returns:
    True if successful, Fales otherwise
:rtype:
    bool
r8   r        )r@   ry   _boolean_putr&   r'   rI   s      r+   blockGitHub.block5  5     oofhH>}}TYYs^S#66r-   c                 ~    U R                  SS[        U5      5      nU R                  U R                  U5      SS5      $ )zUnblock a specific user from an organization.

.. versionadded:: 2.1.0

:parameter str username:
    Name (or user-like instance) of the user to unblock.
:returns:
    True if successful, Fales otherwise
:rtype:
    bool
r8   r   r   r   )r@   ry   r   _deleter   s      r+   unblockGitHub.unblockE  s6     oofhH>}}T\\#.S99r-   c                 ~    U R                  SS[        U5      5      nU R                  U R                  U5      SS5      $ )zCheck if this organization is blocking a specific user.

.. versionadded:: 2.1.0

:parameter str username:
    Name (or user-like instance) of the user to unblock.
:returns:
    True if successful, Fales otherwise
:rtype:
    bool
r8   r   r   r   )r@   ry   r   rz   r   s      r+   is_blockingGitHub.is_blockingU  r   r-   c                 0   U R                   R                  nUR                  S5      UR                  S5      4nU(       aW  U(       aP  U R                  S[	        US   5      S[	        U5      5      nU R                  UUSSS.S9nU R                  US	S
5      $ g)aU  Check an authorization created by a registered application.

OAuth applications can use this method to check token validity
without hitting normal rate limits because of failed login attempts.
If the token is valid, it will return True, otherwise it will return
False.

:returns:
    True if token is valid, False otherwise
:rtype:
    bool
r   r   applicationsr   tokensNr   r   )r2   re   r>   r   F)r   re   getr@   ry   rz   r   )r&   access_tokenpr2   rI   resps         r+   check_authorizationGitHub.check_authorizatione  s     LLk"AEE/$:;D//DGhL8IC 99%)DA  D
 ==sC00r-   c                     UUUS.nU R                  S5      nU R                  U R                  XTS9S5      nU R                  [        R
                  U5      $ )a  Create a new gist.

.. versionchanged:: 1.1.0

    Per `GitHub's recent announcement`_ authentication is now required
    for creating gists.

.. _GitHub's recent announcement:
    https://blog.github.com/2018-02-18-deprecation-notice-removing-anonymous-gist-creation/

:param str description:
    (required), description of gist
:param dict files:
    (required), file names with associated dictionaries for content,
    e.g. ``{'spam.txt': {'content': 'File contents ...'}}``
:param bool public:
    (optional), make the gist public if True
:returns:
    the created gist if successful, otherwise ``None``
:rtype:
    created gist
:rtype:
    :class:`~github3.gists.gist.Gist`
)descriptionpublicfilesr   r<   rN   )r@   rA   rO   rE   r   Gist)r&   r   r   r   new_gistrI   rC   s          r+   create_gistGitHub.create_gist  sV    6 '

 oog&zz$**S*8#>%%ejj$77r-   c                     U R                  SS5      nSU0nU R                  U R                  X#S9S5      nU R                  [        R
                  U5      $ )zCreate a new GPG key.

.. versionadded:: 1.2.0

:param str armored_public_key:
    (required), your GPG key, generated in ASCII-armored format
:returns:
    the created GPG key if successful, otherwise ``None``
:rtype:
    :class:`~github3.users.GPGKey`
r8   gpg_keysarmored_public_keyr<   rN   )r@   rA   rO   rE   r   GPGKey)r&   r   rI   r=   rC   s        r+   create_gpg_keyGitHub.create_gpg_key  sQ     oofj1$&89zz$**S*4c:%%ellD99r-   c	                     Sn	U(       a  U(       a  U(       a  U R                  X5      n	U	b  U	R                  " X4XVXx5      $ U R                  [        R                  S5      $ )a  Create an issue on the repository.

.. note::

    ``body``, ``assignee``, ``assignees``, ``milestone``, ``labels``
    are all optional.

.. warning::

    This method retrieves the repository first and then uses it to
    create an issue. If you're making several issues, you should use
    :py:meth:`repository <github3.github.GitHub.repository>` and then
    use :py:meth:`create_issue
    <github3.repos.repo.Repository.create_issue>`

:param str owner:
    (required), login of the owner
:param str repository:
    (required), repository name
:param str title:
    (required), Title of issue to be created
:param str body:
    (optional), The text of the issue, markdown formatted
:param str assignee:
    (optional), Login of person to assign the issue to
:param assignees:
    (optional), logins of the users to assign the issue to
:param int milestone:
    (optional), id number of the milestone to attribute this issue to
    (e.g. if ``m`` is a :class:`~github3.issues.Milestone` object,
    ``m.number`` is what you pass here.)
:param list labels:
    (optional), List of label names.
:returns:
    created issue
:rtype:
    :class:`~github3.issues.ShortIssue`
N)r   create_issuerE   r	   
ShortIssue)
r&   r   r   titlebodyassignee	milestonelabels	assigneesr   s
             r+   r   GitHub.create_issue  sZ    d ZE??55D$$X&  %%f&7&7>>r-   c                     SnU(       a?  U(       a8  XUS.nU R                  SS5      nU R                  XeS9nU R                  US5      nU R                  [        R
                  U5      $ )a\  Create a new key for the authenticated user.

:param str title:
    (required), key title
:param str key:
    (required), actual key contents, accepts path
    as a string or file-like object
:param bool read_only:
    (optional), restrict key access to read-only, default to False
:returns:
    created key
:rtype:
    :class:`~github3.users.Key`
N)r   key	read_onlyr8   keysr<   rN   )r@   rO   rA   rE   r   Key)r&   r   r   r   rC   r=   rI   reqs           r+   
create_keyGitHub.create_key  s_      S"YGD//&&1C**S*,C::c3'D%%eii66r-   c
           
          U R                  SS5      n
UUUUUUUUU	S.	nU R                  U R                  XS9S5      nU R                  [        R
                  U5      $ )a  Create a repository for the authenticated user.

:param str name:
    (required), name of the repository

    .. warning: this be no longer than 100 characters
:param str description:
    (optional)
:param str homepage:
    (optional)
:param str private:
    (optional), If ``True``, create a private repository. API default:
    ``False``
:param bool has_issues:
    (optional), If ``True``, enable issues for this repository. API
    default: ``True``
:param bool has_wiki:
    (optional), If ``True``, enable the wiki for this repository. API
    default: ``True``
:param bool auto_init:
    (optional), auto initialize the repository
:param str gitignore_template:
    (optional), name of the git template to use; ignored if auto_init =
    False.
:param bool has_projects:
    (optional), If ``True``, enable projects for this repository. API
    default: ``True``
:returns:
    created repository
:rtype:
    :class:`~github3.repos.repo.Repository`
r8   r   )	r   r   homepageprivate
has_issueshas_wiki	auto_initgitignore_templatehas_projectsr<   rN   )r@   rA   rO   rE   r   
Repository)r&   r   r   r   r   r   r   r   r   r   rI   r=   rC   s                r+   create_repositoryGitHub.create_repository  sk    Z oofg.& $ ""4(

 zz$**S*4c:%%doot<<r-   c                     U R                  SS5      nU R                  U R                  U[        R                  " U5      S9SS5      $ )zDelete the specified addresses the authenticated user's account.

:param list addresses:
    (optional), email addresses to be removed
:returns:
    True if successful, False otherwise
:rtype:
    bool
r8   rM   r<   r   r   )r@   r   r   rC   rD   )r&   rQ   rI   s      r+   delete_email_addressesGitHub.delete_email_addressesG  sB     oofh/}}LL4::i#8L93
 	
r-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )aW  Iterate over email addresses for the authenticated user.

:param int number:
    (optional), number of email addresses to return.
    Default: -1 returns all available email addresses
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of emails
:rtype:
    :class:`~github3.users.Email`
r8   rM   rV   )r@   rX   rY   r   rP   r[   s       r+   rM   GitHub.emailsW  s3     oofh/zz#f+sEKKdzCCr-   c                 d    U R                  S5      nU R                  U R                  U5      SSS9$ )aI  Retrieve a dictionary of all of the emojis that GitHub supports.

:returns:
    dictionary where the key is what would be in between the
    colons and the value is the URL to the image, e.g.,

    .. code-block:: python

        {
            '+1': 'https://github.global.ssl.fastly.net/images/...',
            # ...
        }
emojisr>   Finclude_cache_infor@   rA   rz   r&   rI   s     r+   r  GitHub.emojish  s/     ooh'zz$))C.#%zHHr-   c                 L   S nU R                  S5      nU R                  U R                  U5      SSS9nUc  g0 nUR                  " S0 5      n0 nUR	                  5        H@  u  px[        U[        5      (       a  U V	s/ s H
  o" U	5      PM     sn	Xg'   M6  U" U5      Xg'   MB     XdS'   UR                  " 5        H]  u  px[        U[        5      (       a+  U V
s/ s H  n
[        R                  " U
5      PM     sn
XG'   ME  [        R                  " U5      XG'   M_     U$ s  sn	f s  sn
f )z{List GitHub's timeline resources in Atom format.

:returns:
    dictionary parsed to include URITemplates
:rtype:
    dict
c                     U (       d  U $ 0 nU R                  SS 5      nUR                  U 5        Ub  [        R                  " U5      US'   U$ )Nhref)popr$   uritemplateURITemplate)	feed_dictret_dictr
  s      r+   replace_href"GitHub.feeds.<locals>.replace_href  sL      H==.DOOI&#.#:#:4#@ Or-   feedsr>   Fr  N_links)	r@   rA   rz   r  items
isinstancelistr  r  )r&   r  rI   rC   r  	old_linksr  r   valuedvs              r+   r  GitHub.feedsy  s   	 oog&zz$))C.#%zH<  HHXr*	 $//+JC%&& 9>>1|A> +51 , !h**,JC%&&BGH%Qk55a8%H
(44U;
 '  ? Is   >D D!c                     SnU(       a5  U R                  SSU5      nU R                  U R                  U5      SS5      nU$ )zMake the authenticated user follow the provided username.

:param str username:
    (required), user to follow
:returns:
    True if successful, False otherwise
:rtype:
    bool
Fr8   	followingr   r   r@   r   r   r&   r'   r   rI   s       r+   followGitHub.follow  s=     //&+x@C==3c:Dr-   c                 z    U R                  SUS5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over users being followed by ``username``.

.. versionadded:: 1.0.0

    This replaces iter_following('sigmavirus24').

:param str username:
    (required), login of the user to check
:param int number:
    (optional), number of people to return. Default: -1 returns all
    people you follow
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of users
:rtype:
    :class:`~github3.users.ShortUser`
r   r  rV   rr   r&   r'   r\   rW   rI   s        r+   followed_byGitHub.followed_by  5    & oogx=zz#f+sEOO$zGGr-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over followers of the authenticated user.

.. versionadded:: 1.0.0

    This replaces iter_followers().

:param int number:
    (optional), number of followers to return. Default: -1 returns all
    followers
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of followers
:rtype:
    :class:`~github3.users.ShortUser`
r8   	followersrV   rr   r[   s       r+   r(  GitHub.followers  3    $ oofk2zz#f+sEOO$zGGr-   c                 z    U R                  SUS5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over followers of ``username``.

.. versionadded:: 1.0.0

    This replaces iter_followers('sigmavirus24').

:param str username:
    (required), login of the user to check
:param int number:
    (optional), number of followers to return. Default: -1 returns all
    followers
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of followers
:rtype:
    :class:`~github3.users.ShortUser`
r   r(  rV   rr   r#  s        r+   followers_ofGitHub.followers_of  r&  r-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over users the authenticated user is following.

.. versionadded:: 1.0.0

    This replaces iter_following().

:param int number:
    (optional), number of people to return. Default: -1 returns all
    people you follow
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of users
:rtype:
    :class:`~github3.users.ShortUser`
r8   r  rV   rr   r[   s       r+   r  GitHub.following  r*  r-   c                     U R                  S[        U5      5      nU R                  U R                  U5      S5      nU R	                  [
        R                  U5      $ )zRetrieve the gist using the specified id number.

:param int id_num:
    (required), unique id of the gist
:returns:
    the gist identified by ``id_num``
:rtype:
    :class:`~github3.gists.gist.Gist`
r   r>   )r@   ry   rA   rz   rE   r   r   r&   r   rI   rC   s       r+   gistGitHub.gist  sG     oogs6{3zz$))C.#.%%ejj$77r-   c                 v    U R                  S5      nU R                  [        U5      U[        R                  US9$ )aS  Retrieve the authenticated user's gists.

.. versionadded:: 1.0

:param int number:
    (optional), number of gists to return. Default: -1, returns all
    available gists
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of short gists
:rtype:
    :class:~github3.gists.ShortGist`
r   rV   r@   rX   rY   r   	ShortGistr[   s       r+   r   GitHub.gists(  s1      oog&zz#f+sEOO$zGGr-   c                 z    U R                  SUS5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over the gists owned by a user.

.. versionadded:: 1.0

:param str username:
    login of the user who owns the gists
:param int number:
    (optional), number of gists to return. Default: -1 returns all
    available gists
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of short gists owned by the specified user
:rtype:
    :class:`~github3.gists.ShortGist`
r   r   rV   r5  r#  s        r+   gists_byGitHub.gists_by;  s5    " oogx9zz#f+sEOO$zGGr-   c                     U R                  SSU5      nU R                  U R                  U5      S5      nU(       d  gUR                  " SS5      $ )zUReturn the template for language.

:returns:
    the template string
:rtype:
    str
	gitignore	templatesr>    source)r@   rA   rz   r   )r&   languagerI   rC   s       r+   r   GitHub.gitignore_templateO  sE     ook;Azz$))C.#.xx"%%r-   c                 z    U R                  SS5      nU R                  U R                  U5      S5      =(       d    / $ )z`Return the list of available templates.

:returns:
    list of template names
:rtype:
    [str]
r<  r=  r>   r  r  s     r+   gitignore_templatesGitHub.gitignore_templates]  s2     ook;7zz$))C.#.4"4r-   c                     U R                  SSU5      nU R                  U R                  U5      S5      nU R                  [        R
                  U5      $ )zRetrieve the GPG key of the authenticated user specified by id_num.

.. versionadded:: 1.2.0

:returns:
    the GPG key specified by id_num
:rtype:
    :class:`~github3.users.GPGKey`
r8   r   r>   )r@   rA   rz   rE   r   r   r1  s       r+   gpg_keyGitHub.gpg_keyh  sE     oofj&9zz$))C.#.%%ellD99r-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over the GPG keys of the authenticated user.

.. versionadded:: 1.2.0

:param int number: (optional), number of GPG keys to return. Default:
    -1 returns all available GPG keys
:param str etag: (optional), ETag from a previous request to the same
    endpoint
:returns:
    generator of the GPG keys belonging to the authenticated user
:rtype:
    :class:`~github3.users.GPGKey`
r8   r   rV   )r@   rX   rY   r   r   r[   s       r+   r   GitHub.gpg_keysw  s3     oofj1zz#f+sELLtzDDr-   c                     SnU(       a5  U R                  SSU5      nU R                  U R                  U5      SS5      nU$ )zCheck if the authenticated user is following login.

:param str username:
    (required), login of the user to check if the
    authenticated user is checking
:returns:
    True if following, False otherwise
:rtype:
    bool
Fr8   r  r   r   r@   r   rz   )r&   r'   rC   rI   s       r+   is_followingGitHub.is_following  s=     //&+x@C==3c:Dr-   c                     SnU(       a<  U(       a5  U R                  SSX5      nU R                  U R                  U5      SS5      nU$ )zCheck if the authenticated user starred username/repo.

:param str username:
    (required), owner of repository
:param str repo:
    (required), name of repository
:returns:
    True if starred, False otherwise
:rtype:
    bool
Fr8   starredr   r   rK  )r&   r'   r   rC   rI   s        r+   
is_starredGitHub.is_starred  ?     //&)XDC==3c:Dr-   c           	          SnU(       aT  U(       aM  [        U5      S:  a>  U R                  SXS[        U5      5      nU R                  U R	                  U5      S5      nU R                  [        R                  U5      $ )a  Fetch issue from owner/repository.

:param str username:
    (required), owner of the repository
:param str repository:
    (required), name of the repository
:param int number:
    (required), issue number
:return:
    the issue
:rtype:
    :class:`~github3.issues.issue.Issue`
Nr   r   r	   r>   )rY   r@   ry   rA   rz   rE   r	   Issue)r&   r'   r   r\   rC   rI   s         r+   issueGitHub.issue  sd     
s6{Q//xVC ::diinc2D%%fllD99r-   c	                     U R                  S5      n	[        R                  " XX4XV5      n
U R                  [	        U5      U	[        R
                  X5      $ )ay  List all of the authenticated user's (and organization's) issues.

.. versionchanged:: 0.9.0

    - The ``state`` parameter now accepts 'all' in addition to 'open'
      and 'closed'.

:param str filter:
    accepted values:
    ('assigned', 'created', 'mentioned', 'subscribed')
    api-default: 'assigned'
:param str state:
    accepted values: ('all', 'open', 'closed')
    api-default: 'open'
:param str labels:
    comma-separated list of label names, e.g., 'bug,ui,@high'
:param str sort:
    accepted values: ('created', 'updated', 'comments')
    api-default: created
:param str direction:
    accepted values: ('asc', 'desc')
    api-default: desc
:param since:
    (optional), Only issues after this date will
    be returned. This can be a `datetime` or an ISO8601 formatted
    date string, e.g., 2012-05-20T23:10:27Z
:type since:
    :class:`~datetime.datetime` or str
:param int number:
    (optional), number of issues to return.
    Default: -1 returns all issues
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of issues
:rtype:
    :class:`~github3.issues.ShortIssue`
r	   r@   r	   issue_paramsrX   rY   r   )r&   filterr:   r   sort	directionrb   r\   rW   rI   re   s              r+   r	   GitHub.issues  sK    d ooh'$$6
 zz#f+sF,=,=vLLr-   c           
          U(       a`  U(       aY  U R                  SXS5      n[        R                  " UUUUUUU	U
5      nU R                  [	        U5      U[
        R                  XS9$ [        / 5      $ )a  List issues on owner/repository.

Only owner and repository are required.

.. versionchanged:: 0.9.0

    - The ``state`` parameter now accepts 'all' in addition to 'open'
      and 'closed'.

:param str username:
    login of the owner of the repository
:param str repository:
    name of the repository
:param int milestone:
    None, '*', or ID of milestone
:param str state:
    accepted values: ('all', 'open', 'closed')
    api-default: 'open'
:param str assignee:
    '*' or login of the user
:param str mentioned:
    login of the user
:param str labels:
    comma-separated list of label names, e.g., 'bug,ui,@high'
:param str sort:
    accepted values: ('created', 'updated', 'comments')
    api-default: created
:param str direction:
    accepted values: ('asc', 'desc')
    api-default: desc
:param since:
    (optional), Only issues after this date will
    be returned. This can be a `datetime` or an ISO8601 formatted
    date string, e.g., 2012-05-20T23:10:27Z
:type since:
    :class:`~datetime.datetime` or str
:param int number:
    (optional), number of issues to return.
    Default: -1 returns all issues
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of issues
:rtype:
    :class:`~github3.issues.ShortIssue`
r   r	   rd   )r@   r   repo_issue_paramsrX   rY   r	   r   iter)r&   r'   r   r   r:   r   	mentionedr   r[  r\  rb   r\   rW   rI   re   s                  r+   	issues_onGitHub.issues_on  sz    z 
//'8JC++	F ::FS&"3"3F    Bxr-   c                     Sn[        U5      S:  a=  U R                  SS[        U5      5      nU R                  U R	                  U5      S5      nU R                  [        R                  U5      $ )zGet the authenticated user's key specified by id_num.

:param int id_num:
    (required), unique id of the key
:returns:
    created key
:rtype:
    :class:`~github3.users.Key`
Nr   r8   r   r>   )rY   r@   ry   rA   rz   rE   r   r   r   s       r+   r   
GitHub.keyL  sY     v;?//&&#f+>C::diinc2D%%eii66r-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )a4  Iterate over public keys for the authenticated user.

:param int number:
    (optional), number of keys to return. Default: -1
    returns all your keys
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of keys
:rtype:
    :class:`~github3.users.Key`
r8   r   rV   )r@   rX   rY   r   r   r[   s       r+   r   GitHub.keys]  s3     ooff-zz#f+sEIIDzAAr-   c                     U R                  SU5      nU R                  U R                  U5      S5      nU R                  [        R
                  U5      $ )zRetrieve the license specified by the name.

:param string name:
    (required), name of license
:returns:
    the specified license
:rtype:
    :class:`~github3.licenses.License`
r
   r>   )r@   rA   rz   rE   r
   License)r&   r   rI   rC   s       r+   licenseGitHub.licensen  sE     ooj$/zz$))C.#.%%h&6&6==r-   c                 v    U R                  S5      nU R                  [        U5      U[        R                  US9$ )zIterate over open source licenses.

:returns:
    generator of short license objects
:rtype:
    :class:`~github3.licenses.ShortLicense`
r
   rV   )r@   rX   rY   r
   ShortLicenser[   s       r+   r
   GitHub.licenses|  s3     ooj)zz#f+sH,A,AzMMr-   c                     U(       a#  U(       a  U R                   R                  X5        O"U(       a  U R                   R                  U5        U R                   R                  U5        g)a<  Log the user into GitHub for protected API calls.

:param str username:
    login name
:param str password:
    password for the login
:param str token:
    OAuth token
:param func two_factor_callback:
    (optional), function you implement to provide the Two-factor
    Authentication code to GitHub when necessary
N)r   
basic_auth
token_authtwo_factor_auth_callback)r&   r'   r(   r   two_factor_callbacks        r+   r%   GitHub.login  sE    & LL##H7LL##E* 	--.ABr-   c                 h    [         R                  " XU5      nU R                  R                  XC5        g)ac  Login as a GitHub Application.

.. versionadded:: 1.2.0

.. seealso::

    `Authenticating as an App`_
        GitHub's documentation of authenticating as an application.

:param bytes private_key_pem:
    The bytes of the private key for this GitHub Application.
:param int app_id:
    The integer identifier for this GitHub Application.
:param int expire_in:
    The length in seconds for this token to be valid for.
    Default: 600 seconds (10 minutes)

.. _Authenticating as an App:
    https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app
N)r   create_tokenr   app_bearer_token_auth)r&   private_key_pemapp_id	expire_inr   s        r+   login_as_appGitHub.login_as_app  s(    4 !!/9E**5<r-   c                    [         R                  " XUS9n[        R                  " XT5      nU R	                  SS[        U5      S5      nU R                  R                  5          U R                  R                  Xv[         R                  S9nU R                  US5      n	SSS5        U R                  R                  W	5        g! , (       d  f       N*= f)aM  Login using your GitHub App's installation credentials.

.. versionadded:: 1.2.0

.. versionchanged:: 3.0.0

    Added ``expire_in`` parameter.

.. seealso::

    `Authenticating as an Installation`_
        GitHub's documentation of authenticating as an installation.
    `Create a new installation token`_
        API Documentation

.. note::

    This method makes an API call to retrieve the token.

.. warning::

    This method expires after 1 hour.

:param bytes private_key_pem:
    The bytes of the private key for this GitHub Application.
:param int app_id:
    The integer identifier for this GitHub Application.
:param int installation_id:
    The integer identifier of your App's installation.
:param int expire_in:
    (Optional) The number of seconds in the future that the underlying
    JWT expires. To prevent tokens from being valid for too long and
    creating a security risk, the library defaults to 30 seconds. In
    the event that clock drift is significant between your machine and
    GitHub's servers, you can set this higher than 30.
    Default: 30

.. _Authenticating as an Installation:
    https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation
.. _Create a new installation token:
    https://developer.github.com/v3/apps/#create-a-new-installation-token
)rz  r}   r   access_tokens)r2   r#   rN   N)r   rv  r   AppBearerTokenAuthr@   ry   no_authpostrx   rA   app_installation_token_auth)
r&   rx  ry  r   rz  	jwt_tokenbearer_authrI   responserC   s
             r+   login_as_app_installation GitHub.login_as_app_installation  s    Z %%y
	 00Foo?C$8/
 \\!!#||((t/G/G ) H ::h,D	 $ 	006 $#s   #;C
Cc                 *   SnSn0 nU(       a  U R                  SS5      nUnSUS'   O5U R                  S5      n0 nU(       a  XS'   US;   a  X%S	'   U(       a  X5S
'   SnSn	U(       a-  U R                  XXgS9n
U
R                  (       a  U
R                  n	U	$ )a  Render an arbitrary markdown document.

:param str text:
    (required), the text of the document to render
:param str mode:
    (optional), 'markdown' or 'gfm'
:param str context:
    (optional), only important when using mode 'gfm', this is the
    repository to use as the context for the rendering
:param bool raw:
    (optional), renders a document like a README.md, no gfm, no context
:returns:
    the HTML formatted markdown text
:rtype:
    str
NFmarkdownrawz
text/plainzcontent-typetext)r  gfmmodecontextTr>  r=   rC   r#   )r@   rO   okr  )r&   r  r  r  r  r=   rC   r#   rI   htmlr   s              r+   r  GitHub.markdown  s    " //*e4CD&2GN#//*-CD#V**#V")YD**S$*HCvvxxr-   c                     U R                  S5      nU R                  U R                  U5      S5      nU R                  [        R
                  U5      $ )zRetrieve the info for the authenticated user.

.. versionadded:: 1.0

    This was separated from the ``user`` method.

:returns:
    the representation of the authenticated user.
:rtype:
    :class:`~github3.users.AuthenticatedUser`
r8   r>   )r@   rA   rz   rE   r   AuthenticatedUser)r&   rI   rC   s      r+   me	GitHub.me(  sC     oof%zz$))C.#.%%e&=&=tDDr-   c                     [        USU5      nU R                  SSSU5      nU R                  U R                  U5      S5      nU R	                  [
        R                  U5      $ )a]  Retrieve the user's membership in the specified organization.

:param organization:
    the organization or organization login to retrieve the authorized
    user's membership in
:type organization:
    str
:type organization:
    :class:`~github3.orgs.Organization`
:returns:
    the user's membership
:rtype:
    :class:`~github3.orgs.Membership`
r%   r8   r9   r   r>   )r?   r@   rA   rz   rE   r   rF   )r&   rG   rH   rI   rC   s        r+   membership_inGitHub.membership_in9  s\      $L'<HooM6+<
 zz$))C.#.%%doot<<r-   c                 x    U R                  S5      nU R                  U R                  U5      S5      =(       d    0 $ )zRetrieve a dictionary with arrays of addresses in CIDR format.

The addresses in CIDR format specify the addresses that the incoming
service hooks will originate from.

.. versionadded:: 0.5

:returns:
    CIDR addresses
:rtype:
    dict
metar>   r  r  s     r+   r  GitHub.metaP  s0     oof%zz$))C.#.4"4r-   c                     SnUSL a  SS0nO	USL a  SS0nU R                  S5      nU R                  [        U5      U[        R                  XTS9$ )a  Iterate over the user's notification.

:param bool all:
    (optional), iterate over all notifications
:param bool participating:
    (optional), only iterate over notifications in which the user is
    participating
:param int number:
    (optional), how many notifications to return
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of threads
:rtype:
    :class:`~github3.notifications.Thread`
NTalltrueparticipatingr   rV   )r@   rX   rY   r   Thread)r&   r  r  r\   rW   re   rI   s          r+   r   GitHub.notifications`  sb    ( $;V_Fd"%v.Fooo.zzKm22F  
 	
r-   c                     U R                  S5      nU R                  USU0S9nUR                  (       a  UR                  $ S$ )zReturn an easter egg of the API.

:params str say:
    (optional), pass in what you'd like Octocat to say
:returns:
    ascii art of Octocat
:rtype:
    str
octocatsre   r>  )r@   rz   r  r  )r&   sayrI   r   s       r+   r  GitHub.octocat  s=     ooi(iiS#Ji/66sxx)r)r-   c                     U R                  SU5      nU R                  U R                  U5      S5      nU R                  [        R
                  U5      $ )zReturn an Organization object for the login name.

:param str username:
    (required), login name of the org
:returns:
    the organization
:rtype:
    :class:`~github3.orgs.Organization`
r   r>   )r@   rA   rz   rE   r   Organizationr&   r'   rI   rC   s       r+   rG   GitHub.organization  sE     oofh/zz$))C.#.%%d&7&7>>r-   c
                     U R                  SUS5      n
[        R                  " X#XEXg5      nU R                  [	        U5      U
[        R
                  X5      $ )at  Iterate over the organization's issues.

.. note::

    This only works if the authenticated user belongs to it.

:param str name:
    (required), name of the organization
:param str filter:
    accepted values:
    ('assigned', 'created', 'mentioned', 'subscribed')
    api-default: 'assigned'
:param str state:
    accepted values: ('open', 'closed')
    api-default: 'open'
:param str labels:
    comma-separated list of label names, e.g.,
    'bug,ui,@high'
:param str sort:
    accepted values: ('created', 'updated', 'comments')
    api-default: created
:param str direction:
    accepted values: ('asc', 'desc')
    api-default: desc
:param since:
    (optional), Only issues after this date will
    be returned. This can be a `datetime` or an ISO8601 formatted
    date string, e.g., 2012-05-20T23:10:27Z
:type since:
    :class:`~datetime.datetime` or str
:param int number:
    (optional), number of issues to return. Default:
    -1, returns all available issues
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of issues
:rtype:
    :class:`~github3.issues.ShortIssue`
r   r	   rX  )r&   r   rZ  r:   r   r[  r\  rb   r\   rW   rI   re   s               r+   organization_issuesGitHub.organization_issues  sO    j oofdH5$$6
 zz#f+sF,=,=vLLr-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )a  Iterate over all organizations the authenticated user belongs to.

This will display both the private memberships and the publicized
memberships.

:param int number:
    (optional), number of organizations to return.
    Default: -1 returns all available organizations
:param str etag:
    (optional), ETag from a previous request to the same
    endpoint
:returns:
    generator of organizations
:rtype:
    :class:`~github3.orgs.ShortOrganization`
r8   r   rV   rf   r[   s       r+   r`   GitHub.organizations  s5    $ ooff-zz#f+sD,B,BzNNr-   c                     U(       a<  U R                  SUS5      nU R                  [        U5      U[        R                  US9$ [        / 5      $ )a  Iterate over organizations with ``username`` as a public member.

.. versionadded:: 1.0.0

    Replaces ``iter_orgs('sigmavirus24')``.

:param str username:
    (optional), user whose orgs you wish to list
:param int number:
    (optional), number of organizations to return.
    Default: -1 returns all available organizations
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of organizations
:rtype:
    :class:`~github3.orgs.ShortOrganization`
r   r   rV   )r@   rX   rY   r   rg   r`  r#  s        r+   organizations_withGitHub.organizations_with  sM    & //'8V<C::FS$"8"8t    Bxr-   c                    [        U5      nSnUS:  aS  U R                  S[        U5      5      nU R                  U R	                  U[
        R                  R                  S9S5      nU R                  [
        R                  U5      $ )zReturn the Project with id ``number``.

:param int number:
    id of the project
:returns:
    the project
:rtype:
    :class:`~github3.projects.Project`
Nr   r   rw   r>   )	rY   r@   ry   rA   rz   r   ProjectCUSTOM_HEADERSrE   r&   r\   rC   rI   s       r+   projectGitHub.project  st     VA://*c&k:C::		#x'7'7'F'F	GD %%h&6&6==r-   c                    [        U5      nSnUS:  aU  U R                  SSS[        U5      5      nU R                  U R	                  U[
        R                  R                  S9S5      nU R                  [
        R                  U5      $ )zReturn the ProjectCard with id ``number``.

:param int number:
    id of the project card
:returns:
    :class:`~github3.projects.ProjectCard`
Nr   r   columnscardsrw   r>   )
rY   r@   ry   rA   rz   r   r  r  rE   ProjectCardr  s       r+   project_cardGitHub.project_card  sx     VA://*i#f+NC::		#x'7'7'F'F	GD %%h&:&:DAAr-   c                    [        U5      nSnUS:  aT  U R                  SS[        U5      5      nU R                  U R	                  U[
        R                  R                  S9S5      nU R                  [
        R                  U5      $ )zReturn the ProjectColumn with id ``number``.

:param int number:
    id of the project column
:returns:
    :class:`~github3.projects.ProjectColumn`
Nr   r   r  rw   r>   )
rY   r@   ry   rA   rz   r   r  r  rE   ProjectColumnr  s       r+   project_columnGitHub.project_column*  sv     VA://*iVEC::		#x'7'7'F'F	GD %%h&<&<dCCr-   c                     SnU R                  SS5      nUb  S[        R                  " U5      0nU R                  [	        U5      U[
        R                  XBS9$ )aJ  Retrieve all public gists and iterate over them.

.. versionadded:: 1.0

:param int number:
    (optional), number of gists to return. Default: -1
    returns all available gists
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:param since:
    (optional), filters out any gists updated before the
    given time. This can be a `datetime` or an `ISO8601`
    formatted date string, e.g., 2012-05-20T23:10:27Z
:type since:
    :class:`~datetime.datetime` or str
:returns:
    generator of short gists
:rtype:
    :class:`~github3.gists.gist.ShortGist`
Nr   r   rb   rd   )r@   r   timestamp_parameterrX   rY   r   r6  )r&   r\   rW   rb   re   rI   s         r+   public_gistsGitHub.public_gists;  s[    * oogx0u88?@FzzKeoof  
 	
r-   c                     SnU R                  SSS5      nUb&  UR                  5       S;   a  SUR                  5       0nU R                  [        U5      U[        R
                  XCS9$ )zList organizations of which the user is a current or pending member.

:param str state:
    (option), state of the membership, i.e., active, pending
:returns:
    iterator of memberships
:rtype:
    :class:`~github3.orgs.Membership`
Nr8   r9   r   )r;   pendingr:   rd   )r@   lowerrX   rY   r   rF   )r&   r:   r\   rW   re   rI   s         r+   organization_membershipsGitHub.organization_membershipsX  sf     oofmV<2G!Gu{{}-FzzKdoof  
 	
r-   c           	      "   [         R                  U5      nSnU(       ap  U(       ai  U(       ab  U(       a[  SU4SU4SU4/nU(       a  UR                  SU45        U R                  S5      nU R	                  U R                  UUSSS0S	9S
S5      nU$ )a  Create or update a pubsubhubbub hook.

:param str mode:
    (required), accepted values: ('subscribe', 'unsubscribe')
:param str topic:
    (required), form: https://github.com/:user/:repo/events/:event
:param str callback:
    (required), the URI that receives the updates
:param str secret:
    (optional), shared secret key that generates a
    SHA1 HMAC of the payload content.
:returns:
    True if successful, False otherwise
:rtype:
    bool
Fzhub.modez	hub.topiczhub.callbackz
hub.secrethubzContent-Typez!application/x-www-form-urlencodedr  r   r   )
_pubsub_rematchappendr@   r   rO   )	r&   r  topiccallbacksecretmstatusr=   rI   s	            r+   pubsubhubbubGitHub.pubsubhubbubk  s    $ U#Eh1T"e$*D
 \623//%(C ]]

&(K	   F r-   c           	          Sn[        U5      S:  a>  U R                  SXS[        U5      5      nU R                  U R	                  U5      S5      nU R                  [        R                  U5      $ )a  Fetch pull_request #:number: from :owner:/:repository.

:param str owner:
    (required), owner of the repository
:param str repository:
    (required), name of the repository
:param int number:
    (required), issue number
:return:
    :class:`~github.pulls.PullRequest`
Nr   r   r   r>   )rY   r@   ry   rA   rz   rE   r   PullRequest)r&   r   r   r\   rC   rI   s         r+   pull_requestGitHub.pull_request  sb     v;?//GS[C ::diinc2D%%e&7&7>>r-   c                 f    U R                  S5      nU R                  U R                  U5      S5      $ )a~  Return a dictionary with information from /rate_limit.

The dictionary has two keys: ``resources`` and ``rate``. In
``resources`` you can access information about ``core`` or ``search``.

Note: the ``rate`` key will be deprecated before version 3 of the
GitHub API is finalized. Do not rely on that key. Instead, make your
code future-proof by using ``core`` in ``resources``, e.g.,

.. code-block:: python

    rates = g.rate_limit()
    rates['resources']['core']  # => your normal ratelimit info
    rates['resources']['search']  # => your search ratelimit info

.. versionadded:: 0.8

:returns:
    ratelimit mapping
:rtype:
    dict

rate_limitr>   r  r  s     r+   r  GitHub.rate_limit  s+    . ool+zz$))C.#..r-   c                     U R                  SS5      n0 nUS;   a  UR                  US9  US;   a  UR                  US9  US;   a  UR                  US9  U R                  [        U5      U[        R
                  Xu5      $ )	aY  List repositories for the authenticated user filterable by ``type``.

.. versionchanged:: 0.6

   Removed the login parameter for correctness. Use repositories_by
   instead

:param str type:
    (optional), accepted values:
    ('all', 'owner', 'public', 'private', 'member')
    API default: 'all'
:param str sort:
    (optional), accepted values:
    ('created', 'updated', 'pushed', 'full_name')
    API default: 'created'
:param str direction:
    (optional), accepted values:
    ('asc', 'desc'), API default: 'asc' when using 'full_name',
    'desc' otherwise
:param int number:
    (optional), number of repositories to return.
    Default: -1 returns all repositories
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of repositories
:rtype:
    :class:`~github3.repos.repo.ShortRepository`
r8   r   )r  r   r   r   membertypecreatedupdatedpushed	full_namer[  ascdescr\  r@   r$   rX   rY   r   rn   )r&   r  r[  r\  r\   rW   rI   re   s           r+   rl   GitHub.repositories  s    B oofg.BBMMtM$@@MMtM$'MMIM.zzKd22F
 	
r-   c                     U R                  SUS5      n0 nUS;   a  UR                  US9  US;   a  UR                  US9  US;   a  UR                  US9  U R                  [        U5      U[        R
                  X5      $ )	a  List public repositories for the specified ``username``.

.. versionadded:: 0.6

:param str username:
    (required), username
:param str type:
    (optional), accepted values: ('all', 'owner', 'member')
    API default: 'all'
:param str sort:
    (optional), accepted values:
    ('created', 'updated', 'pushed', 'full_name')
    API default: 'created'
:param str direction:
    (optional), accepted values:
    ('asc', 'desc'), API default: 'asc' when using 'full_name',
    'desc' otherwise
:param int number:
    (optional), number of repositories to return.
    Default: -1 returns all repositories
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of repositories
:rtype:
    :class:`~github3.repos.repo.ShortRepository`
r   r   )r  r   r  r  r  r  r  r  r  )	r&   r'   r  r[  r\  r\   rW   rI   re   s	            r+   repositories_byGitHub.repositories_by  s    H oogx9--MMtM$@@MMtM$'MMIM.zzKd22F
 	
r-   c                     SnU(       a:  U(       a3  U R                  SX5      nU R                  U R                  U5      S5      nU R                  [        R
                  U5      $ )zRetrieve the desired repository.

:param str owner:
    (required)
:param str repository:
    (required)
:returns:
    the repository
:rtype:
    :class:`~github3.repos.repo.Repository`
Nr   r>   )r@   rA   rz   rE   r   r   )r&   r   r   rC   rI   s        r+   r   GitHub.repository(  sM     Z//'5=C::diinc2D%%doot<<r-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )a{  Iterate over the repository invitations for the current user.

:param int number:
    (optional), number of invitations to return. Default: -1 returns
    all available invitations
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of repository invitation objects
:rtype:
    :class:`~github3.repos.invitation.Invitation`
r8   repository_invitationsrV   )r@   rX   rY   r   
Invitationr[   s       r+   r  GitHub.repository_invitations:  s6     oof&>?zz#f+sJ,A,AzMMr-   c                     [        U5      nSnUS:  a<  U R                  S[        U5      5      nU R                  U R	                  U5      S5      nU R                  [        R                  U5      $ )zRetrieve the repository with the globally unique id.

:param int number:
    id of the repository
:returns:
    the repository
:rtype:
    :class:`~github3.repos.repo.Repository`
Nr   rl   r>   )rY   r@   ry   rA   rz   rE   r   r   r  s       r+   repository_with_idGitHub.repository_with_idK  s\     VA://.#f+>C::diinc2D%%doot<<r-   c                 *   U R                   R                  5       u  p#U R                  S[        U5      SU5      nU R                   R	                  X#5         U R                  USSS.S9nSSS5        U R                  WSS5      $ ! , (       d  f       N!= f)aA  Revoke specified authorization for an OAuth application.

Revoke all authorization tokens created by your application. This will
only work if you have already called ``set_client_id``.

:param str access_token:
    (required), the access_token to revoke
:returns:
    True if successful, False otherwise
:rtype:
    bool
r   r   Nr   r  r   r   r   retrieve_client_credentialsr@   ry   r   r   r   )r&   r   r   r   rI   r  s         r+   revoke_authorizationGitHub.revoke_authorization\  s     $(<<#K#K#M 	ooC	NHl
 \\..yH||$F $ H I
 }}XsC00 IHs   B
Bc                 (   U R                   R                  5       u  pU R                  S[        U5      S5      nU R                   R	                  X5         U R                  USSS.S9nSSS5        U R                  WSS5      $ ! , (       d  f       N!= f)a@  Revoke all authorizations for an OAuth application.

Revoke all authorization tokens created by your application. This will
only work if you have already called ``set_client_id``.

:param str client_id:
    (required), the client_id of your application
:returns:
    True if successful, False otherwise
:rtype:
    bool
r   r   Nr   r  r   r   r  )r&   r   r   rI   r  s        r+   revoke_authorizationsGitHub.revoke_authorizationsu  s     $(<<#K#K#M 	oonc)nhG\\..yH||$F $ H I
 }}XsC00 IHs   B
Bc           	          SU0n0 n	US:X  a  X(S'   U(       a
  US;   a  X8S'   U(       a  SS0n	U R                  SS	5      n
[        R                  " Xj[        R                  XXy5      $ )
u}  Find code via the code search API.

The query can contain any combination of the following supported
qualifiers:

- ``in`` Qualifies which fields are searched. With this qualifier you
  can restrict the search to just the file contents, the file path, or
  both.
- ``language`` Searches code based on the language it’s written in.
- ``fork`` Specifies that code from forked repositories should be
  searched.  Repository forks will not be searchable unless the fork
  has more stars than the parent repository.
- ``size`` Finds files that match a certain size (in bytes).
- ``path`` Specifies the path that the resulting file must be at.
- ``extension`` Matches files with a certain extension.
- ``user`` or ``repo`` Limits searches to a specific user or
  repository.

For more information about these qualifiers, see: http://git.io/-DvAuA

:param str query:
    (required), a valid query as described above, e.g.,
    ``addClass in:file language:js repo:jquery/jquery``
:param str sort:
    (optional), how the results should be sorted;
    option(s): ``indexed``; default: best match
:param str order:
    (optional), the direction of the sorted results,
    options: ``asc``, ``desc``; default: ``desc``
:param int per_page:
    (optional)
:param bool text_match:
    (optional), if True, return matching search
    terms. See http://git.io/iRmJxg for more information
:param int number:
    (optional), number of repositories to return.
    Default: -1, returns all available repositories
:param str etag:
    (optional), previous ETag header value
:return:
    generator of code search results
:rtype:
    :class:`~github3.search.code.CodeSearchResult`
qindexedr[  r  orderAccept.application/vnd.github.v3.full.text-match+jsonr   code)r@   r   SearchIteratorr   CodeSearchResultr&   queryr[  r  rc   
text_matchr\   rW   re   r#   rI   s              r+   search_codeGitHub.search_code  sw    l u9!6NE_,#7OJG ooh/%%00$
 	
r-   c           	          SU0nSS0n	US;   a  X(S'   U(       a
  US;   a  X8S'   U(       a  SR                  U	S   S	/5      U	S'   U R                  S
S5      n
[        R                  " UU
[        R
                  U UUU	5      $ )a	  Find commits via the commits search API.

The query can contain any combination of the following supported
qualifiers:

- ``author`` Matches commits authored by the given username.
  Example: ``author:defunkt``.
- ``committer`` Matches commits committed by the given username.
  Example: ``committer:defunkt``.
- ``author-name`` Matches commits authored by a user with the given
  name. Example: ``author-name:wanstrath``.
- ``committer-name`` Matches commits committed by a user with the given
  name. Example: ``committer-name:wanstrath``.
- ``author-email`` Matches commits authored by a user with the given
  email. Example: ``author-email:chris@github.com``.
- ``committer-email`` Matches commits committed by a user with the
  given email. Example: ``committer-email:chris@github.com``.
- ``author-date`` Matches commits authored within the specified date
  range. Example: ``author-date:<2016-01-01``.
- ``committer-date`` Matches commits committed within the specified
  date range. Example: ``committer-date:>2016-01-01``.
- ``merge`` Matches merge commits when set to to ``true``, excludes
  them when set to ``false``.
- ``hash`` Matches commits with the specified hash. Example:
  ``hash:124a9a0ee1d8f1e15e833aff432fbb3b02632105``.
- ``parent`` Matches commits whose parent has the specified hash.
  Example: ``parent:124a9a0ee1d8f1e15e833aff432fbb3b02632105``.
- ``tree`` Matches commits with the specified tree hash. Example:
  ``tree:99ca967``.
- ``is`` Matches public repositories when set to ``public``, private
  repositories when set to ``private``.
- ``user`` or ``org`` or ``repo`` Limits the search to a specific user,
  organization, or repository.

For more information about these qualifiers, see: https://git.io/vb7XQ

:param str query:
    (required), a valid query as described above, e.g.,
    ``css repo:octocat/Spoon-Knife``
:param str sort:
    (optional), how the results should be sorted;
    options: ``author-date``, ``committer-date``;
    default: best match
:param str order:
    (optional), the direction of the sorted results,
    options: ``asc``, ``desc``; default: ``desc``
:param int per_page:
    (optional)
:param int number:
    (optional), number of commits to return.
    Default: -1, returns all available commits
:param str etag:
    (optional), previous ETag header value
:return:
    generator of commit search results
:rtype:
    :class:`~github3.search.commits.CommitSearchResult`
r  r	  z$application/vnd.github.cloak-preview)zauthor-datezcommitter-dater[  r  r  z, r
  r   commits)joinr@   r   r  r   CommitSearchResultr  s              r+   search_commitsGitHub.search_commits  s    H uCD44!6NE_,#7O $		H%D!GH ooh	2%%%%
 	
r-   c           	          SU0n0 n	US;   a  X(S'   US;   a  X8S'   U(       a  SS0n	U R                  SS	5      n
[        R                  " Xj[        R                  XXy5      $ )
u,  Find issues by state and keyword.

The query can contain any combination of the following supported
qualifers:

- ``type`` With this qualifier you can restrict the search to issues
  or pull request only.
- ``in`` Qualifies which fields are searched. With this qualifier you
  can restrict the search to just the title, body, comments, or any
  combination of these.
- ``author`` Finds issues created by a certain user.
- ``assignee`` Finds issues that are assigned to a certain user.
- ``mentions`` Finds issues that mention a certain user.
- ``commenter`` Finds issues that a certain user commented on.
- ``involves`` Finds issues that were either created by a certain user,
  assigned to that user, mention that user, or were commented on by
  that user.
- ``state`` Filter issues based on whether they’re open or closed.
- ``labels`` Filters issues based on their labels.
- ``language`` Searches for issues within repositories that match a
  certain language.
- ``created`` or ``updated`` Filters issues based on times of creation,
  or when they were last updated.
- ``comments`` Filters issues based on the quantity of comments.
- ``user`` or ``repo`` Limits searches to a specific user or
  repository.

For more information about these qualifiers, see: http://git.io/d1oELA

:param str query:
    (required), a valid query as described above, e.g.,
    ``windows label:bug``
:param str sort:
    (optional), how the results should be sorted;
    options: ``created``, ``comments``, ``updated``;
    default: best match
:param str order:
    (optional), the direction of the sorted results,
    options: ``asc``, ``desc``; default: ``desc``
:param int per_page:
    (optional)
:param bool text_match:
    (optional), if True, return matching search terms.
    See http://git.io/QLQuSQ for more information
:param int number:
    (optional), number of issues to return.
    Default: -1, returns all available issues
:param str etag:
    (optional), previous ETag header value
:return:
    generator of issue search results
:rtype:
    :class:`~github3.search.issue.IssueSearchResult`
r  )commentsr  r  r[  r  r  r	  r
  r   r	   )r@   r   r  r   IssueSearchResultr  s              r+   search_issuesGitHub.search_issues5	  sv    @ u55!6NO##7OJG ooh1%%114
 	
r-   c           	          SU0n0 n	US;   a  X(S'   US;   a  X8S'   U(       a  SS0n	U R                  SS	5      n
[        R                  " UU
[        R                  U UUU	5      $ )
a;  Find repositories via various criteria.

The query can contain any combination of the following supported
qualifers:

- ``in`` Qualifies which fields are searched. With this qualifier you
  can restrict the search to just the repository name, description,
  readme, or any combination of these.
- ``size`` Finds repositories that match a certain size (in
  kilobytes).
- ``forks`` Filters repositories based on the number of forks, and/or
  whether forked repositories should be included in the results at
  all.
- ``created`` or ``pushed`` Filters repositories based on times of
  creation, or when they were last updated. Format: ``YYYY-MM-DD``.
  Examples: ``created:<2011``, ``pushed:<2013-02``,
  ``pushed:>=2013-03-06``
- ``user`` or ``repo`` Limits searches to a specific user or
  repository.
- ``language`` Searches repositories based on the language they're
  written in.
- ``stars`` Searches repositories based on the number of stars.

For more information about these qualifiers, see: http://git.io/4Z8AkA

:param str query:
    (required), a valid query as described above, e.g.,
    ``tetris language:assembly``
:param str sort:
    (optional), how the results should be sorted;
    options: ``stars``, ``forks``, ``updated``; default: best match
:param str order:
    (optional), the direction of the sorted results,
    options: ``asc``, ``desc``; default: ``desc``
:param int per_page:
    (optional)
:param bool text_match:
    (optional), if True, return matching search
    terms. See http://git.io/4ct1eQ for more information
:param int number:
    (optional), number of repositories to return.
    Default: -1, returns all available repositories
:param str etag:
    (optional), previous ETag header value
:return:
    generator of repository search results
:rtype:
    :class:`~github3.search.repository.RepositorySearchResult`
r  )starsforksr  r[  r  r  r	  r
  r   rl   )r@   r   r  r   RepositorySearchResultr  s              r+   search_repositoriesGitHub.search_repositories	  s    v u00!6NO##7OJG ooh7%%))
 	
r-   c           	          SU0n0 n	US;   a  X(S'   US;   a  X8S'   U(       a  SS0n	U R                  SS	5      n
[        R                  " Xj[        R                  XXy5      $ )
a  Find users via the Search API.

The query can contain any combination of the following supported
qualifers:


- ``type`` With this qualifier you can restrict the search to just
  personal accounts or just organization accounts.
- ``in`` Qualifies which fields are searched. With this qualifier you
  can restrict the search to just the username, public email, full
  name, or any combination of these.
- ``repos`` Filters users based on the number of repositories they
  have.
- ``location`` Filter users by the location indicated in their
  profile.
- ``language`` Search for users that have repositories that match a
  certain language.
- ``created`` Filter users based on when they joined.
- ``followers`` Filter users based on the number of followers they
  have.

For more information about these qualifiers see: http://git.io/wjVYJw

:param str query:
    (required), a valid query as described above, e.g.,
    ``tom repos:>42 followers:>1000``
:param str sort:
    (optional), how the results should be sorted;
    options: ``followers``, ``repositories``, or ``joined``; default:
    best match
:param str order:
    (optional), the direction of the sorted results,
    options: ``asc``, ``desc``; default: ``desc``
:param int per_page:
    (optional)
:param bool text_match:
    (optional), if True, return matching search
    terms. See http://git.io/_V1zRwa for more information
:param int number:
    (optional), number of search results to return;
    Default: -1 returns all available
:param str etag:
    (optional), ETag header value of the last request.
:return:
    generator of user search results
:rtype:
    :class:`~github3.search.user.UserSearchResult`
r  )r(  rl   joinedr[  r  r  r	  r
  r   r   )r@   r   r  r   UserSearchResultr  s              r+   search_usersGitHub.search_users	  sv    t u::!6NO##7OJG ooh0%%00$
 	
r-   c                 *    XS.U R                   l        g)zAllow the developer to set their OAuth application credentials.

:param str id:
    20-character hexidecimal client_id provided by GitHub
:param str secret:
    40-character hexidecimal client_secret provided by GitHub
r   N)r   re   )r&   r3   r  s      r+   set_client_idGitHub.set_client_id)
  s     -/Hr-   c                 b    U(       d  gU R                   R                  R                  SU05        g)zAllow the user to set their own user agent string.

:param str user_agent:
    string used to identify your application.
    Library default: "github3.py/{version}", e.g., "github3.py/1.0.0"
Nz
User-Agent)r   r#   r$   )r&   
user_agents     r+   set_user_agentGitHub.set_user_agent3
  s'     ##\:$>?r-   c                     SnU(       a<  U(       a5  U R                  SSX5      nU R                  U R                  U5      SS5      nU$ )zStar a repository.

:param str username:
    (required), owner of the repo
:param str repo:
    (required), name of the repo
:return:
    True if successful, False otherwise
:rtype:
    bool
Fr8   rO  r   r   r  r&   r'   r   r   rI   s        r+   starGitHub.star>
  rR  r-   c                     XS.nU R                  U5        U R                  SS5      nU R                  [        U5      U[        R
                  XT5      $ )a  Iterate over repositories starred by the authenticated user.

.. versionchanged:: 1.0.0

   This was split from ``iter_starred`` and requires authentication.

:param str sort:
    (optional), either 'created' (when the star was
    created) or 'updated' (when the repository was last pushed to)
:param str direction:
    (optional), either 'asc' or 'desc'. Default: 'desc'
:param int number:
    (optional), number of repositories to return.
    Default: -1 returns all repositories
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of repositories
:rtype:
    :class:`~github3.repos.repo.ShortRepository>`
r[  r\  r8   rO  )_remove_noner@   rX   rY   r   rn   )r&   r[  r\  r\   rW   re   rI   s          r+   rO  GitHub.starredQ
  sN    . 7&!oofi0zzKd22F
 	
r-   c                     X#S.nU R                  U5        U R                  S[        U5      S5      nU R                  [	        U5      U[
        R                  Xe5      $ )a  Iterate over repositories starred by ``username``.

.. versionadded:: 1.0

   This was split from ``iter_starred`` and requires the login
   parameter.

:param str username:
    name of user whose stars you want to see
:param str sort:
    (optional), either 'created' (when the star was created) or
    'updated' (when the repository was last pushed to)
:param str direction:
    (optional), either 'asc' or 'desc'. Default: 'desc'
:param int number:
    (optional), number of repositories to return.
    Default: -1 returns all repositories
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of repositories
:rtype:
    :class:`~github3.repos.repo.ShortRepository`
r5  r   rO  )r6  r@   ry   rX   rY   r   rn   )r&   r'   r[  r\  r\   rW   re   rI   s           r+   
starred_byGitHub.starred_byo
  sT    6 7&!oogs8}i@zzKd22F
 	
r-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )af  Iterate over repositories subscribed to by the authenticated user.

:param int number:
    (optional), number of repositories to return.
    Default: -1 returns all repositories
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of repositories
:rtype:
    :class:`~github3.repos.repo.ShortRepository`
r8   subscriptionsrV   rm   r[   s       r+   r<  GitHub.subscriptions
  s5     oofo6zz#f+sD,@,@tzLLr-   c                     U R                  S[        U5      S5      nU R                  [        U5      U[        R
                  US9$ )a  Iterate over repositories subscribed to by ``username``.

:param str username:
    name of user whose subscriptions you want to see
:param int number:
    (optional), number of repositories to return.
    Default: -1 returns all repositories
:param str etag:
    (optional), ETag from a previous request to the same endpoint
:returns:
    generator of subscribed repositories
:rtype:
    :class:`~github3.repos.repo.ShortRepository`
r   r<  rV   )r@   ry   rX   rY   r   rn   r#  s        r+   subscriptions_forGitHub.subscriptions_for
  s;     oogs8}oFzz#f+sD,@,@tzLLr-   c                     SnU(       a5  U R                  SSU5      nU R                  U R                  U5      SS5      nU$ )zMake the authenticated user stop following username.

:param str username:
    (required)
:returns:
    True if successful, False otherwise
:rtype:
    bool
Fr8   r  r   r   r@   r   r   r  s       r+   unfollowGitHub.unfollow
  s>     //&+x@C==c!2C=Dr-   c                     SnU(       a<  U(       a5  U R                  SSX5      nU R                  U R                  U5      SS5      nU$ )zUnstar username/repo.

:param str username:
    (required), owner of the repo
:param str repo:
    (required), name of the repo
:return:
    True if successful, False otherwise
:rtype:
    bool
Fr8   rO  r   r   rB  r1  s        r+   unstarGitHub.unstar
  s@     //&)XDC==c!2C=Dr-   c                     UUUUUUUS.nU R                  U5        U R                  S5      n	U R                  U R                  U	[        R
                  " U5      S9S5      n
U
(       a  U R                  U
5        gg)a  Update the profile of the authenticated user.

:param str name:
    e.g., 'John Smith', not login name
:param str email:
    e.g., 'john.smith@example.com'
:param str blog:
    e.g., 'http://www.example.com/jsmith/blog'
:param str company:
:param str location:
:param bool hireable:
    defaults to False
:param str bio:
    GitHub flavored markdown
:returns:
    True if successful, False otherwise
:rtype:
    bool
)r   rR   blogcompanylocationhireablebior8   r<   r>   TF)r6  r@   rA   rB   rC   rD   _update_attributes)r&   r   rR   rI  rJ  rK  rL  rM  r8   rI   rA   s              r+   	update_meGitHub.update_me
  s{    >   
 	$oof%

4;;sD1A;BCH##E*r-   c                     U R                  SU5      nU R                  U R                  U5      S5      nU R                  [        R
                  U5      $ )zRetrieve a User object for the specified user name.

:param str username:
    name of the user
:returns:
    the user
:rtype:
    :class:`~github3.users.User`
r   r>   )r@   rA   rz   rE   r   Userr  s       r+   r8   GitHub.user  sC     oogx0zz$))C.#.%%ejj$77r-   c
                     U R                  SS5      n
[        R                  " XX4XV5      nUR                  US9  U R	                  [        U5      U
[        R                  X5      $ )a  List only the authenticated user's issues.

Will not list organization's issues. See :meth:`organization_issues`.

.. versionchanged:: 1.0

    ``per_page`` parameter added before ``number``

.. versionchanged:: 0.9.0

    - The ``state`` parameter now accepts 'all' in addition to 'open'
      and 'closed'.

:param str filter:
    accepted values:
    ('assigned', 'created', 'mentioned', 'subscribed')
    api-default: 'assigned'
:param str state:
    accepted values: ('all', 'open', 'closed')
    api-default: 'open'
:param str labels:
    comma-separated list of label names, e.g.,
    'bug,ui,@high'
:param str sort:
    accepted values: ('created', 'updated', 'comments')
    api-default: created
:param str direction:
    accepted values: ('asc', 'desc')
    api-default: desc
:param since:
    (optional), Only issues after this date will
    be returned. This can be a `datetime` or an ISO8601 formatted
    date string, e.g., 2012-05-20T23:10:27Z
:type since:
    :class:`~datetime.datetime` or str
:param int number:
    (optional), number of issues to return.
    Default: -1 returns all issues
:param str etag:
    (optional), ETag from a previous request to the same
    endpoint
:returns:
    generator of issues
:rtype:
    :class:`~github3.issues.ShortIssue`
r8   r	   )rc   )r@   r	   rY  r$   rX   rY   r   )r&   rZ  r:   r   r[  r\  rb   rc   r\   rW   rI   re   s               r+   user_issuesGitHub.user_issues  s[    v oofh/$$6
 	x(zz#f+sF,=,=vLLr-   c                 x    U R                  SS5      nU R                  [        U5      U[        R                  US9$ )a6  Get the authenticated user's teams across all of organizations.

List all of the teams across all of the organizations to which the
authenticated user belongs. This method requires user or repo scope
when authenticating via OAuth.

:returns:
    generator of teams
:rtype:
    :class:`~github3.orgs.ShortTeam`
r8   teamsrV   )r@   rX   rY   r   	ShortTeamr[   s       r+   
user_teamsGitHub.user_teamsX  s3     oofg.zz#f+sDNNzFFr-   c                     [        U5      nSnUS:  a<  U R                  S[        U5      5      nU R                  U R	                  U5      S5      nU R                  [        R                  U5      $ )zGet the user's information with id ``number``.

:param int number:
    the user's id number
:returns:
    the user
:rtype:
    :class:`~github3.users.User`
Nr   r8   r>   )rY   r@   ry   rA   rz   rE   r   rR  r  s       r+   user_with_idGitHub.user_with_idh  s\     VA://&#f+6C::diinc2D%%ejj$77r-   c                     U R                  S5      nU R                  U5      nUR                  S:X  a  UR                  $ SR	                  S5      $ )ztReturn a quote from the Zen of GitHub.

Yet another API Easter Egg

:returns:
    the zen of GitHub
:rtype:
    str
zenr>   r-   zutf-8)r@   rz   status_coder  decode)r&   rI   r   s      r+   r`  
GitHub.zeny  sD     ooe$yy~ ,,3tyyLG9LLr-    )r>  r>  r>  Nr>  )N)re  NNN)re  )Nr>  r>  r>  r>  )T)F)r>  r>  FTTFr>  T)r>  r>  r>  r>  r>  Nre  N)
NNNNNNNNre  N)NNNN)   )r>  r>  F)FFre  N)N)re  NN)Nre  N)r>  )NNNre  N)NNNFre  N)NNre  N)NNNNNFN)	r>  r>  r>  r>  r>  NNre  N)~__name__
__module____qualname____firstlineno____doc__r!   r5   r   rJ   rS   r]   ri   ro   rt   r}   r   requires_app_bearer_authr   r   r   r   r   requires_app_installation_authr   r   r   r   r   r   rY   tOptionalry   	Generatorr   rs   r   UserLikeboolr   r   r   r   r   r   r   r   r   r   rM   r  r  r   r$  r(  r,  r  r2  r   r9  r   rC  rF  r   rL  rP  rU  r	   rb  r   r   rj  r
   r%   r   DEFAULT_JWT_TOKEN_EXPIRATIONr{  r  r  r  r  r  r   r  rG   r  r`   r  r  r  r  r  r  r  r  r  rl   r  r   r  r  r   r   r  r  r  r  r"  r'  r*  r.  r2  rO  r9  r<  r?  rC  rF  rO  r8   rU  rZ  r]  r`  __static_attributes____classcell__r*   s   @r+   r   r   %   s   2 MO+(7
 > >. ,. L L E" :>
< :>
:
<64 ((? )?4 ((
 )
4 ((? )?4 ((? )?< ((? )?6 ..
 /
8 ((6 )60 A A L L2 5An 8<HH&'jjoH	
U__dD0	1H H( 7enn 7 7 7 : :4 : : 7ENN 7t 7 76  8  8D : :"  :? :?x 7 70  9= 9=v /1 
 
 D D I" 7 7r   H, H H(H, H H(8 H H$H(&	5 : : E E"  "  $:,  6M 6Mx M^ 7 7  B B >	N  C> 33	=< CE:7x+Z E E  = =,5  >B
 
<*?  9M 9Mv O O(4>&B"D"
: 
 
$ + +Z?(/4 DH,
 ,
b 0
d=$ N N =" 1 10 1 12 G
X ^
F Q
l R
n K
ZI	@  $ 
 
< DH 
D M M M$     $  , ,\8  @M @MD G G8"M Mr-   r   c                   `   ^  \ rS rSrSr     SU 4S jjrS r\S 5       r\S 5       r	Sr
U =r$ )	GitHubEnterprisei  a
  An interface to a specific GitHubEnterprise instance.

For GitHub Enterprise users, this object will act as the public API to
your instance. You must provide the URL to your instance upon
initialization and can provide the rest of the login details just like in
the :class:`GitHub <GitHub>` object.

There is no need to provide the end of the url (e.g., /api/v3/), that will
be taken care of by us.

If you have a self signed SSL for your local github enterprise you can
override the validation by passing `verify=False`.
c                    > [         TU ]  X#XFS9  UR                  S5      S-   U R                  l        XPR                  l        Xl        g)z1Create a client for a GitHub Enterprise instance.r   /z/api/v3N)r    r!   rstripr   base_urlverifyrI   )r&   rI   r'   r(   r   r}  r   r*   s          r+   r!   GitHubEnterprise.__init__  s?     	UD #

3) ;$r-   c                 "    SU R                    S3$ )Nz<GitHub Enterprise [r/   rI   r4   s    r+   r5   GitHubEnterprise._repr  s    %dhhZr22r-   c                     U R                  SS5      nXS.nU R                  U R                  X4S9S5      nU R                  [        R
                  U5      $ )a&  Create a new user.

.. note::

    This is only available for administrators of the instance.

:param str login:
    (required), The user's username.
:param str email:
    (required), The user's email address.
:returns:
    created user
:rtype:
    :class:`ShortUser <github3.users.ShortUser>`
adminr   )r%   rR   r<   rN   )r@   rA   rO   rE   r   rs   )r&   r%   rR   rI   payload	json_datas         r+   create_userGitHubEnterprise.create_user  sN    " oogw/!2JJtzz#z<cB	%%eooyAAr-   c                     0 nUR                  5       S;   aB  U R                  SSUR                  5       5      nU R                  U R                  U5      S5      nU$ )a  Retrieve statistics about this GitHub Enterprise instance.

:param str option:
    (required), accepted values: ('all', 'repos',
    'hooks', 'pages', 'orgs', 'users', 'pulls', 'issues',
    'milestones', 'gists', 'comments')
:returns:
    the statistics
:rtype:
    dict
)r  r   hookspagesr   r   r   r	   
milestonesr   r  
enterprisestatsr>   )r  r@   rA   rz   )r&   optionr  rI   s       r+   admin_statsGitHubEnterprise.admin_stats  sS     <<> 
 
 //,HCJJtyy~s3Er-   r  )r>  r>  r>  TN)rg  rh  ri  rj  rk  r!   r5   r   r  r  rt  ru  rv  s   @r+   rx  rx    sM    " 3 B B*  r-   rx  )#rk  rC   retypingrn  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   compiler  
GitHubCorer   rx  rd  r-   r+   <module>r     s    :  	                    0 % +   ZZ=

`-MV `-MF[Tv Tr-   