Results Export with Python : Check if an element exists

Hello everyone, 

How can we check if a group of plates exists in a phase while exporting results with python ? in order to avoid getting error message when plates are not activated in a certain phase

Thanks.