FIX: some more casts in ufunc_object
FIX: some more casts in ufunc_object

Introduced a helper function to get rid of repetitive code.

CMartelLML/numpy,pbrod/numpy,nbeaver/numpy,endolith/numpy,ajdawson/numpy,ddasilva/numpy,GrimDerp/numpy,pizzathief/numpy,mortada/numpy,cjermain/numpy,bringingheavendown/numpy,rudimeier/numpy,ESSS/numpy,ViralLeadership/numpy,pyparallel/numpy,anntzer/numpy,leifdenby/numpy,sigma-random/numpy,KaelChen/numpy,shoyer/numpy,stuarteberg/numpy,githubmlai/numpy,Yusa95/numpy,AustereCuriosity/numpy,jschueller/numpy,ekalosak/numpy,rmcgibbo/numpy,musically-ut/numpy,BMJHayward/numpy,kirillzhuravlev/numpy,chatcannon/numpy,skymanaditya1/numpy,bertrand-l/numpy,Eric89GXL/numpy,pbrod/numpy,abalkin/numpy,abalkin/numpy,ogrisel/numpy,bmorris3/numpy,kirillzhuravlev/numpy,pyparallel/numpy,charris/numpy,hainm/numpy,jonathanunderwood/numpy,nguyentu1602/numpy,brandon-rhodes/numpy,ogrisel/numpy,SiccarPoint/numpy,solarjoe/numpy,mingwpy/numpy,utke1/numpy,KaelChen/numpy,brandon-rhodes/numpy,ESSS/numpy,jakirkham/numpy,immerrr/numpy,sigma-random/numpy,bringingheavendown/numpy,utke1/numpy,pdebuyl/numpy,groutr/numpy,embray/numpy,WillieMaddox/numpy,MichaelAquilina/numpy,rudimeier/numpy,skymanaditya1/numpy,endolith/numpy,Eric89GXL/numpy,tynn/numpy,GaZ3ll3/numpy,pizzathief/numpy,mortada/numpy,tacaswell/numpy,mathdd/numpy,pbrod/numpy,bringingheavendown/numpy,naritta/numpy,jorisvandenbossche/numpy,ssanderson/numpy,ekalosak/numpy,naritta/numpy,numpy/numpy,hainm/numpy,seberg/numpy,pdebuyl/numpy,stuarteberg/numpy,jorisvandenbossche/numpy,Yusa95/numpy,rmcgibbo/numpy,dch312/numpy,sinhrks/numpy,grlee77/numpy,shoyer/numpy,joferkington/numpy,b-carter/numpy,jankoslavic/numpy,KaelChen/numpy,dch312/numpy,pizzathief/numpy,kirillzhuravlev/numpy,SunghanKim/numpy,nguyentu1602/numpy,GaZ3ll3/numpy,gfyoung/numpy,Linkid/numpy,dimasad/numpy,kirillzhuravlev/numpy,jonathanunderwood/numpy,Yusa95/numpy,anntzer/numpy,bertrand-l/numpy,madphysicist/numpy,mwiebe/numpy,jorisvandenbossche/numpy,madphysicist/numpy,ChristopherHogan/numpy,jschueller/numpy,mhvk/numpy,seberg/numpy,njase/numpy,mathdd/numpy,sinhrks/numpy,Eric89GXL/numpy,SiccarPoint/numpy,skwbc/numpy,rudimeier/numpy,Anwesh43/numpy,ekalosak/numpy,moreati/numpy,ogrisel/numpy,ahaldane/numpy,hainm/numpy,pdebuyl/numpy,joferkington/numpy,cjermain/numpy,CMartelLML/numpy,ChanderG/numpy,yiakwy/numpy,chatcannon/numpy,numpy/numpy,grlee77/numpy,CMartelLML/numpy,groutr/numpy,rherault-insa/numpy,empeeu/numpy,groutr/numpy,chiffa/numpy,brandon-rhodes/numpy,mattip/numpy,BabeNovelty/numpy,mattip/numpy,trankmichael/numpy,pizzathief/numpy,dimasad/numpy,rajathkumarmp/numpy,ssanderson/numpy,bmorris3/numpy,MichaelAquilina/numpy,hainm/numpy,felipebetancur/numpy,solarjoe/numpy,MaPePeR/numpy,Eric89GXL/numpy,mortada/numpy,jonathanunderwood/numpy,pizzathief/numpy,empeeu/numpy,grlee77/numpy,ssanderson/numpy,maniteja123/numpy,tynn/numpy,Linkid/numpy,Dapid/numpy,anntzer/numpy,dwillmer/numpy,MSeifert04/numpy,mingwpy/numpy,AustereCuriosity/numpy,rgommers/numpy,SunghanKim/numpy,yiakwy/numpy,mhvk/numpy,rhythmsosad/numpy,ViralLeadership/numpy,has2k1/numpy,kiwifb/numpy,jankoslavic/numpy,GrimDerp/numpy,trankmichael/numpy,mindw/numpy,dwillmer/numpy,kiwifb/numpy,mindw/numpy,NextThought/pypy-numpy,andsor/numpy,bmorris3/numpy,sinhrks/numpy,sinhrks/numpy,sonnyhu/numpy,MSeifert04/numpy,yiakwy/numpy,NextThought/pypy-numpy,Dapid/numpy,andsor/numpy,gmcastil/numpy,utke1/numpy,nbeaver/numpy,GrimDerp/numpy,Anwesh43/numpy,mhvk/numpy,numpy/numpy,githubmlai/numpy,ChristopherHogan/numpy,immerrr/numpy,immerrr/numpy,bmorris3/numpy,GrimDerp/numpy,jschueller/numpy,GaZ3ll3/numpy,embray/numpy,gfyoung/numpy,argriffing/numpy,joferkington/numpy,has2k1/numpy,githubmlai/numpy,numpy/numpy,simongibbons/numpy,ogrisel/numpy,simongibbons/numpy,gmcastil/numpy,pbrod/numpy,SiccarPoint/numpy,SunghanKim/numpy,rmcgibbo/numpy,dato-code/numpy,WarrenWeckesser/numpy,dimasad/numpy,shoyer/numpy,grlee77/numpy,MaPePeR/numpy,tacaswell/numpy,Linkid/numpy,mingwpy/numpy,rhythmsosad/numpy,larsmans/numpy,rajathkumarmp/numpy,chatcannon/numpy,nguyentu1602/numpy,WarrenWeckesser/numpy,pbrod/numpy,skymanaditya1/numpy,rgommers/numpy,njase/numpy,rherault-insa/numpy,ChristopherHogan/numpy,solarjoe/numpy,jakirkham/numpy,BMJHayward/numpy,ContinuumIO/numpy,stuarteberg/numpy,charris/numpy,has2k1/numpy,madphysicist/numpy,BMJHayward/numpy,naritta/numpy,endolith/numpy,rhythmsosad/numpy,felipebetancur/numpy,mwiebe/numpy,kiwifb/numpy,rajathkumarmp/numpy,larsmans/numpy,jankoslavic/numpy,argriffing/numpy,musically-ut/numpy,Anwesh43/numpy,cowlicks/numpy,CMartelLML/numpy,madphysicist/numpy,mhvk/numpy,MSeifert04/numpy,empeeu/numpy,dato-code/numpy,endolith/numpy,stuarteberg/numpy,leifdenby/numpy,madphysicist/numpy,ogrisel/numpy,dimasad/numpy,WarrenWeckesser/numpy,MSeifert04/numpy,pyparallel/numpy,ddasilva/numpy,anntzer/numpy,jakirkham/numpy,andsor/numpy,WillieMaddox/numpy,ContinuumIO/numpy,tynn/numpy,Srisai85/numpy,chiffa/numpy,jschueller/numpy,BabeNovelty/numpy,drasmuss/numpy,Srisai85/numpy,njase/numpy,simongibbons/numpy,ddasilva/numpy,simongibbons/numpy,tdsmith/numpy,NextThought/pypy-numpy,BMJHayward/numpy,ajdawson/numpy,rhythmsosad/numpy,MaPePeR/numpy,drasmuss/numpy,behzadnouri/numpy,nguyentu1602/numpy,dwillmer/numpy,SiccarPoint/numpy,empeeu/numpy,ChristopherHogan/numpy,seberg/numpy,shoyer/numpy,mattip/numpy,mindw/numpy,WarrenWeckesser/numpy,skwbc/numpy,GaZ3ll3/numpy,leifdenby/numpy,charris/numpy,Dapid/numpy,mathdd/numpy,maniteja123/numpy,ahaldane/numpy,mindw/numpy,ekalosak/numpy,ajdawson/numpy,jakirkham/numpy,rudimeier/numpy,ChanderG/numpy,jakirkham/numpy,Srisai85/numpy,AustereCuriosity/numpy,gfyoung/numpy,trankmichael/numpy,NextThought/pypy-numpy,felipebetancur/numpy,seberg/numpy,MSeifert04/numpy,b-carter/numpy,skymanaditya1/numpy,maniteja123/numpy,charris/numpy,ESSS/numpy,gmcastil/numpy,Anwesh43/numpy,cowlicks/numpy,b-carter/numpy,tdsmith/numpy,tdsmith/numpy,argriffing/numpy,embray/numpy,rherault-insa/numpy,sonnyhu/numpy,rgommers/numpy,rgommers/numpy,Yusa95/numpy,MichaelAquilina/numpy,MaPePeR/numpy,sonnyhu/numpy,ChanderG/numpy,larsmans/numpy,ContinuumIO/numpy,chiffa/numpy,drasmuss/numpy,Srisai85/numpy,githubmlai/numpy,BabeNovelty/numpy,tdsmith/numpy,naritta/numpy,immerrr/numpy,jorisvandenbossche/numpy,simongibbons/numpy,nbeaver/numpy,joferkington/numpy,mattip/numpy,BabeNovelty/numpy,musically-ut/numpy,KaelChen/numpy,ahaldane/numpy,ChanderG/numpy,jankoslavic/numpy,dwillmer/numpy,sigma-random/numpy,yiakwy/numpy,brandon-rhodes/numpy,larsmans/numpy,mwiebe/numpy,ahaldane/numpy,grlee77/numpy,WarrenWeckesser/numpy,mhvk/numpy,felipebetancur/numpy,dch312/numpy,moreati/numpy,embray/numpy,behzadnouri/numpy,WillieMaddox/numpy,rajathkumarmp/numpy,sonnyhu/numpy,embray/numpy,abalkin/numpy,andsor/numpy,skwbc/numpy,rmcgibbo/numpy,moreati/numpy,cowlicks/numpy,tacaswell/numpy,cjermain/numpy,musically-ut/numpy,behzadnouri/numpy,ahaldane/numpy,has2k1/numpy,SunghanKim/numpy,ViralLeadership/numpy,dato-code/numpy,Linkid/numpy,mingwpy/numpy,mathdd/numpy,bertrand-l/numpy,mortada/numpy,pdebuyl/numpy,cjermain/numpy,dato-code/numpy,MichaelAquilina/numpy,trankmichael/numpy,shoyer/numpy,dch312/numpy,ajdawson/numpy,jorisvandenbossche/numpy,cowlicks/numpy,sigma-random/numpy