<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process_affinity(affinity=None):
 """Get or set the CPU affinity set for the current process. This will affect all future threads spawned by this process. It is implementation-defined whether it will also affect previously-spawned threads. """

    if affinity is not None:
        affinity = CPUSet(affinity)
        if not affinity.issubset(system_affinity()):
            raise ValueError("unknown cpus: %s" % affinity)
    return system_affinity()