`norm` is imported from `numpy.linalg` in line 15, `inv` should be imported similarly, or get rid of line 15 and use the full numpy path for `norm`.