def delete_database(self, db_instance_identifier):
        if db_instance_identifier in self.databases:
            database = self.databases.pop(db_instance_identifier)
            if database.is_replica:
                primary = self.describe_databases(database.source_db_identifier)[0]
                primary.remove_replica(database)
            return database
        else:
            raise DBInstanceNotFoundError(db_instance_identifier)
dataset/ETHPy150Open spulec/moto/moto/rds/models.py/RDSBackend.delete_database/original