Custom transform with python

has anyone implement custom transform with python (assuming it is supported by the platform) instead of javascript. I know Type System supported Javascript, Python, and R.
I am assuming that we can implement some thing like:
type TransformCaninicalTypeToTargetType mixes TargetType transforms CanonicalType {
transform: function(canonical: CanonicalType): TargetType py server

I haven’t personally done this, but yes it should be possible.