PR #5031: udf_utils: fix python path modification
PR #5031: udf_utils: fix python path modification

Please approve this CL. It will be submitted automatically, and its GitHub pull request will be marked as merged.

Imported from GitHub PR #5031

This should fix an issue where in some cases `sys.path` and (especially) `$PYTHONPATH` is not correctly restored after being temporarily modified. This was the cause of problems in subsequent code (e.g. wrong module order, etc.).

Copybara import of the project:

  - 96ebe6d318d7c064bdd0059b74565e722b0e1faa udf_utils: fix python path modification by japm48 <japm48gh@gmail.com>
  - d96ff7eb4957acfde003f82e249aec7afe221a86 udf_utils: pylint fixes by japm48 <japm48gh@gmail.com>
  - 416c52041b3a8b40787788c5622aa25c72d3f1b2 Merge d96ff7eb4957acfde003f82e249aec7afe221a86 into 14c15... by japm48 <japm48gh@gmail.com>

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tfx/pull/5031 from japm48:patch-1 d96ff7eb4957acfde003f82e249aec7afe221a86
PiperOrigin-RevId: 480229518

tensorflow/tfx,tensorflow/tfx