<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unregister(self, obj=None):
 """ Unregisters the object from the system. If None is supplied, then all objects will be unregistered :param obj: <str> or <orb.Database> or <orb.Schema> or None """

        if obj is None:
            self.__databases.clear()
            self.__schemas.clear()
        elif isinstance(obj, orb.Schema):
            self.__schemas.pop(obj.name(), None)
        elif isinstance(obj, orb.Database):
            if obj == self.__current_db:
                self.__current_db = None
            self.__databases.pop(obj.name(), None)
        else:
            self.__current_db = None
            self.__schemas.pop(obj, None)
            self.__databases.pop(obj, None)