{"action":"created","comment":{"url":"https://api.github.com/repos/alenaPy/advanced_python/pulls/comments/224993623","pull_request_review_id":164499548,"id":224993623,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDk5MzYyMw==","diff_hunk":"@@ -0,0 +1,52 @@\n+#!/usr/bin/env python3\n+\"\"\"Advanced Python Courses. Homework #3\"\"\"\n+\n+import threading\n+from time import sleep\n+\n+import common\n+\n+\n+class OddEven(common.BaseOddEven, threading.Thread):\n+    timer_even = None\n+    timer_odd = None\n+\n+    def run(self):\n+        if self.even:\n+            self.set_timer(0.001)\n+            self.set_timer_opposite(0.001)\n+        else:\n+            sleep(0.1)\n+        while self.pool:\n+            if self.timer.is_alive():\n+                self.timer.join()\n+            self.set_timer_opposite(0.001)\n+            if self.pool:\n+                if self.even == common.is_even(self.pool[-1]):\n+                    print(self.message_template.format(self.pool.pop()))\n+\n+    @property\n+    def timer(self):\n+        if self.even:\n+            return self.timer_even\n+        return self.timer_odd\n+\n+    @property\n+    def timer_opposite(self):\n+        if self.even:\n+            return self.timer_odd\n+        return self.timer_even\n+\n+    def set_timer(self, timeout):\n+        if self.even:\n+            self.__class__.timer_even = threading.Timer(timeout, lambda: None)","path":"with_timer.py","position":42,"original_position":42,"commit_id":"1925c57d6285849d17a5aac1e28ddef29a59a3c5","original_commit_id":"1925c57d6285849d17a5aac1e28ddef29a59a3c5","user":{"login":"alenaPy","id":17473831,"node_id":"MDQ6VXNlcjE3NDczODMx","avatar_url":"https://avatars1.githubusercontent.com/u/17473831?v=4","gravatar_id":"","url":"https://api.github.com/users/alenaPy","html_url":"https://github.com/alenaPy","followers_url":"https://api.github.com/users/alenaPy/followers","following_url":"https://api.github.com/users/alenaPy/following{/other_user}","gists_url":"https://api.github.com/users/alenaPy/gists{/gist_id}","starred_url":"https://api.github.com/users/alenaPy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alenaPy/subscriptions","organizations_url":"https://api.github.com/users/alenaPy/orgs","repos_url":"https://api.github.com/users/alenaPy/repos","events_url":"https://api.github.com/users/alenaPy/events{/privacy}","received_events_url":"https://api.github.com/users/alenaPy/received_events","type":"User","site_admin":false},"body":"``\r\n`self.timer_odd = ...\r\nself.timer_even = ...\r\n```","created_at":"2018-10-14T13:54:00Z","updated_at":"2018-10-14T13:58:29Z","html_url":"https://github.com/alenaPy/advanced_python/pull/28#discussion_r224993623","pull_request_url":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/alenaPy/advanced_python/pulls/comments/224993623"},"html":{"href":"https://github.com/alenaPy/advanced_python/pull/28#discussion_r224993623"},"pull_request":{"href":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28","id":214110295,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MTEwMjk1","html_url":"https://github.com/alenaPy/advanced_python/pull/28","diff_url":"https://github.com/alenaPy/advanced_python/pull/28.diff","patch_url":"https://github.com/alenaPy/advanced_python/pull/28.patch","issue_url":"https://api.github.com/repos/alenaPy/advanced_python/issues/28","number":28,"state":"open","locked":false,"title":"Homework3: Ivan Melnik","user":{"login":"melnik-ivan","id":25271294,"node_id":"MDQ6VXNlcjI1MjcxMjk0","avatar_url":"https://avatars2.githubusercontent.com/u/25271294?v=4","gravatar_id":"","url":"https://api.github.com/users/melnik-ivan","html_url":"https://github.com/melnik-ivan","followers_url":"https://api.github.com/users/melnik-ivan/followers","following_url":"https://api.github.com/users/melnik-ivan/following{/other_user}","gists_url":"https://api.github.com/users/melnik-ivan/gists{/gist_id}","starred_url":"https://api.github.com/users/melnik-ivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melnik-ivan/subscriptions","organizations_url":"https://api.github.com/users/melnik-ivan/orgs","repos_url":"https://api.github.com/users/melnik-ivan/repos","events_url":"https://api.github.com/users/melnik-ivan/events{/privacy}","received_events_url":"https://api.github.com/users/melnik-ivan/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-08T19:15:04Z","updated_at":"2018-10-14T13:58:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7dd761d581cfc1b792206114415a5e7420557b68","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28/commits","review_comments_url":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28/comments","review_comment_url":"https://api.github.com/repos/alenaPy/advanced_python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alenaPy/advanced_python/issues/28/comments","statuses_url":"https://api.github.com/repos/alenaPy/advanced_python/statuses/1925c57d6285849d17a5aac1e28ddef29a59a3c5","head":{"label":"melnik-ivan:homework3","ref":"homework3","sha":"1925c57d6285849d17a5aac1e28ddef29a59a3c5","user":{"login":"melnik-ivan","id":25271294,"node_id":"MDQ6VXNlcjI1MjcxMjk0","avatar_url":"https://avatars2.githubusercontent.com/u/25271294?v=4","gravatar_id":"","url":"https://api.github.com/users/melnik-ivan","html_url":"https://github.com/melnik-ivan","followers_url":"https://api.github.com/users/melnik-ivan/followers","following_url":"https://api.github.com/users/melnik-ivan/following{/other_user}","gists_url":"https://api.github.com/users/melnik-ivan/gists{/gist_id}","starred_url":"https://api.github.com/users/melnik-ivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melnik-ivan/subscriptions","organizations_url":"https://api.github.com/users/melnik-ivan/orgs","repos_url":"https://api.github.com/users/melnik-ivan/repos","events_url":"https://api.github.com/users/melnik-ivan/events{/privacy}","received_events_url":"https://api.github.com/users/melnik-ivan/received_events","type":"User","site_admin":false},"repo":{"id":146997309,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY5OTczMDk=","name":"advanced_python","full_name":"melnik-ivan/advanced_python","private":false,"owner":{"login":"melnik-ivan","id":25271294,"node_id":"MDQ6VXNlcjI1MjcxMjk0","avatar_url":"https://avatars2.githubusercontent.com/u/25271294?v=4","gravatar_id":"","url":"https://api.github.com/users/melnik-ivan","html_url":"https://github.com/melnik-ivan","followers_url":"https://api.github.com/users/melnik-ivan/followers","following_url":"https://api.github.com/users/melnik-ivan/following{/other_user}","gists_url":"https://api.github.com/users/melnik-ivan/gists{/gist_id}","starred_url":"https://api.github.com/users/melnik-ivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melnik-ivan/subscriptions","organizations_url":"https://api.github.com/users/melnik-ivan/orgs","repos_url":"https://api.github.com/users/melnik-ivan/repos","events_url":"https://api.github.com/users/melnik-ivan/events{/privacy}","received_events_url":"https://api.github.com/users/melnik-ivan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/melnik-ivan/advanced_python","description":null,"fork":true,"url":"https://api.github.com/repos/melnik-ivan/advanced_python","forks_url":"https://api.github.com/repos/melnik-ivan/advanced_python/forks","keys_url":"https://api.github.com/repos/melnik-ivan/advanced_python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/melnik-ivan/advanced_python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/melnik-ivan/advanced_python/teams","hooks_url":"https://api.github.com/repos/melnik-ivan/advanced_python/hooks","issue_events_url":"https://api.github.com/repos/melnik-ivan/advanced_python/issues/events{/number}","events_url":"https://api.github.com/repos/melnik-ivan/advanced_python/events","assignees_url":"https://api.github.com/repos/melnik-ivan/advanced_python/assignees{/user}","branches_url":"https://api.github.com/repos/melnik-ivan/advanced_python/branches{/branch}","tags_url":"https://api.github.com/repos/melnik-ivan/advanced_python/tags","blobs_url":"https://api.github.com/repos/melnik-ivan/advanced_python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/melnik-ivan/advanced_python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/melnik-ivan/advanced_python/git/refs{/sha}","trees_url":"https://api.github.com/repos/melnik-ivan/advanced_python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/melnik-ivan/advanced_python/statuses/{sha}","languages_url":"https://api.github.com/repos/melnik-ivan/advanced_python/languages","stargazers_url":"https://api.github.com/repos/melnik-ivan/advanced_python/stargazers","contributors_url":"https://api.github.com/repos/melnik-ivan/advanced_python/contributors","subscribers_url":"https://api.github.com/repos/melnik-ivan/advanced_python/subscribers","subscription_url":"https://api.github.com/repos/melnik-ivan/advanced_python/subscription","commits_url":"https://api.github.com/repos/melnik-ivan/advanced_python/commits{/sha}","git_commits_url":"https://api.github.com/repos/melnik-ivan/advanced_python/git/commits{/sha}","comments_url":"https://api.github.com/repos/melnik-ivan/advanced_python/comments{/number}","issue_comment_url":"https://api.github.com/repos/melnik-ivan/advanced_python/issues/comments{/number}","contents_url":"https://api.github.com/repos/melnik-ivan/advanced_python/contents/{+path}","compare_url":"https://api.github.com/repos/melnik-ivan/advanced_python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/melnik-ivan/advanced_python/merges","archive_url":"https://api.github.com/repos/melnik-ivan/advanced_python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/melnik-ivan/advanced_python/downloads","issues_url":"https://api.github.com/repos/melnik-ivan/advanced_python/issues{/number}","pulls_url":"https://api.github.com/repos/melnik-ivan/advanced_python/pulls{/number}","milestones_url":"https://api.github.com/repos/melnik-ivan/advanced_python/milestones{/number}","notifications_url":"https://api.github.com/repos/melnik-ivan/advanced_python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/melnik-ivan/advanced_python/labels{/name}","releases_url":"https://api.github.com/repos/melnik-ivan/advanced_python/releases{/id}","deployments_url":"https://api.github.com/repos/melnik-ivan/advanced_python/deployments","created_at":"2018-09-01T12:41:10Z","updated_at":"2018-09-01T12:41:12Z","pushed_at":"2018-10-13T18:42:21Z","git_url":"git://github.com/melnik-ivan/advanced_python.git","ssh_url":"git@github.com:melnik-ivan/advanced_python.git","clone_url":"https://github.com/melnik-ivan/advanced_python.git","svn_url":"https://github.com/melnik-ivan/advanced_python","homepage":null,"size":19,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"alenaPy:master","ref":"master","sha":"077a9d43662c94e8e618ff937c219e07ebf6b964","user":{"login":"alenaPy","id":17473831,"node_id":"MDQ6VXNlcjE3NDczODMx","avatar_url":"https://avatars1.githubusercontent.com/u/17473831?v=4","gravatar_id":"","url":"https://api.github.com/users/alenaPy","html_url":"https://github.com/alenaPy","followers_url":"https://api.github.com/users/alenaPy/followers","following_url":"https://api.github.com/users/alenaPy/following{/other_user}","gists_url":"https://api.github.com/users/alenaPy/gists{/gist_id}","starred_url":"https://api.github.com/users/alenaPy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alenaPy/subscriptions","organizations_url":"https://api.github.com/users/alenaPy/orgs","repos_url":"https://api.github.com/users/alenaPy/repos","events_url":"https://api.github.com/users/alenaPy/events{/privacy}","received_events_url":"https://api.github.com/users/alenaPy/received_events","type":"User","site_admin":false},"repo":{"id":146766034,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY3NjYwMzQ=","name":"advanced_python","full_name":"alenaPy/advanced_python","private":false,"owner":{"login":"alenaPy","id":17473831,"node_id":"MDQ6VXNlcjE3NDczODMx","avatar_url":"https://avatars1.githubusercontent.com/u/17473831?v=4","gravatar_id":"","url":"https://api.github.com/users/alenaPy","html_url":"https://github.com/alenaPy","followers_url":"https://api.github.com/users/alenaPy/followers","following_url":"https://api.github.com/users/alenaPy/following{/other_user}","gists_url":"https://api.github.com/users/alenaPy/gists{/gist_id}","starred_url":"https://api.github.com/users/alenaPy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alenaPy/subscriptions","organizations_url":"https://api.github.com/users/alenaPy/orgs","repos_url":"https://api.github.com/users/alenaPy/repos","events_url":"https://api.github.com/users/alenaPy/events{/privacy}","received_events_url":"https://api.github.com/users/alenaPy/received_events","type":"User","site_admin":false},"html_url":"https://github.com/alenaPy/advanced_python","description":null,"fork":false,"url":"https://api.github.com/repos/alenaPy/advanced_python","forks_url":"https://api.github.com/repos/alenaPy/advanced_python/forks","keys_url":"https://api.github.com/repos/alenaPy/advanced_python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alenaPy/advanced_python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alenaPy/advanced_python/teams","hooks_url":"https://api.github.com/repos/alenaPy/advanced_python/hooks","issue_events_url":"https://api.github.com/repos/alenaPy/advanced_python/issues/events{/number}","events_url":"https://api.github.com/repos/alenaPy/advanced_python/events","assignees_url":"https://api.github.com/repos/alenaPy/advanced_python/assignees{/user}","branches_url":"https://api.github.com/repos/alenaPy/advanced_python/branches{/branch}","tags_url":"https://api.github.com/repos/alenaPy/advanced_python/tags","blobs_url":"https://api.github.com/repos/alenaPy/advanced_python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alenaPy/advanced_python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alenaPy/advanced_python/git/refs{/sha}","trees_url":"https://api.github.com/repos/alenaPy/advanced_python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alenaPy/advanced_python/statuses/{sha}","languages_url":"https://api.github.com/repos/alenaPy/advanced_python/languages","stargazers_url":"https://api.github.com/repos/alenaPy/advanced_python/stargazers","contributors_url":"https://api.github.com/repos/alenaPy/advanced_python/contributors","subscribers_url":"https://api.github.com/repos/alenaPy/advanced_python/subscribers","subscription_url":"https://api.github.com/repos/alenaPy/advanced_python/subscription","commits_url":"https://api.github.com/repos/alenaPy/advanced_python/commits{/sha}","git_commits_url":"https://api.github.com/repos/alenaPy/advanced_python/git/commits{/sha}","comments_url":"https://api.github.com/repos/alenaPy/advanced_python/comments{/number}","issue_comment_url":"https://api.github.com/repos/alenaPy/advanced_python/issues/comments{/number}","contents_url":"https://api.github.com/repos/alenaPy/advanced_python/contents/{+path}","compare_url":"https://api.github.com/repos/alenaPy/advanced_python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alenaPy/advanced_python/merges","archive_url":"https://api.github.com/repos/alenaPy/advanced_python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alenaPy/advanced_python/downloads","issues_url":"https://api.github.com/repos/alenaPy/advanced_python/issues{/number}","pulls_url":"https://api.github.com/repos/alenaPy/advanced_python/pulls{/number}","milestones_url":"https://api.github.com/repos/alenaPy/advanced_python/milestones{/number}","notifications_url":"https://api.github.com/repos/alenaPy/advanced_python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alenaPy/advanced_python/labels{/name}","releases_url":"https://api.github.com/repos/alenaPy/advanced_python/releases{/id}","deployments_url":"https://api.github.com/repos/alenaPy/advanced_python/deployments","created_at":"2018-08-30T14:58:04Z","updated_at":"2018-08-30T16:33:07Z","pushed_at":"2018-10-13T18:44:58Z","git_url":"git://github.com/alenaPy/advanced_python.git","ssh_url":"git@github.com:alenaPy/advanced_python.git","clone_url":"https://github.com/alenaPy/advanced_python.git","svn_url":"https://github.com/alenaPy/advanced_python","homepage":null,"size":2,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"archived":false,"open_issues_count":109,"license":null,"forks":21,"open_issues":109,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28"},"html":{"href":"https://github.com/alenaPy/advanced_python/pull/28"},"issue":{"href":"https://api.github.com/repos/alenaPy/advanced_python/issues/28"},"comments":{"href":"https://api.github.com/repos/alenaPy/advanced_python/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/alenaPy/advanced_python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alenaPy/advanced_python/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/alenaPy/advanced_python/statuses/1925c57d6285849d17a5aac1e28ddef29a59a3c5"}},"author_association":"NONE"}}
{"actor":{"display_login":"alenaPy"}}