How to label all floor prims with the 'floor' label using Python code?

In Python code, I want to assign a semantic label “floor” to all floor prims. Is there any good way to achieve this?

check this https://github.com/eliabntt/GRADE-RR/blob/064c1b888727c6faa191f88519184dc272a8b950/simulator/utils/misc_utils.py#L46