Python equivalent for Transaction.Rollback() | Get child elements

I there an equivalent to this C# method?

I’m trying to create a script in python that gets all elements related to a host object. One way would be to use doc.Delete() to get the elements related to the host then do a rollback.

I’ve already tried using the Transcation class as used in C# but it doesn’t work in Dynamo.

Or is there a better way to get the child elements of any host element in general?

Oh God this is embarassing. Apparently, this time, doing the Transaction worked, I have no idea why it didn’t work last time.

Anyway, don’t mind this.