Removed spurious self keyword
Moved patch extraction to utils
Fixed for np random and neighbors class