Assign all roles of another user to new user using python

Hello, anyone here who have an idea how I can assign the roles of another user to a newly created user?

I have this script with me.
#Get the reference user roles
GET /api/v1/users/{reference_user}/roles

#Assign the roles to newly created user
POST /api/v1/users/{user_id}/roles
Body = type: {{role_type}

However, the reference user has multiple admin roles that I need to assign to the new user. How can I get all the Json result from list of roles of reference user and assign it to the new user? Is there a way to do it?

Thanks

Hello,

The Roles API can be used to retrieve/add/delete administrative roles for a user.

Thank You