code: def parent(self, key):
          
          parent_key = '.'.join(key.split('.')[:-1])
          if not parent_key:
              return None
          else:
              return self[parent_key]
docs: when given a key of the form X.Y.Z, this method will return the
          parent DotDict of the 'Z' key.