BPY - How to set Bone Parent? I have a bone called 'Hips', i want to set it's parent to bone 'Root', how can i do this?

these are some codes i've tried but didn't work

bpy.context.object.data.parent = C.object.data.edit_bones['Root']
i tried to select Hips bone then run this code to set the selected bone's parent to Root, but it gave this error IndentationError: unexpected indent

i also tried this code bpy.context.object.data.parent = bpy.data.armatures["Armature"].["Root"]
no wonder it didn't work either.

i'm using Blender 2.82
Here's what I used, the following two lines of code did the job:

arm = bpy.data.objects['Armature']
arm.data.edit_bones['boneName'].parent = arm.data.edit_bones['parentBone']