{"action":"created","comment":{"url":"https://api.github.com/repos/diarts/python/pulls/comments/217881729","pull_request_review_id":155710066,"id":217881729,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzg4MTcyOQ==","diff_hunk":"@@ -0,0 +1,51 @@\n+# 1. Отсортировать по убыванию методом «пузырька» одномерный целочисленный массив, заданный случайными числами на промежутке [-100; 100). Вывести на экран исходный и отсортированный массивы.\n+import random\n+\n+\n+def my_buble_sort(list, first_be='max'):\n+    '''\n+    Сортировка пузырьком, немного ускоренная.\n+    :param list: Массив который требуется отсортировать\n+    :param first_be: параметр по дефолту = max, max - это значит сортировать по убыванию, min - сотрировать по возрастанию\n+    :return: отсортированый массив и количество циклов затраченных на сортировку\n+    '''\n+    n = 0\n+    for i in range(len(my_list)):\n+        for j in range(0 + i, len(my_list)):\n+\n+            if first_be == 'max':\n+                if my_list[i] < my_list[j]:\n+                    my_list[i], my_list[j] = my_list[j], my_list[i]\n+            elif first_be == 'min':\n+                if my_list[i] > my_list[j]:\n+                    my_list[i], my_list[j] = my_list[j], my_list[i]\n+            n += 1\n+    return my_list, n","path":"algorithms/home_work_7/task_01.py","position":23,"original_position":23,"commit_id":"51b448a68b13bf445ce53602fd19f4c5dc44daef","original_commit_id":"51b448a68b13bf445ce53602fd19f4c5dc44daef","user":{"login":"Dzhoker1","id":31956448,"node_id":"MDQ6VXNlcjMxOTU2NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/31956448?v=4","gravatar_id":"","url":"https://api.github.com/users/Dzhoker1","html_url":"https://github.com/Dzhoker1","followers_url":"https://api.github.com/users/Dzhoker1/followers","following_url":"https://api.github.com/users/Dzhoker1/following{/other_user}","gists_url":"https://api.github.com/users/Dzhoker1/gists{/gist_id}","starred_url":"https://api.github.com/users/Dzhoker1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dzhoker1/subscriptions","organizations_url":"https://api.github.com/users/Dzhoker1/orgs","repos_url":"https://api.github.com/users/Dzhoker1/repos","events_url":"https://api.github.com/users/Dzhoker1/events{/privacy}","received_events_url":"https://api.github.com/users/Dzhoker1/received_events","type":"User","site_admin":false},"body":"На уроке покажу как сделать сортировку еще быстрее","created_at":"2018-09-15T10:22:46Z","updated_at":"2018-09-15T10:32:39Z","html_url":"https://github.com/diarts/python/pull/7#discussion_r217881729","pull_request_url":"https://api.github.com/repos/diarts/python/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/diarts/python/pulls/comments/217881729"},"html":{"href":"https://github.com/diarts/python/pull/7#discussion_r217881729"},"pull_request":{"href":"https://api.github.com/repos/diarts/python/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/diarts/python/pulls/7","id":215756404,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1NzU2NDA0","html_url":"https://github.com/diarts/python/pull/7","diff_url":"https://github.com/diarts/python/pull/7.diff","patch_url":"https://github.com/diarts/python/pull/7.patch","issue_url":"https://api.github.com/repos/diarts/python/issues/7","number":7,"state":"open","locked":false,"title":"Home work 7","user":{"login":"diarts","id":38961863,"node_id":"MDQ6VXNlcjM4OTYxODYz","avatar_url":"https://avatars1.githubusercontent.com/u/38961863?v=4","gravatar_id":"","url":"https://api.github.com/users/diarts","html_url":"https://github.com/diarts","followers_url":"https://api.github.com/users/diarts/followers","following_url":"https://api.github.com/users/diarts/following{/other_user}","gists_url":"https://api.github.com/users/diarts/gists{/gist_id}","starred_url":"https://api.github.com/users/diarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diarts/subscriptions","organizations_url":"https://api.github.com/users/diarts/orgs","repos_url":"https://api.github.com/users/diarts/repos","events_url":"https://api.github.com/users/diarts/events{/privacy}","received_events_url":"https://api.github.com/users/diarts/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-15T07:48:53Z","updated_at":"2018-09-15T10:32:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d864a5583186837499d8ad5c638bb642eeee133","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/diarts/python/pulls/7/commits","review_comments_url":"https://api.github.com/repos/diarts/python/pulls/7/comments","review_comment_url":"https://api.github.com/repos/diarts/python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diarts/python/issues/7/comments","statuses_url":"https://api.github.com/repos/diarts/python/statuses/51b448a68b13bf445ce53602fd19f4c5dc44daef","head":{"label":"diarts:home_work_7","ref":"home_work_7","sha":"51b448a68b13bf445ce53602fd19f4c5dc44daef","user":{"login":"diarts","id":38961863,"node_id":"MDQ6VXNlcjM4OTYxODYz","avatar_url":"https://avatars1.githubusercontent.com/u/38961863?v=4","gravatar_id":"","url":"https://api.github.com/users/diarts","html_url":"https://github.com/diarts","followers_url":"https://api.github.com/users/diarts/followers","following_url":"https://api.github.com/users/diarts/following{/other_user}","gists_url":"https://api.github.com/users/diarts/gists{/gist_id}","starred_url":"https://api.github.com/users/diarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diarts/subscriptions","organizations_url":"https://api.github.com/users/diarts/orgs","repos_url":"https://api.github.com/users/diarts/repos","events_url":"https://api.github.com/users/diarts/events{/privacy}","received_events_url":"https://api.github.com/users/diarts/received_events","type":"User","site_admin":false},"repo":{"id":146025252,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwMjUyNTI=","name":"python","full_name":"diarts/python","owner":{"login":"diarts","id":38961863,"node_id":"MDQ6VXNlcjM4OTYxODYz","avatar_url":"https://avatars1.githubusercontent.com/u/38961863?v=4","gravatar_id":"","url":"https://api.github.com/users/diarts","html_url":"https://github.com/diarts","followers_url":"https://api.github.com/users/diarts/followers","following_url":"https://api.github.com/users/diarts/following{/other_user}","gists_url":"https://api.github.com/users/diarts/gists{/gist_id}","starred_url":"https://api.github.com/users/diarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diarts/subscriptions","organizations_url":"https://api.github.com/users/diarts/orgs","repos_url":"https://api.github.com/users/diarts/repos","events_url":"https://api.github.com/users/diarts/events{/privacy}","received_events_url":"https://api.github.com/users/diarts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diarts/python","description":null,"fork":false,"url":"https://api.github.com/repos/diarts/python","forks_url":"https://api.github.com/repos/diarts/python/forks","keys_url":"https://api.github.com/repos/diarts/python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diarts/python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diarts/python/teams","hooks_url":"https://api.github.com/repos/diarts/python/hooks","issue_events_url":"https://api.github.com/repos/diarts/python/issues/events{/number}","events_url":"https://api.github.com/repos/diarts/python/events","assignees_url":"https://api.github.com/repos/diarts/python/assignees{/user}","branches_url":"https://api.github.com/repos/diarts/python/branches{/branch}","tags_url":"https://api.github.com/repos/diarts/python/tags","blobs_url":"https://api.github.com/repos/diarts/python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diarts/python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diarts/python/git/refs{/sha}","trees_url":"https://api.github.com/repos/diarts/python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diarts/python/statuses/{sha}","languages_url":"https://api.github.com/repos/diarts/python/languages","stargazers_url":"https://api.github.com/repos/diarts/python/stargazers","contributors_url":"https://api.github.com/repos/diarts/python/contributors","subscribers_url":"https://api.github.com/repos/diarts/python/subscribers","subscription_url":"https://api.github.com/repos/diarts/python/subscription","commits_url":"https://api.github.com/repos/diarts/python/commits{/sha}","git_commits_url":"https://api.github.com/repos/diarts/python/git/commits{/sha}","comments_url":"https://api.github.com/repos/diarts/python/comments{/number}","issue_comment_url":"https://api.github.com/repos/diarts/python/issues/comments{/number}","contents_url":"https://api.github.com/repos/diarts/python/contents/{+path}","compare_url":"https://api.github.com/repos/diarts/python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diarts/python/merges","archive_url":"https://api.github.com/repos/diarts/python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diarts/python/downloads","issues_url":"https://api.github.com/repos/diarts/python/issues{/number}","pulls_url":"https://api.github.com/repos/diarts/python/pulls{/number}","milestones_url":"https://api.github.com/repos/diarts/python/milestones{/number}","notifications_url":"https://api.github.com/repos/diarts/python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diarts/python/labels{/name}","releases_url":"https://api.github.com/repos/diarts/python/releases{/id}","deployments_url":"https://api.github.com/repos/diarts/python/deployments","created_at":"2018-08-24T18:16:28Z","updated_at":"2018-09-14T13:09:13Z","pushed_at":"2018-09-15T07:48:54Z","git_url":"git://github.com/diarts/python.git","ssh_url":"git@github.com:diarts/python.git","clone_url":"https://github.com/diarts/python.git","svn_url":"https://github.com/diarts/python","homepage":null,"size":8108,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"diarts:master","ref":"master","sha":"1818b1e97b540bfeaeb7147107be9df1e4855c7d","user":{"login":"diarts","id":38961863,"node_id":"MDQ6VXNlcjM4OTYxODYz","avatar_url":"https://avatars1.githubusercontent.com/u/38961863?v=4","gravatar_id":"","url":"https://api.github.com/users/diarts","html_url":"https://github.com/diarts","followers_url":"https://api.github.com/users/diarts/followers","following_url":"https://api.github.com/users/diarts/following{/other_user}","gists_url":"https://api.github.com/users/diarts/gists{/gist_id}","starred_url":"https://api.github.com/users/diarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diarts/subscriptions","organizations_url":"https://api.github.com/users/diarts/orgs","repos_url":"https://api.github.com/users/diarts/repos","events_url":"https://api.github.com/users/diarts/events{/privacy}","received_events_url":"https://api.github.com/users/diarts/received_events","type":"User","site_admin":false},"repo":{"id":146025252,"node_id":"MDEwOlJlcG9zaXRvcnkxNDYwMjUyNTI=","name":"python","full_name":"diarts/python","owner":{"login":"diarts","id":38961863,"node_id":"MDQ6VXNlcjM4OTYxODYz","avatar_url":"https://avatars1.githubusercontent.com/u/38961863?v=4","gravatar_id":"","url":"https://api.github.com/users/diarts","html_url":"https://github.com/diarts","followers_url":"https://api.github.com/users/diarts/followers","following_url":"https://api.github.com/users/diarts/following{/other_user}","gists_url":"https://api.github.com/users/diarts/gists{/gist_id}","starred_url":"https://api.github.com/users/diarts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diarts/subscriptions","organizations_url":"https://api.github.com/users/diarts/orgs","repos_url":"https://api.github.com/users/diarts/repos","events_url":"https://api.github.com/users/diarts/events{/privacy}","received_events_url":"https://api.github.com/users/diarts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diarts/python","description":null,"fork":false,"url":"https://api.github.com/repos/diarts/python","forks_url":"https://api.github.com/repos/diarts/python/forks","keys_url":"https://api.github.com/repos/diarts/python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diarts/python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diarts/python/teams","hooks_url":"https://api.github.com/repos/diarts/python/hooks","issue_events_url":"https://api.github.com/repos/diarts/python/issues/events{/number}","events_url":"https://api.github.com/repos/diarts/python/events","assignees_url":"https://api.github.com/repos/diarts/python/assignees{/user}","branches_url":"https://api.github.com/repos/diarts/python/branches{/branch}","tags_url":"https://api.github.com/repos/diarts/python/tags","blobs_url":"https://api.github.com/repos/diarts/python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diarts/python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diarts/python/git/refs{/sha}","trees_url":"https://api.github.com/repos/diarts/python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diarts/python/statuses/{sha}","languages_url":"https://api.github.com/repos/diarts/python/languages","stargazers_url":"https://api.github.com/repos/diarts/python/stargazers","contributors_url":"https://api.github.com/repos/diarts/python/contributors","subscribers_url":"https://api.github.com/repos/diarts/python/subscribers","subscription_url":"https://api.github.com/repos/diarts/python/subscription","commits_url":"https://api.github.com/repos/diarts/python/commits{/sha}","git_commits_url":"https://api.github.com/repos/diarts/python/git/commits{/sha}","comments_url":"https://api.github.com/repos/diarts/python/comments{/number}","issue_comment_url":"https://api.github.com/repos/diarts/python/issues/comments{/number}","contents_url":"https://api.github.com/repos/diarts/python/contents/{+path}","compare_url":"https://api.github.com/repos/diarts/python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diarts/python/merges","archive_url":"https://api.github.com/repos/diarts/python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diarts/python/downloads","issues_url":"https://api.github.com/repos/diarts/python/issues{/number}","pulls_url":"https://api.github.com/repos/diarts/python/pulls{/number}","milestones_url":"https://api.github.com/repos/diarts/python/milestones{/number}","notifications_url":"https://api.github.com/repos/diarts/python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diarts/python/labels{/name}","releases_url":"https://api.github.com/repos/diarts/python/releases{/id}","deployments_url":"https://api.github.com/repos/diarts/python/deployments","created_at":"2018-08-24T18:16:28Z","updated_at":"2018-09-14T13:09:13Z","pushed_at":"2018-09-15T07:48:54Z","git_url":"git://github.com/diarts/python.git","ssh_url":"git@github.com:diarts/python.git","clone_url":"https://github.com/diarts/python.git","svn_url":"https://github.com/diarts/python","homepage":null,"size":8108,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diarts/python/pulls/7"},"html":{"href":"https://github.com/diarts/python/pull/7"},"issue":{"href":"https://api.github.com/repos/diarts/python/issues/7"},"comments":{"href":"https://api.github.com/repos/diarts/python/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/diarts/python/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/diarts/python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diarts/python/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/diarts/python/statuses/51b448a68b13bf445ce53602fd19f4c5dc44daef"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Dzhoker1"}}