Python doesn't have multiline lambdas, so there is no way to create an api similar to rake's:
task :name do |t|
# do stuff
end
I'm not sure what's the closest equivalent syntax you could create in python.