code: def replace(self, key, value):
          
          if key in self._inner().keys():
              return self.__setitem__(key, value)
          parents_searched = [self]
          parent = self._parent_context
          while parent:
              try:
                  if key in parent.keys():
                      return parent.__setitem__(key, value)
              except (KeyError, AttributeError):
                  pass
              parents_searched.append(parent)
              # noinspection PyProtectedMember
              next_parent = parent._parent_context
              if next_parent in parents_searched:
                  raise RuntimeError("Recursive ContextDict found!")
              parent = next_parent
          return self.__setitem__(key, value)
docs: If this ContextDict doesn't already have this key, it sets
          the value on a parent ContextDict if that parent has the key,
          otherwise sets the value on this ContextDict.
          :param key:
          :param value:
          :return: Nothing
          :rtype: None