How to set animator cullingMode from script?

How to set animator cullingMode from script?

I figured it out.
transform.GetComponent <Animator>.cullingMode = 0; // replace 0 with a value from 0 to 4