<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def select_device_by_load(wproc=0.5, wmem=0.5):
 """Set the current device for cupy as the device with the lowest weighted average of processor and memory load. """


    ids = device_by_load(wproc=wproc, wmem=wmem)
    cp.cuda.Device(ids[0]).use()
    return ids[0]