Python - select all faces in a UV tile or select all associated faces by UV id



I am looking for a python function to assign a shader to all faces in a UV tile.

1> list-up all faces with a tile number -> select them all -> assign a shader
2> select all UVs in a tile -> select all faces associated with the uvs -> assign a shader

Thank you in advance.