Reset Rotation , Translation and Scale of bones through Script Like we do it by using shortcuts


ALT + R to reset all rotations,
ALT + G to reset all translations,
ALT + S to reset all scales.


Is there a proper way to clear the pose through script.
Below is my code, I know how to select specific bones, but am not sure about a way to reset the rotations , translations and scales of those bones.

bpy.ops.object.mode_set(mode='POSE')
arm = bpy.data.objects['Armature']
bpy.ops.pose.select_all(action='DESELECT')

for pb in arm.pose.bones:
    if "Spine" in pb.name:
        arm.data.bones[pb.name].select = True


Thanks in Advance
You can:

import bpy
from mathutils import Vector, Quaternion

arm = bpy.data.objects['Armature']

for pb in arm.pose.bones:
    #Set the rotation to 0
    identityQuaternion = Quaternion((0, 0, 0), 1 )
    pb.rotation_quaternion = identityQuaternion
    #Set the scale to 1
    pb.scale = Vector( (1, 1, 1) )
    #Set the location at rest (edit) pose bone position
    pb.location = pb.bone.head