INSTRUCTION
stringlengths
1
46.3k
RESPONSE
stringlengths
75
80.2k
:calls: `GET /issues <http://developer.github.com/v3/issues>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Issue.Issue` :param filter: string :param state: string :param labels: list of :class:`github.Label.Label` :param sort: string :param direc...
def get_issues(self, filter=github.GithubObject.NotSet, state=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): """ :calls: `GET /issues <http://developer.github.com/v3/issues>`_ ...
:calls: `GET /user/keys/:id <http://developer.github.com/v3/users/keys>`_ :param id: integer :rtype: :class:`github.UserKey.UserKey`
def get_key(self, id): """ :calls: `GET /user/keys/:id <http://developer.github.com/v3/users/keys>`_ :param id: integer :rtype: :class:`github.UserKey.UserKey` """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestJsonAndCheck( ...
:calls: `GET /notifications/threads/:id <http://developer.github.com/v3/activity/notifications>`_ :rtype: :class:`github.Notification.Notification`
def get_notification(self, id): """ :calls: `GET /notifications/threads/:id <http://developer.github.com/v3/activity/notifications>`_ :rtype: :class:`github.Notification.Notification` """ assert isinstance(id, (str, unicode)), id headers, data = self._requester.requestJs...
:calls: `GET /notifications <http://developer.github.com/v3/activity/notifications>`_ :param all: bool :param participating: bool :param since: datetime.datetime :param before: datetime.datetime :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Notification.No...
def get_notifications(self, all=github.GithubObject.NotSet, participating=github.GithubObject.NotSet, since=github.GithubObject.NotSet, before=github.GithubObject.NotSet): """ :calls: `GET /notifications <http://developer.github.com/v3/activity/notifications>`_ :param all: bool :param pa...
:calls: `GET /users/:user/events/orgs/:org <http://developer.github.com/v3/activity/events>`_ :param org: :class:`github.Organization.Organization` :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
def get_organization_events(self, org): """ :calls: `GET /users/:user/events/orgs/:org <http://developer.github.com/v3/activity/events>`_ :param org: :class:`github.Organization.Organization` :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event` """ ...
:calls: `GET /user/orgs <http://developer.github.com/v3/orgs>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization`
def get_orgs(self): """ :calls: `GET /user/orgs <http://developer.github.com/v3/orgs>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization` """ return github.PaginatedList.PaginatedList( github.Organization.Organization, ...
:calls: `GET /user/repos <http://developer.github.com/v3/repos>` :param visibility: string :param affiliation: string :param type: string :param sort: string :param direction: string :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Reposito...
def get_repos(self, visibility=github.GithubObject.NotSet, affiliation=github.GithubObject.NotSet, type=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet): """ :calls: `GET /user/repos <http://developer.github.com/v3/repos>` :param visibility: stri...
:calls: `GET /user/starred <http://developer.github.com/v3/activity/starring>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
def get_starred(self): """ :calls: `GET /user/starred <http://developer.github.com/v3/activity/starring>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` """ return github.PaginatedList.PaginatedList( github.Repository.Rep...
:calls: `GET /gists/starred <http://developer.github.com/v3/gists>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist`
def get_starred_gists(self): """ :calls: `GET /gists/starred <http://developer.github.com/v3/gists>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Gist.Gist` """ return github.PaginatedList.PaginatedList( github.Gist.Gist, self._re...
:calls: `GET /user/following/:user <http://developer.github.com/v3/users/followers>`_ :param following: :class:`github.NamedUser.NamedUser` :rtype: bool
def has_in_following(self, following): """ :calls: `GET /user/following/:user <http://developer.github.com/v3/users/followers>`_ :param following: :class:`github.NamedUser.NamedUser` :rtype: bool """ assert isinstance(following, github.NamedUser.NamedUser), following ...
:calls: `GET /user/starred/:owner/:repo <http://developer.github.com/v3/activity/starring>`_ :param starred: :class:`github.Repository.Repository` :rtype: bool
def has_in_starred(self, starred): """ :calls: `GET /user/starred/:owner/:repo <http://developer.github.com/v3/activity/starring>`_ :param starred: :class:`github.Repository.Repository` :rtype: bool """ assert isinstance(starred, github.Repository.Repository), starred ...
:calls: `GET /user/subscriptions/:owner/:repo <http://developer.github.com/v3/activity/watching>`_ :param subscription: :class:`github.Repository.Repository` :rtype: bool
def has_in_subscriptions(self, subscription): """ :calls: `GET /user/subscriptions/:owner/:repo <http://developer.github.com/v3/activity/watching>`_ :param subscription: :class:`github.Repository.Repository` :rtype: bool """ assert isinstance(subscription, github.Reposito...
:calls: `GET /repos/:owner/:repo/subscription <http://developer.github.com/v3/activity/watching>`_ :param watched: :class:`github.Repository.Repository` :rtype: bool
def has_in_watched(self, watched): """ :calls: `GET /repos/:owner/:repo/subscription <http://developer.github.com/v3/activity/watching>`_ :param watched: :class:`github.Repository.Repository` :rtype: bool """ assert isinstance(watched, github.Repository.Repository), watch...
:calls: `PUT /notifications <https://developer.github.com/v3/activity/notifications>`_ :param last_read_at: datetime
def mark_notifications_as_read(self, last_read_at=datetime.datetime.utcnow()): """ :calls: `PUT /notifications <https://developer.github.com/v3/activity/notifications>`_ :param last_read_at: datetime """ assert isinstance(last_read_at, datetime.datetime) put_parameters = ...
:calls: `DELETE /user/subscriptions/:owner/:repo <http://developer.github.com/v3/activity/watching>`_ :param subscription: :class:`github.Repository.Repository` :rtype: None
def remove_from_subscriptions(self, subscription): """ :calls: `DELETE /user/subscriptions/:owner/:repo <http://developer.github.com/v3/activity/watching>`_ :param subscription: :class:`github.Repository.Repository` :rtype: None """ assert isinstance(subscription, github....
:calls: `DELETE /repos/:owner/:repo/subscription <http://developer.github.com/v3/activity/watching>`_ :param watched: :class:`github.Repository.Repository` :rtype: None
def remove_from_watched(self, watched): """ :calls: `DELETE /repos/:owner/:repo/subscription <http://developer.github.com/v3/activity/watching>`_ :param watched: :class:`github.Repository.Repository` :rtype: None """ assert isinstance(watched, github.Repository.Repository...
:calls: `PATCH /user/repository_invitations/:invitation_id <https://developer.github.com/v3/repos/invitations/>` :param invitation: :class:`github.Invitation.Invitation` or int :rtype: None
def accept_invitation(self, invitation): """ :calls: `PATCH /user/repository_invitations/:invitation_id <https://developer.github.com/v3/repos/invitations/>` :param invitation: :class:`github.Invitation.Invitation` or int :rtype: None """ assert isinstance(invitation, git...
:calls: `POST /user/migrations`_ :param repos: list or tuple of str :param lock_repositories: bool :param exclude_attachments: bool :rtype: :class:`github.Migration.Migration`
def create_migration(self, repos, lock_repositories=github.GithubObject.NotSet, exclude_attachments=github.GithubObject.NotSet): """ :calls: `POST /user/migrations`_ :param repos: list or tuple of str :param lock_repositories: bool :param exclude_attachments: bool :rtype:...
:calls: `GET /installation/repositories <https://developer.github.com/v3/integrations/installations/#list-repositories>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
def get_repos(self): """ :calls: `GET /installation/repositories <https://developer.github.com/v3/integrations/installations/#list-repositories>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` """ url_parameters = dict() ret...
:calls: `PATCH /repos/:owner/:repo/pulls/comments/:number <http://developer.github.com/v3/pulls/comments>`_ :param body: string :rtype: None
def edit(self, body): """ :calls: `PATCH /repos/:owner/:repo/pulls/comments/:number <http://developer.github.com/v3/pulls/comments>`_ :param body: string :rtype: None """ assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, ...
:calls: `PATCH /authorizations/:id <http://developer.github.com/v3/oauth>`_ :param scopes: list of string :param add_scopes: list of string :param remove_scopes: list of string :param note: string :param note_url: string :rtype: None
def edit(self, scopes=github.GithubObject.NotSet, add_scopes=github.GithubObject.NotSet, remove_scopes=github.GithubObject.NotSet, note=github.GithubObject.NotSet, note_url=github.GithubObject.NotSet): """ :calls: `PATCH /authorizations/:id <http://developer.github.com/v3/oauth>`_ :param scopes:...
:calls: `GET /projects/columns/:column_id/cards <https://developer.github.com/v3/projects/cards/#list-project-cards>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.ProjectCard.ProjectCard` :param archived_state: string
def get_cards(self, archived_state=github.GithubObject.NotSet): """ :calls: `GET /projects/columns/:column_id/cards <https://developer.github.com/v3/projects/cards/#list-project-cards>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.ProjectCard.ProjectCard` :param...
:calls: `POST /projects/columns/:column_id/cards <https://developer.github.com/v3/projects/cards/#create-a-project-card>`_ :param note: string :param content_id: integer :param content_type: string
def create_card(self, note=github.GithubObject.NotSet, content_id=github.GithubObject.NotSet, content_type=github.GithubObject.NotSet): """ :calls: `POST /projects/columns/:column_id/cards <https://developer.github.com/v3/projects/cards/#create-a-project-card>`_ ...
:calls: `POST /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_ :param body: string :param line: integer :param path: string :param position: integer :rtype: :class:`github.CommitComment.CommitComment`
def create_comment(self, body, line=github.GithubObject.NotSet, path=github.GithubObject.NotSet, position=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/commits/:sha/comments <http://developer.github.com/v3/repos/comments>`_ :param body: string :param line: integer ...
:calls: `POST /repos/:owner/:repo/statuses/:sha <http://developer.github.com/v3/repos/statuses>`_ :param state: string :param target_url: string :param description: string :param context: string :rtype: :class:`github.CommitStatus.CommitStatus`
def create_status(self, state, target_url=github.GithubObject.NotSet, description=github.GithubObject.NotSet, context=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/statuses/:sha <http://developer.github.com/v3/repos/statuses>`_ :param state: string :param target_url:...
:calls: `GET /repos/:owner/:repo/statuses/:ref <http://developer.github.com/v3/repos/statuses>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus`
def get_statuses(self): """ :calls: `GET /repos/:owner/:repo/statuses/:ref <http://developer.github.com/v3/repos/statuses>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.CommitStatus.CommitStatus` """ return github.PaginatedList.PaginatedList( ...
:calls: `GET /repos/:owner/:repo/commits/:ref/status/ <http://developer.github.com/v3/repos/statuses>`_ :rtype: :class:`github.CommitCombinedStatus.CommitCombinedStatus`
def get_combined_status(self): """ :calls: `GET /repos/:owner/:repo/commits/:ref/status/ <http://developer.github.com/v3/repos/statuses>`_ :rtype: :class:`github.CommitCombinedStatus.CommitCombinedStatus` """ headers, data = self._requester.requestJsonAndCheck( "GET",...
:calls: `DELETE /reactions/:id <https://developer.github.com/v3/reactions/#delete-a-reaction>`_ :rtype: None
def delete(self): """ :calls: `DELETE /reactions/:id <https://developer.github.com/v3/reactions/#delete-a-reaction>`_ :rtype: None """ self._requester.requestJsonAndCheck( "DELETE", self._parentUrl("") + "/reactions/" + str(self.id), headers={'...
:calls: `GET /repos/:owner/:repo/branches/:branch/protection <https://developer.github.com/v3/repos/branches>`_
def get_protection(self): """ :calls: `GET /repos/:owner/:repo/branches/:branch/protection <https://developer.github.com/v3/repos/branches>`_ """ headers, data = self._requester.requestJsonAndCheck( "GET", self.protection_url, headers={'Accept': Consts...
:calls: `PUT /repos/:owner/:repo/branches/:branch/protection <https://developer.github.com/v3/repos/branches>`_ :strict: bool :contexts: list of strings :enforce_admins: bool :dismissal_users: list of strings :dismissal_teams: list of strings :dismiss_stale_reviews: bool ...
def edit_protection(self, strict=github.GithubObject.NotSet, contexts=github.GithubObject.NotSet, enforce_admins=github.GithubObject.NotSet, dismissal_users=github.GithubObject.NotSet, dismissal_teams=github.GithubObject.NotSet, dismiss_stale_reviews=github.GithubObject.NotSet, require_code_owner_reviews=github.GithubO...
:calls: `GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.RequiredStatusChecks.RequiredStatusChecks`
def get_required_status_checks(self): """ :calls: `GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.RequiredStatusChecks.RequiredStatusChecks` """ headers, data = self._requester.r...
:calls: `PATCH /repos/:owner/:repo/branches/:branch/protection/required_status_checks <https://developer.github.com/v3/repos/branches>`_ :strict: bool :contexts: list of strings
def edit_required_status_checks(self, strict=github.GithubObject.NotSet, contexts=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/branches/:branch/protection/required_status_checks <https://developer.github.com/v3/repos/branches>`_ :strict: bool :contexts: list of str...
:calls: `GET /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.RequiredPullRequestReviews.RequiredPullRequestReviews`
def get_required_pull_request_reviews(self): """ :calls: `GET /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.RequiredPullRequestReviews.RequiredPullRequestReviews` """ headers...
:calls: `PATCH /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews <https://developer.github.com/v3/repos/branches>`_ :dismissal_users: list of strings :dismissal_teams: list of strings :dismiss_stale_reviews: bool :require_code_owner_reviews: bool :requ...
def edit_required_pull_request_reviews(self, dismissal_users=github.GithubObject.NotSet, dismissal_teams=github.GithubObject.NotSet, dismiss_stale_reviews=github.GithubObject.NotSet, require_code_owner_reviews=github.GithubObject.NotSet, required_approving_review_count=github.GithubObject.NotSet): """ :...
:calls: `GET /repos/:owner/:repo/branches/:branch/protection/enforce_admins <https://developer.github.com/v3/repos/branches>`_ :rtype: bool
def get_admin_enforcement(self): """ :calls: `GET /repos/:owner/:repo/branches/:branch/protection/enforce_admins <https://developer.github.com/v3/repos/branches>`_ :rtype: bool """ headers, data = self._requester.requestJsonAndCheck( "GET", self.protection...
:calls: `GET /repos/:owner/:repo/branches/:branch/protection/restrictions/users <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
def get_user_push_restrictions(self): """ :calls: `GET /repos/:owner/:repo/branches/:branch/protection/restrictions/users <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ return githu...
:calls: `GET /repos/:owner/:repo/branches/:branch/protection/restrictions/teams <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team`
def get_team_push_restrictions(self): """ :calls: `GET /repos/:owner/:repo/branches/:branch/protection/restrictions/teams <https://developer.github.com/v3/repos/branches>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team` """ return github.Paginate...
:calls: `POST /repos/:owner/:repo/branches/:branch/protection/restrictions <https://developer.github.com/v3/repos/branches>`_ :users: list of strings
def edit_user_push_restrictions(self, *users): """ :calls: `POST /repos/:owner/:repo/branches/:branch/protection/restrictions <https://developer.github.com/v3/repos/branches>`_ :users: list of strings """ assert all(isinstance(element, (str, unicode)) or isinstance(element, (str,...
:calls: `POST /repos/:owner/:repo/branches/:branch/protection/restrictions <https://developer.github.com/v3/repos/branches>`_ :teams: list of strings
def edit_team_push_restrictions(self, *teams): """ :calls: `POST /repos/:owner/:repo/branches/:branch/protection/restrictions <https://developer.github.com/v3/repos/branches>`_ :teams: list of strings """ assert all(isinstance(element, (str, unicode)) or isinstance(element, (str,...
:calls: `GET /repos/:owner/:repo/branches/:branch/protection/required_signatures <https://developer.github.com/v3/repos/branches>`
def get_required_signatures(self): """ :calls: `GET /repos/:owner/:repo/branches/:branch/protection/required_signatures <https://developer.github.com/v3/repos/branches>` """ headers, data = self._requester.requestJsonAndCheck( "GET", self.protection_url + "/requir...
:calls: `PATCH /repos/:owner/:repo/hooks/:id <http://developer.github.com/v3/repos/hooks>`_ :param name: string :param config: dict :param events: list of string :param add_events: list of string :param remove_events: list of string :param active: bool :rtype: Non...
def edit(self, name, config, events=github.GithubObject.NotSet, add_events=github.GithubObject.NotSet, remove_events=github.GithubObject.NotSet, active=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/hooks/:id <http://developer.github.com/v3/repos/hooks>`_ :param name: string...
:calls: `GET /users/:user/followers <http://developer.github.com/v3/users/followers>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
def get_followers(self): """ :calls: `GET /users/:user/followers <http://developer.github.com/v3/users/followers>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ return github.PaginatedList.PaginatedList( NamedUser, ...
:calls: `GET /users/:user/following <http://developer.github.com/v3/users/followers>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
def get_following(self): """ :calls: `GET /users/:user/following <http://developer.github.com/v3/users/followers>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ return github.PaginatedList.PaginatedList( NamedUser, ...
:calls: `GET /users/:user/keys <http://developer.github.com/v3/users/keys>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.UserKey.UserKey`
def get_keys(self): """ :calls: `GET /users/:user/keys <http://developer.github.com/v3/users/keys>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.UserKey.UserKey` """ return github.PaginatedList.PaginatedList( github.UserKey.UserKey, ...
:calls: `GET /users/:user/events/public <http://developer.github.com/v3/activity/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
def get_public_events(self): """ :calls: `GET /users/:user/events/public <http://developer.github.com/v3/activity/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event` """ return github.PaginatedList.PaginatedList( github.Event.E...
:calls: `GET /users/:user/received_events/public <http://developer.github.com/v3/activity/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
def get_public_received_events(self): """ :calls: `GET /users/:user/received_events/public <http://developer.github.com/v3/activity/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event` """ return github.PaginatedList.PaginatedList( ...
:calls: `GET /users/:user/received_events <http://developer.github.com/v3/activity/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event`
def get_received_events(self): """ :calls: `GET /users/:user/received_events <http://developer.github.com/v3/activity/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event` """ return github.PaginatedList.PaginatedList( github.Eve...
:calls: `GET /users/:user/repos <http://developer.github.com/v3/repos>`_ :param type: string :param sort: string :param direction: string :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
def get_repos(self, type=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet): """ :calls: `GET /users/:user/repos <http://developer.github.com/v3/repos>`_ :param type: string :param sort: string :param direction: st...
:calls: `GET /users/:user/subscriptions <http://developer.github.com/v3/activity/watching>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
def get_subscriptions(self): """ :calls: `GET /users/:user/subscriptions <http://developer.github.com/v3/activity/watching>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` """ return github.PaginatedList.PaginatedList( gi...
:calls: `GET /users/:user/watched <http://developer.github.com/v3/activity/starring>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
def get_watched(self): """ :calls: `GET /users/:user/watched <http://developer.github.com/v3/activity/starring>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` """ return github.PaginatedList.PaginatedList( github.Reposit...
:calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/releases/#edit-a-release>`_ :rtype: :class:`github.GitRelease.GitRelease`
def update_release(self, name, message, draft=False, prerelease=False, tag_name=github.GithubObject.NotSet, target_commitish=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/releases/:release_id <https://developer.github.com/v3/repos/relea...
:calls: `POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?name=foo.zip <https://developer.github.com/v3/repos/releases/#upload-a-release-asset>`_ :rtype: :class:`github.GitReleaseAsset.GitReleaseAsset`
def upload_asset(self, path, label="", content_type=""): """ :calls: `POST https://<upload_url>/repos/:owner/:repo/releases/:release_id/assets?name=foo.zip <https://developer.github.com/v3/repos/releases/#upload-a-release-asset>`_ :rtype: :class:`github.GitReleaseAsset.GitReleaseAsset` "...
:calls: `PATCH /repos/:owner/:repo/git/refs/:ref <http://developer.github.com/v3/git/refs>`_ :param sha: string :param force: bool :rtype: None
def edit(self, sha, force=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/git/refs/:ref <http://developer.github.com/v3/git/refs>`_ :param sha: string :param force: bool :rtype: None """ assert isinstance(sha, (str, unicode)), sha asser...
:calls: `GET /repos/:owner/:repo/releases/:release_id/assets <https://developer.github.com/v3/repos/releases/#list-assets-for-a-release>`_ :rtype: :class:`github.PaginatedList.PaginatedList`
def get_assets(self): """ :calls: `GET /repos/:owner/:repo/releases/:release_id/assets <https://developer.github.com/v3/repos/releases/#list-assets-for-a-release>`_ :rtype: :class:`github.PaginatedList.PaginatedList` """ return github.PaginatedList.PaginatedList( gith...
This function sets up a very simple logging configuration (log everything on standard output) that is useful for troubleshooting.
def enable_console_debug_logging(): # pragma no cover (Function useful only outside test environment) """ This function sets up a very simple logging configuration (log everything on standard output) that is useful for troubleshooting. """ logger = logging.getLogger("github") logger.setLevel(loggi...
First value is requests remaining, second value is request limit. :type: (int, int)
def rate_limiting(self): """ First value is requests remaining, second value is request limit. :type: (int, int) """ remaining, limit = self.__requester.rate_limiting if limit < 0: self.get_rate_limit() return self.__requester.rate_limiting
Unix timestamp indicating when rate limiting will reset. :type: int
def rate_limiting_resettime(self): """ Unix timestamp indicating when rate limiting will reset. :type: int """ if self.__requester.rate_limiting_resettime == 0: self.get_rate_limit() return self.__requester.rate_limiting_resettime
Rate limit status for different resources (core/search/graphql). :calls: `GET /rate_limit <http://developer.github.com/v3/rate_limit>`_ :rtype: :class:`github.RateLimit.RateLimit`
def get_rate_limit(self): """ Rate limit status for different resources (core/search/graphql). :calls: `GET /rate_limit <http://developer.github.com/v3/rate_limit>`_ :rtype: :class:`github.RateLimit.RateLimit` """ headers, data = self.__requester.requestJsonAndCheck( ...
:calls: `GET /license/:license <https://developer.github.com/v3/licenses/#get-an-individual-license>`_ :param key: string :rtype: :class:`github.License.License`
def get_license(self, key=github.GithubObject.NotSet): """ :calls: `GET /license/:license <https://developer.github.com/v3/licenses/#get-an-individual-license>`_ :param key: string :rtype: :class:`github.License.License` """ assert isinstance(key, (str, unicode)), key ...
:calls: `GET /licenses <https://developer.github.com/v3/licenses/#list-all-licenses>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.License.License`
def get_licenses(self): """ :calls: `GET /licenses <https://developer.github.com/v3/licenses/#list-all-licenses>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.License.License` """ url_parameters = dict() return github.PaginatedList.PaginatedLis...
:calls: `GET /users/:user <http://developer.github.com/v3/users>`_ or `GET /user <http://developer.github.com/v3/users>`_ :param login: string :rtype: :class:`github.NamedUser.NamedUser`
def get_user(self, login=github.GithubObject.NotSet): """ :calls: `GET /users/:user <http://developer.github.com/v3/users>`_ or `GET /user <http://developer.github.com/v3/users>`_ :param login: string :rtype: :class:`github.NamedUser.NamedUser` """ assert login is github....
:calls: `GET /orgs/:org <http://developer.github.com/v3/orgs>`_ :param login: string :rtype: :class:`github.Organization.Organization`
def get_organization(self, login): """ :calls: `GET /orgs/:org <http://developer.github.com/v3/orgs>`_ :param login: string :rtype: :class:`github.Organization.Organization` """ assert isinstance(login, (str, unicode)), login headers, data = self.__requester.reque...
:calls: `GET /organizations <http://developer.github.com/v3/orgs#list-all-organizations>`_ :param since: integer :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization`
def get_organizations(self, since=github.GithubObject.NotSet): """ :calls: `GET /organizations <http://developer.github.com/v3/orgs#list-all-organizations>`_ :param since: integer :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization` """...
:calls: `GET /repos/:owner/:repo <http://developer.github.com/v3/repos>`_ or `GET /repositories/:id <http://developer.github.com/v3/repos>`_ :rtype: :class:`github.Repository.Repository`
def get_repo(self, full_name_or_id, lazy=False): """ :calls: `GET /repos/:owner/:repo <http://developer.github.com/v3/repos>`_ or `GET /repositories/:id <http://developer.github.com/v3/repos>`_ :rtype: :class:`github.Repository.Repository` """ assert isinstance(full_name_or_id, (...
:calls: `GET /repositories <http://developer.github.com/v3/repos/#list-all-public-repositories>`_ :param since: integer :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository`
def get_repos(self, since=github.GithubObject.NotSet): """ :calls: `GET /repositories <http://developer.github.com/v3/repos/#list-all-public-repositories>`_ :param since: integer :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` """ ...
:calls: `GET /projects/:project_id <https://developer.github.com/v3/projects/#get-a-project>`_ :rtype: :class:`github.Project.Project` :param id: integer
def get_project(self, id): """ :calls: `GET /projects/:project_id <https://developer.github.com/v3/projects/#get-a-project>`_ :rtype: :class:`github.Project.Project` :param id: integer """ headers, data = self.__requester.requestJsonAndCheck( "GET", ...
:calls: `GET /gists/:id <http://developer.github.com/v3/gists>`_ :param id: string :rtype: :class:`github.Gist.Gist`
def get_gist(self, id): """ :calls: `GET /gists/:id <http://developer.github.com/v3/gists>`_ :param id: string :rtype: :class:`github.Gist.Gist` """ assert isinstance(id, (str, unicode)), id headers, data = self.__requester.requestJsonAndCheck( "GET", ...
:calls: `GET /search/users <http://developer.github.com/v3/search>`_ :param query: string :param sort: string ('followers', 'repositories', 'joined') :param order: string ('asc', 'desc') :param qualifiers: keyword dict query qualifiers :rtype: :class:`github.PaginatedList.Paginat...
def search_users(self, query, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, **qualifiers): """ :calls: `GET /search/users <http://developer.github.com/v3/search>`_ :param query: string :param sort: string ('followers', 'repositories', 'joined') :param order: ...
:calls: `GET /search/code <http://developer.github.com/v3/search>`_ :param query: string :param sort: string ('indexed') :param order: string ('asc', 'desc') :param highlight: boolean (True, False) :param qualifiers: keyword dict query qualifiers :rtype: :class:`github.Pa...
def search_code(self, query, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, highlight=False, **qualifiers): """ :calls: `GET /search/code <http://developer.github.com/v3/search>`_ :param query: string :param sort: string ('indexed') :param order: string ('asc'...
:calls: `GET /search/commits <http://developer.github.com/v3/search>`_ :param query: string :param sort: string ('author-date', 'committer-date') :param order: string ('asc', 'desc') :param qualifiers: keyword dict query qualifiers :rtype: :class:`github.PaginatedList.PaginatedLi...
def search_commits(self, query, sort=github.GithubObject.NotSet, order=github.GithubObject.NotSet, **qualifiers): """ :calls: `GET /search/commits <http://developer.github.com/v3/search>`_ :param query: string :param sort: string ('author-date', 'committer-date') :param order: st...
:calls: `GET /search/topics <http://developer.github.com/v3/search>`_ :param query: string :param qualifiers: keyword dict query qualifiers :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Topic.Topic`
def search_topics(self, query, **qualifiers): """ :calls: `GET /search/topics <http://developer.github.com/v3/search>`_ :param query: string :param qualifiers: keyword dict query qualifiers :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Topic.Topic` ...
:calls: `POST /markdown <http://developer.github.com/v3/markdown>`_ :param text: string :param context: :class:`github.Repository.Repository` :rtype: string
def render_markdown(self, text, context=github.GithubObject.NotSet): """ :calls: `POST /markdown <http://developer.github.com/v3/markdown>`_ :param text: string :param context: :class:`github.Repository.Repository` :rtype: string """ assert isinstance(text, (str, ...
:calls: `GET /hooks/:name <http://developer.github.com/v3/repos/hooks/>`_ :param name: string :rtype: :class:`github.HookDescription.HookDescription`
def get_hook(self, name): """ :calls: `GET /hooks/:name <http://developer.github.com/v3/repos/hooks/>`_ :param name: string :rtype: :class:`github.HookDescription.HookDescription` """ assert isinstance(name, (str, unicode)), name headers, attributes = self.__reque...
:calls: `GET /hooks <http://developer.github.com/v3/repos/hooks/>`_ :rtype: list of :class:`github.HookDescription.HookDescription`
def get_hooks(self): """ :calls: `GET /hooks <http://developer.github.com/v3/repos/hooks/>`_ :rtype: list of :class:`github.HookDescription.HookDescription` """ headers, data = self.__requester.requestJsonAndCheck( "GET", "/hooks" ) return ...
:calls: `GET /gitignore/templates/:name <http://developer.github.com/v3/gitignore>`_ :rtype: :class:`github.GitignoreTemplate.GitignoreTemplate`
def get_gitignore_template(self, name): """ :calls: `GET /gitignore/templates/:name <http://developer.github.com/v3/gitignore>`_ :rtype: :class:`github.GitignoreTemplate.GitignoreTemplate` """ assert isinstance(name, (str, unicode)), name headers, attributes = self.__requ...
Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data`, and optionaly headers previously obtained by :attr:`github.GithubObject.GithubObject.raw_headers`. :param klass: the class of the object to create :param raw_data: dict :param heade...
def create_from_raw_data(self, klass, raw_data, headers={}): """ Creates an object from raw_data previously obtained by :attr:`github.GithubObject.GithubObject.raw_data`, and optionaly headers previously obtained by :attr:`github.GithubObject.GithubObject.raw_headers`. :param klass: the...
Dumps (pickles) a PyGithub object to a file-like object. Some effort is made to not pickle sensitive informations like the Github credentials used in the :class:`Github` instance. But NO EFFORT is made to remove sensitive information from the object's attributes. :param obj: the object to pickl...
def dump(self, obj, file, protocol=0): """ Dumps (pickles) a PyGithub object to a file-like object. Some effort is made to not pickle sensitive informations like the Github credentials used in the :class:`Github` instance. But NO EFFORT is made to remove sensitive information from the ob...
Creates a signed JWT, valid for 60 seconds by default. The expiration can be extended beyond this, to a maximum of 600 seconds. :param expiration: int :return:
def create_jwt(self, expiration=60): """ Creates a signed JWT, valid for 60 seconds by default. The expiration can be extended beyond this, to a maximum of 600 seconds. :param expiration: int :return: """ now = int(time.time()) payload = { "ia...
Get an access token for the given installation id. POSTs https://api.github.com/app/installations/<installation_id>/access_tokens :param user_id: int :param installation_id: int :return: :class:`github.InstallationAuthorization.InstallationAuthorization`
def get_access_token(self, installation_id, user_id=None): """ Get an access token for the given installation id. POSTs https://api.github.com/app/installations/<installation_id>/access_tokens :param user_id: int :param installation_id: int :return: :class:`github.Install...
:calls: `PATCH /repos/:owner/:repo/labels/:name <http://developer.github.com/v3/issues/labels>`_ :param name: string :param color: string :param description: string :rtype: None
def edit(self, name, color, description=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/labels/:name <http://developer.github.com/v3/issues/labels>`_ :param name: string :param color: string :param description: string :rtype: None """ a...
:calls: `GET /repos/:owner/:repo/pulls/:number <https://developer.github.com/v3/pulls/#get-a-single-pull-request>`_ :rtype: :class:`github.PullRequest.PullRequest` or :class:`github.Issue.Issue`
def get_content(self, content_type=github.GithubObject.NotSet): """ :calls: `GET /repos/:owner/:repo/pulls/:number <https://developer.github.com/v3/pulls/#get-a-single-pull-request>`_ :rtype: :class:`github.PullRequest.PullRequest` or :class:`github.Issue.Issue` """ if self.conte...
:calls: `POST /gists/:id/forks <http://developer.github.com/v3/gists>`_ :rtype: :class:`github.Gist.Gist`
def create_fork(self): """ :calls: `POST /gists/:id/forks <http://developer.github.com/v3/gists>`_ :rtype: :class:`github.Gist.Gist` """ headers, data = self._requester.requestJsonAndCheck( "POST", self.url + "/forks" ) return Gist(self._re...
:calls: `PATCH /gists/:id <http://developer.github.com/v3/gists>`_ :param description: string :param files: dict of string to :class:`github.InputFileContent.InputFileContent` :rtype: None
def edit(self, description=github.GithubObject.NotSet, files=github.GithubObject.NotSet): """ :calls: `PATCH /gists/:id <http://developer.github.com/v3/gists>`_ :param description: string :param files: dict of string to :class:`github.InputFileContent.InputFileContent` :rtype: No...
:calls: `GET /gists/:gist_id/comments <http://developer.github.com/v3/gists/comments>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.GistComment.GistComment`
def get_comments(self): """ :calls: `GET /gists/:gist_id/comments <http://developer.github.com/v3/gists/comments>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.GistComment.GistComment` """ return github.PaginatedList.PaginatedList( github.Gis...
:calls: `GET /gists/:gist_id/comments/:id <http://developer.github.com/v3/gists/comments>`_ :param id: integer :rtype: :class:`github.GistComment.GistComment`
def get_comment(self, id): """ :calls: `GET /gists/:gist_id/comments/:id <http://developer.github.com/v3/gists/comments>`_ :param id: integer :rtype: :class:`github.GistComment.GistComment` """ assert isinstance(id, (int, long)), id headers, data = self._requester...
:calls: `GET /gists/:id/star <http://developer.github.com/v3/gists>`_ :rtype: bool
def is_starred(self): """ :calls: `GET /gists/:id/star <http://developer.github.com/v3/gists>`_ :rtype: bool """ status, headers, data = self._requester.requestJson( "GET", self.url + "/star" ) return status == 204
For most ordinary keys, the "keysym" is the same as the corresponding ASCII value. Other common keys are shown in the KEY_ constants.
def send_KeyEvent(self, key, down): """For most ordinary keys, the "keysym" is the same as the corresponding ASCII value. Other common keys are shown in the KEY_ constants. """ self.sendMessage(struct.pack('!BBxxI', 4, down, key))
Indicates either pointer movement or a pointer button press or release. The pointer is now at (x-position, y-position), and the current state of buttons 1 to 8 are represented by bits 0 to 7 of button-mask respectively, 0 meaning up, 1 meaning down (pressed).
def send_PointerEvent(self, x, y, buttonmask=0): """Indicates either pointer movement or a pointer button press or release. The pointer is now at (x-position, y-position), and the current state of buttons 1 to 8 are represented by bits 0 to 7 of button-mask respectively, 0 meani...
The client has new text in its clipboard.
def send_ClientCutText(self, message): """The client has new text in its clipboard. """ self.sendMessage(struct.pack("!BxxxI", 6, len(message))) self.sendMessage(message)
Atomically set the environment state tracking variables.
def set_env_info(self, env_state=None, env_id=None, episode_id=None, bump_past=None, fps=None): """Atomically set the environment state tracking variables. """ with self.cv: if env_id is None: env_id = self._env_id if env_state is None: env...
Construct a container object from the output of GET /containers/json.
def from_ps(cls, client, dictionary, **kwargs): """ Construct a container object from the output of GET /containers/json. """ name = get_container_name(dictionary) if name is None: return None new_dictionary = { 'Id': dictionary['Id'], ...
A log stream can only be attached if the container uses a json-file log driver.
def attach_log_stream(self): """A log stream can only be attached if the container uses a json-file log driver. """ if self.has_api_logs: self.log_stream = self.attach(stdout=True, stderr=True, stream=True)
Return a value from the container or None if the value is not set. :param key: a string using dotted notation for nested dictionary lookups
def get(self, key): """Return a value from the container or None if the value is not set. :param key: a string using dotted notation for nested dictionary lookups """ self.inspect_if_not_inspected() def get_value(dictionary, key): return (diction...
Rename the container to a hopefully unique temporary container name by prepending the short id.
def rename_to_tmp_name(self): """Rename the container to a hopefully unique temporary container name by prepending the short id. """ self.client.rename( self.id, '%s_%s' % (self.short_id, self.name) )
Build a key combination, such as: ctrl-t
def build(cls, keys, down=None): """Build a key combination, such as: ctrl-t """ codes = [] for key in keys.split('-'): key = keycode(key) codes.append(key) events = [] if down is None or down: for code in codes: ...
id is a string describing the runtime, e.g 'flashgames Returns a configured DockerRuntime object
def runtime_spec(self, id): """ id is a string describing the runtime, e.g 'flashgames Returns a configured DockerRuntime object """ try: return self.runtimes[id] except KeyError: raise UnregisteredRuntime('No registered runtime with name: {}'.for...
Used in the tests
def _manual_recv(self, method, body, headers={}): """Used in the tests""" headers.setdefault('sent_at', time.time()) return self.recv(self._make_context(), {'method': method, 'body': body, 'headers': headers})
Install a signal handler for HUP, INT, and TERM to call exit, allowing clean shutdown. When running a universe environment, it's important to shut down the container when the agent dies so you should either call this or otherwise arrange to exit on signals.
def exit_on_signal(): """ Install a signal handler for HUP, INT, and TERM to call exit, allowing clean shutdown. When running a universe environment, it's important to shut down the container when the agent dies so you should either call this or otherwise arrange to exit on signals. """ def shut...
We currently close our fbs files by killing them, so sometimes they end up with bad data at the end. Close our reader if we expect `size` bytes and get fewer. This is a hack and should be removed when we cleanly close our connections in fbs_writer. https://github.com/openai/uni...
def read_safe(self, size=None): """ We currently close our fbs files by killing them, so sometimes they end up with bad data at the end. Close our reader if we expect `size` bytes and get fewer. This is a hack and should be removed when we cleanly close our connections i...
Call from main thread. Returns the list of newly-available (handle, env) pairs.
def pop(self, n=None): """Call from main thread. Returns the list of newly-available (handle, env) pairs.""" self.error_buffer.check() envs = [] if n is None: while True: try: envs += self.ready.get(block=False) except que...