{"action":"created","comment":{"url":"https://api.github.com/repos/bartvm/blocks/pulls/comments/25546591","id":25546591,"diff_hunk":"@@ -0,0 +1,303 @@\n+from collections import OrderedDict\n+from six.moves import range\n+\n+import numpy\n+\n+from theano import config, function, tensor\n+\n+from blocks.filter import VariableFilter, get_application_call\n+from blocks.graph import ComputationGraph\n+from blocks.roles import INPUT, OUTPUT\n+\n+floatX = config.floatX\n+\n+\n+class BeamSearch(object):\n+    \"\"\"Beam search.\n+\n+    N-greedy algorithm to find the most probable sequence.\n+\n+    Parameters\n+    ----------\n+    beam_size : int\n+        Size of beam.\n+    sequence_generator : :class:`BasicSequenceGenerator`\n+        Sequence generator brick.\n+    comp_graph : :class:`ComputationalGraph`\n+        Computational graph which contains `sequence_generator`.\n+\n+    See Also\n+    --------\n+    :class:`SequenceGenerator`, :class:`SequenceContentAttention`.\n+\n+    Notes\n+    -----\n+    Sequence generator should use an emitter which has `probs` method and\n+    one of its outputs is called `probs` e.g. :class:`SoftmaxEmitter`.\n+\n+    \"\"\"\n+    def __init__(self, beam_size, sequence_generator, comp_graph):\n+        self.beam_size = beam_size\n+        self.sequence_generator = sequence_generator\n+        self.generate_names = sequence_generator.generate.states\n+        self.context_names = sequence_generator.generate.contexts\n+        self.state_names = (sequence_generator.state_names +\n+                            sequence_generator.glimpse_names +\n+                            sequence_generator.glimpse_names +\n+                            ['outputs'])\n+        self.context_names = sequence_generator.context_names\n+        self.comp_graph = comp_graph\n+        self.inputs = OrderedDict(comp_graph.dict_of_inputs())\n+        self.need_input_states = []\n+        self.compiled = False\n+\n+    def compile_context_computer(self, contexts):\n+        \"\"\"Compiles `context_computer`.\"\"\"\n+        self.context_computer = function(list(self.inputs.values()),\n+                                         list(contexts.values()),\n+                                         on_unused_input='ignore')\n+\n+    def compile_initial_state_computer(self, generator, contexts):\n+        \"\"\"Compiles `initial_state_computer`.\"\"\"\n+        initial_states = []\n+        for name in self.state_names:\n+            initial_states.append(generator.initial_state(\n+                name,\n+                self.beam_size,\n+                **contexts))\n+        self.initial_state_computer = function(list(contexts.values()),\n+                                               initial_states,\n+                                               on_unused_input='ignore')\n+\n+    def compile_next_state_computer(self, generator, contexts, states,\n+                                    inner_cg):\n+        \"\"\"Compiles `next_state_computer`.\"\"\"\n+\n+        next_states = []\n+        for name in generator.generate.states:\n+            var = VariableFilter(bricks=[generator], name='^' + name + '$',\n+                                 roles=[OUTPUT])(inner_cg)[-1:]\n+            next_states.extend(var)\n+\n+        next_outputs = VariableFilter(\n+            application=generator.readout.emit,\n+            roles=[OUTPUT])(inner_cg.variables)\n+\n+        # Create theano function for next states\n+        self.next_state_computer = function(list(contexts.values()) + states +\n+                                            next_outputs, next_states)\n+\n+    def compile_costs_computer(self, generator, contexts, states, inner_cg):\n+        next_probs = VariableFilter(\n+            bricks=[generator.readout.emitter],\n+            name='^probs$')(inner_cg)[-1]\n+        logprobs = -tensor.log(next_probs)\n+\n+        self.costs_computer = function(list(contexts.values()) + states,\n+                                       logprobs,\n+                                       on_unused_input='ignore')\n+\n+    def compile(self):\n+        \"\"\"Compiles functions for beam search.\"\"\"\n+        generator = self.sequence_generator\n+\n+        application_call = get_application_call(self.comp_graph.outputs[0])\n+        inner_cg = ComputationGraph(application_call.inner_outputs)\n+        contexts = OrderedDict()\n+        for name in generator.generate.contexts:\n+            contexts[name] = VariableFilter(bricks=[generator],\n+                                            name='^' + name + '$',\n+                                            roles=[INPUT])(inner_cg)[0]\n+        states = []\n+        for name in generator.generate.states:\n+            var = VariableFilter(bricks=[generator], name='^' + name + '$',\n+                                 roles=[INPUT])(inner_cg)[-1:]\n+            if var:\n+                self.need_input_states.append(name)\n+            states.extend(var)\n+        self.compile_context_computer(contexts)\n+        self.compile_initial_state_computer(generator, contexts)\n+        self.compile_next_state_computer(generator, contexts, states, inner_cg)\n+        self.compile_costs_computer(generator, contexts, states, inner_cg)\n+\n+        self.compiled = True\n+\n+    def compute_contexts(self, inputs_dict):\n+        \"\"\"Computes contexts from inputs.\n+\n+        Wrapper around a theano function which precomputes contexts.\n+\n+        Parameters\n+        ----------\n+        inputs_dict : dict\n+            Dictionary of input arrays.\n+\n+        \"\"\"\n+        contexts = self.context_computer(*[inputs_dict[name]\n+                                           for name in self.inputs])\n+        return OrderedDict(zip(self.context_names, contexts))\n+\n+    def compute_initial_states(self, contexts):\n+        \"\"\"Computes initial outputs and states.\n+\n+        Parameters\n+        ----------\n+        contexts : dict\n+            Dictionary of contexts {name: context}.\n+\n+        \"\"\"\n+        init_states = self.initial_state_computer(*list(contexts.values()))\n+        init_states = [state.reshape((1,) + state.shape)\n+                       for state in init_states]\n+        return OrderedDict(zip(self.state_names, init_states))\n+\n+    def compute_costs(self, contexts, cur_states):\n+        \"\"\"Computes next costs.\"\"\"\n+        states = [cur_states[name][0] for name in self.need_input_states]\n+\n+        logprobs = self.costs_computer(*(list(contexts.values()) + states))\n+        return logprobs[None, :, :]\n+\n+    def compute_next_state(self, contexts, cur_states, outputs):\n+        \"\"\"Computes next states.\n+\n+        Parameters\n+        ----------\n+        contexts : dict\n+            Dictionary of contexts.\n+        cur_states : dict\n+            Dictionary of current states.\n+\n+        Returns\n+        -------\n+        Dictionary of next state and probabilities values\n+        with names as returned by `generate_outputs`.\n+\n+        \"\"\"\n+        # First timesteps only if state is needed\n+        states = [cur_states[name][0] for name in self.need_input_states]\n+\n+        next_values = self.next_state_computer(*(list(contexts.values()) +\n+                                                 states + [outputs]))\n+\n+        # Add time dimension back\n+        next_values = [state.reshape((1,) + state.shape)\n+                       for state in next_values]\n+        return OrderedDict(zip(self.generate_names, next_values))\n+\n+    @staticmethod\n+    def _top_probs(scores, beam_size, unique=False):\n+        \"\"\"Returns indexes of elements with lowest scores.\n+\n+        Parameters\n+        ----------\n+        scores : numpy array\n+            A 3d array of scores (length of sequence, batch, readout_dim).\n+        beam_size : int\n+            Beam size, number of top scores to return.\n+        unique : bool\n+            Return only unique indexes. Should be used for the first\n+            iteration of the beam search.\n+\n+        Returns\n+        -------\n+        Tuple of (indexes, top scores).\n+\n+        \"\"\"\n+        if unique:\n+            flatten = scores[:, :1, :].flatten()\n+        else:\n+            flatten = scores.flatten()\n+        args = numpy.argpartition(flatten, beam_size)[:beam_size]\n+        args = args[numpy.argsort(flatten[args])]\n+        # convert args back\n+        indexes = numpy.unravel_index(args, scores.shape[1:])\n+        return indexes, scores[0][indexes]\n+\n+    @staticmethod\n+    def _rearrange(outputs, indexes):\n+        new_outputs = outputs[:, indexes.T.flatten()]\n+        return new_outputs.copy()\n+\n+    def search(self, inputs_val_dict, eol_symbol=-1, max_length=512):\n+        \"\"\"Performs beam search.\n+\n+        If the beam search was not compiled, it also compiles it.\n+\n+        Parameters\n+        ----------\n+        inputs_val_dict : dict\n+            Dictionary of input values {name: value}. Batch size `1` is\n+            supported only.\n+        eol_symbol : int\n+            End of sequence symbol, the search stops when the\n+            symbol is generated.\n+        max_length : int\n+            Maximum sequence length, the search stops when it\n+            is reached.\n+\n+        Returns\n+        -------\n+        Sequences in the beam, masks, and corresponding probabilities.\n+\n+        \"\"\"\n+        if not self.compiled:\n+            self.compile()\n+        # Inputs repeated beam_size times\n+        inputs = OrderedDict([(name, numpy.tile(val, (1, self.beam_size)))\n+                              for name, val in inputs_val_dict.items()])\n+\n+        # Precompute contexts\n+        contexts = self.compute_contexts(inputs)\n+\n+        states = self.compute_initial_states(contexts)\n+\n+        states['cur_outputs'] = states['outputs']\n+        states['cur_outputs_mask'] = numpy.ones_like(states['cur_outputs'])\n+        states['cur_logprobs'] = numpy.zeros_like(states['cur_outputs'])\n+\n+        for i in range(max_length):\n+            logprobs = self.compute_costs(contexts, states)\n+            next_probs = (states['cur_logprobs'][:, :, None] +\n+                          logprobs *\n+                          states['cur_outputs_mask'][-1, :, None])\n+\n+            # Top probs\n+            indexes, top_probs = self._top_probs(next_probs, self.beam_size,\n+                                                 unique=i == 0)\n+            states['cur_logprobs'] = numpy.array(top_probs).T[None, :]\n+            indexes = numpy.array(indexes)  # 2, beam\n+            # here we suppose, that we have 2d outputs\n+            outputs = indexes[1, :].copy()\n+\n+            # rearrange outputs\n+            rearrange_ind = indexes[0, :]\n+            for name in states:\n+                states[name] = self._rearrange(states[name], rearrange_ind)\n+            for name in contexts:","path":"blocks/search.py","position":277,"original_position":277,"commit_id":"277c85c8337d407d76bb14277cda5919098b4a18","original_commit_id":"277c85c8337d407d76bb14277cda5919098b4a18","user":{"login":"rizar","id":654434,"avatar_url":"https://avatars.githubusercontent.com/u/654434?v=3","gravatar_id":"","url":"https://api.github.com/users/rizar","html_url":"https://github.com/rizar","followers_url":"https://api.github.com/users/rizar/followers","following_url":"https://api.github.com/users/rizar/following{/other_user}","gists_url":"https://api.github.com/users/rizar/gists{/gist_id}","starred_url":"https://api.github.com/users/rizar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rizar/subscriptions","organizations_url":"https://api.github.com/users/rizar/orgs","repos_url":"https://api.github.com/users/rizar/repos","events_url":"https://api.github.com/users/rizar/events{/privacy}","received_events_url":"https://api.github.com/users/rizar/received_events","type":"User","site_admin":false},"body":"Contexts are the same for all beam elements, so maybe we should not do this?","created_at":"2015-02-27T23:07:32Z","updated_at":"2015-02-27T23:07:32Z","html_url":"https://github.com/bartvm/blocks/pull/279#discussion_r25546591","pull_request_url":"https://api.github.com/repos/bartvm/blocks/pulls/279","_links":{"self":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/comments/25546591"},"html":{"href":"https://github.com/bartvm/blocks/pull/279#discussion_r25546591"},"pull_request":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/279"}}},"pull_request":{"url":"https://api.github.com/repos/bartvm/blocks/pulls/279","id":29280357,"html_url":"https://github.com/bartvm/blocks/pull/279","diff_url":"https://github.com/bartvm/blocks/pull/279.diff","patch_url":"https://github.com/bartvm/blocks/pull/279.patch","issue_url":"https://api.github.com/repos/bartvm/blocks/issues/279","number":279,"state":"open","locked":false,"title":"Beam search","user":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"body":"Work is still in progress.\r\n\r\n- [x] Theano functions for beam search\r\n- [x] Extract necessary inputs\r\n- [x] Search itself\r\n- [x] Multinomial probabilities in Theano for ndim > 2\r\n- [ ] Test beam search","created_at":"2015-02-13T16:58:14Z","updated_at":"2015-02-27T23:07:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef49240c9075e46abf7401853ce9f16df84c4913","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bartvm/blocks/pulls/279/commits","review_comments_url":"https://api.github.com/repos/bartvm/blocks/pulls/279/comments","review_comment_url":"https://api.github.com/repos/bartvm/blocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bartvm/blocks/issues/279/comments","statuses_url":"https://api.github.com/repos/bartvm/blocks/statuses/277c85c8337d407d76bb14277cda5919098b4a18","head":{"label":"dmitriy-serdyuk:dima","ref":"dima","sha":"277c85c8337d407d76bb14277cda5919098b4a18","user":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"repo":{"id":27456006,"name":"blocks","full_name":"dmitriy-serdyuk/blocks","owner":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmitriy-serdyuk/blocks","description":"","fork":true,"url":"https://api.github.com/repos/dmitriy-serdyuk/blocks","forks_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/forks","keys_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/teams","hooks_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/hooks","issue_events_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/events","assignees_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/tags","blobs_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/languages","stargazers_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/stargazers","contributors_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/contributors","subscribers_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/subscribers","subscription_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/subscription","commits_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/merges","archive_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/downloads","issues_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/labels{/name}","releases_url":"https://api.github.com/repos/dmitriy-serdyuk/blocks/releases{/id}","created_at":"2014-12-02T22:07:51Z","updated_at":"2015-02-12T00:04:39Z","pushed_at":"2015-02-27T22:19:04Z","git_url":"git://github.com/dmitriy-serdyuk/blocks.git","ssh_url":"git@github.com:dmitriy-serdyuk/blocks.git","clone_url":"https://github.com/dmitriy-serdyuk/blocks.git","svn_url":"https://github.com/dmitriy-serdyuk/blocks","homepage":null,"size":2926,"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":"bartvm:master","ref":"master","sha":"07590b9b953bb0505a6040c879fee57496762f63","user":{"login":"bartvm","id":2299595,"avatar_url":"https://avatars.githubusercontent.com/u/2299595?v=3","gravatar_id":"","url":"https://api.github.com/users/bartvm","html_url":"https://github.com/bartvm","followers_url":"https://api.github.com/users/bartvm/followers","following_url":"https://api.github.com/users/bartvm/following{/other_user}","gists_url":"https://api.github.com/users/bartvm/gists{/gist_id}","starred_url":"https://api.github.com/users/bartvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartvm/subscriptions","organizations_url":"https://api.github.com/users/bartvm/orgs","repos_url":"https://api.github.com/users/bartvm/repos","events_url":"https://api.github.com/users/bartvm/events{/privacy}","received_events_url":"https://api.github.com/users/bartvm/received_events","type":"User","site_admin":false},"repo":{"id":24829371,"name":"blocks","full_name":"bartvm/blocks","owner":{"login":"bartvm","id":2299595,"avatar_url":"https://avatars.githubusercontent.com/u/2299595?v=3","gravatar_id":"","url":"https://api.github.com/users/bartvm","html_url":"https://github.com/bartvm","followers_url":"https://api.github.com/users/bartvm/followers","following_url":"https://api.github.com/users/bartvm/following{/other_user}","gists_url":"https://api.github.com/users/bartvm/gists{/gist_id}","starred_url":"https://api.github.com/users/bartvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartvm/subscriptions","organizations_url":"https://api.github.com/users/bartvm/orgs","repos_url":"https://api.github.com/users/bartvm/repos","events_url":"https://api.github.com/users/bartvm/events{/privacy}","received_events_url":"https://api.github.com/users/bartvm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bartvm/blocks","description":"A Theano framework for building and training neural networks","fork":false,"url":"https://api.github.com/repos/bartvm/blocks","forks_url":"https://api.github.com/repos/bartvm/blocks/forks","keys_url":"https://api.github.com/repos/bartvm/blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bartvm/blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bartvm/blocks/teams","hooks_url":"https://api.github.com/repos/bartvm/blocks/hooks","issue_events_url":"https://api.github.com/repos/bartvm/blocks/issues/events{/number}","events_url":"https://api.github.com/repos/bartvm/blocks/events","assignees_url":"https://api.github.com/repos/bartvm/blocks/assignees{/user}","branches_url":"https://api.github.com/repos/bartvm/blocks/branches{/branch}","tags_url":"https://api.github.com/repos/bartvm/blocks/tags","blobs_url":"https://api.github.com/repos/bartvm/blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bartvm/blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bartvm/blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/bartvm/blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bartvm/blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/bartvm/blocks/languages","stargazers_url":"https://api.github.com/repos/bartvm/blocks/stargazers","contributors_url":"https://api.github.com/repos/bartvm/blocks/contributors","subscribers_url":"https://api.github.com/repos/bartvm/blocks/subscribers","subscription_url":"https://api.github.com/repos/bartvm/blocks/subscription","commits_url":"https://api.github.com/repos/bartvm/blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/bartvm/blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/bartvm/blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/bartvm/blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/bartvm/blocks/contents/{+path}","compare_url":"https://api.github.com/repos/bartvm/blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bartvm/blocks/merges","archive_url":"https://api.github.com/repos/bartvm/blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bartvm/blocks/downloads","issues_url":"https://api.github.com/repos/bartvm/blocks/issues{/number}","pulls_url":"https://api.github.com/repos/bartvm/blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/bartvm/blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/bartvm/blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bartvm/blocks/labels{/name}","releases_url":"https://api.github.com/repos/bartvm/blocks/releases{/id}","created_at":"2014-10-06T00:08:32Z","updated_at":"2015-02-27T22:43:29Z","pushed_at":"2015-02-27T22:43:29Z","git_url":"git://github.com/bartvm/blocks.git","ssh_url":"git@github.com:bartvm/blocks.git","clone_url":"https://github.com/bartvm/blocks.git","svn_url":"https://github.com/bartvm/blocks","homepage":"","size":17580,"stargazers_count":107,"watchers_count":107,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":33,"mirror_url":null,"open_issues_count":54,"forks":33,"open_issues":54,"watchers":107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/279"},"html":{"href":"https://github.com/bartvm/blocks/pull/279"},"issue":{"href":"https://api.github.com/repos/bartvm/blocks/issues/279"},"comments":{"href":"https://api.github.com/repos/bartvm/blocks/issues/279/comments"},"review_comments":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/279/comments"},"review_comment":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/279/commits"},"statuses":{"href":"https://api.github.com/repos/bartvm/blocks/statuses/277c85c8337d407d76bb14277cda5919098b4a18"}}}}