code: def parent(self):
      '''Returns the parent Key (all namespaces except the last).
  
          >>> Key('/Comedy/MontyPython/Actor:JohnCleese').parent
          Key('/Comedy/MontyPython')
  
      '''
      if '/' in self._string:
        return Key(self.list[:-1])
      raise ValueError('%s is base key (it has no parent)' % repr(self)f parent(self):
      '''Returns the parent Key (all namespaces except the last).
  
          >>> Key('/Comedy/MontyPython/Actor:JohnCleese').parent
          Key('/Comedy/MontyPython')
  
      '''
      if '/' in self._string:
        return Key(self.list[:-1])
      raise ValueError('%s is base key (it has no parent)' % repr(self))
docs: Returns the parent Key (all namespaces except the last).
  
          >>> Key('/Comedy/MontyPython/Actor:JohnCleese').parent
          Key('/Comedy/MontyPython')