Python code for Network Interpolation