How To Add Existing Materials on Multiple Existing Objects in USD File Thru Code

What if there is around 40 - 50 objects. And I have to assign different material from the MDL Library for each objects. I will have two separate arrays with object id and material name . How to add them in a ‘for’ loop to do the process? Maybe show example of adding mdl materials to three different cubes in the usd file using a loop to retrieve each object from usd stage.