Setting requirement allocations with P4C

Has anyone created a function to add requirement allocations through p4c? I see there is a get function for getting incoming and outgoing allocations and confused on how I can set more to requirements via python.

Also looking for the same for attributes since the set_attribute in requirement class is set to status: KO