def deletefrom_collection(self, collection, payload):
ident = payload["<STR_LIT:key>"]<EOL>modified = payload["<STR_LIT:version>"]<EOL>modified_collections = [<EOL>c for c in payload["<STR_LIT:data>"]["<STR_LIT>"] if c != collection<EOL>]<EOL>headers = {"<STR_LIT>": str(modified)}<EOL>headers.update(self.default_headers())<EOL>req = requests.patch(<EOL>url=self.endpoint<EOL>+ "<STR_LIT>".format(<EOL>t=self.library_type, u=self.library_id, i=ident<EOL>),<EOL>data=json.dumps({"<STR_LIT>": modified_collections}),<EOL>headers=headers,<EOL>)<EOL>self.request = req<EOL>try:<EOL><INDENT>req.raise_for_status()<EOL><DEDENT>except requests.exceptions.HTTPError:<EOL><INDENT>error_handler(req)<EOL><DEDENT>return True<EOL>
Delete an item from a collection
Accepts two arguments:
The collection ID, and and an item dict