#NEWLINE# def remove( self , cmd ) : #NEWLINE# #INDENT# '\n        Remove a command instance from the cmdset.\n\n        Args:\n            cmd (Command or str): Either the Command object to remove\n                or the key of such a command.\n\n        ' #NEWLINE# cmd = self . _instantiate ( cmd ) #NEWLINE# if cmd . key . startswith ( '__' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ic = self . system_commands . index ( cmd ) #NEWLINE# del self . system_commands [ ic ] #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . commands = [ oldcmd for oldcmd in self . commands if ( oldcmd != cmd ) ]