def set(self, image_file, source=None):
image_file.set_size()  <EOL>self._set(image_file.key, image_file)<EOL>if source is not None:<EOL><INDENT>if not self.get(source):<EOL><INDENT>raise ThumbnailError('<STR_LIT>'<EOL>'<STR_LIT>' % source.name)<EOL><DEDENT>thumbnails = self._get(source.key, identity='<STR_LIT>') or []<EOL>thumbnails = set(thumbnails)<EOL>thumbnails.add(image_file.key)<EOL>self._set(source.key, list(thumbnails), identity='<STR_LIT>')<EOL><DEDENT>
Updates store for the `image_file`. Makes sure the `image_file` has a
size set.