nodes: 0, module; 1, function_definition; 2, function_name:modify; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, expression_statement; 12, identifier:sort; 13, None; 14, identifier:purge; 15, False; 16, identifier:done; 17, None; 18, identifier:undone; 19, None; 20, comment:"""Handles the 'm' command.
  
          :sort: Sort pattern.
          :purge: Whether to purge items marked as 'done'.
          :done: Done pattern.
          :undone: Not done pattern.
  
          """; 21, call; 22, attribute; 23, argument_list; 24, attribute; 25, identifier:modifyInPlace; 26, keyword_argument; 27, keyword_argument; 28, keyword_argument; 29, identifier:self; 30, identifier:model; 31, identifier:sort; 32, call; 33, identifier:purge; 34, identifier:purge; 35, identifier:done; 36, call; 37, attribute; 38, argument_list; 39, attribute; 40, argument_list; 41, identifier:self; 42, identifier:_getPattern; 43, identifier:sort; 44, identifier:self; 45, identifier:_getDone; 46, identifier:done; 47, identifier:undone
code: def modify(self, sort=None, purge=False, done=None, undone=None):
          """Handles the 'm' command.
  
          :sort: Sort pattern.
          :purge: Whether to purge items marked as 'done'.
          :done: Done pattern.
          :undone: Not done pattern.
  
          """
          self.model.modifyInPlace(
              sort=self._getPattern(sort),
              purge=purge,
              done=self._getDone(done, undone)
          )