INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
Resign Threshold: - 0. 88 - 0. 0662 D4 ( 100 ) == > D16 ( 14 ) == > Q16 ( 3 ) == > Q4 ( 1 ) == > Q: - 0. 07149 move: action Q U P P - Dir N soft - N p - delta p - rel D4: - 0. 028 - 0. 048 0. 020 0. 048 0. 064 100 0. 1096 0. 06127 1. 27 D16: - 0. 024 - 0. 043 0. 019 0. 044 0. 059 96 0. 1053 0. 06135 1. 40
def parse_comment_node(comment): # Example of a comment node. The resign threshold line appears only # for the first move in the game; it gets preprocessed by extract_game_data """ Resign Threshold: -0.88 -0.0662 D4 (100) ==> D16 (14) ==> Q16 (3) ==> Q4 (1) ==> Q: -0.07149 move: action Q U P...
This method performs the positive/ negative sampling and return the sampled proposals. Note: this function keeps a state.
def subsample(self, proposals, targets): """ This method performs the positive/negative sampling, and return the sampled proposals. Note: this function keeps a state. Arguments: proposals (list[BoxList]) targets (list[BoxList]) """ labels...
Execute the encoder.
def forward(self, inputs, lengths): """ Execute the encoder. :param inputs: tensor with indices from the vocabulary :param lengths: vector with sequence lengths (excluding padding) returns: tensor with encoded sequences """ x = self.embedder(inputs) # b...
Run the given subprocess command in a coroutine.
async def checked_run(*cmd): """Run the given subprocess command in a coroutine. Args: *cmd: the command to run and its arguments. Returns: The output that the command wrote to stdout. Raises: RuntimeError: if the command returns a non-zero result. """ # Start the subprocess. logging.info(...
Waits for all of the awaitable objects ( e. g. coroutines ) in aws to finish.
def wait(aws): """Waits for all of the awaitable objects (e.g. coroutines) in aws to finish. All the awaitable objects are waited for, even if one of them raises an exception. When one or more awaitable raises an exception, the exception from the awaitable with the lowest index in the aws list will be reraised...
Return a list of ( name path ) tuples of direct subdirectories of
def get_subdirs(parent_path): """Return a list of (name, path) tuples of direct subdirectories of parent_path, where each tuple corresponds to one subdirectory. Files in the parent_path are excluded from the output. """ entries = os.listdir(parent_path) subdirs = [(entry, os.path.join(parent_path, en...
Arguments: x ( list [ Tensor ] ): feature maps for each level boxes ( list [ BoxList ] ): boxes to be used to perform the pooling operation. Returns: result ( Tensor )
def forward(self, x, boxes): """ Arguments: x (list[Tensor]): feature maps for each level boxes (list[BoxList]): boxes to be used to perform the pooling operation. Returns: result (Tensor) """ num_levels = len(self.poolers) rois = self....
Changes tempo and gain of the recording with sox and loads it.
def augment_audio_with_sox(path, sample_rate, tempo, gain): """ Changes tempo and gain of the recording with sox and loads it. """ with NamedTemporaryFile(suffix=".wav") as augmented_file: augmented_filename = augmented_file.name sox_augment_params = ["tempo", "{:.3f}".format(tempo), "ga...
Picks tempo and gain uniformly applies it to the utterance by using sox utility. Returns the augmented utterance.
def load_randomly_augmented_audio(path, sample_rate=16000, tempo_range=(0.85, 1.15), gain_range=(-6, 8)): """ Picks tempo and gain uniformly, applies it to the utterance by using sox utility. Returns the augmented utterance. """ low_tempo, high_tempo = tempo_range ...
Defines how to train evaluate and predict from the transformer model.
def model_fn(features, labels, mode, params): """Defines how to train, evaluate and predict from the transformer model.""" with tf.variable_scope("model"): inputs, targets = features, labels # Create model and get output logits. model = transformer.Transformer(params, mode == tf.estimator.ModeKeys.TRAI...
Calculate learning rate with linear warmup and rsqrt decay.
def get_learning_rate(learning_rate, hidden_size, learning_rate_warmup_steps): """Calculate learning rate with linear warmup and rsqrt decay.""" with tf.name_scope("learning_rate"): warmup_steps = tf.to_float(learning_rate_warmup_steps) step = tf.to_float(tf.train.get_or_create_global_step()) learning_...
Generate training operation that updates variables based on loss.
def get_train_op(loss, params): """Generate training operation that updates variables based on loss.""" with tf.variable_scope("get_train_op"): mlperf_log.transformer_print( key=mlperf_log.OPT_LR_WARMUP_STEPS, value=params.learning_rate_warmup_steps) learning_rate = get_learning_rate( ...
Translate file and report the cased and uncased bleu scores.
def translate_and_compute_bleu(estimator, subtokenizer, bleu_source, bleu_ref): """Translate file and report the cased and uncased bleu scores.""" # Create temporary file to store translation. tmp = tempfile.NamedTemporaryFile(delete=False) tmp_filename = tmp.name translate.translate_file( estimator, s...
Calculate and record the BLEU score.
def evaluate_and_log_bleu(estimator, bleu_writer, bleu_source, bleu_ref): """Calculate and record the BLEU score.""" subtokenizer = tokenizer.Subtokenizer( os.path.join(FLAGS.data_dir, FLAGS.vocab_file)) uncased_score, cased_score = translate_and_compute_bleu( estimator, subtokenizer, bleu_source, bl...
Train and evaluate model and optionally compute model s BLEU score.
def train_schedule( estimator, train_eval_iterations, single_iteration_train_steps=None, single_iteration_train_epochs=None, bleu_source=None, bleu_ref=None, bleu_threshold=None): """Train and evaluate model, and optionally compute model's BLEU score. **Step vs. Epoch vs. Iteration** Steps and epoch...
: calls: PUT/ teams/: id/ memberships/: user <http:// developer. github. com/ v3/ orgs/ teams > _: param member:: class: github. Nameduser. NamedUser: param role: string: rtype: None
def add_membership(self, member, role=github.GithubObject.NotSet): """ :calls: `PUT /teams/:id/memberships/:user <http://developer.github.com/v3/orgs/teams>`_ :param member: :class:`github.Nameduser.NamedUser` :param role: string :rtype: None """ assert isinstance...
: calls: PUT/ teams/: id/ repos/: org/: repo <http:// developer. github. com/ v3/ orgs/ teams > _: param repo:: class: github. Repository. Repository: rtype: None
def add_to_repos(self, repo): """ :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_ :param repo: :class:`github.Repository.Repository` :rtype: None """ assert isinstance(repo, github.Repository.Repository), repo headers, data =...
: calls: PUT/ teams/: id/ repos/: org/: repo <http:// developer. github. com/ v3/ orgs/ teams > _: param repo:: class: github. Repository. Repository: param permission: string: rtype: None
def set_repo_permission(self, repo, permission): """ :calls: `PUT /teams/:id/repos/:org/:repo <http://developer.github.com/v3/orgs/teams>`_ :param repo: :class:`github.Repository.Repository` :param permission: string :rtype: None """ assert isinstance(repo, github...
: calls: PATCH/ teams/: id <http:// developer. github. com/ v3/ orgs/ teams > _: param name: string: param description: string: param permission: string: param privacy: string: rtype: None
def edit(self, name, description=github.GithubObject.NotSet, permission=github.GithubObject.NotSet, privacy=github.GithubObject.NotSet): """ :calls: `PATCH /teams/:id <http://developer.github.com/v3/orgs/teams>`_ :param name: string :param description: string :param permission: s...
: calls: GET/ teams/: id/ members <https:// developer. github. com/ v3/ teams/ members/ #list - team - members > _: param role: string: rtype:: class: github. PaginatedList. PaginatedList of: class: github. NamedUser. NamedUser
def get_members(self, role=github.GithubObject.NotSet): """ :calls: `GET /teams/:id/members <https://developer.github.com/v3/teams/members/#list-team-members>`_ :param role: string :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ ...
: calls: GET/ teams/: id/ repos <http:// developer. github. com/ v3/ orgs/ teams > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Repository. Repository
def get_repos(self): """ :calls: `GET /teams/:id/repos <http://developer.github.com/v3/orgs/teams>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository.Repository` """ return github.PaginatedList.PaginatedList( github.Repository.Repositor...
: calls: GET/ teams/: id/ members/: user <http:// developer. github. com/ v3/ orgs/ teams > _: param member:: class: github. NamedUser. NamedUser: rtype: bool
def has_in_members(self, member): """ :calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_ :param member: :class:`github.NamedUser.NamedUser` :rtype: bool """ assert isinstance(member, github.NamedUser.NamedUser), member status, head...
: calls: GET/ teams/: id/ repos/: owner/: repo <http:// developer. github. com/ v3/ orgs/ teams > _: param repo:: class: github. Repository. Repository: rtype: bool
def has_in_repos(self, repo): """ :calls: `GET /teams/:id/repos/:owner/:repo <http://developer.github.com/v3/orgs/teams>`_ :param repo: :class:`github.Repository.Repository` :rtype: bool """ assert isinstance(repo, github.Repository.Repository), repo status, heade...
Initialize a debug frame with requestHeader Frame count is updated and will be attached to respond header The structure of a frame: [ requestHeader statusCode responseHeader raw_data ] Some of them may be None
def NEW_DEBUG_FRAME(self, requestHeader): """ Initialize a debug frame with requestHeader Frame count is updated and will be attached to respond header The structure of a frame: [requestHeader, statusCode, responseHeader, raw_data] Some of them may be None """ if ...
Update current frame with response Current frame index will be attached to responseHeader
def DEBUG_ON_RESPONSE(self, statusCode, responseHeader, data): ''' Update current frame with response Current frame index will be attached to responseHeader ''' if self.DEBUG_FLAG: # pragma no branch (Flag always set in tests) self._frameBuffer[self._frameCount][1:4]...
: calls: GET/ repos/: owner/: repo/ issues/: number <http:// developer. github. com/ v3/ issues > _: rtype:: class: github. Issue. Issue
def as_issue(self): """ :calls: `GET /repos/:owner/:repo/issues/:number <http://developer.github.com/v3/issues>`_ :rtype: :class:`github.Issue.Issue` """ headers, data = self._requester.requestJsonAndCheck( "GET", self.issue_url ) return gi...
: calls: POST/ repos/: owner/: repo/ pulls/: number/ comments <http:// developer. github. com/ v3/ pulls/ comments > _: param body: string: param commit_id:: class: github. Commit. Commit: param path: string: param position: integer: rtype:: class: github. PullRequestComment. PullRequestComment
def create_comment(self, body, commit_id, path, position): """ :calls: `POST /repos/:owner/:repo/pulls/:number/comments <http://developer.github.com/v3/pulls/comments>`_ :param body: string :param commit_id: :class:`github.Commit.Commit` :param path: string :param positio...
: calls: POST/ repos/: owner/: repo/ pulls/: number/ comments <http:// developer. github. com/ v3/ pulls/ comments > _: param body: string: param commit_id:: class: github. Commit. Commit: param path: string: param position: integer: rtype:: class: github. PullRequestComment. PullRequestComment
def create_review_comment(self, body, commit_id, path, position): """ :calls: `POST /repos/:owner/:repo/pulls/:number/comments <http://developer.github.com/v3/pulls/comments>`_ :param body: string :param commit_id: :class:`github.Commit.Commit` :param path: string :param ...
: calls: POST/ repos/: owner/: repo/ issues/: number/ comments <http:// developer. github. com/ v3/ issues/ comments > _: param body: string: rtype:: class: github. IssueComment. IssueComment
def create_issue_comment(self, body): """ :calls: `POST /repos/:owner/:repo/issues/:number/comments <http://developer.github.com/v3/issues/comments>`_ :param body: string :rtype: :class:`github.IssueComment.IssueComment` """ assert isinstance(body, (str, unicode)), body ...
: calls: POST/ repos/: owner/: repo/ pulls/: number/ reviews <https:// developer. github. com/ v3/ pulls/ reviews/ > _: param commit: github. Commit. Commit: param body: string: param event: string: param comments: list: rtype:: class: github. PullRequestReview. PullRequestReview
def create_review(self, commit=github.GithubObject.NotSet, body=None, event=github.GithubObject.NotSet, comments=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/pulls/:number/reviews <https://developer.github.com/v3/pulls/reviews/>`_ :param commit: github.Commit.Commit ...
: calls: DELETE/ repos/: owner/: repo/ pulls/: number/ requested_reviewers <https:// developer. github. com/ v3/ pulls/ review_requests/ > _: param reviewers: list of strings: param team_reviewers: list of strings: rtype: None
def delete_review_request(self, reviewers=github.GithubObject.NotSet, team_reviewers=github.GithubObject.NotSet): """ :calls: `DELETE /repos/:owner/:repo/pulls/:number/requested_reviewers <https://developer.github.com/v3/pulls/review_requests/>`_ :param reviewers: list of strings :param ...
: calls: PATCH/ repos/: owner/: repo/ pulls/: number <http:// developer. github. com/ v3/ pulls > _: param title: string: param body: string: param state: string: param base: string: rtype: None
def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, state=github.GithubObject.NotSet, base=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/pulls/:number <http://developer.github.com/v3/pulls>`_ :param title: string :param body: string ...
: calls: GET/ repos/: owner/: repo/ pulls/ comments/: number <http:// developer. github. com/ v3/ pulls/ comments > _: param id: integer: rtype:: class: github. PullRequestComment. PullRequestComment
def get_review_comment(self, id): """ :calls: `GET /repos/:owner/:repo/pulls/comments/:number <http://developer.github.com/v3/pulls/comments>`_ :param id: integer :rtype: :class:`github.PullRequestComment.PullRequestComment` """ assert isinstance(id, (int, long)), id ...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ comments <http:// developer. github. com/ v3/ pulls/ comments > _: param since: datetime. datetime format YYYY - MM - DDTHH: MM: SSZ: rtype:: class: github. PaginatedList. PaginatedList of: class: github. PullRequestComment. PullRequestComment
def get_review_comments(self, since=github.GithubObject.NotSet): """ :calls: `GET /repos/:owner/:repo/pulls/:number/comments <http://developer.github.com/v3/pulls/comments>`_ :param since: datetime.datetime format YYYY-MM-DDTHH:MM:SSZ :rtype: :class:`github.PaginatedList.PaginatedList` o...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ review/: id/ comments <https:// developer. github. com/ v3/ pulls/ reviews/ > _: param id: integer: rtype:: class: github. PaginatedList. PaginatedList of: class: github. PullRequestComment. PullRequestComment
def get_single_review_comments(self, id): """ :calls: `GET /repos/:owner/:repo/pulls/:number/review/:id/comments <https://developer.github.com/v3/pulls/reviews/>`_ :param id: integer :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequestComment.PullRequestComme...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ commits <http:// developer. github. com/ v3/ pulls > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Commit. Commit
def get_commits(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number/commits <http://developer.github.com/v3/pulls>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Commit.Commit` """ return github.PaginatedList.PaginatedList( github.Commit...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ files <http:// developer. github. com/ v3/ pulls > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. File. File
def get_files(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number/files <http://developer.github.com/v3/pulls>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.File.File` """ return github.PaginatedList.PaginatedList( github.File.File, ...
: calls: GET/ repos/: owner/: repo/ issues/ comments/: id <http:// developer. github. com/ v3/ issues/ comments > _: param id: integer: rtype:: class: github. IssueComment. IssueComment
def get_issue_comment(self, id): """ :calls: `GET /repos/:owner/:repo/issues/comments/:id <http://developer.github.com/v3/issues/comments>`_ :param id: integer :rtype: :class:`github.IssueComment.IssueComment` """ assert isinstance(id, (int, long)), id headers, da...
: calls: GET/ repos/: owner/: repo/ issues/: number/ comments <http:// developer. github. com/ v3/ issues/ comments > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. IssueComment. IssueComment
def get_issue_comments(self): """ :calls: `GET /repos/:owner/:repo/issues/:number/comments <http://developer.github.com/v3/issues/comments>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.IssueComment.IssueComment` """ return github.PaginatedList.Paginated...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ reviews/: id <https:// developer. github. com/ v3/ pulls/ reviews > _: param id: integer: rtype:: class: github. PullRequestReview. PullRequestReview
def get_review(self, id): """ :calls: `GET /repos/:owner/:repo/pulls/:number/reviews/:id <https://developer.github.com/v3/pulls/reviews>`_ :param id: integer :rtype: :class:`github.PullRequestReview.PullRequestReview` """ assert isinstance(id, (int, long)), id hea...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ reviews <https:// developer. github. com/ v3/ pulls/ reviews/ > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. PullRequestReview. PullRequestReview
def get_reviews(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number/reviews <https://developer.github.com/v3/pulls/reviews/>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.PullRequestReview.PullRequestReview` """ return github.PaginatedList.Paginate...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ requested_reviewers <https:// developer. github. com/ v3/ pulls/ review_requests/ > _: rtype: tuple of: class: github. PaginatedList. PaginatedList of: class: github. NamedUser. NamedUser and of: class: github. PaginatedList. PaginatedList of: class: github. Team. Tea...
def get_review_requests(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number/requested_reviewers <https://developer.github.com/v3/pulls/review_requests/>`_ :rtype: tuple of :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` and of :class:`github.PaginatedList...
: calls: GET/ repos/: owner/: repo/ issues/: number/ labels <http:// developer. github. com/ v3/ issues/ labels > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Label. Label
def get_labels(self): """ :calls: `GET /repos/:owner/:repo/issues/:number/labels <http://developer.github.com/v3/issues/labels>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Label.Label` """ return github.PaginatedList.PaginatedList( github.L...
: calls: DELETE/ repos/: owner/: repo/ issues/: number/ labels/: name <http:// developer. github. com/ v3/ issues/ labels > _: param label:: class: github. Label. Label or string: rtype: None
def remove_from_labels(self, label): """ :calls: `DELETE /repos/:owner/:repo/issues/:number/labels/:name <http://developer.github.com/v3/issues/labels>`_ :param label: :class:`github.Label.Label` or string :rtype: None """ assert isinstance(label, (github.Label.Label, str...
: calls: PUT/ repos/: owner/: repo/ issues/: number/ labels <http:// developer. github. com/ v3/ issues/ labels > _: param labels: list of: class: github. Label. Label or strings: rtype: None
def set_labels(self, *labels): """ :calls: `PUT /repos/:owner/:repo/issues/:number/labels <http://developer.github.com/v3/issues/labels>`_ :param labels: list of :class:`github.Label.Label` or strings :rtype: None """ assert all(isinstance(element, (github.Label.Label, st...
: calls: GET/ repos/: owner/: repo/ pulls/: number/ merge <http:// developer. github. com/ v3/ pulls > _: rtype: bool
def is_merged(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number/merge <http://developer.github.com/v3/pulls>`_ :rtype: bool """ status, headers, data = self._requester.requestJson( "GET", self.url + "/merge" ) return status == 204
: calls: PUT/ repos/: owner/: repo/ pulls/: number/ merge <http:// developer. github. com/ v3/ pulls > _: param commit_message: string: rtype:: class: github. PullRequestMergeStatus. PullRequestMergeStatus
def merge(self, commit_message=github.GithubObject.NotSet, commit_title=github.GithubObject.NotSet, merge_method=github.GithubObject.NotSet, sha=github.GithubObject.NotSet): """ :calls: `PUT /repos/:owner/:repo/pulls/:number/merge <http://developer.github.com/v3/pulls>`_ :param commit_message: s...
: type:: class: github. Repository. Repository
def repository(self): """ :type: :class:`github.Repository.Repository` """ self._completeIfNotSet(self._repository) if self._repository is github.GithubObject.NotSet: # The repository was not set automatically, so it must be looked up by url. repo_url = "/...
: calls: GET/ repos/: owner/: repo/ pulls/: number <http:// developer. github. com/ v3/ pulls > _: rtype:: class: github. PullRequest. PullRequest
def as_pull_request(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number <http://developer.github.com/v3/pulls>`_ :rtype: :class:`github.PullRequest.PullRequest` """ headers, data = self._requester.requestJsonAndCheck( "GET", "/pulls/".join(self.url.r...
: calls: POST/ repos/: owner/: repo/ issues/: number/ assignees <https:// developer. github. com/ v3/ issues/ assignees > _: param assignee:: class: github. NamedUser. NamedUser or string: rtype: None
def add_to_assignees(self, *assignees): """ :calls: `POST /repos/:owner/:repo/issues/:number/assignees <https://developer.github.com/v3/issues/assignees>`_ :param assignee: :class:`github.NamedUser.NamedUser` or string :rtype: None """ assert all(isinstance(element, (gith...
: calls: POST/ repos/: owner/: repo/ issues/: number/ comments <http:// developer. github. com/ v3/ issues/ comments > _: param body: string: rtype:: class: github. IssueComment. IssueComment
def create_comment(self, body): """ :calls: `POST /repos/:owner/:repo/issues/:number/comments <http://developer.github.com/v3/issues/comments>`_ :param body: string :rtype: :class:`github.IssueComment.IssueComment` """ assert isinstance(body, (str, unicode)), body ...
: calls: PATCH/ repos/: owner/: repo/ issues/: number <http:// developer. github. com/ v3/ issues > _: param title: string: param body: string: param assignee: string or: class: github. NamedUser. NamedUser or None: param assignees: list ( of string or: class: github. NamedUser. NamedUser ): param state: string: param ...
def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, state=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, assignees=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/...
: calls: GET/ repos/: owner/: repo/ issues/: number/ comments <http:// developer. github. com/ v3/ issues/ comments > _: param since: datetime. datetime format YYYY - MM - DDTHH: MM: SSZ: rtype:: class: github. PaginatedList. PaginatedList of: class: github. IssueComment. IssueComment
def get_comments(self, since=github.GithubObject.NotSet): """ :calls: `GET /repos/:owner/:repo/issues/:number/comments <http://developer.github.com/v3/issues/comments>`_ :param since: datetime.datetime format YYYY-MM-DDTHH:MM:SSZ :rtype: :class:`github.PaginatedList.PaginatedList` of :cl...
: calls: GET/ repos/: owner/: repo/ issues/: issue_number/ events <http:// developer. github. com/ v3/ issues/ events > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. IssueEvent. IssueEvent
def get_events(self): """ :calls: `GET /repos/:owner/:repo/issues/:issue_number/events <http://developer.github.com/v3/issues/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.IssueEvent.IssueEvent` """ return github.PaginatedList.PaginatedList( ...
: calls: GET/ repos/: owner/: repo/ issues/: number/ labels <http:// developer. github. com/ v3/ issues/ labels > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Label. Label
def get_labels(self): """ :calls: `GET /repos/:owner/:repo/issues/:number/labels <http://developer.github.com/v3/issues/labels>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Label.Label` """ return github.PaginatedList.PaginatedList( github.L...
: calls: GET/ repos/: owner/: repo/ issues/: number/ reactions <https:// developer. github. com/ v3/ reactions/ #list - reactions - for - an - issue > _: return:: class:: class: github. PaginatedList. PaginatedList of: class: github. Reaction. Reaction
def get_reactions(self): """ :calls: `GET /repos/:owner/:repo/issues/:number/reactions <https://developer.github.com/v3/reactions/#list-reactions-for-an-issue>`_ :return: :class: :class:`github.PaginatedList.PaginatedList` of :class:`github.Reaction.Reaction` """ return github.Pa...
: calls: POST/ repos/: owner/: repo/ issues/: number/ reactions <https:// developer. github. com/ v3/ reactions > _: param reaction_type: string: rtype:: class: github. Reaction. Reaction
def create_reaction(self, reaction_type): """ :calls: `POST /repos/:owner/:repo/issues/:number/reactions <https://developer.github.com/v3/reactions>`_ :param reaction_type: string :rtype: :class:`github.Reaction.Reaction` """ assert isinstance(reaction_type, (str, unicode...
: calls: PATCH/ repos/: owner/: repo/ milestones/: number <http:// developer. github. com/ v3/ issues/ milestones > _: param title: string: param state: string: param description: string: param due_on: date: rtype: None
def edit(self, title, state=github.GithubObject.NotSet, description=github.GithubObject.NotSet, due_on=github.GithubObject.NotSet): """ :calls: `PATCH /repos/:owner/:repo/milestones/:number <http://developer.github.com/v3/issues/milestones>`_ :param title: string :param state: string ...
: calls: PUT/ orgs/: org/ public_members/: user <http:// developer. github. com/ v3/ orgs/ members > _: param public_member:: class: github. NamedUser. NamedUser: rtype: None
def add_to_public_members(self, public_member): """ :calls: `PUT /orgs/:org/public_members/:user <http://developer.github.com/v3/orgs/members>`_ :param public_member: :class:`github.NamedUser.NamedUser` :rtype: None """ assert isinstance(public_member, github.NamedUser.Na...
: calls: POST/ repos/: owner/: repo/ forks <http:// developer. github. com/ v3/ repos/ forks > _: param repo:: class: github. Repository. Repository: rtype:: class: github. Repository. Repository
def create_fork(self, repo): """ :calls: `POST /repos/:owner/:repo/forks <http://developer.github.com/v3/repos/forks>`_ :param repo: :class:`github.Repository.Repository` :rtype: :class:`github.Repository.Repository` """ assert isinstance(repo, github.Repository.Repositor...
: calls: POST/ orgs/: owner/ hooks <http:// developer. github. com/ v3/ orgs/ hooks > _: param name: string: param config: dict: param events: list of string: param active: bool: rtype:: class: github. Hook. Hook
def create_hook(self, name, config, events=github.GithubObject.NotSet, active=github.GithubObject.NotSet): """ :calls: `POST /orgs/:owner/hooks <http://developer.github.com/v3/orgs/hooks>`_ :param name: string :param config: dict :param events: list of string :param activ...
: calls: POST/ orgs/: org/ teams <http:// developer. github. com/ v3/ orgs/ teams > _: param name: string: param repo_names: list of: class: github. Repository. Repository: param permission: string: param privacy: string: rtype:: class: github. Team. Team
def create_team(self, name, repo_names=github.GithubObject.NotSet, permission=github.GithubObject.NotSet, privacy=github.GithubObject.NotSet): """ :calls: `POST /orgs/:org/teams <http://developer.github.com/v3/orgs/teams>`_ :param name: string :param repo_names: list of :class:`github.Re...
: calls: DELETE/ orgs/: owner/ hooks/: id <http:// developer. github. com/ v3/ orgs/ hooks > _: param id: integer: rtype: None
def delete_hook(self, id): """ :calls: `DELETE /orgs/:owner/hooks/:id <http://developer.github.com/v3/orgs/hooks>`_ :param id: integer :rtype: None` """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestJsonAndCheck( "DELETE...
: calls: PATCH/ orgs/: org <http:// developer. github. com/ v3/ orgs > _: param billing_email: string: param blog: string: param company: string: param description: string: param email: string: param location: string: param name: string: rtype: None
def edit(self, billing_email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, description=github.GithubObject.NotSet, email=github.GithubObject.NotSet, location=github.GithubObject.NotSet, name=github.GithubObject.NotSet): """ :calls: `PATCH /orgs/:org <ht...
: calls: GET/ orgs/: org/ events <http:// developer. github. com/ v3/ activity/ events > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Event. Event
def get_events(self): """ :calls: `GET /orgs/:org/events <http://developer.github.com/v3/activity/events>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Event.Event` """ return github.PaginatedList.PaginatedList( github.Event.Event, ...
: calls: GET/ orgs/: owner/ hooks/: id <http:// developer. github. com/ v3/ orgs/ hooks > _: param id: integer: rtype:: class: github. Hook. Hook
def get_hook(self, id): """ :calls: `GET /orgs/:owner/hooks/:id <http://developer.github.com/v3/orgs/hooks>`_ :param id: integer :rtype: :class:`github.Hook.Hook` """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestJsonAndCheck( ...
: calls: GET/ orgs/: owner/ hooks <http:// developer. github. com/ v3/ orgs/ hooks > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Hook. Hook
def get_hooks(self): """ :calls: `GET /orgs/:owner/hooks <http://developer.github.com/v3/orgs/hooks>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Hook.Hook` """ return github.PaginatedList.PaginatedList( github.Hook.Hook, self._r...
: calls: GET/ orgs/: org/ members <http:// developer. github. com/ v3/ orgs/ members > _: param filter_: string: param role: string: rtype:: class: github. PaginatedList. PaginatedList of: class: github. NamedUser. NamedUser
def get_members(self, filter_=github.GithubObject.NotSet, role=github.GithubObject.NotSet): """ :calls: `GET /orgs/:org/members <http://developer.github.com/v3/orgs/members>`_ :param filter_: string :param role: string :rtype: :class:`github.PaginatedList.Pagi...
: calls: GET/ orgs/: org/ projects <https:// developer. github. com/ v3/ projects/ #list - organization - projects > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Project. Project: param state: string
def get_projects(self, state=github.GithubObject.NotSet): """ :calls: `GET /orgs/:org/projects <https://developer.github.com/v3/projects/#list-organization-projects>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Project.Project` :param state: string """ ...
: calls: GET/ orgs/: org/ public_members <http:// developer. github. com/ v3/ orgs/ members > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. NamedUser. NamedUser
def get_public_members(self): """ :calls: `GET /orgs/:org/public_members <http://developer.github.com/v3/orgs/members>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ return github.PaginatedList.PaginatedList( github.Na...
: calls: GET/ orgs/: org/ outside_collaborators <http:// developer. github. com/ v3/ orgs/ outside_collaborators > _: param filter_: string: rtype:: class: github. PaginatedList. PaginatedList of: class: github. NamedUser. NamedUser
def get_outside_collaborators(self, filter_=github.GithubObject.NotSet): """ :calls: `GET /orgs/:org/outside_collaborators <http://developer.github.com/v3/orgs/outside_collaborators>`_ :param filter_: string :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser....
: calls: DELETE/ orgs/: org/ outside_collaborators/: username <https:// developer. github. com/ v3/ orgs/ outside_collaborators > _: param collaborator:: class: github. NamedUser. NamedUser: rtype: None
def remove_outside_collaborator(self, collaborator): """ :calls: `DELETE /orgs/:org/outside_collaborators/:username <https://developer.github.com/v3/orgs/outside_collaborators>`_ :param collaborator: :class:`github.NamedUser.NamedUser` :rtype: None """ assert isinstance(c...
: calls: PUT/ orgs/: org/ outside_collaborators/: username <https:// developer. github. com/ v3/ orgs/ outside_collaborators > _: param member:: class: github. NamedUser. NamedUser: rtype: None
def convert_to_outside_collaborator(self, member): """ :calls: `PUT /orgs/:org/outside_collaborators/:username <https://developer.github.com/v3/orgs/outside_collaborators>`_ :param member: :class:`github.NamedUser.NamedUser` :rtype: None """ assert isinstance(member, gith...
: calls: GET/ repos/: owner/: repo <http:// developer. github. com/ v3/ repos > _: param name: string: rtype:: class: github. Repository. Repository
def get_repo(self, name): """ :calls: `GET /repos/:owner/:repo <http://developer.github.com/v3/repos>`_ :param name: string :rtype: :class:`github.Repository.Repository` """ assert isinstance(name, (str, unicode)), name headers, data = self._requester.requestJsonA...
: calls: GET/ orgs/: org/ repos <http:// developer. github. com/ v3/ repos > _: param type: string ( all public private forks sources member ): rtype:: class: github. PaginatedList. PaginatedList of: class: github. Repository. Repository
def get_repos(self, type=github.GithubObject.NotSet): """ :calls: `GET /orgs/:org/repos <http://developer.github.com/v3/repos>`_ :param type: string ('all', 'public', 'private', 'forks', 'sources', 'member') :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Repository...
: calls: GET/ teams/: id <http:// developer. github. com/ v3/ orgs/ teams > _: param id: integer: rtype:: class: github. Team. Team
def get_team(self, id): """ :calls: `GET /teams/:id <http://developer.github.com/v3/orgs/teams>`_ :param id: integer :rtype: :class:`github.Team.Team` """ assert isinstance(id, (int, long)), id headers, data = self._requester.requestJsonAndCheck( "GET"...
: calls: GET/ orgs/: org/ teams <http:// developer. github. com/ v3/ orgs/ teams > _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Team. Team
def get_teams(self): """ :calls: `GET /orgs/:org/teams <http://developer.github.com/v3/orgs/teams>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team` """ return github.PaginatedList.PaginatedList( github.Team.Team, self._req...
: calls: POST/ orgs/: org/ invitations <http:// developer. github. com/ v3/ orgs/ members > _: param user:: class: github. NamedUser. NamedUser: param email: string: param role: string: param teams: array of: class: github. Team. Team: rtype: None
def invite_user(self, user=github.GithubObject.NotSet, email=github.GithubObject.NotSet, role=github.GithubObject.NotSet, teams=github.GithubObject.NotSet): """ :calls: `POST /orgs/:org/invitations <http://developer.github.com/v3/orgs/members>`_ :param user: :class:`github.NamedUser.NamedUser` ...
: calls: GET/ orgs/: org/ public_members/: user <http:// developer. github. com/ v3/ orgs/ members > _: param public_member:: class: github. NamedUser. NamedUser: rtype: bool
def has_in_public_members(self, public_member): """ :calls: `GET /orgs/:org/public_members/:user <http://developer.github.com/v3/orgs/members>`_ :param public_member: :class:`github.NamedUser.NamedUser` :rtype: bool """ assert isinstance(public_member, github.NamedUser.Na...
: calls: GET/ orgs/: org/ migrations _: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Migration. Migration
def get_migrations(self): """ :calls: `GET /orgs/:org/migrations`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Migration.Migration` """ return github.PaginatedList.PaginatedList( github.Migration.Migration, self._requester, ...
: rtype:: class: github. PaginatedList. PaginatedList of: class: github. NamedUser. NamedUser
def get_user_push_restrictions(self): """ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser` """ if self._user_push_restrictions is github.GithubObject.NotSet: return None return github.PaginatedList.PaginatedList( g...
: rtype:: class: github. PaginatedList. PaginatedList of: class: github. Team. Team
def get_team_push_restrictions(self): """ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Team.Team` """ if self._team_push_restrictions is github.GithubObject.NotSet: return None return github.PaginatedList.PaginatedList( github.Team...
: type: string
def name(self, value): """ :type: string """ self._completeIfNotSet(self._name) self._name.value = value
: type: string
def label(self, value): """ :type: string """ self._completeIfNotSet(self._label) self._label.value = value
Delete asset from the release.: rtype: bool
def delete_asset(self): """ Delete asset from the release. :rtype: bool """ headers, data = self._requester.requestJsonAndCheck( "DELETE", self.url ) return True
Update asset metadata.: rtype: github. GitReleaseAsset. GitReleaseAsset
def update_asset(self, name, label=""): """ Update asset metadata. :rtype: github.GitReleaseAsset.GitReleaseAsset """ assert isinstance(name, (str, unicode)), name assert isinstance(label, (str, unicode)), label post_parameters = { "name": name, ...
Check and update the object with conditional request: rtype: Boolean value indicating whether the object is changed
def update(self): ''' Check and update the object with conditional request :rtype: Boolean value indicating whether the object is changed ''' conditionalRequestHeader = dict() if self.etag is not None: conditionalRequestHeader[Consts.REQ_IF_NONE_MATCH] = self....
: calls: PUT/ repos/: owner/: repo/ pulls/: number/ reviews/: review_id/ dismissals <https:// developer. github. com/ v3/ pulls/ reviews/ > _: rtype: None
def dismiss(self, message): """ :calls: `PUT /repos/:owner/:repo/pulls/:number/reviews/:review_id/dismissals <https://developer.github.com/v3/pulls/reviews/>`_ :rtype: None """ assert isinstance(message, (str, unicode)), message post_parameters = {'message': message} ...
: calls: PUT/ repos/: owner/: repo/ collaborators/: user <http:// developer. github. com/ v3/ repos/ collaborators > _: param collaborator: string or: class: github. NamedUser. NamedUser: param permission: string pull push or admin: rtype: None
def add_to_collaborators(self, collaborator, permission=github.GithubObject.NotSet): """ :calls: `PUT /repos/:owner/:repo/collaborators/:user <http://developer.github.com/v3/repos/collaborators>`_ :param collaborator: string or :class:`github.NamedUser.NamedUser` :param permission: strin...
: calls: GET/ repos/: owner/: repo/ collaborators/: username/ permission <http:// developer. github. com/ v3/ repos/ collaborators > _: param collaborator: string or: class: github. NamedUser. NamedUser: rtype: string
def get_collaborator_permission(self, collaborator): """ :calls: `GET /repos/:owner/:repo/collaborators/:username/permission <http://developer.github.com/v3/repos/collaborators>`_ :param collaborator: string or :class:`github.NamedUser.NamedUser` :rtype: string """ assert...
: calls: GET/ repos/: owner/: repo/ compare/: base...: head <http:// developer. github. com/ v3/ repos/ commits > _: param base: string: param head: string: rtype:: class: github. Comparison. Comparison
def compare(self, base, head): """ :calls: `GET /repos/:owner/:repo/compare/:base...:head <http://developer.github.com/v3/repos/commits>`_ :param base: string :param head: string :rtype: :class:`github.Comparison.Comparison` """ assert isinstance(base, (str, unico...
: calls: POST/ repos/: owner/: repo/ git/ blobs <http:// developer. github. com/ v3/ git/ blobs > _: param content: string: param encoding: string: rtype:: class: github. GitBlob. GitBlob
def create_git_blob(self, content, encoding): """ :calls: `POST /repos/:owner/:repo/git/blobs <http://developer.github.com/v3/git/blobs>`_ :param content: string :param encoding: string :rtype: :class:`github.GitBlob.GitBlob` """ assert isinstance(content, (str, u...
: calls: POST/ repos/: owner/: repo/ git/ commits <http:// developer. github. com/ v3/ git/ commits > _: param message: string: param tree:: class: github. GitTree. GitTree: param parents: list of: class: github. GitCommit. GitCommit: param author:: class: github. InputGitAuthor. InputGitAuthor: param committer:: class...
def create_git_commit(self, message, tree, parents, author=github.GithubObject.NotSet, committer=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/git/commits <http://developer.github.com/v3/git/commits>`_ :param message: string :param tree: :class:`github.GitTree.GitTre...
: calls: POST/ repos/: owner/: repo/ git/ refs <http:// developer. github. com/ v3/ git/ refs > _: param ref: string: param sha: string: rtype:: class: github. GitRef. GitRef
def create_git_ref(self, ref, sha): """ :calls: `POST /repos/:owner/:repo/git/refs <http://developer.github.com/v3/git/refs>`_ :param ref: string :param sha: string :rtype: :class:`github.GitRef.GitRef` """ assert isinstance(ref, (str, unicode)), ref asser...
: calls: POST/ repos/: owner/: repo/ releases <http:// developer. github. com/ v3/ repos/ releases > _: param tag: string: param name: string: param message: string: param draft: bool: param prerelease: bool: param target_commitish: string or: class: github. Branch. Branch or: class: github. Commit. Commit or: class: g...
def create_git_release(self, tag, name, message, draft=False, prerelease=False, target_commitish=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/releases <http://developer.github.com/v3/repos/releases>`_ :param tag: string :param name: string :param message: st...
: calls: POST/ repos/: owner/: repo/ git/ tags <http:// developer. github. com/ v3/ git/ tags > _: param tag: string: param message: string: param object: string: param type: string: param tagger:: class: github. InputGitAuthor. InputGitAuthor: rtype:: class: github. GitTag. GitTag
def create_git_tag(self, tag, message, object, type, tagger=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/git/tags <http://developer.github.com/v3/git/tags>`_ :param tag: string :param message: string :param object: string :param type: string ...
: calls: POST/ repos/: owner/: repo/ git/ trees <http:// developer. github. com/ v3/ git/ trees > _: param tree: list of: class: github. InputGitTreeElement. InputGitTreeElement: param base_tree:: class: github. GitTree. GitTree: rtype:: class: github. GitTree. GitTree
def create_git_tree(self, tree, base_tree=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/git/trees <http://developer.github.com/v3/git/trees>`_ :param tree: list of :class:`github.InputGitTreeElement.InputGitTreeElement` :param base_tree: :class:`github.GitTree.GitTre...
: calls: POST/ repos/: owner/: repo/ issues <http:// developer. github. com/ v3/ issues > _: param title: string: param body: string: param assignee: string or: class: github. NamedUser. NamedUser: param assignees: list ( of string or: class: github. NamedUser. NamedUser ): param milestone:: class: github. Milestone. M...
def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, assignees=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/issues <http://developer.github.com/v3/issues>`_ ...
: calls: POST/ repos/: owner/: repo/ keys <http:// developer. github. com/ v3/ repos/ keys > _: param title: string: param key: string: param read_only: bool: rtype:: class: github. RepositoryKey. RepositoryKey
def create_key(self, title, key, read_only=False): """ :calls: `POST /repos/:owner/:repo/keys <http://developer.github.com/v3/repos/keys>`_ :param title: string :param key: string :param read_only: bool :rtype: :class:`github.RepositoryKey.RepositoryKey` """ ...
: calls: POST/ repos/: owner/: repo/ labels <http:// developer. github. com/ v3/ issues/ labels > _: param name: string: param color: string: param description: string: rtype:: class: github. Label. Label
def create_label(self, name, color, description=github.GithubObject.NotSet): """ :calls: `POST /repos/:owner/:repo/labels <http://developer.github.com/v3/issues/labels>`_ :param name: string :param color: string :param description: string :rtype: :class:`github.Label.Labe...