)]}'
{"monascastatsd/connection.py":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"b6377554e543569a8585a72c23a9e2290d77cd4a","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        \"\"\""},{"line_number":43,"context_line":"        self.max_buffer_size \u003d max_buffer_size"},{"line_number":44,"context_line":"        self._send \u003d self._send_to_server"},{"line_number":45,"context_line":"        self.socket \u003d socket.socket(socket.AF_INET, socket.SOCK_DGRAM)"},{"line_number":46,"context_line":"        self.connect(host, port)"},{"line_number":47,"context_line":"        self.encoding \u003d \u0027utf-8\u0027"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_120849d9","line":45,"updated":"2016-08-24 06:48:44.000000000","message":"Is there any particular reason why you moved that up here ?\nI think that\u0027s pretty fine that it was next to the actual connection.","commit_id":"4f9291f6d0b8cc1a1bc5551a41248d6f940cf8f6"},{"author":{"_account_id":20873,"name":"Laszlo Hegedus","email":"hegedues.laszlo@gmail.com","username":"laszloh"},"change_message_id":"daa015b17170763bcd28745ea0c503083d9a89a5","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        \"\"\""},{"line_number":43,"context_line":"        self.max_buffer_size \u003d max_buffer_size"},{"line_number":44,"context_line":"        self._send \u003d self._send_to_server"},{"line_number":45,"context_line":"        self.socket \u003d socket.socket(socket.AF_INET, socket.SOCK_DGRAM)"},{"line_number":46,"context_line":"        self.connect(host, port)"},{"line_number":47,"context_line":"        self.encoding \u003d \u0027utf-8\u0027"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_2d59a835","line":45,"in_reply_to":"1ac06dbe_120849d9","updated":"2016-08-24 07:07:27.000000000","message":"This way it does not have to be initialized to None. And self.socket is used in _send_to_server, so I\u0027d try to make it independent of connect.","commit_id":"4f9291f6d0b8cc1a1bc5551a41248d6f940cf8f6"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"c87d3bb7f72d7c590852cd4c1a05946940ca4c80","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        \"\"\""},{"line_number":43,"context_line":"        self.max_buffer_size \u003d max_buffer_size"},{"line_number":44,"context_line":"        self._send \u003d self._send_to_server"},{"line_number":45,"context_line":"        self.socket \u003d socket.socket(socket.AF_INET, socket.SOCK_DGRAM)"},{"line_number":46,"context_line":"        self.connect(host, port)"},{"line_number":47,"context_line":"        self.encoding \u003d \u0027utf-8\u0027"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_7b45fab1","line":45,"in_reply_to":"1ac06dbe_2d59a835","updated":"2016-08-24 14:54:24.000000000","message":"One would argue that field definitions should be done in __init__, but I guess that rather own preference, though PyCharm likes to complain about that in certain cases ;-)","commit_id":"4f9291f6d0b8cc1a1bc5551a41248d6f940cf8f6"},{"author":{"_account_id":20873,"name":"Laszlo Hegedus","email":"hegedues.laszlo@gmail.com","username":"laszloh"},"change_message_id":"da0b4ffb1c74be19740eb1b84a8a4c487e3c3ca0","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        \"\"\""},{"line_number":43,"context_line":"        self.max_buffer_size \u003d max_buffer_size"},{"line_number":44,"context_line":"        self._send \u003d self._send_to_server"},{"line_number":45,"context_line":"        self.socket \u003d socket.socket(socket.AF_INET, socket.SOCK_DGRAM)"},{"line_number":46,"context_line":"        self.connect(host, port)"},{"line_number":47,"context_line":"        self.encoding \u003d \u0027utf-8\u0027"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_a402aeb2","line":45,"in_reply_to":"1ac06dbe_7b45fab1","updated":"2016-08-24 16:41:52.000000000","message":"Yeah, PyCharm complains sometimes. :) I don\u0027t always follow it strictly. But I usually don\u0027t use None if a value can be computed instead.","commit_id":"4f9291f6d0b8cc1a1bc5551a41248d6f940cf8f6"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"0c29f739b39871cb3f0ac98cce9d733bfab8719c","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        \"\"\""},{"line_number":81,"context_line":"        if sample_rate \u003d\u003d 1 or random.random() \u003c\u003d sample_rate:"},{"line_number":82,"context_line":"            self._send_encoded_payload(dimensions, metric, metric_type,"},{"line_number":83,"context_line":"                                       sample_rate, value)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _send_encoded_payload(self, dimensions, metric, metric_type,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_bb0f5b2d","line":82,"updated":"2016-08-24 20:43:49.000000000","message":"Just a nit: Basically I remember that it should be written like two arguments per row, so sth like:\n\n self._send_encoded_payload(dimensions, metric,\n                            metric_type, sample_rate,\n                            value)\n\nBut, maybe I am mistaken so don\u0027t take it on faith ;).","commit_id":"4f9291f6d0b8cc1a1bc5551a41248d6f940cf8f6"},{"author":{"_account_id":20873,"name":"Laszlo Hegedus","email":"hegedues.laszlo@gmail.com","username":"laszloh"},"change_message_id":"7355cea38925644a2714c2bfbeb39f37440aad2f","unresolved":false,"context_lines":[{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        \"\"\""},{"line_number":81,"context_line":"        if sample_rate \u003d\u003d 1 or random.random() \u003c\u003d sample_rate:"},{"line_number":82,"context_line":"            self._send_encoded_payload(dimensions, metric, metric_type,"},{"line_number":83,"context_line":"                                       sample_rate, value)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _send_encoded_payload(self, dimensions, metric, metric_type,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_270337ba","line":82,"in_reply_to":"1ac06dbe_bb0f5b2d","updated":"2016-08-25 07:06:00.000000000","message":"You may be right. I haven\u0027t found any specific recommendation about that, but the first and the third examples here are written like that:\n\nhttps://www.python.org/dev/peps/pep-0008/#indentation\n\nThe recommendation in the hacking doc is to write one parameter per line, although it is not a requirement:\n\nhttp://docs.openstack.org/developer/hacking/#calling-methods\n\n\nI wouldn\u0027t like to build towers, so I\u0027ll stick to two per line which looks neater.","commit_id":"4f9291f6d0b8cc1a1bc5551a41248d6f940cf8f6"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"dd554c785c38f3c485b410e5fc203238dbdb09e4","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self._send(encoded)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _create_encoded_payload(self, dimensions, metric, metric_type,"},{"line_number":96,"context_line":"                                sample_rate, value):"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        payload \u003d self._create_payload(dimensions, metric,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa7ab95a_ff43f410","line":95,"updated":"2016-08-29 21:24:41.000000000","message":"I am not exactly sure if need to have this method.\nFrom my POV it would be sufficient to just have _create_payload which actually makes code easier to understand and encode payload there.","commit_id":"e9bb28bd283ec5c0ae7b9bdf29bb4bc63087d695"},{"author":{"_account_id":20873,"name":"Laszlo Hegedus","email":"hegedues.laszlo@gmail.com","username":"laszloh"},"change_message_id":"aa27d29d955644f371c6344a08721f3bb707679b","unresolved":false,"context_lines":[{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self._send(encoded)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def _create_encoded_payload(self, dimensions, metric, metric_type,"},{"line_number":96,"context_line":"                                sample_rate, value):"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"        payload \u003d self._create_payload(dimensions, metric,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa7ab95a_8da8f021","line":95,"in_reply_to":"fa7ab95a_ff43f410","updated":"2016-08-30 05:56:46.000000000","message":"That\u0027s true. Encode does not do much, so we can just put it into _create_payload.","commit_id":"e9bb28bd283ec5c0ae7b9bdf29bb4bc63087d695"}]}
