)]}'
{"sushy/resources/base.py":[{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4fbe98f2ae14e1bab34c20689bdaf0d3c7d638e6","unresolved":false,"context_lines":[{"line_number":259,"context_line":""},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"class MappedListField(MappedField):"},{"line_number":262,"context_line":"    \"\"\"Field taking a list of values with a mapping for the values\"\"\""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":265,"context_line":"        super(MappedListField, self).__init__(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_56470bbd","line":262,"range":{"start_line":262,"start_character":0,"end_line":262,"end_character":69},"updated":"2019-07-18 08:38:28.000000000","message":"I just realized that having a JSON or Python example of such a structure would be of great relief to the reader. I am not sure I totally wrapped my head around this yet. Will go make some coffee perhaps.","commit_id":"369da44f6a4b08d2501b6ee51cd9d4324b74ac69"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4fbe98f2ae14e1bab34c20689bdaf0d3c7d638e6","unresolved":false,"context_lines":[{"line_number":261,"context_line":"class MappedListField(MappedField):"},{"line_number":262,"context_line":"    \"\"\"Field taking a list of values with a mapping for the values\"\"\""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":265,"context_line":"        super(MappedListField, self).__init__(*args, **kwargs)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"    def _load(self, body, resource, nested_in\u003dNone):"},{"line_number":268,"context_line":"        \"\"\"Load the mapped list."}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_d60c5b95","line":265,"range":{"start_line":264,"start_character":4,"end_line":265,"end_character":62},"updated":"2019-07-18 08:38:28.000000000","message":"Do we need to override __init__ if we are not changing anything along the way?","commit_id":"369da44f6a4b08d2501b6ee51cd9d4324b74ac69"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4fbe98f2ae14e1bab34c20689bdaf0d3c7d638e6","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        \"\"\""},{"line_number":275,"context_line":"        nested_in \u003d (nested_in or []) + self._path"},{"line_number":276,"context_line":"        mapping_adapter \u003d self._adapter"},{"line_number":277,"context_line":"        # changing adapter so that list from the json body can pe parsed as is"},{"line_number":278,"context_line":"        self._adapter \u003d lambda x: x"},{"line_number":279,"context_line":"        values \u003d super(MappedListField, self)._load(body, resource)"},{"line_number":280,"context_line":"        self._adapter \u003d mapping_adapter  # restoring the adapter for refresh"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_d681bbc4","line":277,"range":{"start_line":277,"start_character":0,"end_line":277,"end_character":78},"updated":"2019-07-18 08:38:28.000000000","message":"Oh, feels like a design flaw...\n\nMay be we could store our adapter in some other attribute (local to this class), but leave subclass\u0027s adapter attribute to default? That\u0027s all in __init__.","commit_id":"369da44f6a4b08d2501b6ee51cd9d4324b74ac69"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4fbe98f2ae14e1bab34c20689bdaf0d3c7d638e6","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        self._adapter \u003d mapping_adapter  # restoring the adapter for refresh"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        if values is None:"},{"line_number":283,"context_line":"            return None"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        # Initialize the list that will contain each mapped instance"},{"line_number":286,"context_line":"        instances \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_36684f1b","line":283,"range":{"start_line":283,"start_character":19,"end_line":283,"end_character":23},"updated":"2019-07-18 08:38:28.000000000","message":"nit: snip","commit_id":"369da44f6a4b08d2501b6ee51cd9d4324b74ac69"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4fbe98f2ae14e1bab34c20689bdaf0d3c7d638e6","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            return None"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        # Initialize the list that will contain each mapped instance"},{"line_number":286,"context_line":"        instances \u003d []"},{"line_number":287,"context_line":"        for value in values:"},{"line_number":288,"context_line":"            instance \u003d self._adapter(value)"},{"line_number":289,"context_line":"            if instance is not None:"},{"line_number":290,"context_line":"                instances.append(instance)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"        return instances"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_f65dd778","line":292,"range":{"start_line":286,"start_character":8,"end_line":292,"end_character":24},"updated":"2019-07-18 08:38:28.000000000","message":"Would this look even better as a list comprehension?","commit_id":"369da44f6a4b08d2501b6ee51cd9d4324b74ac69"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"94ef607f389d040f45f5e2b5b4fcddbbda53c5f1","unresolved":false,"context_lines":[{"line_number":267,"context_line":"    \"\"\""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    def __init__(self, field, mapping, required\u003dFalse, default\u003dNone):"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        if not isinstance(mapping, collectionsAbc.Mapping):"},{"line_number":272,"context_line":"            raise TypeError(\"The mapping argument must be a mapping\")"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_21b66edb","line":270,"updated":"2019-07-24 13:35:36.000000000","message":"would be nice to have a docstring here","commit_id":"46e883957afa3a1c0cc41206517dc7d05a0f25d4"},{"author":{"_account_id":30013,"name":"Varsha Verma","email":"varsha.verma.eee15@itbhu.ac.in","username":"verma-varsha"},"change_message_id":"2b2b83f79c57f7938fe273a3ca7473c60b10a934","unresolved":false,"context_lines":[{"line_number":267,"context_line":"    \"\"\""},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    def __init__(self, field, mapping, required\u003dFalse, default\u003dNone):"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        if not isinstance(mapping, collectionsAbc.Mapping):"},{"line_number":272,"context_line":"            raise TypeError(\"The mapping argument must be a mapping\")"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_ffea2eaa","line":270,"in_reply_to":"7faddb67_21b66edb","updated":"2019-07-24 16:52:15.000000000","message":"Done","commit_id":"46e883957afa3a1c0cc41206517dc7d05a0f25d4"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"94ef607f389d040f45f5e2b5b4fcddbbda53c5f1","unresolved":false,"context_lines":[{"line_number":441,"context_line":"        # resource is \"_not_ stale\" (i.e. fresh) OR _not_ forced."},{"line_number":442,"context_line":"        if not self._is_stale and not force:"},{"line_number":443,"context_line":"            return"},{"line_number":444,"context_line":"        self._json \u003d self._reader.get_json()"},{"line_number":445,"context_line":""},{"line_number":446,"context_line":"        LOG.debug(\u0027Received representation of %(type)s %(path)s: %(json)s\u0027,"},{"line_number":447,"context_line":"                  {\u0027type\u0027: self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_6150e633","line":444,"updated":"2019-07-24 13:35:36.000000000","message":"I would actually leave the blank line above","commit_id":"46e883957afa3a1c0cc41206517dc7d05a0f25d4"},{"author":{"_account_id":30013,"name":"Varsha Verma","email":"varsha.verma.eee15@itbhu.ac.in","username":"verma-varsha"},"change_message_id":"2b2b83f79c57f7938fe273a3ca7473c60b10a934","unresolved":false,"context_lines":[{"line_number":441,"context_line":"        # resource is \"_not_ stale\" (i.e. fresh) OR _not_ forced."},{"line_number":442,"context_line":"        if not self._is_stale and not force:"},{"line_number":443,"context_line":"            return"},{"line_number":444,"context_line":"        self._json \u003d self._reader.get_json()"},{"line_number":445,"context_line":""},{"line_number":446,"context_line":"        LOG.debug(\u0027Received representation of %(type)s %(path)s: %(json)s\u0027,"},{"line_number":447,"context_line":"                  {\u0027type\u0027: self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_5fd90220","line":444,"in_reply_to":"7faddb67_6150e633","updated":"2019-07-24 16:52:15.000000000","message":"Done","commit_id":"46e883957afa3a1c0cc41206517dc7d05a0f25d4"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"1a4cb0d351f3e1f136490ea0df8cca359a305f56","unresolved":false,"context_lines":[{"line_number":261,"context_line":"class MappedListField(Field):"},{"line_number":262,"context_line":"    \"\"\"Field taking a list of values with a mapping for the values"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    For instance, the field in json will look like [\u0027AHCI\u0027, \u0027PCIe\u0027, \u0027FTP\u0027]"},{"line_number":265,"context_line":"    where each of the list elements will be mapped to their values using the"},{"line_number":266,"context_line":"    mapping provided."},{"line_number":267,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"7faddb67_176cc634","line":264,"range":{"start_line":264,"start_character":0,"end_line":264,"end_character":74},"updated":"2019-07-25 10:51:26.000000000","message":"Yeah, I am thinking of something like \"given this, the outcome is this\":\n\nGiven JSON {\u0027field\u0027: [\u0027xxx\u0027, \u0027yyy\u0027]} and sushy resource definition ..., sushy object to come out will be like resource.field \u003d [\u0027xxx\u0027, \u0027yyy\u0027].\n\nTo me, such notes would be great to hav everywhere. But may be it\u0027s just me having troubles wrapping my head around sushy mappings. So feel free to ignore that then. ;)","commit_id":"1bee5802d2b91fce0408cf79a7f561b2f2542d46"}]}
