Use -- noqa: disable=TMP before the block and -- noqa: enable=TMP after. I had this same issue and after much researching this was the best I found.