{"action":"created","comment":{"url":"https://api.github.com/repos/bartvm/blocks/pulls/comments/25284073","id":25284073,"diff_hunk":"@@ -0,0 +1,266 @@\n+from collections import OrderedDict\n+from six.moves import range\n+\n+import numpy\n+\n+from theano import config\n+from theano import function\n+from theano import tensor\n+\n+from blocks.filter import VariableFilter\n+from blocks.graph import ComputationGraph\n+\n+floatX = config.floatX\n+\n+\n+def construct_dict(func):\n+    def wrapper(self, *inputs):\n+        names, outputs = func(self, *inputs)\n+        return OrderedDict(zip(names, outputs))\n+    return wrapper\n+\n+\n+class BeamSearch(object):\n+    \"\"\"Beam search.\n+\n+    Parameters\n+    ----------\n+    beam_size : int\n+        Size of beam.\n+    sequence_generator : sequence generator\n+        Sequence generator brick.\n+    attended : theano variable\n+        Theano variable for attended in sequence generator.\n+    attended_mask : theano variable\n+        Theano variable for attended mask in sequence generator.\n+    inputs_dict : dict\n+        Dictionary of inputs {name: theano variable for input}. The\n+        functions will be constructed with these inputs.\n+\n+    \"\"\"\n+    def __init__(self, beam_size, sequence_generator, attended,\n+                 attended_mask, inputs_dict):\n+        self.beam_size = beam_size\n+        self.sequence_generator = sequence_generator\n+        self.attended = attended\n+        self.attended_mask = attended_mask\n+        self.inputs_dict = inputs_dict\n+        self.generate_names = sequence_generator.generate.outputs\n+        self.init_computer = None\n+        self.next_computer = None\n+        self.attended_computer = None\n+        self.initial_state_computer = None\n+        self.state_names = (sequence_generator.state_names +\n+                            sequence_generator.glimpse_names +\n+                            ['outputs'])\n+        self.compiled = False\n+\n+    def compile(self, *args, **kwargs):\n+        \"\"\"Compiles functions for beam search.\"\"\"\n+        generator = self.sequence_generator\n+        attended = self.attended\n+        attended_mask = self.attended_mask\n+\n+        self.attended_computer = function(self.inputs_dict.values(),\n+                                          [attended, attended_mask],\n+                                          on_unused_input='ignore')\n+\n+        initial_states = OrderedDict()\n+        for name in self.state_names:\n+            initial_states[name] = generator.initial_state(\n+                name,\n+                self.beam_size,\n+                attended=attended)\n+\n+        self.initial_state_computer = function([attended, attended_mask],\n+                                               initial_states.values(),\n+                                               on_unused_input='ignore')\n+\n+        # Define inputs for next values computer\n+        cur_variables = OrderedDict()\n+        for name, value in initial_states.iteritems():\n+            cur_value = tensor.zeros_like(value)\n+            cur_value.name = name\n+            cur_variables[name] = cur_value\n+\n+        next_generated = generator.generate(attended=attended,\n+                                            attended_mask=attended_mask,\n+                                            iterate=False,\n+                                            n_steps=1,\n+                                            batch_size=self.beam_size,\n+                                            return_dict=True,\n+                                            **cur_variables)\n+        cg_step = ComputationGraph(next_generated.values())\n+        next_probs = VariableFilter(\n+            application=generator.readout.emitter.probs,\n+            name='output')(cg_step.variables)[-1]\n+        # Create theano function for next values\n+        self.next_computer = function([attended, attended_mask,\n+                                       cur_variables['states']],\n+                                      next_generated.values() + [next_probs])\n+        self.compiled = True\n+\n+    @construct_dict\n+    def compute_contexts(self, inputs_dict):\n+        contexts = self.attended_computer(*inputs_dict.values())\n+        return [\"attended\", \"attended_mask\"], contexts\n+\n+    @construct_dict\n+    def compute_initial_states(self, contexts):\n+        \"\"\"Computes initial outputs and states.\"\"\"\n+        init_states = self.initial_state_computer(*contexts.values())\n+        init_states = [state.reshape((1,) + state.shape)\n+                       for state in init_states]\n+        return self.state_names, init_states\n+\n+    @construct_dict\n+    def compute_next(self, contexts, cur_vals):\n+        \"\"\"Computes next states, glimpses, outputs, and probabilities.\n+\n+        Parameters\n+        ----------\n+        contexts : dict\n+            Dictionary of contexts divided by chunks.\n+        cur_vals : dict\n+            Dictionary of current states, glimpses, and outputs.\n+\n+        Returns\n+        -------\n+        Dictionary of next state, glimpses, output, probabilities values\n+        with names as returned by `generate_outputs`.\n+\n+        \"\"\"\n+        next_values = self.next_computer(*(contexts.values() +\n+                                           [cur_vals['states'][0]]))\n+        next_values = [state.reshape((1,) + state.shape)\n+                       for state in next_values]\n+        return self.generate_names + ['probs'], next_values\n+\n+    @classmethod\n+    def _top_probs(cls, probs, beam_size, unique=False):\n+        \"\"\"Returns indexes of elements with highest probabilities.\n+\n+        Parameters\n+        ----------\n+        probs : numpy array\n+            A 3d array of probabilities (length of sequence, batch,\n+            readout_dim)\n+        beam_size : int\n+            Beam size, number of top probs to return\n+\n+        Returns\n+        -------\n+        Tuple of (indexes, top probabilities)\n+\n+        \"\"\"\n+        flatten = probs.flatten()\n+        if unique:\n+            args = numpy.unique(\n+                numpy.argpartition(-flatten, beam_size))[:beam_size]\n+        else:\n+            args = numpy.argpartition(-flatten, beam_size)[:beam_size]\n+        args = args[numpy.argsort(-flatten[args])]\n+        if unique:\n+            # append best if needed\n+            if args.shape[0] < beam_size:\n+                args = numpy.append(\n+                    args,\n+                    numpy.tile(args[0], beam_size - args.shape[0]))\n+        # convert args back\n+        indexes = numpy.unravel_index(args, probs.shape[1:])\n+        return indexes, probs[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+        Parameters\n+        ----------\n+        inputs_val_dict : dict\n+            Dictionary of input values {name: value}. Input values may\n+            be in a batch of size greater than 1, in this case, several\n+            beam searches will be performed in parallel.\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+        Most probable sequences, corresponding probabilities and costs.\n+\n+        \"\"\"\n+        if not self.compiled:\n+            self.compile()\n+        # Inputs repeated beam_size times\n+        aux_inputs = OrderedDict(\n+            [(name, numpy.tile(val, (1, self.beam_size)))\n+             for name, val in inputs_val_dict.iteritems()])\n+\n+        # Precompute contexts\n+        contexts = self.compute_contexts(aux_inputs)\n+\n+        cur_states = self.compute_initial_states(contexts)\n+\n+        cur_states['cur_outputs'] = cur_states['outputs']\n+        cur_states['cur_outputs_mask'] = numpy.ones_like(\n+            cur_states['cur_outputs'])\n+        cur_states['cur_probs'] = numpy.ones_like(\n+            cur_states['cur_outputs'])\n+\n+        for i in range(max_length):\n+            cur_states.update(self.compute_next(contexts, cur_states))\n+            next_probs = (cur_states['cur_probs'][:, :, None] *\n+                          cur_states['probs'] *\n+                          cur_states['cur_outputs_mask'][-1, :, None])\n+\n+            # Top probs\n+            indexes, top_probs = self._top_probs(next_probs[:, :],\n+                                                 self.beam_size,\n+                                                 unique=i == 0)\n+            cur_states['cur_probs'] = numpy.array(top_probs).T[None, :]\n+            indexes = numpy.array(indexes)  # chunk, 2, beam\n+            # current_outputs.\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 cur_states:\n+                cur_states[name] = self._rearrange(cur_states[name],\n+                                                   rearrange_ind)\n+            for name in contexts:\n+                contexts[name] = self._rearrange(contexts[name],\n+                                                 rearrange_ind)\n+\n+            # construct next output\n+            outputs = outputs[None, :]\n+            cur_states['cur_outputs'] = numpy.append(cur_states['cur_outputs'],\n+                                                     outputs.copy(), axis=0)\n+            # check if we meet eol\n+            next_out_mask = numpy.ones((1, self.beam_size),\n+                                       dtype=floatX)\n+\n+            next_out_mask[0, :] = ((outputs[0, :] != eol_symbol) *\n+                                   cur_states['cur_outputs_mask'][-1, :])\n+            cur_states['cur_outputs_mask'] = numpy.append(\n+                cur_states['cur_outputs_mask'],\n+                next_out_mask.copy(),\n+                axis=0)\n+\n+            # All first element in sequences ended\n+            if numpy.all(cur_states['cur_outputs'][-1, 0] == eol_symbol):\n+                break\n+\n+        # Select only best\n+        best_outputs = cur_states['cur_outputs'][1:, 0]","path":"blocks/search.py","position":262,"original_position":262,"commit_id":"9458a115adc982364717091e35987b077f2a30c5","original_commit_id":"9458a115adc982364717091e35987b077f2a30c5","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":"Anyway, I need this mask in order to compute the whole batch on GPU. I can't change the batch size in the middle of computation.","created_at":"2015-02-24T19:34:06Z","updated_at":"2015-02-24T19:34:06Z","html_url":"https://github.com/bartvm/blocks/pull/279#discussion_r25284073","pull_request_url":"https://api.github.com/repos/bartvm/blocks/pulls/279","_links":{"self":{"href":"https://api.github.com/repos/bartvm/blocks/pulls/comments/25284073"},"html":{"href":"https://github.com/bartvm/blocks/pull/279#discussion_r25284073"},"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-24T19:34:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74fd258df95e8c762fec9d9e5bc9fb0c2e50337c","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/9458a115adc982364717091e35987b077f2a30c5","head":{"label":"dmitriy-serdyuk:dima","ref":"dima","sha":"9458a115adc982364717091e35987b077f2a30c5","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-24T17:19:22Z","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":2638,"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":"76d440267759cf2289df14b23b575fc9765ef736","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-24T19:13:35Z","pushed_at":"2015-02-24T19:13:35Z","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":17016,"stargazers_count":104,"watchers_count":104,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":29,"mirror_url":null,"open_issues_count":56,"forks":29,"open_issues":56,"watchers":104,"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/9458a115adc982364717091e35987b077f2a30c5"}}}}