Why is my Python code not updating the labels of PRs in Github as intended?

the code you provided above seems incomplete