)]}'
{"neutron/context.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"3ef13c857547dbd1bb0f5a60e2763868ff79a677","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # Log only once the context has been configured to prevent"},{"line_number":81,"context_line":"        # format errors."},{"line_number":82,"context_line":"        if kwargs:"},{"line_number":83,"context_line":"            # Log only for kwargs with a supplied value to avoid"},{"line_number":84,"context_line":"            # unnecessary log chatter."},{"line_number":85,"context_line":"            kwargs_with_value \u003d dict((x, y) for x, y in kwargs.iteritems()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BUcg%3D","line":82,"updated":"2013-11-27 12:46:24.000000000","message":"I think you can remove this. If kwargs is empty, iteritems() on 85 will end immediately creating empty dict.","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b0a3d165397cf9562719a1315c4dafbb95cb7381","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        # Log only once the context has been configured to prevent"},{"line_number":81,"context_line":"        # format errors."},{"line_number":82,"context_line":"        if kwargs:"},{"line_number":83,"context_line":"            # Log only for kwargs with a supplied value to avoid"},{"line_number":84,"context_line":"            # unnecessary log chatter."},{"line_number":85,"context_line":"            kwargs_with_value \u003d dict((x, y) for x, y in kwargs.iteritems()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BUFQ%3D","line":82,"in_reply_to":"AAAATn%2F%2BUcg%3D","updated":"2013-11-27 17:11:11.000000000","message":"Done","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"b25ccda78264f77ed26f07a2a51800fd3deb9e98","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        if kwargs:"},{"line_number":83,"context_line":"            # Log only for kwargs with a supplied value to avoid"},{"line_number":84,"context_line":"            # unnecessary log chatter."},{"line_number":85,"context_line":"            kwargs_with_value \u003d dict((x, y) for x, y in kwargs.iteritems()"},{"line_number":86,"context_line":"                                     if y is not None)"},{"line_number":87,"context_line":"            if kwargs_with_value:"},{"line_number":88,"context_line":"                LOG.debug(_(\u0027Arguments dropped when creating \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BUaw%3D","line":85,"updated":"2013-11-27 12:50:49.000000000","message":"nit: it might be better to be compatible with py3 by using items() instead of iteritems","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b0a3d165397cf9562719a1315c4dafbb95cb7381","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        if kwargs:"},{"line_number":83,"context_line":"            # Log only for kwargs with a supplied value to avoid"},{"line_number":84,"context_line":"            # unnecessary log chatter."},{"line_number":85,"context_line":"            kwargs_with_value \u003d dict((x, y) for x, y in kwargs.iteritems()"},{"line_number":86,"context_line":"                                     if y is not None)"},{"line_number":87,"context_line":"            if kwargs_with_value:"},{"line_number":88,"context_line":"                LOG.debug(_(\u0027Arguments dropped when creating \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BUTU%3D","line":85,"in_reply_to":"AAAATn%2F%2BUaw%3D","updated":"2013-11-27 17:11:11.000000000","message":"While I appreciate the interest in py3 compatibility, I would suggest that the use of iteritems() is pervasive enough that replacement should not be done at the level of individual patches.  It would ideally involve tree-wide changes combined with mechanical checks (via hacking?) to prevent reintroduction.\n\nAlso, the behavior of items() differs between py2 and py3, with the py2 version making a copy of the dict rather than returning an iterator like iteritems().  py3\u0027s items() was backported to py27 as itemvalues(), but is not available in py26.  In any case, the migration path does not appear to be obvious.\n\nReference:  the stackoverflow result for googling this (gerrit was screwing up the link when I tried to include it): python-what-is-the-difference-between-dict-items-and-dict-iteritems","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"}],"neutron/tests/unit/test_neutron_context.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"30dfafbbee273acf6f192eb8c0c73d4e210570e1","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.assertIsNone(ctx.tenant_name)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _test_neutron_context_create_logs_unknown_kwargs(self, value\u003dNone):"},{"line_number":47,"context_line":"        with mock.patch.object(context.LOG, \u0027debug\u0027) as mock_warn:"},{"line_number":48,"context_line":"            context.Context(\u0027user_id\u0027, \u0027tenant_id\u0027, foo\u003dvalue)"},{"line_number":49,"context_line":"        if value:"},{"line_number":50,"context_line":"            self.assertEqual(mock_warn.call_count, 1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BVls%3D","line":47,"updated":"2013-11-27 08:25:35.000000000","message":"nit: mock_debug now?","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b0a3d165397cf9562719a1315c4dafbb95cb7381","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.assertIsNone(ctx.tenant_name)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _test_neutron_context_create_logs_unknown_kwargs(self, value\u003dNone):"},{"line_number":47,"context_line":"        with mock.patch.object(context.LOG, \u0027debug\u0027) as mock_warn:"},{"line_number":48,"context_line":"            context.Context(\u0027user_id\u0027, \u0027tenant_id\u0027, foo\u003dvalue)"},{"line_number":49,"context_line":"        if value:"},{"line_number":50,"context_line":"            self.assertEqual(mock_warn.call_count, 1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BUFM%3D","line":47,"in_reply_to":"AAAATn%2F%2BVC4%3D","updated":"2013-11-27 17:11:11.000000000","message":"Done","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4ea8da1eeea36d35a54ea694bb2315a4372b6b95","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.assertIsNone(ctx.tenant_name)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _test_neutron_context_create_logs_unknown_kwargs(self, value\u003dNone):"},{"line_number":47,"context_line":"        with mock.patch.object(context.LOG, \u0027debug\u0027) as mock_warn:"},{"line_number":48,"context_line":"            context.Context(\u0027user_id\u0027, \u0027tenant_id\u0027, foo\u003dvalue)"},{"line_number":49,"context_line":"        if value:"},{"line_number":50,"context_line":"            self.assertEqual(mock_warn.call_count, 1)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BVC4%3D","line":47,"in_reply_to":"AAAATn%2F%2BVls%3D","updated":"2013-11-27 10:33:51.000000000","message":"yes, \n\nonly mock_warn-\u003emock_debug, everything else looks fine.","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"3ef13c857547dbd1bb0f5a60e2763868ff79a677","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _test_neutron_context_create_logs_unknown_kwargs(self, value\u003dNone):"},{"line_number":47,"context_line":"        with mock.patch.object(context.LOG, \u0027debug\u0027) as mock_warn:"},{"line_number":48,"context_line":"            context.Context(\u0027user_id\u0027, \u0027tenant_id\u0027, foo\u003dvalue)"},{"line_number":49,"context_line":"        if value:"},{"line_number":50,"context_line":"            self.assertEqual(mock_warn.call_count, 1)"},{"line_number":51,"context_line":"        else:"},{"line_number":52,"context_line":"            self.assertEqual(mock_warn.call_count, 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BUcI%3D","line":49,"updated":"2013-11-27 12:46:24.000000000","message":"value is not None: - as it\u0027s used in context.py","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"b0a3d165397cf9562719a1315c4dafbb95cb7381","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def _test_neutron_context_create_logs_unknown_kwargs(self, value\u003dNone):"},{"line_number":47,"context_line":"        with mock.patch.object(context.LOG, \u0027debug\u0027) as mock_warn:"},{"line_number":48,"context_line":"            context.Context(\u0027user_id\u0027, \u0027tenant_id\u0027, foo\u003dvalue)"},{"line_number":49,"context_line":"        if value:"},{"line_number":50,"context_line":"            self.assertEqual(mock_warn.call_count, 1)"},{"line_number":51,"context_line":"        else:"},{"line_number":52,"context_line":"            self.assertEqual(mock_warn.call_count, 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BUSU%3D","line":49,"in_reply_to":"AAAATn%2F%2BUcI%3D","updated":"2013-11-27 17:11:11.000000000","message":"My rule of thumb for using implicit boolean conversion safely is whether it is desirable to differentiate between a None value and another value that evaluates to boolean False.  In this case, the only values being tested are \u0027bar\u0027 and None so implicit conversion works.","commit_id":"fe7e8ccf7a43b310202a0d856655d334b8344bd2"}]}
