{"action":"created","comment":{"url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/comments/26490642","id":26490642,"diff_hunk":"@@ -337,6 +357,87 @@ def test_memorize(self):\n         utils.TIMESTAMPS['get_data'] = 0\n         self.assertDictEqual(expected_data, utils.get_data()[10])\n \n+    def test_mean_start_end_for_sv(self):\n+        \"\"\"\n+        Test if function correctly counts mean time of\n+        starting and ending work time.\n+        \"\"\"\n+        expected_data = {\n+            'start': 34745.0,\n+            'data_examples_num': 1,\n+            'end': 64792.0\n+        }\n+        self.assertDictEqual(\n+            expected_data,\n+            utils.get_mean_start_end(\n+                utils.get_data()[10]\n+            )[1],\n+        )\n+\n+    def test_variation_start_end(self):\n+        \"\"\"\n+        Test if function correctly counts variation from\n+        given data.\n+        \"\"\"\n+        data = utils.get_data()\n+        day_start_end = {}\n+        for day_idx in range(7):\n+            day_start_end[day_idx] = defaultdict(lambda: 0)\n+\n+        expected_data = {\n+            'end_variation': 2292196.0,\n+            'start_variation': 2292196.0,\n+        }\n+        weekdays = utils.get_mean_start_end(\n+            data[11]\n+        )\n+        day_start_end = utils.variation_for_day_start_end(\n+            day_start_end,\n+            data[11],\n+            weekdays,\n+        )\n+        self.assertDictEqual(day_start_end[3], expected_data)\n+\n+    def test_standard_deviation_from_data(self):\n+        \"\"\"\n+        Test if function retuns standard deviation\n+        from given variations.\n+        \"\"\"\n+        data = utils.get_data()\n+        day_start_end = {}\n+        for day_idx in range(7):\n+            day_start_end[day_idx] = defaultdict(lambda: 0)\n+        weekdays = utils.get_mean_start_end(\n+            data[11]\n+        )\n+        day_start_end = utils.variation_for_day_start_end(\n+            day_start_end,\n+            data[11],\n+            weekdays,\n+        )\n+        expected_data = {\n+            'end_variation': [[15, 51, 12], [16, 41, 40]],\n+            'start_variation': [[9, 28, 8], [10, 18, 36]],\n+        }\n+        self.assertEqual(\n+            expected_data,\n+            utils.standard_deviation_from_data(\n+                day_start_end,\n+                weekdays)[3],\n+        )\n+\n+    def test_equation_for_day(self):\n+        \"\"\"\n+        Test if function properly counts particural\n+        part of variance equation.\n+        \"\"\"\n+        self.assertEqual(\n+            22739.259661982247, utils.equation_for_day(","path":"src/presence_analyzer/tests.py","position":120,"original_position":120,"commit_id":"c86739a2eaf64df674f4e1f26f49f3b1103f2ab2","original_commit_id":"c86739a2eaf64df674f4e1f26f49f3b1103f2ab2","user":{"login":"mjelonek92","id":7791528,"avatar_url":"https://avatars.githubusercontent.com/u/7791528?v=3","gravatar_id":"","url":"https://api.github.com/users/mjelonek92","html_url":"https://github.com/mjelonek92","followers_url":"https://api.github.com/users/mjelonek92/followers","following_url":"https://api.github.com/users/mjelonek92/following{/other_user}","gists_url":"https://api.github.com/users/mjelonek92/gists{/gist_id}","starred_url":"https://api.github.com/users/mjelonek92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjelonek92/subscriptions","organizations_url":"https://api.github.com/users/mjelonek92/orgs","repos_url":"https://api.github.com/users/mjelonek92/repos","events_url":"https://api.github.com/users/mjelonek92/events{/privacy}","received_events_url":"https://api.github.com/users/mjelonek92/received_events","type":"User","site_admin":false},"body":"To assert floats you should use ```assertAlmostEqual```","created_at":"2015-03-16T14:49:28Z","updated_at":"2015-03-16T14:49:28Z","html_url":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk/pull/8#discussion_r26490642","pull_request_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/comments/26490642"},"html":{"href":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk/pull/8#discussion_r26490642"},"pull_request":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8","id":31125443,"html_url":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk/pull/8","diff_url":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk/pull/8.diff","patch_url":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk/pull/8.patch","issue_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/issues/8","number":8,"state":"open","locked":false,"title":"bug_5725 standard deviation added","user":{"login":"krzyhub","id":10939790,"avatar_url":"https://avatars.githubusercontent.com/u/10939790?v=3","gravatar_id":"","url":"https://api.github.com/users/krzyhub","html_url":"https://github.com/krzyhub","followers_url":"https://api.github.com/users/krzyhub/followers","following_url":"https://api.github.com/users/krzyhub/following{/other_user}","gists_url":"https://api.github.com/users/krzyhub/gists{/gist_id}","starred_url":"https://api.github.com/users/krzyhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzyhub/subscriptions","organizations_url":"https://api.github.com/users/krzyhub/orgs","repos_url":"https://api.github.com/users/krzyhub/repos","events_url":"https://api.github.com/users/krzyhub/events{/privacy}","received_events_url":"https://api.github.com/users/krzyhub/received_events","type":"User","site_admin":false},"body":"https://gist.github.com/krzyhub/ae57e9705c247453d643\r\nhttps://bugzilla.stxnext.pl/show_bug.cgi?id=5725","created_at":"2015-03-13T13:30:52Z","updated_at":"2015-03-16T14:49:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7490ae95543f2b72f45bb9b5a6f0cd35cbf4eb19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8/commits","review_comments_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8/comments","review_comment_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/issues/8/comments","statuses_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/statuses/c86739a2eaf64df674f4e1f26f49f3b1103f2ab2","head":{"label":"krzyhub:bug_5725","ref":"bug_5725","sha":"c86739a2eaf64df674f4e1f26f49f3b1103f2ab2","user":{"login":"krzyhub","id":10939790,"avatar_url":"https://avatars.githubusercontent.com/u/10939790?v=3","gravatar_id":"","url":"https://api.github.com/users/krzyhub","html_url":"https://github.com/krzyhub","followers_url":"https://api.github.com/users/krzyhub/followers","following_url":"https://api.github.com/users/krzyhub/following{/other_user}","gists_url":"https://api.github.com/users/krzyhub/gists{/gist_id}","starred_url":"https://api.github.com/users/krzyhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzyhub/subscriptions","organizations_url":"https://api.github.com/users/krzyhub/orgs","repos_url":"https://api.github.com/users/krzyhub/repos","events_url":"https://api.github.com/users/krzyhub/events{/privacy}","received_events_url":"https://api.github.com/users/krzyhub/received_events","type":"User","site_admin":false},"repo":{"id":30636287,"name":"presence-analyzer-klogaciuk","full_name":"krzyhub/presence-analyzer-klogaciuk","owner":{"login":"krzyhub","id":10939790,"avatar_url":"https://avatars.githubusercontent.com/u/10939790?v=3","gravatar_id":"","url":"https://api.github.com/users/krzyhub","html_url":"https://github.com/krzyhub","followers_url":"https://api.github.com/users/krzyhub/followers","following_url":"https://api.github.com/users/krzyhub/following{/other_user}","gists_url":"https://api.github.com/users/krzyhub/gists{/gist_id}","starred_url":"https://api.github.com/users/krzyhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzyhub/subscriptions","organizations_url":"https://api.github.com/users/krzyhub/orgs","repos_url":"https://api.github.com/users/krzyhub/repos","events_url":"https://api.github.com/users/krzyhub/events{/privacy}","received_events_url":"https://api.github.com/users/krzyhub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krzyhub/presence-analyzer-klogaciuk","description":"bug_5547 removing two more lines","fork":true,"url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk","forks_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/forks","keys_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/teams","hooks_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/hooks","issue_events_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/issues/events{/number}","events_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/events","assignees_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/assignees{/user}","branches_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/branches{/branch}","tags_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/tags","blobs_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/git/refs{/sha}","trees_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/statuses/{sha}","languages_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/languages","stargazers_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/stargazers","contributors_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/contributors","subscribers_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/subscribers","subscription_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/subscription","commits_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/commits{/sha}","git_commits_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/git/commits{/sha}","comments_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/comments{/number}","issue_comment_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/issues/comments{/number}","contents_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/contents/{+path}","compare_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/merges","archive_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/downloads","issues_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/issues{/number}","pulls_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/pulls{/number}","milestones_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/milestones{/number}","notifications_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/labels{/name}","releases_url":"https://api.github.com/repos/krzyhub/presence-analyzer-klogaciuk/releases{/id}","created_at":"2015-02-11T07:37:44Z","updated_at":"2015-03-10T10:21:30Z","pushed_at":"2015-03-16T14:30:56Z","git_url":"git://github.com/krzyhub/presence-analyzer-klogaciuk.git","ssh_url":"git@github.com:krzyhub/presence-analyzer-klogaciuk.git","clone_url":"https://github.com/krzyhub/presence-analyzer-klogaciuk.git","svn_url":"https://github.com/krzyhub/presence-analyzer-klogaciuk","homepage":"","size":504,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stxnext-kindergarten:master","ref":"master","sha":"ee1079a25c9681251bc230864c2bd60506f5e9e2","user":{"login":"stxnext-kindergarten","id":5575308,"avatar_url":"https://avatars.githubusercontent.com/u/5575308?v=3","gravatar_id":"","url":"https://api.github.com/users/stxnext-kindergarten","html_url":"https://github.com/stxnext-kindergarten","followers_url":"https://api.github.com/users/stxnext-kindergarten/followers","following_url":"https://api.github.com/users/stxnext-kindergarten/following{/other_user}","gists_url":"https://api.github.com/users/stxnext-kindergarten/gists{/gist_id}","starred_url":"https://api.github.com/users/stxnext-kindergarten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stxnext-kindergarten/subscriptions","organizations_url":"https://api.github.com/users/stxnext-kindergarten/orgs","repos_url":"https://api.github.com/users/stxnext-kindergarten/repos","events_url":"https://api.github.com/users/stxnext-kindergarten/events{/privacy}","received_events_url":"https://api.github.com/users/stxnext-kindergarten/received_events","type":"Organization","site_admin":false},"repo":{"id":30581691,"name":"presence-analyzer-klogaciuk","full_name":"stxnext-kindergarten/presence-analyzer-klogaciuk","owner":{"login":"stxnext-kindergarten","id":5575308,"avatar_url":"https://avatars.githubusercontent.com/u/5575308?v=3","gravatar_id":"","url":"https://api.github.com/users/stxnext-kindergarten","html_url":"https://github.com/stxnext-kindergarten","followers_url":"https://api.github.com/users/stxnext-kindergarten/followers","following_url":"https://api.github.com/users/stxnext-kindergarten/following{/other_user}","gists_url":"https://api.github.com/users/stxnext-kindergarten/gists{/gist_id}","starred_url":"https://api.github.com/users/stxnext-kindergarten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stxnext-kindergarten/subscriptions","organizations_url":"https://api.github.com/users/stxnext-kindergarten/orgs","repos_url":"https://api.github.com/users/stxnext-kindergarten/repos","events_url":"https://api.github.com/users/stxnext-kindergarten/events{/privacy}","received_events_url":"https://api.github.com/users/stxnext-kindergarten/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk","description":"","fork":false,"url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk","forks_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/forks","keys_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/teams","hooks_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/hooks","issue_events_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/issues/events{/number}","events_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/events","assignees_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/assignees{/user}","branches_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/branches{/branch}","tags_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/tags","blobs_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/git/refs{/sha}","trees_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/statuses/{sha}","languages_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/languages","stargazers_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/stargazers","contributors_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/contributors","subscribers_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/subscribers","subscription_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/subscription","commits_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/commits{/sha}","git_commits_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/git/commits{/sha}","comments_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/comments{/number}","issue_comment_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/issues/comments{/number}","contents_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/contents/{+path}","compare_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/merges","archive_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/downloads","issues_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/issues{/number}","pulls_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls{/number}","milestones_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/milestones{/number}","notifications_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/labels{/name}","releases_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/releases{/id}","created_at":"2015-02-10T08:08:24Z","updated_at":"2015-03-12T13:11:00Z","pushed_at":"2015-03-12T13:11:00Z","git_url":"git://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk.git","ssh_url":"git@github.com:stxnext-kindergarten/presence-analyzer-klogaciuk.git","clone_url":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk.git","svn_url":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk","homepage":null,"size":433,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8"},"html":{"href":"https://github.com/stxnext-kindergarten/presence-analyzer-klogaciuk/pull/8"},"issue":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/issues/8"},"comments":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-klogaciuk/statuses/c86739a2eaf64df674f4e1f26f49f3b1103f2ab2"}}}}