def unsubscribe(self, stream, transform="<STR_LIT>"):
if self.status is not "<STR_LIT>":<EOL><INDENT>return False<EOL><DEDENT>logging.debug("<STR_LIT>", stream)<EOL>self.send(<EOL>{"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": stream,<EOL>"<STR_LIT>": transform})<EOL>self.subscription_lock.acquire()<EOL>del self.subscriptions[stream + "<STR_LIT::>" + transform]<EOL>if len(self.subscriptions) is <NUM_LIT:0>:<EOL><INDENT>self.subscription_lock.release()<EOL>self.disconnect()<EOL><DEDENT>else:<EOL><INDENT>self.subscription_lock.release()<EOL><DEDENT>
Unsubscribe from the given stream (with the optional transform)