STYLE enable pylint: undefined-variable
Issue #48855. This PR enables pylint warning: `undefined-variable`
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
To fix the warning I had to refactor the function `determine_clipboard()`. Hopefully, I did it the right way.