How far is it recommended for pipework to be from electrical sockets and switches?
There are no residential codes around pipework and electric distance other than they cannot support each other (touch).  Electric live wires are enclosed.  Pipework is enclosed.  They can be basically as close as you want them to be without them touching.