<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def device_by_load(wproc=0.5, wmem=0.5):
 """Get a list of GPU device ids ordered by increasing weighted average of processor and memory load. """


    gl = gpu_load(wproc=wproc, wmem=wmem)
    # return np.argsort(np.asarray(gl)[:, -1]).tolist()
    return [idx for idx, load in sorted(enumerate(
        [g.weighted for g in gl]), key=(lambda x: x[1]))]