How to perform the overall translation of a path up, down, left, and right through a Python script

How to perform the overall translation of a path up, down, left, and right through a Python script. Similar to the overall movement of glyphs.layer, the NSAffineTransform method is used

Is the following code okay:
transform = NSAffineTransform()
transform.translateXBy_yBy_(10,10)
Layer.paths[0].transform_(transform)

Yes.

Tanks very much!