<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def patch_pkg_resources(cls, working_set):
 """Patch pkg_resources given a new working set."""

    pkg_resources.working_set = working_set
    pkg_resources.require = working_set.require
    pkg_resources.iter_entry_points = working_set.iter_entry_points
    pkg_resources.run_script = pkg_resources.run_main = working_set.run_script
    pkg_resources.add_activation_listener = working_set.subscribe