<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def directoryRemove(self, dir_key, key):
    '''Removes directory entry `key` from directory at `dir_key`.

    If either the directory `dir_key` or the directory entry `key` don't exist,
    this method is a no-op.
    '''
    key = str(key)

    dir_items = self.get(dir_key) or []
    if key in dir_items:
      dir_items = [k for k in dir_items if k != key]
      self.put(dir_key, dir_items)