def __getitem__(self, key):
        """
        Returns the last data value for this key, or [] if it's an empty list;
        raises KeyError if not found.
        """
        try:
            list_ = dict.__getitem__(self, key)
        except KeyError:
            raise MultiValueDictKeyError("Key %r not found in %r" % (key, self))
        try:
            return list_[-1]
        except IndexError:
            return []

        Returns the last data value for this key, or [] if it's an empty list;
        raises KeyError if not found.
        
stackoverflow/venv/lib/python3.6/site-packages/scrapy/utils/datatypes.py