{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/comments/41526442","id":41526442,"diff_hunk":"@@ -0,0 +1,109 @@\n+# -*- coding: utf-8 -*-\n+from collections import namedtuple\n+from datetime import (timedelta, datetime)\n+import re\n+import logging\n+import sys\n+import json\n+import io\n+logging.basicConfig(level=logging.DEBUG)\n+logger = logging.getLogger(__name__)\n+\n+class IntervalSpec(object):\n+    slk_ts = re.compile(r'(?P<epoch>[1-9][^\\.]+).*')\n+    \n+    def __init__(self, seconds=0, minutes=0, hours=0, days=0, weeks=0, size=10):\n+        self.intv = timedelta(seconds=seconds, minutes=minutes, hours=hours, days=days, weeks=weeks)\n+        self.size = size\n+\n+    def contains(self, ts_start, msg_ts):\n+        \"\"\"\n+        Parameters\n+        start_ts : string in form EPOCH.ID start of interval\n+        msg_ts : string in form EPOCH.ID message\n+        Return\n+        boolean\n+        \"\"\"\n+        return self.in_interval(ts_to_time(ts_start), ts_to_time(msg_ts))\n+\n+    def in_interval(self, d0, d1):\n+        return d1 >= d0 and d1 <= d0 + self.intv \n+    \n+class AbstractTsSummarizer(object):","path":"ts_summarizer.py","position":32,"original_position":32,"commit_id":"dc67b6ffd7b0bbfa7656d3cbe144ac80121080f7","original_commit_id":"dc67b6ffd7b0bbfa7656d3cbe144ac80121080f7","user":{"login":"gibrown","id":820871,"avatar_url":"https://avatars.githubusercontent.com/u/820871?v=3","gravatar_id":"","url":"https://api.github.com/users/gibrown","html_url":"https://github.com/gibrown","followers_url":"https://api.github.com/users/gibrown/followers","following_url":"https://api.github.com/users/gibrown/following{/other_user}","gists_url":"https://api.github.com/users/gibrown/gists{/gist_id}","starred_url":"https://api.github.com/users/gibrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gibrown/subscriptions","organizations_url":"https://api.github.com/users/gibrown/orgs","repos_url":"https://api.github.com/users/gibrown/repos","events_url":"https://api.github.com/users/gibrown/events{/privacy}","received_events_url":"https://api.github.com/users/gibrown/received_events","type":"User","site_admin":false},"body":"Why \"Abstract\"? Looks like this is actually getting instantiated directly.\r\n","created_at":"2015-10-08T15:16:06Z","updated_at":"2015-10-08T15:16:06Z","html_url":"https://github.com/Automattic/Slack-Summary/pull/1#discussion_r41526442","pull_request_url":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/comments/41526442"},"html":{"href":"https://github.com/Automattic/Slack-Summary/pull/1#discussion_r41526442"},"pull_request":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1","id":47148851,"html_url":"https://github.com/Automattic/Slack-Summary/pull/1","diff_url":"https://github.com/Automattic/Slack-Summary/pull/1.diff","patch_url":"https://github.com/Automattic/Slack-Summary/pull/1.patch","issue_url":"https://api.github.com/repos/Automattic/Slack-Summary/issues/1","number":1,"state":"open","locked":false,"title":"Initial commit of telescoping summarizer","user":{"login":"charlescearl","id":159478,"avatar_url":"https://avatars.githubusercontent.com/u/159478?v=3","gravatar_id":"","url":"https://api.github.com/users/charlescearl","html_url":"https://github.com/charlescearl","followers_url":"https://api.github.com/users/charlescearl/followers","following_url":"https://api.github.com/users/charlescearl/following{/other_user}","gists_url":"https://api.github.com/users/charlescearl/gists{/gist_id}","starred_url":"https://api.github.com/users/charlescearl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlescearl/subscriptions","organizations_url":"https://api.github.com/users/charlescearl/orgs","repos_url":"https://api.github.com/users/charlescearl/repos","events_url":"https://api.github.com/users/charlescearl/events{/privacy}","received_events_url":"https://api.github.com/users/charlescearl/received_events","type":"User","site_admin":false},"body":"Added a simple base class. Added unit test based on the\r\n8 messages from ES. Next steps:\r\n- add gensim textrank summarizer\r\n- fold into main\r\n- tests with messages pushed to service","created_at":"2015-10-08T12:57:16Z","updated_at":"2015-10-08T15:16:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67c017795d715e451f49c4af15d6a72e87e68ec0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/Slack-Summary/issues/1/comments","statuses_url":"https://api.github.com/repos/Automattic/Slack-Summary/statuses/dc67b6ffd7b0bbfa7656d3cbe144ac80121080f7","head":{"label":"charlescearl:feature/cce-ts-summarizer-start","ref":"feature/cce-ts-summarizer-start","sha":"dc67b6ffd7b0bbfa7656d3cbe144ac80121080f7","user":{"login":"charlescearl","id":159478,"avatar_url":"https://avatars.githubusercontent.com/u/159478?v=3","gravatar_id":"","url":"https://api.github.com/users/charlescearl","html_url":"https://github.com/charlescearl","followers_url":"https://api.github.com/users/charlescearl/followers","following_url":"https://api.github.com/users/charlescearl/following{/other_user}","gists_url":"https://api.github.com/users/charlescearl/gists{/gist_id}","starred_url":"https://api.github.com/users/charlescearl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlescearl/subscriptions","organizations_url":"https://api.github.com/users/charlescearl/orgs","repos_url":"https://api.github.com/users/charlescearl/repos","events_url":"https://api.github.com/users/charlescearl/events{/privacy}","received_events_url":"https://api.github.com/users/charlescearl/received_events","type":"User","site_admin":false},"repo":{"id":43887255,"name":"Slack-Summary","full_name":"charlescearl/Slack-Summary","owner":{"login":"charlescearl","id":159478,"avatar_url":"https://avatars.githubusercontent.com/u/159478?v=3","gravatar_id":"","url":"https://api.github.com/users/charlescearl","html_url":"https://github.com/charlescearl","followers_url":"https://api.github.com/users/charlescearl/followers","following_url":"https://api.github.com/users/charlescearl/following{/other_user}","gists_url":"https://api.github.com/users/charlescearl/gists{/gist_id}","starred_url":"https://api.github.com/users/charlescearl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlescearl/subscriptions","organizations_url":"https://api.github.com/users/charlescearl/orgs","repos_url":"https://api.github.com/users/charlescearl/repos","events_url":"https://api.github.com/users/charlescearl/events{/privacy}","received_events_url":"https://api.github.com/users/charlescearl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/charlescearl/Slack-Summary","description":"","fork":true,"url":"https://api.github.com/repos/charlescearl/Slack-Summary","forks_url":"https://api.github.com/repos/charlescearl/Slack-Summary/forks","keys_url":"https://api.github.com/repos/charlescearl/Slack-Summary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/charlescearl/Slack-Summary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/charlescearl/Slack-Summary/teams","hooks_url":"https://api.github.com/repos/charlescearl/Slack-Summary/hooks","issue_events_url":"https://api.github.com/repos/charlescearl/Slack-Summary/issues/events{/number}","events_url":"https://api.github.com/repos/charlescearl/Slack-Summary/events","assignees_url":"https://api.github.com/repos/charlescearl/Slack-Summary/assignees{/user}","branches_url":"https://api.github.com/repos/charlescearl/Slack-Summary/branches{/branch}","tags_url":"https://api.github.com/repos/charlescearl/Slack-Summary/tags","blobs_url":"https://api.github.com/repos/charlescearl/Slack-Summary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/charlescearl/Slack-Summary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/charlescearl/Slack-Summary/git/refs{/sha}","trees_url":"https://api.github.com/repos/charlescearl/Slack-Summary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/charlescearl/Slack-Summary/statuses/{sha}","languages_url":"https://api.github.com/repos/charlescearl/Slack-Summary/languages","stargazers_url":"https://api.github.com/repos/charlescearl/Slack-Summary/stargazers","contributors_url":"https://api.github.com/repos/charlescearl/Slack-Summary/contributors","subscribers_url":"https://api.github.com/repos/charlescearl/Slack-Summary/subscribers","subscription_url":"https://api.github.com/repos/charlescearl/Slack-Summary/subscription","commits_url":"https://api.github.com/repos/charlescearl/Slack-Summary/commits{/sha}","git_commits_url":"https://api.github.com/repos/charlescearl/Slack-Summary/git/commits{/sha}","comments_url":"https://api.github.com/repos/charlescearl/Slack-Summary/comments{/number}","issue_comment_url":"https://api.github.com/repos/charlescearl/Slack-Summary/issues/comments{/number}","contents_url":"https://api.github.com/repos/charlescearl/Slack-Summary/contents/{+path}","compare_url":"https://api.github.com/repos/charlescearl/Slack-Summary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/charlescearl/Slack-Summary/merges","archive_url":"https://api.github.com/repos/charlescearl/Slack-Summary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/charlescearl/Slack-Summary/downloads","issues_url":"https://api.github.com/repos/charlescearl/Slack-Summary/issues{/number}","pulls_url":"https://api.github.com/repos/charlescearl/Slack-Summary/pulls{/number}","milestones_url":"https://api.github.com/repos/charlescearl/Slack-Summary/milestones{/number}","notifications_url":"https://api.github.com/repos/charlescearl/Slack-Summary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/charlescearl/Slack-Summary/labels{/name}","releases_url":"https://api.github.com/repos/charlescearl/Slack-Summary/releases{/id}","created_at":"2015-10-08T12:36:45Z","updated_at":"2015-10-08T12:36:45Z","pushed_at":"2015-10-08T14:13:40Z","git_url":"git://github.com/charlescearl/Slack-Summary.git","ssh_url":"git@github.com:charlescearl/Slack-Summary.git","clone_url":"https://github.com/charlescearl/Slack-Summary.git","svn_url":"https://github.com/charlescearl/Slack-Summary","homepage":null,"size":1011,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"9d05e5a188e8a6670f05f716afbcc4385e8690be","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":42532288,"name":"Slack-Summary","full_name":"Automattic/Slack-Summary","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/Slack-Summary","description":"","fork":true,"url":"https://api.github.com/repos/Automattic/Slack-Summary","forks_url":"https://api.github.com/repos/Automattic/Slack-Summary/forks","keys_url":"https://api.github.com/repos/Automattic/Slack-Summary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/Slack-Summary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/Slack-Summary/teams","hooks_url":"https://api.github.com/repos/Automattic/Slack-Summary/hooks","issue_events_url":"https://api.github.com/repos/Automattic/Slack-Summary/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/Slack-Summary/events","assignees_url":"https://api.github.com/repos/Automattic/Slack-Summary/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/Slack-Summary/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/Slack-Summary/tags","blobs_url":"https://api.github.com/repos/Automattic/Slack-Summary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/Slack-Summary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/Slack-Summary/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/Slack-Summary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/Slack-Summary/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/Slack-Summary/languages","stargazers_url":"https://api.github.com/repos/Automattic/Slack-Summary/stargazers","contributors_url":"https://api.github.com/repos/Automattic/Slack-Summary/contributors","subscribers_url":"https://api.github.com/repos/Automattic/Slack-Summary/subscribers","subscription_url":"https://api.github.com/repos/Automattic/Slack-Summary/subscription","commits_url":"https://api.github.com/repos/Automattic/Slack-Summary/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/Slack-Summary/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/Slack-Summary/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/Slack-Summary/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/Slack-Summary/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/Slack-Summary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/Slack-Summary/merges","archive_url":"https://api.github.com/repos/Automattic/Slack-Summary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/Slack-Summary/downloads","issues_url":"https://api.github.com/repos/Automattic/Slack-Summary/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/Slack-Summary/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/Slack-Summary/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/Slack-Summary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/Slack-Summary/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/Slack-Summary/releases{/id}","created_at":"2015-09-15T16:37:35Z","updated_at":"2015-09-29T03:07:26Z","pushed_at":"2015-10-08T12:57:17Z","git_url":"git://github.com/Automattic/Slack-Summary.git","ssh_url":"git@github.com:Automattic/Slack-Summary.git","clone_url":"https://github.com/Automattic/Slack-Summary.git","svn_url":"https://github.com/Automattic/Slack-Summary","homepage":null,"size":1052,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1"},"html":{"href":"https://github.com/Automattic/Slack-Summary/pull/1"},"issue":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/issues/1"},"comments":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/Slack-Summary/statuses/dc67b6ffd7b0bbfa7656d3cbe144ac80121080f7"}}}}