query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Transform normalscore data to previous distribution
def from_norm(data, cprob, nscore_value, mu, sd): print('The dtgeostats.utils.from_norm function is under construction - use with caution...') h = fit(cprob, nscore_value) f = st.norm(0, 1).cdf(data) z = [h(i)*sd + mu for i in f] return z
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform(self, data):\n data -= self.mean\n if 0.0 in self.std:\n self.std = np.where(self.std == 0.0, 1.0, self.std)\n data /= self.std\n return data", "def z_score_normalization(data):\n # import data\n\n features = data[:, 0:-1]\n target = data[:, -1]\n\n ...
[ "0.70772254", "0.6795818", "0.6688897", "0.6611134", "0.65442544", "0.6529865", "0.6443814", "0.63869464", "0.63583684", "0.6355613", "0.6277897", "0.6277897", "0.62756896", "0.62598366", "0.62595695", "0.620676", "0.6202899", "0.6180395", "0.6162539", "0.6154963", "0.6154053...
0.5770762
69
Generate random variables stationary covariance function using spectral techniques of Dietrich & Newsam (1993)
def specsim(gr, gsm): if gsm.ndim == 2: yy, xx = np.meshgrid(np.arange(-gr.ny*0.5*gr.dy, gr.ny*0.5*gr.dy, gr.dy), np.arange(-gr.nx*0.5*gr.dx, gr.nx*0.5*gr.dx, gr.dx)) h = ((xx / gsm.lx) ** 2 + (yy / gsm.ly) ** 2) ** 0.5 # Compute distance from origin elif gsm....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rand_cov():\n c = uniform(-1, 1)\n return [[uniform(0, 1), c], [c, uniform(0, 1)]]", "def test_cov_q(self, ndlys=13):\n for d in self.d:\n d.flag_array[:] = False #ensure that there are no flags!\n d.select(times=np.unique(d.time_array)[:10], frequencies=d.freq_array[:16])\n ...
[ "0.672772", "0.6295773", "0.61297596", "0.6065946", "0.6065946", "0.6065946", "0.59721005", "0.5966204", "0.5899281", "0.5872403", "0.5843831", "0.584188", "0.58392113", "0.5836003", "0.5815455", "0.5801603", "0.57929623", "0.5791151", "0.5790837", "0.5782721", "0.5738705", ...
0.6362804
1
cast(itkLightObject obj) > itkVectorExpandImageFilterIVF22IVF22
def cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF22IVF22 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF22IVF22_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkVectorExpandImageFilterIVF22IVF22_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF22IVF22_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVe...
[ "0.83926094", "0.8298233", "0.827044", "0.8268906", "0.8264077", "0.82236785", "0.8218225", "0.8164695", "0.8150108", "0.8041721", "0.80004126", "0.7105834", "0.7096456", "0.70735925", "0.7061469", "0.70598567", "0.7045147", "0.6960174", "0.6953238", "0.6952856", "0.69513655"...
0.8445157
0
New() > itkVectorExpandImageFilterIVF22IVF22 Create a new object of the class itkVectorExpandImageFilterIVF22IVF22 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkVectorExpandImageFilterIVF22IVF22.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF23IVF23.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF33IVF33.__New_orig__()\n import itkTemplate\n ...
[ "0.7913906", "0.7825144", "0.7774732", "0.77336276", "0.75654006", "0.6692003", "0.66852164", "0.6680091", "0.6665125", "0.6605097", "0.65593344", "0.6536447", "0.6496702", "0.6494294", "0.64744526", "0.6458581", "0.6448725", "0.64068097", "0.6398479", "0.6383451", "0.6381740...
0.8207771
0
itkVectorExpandImageFilterIVF22IVF22_cast(itkLightObject obj) > itkVectorExpandImageFilterIVF22IVF22
def itkVectorExpandImageFilterIVF22IVF22_cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF22IVF22 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF22IVF22_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkVectorExpandImageFilterIVF42IVF42_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF42IVF42_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVe...
[ "0.8919381", "0.8902668", "0.8870486", "0.8803641", "0.87216496", "0.8705942", "0.86932236", "0.8684815", "0.86340934", "0.86134416", "0.85737926", "0.69257385", "0.6902999", "0.6873075", "0.6860663", "0.6860394", "0.6820477", "0.6800361", "0.6799008", "0.67509377", "0.673157...
0.91243744
0
cast(itkLightObject obj) > itkVectorExpandImageFilterIVF23IVF23
def cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF23IVF23 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF23IVF23_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF22IVF22_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVectorExpandImageFilterPython.itkVe...
[ "0.8367637", "0.8328482", "0.82955027", "0.8294755", "0.82883745", "0.82858235", "0.82767355", "0.82320833", "0.8200255", "0.81040484", "0.8056728", "0.70618194", "0.7054815", "0.7044602", "0.70427835", "0.7032278", "0.7022957", "0.6936761", "0.6905078", "0.6900155", "0.68895...
0.83792025
0
New() > itkVectorExpandImageFilterIVF23IVF23 Create a new object of the class itkVectorExpandImageFilterIVF23IVF23 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkVectorExpandImageFilterIVF23IVF23.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF33IVF33.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF22IVF22.__New_orig__()\n import itkTemplate\n ...
[ "0.79877603", "0.79593724", "0.7900024", "0.78530586", "0.76366776", "0.6699445", "0.65902627", "0.6584185", "0.6542834", "0.6528242", "0.6488647", "0.6477506", "0.64730835", "0.6451642", "0.6430358", "0.64132684", "0.64045566", "0.6385129", "0.63809365", "0.63807464", "0.638...
0.8225989
0
itkVectorExpandImageFilterIVF23IVF23_cast(itkLightObject obj) > itkVectorExpandImageFilterIVF23IVF23
def itkVectorExpandImageFilterIVF23IVF23_cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF23IVF23 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF23IVF23_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkVectorExpandImageFilterIVF42IVF42_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF42IVF42_cast(obj)", "def itkVectorExpandImageFilterIVF22IVF22_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterI...
[ "0.88909954", "0.8887997", "0.88034046", "0.87624156", "0.8754744", "0.87206584", "0.8713865", "0.8655809", "0.86537486", "0.8581527", "0.8570841", "0.69111556", "0.68571174", "0.68516827", "0.68503773", "0.68038636", "0.6781638", "0.6746848", "0.6721462", "0.6680379", "0.667...
0.9017987
0
cast(itkLightObject obj) > itkVectorExpandImageFilterIVF32IVF32
def cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF32IVF32 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF32IVF32_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkVectorExpandImageFilterIVF32IVF32_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF32IVF32 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF32IVF32_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVe...
[ "0.8542603", "0.8197546", "0.8152614", "0.81165963", "0.8100914", "0.8075377", "0.80663043", "0.8047866", "0.7939687", "0.793264", "0.7824045", "0.6882712", "0.68794525", "0.6836208", "0.68136436", "0.68013775", "0.67733055", "0.6765582", "0.6733538", "0.6731916", "0.6721725"...
0.8536551
1
New() > itkVectorExpandImageFilterIVF32IVF32 Create a new object of the class itkVectorExpandImageFilterIVF32IVF32 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkVectorExpandImageFilterIVF32IVF32.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF33IVF33.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF22IVF22.__New_orig__()\n import itkTemplate\n ...
[ "0.7790981", "0.7635834", "0.76252687", "0.7581817", "0.7536464", "0.6553982", "0.6549788", "0.65378934", "0.6516733", "0.6490127", "0.64769095", "0.644009", "0.6430601", "0.642637", "0.64174163", "0.6405188", "0.6396696", "0.638686", "0.63681155", "0.6344883", "0.6328053", ...
0.81372416
0
itkVectorExpandImageFilterIVF32IVF32_cast(itkLightObject obj) > itkVectorExpandImageFilterIVF32IVF32
def itkVectorExpandImageFilterIVF32IVF32_cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF32IVF32 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF32IVF32_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF32IVF32 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF32IVF32_cast(obj)", "def itkVectorExpandImageFilterIVF42IVF42_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVe...
[ "0.8885994", "0.8514419", "0.8466365", "0.8433972", "0.84204555", "0.8414497", "0.83895296", "0.8381609", "0.8365337", "0.83102876", "0.828113", "0.6605372", "0.65935415", "0.6558618", "0.65523034", "0.6520429", "0.6510308", "0.6496248", "0.64699", "0.64616305", "0.6453076", ...
0.9125741
0
cast(itkLightObject obj) > itkVectorExpandImageFilterIVF33IVF33
def cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF33IVF33 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF33IVF33_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF32IVF32 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF32IVF32_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVectorExpandImageFilterPython.itkVe...
[ "0.8378539", "0.83769655", "0.8360035", "0.8354005", "0.8330188", "0.83221495", "0.8315428", "0.83101475", "0.8307184", "0.8250692", "0.81651515", "0.7041615", "0.70121455", "0.69962054", "0.6981861", "0.6976024", "0.696934", "0.6917863", "0.68970424", "0.6891882", "0.686782"...
0.8424311
0
New() > itkVectorExpandImageFilterIVF33IVF33 Create a new object of the class itkVectorExpandImageFilterIVF33IVF33 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkVectorExpandImageFilterIVF33IVF33.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF23IVF23.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF22IVF22.__New_orig__()\n import itkTemplate\n ...
[ "0.7578717", "0.7488091", "0.74820507", "0.73857886", "0.7352937", "0.6572345", "0.6572335", "0.65703875", "0.65606385", "0.6547305", "0.64844", "0.6450503", "0.6440559", "0.6427319", "0.64043665", "0.639521", "0.6377667", "0.63764465", "0.63490903", "0.6344421", "0.6337048",...
0.80141616
0
itkVectorExpandImageFilterIVF33IVF33_cast(itkLightObject obj) > itkVectorExpandImageFilterIVF33IVF33
def itkVectorExpandImageFilterIVF33IVF33_cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF33IVF33 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF33IVF33_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF33IVF33 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF33IVF33_cast(obj)", "def itkVectorExpandImageFilterIVF32IVF32_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF32IVF32 *\":\n return _itkVe...
[ "0.8915183", "0.88915145", "0.8880836", "0.8853808", "0.8850993", "0.87855667", "0.8701169", "0.86950517", "0.868961", "0.8673146", "0.8629543", "0.6860302", "0.68447447", "0.6827326", "0.681855", "0.68182826", "0.6815381", "0.6813387", "0.6800047", "0.6794376", "0.67919606",...
0.91449696
0
cast(itkLightObject obj) > itkVectorExpandImageFilterIVF42IVF42
def cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF42IVF42 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF42IVF42_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkVectorExpandImageFilterIVF42IVF42_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF42IVF42_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVe...
[ "0.84367687", "0.84120345", "0.83647484", "0.83479774", "0.8332825", "0.8301246", "0.82855546", "0.820976", "0.82079655", "0.81850594", "0.8031599", "0.70579237", "0.70417744", "0.7033641", "0.7028657", "0.6991236", "0.69784135", "0.6920577", "0.69075537", "0.68936443", "0.68...
0.84540933
0
New() > itkVectorExpandImageFilterIVF42IVF42 Create a new object of the class itkVectorExpandImageFilterIVF42IVF42 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkVectorExpandImageFilterIVF42IVF42.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF43IVF43.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF23IVF23.__New_orig__()\n import itkTemplate\n ...
[ "0.8120374", "0.8040503", "0.80063623", "0.7958326", "0.77078223", "0.6739954", "0.66359776", "0.6592951", "0.6508046", "0.64962864", "0.6476553", "0.64362144", "0.6435694", "0.6435688", "0.6424102", "0.6423027", "0.6415844", "0.6413576", "0.63976437", "0.6392345", "0.6390895...
0.82042253
0
itkVectorExpandImageFilterIVF42IVF42_cast(itkLightObject obj) > itkVectorExpandImageFilterIVF42IVF42
def itkVectorExpandImageFilterIVF42IVF42_cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF42IVF42 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF42IVF42_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkVectorExpandImageFilterIVF22IVF22_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF22IVF22_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVe...
[ "0.8921525", "0.88993216", "0.8890407", "0.88709706", "0.8854987", "0.88086265", "0.8802269", "0.875495", "0.8709495", "0.86803514", "0.8627641", "0.6891371", "0.6847465", "0.68462723", "0.68117833", "0.6804652", "0.68016857", "0.6744712", "0.6743745", "0.6740151", "0.6736763...
0.91442156
0
cast(itkLightObject obj) > itkVectorExpandImageFilterIVF43IVF43
def cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF43IVF43 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF43IVF43_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF42IVF42_cast(obj)", "def cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF22IVF22 *\":\n return _itkVectorExpandImageFilterPython.itkVe...
[ "0.83973604", "0.83811015", "0.8374428", "0.83428836", "0.8341684", "0.8290391", "0.82777834", "0.8274626", "0.8234205", "0.82291055", "0.8076892", "0.7067558", "0.70327514", "0.7022479", "0.6989206", "0.69563186", "0.6955844", "0.69457936", "0.68938327", "0.6885933", "0.6884...
0.8423962
0
New() > itkVectorExpandImageFilterIVF43IVF43 Create a new object of the class itkVectorExpandImageFilterIVF43IVF43 and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named pa...
def New(*args, **kargs): obj = itkVectorExpandImageFilterIVF43IVF43.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF23IVF23.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkVectorExpandImageFilterIVF42IVF42.__New_orig__()\n import itkTemplate\n ...
[ "0.7723938", "0.7714054", "0.7689223", "0.7592957", "0.72759426", "0.6405043", "0.6395701", "0.63572246", "0.6319903", "0.63052416", "0.6303876", "0.625298", "0.6223321", "0.6203164", "0.62000895", "0.61924714", "0.6171819", "0.6160176", "0.6148205", "0.614818", "0.612762", ...
0.80912405
0
itkVectorExpandImageFilterIVF43IVF43_cast(itkLightObject obj) > itkVectorExpandImageFilterIVF43IVF43
def itkVectorExpandImageFilterIVF43IVF43_cast(obj: 'itkLightObject') -> "itkVectorExpandImageFilterIVF43IVF43 *": return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF43IVF43_cast(obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkVectorExpandImageFilterIVF42IVF42_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterIVF42IVF42 *\":\n return _itkVectorExpandImageFilterPython.itkVectorExpandImageFilterIVF42IVF42_cast(obj)", "def itkVectorExpandImageFilterIVF23IVF23_cast(obj: 'itkLightObject') -> \"itkVectorExpandImageFilterI...
[ "0.9001677", "0.88652575", "0.8849221", "0.8841853", "0.8799134", "0.87511665", "0.8722462", "0.87099034", "0.87083143", "0.8628319", "0.86165863", "0.6798223", "0.6765647", "0.67360586", "0.6715522", "0.6696963", "0.6694683", "0.66818583", "0.66594", "0.6659369", "0.6647706"...
0.9023615
0
Calculate pvalues for a permuted walk dataset. The pvalue is the cumulative probability of observing a walk score of equal or greater magnitude. arguments
def _calculate_p(vector: pd.DataFrame, n: int) -> pd.DataFrame: ## Isolate permuted walk scores (these fields begin w/ p_), identify permuted scores ## of equal or greater magnitude than the one originally observed, sum the scores, ## then calculate the p-value. vector['p'] = ( vector.fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_pvalue(self):\n # Run permutation test\n self.PermutationTest()\n # TS obtained from the original B,T samples\n self.compute_obs_TS()\n \n # Mean and std of the TS distribution\n self.mu = np.mean(self.TS_tilde)\n self.sigma = np.std(s...
[ "0.6741401", "0.6739902", "0.6329827", "0.60644656", "0.59954697", "0.5938298", "0.59018594", "0.5887984", "0.5877435", "0.5873915", "0.58594567", "0.58151317", "0.5762956", "0.5734468", "0.57270837", "0.57074153", "0.56138307", "0.56138307", "0.55645233", "0.5549605", "0.554...
0.6146725
3
Calculates the histogram of a given image.
def calculate_histogram(img, channel): # histogram arrays for each channel hist_gs_or_red = np.zeros((256, 1), dtype=np.int32) hist_green = np.zeros((256, 1), dtype=np.int32) hist_blue = np.zeros((256, 1), dtype=np.int32) # Calculate the histogram for red channel for RGB images # or the the fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_histogram(self, image):\n\n hist = [0] * 256\n x, y = image.shape[:2]\n #print(image.shape)\n for i in range(x):\n for j in range(y):\n hist[image[i, j]] += 1\n\n return hist", "def histogram(img):\n BINS = 8\n RANGE = np.tile(np.arra...
[ "0.8454061", "0.82917804", "0.8227543", "0.8146126", "0.81406593", "0.8092285", "0.7866563", "0.7743489", "0.7423736", "0.7119662", "0.70962876", "0.7085983", "0.703597", "0.70013666", "0.6971639", "0.6963821", "0.69563365", "0.6890361", "0.68844575", "0.685031", "0.6794314",...
0.67777276
21
Returns the value of the element at position index
def __getitem__(self, index: int) -> T: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n return self._value_at(index)", "def __getitem__(self, index):\n return self._value_at(index)", "def get_value_by_index(self, index):\n return self['value'][index]", "def _value_at(self, index):\n node = self._get_node_at(index)\n if node is N...
[ "0.8325352", "0.8325352", "0.81860703", "0.8162933", "0.8162933", "0.80013084", "0.7963294", "0.7937719", "0.7843172", "0.7801458", "0.7800107", "0.77847344", "0.7677333", "0.76375395", "0.7623587", "0.7612316", "0.75660056", "0.75660056", "0.7532371", "0.7492172", "0.7488256...
0.0
-1
Inserts item into the list at the correct position
def insert(self, item: T) -> None: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert(self, index, item):\n # type: (int, Any) -> None\n return list.insert(self, index, self.ref(item))", "def push(self, item):\n self.list.prepend(item)", "def insert(self, index: int, item: Any) -> BaseList:\n super().insert(index, item)\n return self", "def insert...
[ "0.79405856", "0.7613358", "0.754908", "0.75425905", "0.7532011", "0.74775505", "0.7393919", "0.73665935", "0.73036444", "0.72954285", "0.72944105", "0.7269339", "0.7253484", "0.72502726", "0.7239297", "0.7228257", "0.7175718", "0.71571726", "0.7154767", "0.7146624", "0.71220...
0.6932816
34
Converts the list into a string, first to last
def __str__(self) -> str: result = "[" for i in range(len(self)): if i > 0: result += ', ' result += str(self[i]) result += ']' return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_to_str( L ):\n if len(L) == 0: return ''\n return L[0] + list_to_str( L[1:] )", "def list_to_str( L ):\n if len(L) == 0: return ''\n return L[0] + list_to_str( L[1:] )", "def list_str(lis):\r\n as_str = \"\"\r\n for item in lis:\r\n as_str += \" \" + str(item) + \",\"\r\n return as...
[ "0.8001536", "0.8001536", "0.75531805", "0.74788576", "0.7471599", "0.7292597", "0.72357595", "0.71526766", "0.71234137", "0.7055043", "0.7053565", "0.70516855", "0.7040503", "0.7003239", "0.6955984", "0.6952963", "0.68701166", "0.68549097", "0.6849128", "0.6753707", "0.67382...
0.0
-1
Initialises self.length by calling its parent and self.head as None, since the list is initially empty
def __init__(self) -> None: SortedList.__init__(self) self.head = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.head = None\n self.length = 0", "def __init__(self):\n self.head = None\n self.length = 0", "def __init__(self):\n self.length = 0\n self.head = None", "def __init__(self):\n self.head = None\n self.size = 0", "def __init__(...
[ "0.82814825", "0.82814825", "0.8258897", "0.7824902", "0.7824902", "0.7824902", "0.7658213", "0.76015234", "0.75551814", "0.75506204", "0.7510291", "0.75018483", "0.75018483", "0.75018483", "0.7489176", "0.7472115", "0.7418264", "0.7391681", "0.73670274", "0.734793", "0.72661...
0.65968597
80
Returns the value of the element at position index
def __getitem__(self, index: int) -> T: node_at_index = self.__get_node_at_index(index) return node_at_index.item
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, index):\n return self._value_at(index)", "def __getitem__(self, index):\n return self._value_at(index)", "def get_value_by_index(self, index):\n return self['value'][index]", "def _value_at(self, index):\n node = self._get_node_at(index)\n if node is N...
[ "0.8325352", "0.8325352", "0.81860703", "0.8162933", "0.8162933", "0.80013084", "0.7963294", "0.7937719", "0.7843172", "0.7801458", "0.7800107", "0.77847344", "0.7677333", "0.76375395", "0.7623587", "0.7612316", "0.75660056", "0.75660056", "0.7532371", "0.7492172", "0.7488256...
0.7054872
63
Returns the node in the list at position index
def __get_node_at_index(self, index: int) -> Node[T]: if 0 <= index and index < len(self): current = self.head for i in range(index): current = current.link return current else: raise ValueError("Index out of bounds")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_node(self, index):\r\n\t\tself._validate_index(index)\r\n\t\treturn self._traverse(lambda i, list: i < index)[\"node\"]", "def get_node_from_index(self, index):\n curr = self.head\n for i in range(index):\n curr = curr.next\n return curr", "def getNode_at(self, index):\...
[ "0.8678137", "0.8378689", "0.8369056", "0.82598925", "0.8214268", "0.81281424", "0.777039", "0.768432", "0.76695555", "0.7572523", "0.75428927", "0.75428045", "0.7497472", "0.74774575", "0.74681276", "0.7461361", "0.7446571", "0.7422648", "0.73729736", "0.73640317", "0.735137...
0.82805175
3
Dynamically take this setting from this 'PromptSession' class. `attr_name` represents an attribute name of this class. Its value can either be a boolean or a `Filter`. This returns something that can be used as either a `Filter` or `Filter`.
def _dyncond(self, attr_name: str) -> Condition: @Condition def dynamic() -> bool: value = cast(FilterOrBool, getattr(self, attr_name)) return to_filter(value)() return dynamic
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getattribute__(self, name):\n if name in [\"sampling_function\", \"env\", \"fit_dist\", \"reset\"]:\n return object.__getattribute__(self, name)\n\n else:\n return getattr(self.env, name)", "def get_attr(self, name: str):\n return self.call(name)", "def _valuabl...
[ "0.55775553", "0.5507384", "0.5504079", "0.5353542", "0.5301226", "0.52445555", "0.52445555", "0.5201549", "0.5197284", "0.5192361", "0.51679343", "0.5130608", "0.5100696", "0.5086208", "0.507831", "0.5071244", "0.5069357", "0.50390226", "0.50167257", "0.4992679", "0.4992679"...
0.6094935
0
Create the `Application` object.
def _create_application( self, editing_mode: EditingMode, erase_when_done: bool ) -> Application[_T]: dyncond = self._dyncond # Default key bindings. auto_suggest_bindings = load_auto_suggest_bindings() open_in_editor_bindings = load_open_in_editor_bindings() prompt_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app():\n app = create_app()\n return app", "def get_app(self):\n return Application()", "def app():\n return create_app()", "def create_app():\n\n # Create app\n app = Flask(__name__)\n app.config.from_object(\"nextbus.config.Config\")\n\n app.logger = logger.app_logger\n #...
[ "0.79290044", "0.7740176", "0.7724193", "0.7710619", "0.76674026", "0.7646432", "0.75434595", "0.7489573", "0.73718864", "0.73690045", "0.7338987", "0.7267931", "0.7232365", "0.72245014", "0.7223123", "0.7218054", "0.7217714", "0.7215869", "0.71860194", "0.71767944", "0.71697...
0.0
-1
Calculate the Haversine distance.
def distance(origin, destination): lat1, lon1 = origin lat2, lon2 = destination radius = 6371 # km dlat = math.radians(lat2 - lat1) dlon = math.radians(lon2 - lon1) a = (math.sin(dlat / 2) * math.sin(dlat / 2) + math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) * ma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def haversine(lon1, lat1, lon2, lat2): \r\n lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) \r\n #print 34\r\n dlon = lon2 - lon1 \r\n dlat = lat2 - lat1 \r\n a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2 \r\n c = 2 * atan(sqrt(a)/sqrt(1-a)) \r\n r = 637...
[ "0.75145954", "0.74784905", "0.7441076", "0.73765993", "0.7361475", "0.72931635", "0.7262805", "0.7244069", "0.722919", "0.7224837", "0.7204102", "0.7181636", "0.7154773", "0.71105516", "0.71057034", "0.7092415", "0.7076044", "0.7072163", "0.7038709", "0.7028212", "0.70122015...
0.0
-1
Return the unique vertices from given vertices.
def unique_vertices( vertices: ArrayLike, decimals: int = np.finfo(cast(Any, DEFAULT_FLOAT_DTYPE)).precision - 1, ) -> NDArrayFloat: vertices = as_float_array(vertices) unique, indexes = np.unique( vertices.round(decimals=decimals), axis=0, return_index=True ) return unique[np.argsort...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vertices(size):\n return set(range(size))", "def vertices(self):\n s = set([x for x in self.edges.keys()])\n t = set([y for v in self.edges.values() for (y,d) in v.items()])\n v = s.union(t)\n return list(v)", "def removeVertices(self, vertices: set):\n\n for v in copy...
[ "0.73574716", "0.71837825", "0.676872", "0.67016476", "0.6685178", "0.6626049", "0.64009607", "0.6392685", "0.6284409", "0.6202879", "0.6173063", "0.6146399", "0.6103837", "0.6040789", "0.60084146", "0.59984154", "0.5984825", "0.5984585", "0.5968651", "0.5909573", "0.590302",...
0.71867096
1
Convert datetime objects into timestamp.
def json_encoder(obj): if isinstance(obj, datetime.datetime): return time.mktime(obj.timetuple()) if isinstance(obj, datetime.timedelta): return obj.total_seconds()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_to_timestamp(obj: \"datetime\") -> \"Timestamp\":\n td = datetime_to_epoch_timedelta(obj)\n ts = Timestamp()\n ts.seconds = td.seconds + td.days * _SECONDS_PER_DAY\n ts.nanos = td.microseconds * _NANOS_PER_MICROSECOND\n return ts", "def _datetime_to_timestamp(self, dt):\n retur...
[ "0.75886273", "0.7169292", "0.7101051", "0.6844625", "0.672754", "0.66921127", "0.6681874", "0.6657311", "0.66404706", "0.66253364", "0.66199344", "0.65921235", "0.65772563", "0.65608436", "0.65244097", "0.6513138", "0.64997137", "0.64858013", "0.63744724", "0.637078", "0.636...
0.580868
61
Returns a dict of parameters suitable for get_new_connection.
def get_connection_params(self): settings_dict = self.settings_dict.copy() if settings_dict['NAME'] == '': from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured( "settings.DATABASES is improperly configured. " "Pl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connection_params(self, session, **kwargs):\n return {}", "def _get_conn_params(self) -> dict[str, Any]:\n conn = self.get_connection(self.slack_conn_id)\n if not conn.password:\n raise AirflowNotFoundException(\n f\"Connection ID {self.slack_conn_id!r} does...
[ "0.77255714", "0.75389177", "0.7532421", "0.74720806", "0.7248387", "0.70902026", "0.70675164", "0.7006772", "0.6791901", "0.6656478", "0.6649362", "0.6639104", "0.659048", "0.6569225", "0.6549231", "0.65441257", "0.65178263", "0.64895004", "0.648519", "0.64809495", "0.644793...
0.7234448
5
Convert a three ndarray to SparseTensor which would be used in Java side.
def sparse(cls, a_ndarray, i_ndarray, shape, bigdl_type="float"): if a_ndarray is None: return None invalidInputError(isinstance(a_ndarray, np.ndarray), f"input should be a np.ndarray, not ${type(a_ndarray)}") invalidInputError(isinstance(i_ndarray, np.ndarr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _binary_3d_label_to_sparse(labels):\n return sparse_tensor.SparseTensor.from_value(\n _binary_3d_label_to_sparse_value(labels))", "def collate_sparse_tensors(batch):\n batch_inds = []\n F_list = []\n C_list = []\n for i in range(len(batch)):\n n = batch[i].F.shape[0]\n F_list....
[ "0.6781133", "0.62889516", "0.6245261", "0.62376535", "0.62293434", "0.61515474", "0.61474276", "0.6139255", "0.6110722", "0.60642266", "0.6060542", "0.6025704", "0.59922755", "0.59220344", "0.5917676", "0.59050804", "0.5903568", "0.5868671", "0.58631545", "0.5850128", "0.583...
0.5864859
18
Set BigDL log level to INFO.
def show_bigdl_info_logs(bigdl_type="float"): callBigDlFunc(bigdl_type, "showBigDlInfoLogs")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_log_info():\n set_log_level_format(logging.INFO,\n '%(asctime)s %(levelname)s:%(name)s:%(message)s')", "def log_info(self, msg):\n self.log(msg, level=LOG_INFO)", "def setLogLevel(self,value):\n self.PDFreactorConfiguration.in1[\"logLevel\"] = value", "def log...
[ "0.6882181", "0.6606571", "0.65878797", "0.64794856", "0.6433123", "0.6430044", "0.6380692", "0.6338988", "0.6318845", "0.6315953", "0.6255788", "0.6236509", "0.6218847", "0.6180613", "0.615779", "0.61469585", "0.61235714", "0.61101454", "0.6060425", "0.60493124", "0.6038953"...
0.5599594
71
Computes the dot product between two vectors.
def dot_product(vector1, vector2): return [reduce_by_multiplication(pair) for pair in zip(vector1, vector2)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot(vector1, vector2):\n return sum(a1 * a2 for a1, a2 in zip(vector1, vector2))", "def dot(a, b):\n\n if len(a) != len(b):\n raise Exception(\"Input vectors must be of same length, not %d and %d\" % (len(a), len(b)))\n\n return float(sum([a[i] * b[i] for i in range(len(a))]))", ...
[ "0.8743899", "0.87390256", "0.8668944", "0.8617667", "0.8617369", "0.8595715", "0.85551625", "0.8548558", "0.85236335", "0.8503238", "0.8466258", "0.83802617", "0.83662665", "0.8345095", "0.8322645", "0.83145404", "0.830822", "0.8257369", "0.8168214", "0.8158046", "0.8136944"...
0.8313931
16
Get a quoted path from a request path. The returned path can be used as a query parameter in login and reset URLs.
def get_return_to_from_path(req: web.Request) -> str: if req.path == "/login": return urllib.parse.quote("/", safe="") return urllib.parse.quote(req.path, safe="")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quote_path(path):\n return '\"' + re.sub(r'([\\\\$\"[])', r\"\\\\\\1\", path) + '\"'", "def path(self):\n\n if os.path.isabs(self._value):\n return pathlib.Path(self._value)\n raise RuntimeError('RequestString.path not supported.')", "def get_path(self, path):\n return abspath(join...
[ "0.66117185", "0.6518639", "0.6459984", "0.6444478", "0.6425003", "0.63703877", "0.6280366", "0.6258959", "0.6107533", "0.6097093", "0.6078227", "0.6031704", "0.6009114", "0.5984838", "0.59573656", "0.5928795", "0.59065956", "0.588949", "0.58834934", "0.58822876", "0.5874672"...
0.75459146
0
Get a quoted path from a request query string. The returned path can be used as a query parameter in login and reset URLs.
def get_return_to_from_query(req: web.Request) -> str: return_to = req.query.get("return_to", "/") return urllib.parse.quote(return_to, safe="")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_return_to_from_path(req: web.Request) -> str:\n if req.path == \"/login\":\n return urllib.parse.quote(\"/\", safe=\"\")\n\n return urllib.parse.quote(req.path, safe=\"\")", "def get_query(self):\r\n\r\n split = self.path_s.split(\"?\", 1)\r\n if len(split) == 1: return \"\"\r\...
[ "0.67656595", "0.66694194", "0.6187575", "0.61266077", "0.60721916", "0.6044022", "0.5936467", "0.5865279", "0.5857856", "0.5808022", "0.5736979", "0.57093316", "0.5700575", "0.56682545", "0.56547445", "0.56516343", "0.5648888", "0.56476533", "0.5645986", "0.56235856", "0.561...
0.57526857
10
Parse and decode an API key from an HTTP authorization header value. Thje
def decode_authorization(authorization: str) -> tuple: split = authorization.split(" ") if len(split) != 2 or split[0] != "Basic": raise virtool.errors.AuthError("Malformed authorization header") decoded = base64.b64decode(split[1]).decode("utf-8") user_id, key = decoded.split(":") retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decode_user_api_key(req):\n auth_header = req.headers.get('AUTHORIZATION')\n\n if not auth_header:\n raise AuthException(\"'Authorization' header is missing.\")\n\n # Verify authentication type\n try:\n auth_type, token = auth_header.split()\n assert auth_type == 'Bearer'\n ...
[ "0.67872375", "0.67390203", "0.6706294", "0.6448602", "0.6335395", "0.6261553", "0.6190575", "0.6183604", "0.61806434", "0.6146972", "0.6099199", "0.6075243", "0.6074185", "0.60723877", "0.60331666", "0.6016162", "0.59760946", "0.5970541", "0.5969888", "0.5969888", "0.5969182...
0.6552927
3
A request handler for requests where the `index.html` should be returned. This handler deals with redirecting to the login and password reset pages where appropriate.
async def index_handler(req: web.Request) -> web.Response: if req.app["client_path"] is None: try: client_path = await virtool.utils.get_client_path() except FileNotFoundError: return await client_path_error() req.app["client_path"] = client_path req.app.rout...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def homepage():\n return redirect('index.html')", "def index_file():\n return redirect(\"/\")", "def home():\n return make_response(open('app/templates/index.html').read())", "def root():\n if request.headers['Accept'] == 'application/json':\n return \"Welcome\\n\\n\", 200\n else:\n retu...
[ "0.6745893", "0.67394066", "0.6696376", "0.6687734", "0.66440356", "0.6622204", "0.6604141", "0.6585776", "0.6500741", "0.6485597", "0.646933", "0.6447608", "0.6439399", "0.64084417", "0.63921463", "0.63542634", "0.6336931", "0.6322592", "0.63144946", "0.6281809", "0.6277725"...
0.74163663
0
returns a File instance for the input file or None if the input hasn't been generated yet. If the latter is the case, then it automatically starts the generation of input file.
def output_file(self): if not self.output_file_generated(): return None if self.output_static is False: return self._output_generated_file else: return self._output_uploaded_file
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_file(self):\n if not self.input_file_generated():\n return None\n if self.input_static is False:\n return self._input_generated_file\n else:\n return self._input_uploaded_file", "def create_default_input(self):\n input_creator = InputCreator(...
[ "0.7460117", "0.7118828", "0.69139284", "0.64967453", "0.6441516", "0.63185525", "0.6115493", "0.5905624", "0.58408743", "0.58305377", "0.57929844", "0.5750007", "0.572476", "0.5718196", "0.5666526", "0.5643162", "0.5630864", "0.56140953", "0.5592145", "0.55690205", "0.556651...
0.62553054
6
Given a vector returns a matrix with rows corresponding to onehot encoding
def one_hot(self, x, N): ### YOUR CODE HERE ### M = x.shape[0] one_hot = np.zeros((N, M)) for i in range(M): one_hot[x[i], i] = 1 # for xi,intWord in enumerate(x): # one_hot[xi,intWord] = 1 assert one_hot.shape == (N, x.shap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_one_hot(v):\n n = len(v)\n m = max(v) + 1\n out = np.zeros((n, m))\n out[np.arange(n), v] = 1\n return out", "def one_hot_encode(vector, values = 10):\n n = len(vector)\n out = numpy.zeros( (n, values) )\n out[range(n), vector] = 1\n return out", "def _one_hot_encode(label_vec...
[ "0.83644116", "0.8250922", "0.8041751", "0.80206984", "0.7957406", "0.78535616", "0.782778", "0.779976", "0.76363915", "0.7615411", "0.7594082", "0.7537369", "0.753309", "0.7487682", "0.74870867", "0.7482502", "0.7462316", "0.74530447", "0.7442612", "0.74367964", "0.74042165"...
0.7385332
23
Performs forward and backward propagation and updates weights
def step(self, x, y, learning_rate=1e-3): # Input transformation """ Input is represented with M-dimensional vectors We convert them to (N, M) matrices such that columns are one-hot representations of the input """ x = self.one_hot(x, self.N) y =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_weights(self):\n activation, activation_p = self.feedforward()\n # initialize delta_weights\n delta_w = np.zeros(2)\n # simultaneous calculate delta_weights\n for i, element in enumerate(self.y):\n delta_w += (activation[i]-element)*(activation_p[i])*self.X[...
[ "0.78562564", "0.73390895", "0.7321579", "0.7282418", "0.72295105", "0.7229397", "0.71834415", "0.71750623", "0.71382415", "0.7128352", "0.7065244", "0.705789", "0.7047591", "0.7020441", "0.7001433", "0.6987382", "0.6968537", "0.6944231", "0.69366634", "0.69217235", "0.692024...
0.0
-1
Changes the admin password.
def post(self): DA = DataAccessor() session = getSessionByRequest(self) user = getSessionUser(session) old = self.request.get('old') new = self.request.get('new') new2 = self.request.get('new2') if old != user.password: setSessionMessage(sess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_admin_password(self, instance, new_pass):\n pass", "def set_admin_password(self, instance, new_pass):\n raise NotImplementedError()", "def change_password(self, new_pass):\n self.manager.change_user_password(self, new_pass)", "def setpassword(self, pwd):\n pass", "def se...
[ "0.89401054", "0.8628543", "0.76031244", "0.7567382", "0.75085676", "0.7388083", "0.73617107", "0.73413193", "0.72835135", "0.72178334", "0.713289", "0.711186", "0.7078669", "0.7064469", "0.7035929", "0.7006707", "0.69938266", "0.69937426", "0.6991373", "0.69582367", "0.69160...
0.6398779
86
Does nothing but redirect to the root admin page.
def get(self): self.redirect('/admin')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(self) :\n self.redirect('/admin')", "def goToAdmin(request):\n\n\ttemplate = '../admin'\n\treturn HttpResponseRedirect(template)", "def admin():\n return redirect(url_for(\"user\", name=\"Admin!\"))", "def GET_adminon(self):\r\n #check like this because c.user_is_admin is still fals...
[ "0.792132", "0.7732155", "0.7502501", "0.7218575", "0.7142838", "0.6975247", "0.6898303", "0.6879668", "0.68388873", "0.6797142", "0.67157716", "0.67048424", "0.6685925", "0.6684974", "0.66080475", "0.6575411", "0.65521383", "0.65265316", "0.6444826", "0.6438821", "0.6432843"...
0.80592966
0
Creates a gNMI GetRequest.
def CreateStub(creds: grpc.ssl_channel_credentials, target: Text, port: Text, host_override: Optional[Text] = None) -> gnmi_pb2_grpc.gNMIStub: if host_override: channel = grpc.secure_channel(target + ':' + port, creds, (( 'grpc.ssl_target_name_override', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createRequest(self):\n self.get_bmc_website()\n self.__createChangeRequest = Create(self.browser)\n self.__createChangeRequest.createNCR()", "def req():\n return Request()", "def newRequest(self):\n return Request( )", "def _get_request(url, params):\n request = requests...
[ "0.6341264", "0.61584914", "0.5815869", "0.5652661", "0.5589696", "0.55891114", "0.556782", "0.55567867", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0...
0.0
-1
Creates a gNMI GetRequest.
def Get(stub: gnmi_pb2_grpc.gNMIStub, paths: gnmi_pb2.Path, username: Text, password: Text) -> gnmi_pb2.GetResponse: if username and password: # User/pass supplied for Authentication. return stub.Get( gnmi_pb2.GetRequest(path=[paths], encoding='JSON_IETF'), metadata=[('username', username...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createRequest(self):\n self.get_bmc_website()\n self.__createChangeRequest = Create(self.browser)\n self.__createChangeRequest.createNCR()", "def req():\n return Request()", "def newRequest(self):\n return Request( )", "def _get_request(url, params):\n request = requests...
[ "0.6341264", "0.61584914", "0.5815869", "0.5652661", "0.5589696", "0.55891114", "0.556782", "0.55567867", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0.55140406", "0...
0.0
-1
Get all placeholders from a template string.
def _get_placeholders(template): return [p[1] for p in string.Formatter().parse(template) if p[1] is not None and len(p[1]) > 0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_placeholders(self, format_string):\n placeholders = set()\n # Tokenize the format string and process them\n for token in self.tokens(format_string):\n if token.group(\"placeholder\"):\n placeholders.add(token.group(\"key\"))\n elif token.group(\"com...
[ "0.71580124", "0.67409444", "0.6394941", "0.6327401", "0.5901614", "0.58758324", "0.560435", "0.55591387", "0.55499095", "0.55314493", "0.5469728", "0.5336413", "0.52854705", "0.5263065", "0.51894563", "0.5146677", "0.51218146", "0.5087384", "0.50623006", "0.5057447", "0.5049...
0.7838539
0
Makes a filename from a template. Any placeholders that point to known file aliases will be prefilled. The rest is filled given the values provided by the user when requesting the filename.
def _substitute(template, files, user_values): # Get all placeholder names placeholders = _get_placeholders(template) # Pre-fill placeholders based on existing file aliases placeholder_values = _prefill_placeholders(placeholders, files, user_values) #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_filename(entry):\n template = \"{title}-{speaker}.pdf\"\n return template.format(**entry._asdict())", "def get_template_filename(template):\n config = read_config(SETTINGS_PATH)\n #String templates\n if (template in STRING_TEMPLATES):\n options = config.options(STRING_TEMPLATES_...
[ "0.64709675", "0.6383289", "0.627214", "0.6240936", "0.6196781", "0.61209327", "0.6086653", "0.59375006", "0.5933323", "0.5881599", "0.584232", "0.58317757", "0.5817147", "0.57615113", "0.5745475", "0.5736176", "0.5730721", "0.5712924", "0.57093763", "0.56978744", "0.5690951"...
0.70889616
0
Tries to delete a Security group
def _delete_security_group(self, group_id): group_to_delete = self.get_resource() if not group_to_delete: raise NonRecoverableError( 'Unable to delete security group {0}, because the group ' 'does not exist in the account'.format(group_id)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_security_group(self, security_group):\r\n return self.delete(self.security_group_path % (security_group))", "def delete(self, sg_id):\n self.client.delete_security_group(sg_id)", "def test_aws_service_api_vm_security_group_delete(self):\n pass", "def delete(self, oid):\n ...
[ "0.8178968", "0.81053555", "0.7877533", "0.78324956", "0.7786808", "0.7769312", "0.77647793", "0.76993644", "0.75547844", "0.75394404", "0.7535836", "0.7483521", "0.737226", "0.7364662", "0.7364633", "0.7307979", "0.7301483", "0.7301483", "0.72795534", "0.72782606", "0.724300...
0.75419956
9
Sets the ccf_ids of this PublishedApiPath.
def ccf_ids(self, ccf_ids): if ccf_ids is not None and len(ccf_ids) < 1: raise ValueError("Invalid value for `ccf_ids`, number of items must be greater than or equal to `1`") # noqa: E501 self._ccf_ids = ccf_ids
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ids(self, ids):\n self._ids = ids", "def __init__(self, ccf_ids=None): # noqa: E501\n self.openapi_types = {\n 'ccf_ids': List[str]\n }\n\n self.attribute_map = {\n 'ccf_ids': 'ccfIds'\n }\n\n self._ccf_ids = ccf_ids", "def invoice_ids(self, ...
[ "0.6275112", "0.61728823", "0.5786723", "0.56357884", "0.5586644", "0.55585057", "0.5339", "0.5272224", "0.5225076", "0.5160451", "0.51491076", "0.5092318", "0.5087153", "0.5079945", "0.5072161", "0.5031657", "0.50247496", "0.5022607", "0.50155085", "0.5005933", "0.49878728",...
0.6009279
2
Obtiene los objetos del modelo 'name'
def _get_objects(self, cr, uid, name, args=[], ids=None): obj = self.pool.get(name) if not ids: ids = obj.search(cr, uid, args) return obj.browse(cr, uid, ids)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getObjectByName(self, name):\n pass", "def __str__(self): \r\n return self.name", "def __str__(self): \n return self.name", "def get_all(self, name):\n\t\tpass", "def __str__(self):\n return self.name", "def __str__(self):\r\n return self.name", "def __str__(s...
[ "0.6555148", "0.61462766", "0.6058201", "0.6049102", "0.5957742", "0.5940858", "0.5940858", "0.5940858", "0.5920288", "0.59101236", "0.5902254", "0.5902254", "0.5866233", "0.5858096", "0.5857474", "0.58553004", "0.5830256", "0.5830256", "0.5830256", "0.5830256", "0.5830256", ...
0.0
-1
Returns the data between ``tmin`` and ``tmax``.
def getDataSegment(self, tmin, tmax, chunkN=10000): meta, units = self.getMetadata() nstart = int(meta.samplingRate * tmin) nrows = int(meta.samplingRate * (tmax - tmin)) return self.data.getDataSegment(nstart, nrows)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tas(tasmin: xr.DataArray, tasmax: xr.DataArray) -> xr.DataArray:\n tasmax = convert_units_to(tasmax, tasmin)\n tas = (tasmax + tasmin) / 2\n tas.attrs[\"units\"] = tasmin.attrs[\"units\"]\n return tas", "def data_range(x):\n return max(x)-min(x)", "def is_dataset_in_t_range(dataset, t_min, t...
[ "0.680804", "0.66929406", "0.6501322", "0.63619685", "0.6284432", "0.62795717", "0.6277218", "0.6178171", "0.60927814", "0.6066463", "0.60651124", "0.60347027", "0.5957372", "0.5908891", "0.58926105", "0.5786205", "0.57822526", "0.57638055", "0.57257944", "0.57212675", "0.568...
0.6668721
2
This method returns the intersection of the two boxes which have the largest IoU between them.
def best_iou2(list_bb): # Compute the number of predicted boxes n = len(list_bb) # if there are more than 0 predicted boxes, search for the 2 boxes if n != 0: tab_IoU = np.zeros((n, n)) for i in range(n): for j in range(i + 1, n): iou_val = IoU(list_bb[i], l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_iou(box, boxes):\n\n x_min_A, y_min_A, x_max_A, y_max_A = box[:4]\n x_min_B, y_min_B = boxes[:, 0], boxes[:, 1]\n x_max_B, y_max_B = boxes[:, 2], boxes[:, 3]\n # calculating the intersection\n inner_x_min = np.maximum(x_min_B, x_min_A)\n inner_y_min = np.maximum(y_min_B, y_min_A)\n ...
[ "0.73956984", "0.71836853", "0.7170263", "0.7155214", "0.70082915", "0.6993681", "0.698939", "0.6987429", "0.6926445", "0.6916235", "0.69158846", "0.6907434", "0.68955445", "0.6858592", "0.68514067", "0.68514067", "0.68451464", "0.6822879", "0.6788973", "0.6787203", "0.678649...
0.67638534
21
This method returns the union of the boxes which have an IoU larger than the threshold with the box of the Deep Learning
def deep_iou(list_bb, threshold): # Compute the number of predicted boxes n = len(list_bb) # if there are more than 0 predicted boxes, search for the valid boxes if n != 0: tab_IoU = np.zeros((n-1)) for i in range(n-1): iou_val = IoU(list_bb[i], list_bb[n-1]) ta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def threshold_iou(list_bb, threshold):\n\n # Compute the number of predicted boxes\n n = len(list_bb)\n\n # if there are more than 0 predicted boxes, search for the 2 boxes\n if n != 0:\n\n # Find the valid bounding boxes\n good_bb = set()\n for i in range(n):\n for j in...
[ "0.7467005", "0.7129809", "0.699382", "0.68625695", "0.68437773", "0.6774301", "0.65509975", "0.65509975", "0.6528361", "0.6509469", "0.6504449", "0.646909", "0.64670026", "0.6389136", "0.6363632", "0.6330493", "0.6278857", "0.6277431", "0.626782", "0.6250302", "0.6220109", ...
0.7454665
1
This method returns the union of the boxes which have an IoU larger than the threshold
def threshold_iou(list_bb, threshold): # Compute the number of predicted boxes n = len(list_bb) # if there are more than 0 predicted boxes, search for the 2 boxes if n != 0: # Find the valid bounding boxes good_bb = set() for i in range(n): for j in range(i + 1, n)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deep_iou(list_bb, threshold):\n\n # Compute the number of predicted boxes\n n = len(list_bb)\n\n # if there are more than 0 predicted boxes, search for the valid boxes\n if n != 0:\n tab_IoU = np.zeros((n-1))\n for i in range(n-1):\n iou_val = IoU(list_bb[i], list_bb[n-1])\...
[ "0.7115829", "0.6876892", "0.6781579", "0.6706805", "0.6560954", "0.65161544", "0.6474637", "0.64735657", "0.64083487", "0.64083487", "0.6384663", "0.6376866", "0.6332816", "0.6325833", "0.6288974", "0.6288974", "0.62464505", "0.6211646", "0.6177991", "0.60829705", "0.6051003...
0.73573524
0
Returns True if the given email account is authorized for access.
def IsPrivilegedUser(user_email, is_admin): return is_admin or (user_email and user_email.endswith('@google.com'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_candidate_access(application, email):\n\n authorized_email = application.authorized_email\n if authorized_email is not None and (\n authorized_email.lower() == email.lower()\n ):\n can_access = True\n else:\n can_access = False\n\n return can_access", "def is_authorize...
[ "0.72002715", "0.715686", "0.65535593", "0.6472498", "0.6438494", "0.64062756", "0.63325423", "0.6284809", "0.6248885", "0.6113496", "0.60954946", "0.6081167", "0.60208917", "0.60060054", "0.599386", "0.5983052", "0.58825487", "0.5844488", "0.58370996", "0.58026123", "0.57771...
0.5688053
30
Returns True if the given client id is whitelisted.
def IsWhitelistedClientId(client_id): return client_id in constants.WHITELISTED_CLIENT_IDS
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_whitelisted(self, instance_id):\n item = self.get_whitelist_instance(instance_id)\n if item is None:\n return False\n else:\n return True", "def is_whitelisted(self, instance_id):\n return self.is_tagged(instance_id, 'Whitelisted')", "def is_whitelisted(...
[ "0.7564243", "0.74454796", "0.6685991", "0.6605228", "0.6302355", "0.62129164", "0.6174267", "0.61502475", "0.60796034", "0.60279274", "0.5978961", "0.59389883", "0.57985216", "0.5767977", "0.56780225", "0.5610917", "0.56006", "0.5600555", "0.5579706", "0.5554736", "0.5528284...
0.86540294
0
Returns True if the given email account could trigger a new analysis.
def CanTriggerNewAnalysis(user_email, is_admin): if not appengine_util.IsStaging(): whitelisted_app_accounts = constants.WHITELISTED_APP_ACCOUNTS else: whitelisted_app_accounts = constants.WHITELISTED_STAGING_APP_ACCOUNTS return IsPrivilegedUser(user_email, is_admin) or (user_ema...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isEmailUsed(self, email):\n\n\t\ttestq = {\"email\": email};\n\t\ttest_result = self.db.request(\"getOne\", testq);\n\n\t\tif test_result:\n\t\t\treturn True;\n\t\telse:\n\t\t\treturn False;", "def _did_send_first_contact_email(app):\n first_contact = app[FIRST_CONTACT_EMAIL_SENT_KEY]\n if first_contac...
[ "0.61531615", "0.6061845", "0.6026742", "0.59239453", "0.5847844", "0.58315265", "0.57107997", "0.56831706", "0.5653294", "0.5650394", "0.5615384", "0.5586029", "0.55744314", "0.5564936", "0.5560094", "0.5557179", "0.55555564", "0.55457264", "0.55348986", "0.5502539", "0.5493...
0.6804463
0
Return an array containing the interspike intervals of the spike train. Accepts a `neo.SpikeTrain`, a `pq.Quantity` array, a `np.ndarray`, or a list of time spikes. If either a `neo.SpikeTrain` or `pq.Quantity` is provided, the return value will be `pq.Quantity`, otherwise `np.ndarray`. The units of `pq.Quantity` will ...
def isi(spiketrain, axis=-1): if isinstance(spiketrain, neo.SpikeTrain): intervals = np.diff(spiketrain.magnitude, axis=axis) # np.diff makes a copy intervals = pq.Quantity(intervals, units=spiketrain.units, copy=False) else: intervals = np.diff(spiketrain, axis=axis) if (int...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spiketraintimesel(spiketrain, t_start, t_stop):\n if not np.isscalar(t_start):\n if len(t_start) != len(t_stop):\n print('Argments t_start and t_stop must have the same size')\n return [], []\n else:\n spiketrainsel_list, spiketimesel_list = [], []\n ...
[ "0.6493261", "0.64629483", "0.5766802", "0.5764141", "0.54695255", "0.54156715", "0.5371095", "0.5355758", "0.5353865", "0.53306454", "0.5320814", "0.5271833", "0.51329505", "0.50532323", "0.49743178", "0.49617216", "0.494792", "0.4941848", "0.49282643", "0.48889938", "0.4878...
0.67497957
0
Probability density computed from the complexity histogram. Returns
def pdf(self): norm_hist = self.complexity_histogram / self.complexity_histogram.sum() # Convert the Complexity pdf to an neo.AnalogSignal pdf = neo.AnalogSignal( np.expand_dims(norm_hist, axis=1), units=pq.dimensionless, t_start=0 * pq.dimensionless, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probability_density(self, X):\n raise NotImplementedError", "def gc_prob_density(r):\n return np.exp(_interp_ln_dens(r))", "def density_ch(tensor):\n return 1 - sparsity_ch(tensor)", "def density(self, x):\n\t\tN = len(self.train_data)\n\t\tpoints = list(self.train_data)\n\t\tdists = [np.lin...
[ "0.7119956", "0.70265144", "0.66242903", "0.66035396", "0.6552839", "0.6490823", "0.64705616", "0.6378173", "0.63718146", "0.63632625", "0.6251723", "0.62419283", "0.62210286", "0.6212976", "0.62068456", "0.62064296", "0.61962306", "0.61776567", "0.6148402", "0.6148402", "0.6...
0.6131031
21
Return the smallest integral power of 2 that is equal or larger than `x`.
def nextpow2(x): log2_n = math.ceil(math.log2(x)) n = 2 ** log2_n return n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _find_nearest_power_of_two(x):\n\n return 1 << (x - 1).bit_length()", "def _nearest_bigger_power_of_two(x: int) -> int:\n y = 2\n while y < x:\n y *= 2\n return y", "def closest_power_2(x):\n if 2 ** (int(math.log(x, 2))) == x:\n return 2 ** (int(math.log(x - 1, 2)))\n e...
[ "0.8232767", "0.7974666", "0.7799261", "0.7797432", "0.77805525", "0.74885195", "0.7201394", "0.71892244", "0.7162341", "0.70785785", "0.6984928", "0.6726522", "0.6681027", "0.6673099", "0.66451067", "0.65780634", "0.65737385", "0.6560425", "0.65315294", "0.65307194", "0.6517...
0.72477764
6
Reset the specific workspace. Remove all resources of given workspace. If workspace name is empty, the current workspace will be modified.
def ResetWorkspace(workspace_name=''): ResetWorkspaceCC(workspace_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ResetWorkspace(workspace_name=''):\n _C.ResetWorkspace(workspace_name)", "def ClearWorkspace(workspace_name=''):\n _C.ClearWorkspace(workspace_name)", "def ClearWorkspace(workspace_name=''):\n ClearWorkspaceCC(workspace_name)", "def clear_workspace(client, workspace=None, filenames=None):\n a...
[ "0.7966801", "0.7577185", "0.7497874", "0.73873043", "0.6528225", "0.62132114", "0.62107277", "0.59795314", "0.5947789", "0.59110594", "0.58630645", "0.5845041", "0.577669", "0.5751771", "0.57010907", "0.5670471", "0.55394554", "0.55279255", "0.5428981", "0.54277605", "0.5358...
0.79124635
1
Query the name represented in current workspace.
def GetTensorName(tensor): return GetTensorNameCC(_stringify_tensor(tensor))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workspace_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"workspace_name\")", "def workspace_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"workspace_name\")", "def workspace_name(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"workspace_name\")", "...
[ "0.70013565", "0.70013565", "0.70013565", "0.67076975", "0.61967176", "0.6163396", "0.60812116", "0.5957047", "0.5957047", "0.5957047", "0.5957047", "0.5921463", "0.58235246", "0.5774391", "0.5762921", "0.5762921", "0.5762921", "0.5762921", "0.5762921", "0.5762921", "0.576292...
0.0
-1
Return the raw Magento data for ``self.magento_id``
def _get_magento_data(self): result = self.backend_adapter.read(self.magento_id) if result and result.get('attribute_id'): self.magento_id = result.get('attribute_id') return result else : #23/03/2017 #if attribute is import custom set to "No" in ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_raw_data(self):\n return self.__data", "def raw(self):\n return self.data", "def get_data(self):\n return {\"bcode\": self.barcode, \"prodid\": self.product_id}", "def raw_data(self):\n return self._raw_data", "def raw_data(self):\n return self._raw_data", "def ...
[ "0.63187206", "0.61803865", "0.6134642", "0.6042066", "0.6042066", "0.60308444", "0.60308444", "0.595182", "0.5945739", "0.58305377", "0.5811236", "0.5722459", "0.5722459", "0.5661492", "0.5661492", "0.5661492", "0.5601185", "0.5590722", "0.5507192", "0.549956", "0.54979384",...
0.68574977
0
id() int Returns a number that uniquely identifies this component.
def id(self): return id(self._component)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def component_id(self) -> str:\n return pulumi.get(self, \"component_id\")", "def component_id(self) -> str:\n return pulumi.get(self, \"component_id\")", "def component_id(self) -> ComponentId:\n return self.configuration.component_id", "def id(self):\n # Might also be a first 12-cha...
[ "0.81634444", "0.81634444", "0.7868774", "0.782611", "0.7802501", "0.77660114", "0.7758881", "0.7757853", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", "0.7751986", ...
0.89312774
0
Returns the default collector settings
def get_default_config(self): config = super(UDPCollector, self).get_default_config() config.update({ 'path': 'udp', 'allowed_names': 'InDatagrams, NoPorts, ' + 'InErrors, OutDatagrams, RcvbufErrors, SndbufErrors' }) return config
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_config(self):\r\n config = super(CMDCollector, self).get_default_config()\r\n config.update({\r\n 'enabled': 'True',\r\n 'fs': ',',\r\n 'timeout': 300,\r\n })\r\n return config", "def getDefaultSettings():\n return {}", "def ge...
[ "0.70514023", "0.7008024", "0.69490683", "0.6713433", "0.65743333", "0.65309024", "0.6521635", "0.6515402", "0.6466526", "0.6447688", "0.641337", "0.6397818", "0.6380512", "0.63683224", "0.6357208", "0.63517016", "0.6331759", "0.63120294", "0.62353724", "0.6231899", "0.620161...
0.62074906
20
Returns the absolute path to a file given by the relative path
def path(filename: str) -> str: path = os.path.dirname(sys.argv[0]) if not path: path = '.' return path + '/' + filename
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_abs_path(file_path, relative_path):\n import os\n dir_path = os.path.dirname(file_path)\n abs_path = os.path.join(dir_path, relative_path)\n return abs_path", "def getAbsolutePath(relPath):\n currDir = os.path.dirname(__file__)\n return os.path.join(currDir, relPath)", "def relative_p...
[ "0.85994697", "0.78654426", "0.7853082", "0.7837121", "0.7780681", "0.77586025", "0.77358365", "0.7710484", "0.7639049", "0.760071", "0.75819683", "0.75277907", "0.7514124", "0.7490403", "0.74542934", "0.7454193", "0.7432706", "0.74195486", "0.7414446", "0.7407167", "0.739119...
0.6700842
95
adds motion blur at given angel to the image.
def add_motion_blur(image, kernel_size, angle): kernel = sol5_utils.motion_blur_kernel(kernel_size, angle) return scipy.ndimage.filters.convolve(image, kernel)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def blur_slide(self):\r\n std_input = self.horizontal.get() # Get the user STD input\r\n img = self.master.images[-1] # Select the displayed image for transformation\r\n blurred_image = blur.gaussian_blur(img, std_input) # Perform gaussian blurring on the input image\r\n self.mas...
[ "0.60605735", "0.60226476", "0.5957153", "0.5946662", "0.5924968", "0.5920352", "0.5920352", "0.58782876", "0.5824981", "0.57857263", "0.5776827", "0.57483697", "0.573825", "0.5737287", "0.5730932", "0.5693681", "0.56637216", "0.5510511", "0.550405", "0.5454563", "0.5448282",...
0.6321507
0
return an specific motion blur to image
def _motion_blur_for_learn_deblurring_model(image): return random_motion_blur(image, [7])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Blur(image):\n\n return cv2.GaussianBlur(image,(7,7),0)", "def reblur(inp_img):\n\n img = np.array(inp_img)\n kernel_deviation = 1.5\n y_img = cv2.GaussianBlur(img, (11, 11), kernel_deviation)\n\n return y_img", "def RandomMotionBlur(img, kernel):\r\n kernel_motion_blur = CreateMotionKern...
[ "0.75197524", "0.74753124", "0.74634266", "0.73787653", "0.7351138", "0.7347236", "0.7347236", "0.72560805", "0.72475135", "0.7027281", "0.7001197", "0.69660026", "0.6961478", "0.6913347", "0.68922466", "0.68882436", "0.6856979", "0.6832801", "0.68317246", "0.6806728", "0.677...
0.742846
3
Gets the list of most popular movies from Videeo. Gets all movies in descending order of their average rating. Excludes any movies with a rating lower than 'min_rating'.
def get_popular(min_rating=3): # gets back a list of movie ids, in descending order of rating movie_results = Rating.objects.values('movie__m_id').annotate(rating=Avg('rating'))\ .order_by('-rating').filter(rating__gte=min_rating) movie_ids = [m['movie__m_id'] for m in movie_results]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_best_for_genre(genre, rated_movies=None, min_ratings=5):\n rated_movies = rated_movies if rated_movies is not None else load_movies_rated()\n in_genre = rated_movies['genres'].map(lambda genres: genre in genres)\n enough_ratings = rated_movies['num_ratings'] > min_ratings\n valid = rated_movies...
[ "0.70340586", "0.6928632", "0.6913326", "0.6388382", "0.63848567", "0.63267213", "0.62956077", "0.62572306", "0.6256958", "0.6192984", "0.61723053", "0.6171027", "0.614202", "0.61292315", "0.6128649", "0.60818607", "0.6050333", "0.6035789", "0.6014729", "0.5886794", "0.586519...
0.80987626
0
Stop the audio stream.
def stop(self): self.stream.stop_stream()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stop(self):\n self.stream.stop()\n self.running = False", "def stop(self) -> None:\n self._stream.stop()", "def stop(self) -> None:\n self._stream.stop()", "def stop(self):\n self.prestop()\n if not self._graceful:\n self._graceful = True\n self.str...
[ "0.7701117", "0.76953137", "0.7615434", "0.7450446", "0.7354546", "0.73386073", "0.7262591", "0.72359985", "0.72359985", "0.7014574", "0.6972987", "0.69596606", "0.6844021", "0.68406713", "0.67888784", "0.67817616", "0.67804784", "0.677045", "0.6749673", "0.6715556", "0.67075...
0.76714396
2
Return the name of the sensor.
def name(self): return self._name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def name(self):\n return self._sensor.name", "def get_sensor_name(self):\n return self.data[1]", "def name(self):\n return self.device.device_data[self.device_id]['name'] + \\\n f' {self._sensor_type}'", "def name(self):\n return f\"{self._name} {SENSOR_TYPES[self.senso...
[ "0.91896784", "0.9168378", "0.890185", "0.8770976", "0.8511273", "0.8479953", "0.844435", "0.8299758", "0.8186503", "0.8105667", "0.8079737", "0.8066149", "0.8049647", "0.7700968", "0.7612295", "0.7611456", "0.7600605", "0.7600605", "0.7600605", "0.75392073", "0.75166553", ...
0.0
-1
Return the unique of the sensor.
def unique_id(self): return self._unique_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_id(self):\n return self.device_id + '_' + self._sensor_type", "def get_unique(self):\n return self.serie.nunique()", "def unique_id(self):\n id = \"{}{}{}\".format(\n DOMAIN, self._account, self.sensorName.lower().replace(\" \", \"\")\n )\n return id", ...
[ "0.7506052", "0.73454386", "0.71411604", "0.7065196", "0.7048771", "0.6793633", "0.6561676", "0.65580696", "0.65379405", "0.6512118", "0.6511427", "0.6476796", "0.6450381", "0.6437327", "0.64008117", "0.638688", "0.63762265", "0.63412493", "0.63340086", "0.63236713", "0.62874...
0.61973107
43
Return the device class of the sensor.
def device_class(self): return SENSOR_TYPES[self._type][1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_class(self):\n return self.sensor_type[\"class\"]", "def device_class(self):\n return SENSOR_TYPES[self.sensor][3].get(\"device_class\")", "def device_class(self):\n return self._sensor_type", "def device_class(self):\r\n return self._sensor_cfg[3]", "def device_class...
[ "0.936224", "0.9243053", "0.923953", "0.9161606", "0.9161606", "0.91570854", "0.8956232", "0.8953195", "0.8950455", "0.89203155", "0.8719521", "0.87172604", "0.8707727", "0.86602074", "0.8652333", "0.8396148", "0.8383337", "0.8381255", "0.8381255", "0.8381255", "0.83367515", ...
0.9040543
7
Return the state attributes of the device.
def device_state_attributes(self): return { ATTR_ATTRIBUTION: ATTRIBUTION, ATTR_LAST_UPDATE: self.metoffice_now.date if self.metoffice_now else None, ATTR_SENSOR_ID: self._type, ATTR_SITE_ID: self.metoffice_site_id if self.metoffice_site_id else None, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_state_attributes(self):\r\n return self.attributes", "def device_state_attributes(self):\r\n return self._attributes", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_attributes(self):\n return self._state_attrs", "def device_state_a...
[ "0.92738223", "0.92053986", "0.91516256", "0.91516256", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148889", "0.9148746", "0.9148746", "0.9137698", "0.9110632",...
0.82271665
50
Calculates effect size for nonproportional data.
def _effect_size_nonprop(control, test): d_control = DescrStatsW(control) d_test = DescrStatsW(test) return effect_size_cohen(d_control.mean, d_test.mean, d_control.nobs, d_test.nobs, d_control.std, d_test.std)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalized_effect_size(self):\n mus = self.mu + self.absolute_effects\n pop_mu = (mus * self.test_splits).sum()\n sigma2_m = (self.test_splits * np.square(mus - pop_mu)).sum()\n f = np.sqrt(sigma2_m) / self.sigma\n return f", "def effectsize_normal(self, prob=None):\n ...
[ "0.7119022", "0.6342775", "0.63074774", "0.62616235", "0.61959773", "0.6046894", "0.60398793", "0.58502096", "0.5848326", "0.58346575", "0.57936573", "0.5783445", "0.5722568", "0.5711514", "0.56794244", "0.5677118", "0.5665433", "0.5663338", "0.564474", "0.56443065", "0.56163...
0.617715
5
Computes one convergent fraction
def revContFraction(a): N = 1 D = a[len(a)-1] for i in range(len(a)-2, -1, -1): N += D * a[i] tmp = N N = D D = tmp return (N,D)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simplify (self):\n if (self.debug): print(f'enter fraction.simplify')\n hcf = find_hcf(self.value[0], self.value[1])\n self.value = (self.value[0] // hcf.product(), self.value[1] // hcf.product())\n return", "def reduce(self):\n import math\n g = math.gcd(self.num, self.den)\n ...
[ "0.6632698", "0.6612296", "0.6512855", "0.6405199", "0.6393247", "0.6328791", "0.6323339", "0.6229324", "0.6212909", "0.620456", "0.62002426", "0.6165748", "0.61201674", "0.6110797", "0.60554385", "0.60514224", "0.6017895", "0.6011515", "0.6007244", "0.597871", "0.5952201", ...
0.60397726
16
Create dataset reference from dataset.
def from_dataset(self, dataset=None): if not dataset: raise aspecd.exceptions.MissingDatasetError self.type = aspecd.utils.full_class_name(dataset) self.id = dataset.id self.history = copy.deepcopy(dataset.history)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dataset_reference(self, dataset_name):\n\n print_debug(\"Geting dataset :\" + dataset_name)\n dataset = DatasetFactory.get(dataset_file_name=dataset_name)\n return dataset", "def add_reference(self, dataset=None):\n if not dataset:\n raise aspecd.exceptions.MissingD...
[ "0.7274347", "0.67541945", "0.66489094", "0.6634503", "0.65469825", "0.65316373", "0.6378611", "0.6367565", "0.63656896", "0.6327208", "0.6287988", "0.6274847", "0.62744", "0.6268349", "0.6261156", "0.6244324", "0.6222291", "0.6204049", "0.6188746", "0.6171622", "0.6147788", ...
0.68830264
1
Nonpublic method creating the actual (empty) dataset object.
def _create_dataset(source=''): return ExperimentalDataset()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.__dataset = None", "def __init__(self, dataset: Dataset):\n self.dataset = dataset", "def __init__(self, dataset):\n self._dataset = dataset", "def build_dataset(self):\n self.dataset = KITTIBEVDataset(self.dataset_config, self.transform)\n return...
[ "0.75642174", "0.7556849", "0.7466317", "0.7246786", "0.7225319", "0.72003406", "0.70721096", "0.7037645", "0.697931", "0.6922149", "0.6905983", "0.68870157", "0.6862843", "0.68362135", "0.6798097", "0.6785224", "0.67833054", "0.6766246", "0.6760445", "0.6702157", "0.669537",...
0.733732
3
Get or set the index corresponding to the axis values. The index is a list of data labels for each element in the axis
def index(self): return self._index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index(self, value):\n\n if not _isstr(value):\n return self._ax.index(value)\n else:\n raise TypeError(\n \"index({value}) cannot be a string for a numerical axis\".format(\n value=value\n )\n )", "def axis_index(...
[ "0.670616", "0.6673953", "0.6495107", "0.63223773", "0.63015646", "0.6292271", "0.61369073", "0.6121951", "0.6089462", "0.6066161", "0.60489064", "0.60489064", "0.60437024", "0.6036631", "0.6009797", "0.5990606", "0.59399116", "0.59118307", "0.588701", "0.585114", "0.5803004"...
0.0
-1
Return whether the axes values are equidistant. True if the axis values are equidistant, False otherwise. None in case of no axis values. The property is set automatically if axis values are set and therefore readonly. While simple plotting of data values against nonuniform axes with nonequidistant values is usually st...
def equidistant(self): return self._equidistant
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_equidistant(self) -> bool:\n if len(self.time) < 3:\n return True\n return len(self.time.to_series().diff().dropna().unique()) == 1", "def _validate_axes(self):\n if not (\n np.abs(self.axis_u.dot(self.axis_v) < 1e-6)\n and np.abs(self.axis_v.dot(self....
[ "0.66698897", "0.61169755", "0.588325", "0.5786408", "0.5736001", "0.5614308", "0.5459992", "0.53591156", "0.5328026", "0.53064346", "0.529953", "0.52876586", "0.5242716", "0.5231172", "0.5211766", "0.52102655", "0.5177504", "0.5170575", "0.5126591", "0.5118351", "0.5114907",...
0.6644519
1
Find the decimal value of any character in the alphabet.
def decimal_value_of(self, char): return self.__alphabet.find(char)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetNumByChar(self, inputChar):\n # ROTOR USE ONLY\n for char, num in self.alphabet.items():\n if char == inputChar:\n return num", "def get_value(word):\n letters = 'abcdefghijklmnopqrstuvwxyz'\n sum = 0\n for letter in word:\n letter_va...
[ "0.6955777", "0.68831295", "0.66964316", "0.652347", "0.6448869", "0.6403654", "0.6401977", "0.6364307", "0.6364307", "0.63437116", "0.62967074", "0.6291315", "0.6281344", "0.6249494", "0.6237745", "0.62115896", "0.62030464", "0.61929226", "0.61827475", "0.6163866", "0.616273...
0.8357886
0
Renders the table using the template from the table options.
def render(self): breadcrumb_template = template.loader.get_template(self.template) extra_context = {"breadcrumb": self} return breadcrumb_template.render(extra_context, self.request)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_html(self):\r\n template = get_template(self.template)\r\n request = build_request()\r\n return template.render(RequestContext(request, {'table': self}))", "def as_html(self): # pragma: no cover\n\n return render_to_string(\n self._meta.template,\n { \"tab...
[ "0.74242055", "0.6807843", "0.6338291", "0.6253442", "0.6233681", "0.6226873", "0.6200433", "0.6182743", "0.6181057", "0.6161903", "0.6133231", "0.60895705", "0.60802", "0.60788226", "0.60330886", "0.6029842", "0.6007357", "0.59582686", "0.59577566", "0.5919672", "0.59115946"...
0.0
-1
We should be able to create an account with a username and a password.
def test_register(self): url = '/register/' data = {'username' : 'testUser1234', 'password' : 'pass12345'} # The amazing password... response = self.client.post(url, data, format='json') self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(User.objects.count(), 2) # Every user mu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_account(self, username, email, password):\r\n resp = self.client.post('/create_account', {\r\n 'username': username,\r\n 'email': email,\r\n 'password': password,\r\n 'location': 'home',\r\n 'language': 'Franglish',\r\n 'name': 'F...
[ "0.82805216", "0.80722266", "0.79142463", "0.77801514", "0.76982284", "0.7565461", "0.73977983", "0.736303", "0.7340366", "0.7326268", "0.732512", "0.7303432", "0.7249793", "0.72208565", "0.7209573", "0.71971095", "0.7193995", "0.71871245", "0.7186993", "0.7147596", "0.713769...
0.0
-1
Login should fail with 400 for a nonexistent user.
def test_login_wrong_credentials(self): data = {'username' : 'nonexistentuser', 'password' : 'nopasswordlol'} response = self.login(data) error_text = "Unable to log in with provided credentials." self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) try: if error_text not in response.data[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_user_login_bad_request(self):\n response = self.client.post(\n CONSTS.USER_LOGIN_URL,\n data={\n 'login': 'bad_login',\n 'password': 'StrongPassword123'\n },\n format='json'\n )\n self.assertEqual(response.statu...
[ "0.81295794", "0.80571836", "0.7867218", "0.78567404", "0.77576935", "0.7749023", "0.7701434", "0.7656769", "0.7617358", "0.7607421", "0.7607303", "0.7559471", "0.75544244", "0.7552302", "0.7552069", "0.7493191", "0.74792325", "0.74773717", "0.7452797", "0.74496764", "0.74424...
0.744154
21
Return a custom 404 error.
def page_not_found(e): return 'Sorry, Nothing at this URL.', 404
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def not_found():\n return HttpError(404)", "def error_404(error):\n return '404 Error'", "def error_404(error):\n return 'Bummer, there is nothing at this URL.'", "def error_not_found(error):\n return 'No page here, dood. 404!', 404", "def not_found(self, error):\n return jsonify({'error': 'NO...
[ "0.81159586", "0.80410045", "0.7738874", "0.77369535", "0.77182025", "0.7689595", "0.7670471", "0.76112473", "0.7602477", "0.7570698", "0.75528365", "0.7545827", "0.751882", "0.74745256", "0.7458403", "0.7455682", "0.74548143", "0.74505144", "0.7442062", "0.7428278", "0.74065...
0.7254463
40
Returns the Iterator object
def __iter__(self): return iter(self.model)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __iter__(self):\n return self._next()", "def __iter__(self):\n return self._next()", "def __iter__(self):\n return self._next()", "def getIter(object):\n iterator = None\n try:\n iterator = iter(object)\n except TypeError:\n pass\n return iterator", "def _...
[ "0.7819556", "0.7819556", "0.7819556", "0.7808058", "0.7799018", "0.7789657", "0.7777762", "0.773226", "0.7575465", "0.7549315", "0.753738", "0.75318533", "0.75247055", "0.75146395", "0.75007915", "0.74823695", "0.74823695", "0.74823695", "0.74823695", "0.74823695", "0.748236...
0.0
-1
takes input size and generates a random torch tensor to test the model
def get_random_input(self, input_shape): n_channels = input_shape[0] input_size = input_shape[1:] return torch.rand(1, n_channels, *input_size)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_a_tensor():\n dev = random.choice(devices)\n shape = random.choice(((1), (2, 3), (4, 5, 6), (7, 8, 9, 10)))\n t = torch.rand(shape).to(dev)\n nonlocal expected\n expected += t.numel()\n return t", "def sample_prior(size):\n return torch...
[ "0.7177327", "0.7068587", "0.681733", "0.6694878", "0.6537697", "0.6432953", "0.6419269", "0.63683456", "0.63182", "0.6280436", "0.6278364", "0.62698174", "0.6253921", "0.6236155", "0.6138442", "0.6135494", "0.61175203", "0.6109991", "0.6106022", "0.60953075", "0.60860944", ...
0.5803678
51
The string id associated with this analysis
def figure_id(self): return str(self.analysis)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self):\n return str(self.get_data(\"id\"))", "def id(self) -> str:\n pass", "def id(self) -> str:\r\n return self._id", "def idstring(self):\n return self.server.idstring(self)", "def get_id(self): # real signature unknown; restored from __doc__\n return \"\"", "...
[ "0.7914687", "0.78192365", "0.7763028", "0.7744371", "0.77217525", "0.7719384", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.76688325", "0.7660906", "...
0.0
-1
Check whether it is a sequence of some type.
def is_seq_of(seq, expected_type, seq_type=None): if seq_type is None: exp_seq_type = abc.Sequence else: assert isinstance(seq_type, type) exp_seq_type = seq_type if not isinstance(seq, exp_seq_type): return False for item in seq: if not isinstance(item, expected_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_proper_sequence(seq):\n return (isinstance(seq, collections.abc.Sequence) and\n not isinstance(seq, str))", "def isSequence(obj):\n # type: (Any) -> bool\n return isinstance(obj, Sequence)", "def is_sequence(self) -> bool:\n return isinstance(self.yaml_node, yaml.SequenceNode...
[ "0.79112864", "0.78849316", "0.76932395", "0.7483998", "0.7476312", "0.7452354", "0.74039936", "0.73786527", "0.73713434", "0.73557633", "0.72904116", "0.7143708", "0.7142964", "0.6890467", "0.6862335", "0.68508655", "0.66771424", "0.66130203", "0.6598843", "0.65937495", "0.6...
0.8278426
0
Slice a list into several sub lists by a list of given length.
def slice_list(in_list, lens): if isinstance(lens, int): assert len(in_list) % lens == 0 lens = [lens] * int(len(in_list) / lens) if not isinstance(lens, list): raise TypeError('"indices" must be an integer or a list of integers') elif sum(lens) != len(in_list): raise ValueEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice_list(input, size):\n input_size = len(input)\n slice_size = input_size // size\n remain = input_size % size\n result = []\n iterator = iter(input)\n for i in range(size):\n result.append([])\n for j in range(slice_size):\n result[i].append(next(iterator))\n ...
[ "0.75841886", "0.7578515", "0.7286935", "0.7256224", "0.7206369", "0.7065988", "0.69726545", "0.6897537", "0.6890562", "0.6884979", "0.6857191", "0.6840832", "0.6838281", "0.68362945", "0.6706136", "0.6704703", "0.66583204", "0.66537356", "0.6650528", "0.66388154", "0.6633278...
0.68237764
14
Concatenate a list of list into a single list.
def concat_list(in_list): return list(itertools.chain(*in_list))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def concat(list_of_lists):\n return reduce(lambda a,b : a+b,list_of_lists,[])", "def cat_lists(*list_args):\n result = []\n for List in list_args:\n result.extend(List)\n\n return result", "def concatenateList(list1, list2):\n outputList = []\n\n ## list1\n # i...
[ "0.83569485", "0.7658576", "0.76351273", "0.752857", "0.7474277", "0.73940736", "0.73832667", "0.7324224", "0.7311471", "0.72927034", "0.72693926", "0.7179423", "0.7147368", "0.7017182", "0.7000582", "0.6957898", "0.6942505", "0.69308966", "0.69212574", "0.69006956", "0.68883...
0.8158095
1
Obtain thresholds and image masks directly from image. Abstracts away the need to handle histogram generation.
def full_method(img, L=256, M=32): # Calculate histogram hist = cv2.calcHist( [img], channels=[0], mask=None, histSize=[L], ranges=[0, L] ) thresholds = otsu.modified_TSMO(hist, M=M, L=L) masks = otsu.multithreshold(img, thresholds) return thresholds, mas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, image: np.ndarray) -> np.ndarray:\n # convert the image into the hsv colour space\n image_hsv = rgb2hsv(image)\n\n # use Otsu's method to find the thresholds for hue and saturation\n thresh_h = threshold_otsu(image_hsv[:, :, 0])\n thresh_s = threshold_otsu(imag...
[ "0.6563018", "0.6370107", "0.63619435", "0.6313332", "0.6211727", "0.61615443", "0.6060991", "0.6009466", "0.59960824", "0.59922373", "0.5976325", "0.5975568", "0.5906319", "0.58952147", "0.58911747", "0.5884242", "0.5878501", "0.5872466", "0.58495414", "0.58211845", "0.58153...
0.5666779
40
View function for home page of site
def index(request): # Form: # If this is a POST request then process the Form data if request.method == 'POST': form = AddRecipeForm(request.POST) # Check if the form is valid: if form.is_valid(): # Create new record get_recipe = Recipe(form.cleaned_data['url...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def home(request):\n\treturn render(request, \"compta/home.html\")", "def home_page(request):\r\n return render(request, 'ez_main/home_page.html')", "def home(request):\r\n return render(request, 'home.html')", "def homepage(request):\n\treturn render(request, 'core/homepage.html')", "def home(request...
[ "0.85561705", "0.8463156", "0.8426648", "0.8388098", "0.8337306", "0.83208233", "0.8319217", "0.8253385", "0.8186879", "0.8180329", "0.8155009", "0.81181335", "0.8090556", "0.80876964", "0.80813605", "0.80692863", "0.80689037", "0.80665994", "0.80665994", "0.80665994", "0.806...
0.0
-1
Get a single example from the dataset
def __getitem__(self, index): # get and load sample from index file sample = self.samples[index] # labels = self.labels return load_sample(sample, self.imgTransform, self.use_s1, self.use_s2, self.use_RGB)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def example(self):\n result = getattr(self, '_example', None)\n if result is None:\n # No example batch was found, so get one from the `.train` dataset\n result = next(iter(self.train))\n # And cache it for next time\n self._example = result\n return result", "def get_first_element(dataset):\n ...
[ "0.7115562", "0.66712093", "0.64783984", "0.6403151", "0.6335547", "0.6269411", "0.61371744", "0.60608315", "0.6044252", "0.59989613", "0.59826136", "0.59711236", "0.5924923", "0.5903227", "0.58972275", "0.5886283", "0.57957745", "0.5786258", "0.5776925", "0.57686067", "0.575...
0.55057466
43
Equality does not include the message ID, which should be unique between different instances.
def __eq__(self, other): result = NotImplemented if isinstance(other, Message): result = False if self is other: result = True else: # does not compare _id if (self._message_length == other._message_length and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, message):\n return (self.source == message.source and\n self.destination == message.destination and\n self.size_bytes == message.size_bytes and\n self.message_type == message.message_type and\n self.data == message.data)", "def _...
[ "0.70127857", "0.6743486", "0.66894925", "0.66731906", "0.6627223", "0.6595702", "0.65352756", "0.65295297", "0.65107906", "0.64951575", "0.64414275", "0.6438396", "0.64345294", "0.6383868", "0.63804936", "0.63795507", "0.63537985", "0.6348592", "0.6348143", "0.6338608", "0.6...
0.6758602
1
Tests if other is not equal to this instance.
def __ne__(self, other): eq = self.__eq__(other) if eq is not NotImplemented: return not eq else: return NotImplemented
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__ (self, other):\n return not self == other", "def __ne__(self, other):\n # type: (object) -> bool\n return not self == other", "def __ne__(self, other):\n # type: (object) -> bool\n return not self == other", "def __ne__(self, other):\n # type: (object) -> ...
[ "0.90741354", "0.8946026", "0.8946026", "0.8946026", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0.890229", "0....
0.0
-1
Returns the last header added to the message. May be None if no headers available. The header is removed from the stack of headers.
def pop_header(self): header = None if self._headers: header = self._headers.pop() self._set_message_length() return header
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def peek_header(self):\n header = None\n if self._headers:\n # returns the last element on the list\n header = self._headers[-1:]\n\n return header", "def getLastHeader(self, headerName: str, default = None):\n return self._headers.get(headerName, default)", "d...
[ "0.7802154", "0.73739195", "0.67139435", "0.62423646", "0.623711", "0.6096702", "0.59779835", "0.5943574", "0.5941998", "0.5941998", "0.5941998", "0.5928577", "0.57978076", "0.5756973", "0.5720089", "0.57079345", "0.57037115", "0.5655182", "0.5655182", "0.5655182", "0.5647583...
0.7823903
0