How can I change shape key DriverTarget by bpy?(Solved)

I happend to need to make script which can re-target mesh shape keys driver.
I could find some infomation but I still not see stable clear work-flow so hope if someone can help me,

  1. I have mesh object with some shape keys. then shape keys values are driven by armatureA object properties and bone rotation.

  2. When I append the mesh object to another blend scene armature, and attach mesh for the armatureB with armature modifier,. it can pose without problem, (2 armature have same bones) but those shape keys driver not work any-more because rig ID change.

  3. all shape keys still keep driver (but target rig changed), then I only need to change DriverTarget ID from Armature A to Armature B.

then how I can change the DriverTarget from “ArmatureA” to “ArmatureB”
for[“key1”] ?

I know to access driver,
I need to use mesh.shape_keys.animation_data

But how I can access driver of specific shape-key with the labell name like “key1” “key2” etc?

OK I could manage this.
with make custom function. But I do not know why there is no way to access shape key driver with shape key name, more directly… (so shape key driver is for shape key value,then it seems better to access with shape key name… I feel,

def get_driver(mesh, name):
drvs = mesh.shape_keys.animation_data.drivers
drv = False
for tdrv in drvs:
    if tdrv.data_path[12: -8] == name:
        drv = tdrv
        return drv