def METHOD_NAME(self, obj):
    # only run hooks on dictionaries
    if isinstance(obj, list):
        return [self.METHOD_NAME(item) for item in obj]
    if isinstance(obj, dict):
        return self.run_hooks({k: self.METHOD_NAME(v) for k, v in obj.items()})
    else:
        return obj