)]}'
{"nova/scheduler/host_manager.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"448c5548ab5d39f5c069551f5a9116a925883ac3","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        statmap \u003d {}"},{"line_number":232,"context_line":"        for stat in stats:"},{"line_number":233,"context_line":"            statmap[stat[\u0027key\u0027]] \u003d stat[\u0027value\u0027]"},{"line_number":234,"context_line":"        return statmap"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def passes_filters(self, filter_fns, filter_properties):"},{"line_number":237,"context_line":"        \"\"\"Return whether or not this host passes filters.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FQxw%3D","line":234,"updated":"2012-09-27 20:02:31.000000000","message":"Suggestion:\n\n    return dict((st[\u0027key\u0027], st[\u0027value\u0027]) for st in stats)\n\nThis\u0027ll work fine, though.","commit_id":"63bdee8948d049ddc221da292cb8bf137817012d"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"b6c1df58cda8497b7543f6156482b4c1ceb8cdb6","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        statmap \u003d {}"},{"line_number":232,"context_line":"        for stat in stats:"},{"line_number":233,"context_line":"            statmap[stat[\u0027key\u0027]] \u003d stat[\u0027value\u0027]"},{"line_number":234,"context_line":"        return statmap"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def passes_filters(self, filter_fns, filter_properties):"},{"line_number":237,"context_line":"        \"\"\"Return whether or not this host passes filters.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FQxM%3D","line":234,"in_reply_to":"AAAALH%2F%2FQxw%3D","updated":"2012-09-27 20:19:45.000000000","message":"Done","commit_id":"63bdee8948d049ddc221da292cb8bf137817012d"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"5c8c8d7ccfc8ae76d689c6f6f75c526c8b888c80","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        # Track number of instances by project_id"},{"line_number":199,"context_line":"        project_id \u003d instance.get(\u0027project_id\u0027)"},{"line_number":200,"context_line":"        if project_id not in self.num_instances_by_project:"},{"line_number":201,"context_line":"            self.num_instances_by_project[project_id] \u003d 0"},{"line_number":202,"context_line":"        self.num_instances_by_project[project_id] +\u003d 1"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # Track number of instances in certain vm_states"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FQtc%3D","line":201,"updated":"2012-09-27 21:22:33.000000000","message":"I\u0027ve started to use the dict method setdefault() for this kind of thing; instead of the whole if statement, this ends up reducing to:\n\n    self.num_instances_by_project.setdefault(project_id, 0)\n\nWhat you have will work fine, however, and may be a little clearer.","commit_id":"818fa7e26d9e7af0fe5716755a56f7fe2f13a890"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e23fe0f3bdcec67c1db62d56e22f0b838d81690d","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        # Track number of instances by project_id"},{"line_number":199,"context_line":"        project_id \u003d instance.get(\u0027project_id\u0027)"},{"line_number":200,"context_line":"        if project_id not in self.num_instances_by_project:"},{"line_number":201,"context_line":"            self.num_instances_by_project[project_id] \u003d 0"},{"line_number":202,"context_line":"        self.num_instances_by_project[project_id] +\u003d 1"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # Track number of instances in certain vm_states"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FQMc%3D","line":201,"in_reply_to":"AAAALH%2F%2FQNI%3D","updated":"2012-09-28 14:46:13.000000000","message":"Agreed, just thought you might like to know about that little trick :)","commit_id":"818fa7e26d9e7af0fe5716755a56f7fe2f13a890"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"8eeca1938cec9e4e72d589b4057009218ac9885e","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        # Track number of instances by project_id"},{"line_number":199,"context_line":"        project_id \u003d instance.get(\u0027project_id\u0027)"},{"line_number":200,"context_line":"        if project_id not in self.num_instances_by_project:"},{"line_number":201,"context_line":"            self.num_instances_by_project[project_id] \u003d 0"},{"line_number":202,"context_line":"        self.num_instances_by_project[project_id] +\u003d 1"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # Track number of instances in certain vm_states"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FQNI%3D","line":201,"in_reply_to":"AAAALH%2F%2FQtc%3D","updated":"2012-09-28 14:40:24.000000000","message":"That\u0027s good to know.  I think it\u0027s clear enough as it is, though.","commit_id":"818fa7e26d9e7af0fe5716755a56f7fe2f13a890"}]}
