query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Computes voltage drop using abf object and epoch index.
def voltage_drop_abf(abf, epoch_start): vmin = Vmin_abf(abf, epoch_start) resting = Vrest_abf(abf, epoch_start) return vmin - resting
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def voltage_drop(V):\n vmin = Vmin(V)\n resting = Vrest(V)\n return vmin - resting", "def __call__(self, epoch):\n exp = np.floor((1 + epoch) / self.dropEvery)\n alpha = initAlpha * (self.factor ** exp)\n \n # return alpha \n return float(alpha)", "def deredden(EBV,f...
[ "0.60475296", "0.5323616", "0.5242114", "0.5225883", "0.5147038", "0.5052979", "0.5022212", "0.50195706", "0.50011486", "0.4997545", "0.4979149", "0.49542353", "0.49397612", "0.49350744", "0.49276263", "0.49276263", "0.4927134", "0.49154943", "0.4914897", "0.49054533", "0.487...
0.7607646
0
Computes capacitance from the time constant tau and membrane resistance Rm.
def capacitance(tau, Rm): return tau/Rm
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vcapcharge(t, Vs, R, C):\n if t < 0:\n raise ValueError(\"Time must be greater than or equal to zero.\")\n if R * C == 0:\n raise ValueError(\"Resistance and Capacitance must be non-zero.\")\n Vc = Vs * (1 - _np.exp(-t / (R * C)))\n return Vc", "def TCMB(rs):\n\n return 0.235e-3 ...
[ "0.60113776", "0.5732019", "0.5719932", "0.5657031", "0.5627349", "0.5524498", "0.540581", "0.53926945", "0.53923887", "0.5390512", "0.5366869", "0.5360185", "0.5343438", "0.5330854", "0.5330817", "0.5262412", "0.52592707", "0.52560985", "0.52401096", "0.5227372", "0.5217925"...
0.79187113
0
Computes the time constant (usually called tau) using a fit to an exponential function.
def time_constant(t, V): a_init = 1 b_init = -100 c_init = V[-1] popt, pcov = curve_fit(func_exp, t, V, p0=[a_init, b_init, c_init], bounds=(-np.inf, np.inf)) Vpred = np.zeros(len(t)) for i in range(len(t)): Vpred[i] = func_exp(t[i], popt[0], popt[1], popt[2]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exp(t,tau):\n return np.exp(-t/tau)", "def exp_func(x, initial, lifetime):\n return initial * np.exp(-x/lifetime)", "def time_constant_abf(abf, epoch_start):\n p0 = abf.sweepEpochs.p1s[epoch_start]\n p1 = abf.sweepEpochs.p1s[epoch_start + 1]\n\n t = abf.sweepX[p0:p1] - abf.sweepX[p0]\n V ...
[ "0.7259245", "0.6025949", "0.59778154", "0.59671766", "0.59623075", "0.5949129", "0.5861898", "0.5844591", "0.58408463", "0.58236575", "0.58123475", "0.58123475", "0.57859", "0.5768751", "0.5766582", "0.57458115", "0.57265747", "0.56759924", "0.56325513", "0.5629962", "0.5628...
0.69503814
1
Computes time constant using abf object and epoch index.
def time_constant_abf(abf, epoch_start): p0 = abf.sweepEpochs.p1s[epoch_start] p1 = abf.sweepEpochs.p1s[epoch_start + 1] t = abf.sweepX[p0:p1] - abf.sweepX[p0] V = abf.sweepY[p0:p1] return time_constant(t, V)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def epoch():\n\treturn time.time()", "def scheduler(epoch):\n return alpha / (1 + decay_rate * epoch)", "def schedule(epoch):\n return alpha / (1 + (decay_rate * epoch))", "def to_timestamp(index, base_dt, fps=4):\n ts = time.mktime(base_dt.timetuple())\n return ts + index * (1.0 / fps)",...
[ "0.60388803", "0.5923182", "0.5861852", "0.5851152", "0.5816836", "0.5719287", "0.56861186", "0.56355155", "0.5511518", "0.5490061", "0.54632735", "0.5410102", "0.539538", "0.53734636", "0.53531617", "0.53530735", "0.53180134", "0.5299205", "0.5292408", "0.52918327", "0.52644...
0.7036398
0
Computes input membrane resistance Rm using current trace I and voltage trace V.
def input_membrane_resistance(I, V): V1 = V[0] V2 = V[-1] I1 = I[0] I2 = I[-1] dV = V2 - V1 dI = I2 - I1 return dV / dI
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scoreCirc_VoltageReference(circuit, gen, indi, makeRedundancyInMatrix):\n #----------#\n VREF = 1.5\n #----------#\n \n FullBigCircuitMatrix = deepcopy(circuit.fullRedundancyMatrix)\n rowsR,columnsR,columnsC,rowsC = sortedNonZeroIndices(FullBigCircuitMatrix)\n\n matrixDensity = float(len(rowsR))/float((...
[ "0.560289", "0.5515143", "0.54086477", "0.53610516", "0.53610516", "0.5335618", "0.5252791", "0.5252791", "0.5249713", "0.5220318", "0.51931876", "0.51924676", "0.51635695", "0.5152857", "0.5121018", "0.5117766", "0.5107696", "0.5075379", "0.50642395", "0.505149", "0.5047355"...
0.7239529
0
Computes input membrane resistance Rm using abf object and epoch index.
def input_membrane_resistance_abf(abf, epoch_start): p0 = abf.sweepEpochs.p1s[epoch_start] p1 = abf.sweepEpochs.p1s[epoch_start + 1] V = abf.sweepY[p0:p1] I = abf.sweepC[p0-1:p1] return input_membrane_resistance(I, V)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abs_units(wb_run,sample_run,mono_van,wb_mono,samp_rmm,samp_mass,ei_guess,rebin,map_file,monovan_mapfile,**kwargs): \n #available keywords\n #abs_units_van_range\n global reducer, rm_zero,inst_name,van_mass,bleed_switch,rate,pixels\n print 'DGreduce run for ',inst_name,'run number ',sample_run\n...
[ "0.5661596", "0.5583767", "0.5244712", "0.52179146", "0.50538725", "0.5035523", "0.50179875", "0.49651486", "0.49581146", "0.4953757", "0.4952349", "0.4940061", "0.49252868", "0.4917301", "0.4902398", "0.48844683", "0.4883962", "0.48734564", "0.48699412", "0.48697597", "0.486...
0.72315216
0
Computes spike amplitude from voltage trace V and spike index t_spike.
def spike_amplitude(V, t_spike): # handle no spike found if t_spike is None: return None Vmax = V[t_spike] Vmin = np.min(V[t_spike+1:t_spike+500]) return Vmax - Vmin
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spike_amplitude_abf(abf, t_spike, epoch_start=3):\n p0 = abf.sweepEpochs.p1s[epoch_start]\n V = abf.sweepY[p0:-1]\n\n return spike_amplitude(V, t_spike)", "def get_spike_frequency_adaptation(t, V):\n # check that there are 2 spikes minimum\n intervals = interspike_intervals(t, V)\n raise_if...
[ "0.6659725", "0.65162295", "0.64531356", "0.64009815", "0.63487196", "0.60847944", "0.59346", "0.5815772", "0.5731569", "0.56815606", "0.5331351", "0.5330158", "0.53281474", "0.5322849", "0.5302969", "0.52671605", "0.52634954", "0.52188766", "0.5206136", "0.51838505", "0.5182...
0.8268467
0
Computes spike amplitude from abf object with epoch index and the index of the spike time. Note that t_spike should be found within the same epoch, otherwise there be an index mismatch.
def spike_amplitude_abf(abf, t_spike, epoch_start=3): p0 = abf.sweepEpochs.p1s[epoch_start] V = abf.sweepY[p0:-1] return spike_amplitude(V, t_spike)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_spike_frequency_abf(abf, epoch):\n p0 = abf.sweepEpochs.p1s[epoch]\n p1 = abf.sweepEpochs.p1s[epoch+1]\n t = abf.sweepX[p0:p1]\n V = abf.sweepY[p0:p1]\n return avg_spike_frequency(t, V)", "def spike_amplitude(V, t_spike):\n # handle no spike found\n if t_spike is None:\n retur...
[ "0.71000993", "0.66413033", "0.59593457", "0.57064515", "0.560591", "0.5349984", "0.52664065", "0.5201257", "0.51858026", "0.5102255", "0.50289434", "0.5015051", "0.501375", "0.5008975", "0.49718475", "0.49624377", "0.49535725", "0.4944559", "0.49286938", "0.49224788", "0.491...
0.8097871
0
Finds index in an array `arr` closest to value `val`.
def find_nearest_idx(arr, val): arr = np.asarray(arr) idx = (np.abs(arr - val)).argmin() return idx
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_nearest(arr, val):\n\n arr = np.asarray(arr)\n idx = (np.abs(arr - val)).argmin()\n return idx, arr[idx]", "def find_nearest(arr, val):\n arr = np.asarray(arr)\n idx = (np.abs(arr - val)).argmin()\n return idx, arr[idx]", "def find_index(arr, val):\n index = 0\n min_differ = ab...
[ "0.85350364", "0.85226977", "0.8322245", "0.78922063", "0.77532303", "0.76765335", "0.7673342", "0.76364684", "0.7635272", "0.76115376", "0.75738764", "0.7554509", "0.7554509", "0.7552452", "0.73447585", "0.73183924", "0.72771406", "0.72477376", "0.7222891", "0.721653", "0.72...
0.8975662
0
Computes spike width for time t, voltage trace V, and index t_spike and voltage amplitude `spike_amp`.
def spike_width(t, V, t_spike, spike_amp): # handle no spike found if t_spike is None: return None Vmin = np.min(V[t_spike+1:t_spike+500]) minval = np.max([t_spike - 100, 0]) if len(V) > t_spike+500: maxval = -1 else: maxval = t_spike+500 id1 = find_nearest_idx(V[min...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spike_width_abf(abf, t_spike, spike_amp, epoch_start=3):\n # handle no spike found\n if t_spike is None:\n return None\n p0 = abf.sweepEpochs.p1s[epoch_start]\n t = abf.sweepX[p0:-1]\n V = abf.sweepY[p0:-1]\n return spike_width(t, V, t_spike, spike_amp)", "def spike_amplitude(V, t_sp...
[ "0.7286549", "0.6501221", "0.6024024", "0.5812456", "0.5557657", "0.55041677", "0.5400036", "0.53080493", "0.5215794", "0.52152115", "0.51359975", "0.5117697", "0.5102243", "0.5066071", "0.5011091", "0.50041133", "0.4983569", "0.4959171", "0.49430996", "0.49130043", "0.491187...
0.8307181
0
Computes spike width for abf object and t_spike index, and spike amplitude `spike_amp`. Note that t_spike should be found within the same epoch, otherwise there be an index mismatch.
def spike_width_abf(abf, t_spike, spike_amp, epoch_start=3): # handle no spike found if t_spike is None: return None p0 = abf.sweepEpochs.p1s[epoch_start] t = abf.sweepX[p0:-1] V = abf.sweepY[p0:-1] return spike_width(t, V, t_spike, spike_amp)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spike_width(t, V, t_spike, spike_amp):\n # handle no spike found\n if t_spike is None:\n return None\n\n Vmin = np.min(V[t_spike+1:t_spike+500])\n minval = np.max([t_spike - 100, 0])\n if len(V) > t_spike+500:\n maxval = -1\n else:\n maxval = t_spike+500\n id1 = find_n...
[ "0.7473685", "0.6299853", "0.59371275", "0.5677367", "0.5461012", "0.53023696", "0.52721286", "0.5254281", "0.5241991", "0.487418", "0.48584986", "0.4848857", "0.48387563", "0.48139584", "0.4812244", "0.48033372", "0.4773211", "0.47599214", "0.4744546", "0.4734407", "0.473427...
0.8146022
0
Finds the index of the first spike. The value of startind can be used as an offset in case t and V are slices of a larger array, but you want the index for those arrays.
def first_spike_tind(V, startind=0): spikes, _ = find_peaks(V, [1, 1000]) if len(spikes) == 0: found_spike = False else: found_spike = True if found_spike is False: raise NoSpikeFoundException else: return spikes[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_spike_tind_abf(abf, epoch_start, startind=0):\n p0 = abf.sweepEpochs.p1s[epoch_start]\n V = abf.sweepY[p0:-1]\n return first_spike_tind(V, startind=startind)", "def get_start(i,v):\n return i-v[i]-1", "def _get_indx(self, t):\n t = np.array(t)\n a = (t[:, np.newaxis] <= self...
[ "0.6851553", "0.66663456", "0.6480114", "0.5943271", "0.5854851", "0.58466977", "0.57779187", "0.5618756", "0.550382", "0.5497214", "0.5495332", "0.5477422", "0.5467759", "0.54675514", "0.5465566", "0.543921", "0.54121536", "0.5388304", "0.5374073", "0.53687054", "0.53608406"...
0.8042713
0
Computes spike latency. Makes sure that current is +100 pA.
def spike_latency(t, I, V): # make sure that current is +100 pA if abs(I[5] - 0.1) > 1e-7: sign = "" if I[5] > 0: sign = "+" print(f"Warning! Expected +100pA current, got {sign}{round(I[5]*1000)} \ pA current") spike_tind = first_spike_tind(V) return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _latency(self):\n\n return\n time.sleep(0.005 + random.random() / 30.)", "def spike_latency_abf(abf, epochstart):\n p0 = abf.sweepEpochs.p1s[epochstart]\n t = abf.sweepX[p0:-1]\n V = abf.sweepY[p0:-1]\n I = abf.sweepC[p0:-1]\n return spike_latency(t, I, V)", "def get_latency(a,...
[ "0.6667742", "0.6639285", "0.63193643", "0.6291087", "0.62277293", "0.6076571", "0.6061371", "0.59558076", "0.59556544", "0.5908918", "0.57772434", "0.5773665", "0.5744893", "0.5719568", "0.56907696", "0.56907696", "0.5681695", "0.56708837", "0.5628368", "0.56033325", "0.5596...
0.7749325
0
Computes spike latency using abf objet and epoch index.
def spike_latency_abf(abf, epochstart): p0 = abf.sweepEpochs.p1s[epochstart] t = abf.sweepX[p0:-1] V = abf.sweepY[p0:-1] I = abf.sweepC[p0:-1] return spike_latency(t, I, V)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spike_latency(t, I, V):\n # make sure that current is +100 pA\n if abs(I[5] - 0.1) > 1e-7:\n sign = \"\"\n if I[5] > 0:\n sign = \"+\"\n print(f\"Warning! Expected +100pA current, got {sign}{round(I[5]*1000)} \\\n pA current\")\n\n spike_tind = first_spik...
[ "0.6028425", "0.5491465", "0.530693", "0.5300092", "0.52771044", "0.52674377", "0.5228959", "0.5220311", "0.52153283", "0.52088284", "0.5191576", "0.5187746", "0.51213366", "0.511883", "0.51113784", "0.5102528", "0.5069571", "0.50503147", "0.50503147", "0.50397193", "0.503957...
0.71531516
0
Gets all spike indices from time t and voltage trace V.
def all_spike_ind(t, V): spikes, _ = find_peaks(V, [1, 1000]) return spikes
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def interspike_intervals(t, V):\n # first pass -- get number of spikes and locations\n spike_inds = all_spike_ind(t, V)\n n_spikes = len(spike_inds)\n\n if n_spikes == 0:\n return []\n\n # generate array to hold time intervals\n intervals = np.zeros((n_spikes-1), dtype=float)\n for ti i...
[ "0.7304651", "0.6784216", "0.62212384", "0.6000979", "0.59682405", "0.5941399", "0.58900493", "0.5643796", "0.5640157", "0.5621029", "0.5612397", "0.560505", "0.54741955", "0.54578584", "0.5405408", "0.538798", "0.53744054", "0.5362125", "0.53530985", "0.5315595", "0.5313094"...
0.8067253
0
Computes interspike intervals for time t and voltage trace V. If there are N spikes, then there will be N1 intervals.
def interspike_intervals(t, V): # first pass -- get number of spikes and locations spike_inds = all_spike_ind(t, V) n_spikes = len(spike_inds) if n_spikes == 0: return [] # generate array to hold time intervals intervals = np.zeros((n_spikes-1), dtype=float) for ti in range(1, n_sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_spike_ind(t, V):\n spikes, _ = find_peaks(V, [1, 1000])\n\n return spikes", "def analyzeIV(t, V, I, tw, thr):\n ntraces = numpy.shape(V)[0]\n vss = []\n vmin = []\n vm = []\n ic = []\n nspikes = []\n ispikes = []\n tmin = []\n fsl = []\n fisi = []\n ...
[ "0.6780872", "0.66757673", "0.6342778", "0.61360574", "0.6082667", "0.6070609", "0.597286", "0.58500314", "0.57331735", "0.5723254", "0.5691698", "0.5659111", "0.5644936", "0.56319046", "0.55685604", "0.55277026", "0.54763794", "0.5443054", "0.53831714", "0.53791595", "0.5372...
0.8620648
0
Computes interspike intervals for each spike, then computes the average of those intervals, then returns the reciprocal to denote the average spike frequency, in Hz.
def avg_spike_frequency(t, V): intervals = interspike_intervals(t, V) try: raise_if_not_multiple_spikes(intervals) except NoMultipleSpikesException: return None avg_int = np.average(intervals) return 1/avg_int
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_spike_frequency_adaptation(t, V):\n # check that there are 2 spikes minimum\n intervals = interspike_intervals(t, V)\n raise_if_not_multiple_spikes(intervals)\n return intervals[-1]/intervals[0]", "def avg_spike_frequency_abf(abf, epoch):\n p0 = abf.sweepEpochs.p1s[epoch]\n p1 = abf.swe...
[ "0.6792057", "0.64459485", "0.63366777", "0.60239524", "0.5911255", "0.5820491", "0.5770946", "0.56408936", "0.5640427", "0.5621468", "0.5606927", "0.5601544", "0.55967706", "0.5577748", "0.55715287", "0.55707043", "0.55707043", "0.55707043", "0.5566058", "0.55575603", "0.555...
0.73140913
0
Computes average spike frequency for abf object and epoch index.
def avg_spike_frequency_abf(abf, epoch): p0 = abf.sweepEpochs.p1s[epoch] p1 = abf.sweepEpochs.p1s[epoch+1] t = abf.sweepX[p0:p1] V = abf.sweepY[p0:p1] return avg_spike_frequency(t, V)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def spike_amplitude_abf(abf, t_spike, epoch_start=3):\n p0 = abf.sweepEpochs.p1s[epoch_start]\n V = abf.sweepY[p0:-1]\n\n return spike_amplitude(V, t_spike)", "def avg_spike_frequency(t, V):\n intervals = interspike_intervals(t, V)\n\n try:\n raise_if_not_multiple_spikes(intervals)\n exc...
[ "0.643844", "0.6115807", "0.5816971", "0.5777478", "0.56836677", "0.56770694", "0.5666032", "0.56568635", "0.5650543", "0.5620046", "0.55462974", "0.5540028", "0.5525934", "0.5521558", "0.5508961", "0.54813564", "0.5462477", "0.54483956", "0.5408029", "0.5349789", "0.5333669"...
0.7959858
0
Computes maximum interspike frequency (equivalent to minimum interspike interval).
def max_spike_frequency(t, V): intervals = interspike_intervals(t, V) raise_if_not_multiple_spikes(intervals) min_int = np.amin(intervals) return 1/min_int
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_frequency(sig, FS):\n\n f, fs = plotfft(sig, FS)\n t = np.cumsum(fs)\n\n try:\n ind_mag = np.where(t > t[-1]*0.95)[0][0]\n except:\n ind_mag = np.argmax(t)\n f_max = f[ind_mag]\n\n return f_max", "def findMaximal(freqSet):", "def min_spike_frequency_tV(t, V):\n interv...
[ "0.686226", "0.67198664", "0.6456348", "0.6237039", "0.61072993", "0.6094395", "0.6089857", "0.60836124", "0.5901322", "0.5895342", "0.5891257", "0.5876694", "0.58622146", "0.583807", "0.5814099", "0.57966477", "0.5774891", "0.5773817", "0.577248", "0.5768403", "0.5766519", ...
0.81546277
0
Computes minimum interspike frequency (equivalent to maximum interspike interval).
def min_spike_frequency_tV(t, V): intervals = interspike_intervals(t, V) raise_if_not_multiple_spikes(intervals) max_int = np.amax(intervals) return 1/max_int
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_spike_frequency(t, V):\n intervals = interspike_intervals(t, V)\n raise_if_not_multiple_spikes(intervals)\n min_int = np.amin(intervals)\n return 1/min_int", "def calcLowFrequencyLimit(fls, noct, max_idx):\n # floats required due to integer division in Python 2.7\n f_lower = fls[0:max_i...
[ "0.7111554", "0.6457247", "0.6452509", "0.63382065", "0.61823815", "0.606085", "0.6013277", "0.5989754", "0.59551436", "0.5943181", "0.592826", "0.5807336", "0.5763848", "0.5742698", "0.57422686", "0.5737989", "0.5735367", "0.57189804", "0.57057506", "0.569486", "0.56937164",...
0.77755356
0
Checks for whether there are multiple spikes, otherwise raises and exception.
def raise_if_not_multiple_spikes(intervals): if len(intervals) < 1: raise NoMultipleSpikesException
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_spike(self):\n\n arr = [10, 12, 999.99, 13, 15, 40, 9, 9]\n\n # First and last elements should always be good data, unless someone\n # has set a threshold to zero.\n expected = [1, 4, 4, 4, 1, 3, 1, 1]\n\n inputs = [\n arr,\n np.asarray(arr, dtype=n...
[ "0.5455404", "0.5442264", "0.54034597", "0.53654855", "0.53497535", "0.53397554", "0.53384614", "0.5319763", "0.52793396", "0.5264266", "0.523095", "0.5229649", "0.5143878", "0.5126793", "0.5108548", "0.50885737", "0.50762266", "0.50755095", "0.50739056", "0.504875", "0.50441...
0.78514844
0
load csv filter div and 0.95 r value and at least 2 clls
def load_and_filer(pwd,rval=0.95): df = pd.read_csv(pwd) df = rl.give_good_structure(df) df = df.loc[(df['end_type']=='DIVISION')|(df['end_type']=='DIV')|(df['end_type']=='div')] if 'length_box' in df.columns: #guillaume data df['time_sec'] = df['frame']*60*3 df['length_box_um'] = df['le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_breuer_csv():\n import csv\n with open('Hill_Re_10595_Breuer.csv', 'r') as fh:\n reader = csv.reader(fh)\n reader.next() # Eat header\n raw = np.array([[float(i) for i in l[:-1]] for l in reader if len(l) > 0])\n return analyse_breuer(raw)", "def load_data...
[ "0.59180343", "0.59158766", "0.57957816", "0.5783254", "0.5765451", "0.5695217", "0.5683417", "0.56652474", "0.5604578", "0.56006265", "0.559732", "0.5570948", "0.5557407", "0.5556778", "0.55453295", "0.5445747", "0.5437512", "0.5381096", "0.53779906", "0.53775626", "0.537084...
0.63760495
0
Variable at birth and elongation rate mean over npoint
def at_birth(df,variable,npoint): return df.groupby('cell')[['{}'.format('{}'.format(variable)),'pred_growth_rate']].apply(lambda x: x.head(npoint).mean()).rename(columns={'pred_length_box_um':'{}_at_birth'.format(variable)})
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bl_mean(mu, std, alpha, n):\n var__alpha = (alpha - 1) / 2\n var__beta = var__alpha * std ** 2\n var = var__beta / (var__alpha - 1)\n return np.exp(mu + var / 2) * (alpha / n)", "def mean(self):\n return math.exp(self.mu + (self.sigma ** 2) / 2)", "def modelmean(self, model_params, this_...
[ "0.62526536", "0.61370325", "0.6102281", "0.60851276", "0.6018355", "0.601033", "0.60047895", "0.6003948", "0.6003362", "0.59845704", "0.5964844", "0.5962788", "0.594292", "0.594292", "0.5938851", "0.5929146", "0.5919363", "0.5890413", "0.586686", "0.5865125", "0.5861947", ...
0.6964157
0
Connect cells between genealogies and return dataframe with super_cell id and variable
def connect_cells(dfte,vari): # Create the variabel cell for mother, grand mother and grand grand mother if 'g_parent_cell' not in dfte.columns: dfte = rl.genalogy(dfte,'parent_cell') #Create genealogy if 'g_g_parent_cell' not in dfte.columns: dfte = rl.genalogy(dfte,'g_parent_cell') if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def muther_dau_gdau(df,var_m,var_d,var_gd):\n if 'g_parent_cell' not in df.columns:\n df = rl.genalogy(df,'parent_cell') #Create genealogy\n tmp={'gr_mu_{}'.format(var_m):[],'mu_{}'.format(var_d):[],'daugther_{}'.format(var_gd):[]}\n for k in df.cell.unique():\n dau = df.loc[df['cell']==k]\n...
[ "0.60499215", "0.54830205", "0.5432107", "0.54215103", "0.5346217", "0.53322774", "0.53123105", "0.51663107", "0.5132326", "0.51209533", "0.51172334", "0.51165843", "0.51119787", "0.51019263", "0.5093513", "0.5086647", "0.508317", "0.5072695", "0.50606495", "0.50243706", "0.5...
0.7782316
0
Find autocorrelation even between genalogy frmo t=0 to t=maxt with step steps
def autocorrelation(df,maxt,step,vari,acquisiton_time,division_time): maxt = int(maxt/acquisiton_time) step = int(step/acquisiton_time) df = connect_cells(df,vari) return np.vstack([correlation(df,Dt,vari) for Dt in\ np.arange(0,maxt,step)]),\ np.arange(0,maxt,step)*acquisi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def step_autocorrelation(self):\n\n max_hops = max([len(x) for x in self.steps])\n\n self.acf = np.zeros([len(self.steps), max_hops])\n\n keep = [] # list to hold indices of trajectories with a non-zero amount of hops\n for i in range(len(self.steps)):\n hops = self.steps[i]...
[ "0.6922259", "0.6406261", "0.6337326", "0.62940246", "0.6227375", "0.6044275", "0.6015199", "0.5965191", "0.5965191", "0.5907191", "0.5794681", "0.5791768", "0.57608676", "0.56982356", "0.56982356", "0.5690548", "0.5685578", "0.564711", "0.5607928", "0.5591235", "0.557764", ...
0.75102353
0
qq plot with normal dist
def qq_plot(obs,var,fname): plt.figure() z = (obs-np.mean(obs))/np.std(obs) stats.probplot(z, dist="norm", plot=plt) plt.plot(np.arange(-3,3),np.arange(-3,3)) plt.xlim([-3,3]) plt.ylim([-3,3]) plt.title("Normal Q-Q plot {} in {}".format(var,fname)) plt.savefig("qq_{}".format(var))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qq_plot(data, name, distribution=\"norm\", ax_size=(7, 7)):\n\n common_set_up(ax_size)\n\n fig = plt.figure(figsize=ax_size)\n ax = fig.add_subplot(111) # Make one axes\n\n # Use scipy stats probplot and get out only values\n (x, y) = stats.probplot(data, dist=distribution, plot=None, fit=False...
[ "0.661851", "0.6325651", "0.62123716", "0.5937972", "0.5926158", "0.58665866", "0.5817014", "0.5704175", "0.5699012", "0.5634741", "0.5628107", "0.559978", "0.559678", "0.5528379", "0.55140585", "0.5493067", "0.5485866", "0.5461674", "0.5413696", "0.5400506", "0.53609097", ...
0.71324325
0
Instantiate a `Surrogate` from a preinstantiated Botorch `Model`.
def from_botorch( cls, model: Model, mll_class: Type[MarginalLogLikelihood] = ExactMarginalLogLikelihood, ) -> Surrogate: surrogate = cls(botorch_model_class=model.__class__, mll_class=mll_class) surrogate._model = model # Temporarily disallowing `update` for surrogat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_to_instance(model):\n pass", "def __init__(self, model: object):\n self.model = model", "def __init__(self, model):\n self._model = model", "def _instantiate(decoder, model=None, dataset=None):\n if decoder is None: return U.Identity()\n\n if isinstance(decoder, str): nam...
[ "0.6612203", "0.58194447", "0.58095664", "0.57330984", "0.5716413", "0.563533", "0.563533", "0.5630868", "0.56230235", "0.5622394", "0.5622394", "0.5622394", "0.5622394", "0.55855143", "0.5579342", "0.5510232", "0.54965955", "0.54339975", "0.54204804", "0.53734046", "0.535340...
0.65808463
1
Updates the surrogate model with new data. In the base ``Surrogate``, just calls ``fit`` after checking that this surrogate was not created via ``Surrogate.from_botorch`` (in which case the ``Model`` comes premade, constructed manually and then supplied to ``Surrogate``).
def update( self, datasets: List[SupervisedDataset], metric_names: List[str], search_space_digest: SearchSpaceDigest, candidate_metadata: Optional[List[List[TCandidateMetadata]]] = None, state_dict: Optional[Dict[str, Tensor]] = None, refit: bool = True, *...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_model(model, data, encoders, epochs, batch_size):\n model.fit(\n dict(data.drop(\"total_return\", axis=1)),\n data.total_return,\n epochs=epochs,\n batch_size=batch_size,\n verbose=False,\n )\n\n factors = pd.DataFrame(model.get_layer(\"date_embedding\").get_w...
[ "0.61704075", "0.60705763", "0.60033774", "0.5971347", "0.5954025", "0.5933478", "0.59277827", "0.5849612", "0.583745", "0.57466644", "0.5739969", "0.571057", "0.56760395", "0.5675398", "0.56300014", "0.55561376", "0.55544794", "0.5538727", "0.55382186", "0.55081874", "0.5489...
0.6504125
0
For multiobjective optimization, retrieve Pareto frontier instead of best point.
def pareto_frontier(self) -> Tuple[Tensor, Tensor]: raise NotImplementedError("Pareto frontier not yet implemented.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pareto_front_cut(self):\n return self.NDA([kernel.objective_values for kernel in self.kernels \\\n if kernel.objective_values is not None],\n self.reference_point)", "def _calc_pareto_front(self, *args, **kwargs):\n fname = f\"{self.fct.name}_PF.d...
[ "0.6535724", "0.6393786", "0.5591595", "0.5555255", "0.54125065", "0.5407732", "0.53989637", "0.5383117", "0.53506523", "0.534688", "0.5342991", "0.5335419", "0.5257751", "0.5256599", "0.5251918", "0.5244487", "0.5146469", "0.5136885", "0.5126721", "0.51253355", "0.5110239", ...
0.7016293
0
Serialize attributes of this surrogate, to be passed back to it as kwargs on reinstantiation.
def _serialize_attributes_as_kwargs(self) -> Dict[str, Any]: if self._constructed_manually: raise UnsupportedError( "Surrogates constructed manually (ie Surrogate.from_botorch) may not " "be serialized. If serialization is necessary please initialize from " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self):\n pass", "def serialize(self):\n raise NotImplementedError(\"Abstract class, implemented in sub class\")", "def _serialise(self):\n # TODO (M Foley)\n pass", "def serialize(self, *args, **kwargs): # pylint: disable = unused-argument\n attribs = {}\n ...
[ "0.6771217", "0.67654073", "0.6750785", "0.66644406", "0.66298956", "0.66251737", "0.6616901", "0.6616476", "0.65615296", "0.65493906", "0.65493906", "0.653947", "0.6524214", "0.65125376", "0.6478986", "0.64641863", "0.6462501", "0.6462501", "0.6429069", "0.6424507", "0.64142...
0.7048768
0
Calculates the maximum time, between all the velocities, required to reach the goal. By default, it only synchronizes linear velocities. If angular_synchronization is True, then it also synchronizes for angular velocities.
def calculate_max_time(error, velocity, angular_synchronization=False, zero=0.001): if angular_synchronization: assert len(error) == len(velocity) == 6 else: assert len(error) == len(velocity) == 3 # calculate_duration = lambda distance, speed: abs(float(distance) / speed) def calculate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_sync_velocity(error, velocity, max_time, angular_synchronization=False):\n if angular_synchronization:\n assert len(error) == len(velocity) == 6\n else:\n assert len(error) == len(velocity) == 3\n\n # A velocity is computed to cover a distance (dist) in a given time (max_time),...
[ "0.68456197", "0.57857203", "0.57491744", "0.5585136", "0.5567209", "0.5532728", "0.55307406", "0.5515998", "0.5502145", "0.53898937", "0.5357226", "0.53221965", "0.5281155", "0.527711", "0.52734107", "0.52734107", "0.52235395", "0.5221728", "0.5191337", "0.5123462", "0.51054...
0.67981666
1
Calculates the synchronized velocity for all velocities to reach their goal at the same time. By default, it only synchronizes linear velocities. If angular_synchronization is True, then it also synchronizes for angular velocities.
def calculate_sync_velocity(error, velocity, max_time, angular_synchronization=False): if angular_synchronization: assert len(error) == len(velocity) == 6 else: assert len(error) == len(velocity) == 3 # A velocity is computed to cover a distance (dist) in a given time (max_time), # wher...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calcVelocity(self, iteration):\n self.setIteration(iteration)\n if self.parallelization_mode == \"serial\":\n # calculate and set coordinates\n for this_bin in iteration:\n for this_segment in this_bin:\n self.calcSegmentVelocities(this_segm...
[ "0.6337773", "0.6259177", "0.608339", "0.58207667", "0.56556183", "0.5638544", "0.55727834", "0.5561666", "0.5555737", "0.55239564", "0.54603755", "0.54364896", "0.542645", "0.5399831", "0.53976446", "0.5384", "0.5349686", "0.5341977", "0.5341679", "0.53016967", "0.52791053",...
0.7185989
0
Color edge based on the mean of its node colors
def get_edge_color( row ): rgb = 0.5 * ( node_color_dict[ row[ 'source' ] ] + \ node_color_dict[ row[ 'target' ] ] ) return rgb2hex( rgb )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def merge_mean_color(graph, src ,dst):\n\n graph.nodes[dst]['total color'] += graph.nodes[src]['total color']\n graph.nodes[dst]['pixel count'] += graph.nodes[src]['pixel count']\n graph.nodes[dst]['mean color'] = (graph.nodes[dst]['total color'] / graph.nodes[dst]['pixel count'])", "def node_colors(sel...
[ "0.6794543", "0.65701836", "0.63036895", "0.60805434", "0.5911971", "0.5882105", "0.5866474", "0.58314013", "0.58042705", "0.5791548", "0.57542545", "0.5686546", "0.5630701", "0.56300443", "0.5613021", "0.55528307", "0.55281764", "0.55185825", "0.55115545", "0.54595757", "0.5...
0.6954697
0
Import functions from module ``mmgroup.mm_order``. We import these functions from module ``mmgroup.mm_order`` on demand. This avoids an infinite recursion of imports.
def import_mm_order_functions(): global check_mm_order, check_mm_equal global check_mm_half_order, check_mm_in_g_x0 from mmgroup.mm_order import check_mm_order as f check_mm_order = f from mmgroup.mm_order import check_mm_equal as f check_mm_equal = f from mmgroup.mm_order import check_mm_ha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _import_custom(self, custom_modules):\n for filter_module in custom_modules:\n info('Loading {}'.format(filter_module))\n funs = module_utils.get_all_functions(filter_module)\n for fun_name, fun in funs.items():\n if fun_name.startswith('function'):\n ...
[ "0.56968665", "0.5643161", "0.5435371", "0.53745395", "0.53692764", "0.53691804", "0.53291184", "0.5281062", "0.5275298", "0.5262633", "0.52055323", "0.51773846", "0.51679754", "0.5095697", "0.5073008", "0.50676996", "0.50347024", "0.50226986", "0.5018887", "0.5016364", "0.50...
0.82972014
0
String representation of Completeness object When the command 'print' is used on the Completeness object, this method will return the values contained in the object
def __str__(self): for att in self.__dict__.keys(): print '%s: %r' % (att, getattr(self, att)) return 'Completeness class object attributes'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n struct_repr = \", \".join([\n \"was_available_once: \" + str(self.was_available_once),\n \"is_available: \" + str(self.is_available),\n \"signal_strength_percent: \" + str(self.signal_strength_percent)\n ])\n\n return f\...
[ "0.66518784", "0.6558187", "0.65491027", "0.64940053", "0.6372875", "0.6264341", "0.62038535", "0.6191972", "0.61830616", "0.61642146", "0.6149433", "0.6116986", "0.61088806", "0.6106351", "0.6097083", "0.6079512", "0.6078032", "0.6071107", "0.60571027", "0.6052877", "0.60517...
0.75313747
0
Generates completeness values for target stars This method is called from TargetList __init__ method.
def target_completeness(self, TL): comp0 = np.array([0.2]*TL.nStars) return comp0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_appropriate_target(self):\n pass", "def calculate_appropriate_target(self):\n pass", "def get_target_per_score(self):\n pass", "def narration_target(self):", "def get_learning_completion(self):\n return min(1.0, self.step / Parameters.FINAL_EXPLORATION)", "def __...
[ "0.52117205", "0.52117205", "0.5203223", "0.5138068", "0.5120635", "0.50905424", "0.5024778", "0.49907243", "0.4958207", "0.4958207", "0.4958207", "0.4953239", "0.49531022", "0.49428225", "0.49236003", "0.48905414", "0.48772275", "0.4871452", "0.48638627", "0.48611942", "0.48...
0.7235767
0
Updates completeness value for stars previously observed
def completeness_update(self, sInd, TL, obsbegin, obsend, nexttime): # prototype returns the "virgin" completeness value return TL.comp0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def target_completeness(self, TL):\r\n \r\n comp0 = np.array([0.2]*TL.nStars)\r\n \r\n return comp0", "def update_percent(self):", "def percent_updated(self):\n return self.percent_complete - self.previous_percent_complete", "def update_score():\n pass", "def _upda...
[ "0.6213586", "0.5982645", "0.5977477", "0.57943684", "0.56373745", "0.562053", "0.5567826", "0.555107", "0.5533249", "0.5398687", "0.53789085", "0.5299783", "0.52602965", "0.52126044", "0.5192764", "0.5178828", "0.516683", "0.51598394", "0.5144335", "0.5123487", "0.5123487", ...
0.66835356
0
Set up a default Dogstatsd instance and mock the proc filesystem.
def setUp(self): # self.statsd = DogStatsd(telemetry_min_flush_interval=0) self.statsd.socket = FakeSocket() self.statsd._reset_telemetry() # Mock the proc filesystem route_data = load_fixtures('route') self._procfs_mock = patch('datadog.util.compat.builtins.open...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_statsd():\n statsd.init_statsd({\n 'STATSD_HOST': config.secrets.server('statsd.host'),\n 'STATSD_PORT': config.secrets.server('statsd.port'),\n 'STATSD_BUCKET_PREFIX': 'linkr',\n })", "async def test_statsd_setup_defaults(hass: HomeAssistant) -> None:\n config = {\"statsd\...
[ "0.67476094", "0.66412675", "0.64277816", "0.6259234", "0.60098875", "0.5872404", "0.58321947", "0.58246964", "0.5780947", "0.5772299", "0.5660361", "0.5632279", "0.55069", "0.5496597", "0.54851276", "0.54772216", "0.5475186", "0.5469049", "0.5455055", "0.5450422", "0.5429659...
0.75835073
0
Unmock the proc filesystem.
def tearDown(self): self._procfs_mock.stop()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teardown_function(function):\n bundle.local.reset_mock()\n bundle.cd.reset_mock()", "def tearDown(self):\n self.popen_patcher.stop()", "def tearDown(self):\n self.popen_patcher.stop()", "def test_unload(install_mockery, mock_fetch, mock_archive, mock_packages, working_env):\n insta...
[ "0.6361763", "0.62163806", "0.62163806", "0.62079", "0.6134043", "0.60920656", "0.604096", "0.60291505", "0.6024147", "0.5966361", "0.5828402", "0.5828402", "0.5828402", "0.5828402", "0.5827227", "0.5768053", "0.576695", "0.57601285", "0.57424736", "0.57312685", "0.5698628", ...
0.71018255
0
Send and then asserts that a chain of metrics arrive in the right order and with expected telemetry values.
def send_and_assert( self, dogstatsd, expected_metrics, last_telemetry_size=0, buffered=False, ): expected_messages = [] for metric_type, metric_name, metric_value in expected_metrics: # Construct the expected message data metric_type_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_wait_for_dispatched_metrics(self):\n worker_helper = WorkerHelper()\n d = worker_helper.wait_for_dispatched_metrics()\n self.assertEqual(self.successResultOf(d), [])\n\n self._add_to_dispatched_metrics(worker_helper.broker, MetricMessage())\n msg = MetricMessage()\n ...
[ "0.6648457", "0.61141425", "0.5876275", "0.5731564", "0.56937885", "0.5580018", "0.55792314", "0.54794395", "0.53811246", "0.5342774", "0.53372544", "0.53371376", "0.5333182", "0.53151363", "0.5304059", "0.527914", "0.5275696", "0.52615434", "0.524505", "0.5242069", "0.521468...
0.7067573
0
`initialize` overrides `statsd` default instance attributes.
def test_initialization(self): options = { 'statsd_host': "myhost", 'statsd_port': 1234 } # Default values self.assertEqual(statsd.host, "localhost") self.assertEqual(statsd.port, 8125) # After initialization initialize(**options) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_statsd():\n statsd.init_statsd({\n 'STATSD_HOST': config.secrets.server('statsd.host'),\n 'STATSD_PORT': config.secrets.server('statsd.port'),\n 'STATSD_BUCKET_PREFIX': 'linkr',\n })", "def __init__(self, collectd):\n self.collectd = collectd\n self.conf = self.d...
[ "0.71561664", "0.65992165", "0.6561374", "0.6316971", "0.6264479", "0.6241959", "0.61702603", "0.6155935", "0.6036247", "0.6032295", "0.6023695", "0.601545", "0.60045856", "0.59905905", "0.5960218", "0.5936547", "0.5932973", "0.5904823", "0.58644193", "0.5854766", "0.5841938"...
0.68837506
1
Dogstatsd can retrieve its config from env vars when not provided in constructor.
def test_dogstatsd_initialization_with_env_vars(self): # Setup with preserve_environment_variable('DD_AGENT_HOST'): os.environ['DD_AGENT_HOST'] = 'myenvvarhost' with preserve_environment_variable('DD_DOGSTATSD_PORT'): os.environ['DD_DOGSTATSD_PORT'] = '4321' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n self.config = load_config()\n self.set_env_var()", "def __init__(self, environment=None):\n if environment is None:\n environment = os.environ.get(\"SENTERA_ENV\") or \"prod\"\n environment = environment.lower()\n self.environment = enviro...
[ "0.67549545", "0.6440547", "0.6411156", "0.6389691", "0.6364424", "0.63438725", "0.6324953", "0.6221165", "0.62137526", "0.6192844", "0.61294645", "0.61156017", "0.60837567", "0.6071664", "0.60495734", "0.6048155", "0.60300165", "0.6009422", "0.60019284", "0.59974647", "0.598...
0.70487374
0
Dogstatsd host can be dynamically set to the default route.
def test_default_route(self): self.assertEqual( DogStatsd(use_default_route=True).host, "172.17.0.1" )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getHost():", "def getHost():", "def get_host(name):\n raise NotImplementedError('derived class should overload me')", "def set_target(self, host, port):\r\n pass", "def serve(ctx, host, port):\n pass", "def test_default_host_http_required(self):\n client = self.base_scenario(\n ...
[ "0.6033232", "0.6033232", "0.5783881", "0.5775147", "0.5751545", "0.56110024", "0.5583052", "0.55784684", "0.5525812", "0.549326", "0.54884046", "0.54740816", "0.54694706", "0.5451875", "0.5401176", "0.53989035", "0.53989035", "0.5395777", "0.5393919", "0.5384688", "0.5379834...
0.75208133
0
Timed value is reported in ms when statsd.use_ms is True.
def test_timed_in_ms(self): # Arm statsd to use_ms self.statsd.use_ms = True # Sample a function run time @self.statsd.timed('timed.test') def func(arg1, arg2, kwarg1=1, kwarg2=1): """docstring""" time.sleep(0.5) return (arg1, arg2, kwarg1, kw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ms(self):\n\t\treturn self._ms", "def ms(self):\n # my clock uses seconds internally\n return 1000 * self.read()", "def _unit_ms(self):\n return (self.time_base / 1000.0) / 60.0", "def ms_from_timedelta(td):\n return (td.seconds * 1000) + (td.microseconds / 1000.0)", "def get_ti...
[ "0.6975095", "0.6810435", "0.6657259", "0.6554632", "0.65140027", "0.64969325", "0.6489244", "0.6371504", "0.6335592", "0.63139933", "0.62697685", "0.62574714", "0.6204073", "0.61836475", "0.61701643", "0.6164281", "0.6155498", "0.60401815", "0.6027048", "0.6026042", "0.60232...
0.74131775
0
Exception bubbles out of the `timed` context manager.
def test_timed_context_exception(self): class ContextException(Exception): pass def func(self): with self.statsd.timed('timed_context.test.exception'): time.sleep(0.5) raise ContextException() # Ensure the exception was raised. wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_timer_context_exceptions():\n sc = _client()\n\n with assert_raises(socket.timeout):\n with sc.timer('foo'):\n raise socket.timeout()\n\n _timer_check(sc, 1, 'foo', 'ms')", "def test_timeoutRaises(self):\n\n @self.eventloop.wait_for(timeout=0.5)\n def times_out()...
[ "0.70439595", "0.667859", "0.66749775", "0.665197", "0.6643113", "0.65210307", "0.6512625", "0.6384847", "0.63573813", "0.6299778", "0.6114314", "0.6095104", "0.6008552", "0.59938556", "0.59831214", "0.5930287", "0.59205747", "0.58640987", "0.5854599", "0.58519787", "0.578186...
0.707114
0
Dogstatsd should automatically use DD_ENV, DD_SERVICE, and DD_VERSION (if present) to set {env, service, version} as global tags for all metrics emitted.
def test_dogstatsd_initialization_with_dd_env_service_version(self): cases = [ # Test various permutations of setting DD_* env vars, as well as other global tag configuration. # An empty string signifies that the env var either isn't set or that it is explicitly set to empty string. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dogstatsd_initialization_with_env_vars(self):\n # Setup\n with preserve_environment_variable('DD_AGENT_HOST'):\n os.environ['DD_AGENT_HOST'] = 'myenvvarhost'\n with preserve_environment_variable('DD_DOGSTATSD_PORT'):\n os.environ['DD_DOGSTATSD_PORT'] = '4...
[ "0.581118", "0.5363366", "0.53107005", "0.52418685", "0.51974744", "0.5170413", "0.50802094", "0.5078154", "0.5077305", "0.4975919", "0.4950397", "0.49243206", "0.490046", "0.48965698", "0.48863626", "0.48436457", "0.48390573", "0.48379213", "0.4822794", "0.48173887", "0.4804...
0.74013835
0
The Eflo VPD ID.
def vpd_id(self) -> str: return pulumi.get(self, "vpd_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self):\n return self.vdu_info.vdu_id", "def vat_id(self) -> str:\n return self._vat_id", "def vat_id(self):\n return self._vat_id", "def id(self):\n return int(self.__nvXxPr.cNvPr.get('id'))", "def vm_id(self):\n return self.vm_info.get('id', 'Error retrieving ID')...
[ "0.7936278", "0.7136131", "0.6907432", "0.6904606", "0.6881559", "0.68572456", "0.6835941", "0.6706659", "0.6685424", "0.6678652", "0.6605415", "0.66002005", "0.6591701", "0.65612185", "0.65474844", "0.6488551", "0.64564127", "0.6436533", "0.6436533", "0.6436533", "0.6436533"...
0.85733056
1
The id of the vpd.
def vpd_id(self) -> str: return pulumi.get(self, "vpd_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def id(self):\n return self.vdu_info.vdu_id", "def vat_id(self) -> str:\n return self._vat_id", "def id(self) -> str:\n return pulumi.get(self, \"id\")", "def id(self) -> str:\n return pulumi.get(self, \"id\")", "def id(self) -> str:\n return pulumi.get(self, \"id\")", ...
[ "0.8721102", "0.7705356", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "0.7478009", "...
0.89650935
0
The Name of the VPD.
def vpd_name(self) -> str: return pulumi.get(self, "vpd_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_name(self):\n return self.nvPublic.get_name()", "def name(self):\n return self.__nvXxPr.cNvPr.get('name')", "def get_name():\n return \"SVMd+\"", "def getVhdlName(self):\n return self.name.replace(TOP_NODE_NAME + '.', '').replace('.', '_')", "def virtual_name(self) -> Op...
[ "0.77821183", "0.7476595", "0.73026973", "0.7113421", "0.7092685", "0.7092685", "0.7085843", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", "0.707482", ...
0.91165507
0
Sets the axis1 limits
def set_axis1_limits(self, start, end): if start > end: raise ValueError("Start point over end for this view.") self.axis1_limits = start, end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setlimits(self, Xlim=[], Ylim=[]):\n self.data['Xmin'] = Xlim[0]\n self.data['Xmax'] = Xlim[1]\n self.data['Ymin'] = Ylim[0]\n self.data['Ymax'] = Ylim[1]", "def set_plot_limits(self) -> None:\n matplotlib.pyplot.xlim(0, self.imgsz[0])\n matplotlib.pyplot.ylim(self.i...
[ "0.6964966", "0.69501424", "0.69050765", "0.6849012", "0.6782971", "0.6751624", "0.6689119", "0.66625834", "0.6655498", "0.64951956", "0.64660126", "0.64273226", "0.63873005", "0.63656276", "0.62677586", "0.62336606", "0.6226322", "0.62159514", "0.6192549", "0.61510056", "0.6...
0.8218228
0
Sets the axis2 limits
def set_axis2_limits(self, start, end): if start > end: raise ValueError("Start point over end for this view.") self.axis2_limits = start, end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def adjust_ylimits(self, ylim1, ylim2):\n self.axplot.set_ylim(ylim1, ylim2)\n self.fig.canvas.draw()\n return", "def setlimits(self, Xlim=[], Ylim=[]):\n self.data['Xmin'] = Xlim[0]\n self.data['Xmax'] = Xlim[1]\n self.data['Ymin'] = Ylim[0]\n self.data['Ymax'] =...
[ "0.7679957", "0.7137881", "0.6968403", "0.6968129", "0.69276756", "0.66304326", "0.6625808", "0.65875417", "0.6522321", "0.64404905", "0.6419612", "0.6401575", "0.63996685", "0.63885385", "0.63736707", "0.62931263", "0.6214984", "0.6184074", "0.61167693", "0.6107988", "0.6054...
0.82910025
0
Creates a _Head for linear regression.
def _regression_head(label_name=None, weight_column_name=None, label_dimension=1, enable_centered_bias=False, head_name=None): return _RegressionHead( label_name=label_name, weight_column_name=weight_column_name, lab...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,\n label_name,\n weight_column_name,\n label_dimension,\n enable_centered_bias,\n head_name,\n loss_fn=_mean_squared_loss):\n super(_RegressionHead, self).__init__(head_name=head_name)\n\n self._loss_fn = lo...
[ "0.684842", "0.63585603", "0.63347226", "0.61810565", "0.5857701", "0.5773445", "0.5767058", "0.57526094", "0.5734294", "0.57188934", "0.5590229", "0.55242336", "0.5514718", "0.54834616", "0.5425716", "0.5410449", "0.5330436", "0.52927476", "0.52814287", "0.5274359", "0.52503...
0.7615701
0
Creates a _Head for multi class single label classification. The Head uses softmax cross entropy loss.
def _multi_class_head(n_classes, label_name=None, weight_column_name=None, enable_centered_bias=False, head_name=None, thresholds=None, metric_class_ids=None): if (n_classes is None) or ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _multi_label_head(n_classes,\n label_name=None,\n weight_column_name=None,\n enable_centered_bias=False,\n head_name=None,\n thresholds=None,\n metric_class_ids=None):\n if n_classes <...
[ "0.7676755", "0.6761584", "0.66569084", "0.6371564", "0.6371564", "0.6371564", "0.6289213", "0.6183466", "0.6155606", "0.61344504", "0.59884363", "0.5926488", "0.58939695", "0.5892835", "0.5892204", "0.58319116", "0.58294505", "0.58045626", "0.5804537", "0.58013827", "0.57893...
0.7576061
1
Creates a `_Head` for binary classification with SVMs. The head uses binary hinge loss.
def _binary_svm_head( label_name=None, weight_column_name=None, enable_centered_bias=False, head_name=None, thresholds=None,): return _BinarySvmHead( label_name=label_name, weight_column_name=weight_column_name, enable_centered_bias=enable_centered_bias, head_name=head_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,\n label_name,\n weight_column_name,\n enable_centered_bias,\n head_name,\n loss_fn=_log_loss_with_two_classes,\n thresholds=None):\n super(_BinaryLogisticHead, self).__init__(head_name=head_name)\n self._th...
[ "0.6206049", "0.5943907", "0.59064436", "0.5802742", "0.5763362", "0.5754058", "0.5754058", "0.5754058", "0.5724703", "0.57224053", "0.5697456", "0.5676167", "0.5643779", "0.5625094", "0.56141084", "0.558039", "0.55719155", "0.5535557", "0.5532209", "0.55216694", "0.54993004"...
0.7948433
0
Creates a _Head for multi label classification. The Head uses softmax cross entropy loss.
def _multi_label_head(n_classes, label_name=None, weight_column_name=None, enable_centered_bias=False, head_name=None, thresholds=None, metric_class_ids=None): if n_classes < 2: rais...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _multi_class_head(n_classes,\n label_name=None,\n weight_column_name=None,\n enable_centered_bias=False,\n head_name=None,\n thresholds=None,\n metric_class_ids=None):\n if (n_classes ...
[ "0.7336204", "0.7173082", "0.6579786", "0.6405291", "0.6405291", "0.6405291", "0.63451236", "0.6327597", "0.6323638", "0.6302445", "0.61321354", "0.60909694", "0.6047005", "0.6039839", "0.603225", "0.59006226", "0.5891783", "0.58525467", "0.58370924", "0.5797899", "0.5795075"...
0.76452595
0
_Head to combine multiple _Head objects.
def __init__(self, heads, loss_combiner): # TODO(zakaria): Keep _Head a pure interface. super(_MultiHead, self).__init__(head_name=None) self._logits_dimension = 0 for head in heads: if not head.head_name: raise ValueError("Head must have a name.") self._logits_dimension += head.logi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generateHead(self, headType):\n # load the multi-head models\n filePrefix, phase = ModelDict[self.style.body]\n headModel = loader.loadModel(\"phase_\" + str(phase) + filePrefix + \"heads\")\n\n # search for the appropriate parts\n headReferences = headModel.findAllMatches(\"...
[ "0.6166992", "0.5967676", "0.5889176", "0.58571684", "0.58249354", "0.58173925", "0.5694333", "0.56684655", "0.5642174", "0.56208825", "0.5578456", "0.55694306", "0.55612534", "0.5547007", "0.5547007", "0.5547007", "0.5547007", "0.54943246", "0.548427", "0.5468281", "0.542009...
0.6410378
0
Splits logits for heads.
def _split_logits(self, logits): all_logits = [] begin = 0 for head in self._heads: current_logits_size = head.logits_dimension current_logits = array_ops.slice(logits, [0, begin], [-1, current_logits_size]) all_logits.append(current_logits) beg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _split_heads(self, x: torch.Tensor) -> torch.Tensor:\n depth = x.size(-1)\n split_x = torch.reshape(x, (\n x.size(0), x.size(1),\n self._hparams.num_heads, depth // self._hparams.num_heads))\n return split_x.permute((0, 2, 1, 3))", "def split_heads(x, num_heads):\n ...
[ "0.70507145", "0.65164036", "0.64181155", "0.6412669", "0.6331245", "0.6179869", "0.6152748", "0.5997743", "0.5997743", "0.5997743", "0.5997743", "0.5997743", "0.5997743", "0.5997743", "0.59784955", "0.5914892", "0.56974804", "0.555019", "0.55291426", "0.5393336", "0.530446",...
0.75607777
0
Combines list of ModelFnOps for training.
def _combine_train(self, all_model_fn_ops, train_op_fn): losses = [] additional_train_ops = [] for m in all_model_fn_ops: losses.append(m.loss) additional_train_ops.append(m.train_op) loss = self._loss_combiner(losses) train_op = train_op_fn(loss) train_op = control_flow_ops.group(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _combine_eval(self, all_model_fn_ops):\n predictions = {}\n metrics = {}\n losses = []\n for head, m in zip(self._heads, all_model_fn_ops):\n losses.append(m.loss)\n head_name = head.head_name\n for k, v in m.predictions.items():\n predictions[(head_name, k)] = v\n for k,...
[ "0.7152099", "0.681696", "0.6271104", "0.6034426", "0.58629924", "0.5860132", "0.585599", "0.58350027", "0.57953465", "0.56816924", "0.56582206", "0.5627848", "0.5627384", "0.5624815", "0.5592285", "0.5530983", "0.5488082", "0.5472284", "0.5439261", "0.54166454", "0.5410787",...
0.82771045
0
Combines list of ModelFnOps for inference.
def _combine_infer(self, all_model_fn_ops): predictions = {} output_alternatives = {} for head, m in zip(self._heads, all_model_fn_ops): head_name = head.head_name output_alternatives[head_name] = m.output_alternatives[head_name] for k, v in m.predictions.items(): predictions[(head...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _combine_eval(self, all_model_fn_ops):\n predictions = {}\n metrics = {}\n losses = []\n for head, m in zip(self._heads, all_model_fn_ops):\n losses.append(m.loss)\n head_name = head.head_name\n for k, v in m.predictions.items():\n predictions[(head_name, k)] = v\n for k,...
[ "0.7424944", "0.71752834", "0.59878427", "0.5931156", "0.56635725", "0.56063145", "0.5599954", "0.55916476", "0.5555402", "0.552452", "0.53857994", "0.5308501", "0.5290959", "0.5280084", "0.5270434", "0.5227811", "0.5208972", "0.5192557", "0.5178041", "0.51539606", "0.5143707...
0.7783812
0
Combines list of ModelFnOps for eval.
def _combine_eval(self, all_model_fn_ops): predictions = {} metrics = {} losses = [] for head, m in zip(self._heads, all_model_fn_ops): losses.append(m.loss) head_name = head.head_name for k, v in m.predictions.items(): predictions[(head_name, k)] = v for k, v in m.eval_m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _combine_train(self, all_model_fn_ops, train_op_fn):\n losses = []\n additional_train_ops = []\n for m in all_model_fn_ops:\n losses.append(m.loss)\n additional_train_ops.append(m.train_op)\n loss = self._loss_combiner(losses)\n\n train_op = train_op_fn(loss)\n train_op = control_fl...
[ "0.7129016", "0.6561746", "0.6168162", "0.59013474", "0.58962", "0.57510495", "0.5645326", "0.56403315", "0.5626065", "0.5615804", "0.55982953", "0.55878484", "0.5579561", "0.54772735", "0.5472304", "0.5467546", "0.5465826", "0.546536", "0.546536", "0.5436267", "0.54085", "...
0.79966766
0
Returns a tuple of (loss, weighted_average_loss).
def _loss(loss_unweighted, weight, name): with ops.name_scope(name, values=(loss_unweighted, weight)) as name_scope: if weight is None: loss = math_ops.reduce_mean(loss_unweighted, name=name_scope) return loss, loss loss_weighted = _weighted_loss(loss_unweighted, weight) weighted_average_loss ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_loss(combined_loss):\n loss_dict = {'localization': combined_loss[0].item(),\n 'confidence': combined_loss[1].item()}\n return combined_loss[0] + combined_loss[1], loss_dict", "def _weighted_loss(loss, weight):\n with ops.name_scope(None, \"weighted_loss\", (loss, weigh...
[ "0.67525476", "0.67277217", "0.655962", "0.6471539", "0.64588875", "0.64291614", "0.6397769", "0.6392674", "0.6356757", "0.635146", "0.62811285", "0.6252047", "0.62353516", "0.6232239", "0.61814845", "0.6181042", "0.6164968", "0.61537457", "0.6151719", "0.6144429", "0.6137694...
0.788702
0
Raises ValueError if the given mode is invalid.
def _check_mode_valid(mode): if (mode != model_fn.ModeKeys.TRAIN and mode != model_fn.ModeKeys.INFER and mode != model_fn.ModeKeys.EVAL): raise ValueError("mode=%s unrecognized." % str(mode))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _assert_valid_mode(mode:str):\n if not mode in [_TRAIN, _EVAL, _PREDICT]:\n raise ValueError(\"Invalid mode.\")", "def _checkMode(mode):\n\n if not isinstance(mode, str):\n raise TypeError('The {0} should be a string. Given: {1!r}'.format(\"mode\", mode))\n\n if mode not in [MODE_RTU, MODE_A...
[ "0.7941835", "0.732205", "0.7257453", "0.6744612", "0.66706824", "0.64615804", "0.64179987", "0.6403857", "0.62705153", "0.6223311", "0.6173096", "0.6138948", "0.6084667", "0.6069799", "0.5938012", "0.59287703", "0.5881334", "0.58438796", "0.582425", "0.57956535", "0.5769798"...
0.7829693
1
Returns training loss tensor. Training loss is different from the loss reported on the tensorboard as we should respect the example weights when computing the gradient. L = sum_{i} w_{i} l_{i} / B where B is the number of examples in the batch, l_{i}, w_{i} are individual losses, and example weight.
def _training_loss(features, labels, logits, loss_fn, weight_column_name=None, head_name=None): with ops.name_scope(None, "training_loss", tuple(six.itervalues(features)) + (label...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_loss_weight(self) -> torch.Tensor:\n n_pos: torch.Tensor = 0.0\n n_neg: torch.Tensor = 0.0\n\n for _, ground_truth in self.train_loader:\n n_poss_curr = ground_truth.sum()\n n_pos += n_poss_curr\n n_neg += ground_truth.numel() - n_poss_curr\n\n ...
[ "0.6821857", "0.6805423", "0.6794827", "0.666859", "0.6659326", "0.66584104", "0.6639398", "0.6634321", "0.66334075", "0.6623661", "0.6581316", "0.6571407", "0.65705365", "0.65537775", "0.6537383", "0.6529755", "0.6529278", "0.6529041", "0.65235376", "0.65120804", "0.6492314"...
0.6987192
0
Tries to determine the libc version that the file executable (which defaults to the Python interpreter) is linked against. Returns a tuple of strings (lib,version) which default to the given parameters in case the lookup fails. Note that the function has intimate knowledge of how different libc versions add symbols to ...
def libc_ver(executable=None, lib='', version='', chunksize=16384): if not executable: try: ver = os.confstr('CS_GNU_LIBC_VERSION') # parse 'glibc 2.28' as ('glibc', '2.28') parts = ver.split(maxsplit=1) if len(parts) == 2: return tuple(parts) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_version(e):\n args = e.split()\n args += ['-shared', '-Wl,-t']\n p = subprocess.Popen(args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)\n candidates = [x for x in p.stdout if 'libstdc++.so' in x]\n if not candidates:\n return ''\n assert len(candidates) == 1\n libstdcxx ...
[ "0.67426795", "0.57934326", "0.55663675", "0.555489", "0.55024654", "0.54960775", "0.5471877", "0.5459558", "0.54391474", "0.54132146", "0.53969854", "0.53964067", "0.5367232", "0.5360286", "0.52679116", "0.52131796", "0.5212079", "0.51907736", "0.51898694", "0.5185536", "0.5...
0.7944829
0
Normalize the version and build strings and return a single version string using the format major.minor.build (or patchlevel).
def _norm_version(version, build=''): l = version.split('.') if build: l.append(build) try: strings = list(map(str, map(int, l))) except ValueError: strings = l version = '.'.join(strings[:3]) return version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version_string():\n major, minor, micro, patch, tag, relnum, is_release = VERSION\n\n version = '%s.%s' % (major, minor)\n\n if micro or patch:\n version += '.%s' % micro\n\n if patch:\n version += '.%s' % patch\n\n if tag != 'final':\n if tag == 'rc':\n ...
[ "0.721763", "0.71875566", "0.7102432", "0.7024088", "0.70059144", "0.68267673", "0.6767354", "0.6754383", "0.6735615", "0.67306393", "0.67295843", "0.66853565", "0.66841066", "0.6682962", "0.6672119", "0.66486835", "0.6642322", "0.65846986", "0.65199375", "0.64731044", "0.645...
0.764916
0
Tries to figure out the OS version used and returns a tuple (system, release, version). It uses the "ver" shell command for this which is known to exists on Windows, DOS. XXX Others too ? In case this fails, the given parameters are used as defaults.
def _syscmd_ver(system='', release='', version='', supported_platforms=('win32', 'win16', 'dos')): if sys.platform not in supported_platforms: return system, release, version # Try some common cmd strings import subprocess for cmd in ('ver', 'command /c ver', 'cmd /c ver'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', '')):\n # Import the needed APIs\n try:\n import java.lang\n except ImportError:\n return release, vendor, vminfo, osinfo\n\n vendor = _java_getprop('java.vendor', vendor)\n release = _java_getprop('java.version',...
[ "0.75740063", "0.7208389", "0.7052544", "0.69534546", "0.6946279", "0.6852539", "0.6808164", "0.6719663", "0.6674075", "0.66512173", "0.6601551", "0.6572575", "0.6549043", "0.6530099", "0.6431139", "0.6426023", "0.6416867", "0.6409583", "0.6381106", "0.6374783", "0.6352063", ...
0.8433543
0
Get macOS version information and return it as tuple (release, versioninfo, machine) with versioninfo being a tuple (version, dev_stage, non_release_version). Entries which cannot be determined are set to the parameter values which default to ''. All tuple entries are strings.
def mac_ver(release='', versioninfo=('', '', ''), machine=''): # First try reading the information from an XML file which should # always be present info = _mac_ver_xml() if info is not None: return info # If that also doesn't work return the default values return release, versioninfo,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', '')):\n # Import the needed APIs\n try:\n import java.lang\n except ImportError:\n return release, vendor, vminfo, osinfo\n\n vendor = _java_getprop('java.vendor', vendor)\n release = _java_getprop('java.version',...
[ "0.70257735", "0.69399524", "0.66601026", "0.64289784", "0.63986456", "0.6331269", "0.61766344", "0.61554945", "0.6056711", "0.6012014", "0.59970677", "0.59970117", "0.5963331", "0.5931367", "0.5928057", "0.5925719", "0.59226507", "0.591708", "0.5905139", "0.5883812", "0.5839...
0.8445862
0
Version interface for Jython. Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being a tuple (vm_name, vm_release, vm_vendor) and osinfo being a tuple (os_name, os_version, os_arch). Values which cannot be determined are set to the defaults given as parameters (which all default to '').
def java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', '')): # Import the needed APIs try: import java.lang except ImportError: return release, vendor, vminfo, osinfo vendor = _java_getprop('java.vendor', vendor) release = _java_getprop('java.version', release) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version(self):\r\n return self._get_version(self.java)", "def version(self):\n return \"%d.%d\" % (self._vmajor, self._vminor)", "def get_version_info():\n out = \"\\nmpsyt version : %s \" % __version__\n out += \"\\n notes : %s\" % __notes__\n out += \"\\npafy version : %s\" ...
[ "0.6518461", "0.6503223", "0.6397304", "0.6328363", "0.6327358", "0.63007367", "0.62272507", "0.62220067", "0.6184409", "0.6115367", "0.6099069", "0.6094439", "0.6087738", "0.6084212", "0.60287714", "0.6018853", "0.6005753", "0.5993766", "0.5981113", "0.5972475", "0.5962731",...
0.79008067
0
Returns (system, release, version) aliased to common marketing names used for some systems. It also does some reordering of the information in some cases where it would otherwise cause confusion.
def system_alias(system, release, version): if system == 'SunOS': # Sun's OS if release < '5': # These releases use the old name SunOS return system, release, version # Modify release (marketing release = SunOS release - 3) l = release.split('.') if l:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def system_info() -> str:\n return \"\\n\".join(\n [\n f\"Python version: {platform.python_version()}\",\n f\"Python implementation: {platform.python_implementation()}\",\n f\"Python compiler: {platform.python_compiler()}\",\n f\"PyTorch version: {torch.__versi...
[ "0.6215419", "0.6108677", "0.59298706", "0.59254426", "0.586801", "0.5762022", "0.5750569", "0.574225", "0.5742147", "0.5718789", "0.57069814", "0.5694989", "0.5692988", "0.5684342", "0.5640696", "0.562362", "0.56204915", "0.556907", "0.5566248", "0.55369824", "0.5528952", ...
0.69576734
0
Helper to format the platform string in a filename compatible format e.g. "systemversionmachine".
def _platform(*args): # Format the platform string platform = '-'.join(x.strip() for x in filter(len, args)) # Cleanup some possible filename obstacles... platform = platform.replace(' ', '_') platform = platform.replace('/', '-') platform = platform.replace('\\', '-') platform = platform.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def platform_to_str(self, platform_in):\n parsed_platform = self.parse_platform(platform_in)\n if parsed_platform[2]:\n return \"%s/%s/%s\" % parsed_platform\n if parsed_platform[1]:\n return \"%s/%s\" % parsed_platform[0:2]\n return parsed_platform[0]", "def _fo...
[ "0.73320854", "0.7321266", "0.69390446", "0.6885955", "0.67918944", "0.6570802", "0.6493723", "0.64319324", "0.64065176", "0.6392717", "0.63766414", "0.6262217", "0.6238464", "0.6238464", "0.6237757", "0.62260294", "0.6212253", "0.62072617", "0.62022316", "0.61901605", "0.618...
0.746321
0
In case filepath is a symlink, follow it until a real file is reached.
def _follow_symlinks(filepath): filepath = os.path.abspath(filepath) while os.path.islink(filepath): filepath = os.path.normpath( os.path.join(os.path.dirname(filepath), os.readlink(filepath))) return filepath
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def symlink(self, filen, link):\n src = os.path.abspath(filen)\n cwd = self.getWorkingDirectory()\n dest = os.path.join(cwd, link)\n os.symlink(os.path.relpath(src, cwd), dest)", "def symlink(self, filen, link):\n src = os.path.abspath(filen)\n cwd = self.getWorkingDirec...
[ "0.59758955", "0.59758955", "0.58667785", "0.5801294", "0.5766194", "0.5745428", "0.5708963", "0.5690824", "0.5634242", "0.56276107", "0.55910045", "0.557269", "0.5566692", "0.55402976", "0.5536394", "0.5475052", "0.54657185", "0.5448645", "0.54439133", "0.5421889", "0.540089...
0.7632888
0
Interface to the system's file command. The function uses the b option of the file command to have it omit the filename in its output. Follow the symlinks. It returns default in case the command should fail.
def _syscmd_file(target, default=''): if sys.platform in ('dos', 'win32', 'win16'): # XXX Others too ? return default try: import subprocess except ImportError: return default target = _follow_symlinks(target) # "file" output is locale dependent: force the usage of t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def try_as_file(inp):\n file = pathlib.Path(inp)\n\n if not file.is_absolute():\n file = pathlib.Path.cwd() / file\n\n if not file.exists():\n return None\n\n try:\n # this will throw if it is a symlink that has a loop in it so that it\n # never points to a base file.\n ...
[ "0.57181937", "0.54270643", "0.52126133", "0.52120095", "0.52064097", "0.52064097", "0.5199541", "0.518135", "0.5115018", "0.5114934", "0.5024936", "0.50143844", "0.4999971", "0.4974326", "0.49650243", "0.4924294", "0.49133918", "0.48827857", "0.4861022", "0.48501983", "0.483...
0.5453112
1
Queries the given executable (defaults to the Python interpreter binary) for various architecture information. Returns a tuple (bits, linkage) which contains information about the bit architecture and the linkage format used for the executable. Both values are returned as strings. Values that cannot be determined are r...
def architecture(executable=sys.executable, bits='', linkage=''): # Use the sizeof(pointer) as default number of bits if nothing # else is given as default. if not bits: import struct size = struct.calcsize('P') bits = str(size * 8) + 'bit' # Get data from the 'file' system comm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def architecture(executable=None, bits='', linkage=''): ###\n # Use the sizeof(pointer) as default number of bits if nothing\n # else is given as default.\n if not bits:\n import struct\n try:\n size = struct.calcsize('P')\n except ValueError: ...
[ "0.79984057", "0.605365", "0.598074", "0.5809001", "0.5670192", "0.5661787", "0.5592954", "0.5417459", "0.5406665", "0.53129387", "0.5306204", "0.5304704", "0.5247234", "0.5214229", "0.51679796", "0.51365", "0.51007396", "0.50877565", "0.5084175", "0.5070319", "0.50638765", ...
0.8240533
0
Fairly portable uname interface. Returns a tuple of strings (system, node, release, version, machine, processor) identifying the underlying platform. Note that unlike the os.uname function this also returns possible processor information as an additional tuple entry. Entries which cannot be determined are set to ''.
def uname(): global _uname_cache if _uname_cache is not None: return _uname_cache # Get some infos from the builtin os.uname API... try: system, node, release, version, machine = infos = os.uname() except AttributeError: system = sys.platform node = _node() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uname():\n global _uname_cache\n no_os_uname = 0\n\n if _uname_cache is not None:\n return _uname_cache\n\n processor = ''\n\n # Get some infos from the builtin os.uname API...\n try:\n system, node, release, version, machine = os.uname()\n except AttributeError:\n no_...
[ "0.8784979", "0.7336015", "0.73255605", "0.7301558", "0.7273519", "0.72542316", "0.7228414", "0.7146747", "0.7137755", "0.70993286", "0.70993286", "0.70929116", "0.70929116", "0.70900655", "0.70837486", "0.70837486", "0.70675766", "0.7037415", "0.7003389", "0.69323856", "0.69...
0.8507206
1
Returns the (true) processor name, e.g. 'amdk6' An empty string is returned if the value cannot be determined. Note that many platforms do not provide this information or simply return the same value as for machine(), e.g. NetBSD does this.
def processor(): return uname().processor
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_processor_name() -> bytes:\n return collective.get_processor_name().encode()", "def _detect_name(self):\n\n if 'Model name' in self.cpu_info:\n return self.cpu_info['Model name']\n\n # CPUs C/S Nodes Sockets\n # D03 16 4 1 4 (likely to change in ...
[ "0.7343616", "0.7283618", "0.6868559", "0.6868559", "0.6843412", "0.6774932", "0.67210054", "0.6705206", "0.6705206", "0.6705206", "0.668735", "0.6650386", "0.656623", "0.6536417", "0.6442935", "0.64179313", "0.6400207", "0.6389308", "0.63062775", "0.63062775", "0.62691104", ...
0.7920648
0
Returns a parsed version of Python's sys.version as tuple (name, version, branch, revision, buildno, builddate, compiler) referring to the Python implementation name, version, branch, revision, build number, build date/time as string and the compiler identification string. Note that unlike the Python sys.version, the r...
def _sys_version(sys_version=None): # Get the Python version if sys_version is None: sys_version = sys.version # Try the cache first result = _sys_version_cache.get(sys_version, None) if result is not None: return result # Parse it if 'IronPython' in sys_version: # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def python_version_tuple():\n return tuple(_sys_version()[1].split('.'))", "def get_version():\n vers = [\"%(major)i.%(minor)i\" % __version_info__, ]\n\n if __version_info__['micro']:\n vers.append(\".%(micro)i\" % __version_info__)\n if __version_info__['releaselevel'] != 'final':\n v...
[ "0.69661736", "0.6936045", "0.66326684", "0.6534963", "0.652174", "0.6477283", "0.6472309", "0.64619017", "0.6445718", "0.64044285", "0.6347685", "0.63387734", "0.6316219", "0.62552184", "0.624645", "0.61655927", "0.6143049", "0.6101995", "0.6096731", "0.6026529", "0.59860563...
0.7935132
0
Returns a string identifying the Python implementation.
def python_implementation(): return _sys_version()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_python_version() -> str:\n return \"{} {} on {}\".format(\n platform.python_implementation(),\n platform.python_version(),\n platform.system(),\n )", "def pythonversionstr():\n return '{t[0]}.{t[1]}.{t[2]}'.format(t=platform.python_version_tuple())", "def module_name(self)...
[ "0.7299703", "0.7070567", "0.6981937", "0.680866", "0.6634425", "0.64393586", "0.64343274", "0.6358839", "0.6286373", "0.6282533", "0.62478", "0.61986905", "0.6157437", "0.6141968", "0.60680294", "0.60430735", "0.60430735", "0.5982926", "0.59810865", "0.5969606", "0.596542", ...
0.7831082
0
Returns the Python version as tuple (major, minor, patchlevel) of strings. Note that unlike the Python sys.version, the returned value will always include the patchlevel (it defaults to 0).
def python_version_tuple(): return tuple(_sys_version()[1].split('.'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_version():\n vers = [\"%(major)i.%(minor)i\" % __version_info__, ]\n\n if __version_info__['micro']:\n vers.append(\".%(micro)i\" % __version_info__)\n if __version_info__['releaselevel'] != 'final':\n vers.append('%(releaselevel)s' % __version_info__)\n return ''.join(vers)", "...
[ "0.72485656", "0.7154039", "0.70956457", "0.69873315", "0.6877759", "0.6847924", "0.6845456", "0.6787605", "0.6748689", "0.6733849", "0.6701764", "0.6690922", "0.6680496", "0.6669175", "0.6648375", "0.662438", "0.6623637", "0.65420294", "0.6529781", "0.65242064", "0.6508047",...
0.78322214
0
Returns a string identifying the Python implementation branch. For CPython this is the SCM branch from which the Python binary was built. If not available, an empty string is returned.
def python_branch(): return _sys_version()[2]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scm_branch(self):\n return self._data.get('scm_branch')", "def branch(self):\n return os.popen('git rev-parse --abbrev-ref HEAD').read().strip()", "def get_branch(project_root: str) -> str:\n if os.path.isfile(os.path.join(os.path.abspath(project_root), os.pardir, os.pardir) + '/VERSION'):...
[ "0.7205967", "0.7202124", "0.7188247", "0.71171105", "0.7113601", "0.70824313", "0.6852207", "0.66365796", "0.66342664", "0.64464325", "0.6439272", "0.6393707", "0.6393707", "0.6392835", "0.63432646", "0.6337903", "0.6326181", "0.6315394", "0.6314967", "0.6265553", "0.6242711...
0.76201206
0
Returns a string identifying the Python implementation revision. For CPython this is the SCM revision from which the Python binary was built. If not available, an empty string is returned.
def python_revision(): return _sys_version()[3]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scm_revision(self):\n return self._data.get('scm_revision')", "def get_revision(self) -> str:\n try:\n return self.cmd.rev_parse(verify=True, args=\"HEAD\", check_returncode=True)\n except exc.CommandError:\n return \"initial\"", "def git_version():\n def _mini...
[ "0.70552576", "0.68873155", "0.68783283", "0.6868426", "0.6786601", "0.6774839", "0.67549443", "0.6749165", "0.6732668", "0.67236096", "0.6641747", "0.66417205", "0.6628212", "0.6615963", "0.6615776", "0.66124874", "0.65684795", "0.6500381", "0.64956903", "0.64826936", "0.647...
0.76246005
0
Returns a string identifying the compiler used for compiling Python.
def python_compiler(): return _sys_version()[6]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compiler(self, target):\n self._check_target(target)\n return target.compiler or self._default_compiler", "def CC(self):\n return os.path.join(self._compiler_dir, 'gcc')", "def dump_compiler(input_bytes):\n return dump_from_release(input_bytes, \"compiler\")", "def is_cxx_compiler():\n\n ...
[ "0.7020128", "0.66713786", "0.6648044", "0.63955796", "0.63104576", "0.61867356", "0.6165967", "0.61243194", "0.6005208", "0.59626865", "0.59392613", "0.5927113", "0.5848496", "0.58295643", "0.58110297", "0.5800708", "0.57865334", "0.5751744", "0.57448256", "0.57179636", "0.5...
0.7652477
0
Function to find the source and target of floating edges, for now it only works for edges that support the relation between two other edges, it can be extended for other cases
def find_missing_source_target(property_restrictions, object_properties, sources_targets): # Under this scope restrictions are all relations that indicate relationships # between other object properties for restriction in property_restrictions: child = restriction["xml_object"] geom_prope...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getEdge(source: LNode, target: LNode) -> LEdge:\n for edge in source.getConnectedEdges():\n # [TODO] or is suspicious\n if (edge.dstNode is target) or (edge.srcNode is target):\n return edge\n\n return None", "def referenceEdge(u,v):\n v1 = u\n v2 = v\n\n e1 = u.getEdg...
[ "0.6024941", "0.58484167", "0.5752038", "0.5737474", "0.57083946", "0.56946784", "0.56158674", "0.5598349", "0.55899394", "0.55752385", "0.55166656", "0.5508613", "0.5493426", "0.5487787", "0.5427421", "0.5421382", "0.5415151", "0.5399748", "0.5381808", "0.53680706", "0.53651...
0.6372637
0
This function keeps album table clean without any empty albums Empty albums are albums that has no picture associated with that album This is necessary when uploading SenseCam images which are uploaded in a temporary album at the beginning and a temporary album is created for this purposes
def remove_empty_albums(aid): print "aid" print aid if aid is None: return con = mdb.connect('localhost', 'root', 'sensepass', 'sensecambrowser') with con: query = "SELECT count(*) from fileuploader_picture WHERE album_id=%s" % (aid) cur = con.cursor() cur.execute(query) data = cur.fetchall() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_up(self, graph):\n # Delete albums associated with place\n if len(self.albums) != 0:\n for album in self.albums:\n album.clean_up()\n album.delete(graph)", "def test_single_track_blank_album(self):\n self.add_mp3(set_album=True, album='')\n ...
[ "0.6798063", "0.58578044", "0.5783619", "0.5745405", "0.5689042", "0.56451136", "0.55336326", "0.547788", "0.5440784", "0.5437586", "0.54365647", "0.538309", "0.53422564", "0.53341514", "0.5314252", "0.53092307", "0.5274518", "0.52541596", "0.5244834", "0.5214889", "0.5177951...
0.7484433
0
This function retrieves sensor type id according to abbreviation
def get_sensor_type_id(abbreviation): if abbreviation is None: return con = mdb.connect('localhost', 'root', 'sensepass', 'sensecambrowser') with con: query = "SELECT id from fileuploader_sensortype WHERE abbreviation=%s" % (abbreviation) cur = con.cursor() cur.execute(query) data = cur.fetchall() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sensor_type_id(sensor_type_name):\n query = db.session.query(\n TypeClass.id,\n ).filter(TypeClass.sensor_type == sensor_type_name)\n sensor_id = db.session.execute(query).fetchone()\n if isinstance(sensor_id, Iterable):\n sensor_id = sensor_id[0]\n return sensor_id", "def ge...
[ "0.69486004", "0.68731916", "0.66719717", "0.6295486", "0.6116762", "0.6110051", "0.6105108", "0.6088619", "0.6078984", "0.6076802", "0.6066289", "0.6006523", "0.5961502", "0.588481", "0.5851543", "0.58258665", "0.5825055", "0.5802354", "0.5762437", "0.5751909", "0.57310176",...
0.8284104
0
Plot a performance metric vs. forecast horizon from cross validation. Cross validation produces a collection of outofsample model predictions that can be compared to actual values, at a range of different horizons (distance from the cutoff). This computes a specified performance metric for each prediction, and aggregat...
def plot_cross_validation_metric( df_cv, metric, rolling_window=0.1, ax=None, figsize=(10, 6) ): if ax is None: fig = plt.figure(facecolor='w', figsize=figsize) ax = fig.add_subplot(111) else: fig = ax.get_figure() # Get the metric at the level of individual predictions, and with...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_training_history(history, metric):\n \n val_metric = 'val_'+metric\n acc = history.history[metric]\n val_acc = history.history[val_metric]\n \n loss = history.history['loss']\n val_loss = history.history['val_loss']\n \n epochs_range = history.epoch\n \n plt.figure(figsize...
[ "0.6284926", "0.60687554", "0.5854684", "0.57665604", "0.57452273", "0.574382", "0.5705404", "0.5692809", "0.55961776", "0.5575118", "0.55700886", "0.55517894", "0.55211616", "0.55112994", "0.5492204", "0.5428145", "0.5419277", "0.53920174", "0.5386919", "0.5379678", "0.53709...
0.75381464
0
r""" $\alpha$geodesic between two probability distributions
def alpha_geodesic( a: torch.Tensor, b: torch.Tensor, alpha: float, lmd: float ) -> torch.Tensor: a_ = a + 1e-12 b_ = b + 1e-12 if alpha == 1: return torch.exp((1 - lmd) * torch.log(a_) + lmd * torch.log(b_)) elif alpha >= 1e+9: return torch.min(a_, b_) elif alpha <=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Dist(p1,p2):\n x1, y1 = p1\n x2, y2 = p2\n return (((x1-x2)*(x1-x2)) + ((y1-y2)*(y1-y2)))**0.5", "def prob_larger_continuous(distr1, distr2):\n\n return distr1.expect(distr2.cdf)", "def Geometric(name, p):\n return rv(name, GeometricDistribution, p)", "def hyperboloidDist(point1, point2):\n retu...
[ "0.6699356", "0.6350744", "0.6237337", "0.62175363", "0.60602874", "0.6047542", "0.6032256", "0.5975014", "0.5959113", "0.59015775", "0.59015435", "0.5897139", "0.588646", "0.58855504", "0.58800197", "0.5860326", "0.5824693", "0.58132815", "0.58132315", "0.5791702", "0.579020...
0.6636303
1
Generate and Upload the Discharge Summary
def generate_discharge_summary_task(consultation_ext_id: str): logger.info(f"Generating Discharge Summary for {consultation_ext_id}") try: consultation = PatientConsultation.objects.get(external_id=consultation_ext_id) except PatientConsultation.DoesNotExist as e: raise CeleryTaskException( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_summary_stats(self):\n total_return = self.equity_curve['equity_curve'][-1]\n returns = self.equity_curve['returns']\n pnl = self.equity_curve['equity_curve']\n \n sharpe_ratio = create_sharpe_ratio(returns) #, periods=252*6.5*60) ??? \n drawdown, max_dd, dd_dur...
[ "0.58248866", "0.5804602", "0.57893074", "0.57541466", "0.5715792", "0.5710718", "0.5644889", "0.562997", "0.5606139", "0.5578409", "0.5574924", "0.55447257", "0.55363977", "0.550161", "0.547973", "0.5438724", "0.5418366", "0.53975743", "0.5387723", "0.5375758", "0.5373265", ...
0.65132904
0
iterate over all available hbtasks
def available_hbtasks(): out = [] for tname in dir(tasks): t = getattr(tasks,tname) if inspect.isclass(t) and issubclass(t,tasks.HbTask) and t is not tasks.HbTask: yield tname, t
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def list_tasks():", "def get_all_tasks(self):\n return [\n self.create_virtual_environment,\n self.doc,\n self.install,\n self.lint,\n self.make_distribution,\n self.reset,\n self.setup,\n self.test,\n ]",...
[ "0.5763663", "0.5759618", "0.56385845", "0.5613529", "0.55773354", "0.54651177", "0.54613435", "0.53956527", "0.5391799", "0.53323907", "0.53138953", "0.5310662", "0.52955556", "0.5286145", "0.5217878", "0.51891303", "0.5174316", "0.5149377", "0.51352507", "0.51346594", "0.51...
0.74593323
0
check the settings of a HbTask return json with result hash, which you can then use to set up the next e.g. /check/Add/?x=1&y=5
def check(request,task_name): try: todo = getattr(tasks,task_name,None) except KeyError: return JsonResponse( {'error':'This {} is not a known task'.format(taskname)}) parameters = todo().settings.get.keys() try: kwargs = {par:request.GET[par] for par in par...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run(request, resulthash):\n try:\n stored = models.HBTask.objects.get(resulthash=resulthash)\n except:\n stored = None\n thisone = {'Error', 'not found in database'}\n \n # Finished, and reported back\n if stored.status == models.HBTask.OK_STATUS:\n thisone = True\n\n...
[ "0.641575", "0.63129026", "0.5868379", "0.5789204", "0.5733075", "0.5673604", "0.56617296", "0.5656108", "0.5621732", "0.5575373", "0.55724365", "0.5537721", "0.54453605", "0.5443226", "0.5416293", "0.5410396", "0.5378141", "0.534365", "0.533824", "0.53032565", "0.52877766", ...
0.6802357
0
add a task result to a project provide hash and project name
def add_to_project(resulthash,project): t = models.HBTask.objects.get(resulthash=resulthash) p = models.Project.objects.get(name=projectname) p.tasks.add(t)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_task(self, task):\n res = self.conn.cursor().execute(\"\"\"SELECT count(*) as \"order\" FROM tasks WHERE project_id=?\"\"\",\n (task['project_id'],))\n res = res.fetchone()\n order = int(res['order']) + 1\n cursor = self.conn.cursor().exec...
[ "0.6374565", "0.61560464", "0.6085082", "0.6062353", "0.60185844", "0.6016819", "0.6004296", "0.60006815", "0.59521013", "0.59515864", "0.58847183", "0.5825966", "0.5824629", "0.58160424", "0.57332444", "0.57234216", "0.56767815", "0.5675966", "0.5663726", "0.5663456", "0.565...
0.70965487
0
Check if hashes are already available E.g. /available/?h=1&h=2&h=1adf22a49521bb4da13686d2560953a6
def available(request): hashes = request.GET.getlist('h',None) available = {} for h in hashes: available.update({h:check_available_object(h)}) return JsonResponse(available)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_route_used(_, hash_arg):\n for hash_object in Hash.objects.all():\n if hash_object.hash == hash_arg:\n return HttpResponse(\n json.dumps({\"Used\": True}), mimetype=\"application/json\")\n\n Hash(hash=hash_arg).save()\n return HttpResponse(\n json.dumps({\"Us...
[ "0.6649847", "0.6125281", "0.5972277", "0.5907636", "0.5861764", "0.5686857", "0.56727827", "0.5666598", "0.5653059", "0.54939723", "0.5464405", "0.54545414", "0.5419799", "0.54197407", "0.5365426", "0.53599435", "0.53240955", "0.53148705", "0.5297111", "0.5288192", "0.52737"...
0.7324028
0
Find most probable region in HarvardOxford Atlas of a vox coord.
def locate_peaks(vox_coords): sub_names = harvard_oxford_sub_names ctx_names = harvard_oxford_ctx_names at_dir = op.join(os.environ["FSLDIR"], "data", "atlases") ctx_data = nib.load(op.join(at_dir, "HarvardOxford", "HarvardOxford-cort-prob-2mm.nii.gz")).get_data() sub_dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def determine_region(x, y, width, height):\n xs = [0, width / 3, 2 * width / 3, width]\n ys = [0, height / 3, 2 * height / 3, height]\n for i in range(3):\n for j in range(3):\n if (x >= xs[j] and x < xs[j + 1]) and (y >= ys[i] and y < ys[i + 1]):\n return i * 3 + j", "def minimum_spanning_arbo...
[ "0.58675516", "0.57267046", "0.5638504", "0.55983895", "0.5562923", "0.5545581", "0.54555863", "0.5422686", "0.5355386", "0.5342899", "0.5318674", "0.53076345", "0.5263731", "0.5236593", "0.520713", "0.51990044", "0.51692146", "0.51691866", "0.5168615", "0.51660985", "0.51551...
0.61049676
0
update location of an incident
def update_location_only(self, location, incident_id): self.cursor.execute("""UPDATE incidents SET location='%s' WHERE incident_id='%s'"""%(location,incident_id)) self.commiting()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_location(self, id, location):\n sql = f\"UPDATE incidences SET location = \\'{location}\\'\\\n WHERE incidences.id = {id}\"\n conn = Db().con\n curr = conn.cursor()\n curr.execute(sql)\n conn.commit()", "def upsert_location(self, location):", "def upd...
[ "0.76122206", "0.69032365", "0.6729832", "0.6556108", "0.6544285", "0.64480174", "0.61404055", "0.6120101", "0.61116576", "0.60934275", "0.6064723", "0.6015835", "0.5995509", "0.5994672", "0.59677976", "0.5956472", "0.5948218", "0.5909087", "0.5898638", "0.5888847", "0.586701...
0.7888442
0
update comment of an incident
def update_comment_only(self, comment, incident_id): self.cursor.execute("""UPDATE incidents SET comment='%s' WHERE incident_id='%s'"""%(comment ,incident_id)) self.commiting()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_comment(self, id, comment):\n sql = f\"UPDATE incidences SET comment = \\'{comment}\\'\\\n WHERE incidences.id = {id}\"\n conn = Db().con\n curr = conn.cursor()\n curr.execute(sql)\n conn.commit()", "def edit_comment():\n # Impl...
[ "0.8003306", "0.72777617", "0.7273704", "0.7262597", "0.70803076", "0.7057946", "0.70297766", "0.6917318", "0.6718791", "0.66493183", "0.66147476", "0.6471529", "0.6453238", "0.6453238", "0.6449025", "0.6447175", "0.64454687", "0.6445442", "0.6428888", "0.6378571", "0.6378571...
0.8372494
0
update title of an incident
def update_title_only(self, title, incident_id): self.cursor.execute("""UPDATE incidents SET title='%s' WHERE incident_id='%s'"""%(title, incident_id)) self.commiting()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_title(self, title):\n if type(title) != str:\n raise Exception(\"title is not a string\")\n\n self.__title_var.set(title)", "def _update_title(self, title, tag, lid):\n return title", "def _UpdateTitle(self, event, new_title='Updated event title'):\n\n previous_tit...
[ "0.7311984", "0.7305447", "0.7303785", "0.7017659", "0.69140047", "0.69086075", "0.68804616", "0.68541485", "0.68230927", "0.6807289", "0.6733378", "0.672871", "0.67204005", "0.670341", "0.66799015", "0.66678137", "0.66630304", "0.66421956", "0.66421956", "0.66421956", "0.664...
0.8301075
0
delete a specific incident
def delete_specific_incident(self, incident_id): self.cursor.execute("""DELETE FROM incidents WHERE incident_id ='%s' AND status='draft' """ %(incident_id)) self.commiting() return incident_id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_incident(self, id):\n sql = f\"DELETE FROM incidences WHERE incidences.id ={id}\"\n conn = Db().con\n curr = conn.cursor()\n curr.execute(sql)\n conn.commit()", "def delete_entry(self, scenario_info):\n sql = self.delete(\"id\")\n self.cur.execute(sql, ...
[ "0.7976646", "0.6722562", "0.670638", "0.6674578", "0.66652", "0.64647585", "0.64437497", "0.63609916", "0.63390464", "0.6286161", "0.6257736", "0.6240173", "0.61823016", "0.61280674", "0.6107225", "0.60961556", "0.6091427", "0.60879624", "0.60801107", "0.60540205", "0.605307...
0.7996932
0
Return branches that should be used as bases to check for branches that are already contained within them. The first branch in the list is the default branch for the origin remote.
def base_branches() -> list[str]: branches = [] default = sh("git rev-parse --abbrev-ref origin/HEAD").removeprefix("origin/") branches.append(default) releases = sh( "git branch --all --sort=-committerdate --list *release/* | head -10" ).splitlines() releases = [b.removeprefix("*").st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def branches(self):\n return sorted([\n br[20:] for br in self.repo.refs.keys() if (\n br.startswith('refs/remotes/origin/') and\n br[20:] != 'HEAD'\n )\n ])", "def branches(self) -> list[str]:\n _args: list[Arg] = []\n _ctx = self._...
[ "0.71715426", "0.71089673", "0.6710281", "0.6684703", "0.66340756", "0.66328895", "0.6632771", "0.6595276", "0.6540279", "0.6526692", "0.65261155", "0.6521703", "0.63657045", "0.6361955", "0.63289434", "0.6327129", "0.62591374", "0.6242348", "0.6222655", "0.6163094", "0.61493...
0.7896697
0
Create the Refund for the Invoice.
def post(invoice_id): current_app.logger.info(f'<Refund.post : {invoice_id}') request_json = request.get_json(silent=True) try: valid_format, errors = schema_utils.validate(request_json, 'refund') if request_json else (True, None) if not valid_format: retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(payment, **data):\n if isinstance(payment, resources.Payment):\n payment = payment.id\n\n http_client = HttpClient()\n response, _ = http_client.post(routes.url(routes.REFUND_RESOURCE, payment_id=payment), data)\n return resources.Refund(**response)", "def initia...
[ "0.6858112", "0.6258096", "0.62494576", "0.60835224", "0.59996796", "0.59798473", "0.594909", "0.5946934", "0.5879488", "0.58272815", "0.57642823", "0.57502127", "0.56931144", "0.56429595", "0.5636706", "0.5613712", "0.5600246", "0.5600246", "0.55394715", "0.552758", "0.54929...
0.70421207
0
Flag=1 for subproblem of ALR Flag=2 for subproblem of LR Flag=3 for subproblemmean of ALR Flag=4 for subproblemmean of LR
def g_solving_subproblem_of_ALR(self,vehicle_id): global_LB = -10000 global_UB = 10000 iteration_for_RSP = 20 optimal_solution_for_RSP = None self.multiplier_v = 0.5 # solve the expected shortest path problem self.g_dynamic_programming_algorithm(vehicle_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_mean_fit(flag='L'):\n if flag == 'L':\n return np.mean(np.vstack(l_coeff_queue), axis =0) if len(l_coeff_queue)>1 else l_coeff_queue[-1]\n else:\n return np.mean(np.vstack(r_coeff_queue), axis =0) if len(r_coeff_queue)>1 else r_coeff_queue[-1]", "def g_solving_subproblem_of_LR(self,ve...
[ "0.58328474", "0.54240626", "0.50724727", "0.5055976", "0.5030519", "0.49894556", "0.49818513", "0.49783278", "0.49663126", "0.4953816", "0.49137238", "0.49109685", "0.4887026", "0.484889", "0.48471913", "0.48341736", "0.48184672", "0.47867945", "0.47867945", "0.47867945", "0...
0.55380154
1
Returns True if another observation have been associated with the scan It also replaces that observation if the new one is closer in time to the respective wifi scan
def scan_observed(scan_timestamp, ap_scan, location, previous_observations, user_id): location_timestamp = location[0] latitude = location[1] longitude = location[2] distance_to_closest_scan = abs(location_timestamp - scan_timestamp) for observation in previous_observations: observed_wifi_scan_time = observat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isDuplicate(self, a, b):\n\n isDuplicate = (\n abs(a['distance_in_km'] - b['distance_in_km']) \n < RunDataProcessor.KM_SIMILARITY_THRESHOLD and \n abs((a['start_timestamp'].tz_convert(None) - b['start_timestamp'].tz_convert(None)).total_seconds()) \n <...
[ "0.59715676", "0.5802782", "0.57483566", "0.56059116", "0.5456994", "0.5426937", "0.5389302", "0.5318968", "0.53116345", "0.52669287", "0.5255155", "0.5237892", "0.523052", "0.5199206", "0.51953757", "0.5144182", "0.5136891", "0.51364833", "0.51262516", "0.5119525", "0.511936...
0.62825596
0