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
Extract demo parameters from the model definition.
def get_pars(model_info, use_demo=False): # Get the default values for the parameters pars = dict((p.name, p.default) for p in model_info['parameters']) # Fill in default values for the polydispersity parameters for p in model_info['parameters']: if p.type in ('volume', 'orientation'): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extractModelParam(self):\n copasi_filename = self.genPathCopasi(\"extractor\")\n self.recentModel = model.loada(self.antString, copasi_filename)\n return self.recentModel.parameters.copy().squeeze().to_dict()", "def doParametersOfInterest(self):\n\n self.modelBuilder.doVar(\"Rdy[1...
[ "0.64837956", "0.6315743", "0.6273915", "0.6248899", "0.62303966", "0.6206407", "0.61934096", "0.6082434", "0.6003491", "0.5971099", "0.5959919", "0.5900141", "0.5893965", "0.5847058", "0.5823629", "0.58202666", "0.5698285", "0.56955665", "0.568675", "0.56371653", "0.55673975...
0.6731628
0
Explore the model using the Bumps GUI.
def explore(opts): import wx from bumps.names import FitProblem from bumps.gui.app_frame import AppFrame problem = FitProblem(Explore(opts)) is_mac = "cocoa" in wx.version() app = wx.App() frame = AppFrame(parent=None, title="explore") if not is_mac: frame.Show() frame.panel.set_mod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def demo(name):\n x, y = demo_data[name]\n\n# _models = [models.Const1D(0), models.Gaussian1D(3, 1, .3), models.Gaussian1D(3, 2, .3)]\n# _models = [models.Const1D(0)]\n _models = None\n\n mv = ModelBrowser(x, y, y * 0, _models)\n\n mv.show()\n\n from glue.qt import get_qapp\n get_qapp().ex...
[ "0.5889574", "0.5794204", "0.5676047", "0.5631792", "0.5585122", "0.5573371", "0.55641425", "0.5525804", "0.5505557", "0.5493777", "0.5486398", "0.54668134", "0.54602724", "0.54134226", "0.53638995", "0.53637457", "0.53484154", "0.5342063", "0.5337206", "0.53012127", "0.52861...
0.594703
0
Draw a nice housing to hold the traffic lights
def draw_housing(): green.pensize(3) green.color("black", "darkgrey") green.begin_fill() green.forward(80) green.left(90) green.forward(200) green.circle(40, 180) green.forward(200) green.left(90) green.end_fill()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_housing():\n tess.pensize(3)\n tess.color(\"black\", \"darkgrey\")\n tess.begin_fill()\n tess.forward(80)\n tess.left(90)\n tess.forward(200)\n tess.circle(40, 180)\n tess.forward(200)\n tess.left(90)\n tess.end_fill()", "def draw_housing():\n tess.pensize(3)\n tess.c...
[ "0.757192", "0.7526881", "0.7487201", "0.6984903", "0.6798373", "0.66007304", "0.60361487", "0.599414", "0.5903113", "0.58729994", "0.5810986", "0.5800031", "0.57894075", "0.578831", "0.5784329", "0.5757554", "0.5753362", "0.5752967", "0.5747853", "0.5739003", "0.5734231", ...
0.7746798
0
Modify previous program then we can still realize the rest of lights when they turn off. Green, green and orange, orange, red. We number these states 0, 1, 2, 3. With timer like exercise requisition.
def advance_state_machine(): global state_num if state_num == 0: red.color("black") orange.color("black") green.color("green") state_num = 1 wn.ontimer(advance_state_machine, 3000) elif state_num == 1: red.color("black") orange.color("orange"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ControlLights(state):\n for led in (RED,YELLOW,GREEN):\n GPIO.output(LED[led],state[led])\n time.sleep(FLASH_TIME)", "def light_standby():\n for led in leds:\n led.on()\n\n rgb_driver.pulse(on_color=(scale[\"R\"], scale[\"G\"], scale[\"B\"]), off_color=(0,0,0))", "def advance_state_ma...
[ "0.72298914", "0.6718091", "0.67174655", "0.6687307", "0.65495807", "0.64910793", "0.6281461", "0.62786615", "0.62331176", "0.6230395", "0.62226593", "0.61985695", "0.619567", "0.6166632", "0.6125692", "0.6088462", "0.60882527", "0.608752", "0.60666007", "0.6051194", "0.60249...
0.7125816
1
The check to be performed on an AST (a design file).
def check(self, input, ast): assert False # Must be redefined
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_advance_ast_avaliable():\n assert _test_advanced_ast_presence()", "def check(self):\n try:\n if self.is_compiled:\n # skip compiled (Cythonized) files because pyanalyze will misinterpret the\n # AST in some cases (for example, if a function was cdefed)\...
[ "0.648272", "0.6393194", "0.62702", "0.613588", "0.60619", "0.60233366", "0.5977728", "0.597741", "0.59475607", "0.5865792", "0.58510435", "0.58335364", "0.58133894", "0.58133894", "0.58133894", "0.58133894", "0.57385635", "0.5718586", "0.5697994", "0.56697005", "0.5647083", ...
0.6982063
0
>>> a,b = getnextbyte(binascii.unhexlify('1210233445'), 1) >>> print(hex(a)) 0x23 >>> print(b) 3 >>> a,b = getnextbyte(binascii.unhexlify('1210233445'), 0) >>> print(hex(a)) 0x12 >>> print(b) 1
def getnextbyte(data, index): v = data[index] index += 1 if v == 0x10: v = data[index] index += 1 return v,index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_byte(self):\r\n return self.next_bytes(1)", "def _hexbyte(b):\n return _hexchar(b[0]) * 16 + _hexchar(b[1])", "def _read_next_bytes(\n fid, num_bytes, format_char_sequence, endian_character=\"<\"\n ):\n data = fid.read(num_bytes)\n return struct.unpack(endian_characte...
[ "0.6322323", "0.611362", "0.60862136", "0.6062787", "0.59771585", "0.5948756", "0.5931488", "0.5912274", "0.5912274", "0.58405614", "0.5801832", "0.5792458", "0.57521725", "0.57397574", "0.5722311", "0.569004", "0.568189", "0.56619096", "0.5647636", "0.56459695", "0.56325865"...
0.71101743
0
Setting should fail due to name conflict.
def test_set_conflict(self): with RandomKeyTmpFile() as fname: command_line = self._MENU + [self._KEYNAME, "--keyfile-path", fname] RUNNER(command_line) self.check_error(StratisCliNameConflictError, command_line, _ERROR)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_set_bad_name(self):\n dim = Dimension(\"yolo\", \"uniform\", -3, 4, shape=(4, 4))\n with pytest.raises(TypeError):\n dim.name = 4", "def test_set_invalid_scope(self):\n setting_name = 'user_str_setting'\n url = reverse(\n 'projectroles:api_project_settin...
[ "0.64577913", "0.62993205", "0.6259956", "0.6173455", "0.6092742", "0.6091933", "0.6072255", "0.60711807", "0.60665685", "0.603069", "0.6024282", "0.6014658", "0.5978283", "0.5969654", "0.59553856", "0.5953395", "0.5953062", "0.59395117", "0.590152", "0.5899473", "0.58943343"...
0.7105276
0
Setting should fail due to the length of the key.
def test_set_key_too_long(self): with RandomKeyTmpFile(128) as fname: command_line = self._MENU + [self._KEYNAME, "--keyfile-path", fname] self.check_error(StratisCliEngineError, command_line, _ERROR)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_invalid_keys(self):\n\n\t\ttry:\n\t\t\tyield self.conn.set(\"this has spaces\", 1)\n\t\texcept ValueError:\n\t\t\tpass\n\t\telse:\n\t\t\tself.fail(\"key with spaces did not raise ValueError\")\n\n\t\ttry:\n\t\t\tyield self.conn.set(\"\\x10control\\x02characters\\x11\", 1)\n\t\texcept ValueError:\n\t\t\tpa...
[ "0.7063274", "0.69667125", "0.6398266", "0.6392544", "0.6392544", "0.6260004", "0.6244157", "0.62292206", "0.622276", "0.6218091", "0.6210933", "0.6209377", "0.61843306", "0.6152999", "0.61401016", "0.6111454", "0.6110578", "0.6082006", "0.6082006", "0.60524166", "0.6032132",...
0.70860624
0
Test that specifying a filename that does not exist raises a StratisCliKeyfileNotFoundError.
def test_set_key_filename_missing(self): command_line = self._MENU + [self._KEYNAME, "--keyfile-path", "/bogus"] self.check_error(StratisCliKeyfileNotFoundError, command_line, _ERROR)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_config_filename_given_file_doesnt_exist():\n config_file_name = \"i_dont_exist.ini\"\n assert not os.path.exists(config_file_name)\n\n with pytest.raises(Exception):\n Config(filename=config_file_name)", "def test_path_nonexistent(self):\n self.command.package = self.input_ovf\n ...
[ "0.7394184", "0.69968396", "0.6942686", "0.69373065", "0.69018644", "0.68976176", "0.68946975", "0.6786818", "0.6780421", "0.6769902", "0.6741125", "0.6615576", "0.66148007", "0.6611362", "0.6587929", "0.6565255", "0.65609694", "0.6548419", "0.6540407", "0.65388423", "0.65248...
0.8606106
0
Receives an interval from the frequency of root_pitch root_pitch['freq']), expressed in mils. A positive value means the interval extends above root_pitch while a negative value means the interval extends below. Returns the frequency of the pitch that interval away from root_pitch.
def mils_to_freq(m): f = root_pitch['freq']*(2**(float(m)/12000)) return f;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def freq_to_mils(f):\n if f == 0:\n raise Exception('0 not a valid frequency, what you playing at!?')\n else:\n m = int(round(12000* log(f/root_pitch['freq'],2)))\n return m;", "def getFundFreq(self, data, sampleRate):\n sp = SignalProc.SignalProc(256, 128)\n sp.d...
[ "0.6005354", "0.5816876", "0.5760161", "0.56855977", "0.5584908", "0.55389327", "0.5513072", "0.5502047", "0.5458081", "0.5408832", "0.5342084", "0.53296864", "0.5326595", "0.5306963", "0.52949834", "0.5241739", "0.5227384", "0.521453", "0.5211651", "0.5193988", "0.51438063",...
0.6486499
0
Receives a frequency, returns interval in mils between that frequency and the frequency of root_pitch (root_pitch['freq']). Returns positive value if given frequency is higher than root_pitch, negative if lower
def freq_to_mils(f): if f == 0: raise Exception('0 not a valid frequency, what you playing at!?') else: m = int(round(12000* log(f/root_pitch['freq'],2))) return m;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def miditofreq(midinote):\n return 440 * (2 ** ((midinote - 69.0)/12.0))", "def perceptual_amplitude_dbb(frequency: float) -> float:\n # See http://www.sengpielaudio.com/BerechnungDerBewertungsfilter.pdf\n\n num = 12200.0 ** 2. * frequency ** 3\n den = (frequency ** 2. + 20.6) * (frequency ** 2. + 12...
[ "0.6333899", "0.61145616", "0.6066061", "0.6028613", "0.60101444", "0.5847054", "0.5843562", "0.5816642", "0.58075583", "0.57927597", "0.5756494", "0.5755922", "0.5688351", "0.56856346", "0.5646544", "0.56452155", "0.5620738", "0.5614233", "0.5599333", "0.5584674", "0.5558646...
0.6282281
1
Receives a value in mils between 0 and 999. If this is more than 500 it subtracts 1000
def pos_neg(mils): if mils > 500: mils -= 1000 return mils;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limitValue(self, value, lowerLimit, upperLimit):\n if value > upperLimit:\n return upperLimit\n elif value < lowerLimit:\n return lowerLimit\n else:\n return value", "def limit_speed(speed):\n if speed > 1000:\n speed = 1000\n elif speed < -1...
[ "0.6407028", "0.6335328", "0.62473875", "0.6163593", "0.6136198", "0.602561", "0.57908463", "0.560255", "0.5591744", "0.55848867", "0.55823934", "0.5577144", "0.556901", "0.55591995", "0.5556475", "0.55531615", "0.55418956", "0.5537635", "0.55336213", "0.55145276", "0.5510138...
0.68922126
0
Given the frequency at octave 0, returns the frequency at target_octave.
def freq_at_octave(freq_at_zero, target_octave): target_frequency = 0 if target_octave<0: b = (target_octave*-2)/2 else: b = target_octave for a in range(0,b): if target_octave>0: target_frequency *=2 else: target_frequency /=2 target_frequenc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_freq(self, octave):\n return notes[f'{self.note}{octave}']", "def source_freq(self) -> int:", "def days_in_frequency_target(target: int) -> int:\n return int((target / 12) * 365)", "def tone_to_freq(tone):\n return math.pow(2, (tone - 69.0) / 12.0) * 440.0", "def freq(self, freq: Optiona...
[ "0.66253114", "0.6102212", "0.6060947", "0.59513015", "0.5842971", "0.57598406", "0.5730503", "0.5708239", "0.5680097", "0.5648331", "0.56461424", "0.56106067", "0.55054444", "0.5502096", "0.5499251", "0.545656", "0.5456237", "0.5444813", "0.53967893", "0.5381159", "0.5379939...
0.8766376
0
Prepare the calculator when a new qgrid is passed.
def _prepare(self, q): # store it in _lastr which is consulted in BasePDFGenerator.__call__ self._lastr = q self._calc.qstep = q[1] - q[0] self._calc.qmin = q[0] self._calc.qmax = q[-1] + 0.5*self._calc.qstep return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prepare_grid(self):\n raise NotImplementedError", "def _build_integration_grid(self):\n pass", "def _prepare(self, setup):\n # Initialise cell\n self.cell = self.celltype(model=self._model)\n for rec in setup.record_variables:\n self.cell.record(*rec)\n ...
[ "0.6526059", "0.5305715", "0.5272461", "0.5195514", "0.51765853", "0.5174405", "0.5172547", "0.51565105", "0.5122712", "0.5108893", "0.51086247", "0.50760674", "0.5064199", "0.503173", "0.5030332", "0.50220716", "0.49932542", "0.4988096", "0.49769023", "0.4948785", "0.4926636...
0.54423946
1
FONCTION QUI ORGANISE LA FIN DU TOUR
def finTour(self): print("fin du tour") self.etat = "Fin" if self.joueurActif.nbRessource + self.joueurActif.getNbRessourceTour() <= self.joueurActif.nbMaxRessource : self.joueurActif.nbRessource += self.joueurActif.getNbRessourceTour() else: self.joueurActif.nbRessource = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def es_satisfecho_por(self, candidata):", "def get_furniture():", "def fechou(self):\n return self.tot_rodada == self.rodada", "def vendre(self, symbole, quantite, une_date=date.today()):\n\n if une_date > date.today():\n raise ErreurDate(\"La date est postérieure à la date d'aujourd...
[ "0.63391507", "0.62116545", "0.6208521", "0.61218905", "0.6033425", "0.6032181", "0.6018563", "0.5958281", "0.5849472", "0.58314395", "0.5814928", "0.5783631", "0.5661068", "0.5661068", "0.5644017", "0.5642015", "0.5641191", "0.56019706", "0.5591685", "0.5587276", "0.5584715"...
0.63097227
1
Takes a filesystem path and returns a sorted list of filenames under that path.
def get_filenames(path): xs = [] for (dirpath, dirnames, filenames) in os.walk(path): xs.extend(filenames) break xs.sort() return xs
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_files(path: str) -> List:\n files = []\n for file in os.listdir(path):\n if os.path.isfile(os.path.join(path, file)):\n files.append(file)\n # Reversed to prevent collision upon renaming\n return sorted(files, reverse=True)", "def get_dirnames(path):\n storage = DefaultSt...
[ "0.7952454", "0.73314255", "0.7306707", "0.72185194", "0.7201891", "0.71731275", "0.7164499", "0.7163715", "0.7132579", "0.7100023", "0.70964265", "0.7095107", "0.70786023", "0.7019149", "0.69829243", "0.6979037", "0.6974068", "0.69649667", "0.69457054", "0.69418824", "0.6890...
0.7987954
0
Takes a sequence p representing a polynomial and a number x and returns the value of p at x. This version is Numbacompatible; NumPy's version is not.
def polyval(p, x): val = 0 ii = len(p) - 1 for i in range(len(p) - 1): val += p[i] * (x ** ii) ii -= 1 return val + p[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polyval_vec(p, x, prec=None):\n p = np.atleast_2d(p)\n x = np.atleast_1d(x).flatten()\n # for modest to large arrays, faster to find unique values and\n # only evaluate those. Have to cast to float because np.unique\n # can't handle object types like python native int\n unq_x, xidx = np.uniqu...
[ "0.7189769", "0.6388188", "0.6349685", "0.6349405", "0.6301175", "0.62954414", "0.62514293", "0.6217231", "0.61732244", "0.61730355", "0.61638635", "0.6040098", "0.6035656", "0.59895843", "0.589283", "0.58467543", "0.5791899", "0.5781007", "0.5776011", "0.5772723", "0.5771017...
0.788395
0
Takes two pairs of values, v1, v2 and w1, w2 and returns a boolean result indicating whether the range v1, v2 (inclusive) contains any values in the range w1, w2 (inclusive).
def is_overlap_sorted_values(v1, v2, w1, w2): if (v2 < w1) or (v1 > w2): return False else: return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overlap(range1, range2):\n if range1[0] <= range2[1] and range2[0] <= range1[1]:\n return True\n return False", "def ranges_overlap(start1, end1, start2, end2):\n return start1 <= end2 and end1 >= start2", "def _overlap(x1, w1, x2, w2):\r\n if x1+w1 < x2-w2: return False\r\n if x1-w1 > x2...
[ "0.75839585", "0.7468334", "0.73032653", "0.7254913", "0.7099083", "0.7005381", "0.6924589", "0.6836781", "0.68154067", "0.67770654", "0.6689429", "0.66749865", "0.6669765", "0.66663224", "0.66637504", "0.665274", "0.6625992", "0.65885615", "0.6519127", "0.6514677", "0.649486...
0.79552335
0
Takes two nested two dimensional arrays, a_ary and b_ary, representing a bounding box in ll, ur format [[lon, lat], [lon, lat]]. Returns a boolean result as to whether the bounding boxes overlap.
def bbox_intersect(a_ary, b_ary): # Do any of the 4 corners of one bbox lie inside the other bbox? # bbox format of [ll, ur] # bbx[0] is lower left # bbx[1] is upper right # bbx[0][0] is lower left longitude # bbx[0][1] is lower left latitude # bbx[1][0] is upper right longitude ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bbox_overlap(bbox_1: Sequence, bbox_2: Sequence) -> bool:\n if (bbox_1[0] > bbox_2[0]) or (bbox_1[1] > bbox_2[1]):\n return False\n if (bbox_1[2] < bbox_2[2]) or (bbox_1[3] < bbox_2[3]):\n return False\n\n return True", "def is_overlap(bb1, bb2):\n l1, t1, r1, b1 = bb1['x'], bb1['y'...
[ "0.7563125", "0.72570115", "0.710988", "0.701064", "0.6934993", "0.677594", "0.6731343", "0.66541207", "0.66268736", "0.66024", "0.659357", "0.65671766", "0.65535945", "0.65387017", "0.6467221", "0.64572394", "0.64162743", "0.6390569", "0.63497204", "0.631824", "0.63000226", ...
0.85588765
0
Takes a degree value deg and returns the equivalent value in radians.
def _deg_to_rad(deg): return deg * math.pi / 180
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def degree_to_radians(degree):\n return degree * pi / 180", "def deg2rad(deg: float) -> float:\n return deg * 3.14 / 180.0", "def deg2rad(deg):\n return deg * sp.pi / 180", "def deg_to_rad(degrees):\n degrees = Decimal(unicode(degrees))\n radians = degrees * TWO_PI / 360\n radians = radians...
[ "0.83952487", "0.8153732", "0.8061395", "0.77332145", "0.7705545", "0.7689395", "0.7613848", "0.75884396", "0.7573327", "0.7562161", "0.75616604", "0.751927", "0.7456573", "0.7348964", "0.7297646", "0.72903407", "0.7284143", "0.7225561", "0.72026175", "0.71694857", "0.7099037...
0.8162636
1
Takes a radian value rad and returns the equivalent value in degrees.
def _rad_to_deg(rad): return rad * 180 / math.pi
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rad2deg(rad: float) -> float:\n return rad * 180.0 / math.pi()", "def AngleRtoD(rad):\n\tdegreee=180*rad/math.pi \n\treturn degreee", "def degrees(rad_angle) :\n angle = rad_angle * 180 / math.pi\n #Note this assume the radians angle is positive as that's what MMTK does\n while angl...
[ "0.8273594", "0.8022791", "0.79581714", "0.7873671", "0.76528996", "0.7592591", "0.74427694", "0.735636", "0.72945213", "0.7291209", "0.72846985", "0.7222064", "0.7218808", "0.70348", "0.6971813", "0.6958033", "0.6890582", "0.6882272", "0.68188", "0.6781663", "0.6751045", "...
0.8178221
1
Takes a polynomial array poly_ary and a longitude value lon and returns the angle in radians at that longitude.
def _angle_from_slope(poly_ary, lon): # find the first derivative poly = polyder(poly_ary, 1) # get the slope at our point of interest slope = polyval(poly, lon) # get the angle from the slope angle = math.atan(slope) return angle # in radians
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def angle(z, deg=0):\n if deg:\n fact = 180/pi\n else:\n fact = 1.0\n z = asarray(z)\n if (issubclass(z.dtype.type, _nx.complexfloating)):\n zimag = z.imag\n zreal = z.real\n else:\n zimag = 0\n zreal = z\n return arctan2(zimag, zreal) * fact", "def ang...
[ "0.60667235", "0.60559404", "0.6052086", "0.604196", "0.6015926", "0.5962259", "0.5858523", "0.5830844", "0.58076715", "0.5771097", "0.5732114", "0.57266414", "0.5722521", "0.5678085", "0.56580085", "0.5646384", "0.5643149", "0.5639333", "0.5612041", "0.5611166", "0.55884653"...
0.8269071
0
Takes an acute angle B and distance in kilometers perp and returns the distance perpendicular to the equator. Assumes an orbital section positive in slope.
def _slope_pos_vert_distance(B, perp): # get the arc length of 'a' at around this latitude a = _deg_to_rad(perp / ODL_DISTANCE) # arclength from beam 0110 to first or last beam vertically arclength = math.atan(math.tan(a) / math.cos(B)) # distance in km from beam 0110 to first or last verticall...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PerpendicularDistanceToFinish(point_b_angle: float,\n point_b: gps_pb2.Point) -> float:\n return math.cos(math.radians(point_b_angle)) * point_b.start_finish_distance", "def _slope_neg_vert_distance(B, perp):\r\n # get the arc length of 'a' at around this latitude\r\n ...
[ "0.7223186", "0.67502093", "0.66600615", "0.6265598", "0.6012678", "0.59357464", "0.5722671", "0.56781554", "0.56774014", "0.5673714", "0.5669494", "0.56690276", "0.5657861", "0.56260705", "0.5611562", "0.5574001", "0.5554485", "0.55370617", "0.5533862", "0.5531555", "0.55132...
0.6905677
1
Takes a polynomial array poly_ary, starting longitude lon_min, ending longitude lon_max, and error distance max_error and returns a nested array representing a bounding box for a GEDI swath extent. Return value is in ll, ur format [[lon, lat], [lon, lat]].
def poly_bbox(poly_ary, lon_min, lon_max, max_error): # Angle 'B' is also theta B_lon_min = _angle_from_slope(poly_ary, lon_min) B_lon_max = _angle_from_slope(poly_ary, lon_max) # Slope assumptions: # 1) will never be 0 at orbit major maximum or minimum # 2) will never change sign becaus...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_bounding_box(self, poly=None):\n\n use_poly = poly if poly else self.res_poly\n\n # TODO: Test to comply with future values.\n # Updates the bounds\n if self.bounds_changed:\n # Gets the minimum and maximum value of each bounds.\n self.xmin = float('inf')\n...
[ "0.6630684", "0.6445707", "0.633211", "0.6272101", "0.6204608", "0.6063664", "0.6033086", "0.5961396", "0.5944326", "0.59405506", "0.5891103", "0.58675516", "0.5803532", "0.58031636", "0.57914704", "0.5761674", "0.5709238", "0.5686564", "0.5606224", "0.55829823", "0.5531209",...
0.7609233
0
Builds a circle control.
def circle(self): self._build_name() if self.ctrl_name: self.ctrl = pm.circle(n=self.ctrl_name, ch=0, o=1, nr=[1, 0, 0])[0] self._finalize_ctrl()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def circle(self):\n return circle(self.N, self.o, self.r)", "def circle(self, x, y, r, cls=None, style=None):\n x, y, r = self._meta.units(x, y, r)\n cls_str = 'class=\"%s\" ' % cls if cls else ''\n style_str = 'style=\"%s\" ' % self._meta.make_style(style) if style else ''\n s...
[ "0.70402366", "0.67007273", "0.67007273", "0.6687724", "0.6502949", "0.6500092", "0.64748067", "0.64442", "0.64442", "0.64380133", "0.63871896", "0.63791484", "0.6370651", "0.63555884", "0.6327178", "0.6325744", "0.6300299", "0.62929326", "0.6208691", "0.61940867", "0.6161459...
0.72939414
0
Builds the name of the control.
def _build_name(self): self.ctrl_name = NameUtils.get_unique_name(self.asset, self.side, self.part, "ctrl")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_name(self, name):\n return \"{}/{}.{}\".format(self.name, self._layer_counter, name)", "def _get_name(self):\n return '%s (%d)' % (\n self.panel_template.panel_name,\n self.implementation)", "def _build_name(name_id):\n return \"xp_%08d\" % name_id", "d...
[ "0.6769557", "0.669109", "0.6648812", "0.65889513", "0.65886915", "0.64992493", "0.64962196", "0.648181", "0.6439064", "0.6439064", "0.6439064", "0.6439064", "0.6439064", "0.64387935", "0.6416379", "0.64004415", "0.64004415", "0.6391087", "0.63670844", "0.6349884", "0.6349884...
0.85207385
0
Aims control based on a provided aim axis.
def _aim_ctrl(self): y = 0 z = 0 if self.aim_axis == "y": z = 90 elif self.aim_axis == "z": y = -90 for shape in self.ctrl.getShapes(): pm.rotate(shape.cv, 0, y, z, r=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_guards_to_axes(self, axis: plt.Axes, color: str = \"g\") -> None:\n if self.orientation == Orientation.UP_DOWN:\n length = self.image.shape[0]\n else:\n length = self.image.shape[1]\n x_data = np.arange(length)\n left_y_data = self.left_guard_separated\n ...
[ "0.5673403", "0.55739117", "0.5537915", "0.55028373", "0.5464646", "0.5432632", "0.5375639", "0.532435", "0.52990675", "0.529851", "0.5267174", "0.52602017", "0.5174245", "0.5149552", "0.5135988", "0.5101093", "0.50228465", "0.50111693", "0.4996139", "0.49835455", "0.4960167"...
0.6640851
0
Plot a price chart marking where long and short positions would be, given values of signal.
def chart_price(price_series, signal_series, threshold=0): chart_data = pd.DataFrame() chart_data["out"] = price_series chart_data["long"] = (signal_series > threshold) * price_series chart_data["short"] = (signal_series < -threshold) * price_series chart_data.replace(0, np.nan, inplace=True) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_plot(x,y):", "def value_line(self):\n marks = self._get_marks(False)\n marks['Val'] = self.data['Value']\n fig = plt.figure(figsize=(4,2), dpi=200)\n fig.patch.set_facecolor('#ececec')\n ax = fig.add_subplot(111)\n ax.plot(self.data['Value'], alpha=0.8, lw=1.2, ...
[ "0.6332631", "0.62353545", "0.61054397", "0.60435236", "0.5956085", "0.5932323", "0.58881456", "0.5884435", "0.5882181", "0.58787453", "0.58743924", "0.5874154", "0.5873469", "0.58398116", "0.5824793", "0.57651365", "0.57198536", "0.57072663", "0.5705869", "0.5703248", "0.569...
0.7166306
0
Given Series with daily returns (simple, nonlog ie. P1/P01), return indicators comparing simplified Sharpe to 'true' Sharpe (defined by different caluclation conventions).
def true_sharpe(ret): r = pd.Series() df = pd.DataFrame({"returns": ret}) df["cummulative_return"] = (df["returns"] + 1).cumprod() df["log_returns"] = np.log(df["returns"] + 1) r["cummulative_return"] = df["cummulative_return"][-1] - 1 r["annual_return"] = ((r["cummulative_return"] + 1) ** (252 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __check_single_sign_value(series, log=False):\n # gets useful values\n negative_values_unique, positive_values_unique = set(series[series < 0]), \\\n set(series[series > 0])\n if len(negative_values_unique) == 1 and len(positive_values_unique) > 1:\n...
[ "0.58642346", "0.5710043", "0.5479896", "0.54715127", "0.54500556", "0.5381189", "0.5379159", "0.52815366", "0.52155226", "0.51980346", "0.51967704", "0.519325", "0.51814866", "0.518038", "0.517456", "0.51569456", "0.5140055", "0.5135205", "0.5126213", "0.5102445", "0.5099832...
0.6321988
0
Run func on every element of dfs in mulpiple processes. dfs is a list of DataFrames
def m_proc(dfs, func): pool = Pool(processes=cpu_count()) results = [pool.apply_async(func, args=(df,)) for df in dfs] output = [p.get() for p in results] return output
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def groupby_apply_parallel(grouped_df, func, *args):\n with Pool(cpu_count()) as p:\n return_list = p.starmap(func, [(group, *args) for name, group in grouped_df])\n return pd.concat(return_list)", "def apply_parallel(df, func, **kwargs):\n num_workers = cpu_count()\n\n if (df.shape[0] == 1) o...
[ "0.64947915", "0.64410365", "0.62881696", "0.61850566", "0.6010216", "0.59700817", "0.5891619", "0.5734096", "0.57302344", "0.56988317", "0.56210876", "0.55779684", "0.55649483", "0.5563111", "0.55065495", "0.54993975", "0.5448303", "0.5382057", "0.53642577", "0.53566223", "0...
0.7830786
0
Series2 is filter. If input signals disagree, no signal is output. If they agree, series1 signal is the output.
def combine_signals(series1: pd.Series, series2: pd.Series) -> pd.Series: return ((np.sign(series1) == np.sign(series2)) * series1).astype(int, copy=False)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def same_emitter(track_1, track_2):\n alternate_consistency = False\n start_consistency = False\n start_1_index = 0\n start_2_index = 0\n\n # First of all, check if both tracks use the same frequence to communicate\n freq_consistency = False\n f_1 = track_1.itr_measurement.central_freq_hz\n ...
[ "0.5420677", "0.53641653", "0.5269363", "0.5264427", "0.525368", "0.5248671", "0.5222031", "0.5170227", "0.5146615", "0.506948", "0.50103337", "0.4943461", "0.49222016", "0.4921278", "0.4906378", "0.48961374", "0.4856847", "0.48558632", "0.48525333", "0.48479262", "0.48258182...
0.66925484
0
Generate blips only at points where indicator goes above/below threshold.
def crosser(ind: pd.Series, threshold: float) -> pd.Series: df = pd.DataFrame({"ind": ind}) df["above_below"] = (df["ind"] >= threshold) * 1 - (df["ind"] < threshold) * 1 df["blip"] = ((df["above_below"].shift() + df["above_below"]) == 0) * df[ "above_below" ] df = df.dropna() return df[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def range_blip(\n indicator: pd.Series,\n threshold: float = 0,\n inout: Literal[\"inside\", \"outside\"] = \"inside\",\n) -> pd.Series:\n\n indicator = indicator.dropna()\n\n r = inout_range(indicator, threshold, inout)\n return _signed_range_entry(_range_entry(r), indicator)", "def _thresh_cl...
[ "0.6095413", "0.5878129", "0.5754887", "0.5733245", "0.570352", "0.56719947", "0.5633101", "0.5514651", "0.5503244", "0.5477215", "0.54693437", "0.54594445", "0.543474", "0.5420535", "0.5395379", "0.5358498", "0.53468525", "0.53458107", "0.5283447", "0.52825373", "0.5280514",...
0.71472293
0
Blips should not be propagated. If any column name contains word 'blip' warn user that they may be making a mistake.
def warn_blip(columns: Union[Set[str], List[str]]) -> None: blip_columns = [b for b in columns if "blip" in b] if blip_columns: print(f"Warning: blip is being propagated: {blip_columns}")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __warn_missing_col(col_name, action):\n msg = (\"Skipping {} values for {!r}: Unable to find column \"\n \"in hybrid meta. Did you forget to prefix with \"\n \"{!r} or {!r}? \")\n w = msg.format(action, col_name, SOLAR_PREFIX, WIND_PREFIX)\n logger.warning(w)\n ...
[ "0.59633464", "0.5629486", "0.5324889", "0.52932507", "0.5251429", "0.5170503", "0.5128109", "0.51264954", "0.51006246", "0.50926596", "0.50926596", "0.5080148", "0.5069726", "0.50693744", "0.50359195", "0.50021553", "0.5000355", "0.49801546", "0.4968183", "0.49676052", "0.49...
0.82263887
0
Before joining the two dataframes, ensure that they are correctly aligned. Signal and blip should be shifted on dfg BEFORE upsampling.
def join( df: pd.DataFrame, dfg: pd.DataFrame, upsampled_columns: List[str], label: Literal["left", "right"], ) -> pd.DataFrame: if label == "left": joined_df = df.join(dfg[upsampled_columns]) elif label == "right": dfg = dfg.shift(-1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upsample(\n df: pd.DataFrame,\n dfg: pd.DataFrame,\n *,\n label: Literal[\"left\", \"right\"] = \"left\",\n keep: Optional[Union[str, Sequence[str]]] = None,\n propagate: Optional[Union[str, Sequence[str]]] = None,\n) -> pd.DataFrame:\n\n def warn_blip(columns: Union[Set[str], List[str]]) ...
[ "0.6805154", "0.58178794", "0.56193626", "0.54164696", "0.52387846", "0.52243114", "0.5218583", "0.52179146", "0.5215392", "0.52110416", "0.52046835", "0.51700354", "0.5165345", "0.51637405", "0.51528937", "0.51515895", "0.51488835", "0.5132604", "0.51253265", "0.5119885", "0...
0.60301346
1
Given a threshold, return True/False series indicating whether s prices are inside/outside (threshold, threshold) range.
def inout_range( s: pd.Series, threshold: float = 0, inout: Literal["inside", "outside"] = "inside" ) -> pd.Series: if threshold == 0: raise ValueError("theshold cannot be zero, use: <zero_crosser>") threshold = abs(threshold) excess = s.abs() - threshold if inout == "outside": resu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isPrice(price, high, low):\n return (price >= low) and (price <= high)", "def is_in_interval(self, low, high, value):\n return low <= value and value <= high", "def chart_price(price_series, signal_series, threshold=0):\n chart_data = pd.DataFrame()\n chart_data[\"out\"] = price_series\n ...
[ "0.6682226", "0.6377357", "0.618865", "0.6125125", "0.5998406", "0.5900148", "0.58637464", "0.5804012", "0.5767467", "0.574018", "0.5720942", "0.56339824", "0.5613235", "0.5606552", "0.5596668", "0.5575905", "0.5566276", "0.5561228", "0.55224955", "0.5517698", "0.55140156", ...
0.66740066
1
entry is the output of _range_entry entry will be signed same as price when entering range.
def _signed_range_entry(entry: pd.Series, sign: pd.Series) -> pd.Series: return (_range_entry(entry) * np.sign(sign)).astype(int)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_range_entry(var, win):\n\tentry = Gtk.Scale.new(Gtk.Orientation.HORIZONTAL,\n\t\tGtk.Adjustment(var.get(), var.type.low, var.type.up))\n\tentry.set_value(var.get())\n\tentry.set_digits(0)\n\tentry.set_hexpand(True)\n\tobs = RangeEntryObserver(var)\n\tentry.connect(\"change-value\", obs.on_change_value)\n...
[ "0.61373144", "0.6032945", "0.54929155", "0.5479415", "0.515154", "0.5149273", "0.5042822", "0.50140834", "0.5003269", "0.49909687", "0.4943643", "0.48825723", "0.48644677", "0.4860608", "0.4840631", "0.48357874", "0.48082027", "0.4736602", "0.47233704", "0.46627074", "0.4660...
0.6240598
0
Blip when indicator enters or leaves range. Blip is signed the same as sign of the indicator.
def range_blip( indicator: pd.Series, threshold: float = 0, inout: Literal["inside", "outside"] = "inside", ) -> pd.Series: indicator = indicator.dropna() r = inout_range(indicator, threshold, inout) return _signed_range_entry(_range_entry(r), indicator)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clip(self):\n if self._value < self.lowBound:\n self._value = self.lowBound\n elif self._value > self.upBound:\n self._value = self.upBound", "def crosser(ind: pd.Series, threshold: float) -> pd.Series:\n df = pd.DataFrame({\"ind\": ind})\n df[\"above_below\"] = (df[...
[ "0.6277009", "0.5953873", "0.58876336", "0.56213623", "0.5533034", "0.5480362", "0.53790057", "0.53341526", "0.5326615", "0.5307674", "0.5303355", "0.51896703", "0.5184564", "0.5129037", "0.51242024", "0.51144993", "0.5104742", "0.5090696", "0.50842917", "0.50722456", "0.5069...
0.68230635
0
Blip when indicator crosses zero. Blip is signed the same as sign of the indicator. When indicator value is exactly zero at some point, next value will be treated as having crossed zero.
def zero_crosser(indicator: pd.Series) -> pd.Series: indicator = indicator.fillna(0) return (((indicator.shift() * indicator) <= 0) * np.sign(indicator)).astype(int)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_crossings(x):\n return np.array(np.where(np.diff(np.sign(x)))[0])", "def crosser(ind: pd.Series, threshold: float) -> pd.Series:\n df = pd.DataFrame({\"ind\": ind})\n df[\"above_below\"] = (df[\"ind\"] >= threshold) * 1 - (df[\"ind\"] < threshold) * 1\n df[\"blip\"] = ((df[\"above_below\"].s...
[ "0.63800055", "0.5952263", "0.5914088", "0.58691347", "0.58293945", "0.56045574", "0.5598274", "0.5479052", "0.5435027", "0.5390016", "0.5358857", "0.5321166", "0.52676576", "0.52672845", "0.52667016", "0.52649635", "0.5256902", "0.52521056", "0.5209373", "0.5192771", "0.5179...
0.706241
0
Weighted zscore. Can be used to test whether price is within/outside Bollinger Bands.
def weighted_zscore(df: pd.DataFrame, lookback: int) -> pd.Series: wmean = rolling_weighted_mean(df["close"], df["volume"], lookback) wstd = rolling_weighted_std(df["close"], df["volume"], lookback, wmean) return ((df["close"] - wmean) / wstd).dropna()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc_batter_z_score(batter_list, players_over_zero_dollars, one_dollar_players,\n dollar_per_fvaaz, player_pool_multiplier, add_original_value=False):\n player_pool = int(players_over_zero_dollars * player_pool_multiplier)\n # Standard Calculations\n run_list = []\n hr_list =...
[ "0.64195716", "0.6404542", "0.623077", "0.622927", "0.61641794", "0.6028003", "0.5923462", "0.5905907", "0.5891175", "0.5872673", "0.58546215", "0.5809704", "0.57485", "0.5692656", "0.56759715", "0.5666355", "0.5651114", "0.56005275", "0.5595664", "0.5595595", "0.5575899", ...
0.71250975
0
Wrapper to allow applying stop loss to any signal function. Args are passed to function, kwargs to stop loss. THIS SHOULDN'T BE USED WITHOUT FURTHER REVIEW. IT'S PROBABLY WRONG.
def stop_signal( df, signal_func: Callable, /, *func_args, **stop_kwargs ) -> pd.DataFrame: _df = df.copy() _df["position"] = sig_pos(signal_func(_df["close"], *func_args)) stopped = stop_loss(_df, **stop_kwargs) assert isinstance(stopped, pd.DataFrame) return stopped["position"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_stop(self, **kwargs):\n del kwargs\n self.stop()", "def _wrap_computation_in_while_loop_with_stopping_signals(device, op_fn):\n\n def cond(scalar_stopping_signal):\n return math_ops.logical_not(\n _StopSignals.should_stop(scalar_stopping_signal))\n\n def computation(unused_sca...
[ "0.58743846", "0.5674448", "0.56246555", "0.55227876", "0.55227876", "0.5483376", "0.5476944", "0.54393923", "0.54230165", "0.5420852", "0.541993", "0.54120153", "0.5409945", "0.53929704", "0.538413", "0.5374481", "0.5367693", "0.5366256", "0.5332575", "0.53154844", "0.530238...
0.5998561
0
Return df with log returns of long and short positions in r
def long_short_returns(r: Results) -> pd.DataFrame: pos = r.positions pos["return"] = np.log(pos["pnl"] / pos["open"].abs()) pos = pos.set_index("date_c") long = pos[pos["open"] > 0] short = pos[pos["open"] < 0] combined = pd.DataFrame({"long": long["return"], "short": short["return"]}) comb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(df, cols, base=2, invert=None):\r\n if base == 2:\r\n for c in cols:\r\n df[f\"log2_{c}\"] = np.log2(df[c])\r\n elif base==10:\r\n for c in cols:\r\n df[f\"log10_{c}\"] = np.log10(df[c])\r\n else:\r\n print(\"This base is not implemented!\")\r\n if inver...
[ "0.6381855", "0.63051254", "0.5932502", "0.5920916", "0.5877851", "0.5838608", "0.5811746", "0.5811098", "0.5806278", "0.5783296", "0.57466453", "0.5741185", "0.57286114", "0.5686589", "0.5680549", "0.566111", "0.5657998", "0.5602356", "0.55857456", "0.5583285", "0.5571597", ...
0.704547
0
Alternative (volume) grouper. Vector based. Difference with numba_tools grouper is about the treatment of the first/last bar in a grouped candle. This method has a small lookahead bias, i.e. is not usable for anything serious.
def vector_grouper( df: pd.DataFrame, number: int, field: str = "volume", label: Literal["left", "right"] = "left", ) -> pd.DataFrame: df = df.copy() df = df.reset_index(drop=False) df["index_"] = (df[field].cumsum() // number).shift().fillna(0) return ( df.groupby("index_") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def grouped_bins(self):\n # Load the vector version #\n df = self.grouped_vectors\n # Empty data frame to contain result #\n result = pandas.DataFrame()\n # Iterate #\n for i, row in df.iterrows():\n # Compute a data frame containing the recreated bins #\n ...
[ "0.55901647", "0.5460391", "0.5390095", "0.5390095", "0.5248864", "0.5171182", "0.50614727", "0.50094837", "0.496163", "0.4935842", "0.4923516", "0.49227005", "0.49226493", "0.49063525", "0.49047896", "0.49033874", "0.48544985", "0.48540577", "0.4852908", "0.48239028", "0.481...
0.6425455
0
Updates all structures according to the success or failure of a given command. The given request must also contain a response (not None).
def apply_response(self, request): assert request.response is not None response = request.response other_addr = self.get_other_address() self.processor.process_command( other_addr=other_addr, command=request.command, cid=request.cid, stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateFromResponse(self, response):\n for key in self.status:\n self.status[key] = response[key]", "def process_request(self, request):\n self.req = request\n command = self.get_command()\n file_handler = filehandler.FileHandler(command)\n file_handler.handle_com...
[ "0.5620076", "0.54718906", "0.54160595", "0.5376729", "0.53587043", "0.5354233", "0.52760416", "0.52760416", "0.52670175", "0.52434963", "0.5225124", "0.5163943", "0.51545334", "0.5146088", "0.51351076", "0.51208454", "0.5117091", "0.51013863", "0.5090993", "0.5047707", "0.50...
0.57980293
0
Get a request object's dependencies lock status, aka reads
def get_dep_locks(self, request): depends_on_version = request.command.get_dependencies() dep_locks = {dv: self.object_locks.try_get(str(dv)) for dv in depends_on_version} missing_deps = [] used_deps = [] locked_deps = [] for dep, lock in dep_locks.items(): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_dependencies(self, resource):\n\n rel_path = resource.relative_path\n deps = self.deps[rel_path] if rel_path in self.deps \\\n else self.update_deps(resource)\n return deps", "def lock_status(self) -> Dict[str, str]:\n self.__logger.debug('Eva.lock_status called')\n...
[ "0.5808544", "0.5736591", "0.5684779", "0.5626385", "0.56198746", "0.560007", "0.5549846", "0.55438083", "0.5450805", "0.54364485", "0.543053", "0.5421912", "0.5421912", "0.5421912", "0.5407252", "0.5367982", "0.534507", "0.5331659", "0.5323035", "0.5317566", "0.5312923", "...
0.69462824
0
The local VASP attempts to sequence a new offchain command.
def sequence_command_local(self, off_chain_command): off_chain_command.set_origin(self.get_my_address()) request = CommandRequestObject(off_chain_command) # Before adding locally, check the dependencies missing_deps, used_deps, locked_deps = self.get_dep_locks(request) if missi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command(self, cmd):\n self.lmp.command(cmd)", "def veto(self):\n self.console.write('veto')\n self.callvote = None", "def cmd(self):", "def chain_cmd(ctx):\n pass", "def _doBack(self):\n argin = [\"2\", \"0\"] # to send string array with two arg...\n self._executeServe...
[ "0.5558248", "0.5348713", "0.53144515", "0.5292959", "0.52843213", "0.5257564", "0.5176616", "0.5172852", "0.51587677", "0.5153389", "0.51395804", "0.5100976", "0.5100821", "0.5076194", "0.50715107", "0.5045304", "0.5016509", "0.5016509", "0.5016509", "0.5016509", "0.5016509"...
0.6367771
0
Packages up to a `number` (int) of earlier requests without a reply to send to the the other party. Returns a list of `NetMessage` instances.
async def package_retransmit(self, number=1): return await asyncio.gather( *[ self.package_request(m) for m in self.get_retransmit(number) ] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_requests_with_n_recipients(num, url):\n recipients = [str(x) for x in xrange(num)]\n\n data = create_request('TEST MESSAGE!', recipients)\n return call_api_endpoint(url, data)", "def get_first_n_pending_links(self, number):\n try:\n conn = psycopg2.connect(\"dbname='{0}'\".for...
[ "0.595882", "0.5633911", "0.5543614", "0.5421572", "0.53338075", "0.5250904", "0.5175569", "0.5017793", "0.49893928", "0.4988267", "0.49087372", "0.4898715", "0.4894271", "0.48901066", "0.48861828", "0.48834553", "0.488342", "0.48803717", "0.48681366", "0.48187768", "0.480014...
0.64028597
0
Returns true if there are any pending retransmits, namely requests for which the response has not yet been received.
def would_retransmit(self): return not self.my_pending_requests.is_empty()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_pending_packets_to_be_sent(self):\n return self.num_packets != 0", "def no_more_acks() -> bool:\n return not any(not op.is_set() for op in self._pending_operations.values())", "def is_polling_done(self):\n if self.message_request_more:\n return False\n \n ...
[ "0.7243682", "0.69872236", "0.6487534", "0.6383383", "0.6312614", "0.627255", "0.610029", "0.60920763", "0.6070019", "0.6066764", "0.60588837", "0.6021426", "0.5998724", "0.59974205", "0.59756446", "0.5919119", "0.58142316", "0.58030236", "0.5796859", "0.5787215", "0.57860917...
0.8584883
0
Infinite loop to listen for client connections and route to request_handler
def serve_requests(self): while True: self.server_socket.listen(self.request_queue_size) client_connection, client_address = self.server_socket.accept() self.request_handler(client_connection)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _listen_to_requests(self):\n while True:\n try:\n request = self._client.recv(1024)\n except socket.error as err:\n if DEBUG_LEVEL >= 1:\n print \"Got socket error: {}\".format(err.message)\n self._client.close()\n ...
[ "0.7345777", "0.7169281", "0.7169157", "0.70783734", "0.7046629", "0.7006674", "0.69998455", "0.69914407", "0.69864285", "0.6963859", "0.6918372", "0.6907004", "0.6852823", "0.6837102", "0.6827365", "0.6768687", "0.6760217", "0.6739094", "0.67388463", "0.67078495", "0.6694091...
0.8256458
0
Method to parse requests by path, route them to the correct getter or setter and return a response and HTTP status code
def parse_request(self, request): response='' http_code = 200 request_line = request.splitlines()[0] request_method, path, request_version = request_line.split() #Try to split path into it's components: the operation requested and the keyvalue try: request_op, request_keyvalue = path.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_GET(self):\n\n try:\n self.parsed_url = urllib.parse.urlsplit(self.path)\n self.request_params = dict(urllib.parse.parse_qsl(self.parsed_url.query))\n\n handler = self._dispatch_on_path()\n\n if isinstance(handler, Handler):\n\n self._check_r...
[ "0.6210815", "0.61685705", "0.61090153", "0.60661197", "0.5938361", "0.5854154", "0.5819774", "0.5761749", "0.5718614", "0.5701811", "0.56692934", "0.56031966", "0.5580705", "0.55577755", "0.5556755", "0.5551802", "0.55436087", "0.55363166", "0.5508227", "0.5494905", "0.54924...
0.62466556
0
Generate HTTP headers from passed HTTP response code
def gen_headers(self, http_code): if http_code == 200: http_headers = "HTTP/1.1 200 OK\n" elif http_code == 400: http_headers = "HTTP/1.1 400 Bad Request\n" elif http_code == 404: http_headers = "HTTP/1.1 404 Not Found\n" utc_datetime = datetime.datetime.utcnow().strftime("%a, %d %b ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_response(message, mimetype, code=\"OK 200\"):\n\n if not isinstance(message, bytes):\n message = message.encode('utf-8')\n bytelength = len(message)\n header_list = []\n header_list.append('HTTP/1.1 %s \\r\\n' % code)\n header_list.append('Date: %s \\r\\n' % str(formatdate(usegmt=T...
[ "0.7076088", "0.6702638", "0.65351945", "0.6456887", "0.64418685", "0.63103044", "0.63103044", "0.6244145", "0.62058735", "0.61695415", "0.61634386", "0.61449164", "0.6127177", "0.6060533", "0.60463715", "0.6001048", "0.5998467", "0.5989219", "0.59759045", "0.5963978", "0.595...
0.83281934
0
Make an instance of DBServer on the passed IP and port
def make_dbserver(server_address, server_port): server = DBServer(server_address, server_port) return server
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self,dbname,server_ip,server_port):\n self.dbname = dbname\n self.con = sqlite3.connect(dbname)\n self.cur = self.con.cursor()\n self.server_ip=server_ip\n self.server_port=server_port\n\n # The access method from server initialization\n self.server = S...
[ "0.6800187", "0.66241175", "0.6283851", "0.62752354", "0.6243701", "0.61155516", "0.60950834", "0.6092231", "0.60324806", "0.6025268", "0.59985566", "0.59985566", "0.5993353", "0.5992748", "0.59832615", "0.5982069", "0.5977922", "0.5953338", "0.59488934", "0.592483", "0.59125...
0.83336544
0
Resets the position of the turtle to its starting position
def reset_position(self): self.goto(STARTING_POSITION)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(self):\n self._turtle.clear()\n self._turtle.setposition((0,0)) \n self._turtle.shape('turtle')\n self.color = 'red'\n self.heading = 180\n self.speed = 0", "def reset_position(self):\n self.rect.left, self.rect.top = self.start_pos", "def repos...
[ "0.77305067", "0.73408115", "0.72342724", "0.7171275", "0.7132374", "0.7116628", "0.6990136", "0.6955724", "0.6947348", "0.68602973", "0.68442464", "0.6803416", "0.6747056", "0.6746576", "0.6714489", "0.66705287", "0.66629267", "0.66629267", "0.66629267", "0.6659177", "0.6634...
0.79360133
0
This is the initialization parser. Converts a line from a PDB file and initializes the PDB_atom's variables to appropriate values. Uses implicit typecasting as a failcheck for parsing the file correctly. Well formatted PDB files are 80 characters across and are well defined/easy to parse. Sadly not all PDB files are li...
def parse(self, line): # remove trailing newline a-la Perl CHOMP line = line.rstrip("\n") # correctly formatted PDB files # TODO - assuming 80 chars means well formatted is # perhaps risky. Need a more robust way to asses # formatting validity if len(line) =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, pdb_file):\n self.pdb_file = pdb_file\n self.content = None\n self.lines = None\n self.atom_section = None\n self.conect_section = None\n self.read_all()", "def parse_pdb(self, line):\n super().parse_pdb(line)\n self.num_remark = int(line...
[ "0.6480801", "0.63837385", "0.5987677", "0.59130067", "0.5897999", "0.5887236", "0.57760376", "0.5707651", "0.570124", "0.5690845", "0.5651602", "0.56459063", "0.56334114", "0.5630817", "0.56185424", "0.56093514", "0.558209", "0.5569036", "0.5566678", "0.54970634", "0.5462942...
0.71299464
0
Initialization function which takes a list of atoms all from one chain and constructs a chain object. Importantly, the chain_local_id atom and residue level attribute is only initilized in the "context" of a chain i.e. by this initialization function, so this function actually completes atom and residue initialization....
def __init__(self, atomlist): self.residues = [] current_res = atomlist[0].res_id temp_res =[] for i in atomlist: if i.res_id == current_res: temp_res.append(i) else: self.residues.append(PDB_residue(temp_res)) t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\n # names of atoms that make up relevant segements of each chain\n self.chains = {'a': {'C': 'C1', 'C1': 'C2', 'C2': 'C3', 'C3': 'C4', 'C4': 'C5', 'H': 'H1', 'H1': 'H2',\n 'H2': 'H3', 'H3': 'H4', 'H4': 'H5'},\n 'b': {'C45': 'C1',...
[ "0.55998135", "0.5518003", "0.5513605", "0.54702634", "0.54258364", "0.5373895", "0.53632593", "0.53512615", "0.53424484", "0.5340515", "0.5302385", "0.5292807", "0.525962", "0.52405804", "0.5200973", "0.5157682", "0.51401025", "0.5090289", "0.5086073", "0.50783587", "0.50505...
0.7775325
0
Function which returns the residue from a chain. If chainLocal = False (default) the global resID is used to search for a residue. If, on the other hand, chainLocal is set to true, then the resid local to that chain is used. chainLocal ID values ALWAYS start from 1 for the first residue in a chain and increment by one ...
def get_residue(self, resid, chainLocal=False): try: resid = int(resid) except ValueError, e: print "ERROR: get_resid() requires a numeric value" raise e if type(resid) == int: if chainLocal: f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getResidue(self, resi):\n\n\t\tif self.numChains == 0:\n\t\t\tprint \"WARNING: Molecule has no chains\"\n\t\t\treturn None\n\n\t\tresi = int(resi)\n\t\tfor chn in self.chain:\n\t\t\tfor res in chn.residue:\n\t\t\t\tif int(res.file_id) == resi:\n\t\t\t\t\treturn res\n\n\t\treturn None", "def get_residue(self,...
[ "0.668893", "0.6529663", "0.61339056", "0.59747255", "0.5585247", "0.5462381", "0.54249173", "0.53624696", "0.53349656", "0.5316846", "0.5260693", "0.5238058", "0.51962155", "0.51552856", "0.5132912", "0.51258445", "0.5090824", "0.5040737", "0.5038784", "0.50335884", "0.49568...
0.82316744
0
Function where you can specify the atom order for a residue. Useful because different forcefields have annoying defaults for how residues are parsed which occasionally differ, so this provides an easy way to define the order and rewrite.
def define_residue_order(self, chainID, resID, atomOrder): chain = self.chains[chainID] residue = chain.get_residue(resID, chainLocal=True) residue.set_residue_order(atomOrder)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reorder(self, new_order):\n #TODO doesn't work probably CRA 3/2019\n for field in [\"atoms\", \"xyz\"]:\n self.__dict__[field] = self.__dict__[field][list(new_order)]\n self.atoms = [self.atoms[i] for i in new_order]", "def setOrder(self, verbose = 1):\n\n self.order = ...
[ "0.6063239", "0.5962212", "0.57026076", "0.5530429", "0.5500488", "0.5479389", "0.5399059", "0.5277751", "0.52450716", "0.519707", "0.51750755", "0.51736563", "0.5059151", "0.5023142", "0.50008786", "0.49948952", "0.49739462", "0.495744", "0.49457055", "0.4943124", "0.4939888...
0.7369942
0
Returns a list of instances of the service's model with the specified ids.
def get_all(self, *ids): return self.__model__.query.filter(self.__model__.id.in_(ids)).all()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_models(self, model_names, callback):\n models = self.get_collection('_model')\n models.find(spec={'_id': {'$in': tuple(model_names)}}).to_list(\n callback=callback)", "def get_objects(self, ids, **args):\n args[\"ids\"] = \",\".join(ids)\n return self.request(self.v...
[ "0.67031586", "0.6699068", "0.6696586", "0.6638207", "0.65994287", "0.65258837", "0.63502115", "0.63468754", "0.62926453", "0.6194497", "0.6034407", "0.59933615", "0.59566957", "0.5881391", "0.5861612", "0.58427215", "0.581983", "0.58133096", "0.5810381", "0.58030975", "0.576...
0.6741081
0
Immediately deletes the specified model instance.
def delete(self, model): self._isinstance(model) db.session.delete(model) db.session.commit()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_model(self, request, instance):\n pass", "def delete(self):\n self.stop()\n try:\n self.skil.api.delete_model(self.deployment.id, self.model.id)\n except api_exception as e:\n self.skil.printer.pprint(\n \">>> Exception when calling dele...
[ "0.81506425", "0.7652153", "0.76048505", "0.744475", "0.737455", "0.7273976", "0.7251842", "0.71769357", "0.7160143", "0.70483905", "0.7047641", "0.70271033", "0.7008685", "0.70044905", "0.69935286", "0.6987541", "0.69523567", "0.69240004", "0.6912577", "0.6905001", "0.690093...
0.77066785
1
Rules defined for 'who' type of questions
def find_who_rules_scores(question, story_sentence, morphed_sentence): score = 0 # Rule 1 score += word_match(question, morphed_sentence) # Rule 2 '''print(type(question)) print(type(morphed_sentence)) print(type(' '.join(morphed_sentence))) print(' '.join(morphed_sentence)) print(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hey(self, msg):\n if issilence(msg):\n return \"Fine. Be that way.\"\n elif isshouting(msg):\n return \"Woah, chill out!\"\n elif isquestion(msg):\n return \"Sure.\"\n else:\n return \"Whatever.\"", "def is_question(message, unique_users...
[ "0.57526445", "0.56380576", "0.5491493", "0.53774744", "0.53468835", "0.53228533", "0.5320208", "0.53180206", "0.52792186", "0.5274273", "0.5266316", "0.52485275", "0.5247412", "0.5235203", "0.52073026", "0.51886165", "0.5178019", "0.51778334", "0.51548207", "0.5142385", "0.5...
0.59680885
0
Merge the stats_dict with the SQL DB entry, adding where able ValueError when stats_dict contains an invalid key
async def log_stats(self, stats_dict): cmd = "PRAGMA table_info(trainer_stats)" cur = self.sql.cur data = cur.execute(cmd).fetchall() valid_keys = [] for entry in data: valid_keys.append(entry['name']) self.log.info(valid_keys) for key in stats_dict:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_stats(episodal_stats, k, current_stats):\n # Check if the key exists in on of the dicts and retrieve the type of the corresponding value\n if k in current_stats:\n stat_type = type(current_stats[k])\n elif k in episodal_stats:\n stat_type = type(episodal_stats[k])\n else:\n ...
[ "0.5904677", "0.56306887", "0.56248367", "0.54878306", "0.54276437", "0.5413086", "0.5379965", "0.5305739", "0.51488465", "0.51462114", "0.5103581", "0.5051371", "0.50435966", "0.5016924", "0.5011857", "0.5008543", "0.49911267", "0.49539304", "0.49530947", "0.49171865", "0.49...
0.59542394
0
Return distance from the front sensors (left, center, right).
def get_front_distances(self): return np.array([self.get_distance(name) for name in self.front_distance_sensors])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_distance(self, target): \r\n sensor_transform = self._sensors['rgb_front'].get_transform()\r\n\r\n distance = np.sqrt(\r\n (sensor_transform.location.x - target.x) ** 2 +\r\n (sensor_transform.location.y - target.y) ** 2 +\r\n (sensor_trans...
[ "0.7017235", "0.6549371", "0.64581984", "0.6379817", "0.6338722", "0.63304055", "0.63304055", "0.63304055", "0.63304055", "0.63304055", "0.63304055", "0.63304055", "0.6323968", "0.6294477", "0.6253321", "0.624666", "0.6196004", "0.60975796", "0.6055105", "0.6030134", "0.60296...
0.69127107
1
Return distance from the given sensor. See Rosa.distance_sensors for a list of all available sensors.
def get_distance(self, sensor): if sensor not in self.distance_sensors: raise ValueError('sensor should be one of {}!'.format(self.distance_sensors)) return 255 - self._io.last_state['distance'][sensor]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_sensor(unit):\n\n\tsensor_name = \"baseBoard\"\n\treg_addr = 24\n\tdata_len = 56\n\tregist_sensor(sensor_name, reg_addr, data_len)\n\n\tdata = rospy.wait_for_message(\"MediumSize/SensorHub/Range\", Range, 2)\n\tdistance = data.range\n\t# transfer sensor data to target unit\n\tif unit == \"cm\":\n\t\tr...
[ "0.71713", "0.7136991", "0.67143583", "0.64265466", "0.63979185", "0.6347279", "0.6342724", "0.63268715", "0.61834866", "0.61157393", "0.60445964", "0.6027434", "0.5997184", "0.59771746", "0.5814516", "0.57811177", "0.5756442", "0.57413125", "0.57289225", "0.57217413", "0.566...
0.78509593
0
Return RGBAmbient detected from the front center sensor.
def get_color(self): return self._io.last_state['color']['front-center']
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ambient_light(self):\n return self._ambient_light", "def getAmbientLightSensor(self):\n cmd = 'O'\n ambientLightSensor = [-1,-1,-1,-1,-1,-1,-1,-1]\n out = self.getData(cmd)\n out = str(out, 'utf-8')\n if self.debug:\n print(out)\n if out[0] == 'n':\...
[ "0.6456869", "0.6094395", "0.60205966", "0.59814113", "0.58402157", "0.5835906", "0.5803118", "0.56540084", "0.5627646", "0.55591786", "0.5520857", "0.541431", "0.54012066", "0.5390628", "0.5378792", "0.53740406", "0.5353544", "0.5350059", "0.5344358", "0.53411293", "0.533950...
0.6448859
1
Trigger a buzz for duration (in sec).
def buzz(self, duration): self._io.buzz(duration)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vibrate(self, duration):\n self.wm.rumble = 1\n sleep(duration)\n self.wm.rumble = 0", "def alarm(seconds): # real signature unknown; restored from __doc__\n pass", "def buzz(self, timeout: float, rate: float) -> None:\n # FIXME - the close() method should stop any buzz in pr...
[ "0.61852217", "0.5827161", "0.57949793", "0.5773484", "0.5751459", "0.5750044", "0.57450426", "0.5731707", "0.57204735", "0.5700166", "0.5686778", "0.56843597", "0.56702906", "0.5667191", "0.56382865", "0.562899", "0.5618123", "0.5612783", "0.56075585", "0.55937237", "0.55925...
0.6760693
0
Initializes the history with the startofsentence symbol.
def initialize(self, src_sentence): self.history = ['<s>'] if self.history_len > 0 else []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\r\n self.s_table = SymbolTable.preSymbols", "def __init__(self, symbol, name=None, market=None, history=None):\n self._symbol = symbol\n self._name = name\n if name == None:\n self._name = symbol\n self._market = market\n if history != None...
[ "0.6629664", "0.61422133", "0.5893893", "0.5795038", "0.56736887", "0.5658736", "0.5606722", "0.54772836", "0.53585345", "0.5345294", "0.5338148", "0.5327372", "0.53225595", "0.5298655", "0.5272885", "0.52654237", "0.52591574", "0.5245366", "0.5237385", "0.52224797", "0.52105...
0.63857645
1
Extends the current history by ``word``
def consume(self, word): if len(self.history) >= self.history_len: self.history = self.history[1:] self.history.append(str(word))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def logP(self, history, word):", "def new_match(self, new_word): \n self.rhyming_words.append(new_word)", "def this_word(self):\n self.append = self.add_to_current_word", "def addWord(self, word):\n if word[0] not in self.child:\n self.child[word[0]] = WordDictionar...
[ "0.6599941", "0.6505923", "0.64983183", "0.6454854", "0.64470184", "0.64331174", "0.6424763", "0.63540274", "0.6337719", "0.62547296", "0.62547296", "0.62502587", "0.6189653", "0.6189369", "0.6183528", "0.6178551", "0.61075634", "0.6099807", "0.60856986", "0.6058385", "0.6056...
0.762686
0
Retrieve all Session from OpenVidu Server Only available if OpenVidu is enabled.
def get(self): response = openvidu().list_sessions() if response.status_code == 200: return response.json()["content"] abort(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sessions(self):\n logger.debug(\"Get sessions\")\n return self._raw_api.sessions.get()", "def fusion_api_get_active_sessions(self):\n return self.loginsession.get_active_sessions()", "def get_sessions(self):\n\n return self.all_sessions", "def get_sessions_list():\n ses...
[ "0.69744915", "0.68106383", "0.680421", "0.6639985", "0.6492907", "0.6467396", "0.6462376", "0.6411373", "0.63915443", "0.6341369", "0.6337059", "0.6332384", "0.63185257", "0.62985736", "0.6282246", "0.6229181", "0.6196593", "0.6155813", "0.61123633", "0.6087496", "0.6086961"...
0.6961742
1
Retrieve a Session from OpenVidu Server Only available if OpenVidu is enabled.
def get(self, *, session_id): response = openvidu().get_session(session_id) if response.status_code == 200: return response.json() elif response.status_code == 404: abort(NotFound, query=f"Session `{session_id}` does not exist") abort(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n\n response = openvidu().list_sessions()\n\n if response.status_code == 200:\n return response.json()[\"content\"]\n abort(response)", "def getSession():\n return call(\"getSession\")", "def test_client_get_session(self):\n server, client = loopback()\n...
[ "0.6957267", "0.6738384", "0.6525127", "0.6468331", "0.6465521", "0.6465363", "0.6464419", "0.6318534", "0.63104165", "0.6275549", "0.6267169", "0.6256999", "0.6253086", "0.6247025", "0.6239282", "0.62275785", "0.61824", "0.6169235", "0.6146193", "0.6141159", "0.610484", "0...
0.70654297
0
List all Connections from a Session Only available if OpenVidu is enabled.
def get(self, *, session_id): response = openvidu().list_connections(session_id) if response.status_code == 200: return response.json()["content"] elif response.status_code == 404: abort(NotFound, query=f"Session `{session_id}` does not exist") abort(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(self):\n\t\tif self.client is None:\n\t\t\traise UsageError(\"Not connected!\")\n\t\treturn self.client.list_conns()", "def list_connections(self, show_passthrough=True):\n return self._exprmapper.list_connections(show_passthrough)", "async def get_all(self) -> typing.List[Connection]:\n ...
[ "0.6733905", "0.6326909", "0.62833834", "0.62431115", "0.6201212", "0.6139315", "0.61312217", "0.6088229", "0.6044139", "0.59260124", "0.58997154", "0.5763768", "0.5634482", "0.5621717", "0.5603118", "0.5596979", "0.5581345", "0.55810916", "0.55774164", "0.55729145", "0.55510...
0.63346416
1
Get a Connection from a Session Only available if OpenVidu is enabled.
def get(self, *, session_id, connection_id): response = openvidu().get_connection(session_id, connection_id) if response.status_code == 200: return response.json() elif response.status_code == 400: abort(NotFound, query=f"Session `{session_id}` does not exist") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_conn(self):\n if self.game_request:\n # Prima cerca di ricavare la connessione ciclando sulle connessioni\n for connection in connections.values():\n if connection.player == self:\n return connection\n\n # Nell'eventualità remota che...
[ "0.6831988", "0.65772164", "0.6539034", "0.62769437", "0.6270954", "0.62527394", "0.6241328", "0.6051569", "0.60344905", "0.60256827", "0.60075736", "0.5991678", "0.5909446", "0.58730656", "0.58506244", "0.58354396", "0.5833348", "0.5819763", "0.5816927", "0.580332", "0.58014...
0.6966095
0
Retrieve all Recordings from OpenVidu Server Only available if OpenVidu is enabled.
def get(self): response = openvidu().list_recordings() if response.status_code == 200: return response.json()["items"] elif response.status_code == 501: abort(NotImplemented, query="OpenVidu Server recording module is disabled") abort(response)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_records():\n with RECORD_LOCK: # since flask 1.0 multi-threaded is enabled by default\n return jsonify(RECORDS)", "async def get_all_record():\n # X_new = item.to_df()\n # item_str = item.to_string()\n # project_code = int(item_str[item_str.find('=')+1:])\n pg = Postgr...
[ "0.6345349", "0.59497505", "0.5949022", "0.5938353", "0.5870377", "0.5860587", "0.5783985", "0.5765751", "0.57480633", "0.5731185", "0.56760776", "0.5669972", "0.56515956", "0.5623034", "0.5570114", "0.55670875", "0.55388093", "0.5510589", "0.5506595", "0.5493533", "0.5466946...
0.7766611
0
Retrieve a Recording from OpenVidu Server Only available if OpenVidu is enabled.
def get(self, *, recording_id): response = openvidu().get_recording(recording_id) if response.status_code == 200: return response.json() elif response.status_code == 404: abort(NotFound, query=f"Recording `{recording_id}` does not exist") elif response.status_co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self):\n\n response = openvidu().list_recordings()\n\n if response.status_code == 200:\n return response.json()[\"items\"]\n elif response.status_code == 501:\n abort(NotImplemented, query=\"OpenVidu Server recording module is disabled\")\n abort(response)"...
[ "0.7211836", "0.72032636", "0.6159613", "0.6069545", "0.5994706", "0.5908121", "0.58630157", "0.5737009", "0.57243073", "0.56887484", "0.5688493", "0.5659468", "0.56548274", "0.55429417", "0.54919446", "0.5488744", "0.54677695", "0.5453038", "0.5440263", "0.54098064", "0.5380...
0.7719126
0
Delete a Recording This will delete all of the recording files from disk Only available if OpenVidu is enabled.
def delete(self, *, recording_id): response = openvidu().delete_recording(recording_id) if response.status_code == 204: return elif response.status_code == 404: abort(NotFound, query=f"Recording `{recording_id}` does not exist") elif response.status_code == 409:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_record_file(self, record_file, logStat):\n result = self.storage_delete_file(record_file.group, record_file.storage)\n if result:\n logStat(deleted=True, file_obj=record_file)\n record_file.delete()\n return result", "def __del__(self): \n self.st...
[ "0.65803087", "0.65568966", "0.6367536", "0.6111408", "0.60413176", "0.60305023", "0.6022", "0.60196805", "0.60104823", "0.5969963", "0.5963714", "0.59381646", "0.59376913", "0.59030396", "0.5889724", "0.5853442", "0.58431613", "0.5831818", "0.58182937", "0.58172864", "0.5772...
0.78824013
0
Download a Recording from OpenVidu Server Only available if OpenVidu is enabled.
def get(self, *, recording_id): response = openvidu().get_recording(recording_id) if response.status_code == 200: recording = response.json() elif response.status_code == 404: abort(NotFound, query=f"Recording `{recording_id}` does not exist") elif response.stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_ostrich_video(download_to_path):\n urlretrieve(REMOTE_OSTRICH_VID_PATH, download_to_path)", "def download_skateline_video(download_to_path=None):\n urlretrieve(REMOTE_SKATELINE_VID_PATH, download_to_path)", "def get(self, *, recording_id):\n\n response = openvidu().get_recording(recor...
[ "0.660001", "0.63986474", "0.6218075", "0.59306", "0.5901923", "0.5869856", "0.5765283", "0.5765283", "0.5765283", "0.5765283", "0.5765283", "0.5765283", "0.5758184", "0.5756224", "0.57226616", "0.57060057", "0.57060057", "0.57060057", "0.57060057", "0.57060057", "0.57060057"...
0.6501813
1
Start the recording of a session Only available if OpenVidu is enabled.
def post(self, args, *, session_id): response = openvidu().start_recording(session_id, json=args) if response.status_code == 200: data = response.json() room = ( current_app.session.query(Room) .filter_by(openvidu_session_id=data["sessionId"]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_recording(self):\n\n\t\tself.eyetribe.start_recording()\n\t\tself.recording = True", "def recording_start(self):\n self._post('recording/start')", "def start_recording(self, *args, **kwargs):\n return self.recorder.start_recording(*args, **kwargs)", "def start_recording(self):\n\n ...
[ "0.69981426", "0.69059336", "0.6835243", "0.67142385", "0.6643458", "0.6552146", "0.6403572", "0.6286545", "0.62625855", "0.62147516", "0.61870366", "0.6178485", "0.6161698", "0.6149195", "0.61226386", "0.6110635", "0.600413", "0.5947124", "0.5946636", "0.59133965", "0.590577...
0.69072986
1
Start asynchronous input processing
def start(self): self.has_event = False self.running = True self._condition.acquire() self._thread = threading.Thread(target=read_input, args=(self,)) self._thread.start()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_process_input(self, inp: inputs.Input) -> None:\n raise NotImplementedError()", "def process_input(self, inp: inputs.Input) -> None:\n self.task_registry.create_task(self.async_process_input(inp))", "def run(self) -> None:\n\n while True:\n try:\n ...
[ "0.71012735", "0.6623622", "0.652197", "0.6454346", "0.64008456", "0.6354719", "0.634934", "0.63402873", "0.6291486", "0.6217243", "0.62050235", "0.62028325", "0.6196018", "0.6141272", "0.6123779", "0.6099275", "0.6010271", "0.59452224", "0.59437335", "0.5911982", "0.5861372"...
0.6959562
1
Execute callback action for an incoming event
def callback(self, event): button = event["button"] cmd = self._callbacks.get(self._uuidstr(self.global_id, button), None) cmd = self._callbacks.get(self._uuidstr(event["name"], button), cmd) cmd = self._callbacks.get(self._uuidstr(event["instance"], button), cmd) if cmd is Non...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def event_in_cb(self, msg):\n self.event = msg.data", "def onEvent(self, eventName, callBack):\n self.msg_namespace.on('ops', callBack)", "def perform_callback(self, *args, **kwargs):\n pass", "def onAction(*args):", "def onAction(*args):", "def onAction(*args):", "def onAction(*ar...
[ "0.72822505", "0.70127434", "0.700589", "0.6768786", "0.6768786", "0.6768786", "0.6768786", "0.6697053", "0.6596345", "0.65904605", "0.6590431", "0.6574243", "0.6534539", "0.65215206", "0.64999133", "0.6488703", "0.6477715", "0.6464448", "0.646269", "0.6445889", "0.64355564",...
0.72343135
1
Return the sum of the square of the digits of a number, e.g. 32 > 13.
def square_digit_sum(number): return sum(precomputed_digit_squares[digit] for digit in str(number))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_squares(num):\n sum = 0\n while (num != 0):\n sum += math.pow((num % 10), 2)\n num = num/10\n return int(sum)", "def sum_of_digits_in_number(n: int) -> int:\n return sum(int(digit) for digit in str(n))", "def sum_digits(n):\n num = n\n incTen = 1\n summy = 0\n if n...
[ "0.8314024", "0.7841442", "0.77029717", "0.7654653", "0.7648175", "0.76243734", "0.7467898", "0.74651736", "0.74583864", "0.74521124", "0.74133635", "0.7342469", "0.73378193", "0.73087245", "0.72862816", "0.7282983", "0.7277899", "0.7254383", "0.7231389", "0.7196259", "0.7186...
0.8486469
0
Scales the input features of each intermediate layer in order of increasing stride.
def forward(self, x): # The scaled feature maps for each interim layer scaled_features = OrderedDict() for (_, module), (layer_name, features) in zip(self.adaptor.items(), x.items()): patches_per_axis = int(sqrt(features.shape[1])) # Reshape to 2d and reorder dimensions t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _scale_features(self, features):\n assert isinstance(features, np.ndarray), \"Input is not a numpy array!\"\n\n return self.scaler.transform(features.reshape(1, -1))", "def scale(step_size: float) -> GradientTransformation:\n return _scale(step_size=step_size, already_flattened=False)", "d...
[ "0.6069742", "0.6027195", "0.59086466", "0.58238685", "0.58129877", "0.58056754", "0.58056754", "0.58042914", "0.57350945", "0.57300484", "0.57218236", "0.57141936", "0.568602", "0.5638847", "0.56379384", "0.563669", "0.562825", "0.5611087", "0.56021976", "0.5591613", "0.5567...
0.6467156
0
Extract the module file name and line by inspection.
def filename_line(skip: int = 2) -> Tuple[str, int]: stack = inspect.stack() start = skip parentframe = stack[start][0] filename = 'N/A' module = inspect.getmodule(parentframe) if module: filename = os.path.basename(os.path.realpath(module.__file__)) return filename, parentframe.f_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_definition(self, info):\r\n token = info.obj\r\n lines = info.lines\r\n source_code = info.source_code\r\n filename = info.filename\r\n\r\n line_nr = None\r\n if '.' in token:\r\n token = token.split('.')[-1]\r\n\r\n line_nr = get_definition_with_...
[ "0.6546095", "0.64204025", "0.6286522", "0.6074252", "0.604478", "0.59372175", "0.59232354", "0.58754164", "0.58697623", "0.5837855", "0.57866216", "0.57653844", "0.5745258", "0.574496", "0.5744206", "0.5693252", "0.5683909", "0.56837696", "0.5660498", "0.5617504", "0.5607070...
0.65381515
1
Return generator over check results.
def check_results(self): while True: # If no checks left, stop if len(self._check_results) == 0: break # Return earliest result and remove from list yield self._check_results.pop(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def iterate(self): # pragma: no mccabe\n for case_result in self.suite_result.passed:\n for scenario_result in case_result.passed:\n yield scenario_result, True, True\n for scenario_result in case_result.failed:\n yield scenario_result, False, True # pra...
[ "0.66472244", "0.6500041", "0.6259373", "0.6240636", "0.6147593", "0.59843", "0.5965806", "0.5961395", "0.5939978", "0.59119546", "0.58932894", "0.58822715", "0.5831415", "0.58069813", "0.57816905", "0.5770246", "0.57701373", "0.5715555", "0.570003", "0.5638769", "0.56072867"...
0.7698506
0
Do preconfiguration checks. Return a list of CheckResult items, one for each check.
def pre_config_checks(self): if self.host is not None: self.tell("Doing pre-config checks") self.do_checklist([])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_checks(self):\n retval = []\n retval.extend(self.check_slick_status())\n retval.extend(self.check_java_processes())\n retval.extend(self.check_firefox_processes())\n retval.extend(self.check_disk_space())\n return retval", "def __runChecks(self):\n run...
[ "0.6579942", "0.61347735", "0.5918062", "0.5915588", "0.5889537", "0.58700436", "0.58586943", "0.5851722", "0.572591", "0.57106316", "0.5689189", "0.5632314", "0.5584315", "0.5511301", "0.54948235", "0.54906636", "0.5459327", "0.542329", "0.5401744", "0.5384123", "0.53488743"...
0.6837133
0
Do postconfiguration checks. Return a list of CheckResult items, one for each check.
def post_config_checks(self): if self.host is not None: self.tell("Doing post-config checks") self.do_checklist([])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform_checks(self):\n retval = []\n retval.extend(self.check_slick_status())\n retval.extend(self.check_java_processes())\n retval.extend(self.check_firefox_processes())\n retval.extend(self.check_disk_space())\n return retval", "def test_run_all_sql_data_checks(se...
[ "0.5916621", "0.5734533", "0.5659765", "0.54654485", "0.5404088", "0.53832567", "0.5361073", "0.53190947", "0.5267433", "0.5263102", "0.524129", "0.52240616", "0.5184659", "0.514193", "0.5114651", "0.51029646", "0.5099988", "0.50570494", "0.5046535", "0.5043843", "0.5043554",...
0.6934056
0
Return the configuration of the actual device.
def device_config(self): try: return self._dev except: return 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config(self) -> 'outputs.DeviceConfigResponse':\n return pulumi.get(self, \"config\")", "def get_configuration(self):\n\t\tdevice = DeviceBase(self.name)\n\n\t\tif len(self.master_url) > 0:\n\t\t\tdevice.master_url = self.master_url\n\t\t\tr = requests.get(self.master_url + '/configuration/' + self.na...
[ "0.85367155", "0.76415837", "0.76286024", "0.74827415", "0.74146307", "0.7380526", "0.72712225", "0.72463226", "0.72262603", "0.71948266", "0.7149988", "0.70847535", "0.70729476", "0.7020076", "0.70090455", "0.7004731", "0.70004076", "0.69863135", "0.6963824", "0.6931717", "0...
0.81186765
1
Compare device and object configurations. If dev is not None, use the given configuration instead of the current device configuration. If obj is not None, use the given configuration instead of the current object configuration. Keyword arguments dev device configuration (default None) obj object configuration (default ...
def config_match(self, dev=None, obj=None): if dev is None: dev = self.device_config if obj is None: obj = self.object_config return dev == obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_matches_object(self, obj=None):\n\n\t\treturn self.device_is_configured and self.config_match(obj=obj)", "def __eq__(self, other_object):\n if type(self) != type(other_object):\n return False\n\n #check the important parameters\n #print \"TESTing\", self.config, other_o...
[ "0.65390724", "0.6130971", "0.5525185", "0.5412156", "0.5403968", "0.5375348", "0.53177214", "0.5304435", "0.5297185", "0.52221376", "0.52200085", "0.5219425", "0.52145475", "0.5206618", "0.51980466", "0.5179718", "0.5171252", "0.51585585", "0.515688", "0.5137976", "0.5131275...
0.81821424
0
Check if device is configured.
def device_is_configured(self): try: _ = self._dev except: return False return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_device_state(self):", "def is_configured(self):\n pass", "def system_valid(self):\n return self.udev.devices_exist", "def is_configured(self):\n return True", "async def is_configured(hass: HomeAssistant) -> bool:\n manager = await async_get_manager(hass)\n if manager.d...
[ "0.7194064", "0.7099172", "0.7063311", "0.70046985", "0.6912286", "0.6897651", "0.683083", "0.67324764", "0.668593", "0.66775596", "0.6595061", "0.65944046", "0.6571044", "0.65219057", "0.64957625", "0.6487861", "0.6476712", "0.64276296", "0.64197534", "0.64023596", "0.639306...
0.859375
0
Check if device is configured to match object configuration. If obj is not None, use the given configuration instead of the current object configuration. Keyword arguments obj object configuration (default None) Returns True if the device is configured and if that configuration matches the object configuration.
def device_matches_object(self, obj=None): return self.device_is_configured and self.config_match(obj=obj)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_match(self, dev=None, obj=None):\n\n\t\tif dev is None:\n\t\t\tdev = self.device_config\n\t\tif obj is None:\n\t\t\tobj = self.object_config\n\n\t\treturn dev == obj", "def _check_object_config(self):\n src_cfg_format = self.config[\"source\"][\"config\"]\n\n job = self.active_queue[0]\n...
[ "0.8256742", "0.60175085", "0.57257104", "0.5673974", "0.56703717", "0.5573148", "0.55559886", "0.5523081", "0.5520244", "0.5481249", "0.541949", "0.53592515", "0.52480066", "0.52480066", "0.5242481", "0.5224062", "0.5213584", "0.5182861", "0.517725", "0.5157547", "0.5157547"...
0.86104596
0
Initializes the controller with the view & model.
def __init__(self, view, model): self.view = view self.view.set_controller(self) self.model = model
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n self.model = self.load_model()\n self.form_html = self.create_form_html()", "def __init__(self, controller):\n self._controller = controller", "def on_init(self):\n self.controller = gameController.Controller()", "def initializeUI(self):\n self.setGeom...
[ "0.7051387", "0.68626446", "0.676445", "0.67608416", "0.6730788", "0.66994655", "0.66494745", "0.662967", "0.66260207", "0.65950286", "0.6576748", "0.654844", "0.6439896", "0.64361614", "0.6435332", "0.6284416", "0.62685275", "0.62328696", "0.6160774", "0.6102789", "0.6099398...
0.80433726
0
Relationships for user Returns a list of friends, people you are following, and followers, people that are following you but you are not following.
def relationships_for_user(self, user): # List of users who follow "user". followers_users_list = [ relationship.from_user for relationship in self.filter(to_user=user) ] # List of relationships for users "user" follows, who also follow "user". friend_list = self.filter(from_use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def follows(self):\r\n return relationships.Follows(self)", "def follows(self):\n return relationships.Follows(self)", "def user_following(username, max: int = None):\n for user_dict in client.user_relationships(username, max=max, type=\"following\"):\n print(json.dumps(user_dict))", ...
[ "0.6660938", "0.65419674", "0.6477425", "0.6456748", "0.63984066", "0.62829083", "0.627599", "0.6252226", "0.62037635", "0.61852443", "0.61262274", "0.6106134", "0.60990894", "0.6072475", "0.6068187", "0.6049861", "0.6044976", "0.60012174", "0.5986694", "0.59622574", "0.59373...
0.82885265
0
Checks if flags is in args, and if not it adds the flag to args.
def override_if_not_in_args(flag, argument, args): if flag not in args: args.extend([flag, argument])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_flags(args: Sequence[str]) -> Dict[str, bool]:\n flags = {}\n for arg in args:\n if arg.startswith(FLAG_MARKER):\n flag_name = arg[len(FLAG_MARKER):]\n if flag_name and flag_name not in OMIT_FLAGS:\n flags[flag_name] = True\n else:\n break # Ignore flags after initial CLI ca...
[ "0.6677477", "0.6645882", "0.60863894", "0.60863894", "0.60808325", "0.60373974", "0.60074294", "0.59921616", "0.59623545", "0.5952936", "0.5949942", "0.5934693", "0.5869397", "0.58683527", "0.5840151", "0.5837697", "0.5830563", "0.5817184", "0.58051646", "0.5788879", "0.5758...
0.76882064
0
Builds the evaluation VAEGAN graph.
def build_eval_graph(self, data_dir, batch_size): return self.build_graph(data_dir, batch_size, mode=EVAL)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buildGraph(self):\r\n\r\n print 'Building graph...'\r\n\r\n self.buildQ()\r\n self.buildP()\r\n self.buildReconstructionTerm()\r\n self.buildConditionalPriorTerm()\r\n self.buildWPriorTerm()\r\n self.buildZPriorTerm()\r\n\r\n self.buildObjective()\r\n ...
[ "0.66330874", "0.65755147", "0.64188087", "0.6387675", "0.6357557", "0.629013", "0.62466234", "0.619727", "0.61953604", "0.61843127", "0.61041623", "0.6084243", "0.6071744", "0.6046951", "0.6042873", "0.60207635", "0.6010319", "0.6009588", "0.5993697", "0.5976763", "0.5942786...
0.6601584
1
Builds the prediction VAEGAN graph for image input.
def build_prediction_image_graph(self): tensors = self.build_graph(1, PREDICT_IMAGE_IN) keys_p = tf.placeholder('float32', [None, self.QUES_SIZE]) inputs = {'key': keys_p, 'ques_vector': tensors.quesVec} keys = tf.identity(keys_p) outputs = {'key': keys, 'prediction': tensors.genImgData} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_inference_graph(self):\n self.build_train_graph()", "def _build_and_compile_vae(self):\n z_dimension = int(self.n_dims//2)+1\n\n self.encoder, inputs, z_mean, z_var = self._encoder(z_dimension, self.mcd)\n\n self.decoder, outputs = self._decoder(inputs, z_dimension, self.mcd...
[ "0.61238796", "0.6017474", "0.5863091", "0.56766254", "0.5661419", "0.5589735", "0.5516368", "0.5507306", "0.5503744", "0.5484291", "0.54819345", "0.5471904", "0.5432435", "0.54278654", "0.54207414", "0.54012424", "0.53967243", "0.53850025", "0.5355296", "0.535415", "0.532904...
0.63652086
0
Exports the prediction graph.
def export(self, last_checkpoint, output_dir): with tf.Session(graph=tf.Graph()) as sess: inputs, outputs = self.build_prediction_image_graph() init_op = tf.global_variables_initializer() sess.run(init_op) trained_saver = tf.train.Saver() trained_saver.restore(sess, las...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def export(self):\n if self.model.algorithm == 'DecisionTree':\n dot_data = tree.export_graphviz(self.model.clf, out_file=None)\n graph = graphviz.Source(dot_data)\n graph.render(\"exports/DecisionTreeRegressor\")", "def export_freeze_model(self, export_dir='.', version=1)...
[ "0.69779485", "0.6514851", "0.6343418", "0.63088596", "0.6273102", "0.6150119", "0.61405104", "0.60842127", "0.6041941", "0.6040545", "0.59748113", "0.5972487", "0.5959718", "0.59432715", "0.59266734", "0.59050053", "0.5880715", "0.58521193", "0.5832841", "0.58324564", "0.583...
0.67879766
1
grid vector quantity over pair separation calculate drij[i, j] dot vec[i] and count for each bin see usage in grid_force_difference
def gofv(myr, drij, vec): # !!!! assume linear grid nr = len(myr) rmin = myr[0] dr = myr[1]-myr[0] if not np.isclose(myr[2]-myr[1], dr): raise RuntimeError('not linear grid') # histogram ysum = np.zeros(nr) counts = np.zeros(nr, dtype=int) rij = np.linalg.norm(drij, axis=-1) nmol = rij.shape[0] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calc(self):\n np = 0\n for cell in self.cells:\n n = self.cell_np[cell]\n np += n\n self.dnp = np - self.np\n self.np = np", "def span_vector_pdb(self) -> None:\n pnts = self.dir_vec * np.mgrid[-7.5:7.5:2j][:, np.newaxis]\n pnts += self.mean_vec...
[ "0.5644964", "0.5616432", "0.55806136", "0.555067", "0.5532535", "0.55313903", "0.55079514", "0.54220074", "0.5410216", "0.5404453", "0.5369077", "0.5359384", "0.535771", "0.53471506", "0.533369", "0.5333605", "0.531024", "0.52742636", "0.52707136", "0.5268251", "0.5246245", ...
0.59597963
0
Sets the group of a given user.
def set_user_group(self, user_id, group_no): user_sn = self.id_to_sn(user_id) grp_chg = bytearray(struct.pack('<I', user_sn)+bytes([group_no])) self.send_command(cmd=DEFS.CMD_USERGRP_WRQ, data=grp_chg) self.recv_reply() self.refresh_data()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setGroups(self, user):\n self.grouplist.setGroups(user)", "def set_group(self, group):\n self._group = group", "def set_group(self, group: str) -> None:\n self.group = group", "def set_group(self, address, group):\n self.groups[address] = group", "def set_group(self, group):...
[ "0.7851728", "0.7180732", "0.70697165", "0.6988296", "0.6928173", "0.69139653", "0.67774695", "0.6773321", "0.67713976", "0.6747184", "0.66019046", "0.65300983", "0.65245444", "0.6508961", "0.64286745", "0.6407589", "0.6407589", "0.6407589", "0.63585025", "0.6344296", "0.6303...
0.7689402
1
Set/create an unlock combination.
def set_unlock_comb(self, comb_no, ulg_comb): wreq_ulg = bytearray([0x00]*8) wreq_ulg[0] = comb_no wreq_ulg[6:8] = struct.pack('<H', len(ulg_comb)) for n in range(len(ulg_comb)): wreq_ulg[1+n] = ulg_comb[n] self.send_command(cmd=DEFS.CMD_ULG_WRQ, data=wreq_ulg) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_lock_unlock(self):\n my_thing_id = str(uuid.uuid4())\n dweepy.lock(my_thing_id, test_lock, test_key)\n dweepy.unlock(my_thing_id, test_key)", "def unlock(*args):", "def unlock(self, volume, _cfg=None) :\n name_or_id = self.get_name_or_id(volume)\n CmdList=[_cfg.binar...
[ "0.6183068", "0.6134914", "0.59802043", "0.5789322", "0.5731215", "0.56940514", "0.5689925", "0.5592284", "0.5524211", "0.54851586", "0.54664135", "0.546573", "0.54345644", "0.5430829", "0.5415139", "0.5396441", "0.53864837", "0.5340268", "0.53338486", "0.5332258", "0.5241229...
0.6149357
1
Unlocks the door for a given delay.
def door_unlock(self, delay): self.send_command(cmd=DEFS.CMD_UNLOCK, data=struct.pack('<I', delay)) self.recv_reply()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unlock_door_interlock(self):\n if self.detector_distance_hwobj.getPosition() < 340:\n self.detector_distance_hwobj.move(500)\n gevent.sleep(1)\n\n if not self.use_door_interlock:\n logging.getLogger().info('Door interlock is disabled')\n return\n\n ...
[ "0.66657245", "0.62961185", "0.61680007", "0.5932932", "0.5875496", "0.5805225", "0.57764405", "0.5750556", "0.56625706", "0.56502044", "0.56499124", "0.5626006", "0.5624048", "0.5610247", "0.55794007", "0.556739", "0.55218613", "0.55032533", "0.5485194", "0.54710114", "0.544...
0.8951721
0
Find sections in the given xml document which have a match for the name attribute
def _get_named_arrs_from_xml(self, xml, name, is_expected=True): try: doc = minidom.parseString(xml) except ExpatError, e: raise ProviderContentMalformedError("Content parse provider supplied XML document") arrs = doc.getElementsByTagName('arr') matching_arrs = [e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scan_section(name, o):\n\n for n in dir(o):\n scan(name + n, getattr(o, n))", "def find(self, elements, name=None):\n\n for element in elements:\n if element[\"name\"] == name or element[\"cm\"][\"name\"] == name:\n return element\n return None", "def getCh...
[ "0.59783506", "0.587904", "0.5748297", "0.56949323", "0.5501737", "0.5487459", "0.547802", "0.5442949", "0.5428993", "0.5389648", "0.5362752", "0.5323829", "0.53208655", "0.5281399", "0.5272895", "0.52705747", "0.52676386", "0.5186042", "0.51504034", "0.5145324", "0.5138944",...
0.63427174
0
Places player's guess on board
def placeGuess(player, xPos, yPos): # Print hit ship message if other player's board # has a ship at that position if(player.otherPlayer.board[yPos][xPos] != '~'): player.guess[yPos][xPos] = '#' print("You've hit a ship!\n") # Print miss message if no ship at that position else: player.guess[yPos][xPos]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _guess(self, ctx):\n reply = '\\n'\n for i, entry in enumerate(db.get_leaderboard(\n ctx.message.server.id,\n 'guess-leaderboard')):\n for key, value in entry.items():\n if key == \"discord_id\":\n name = self.get_na...
[ "0.69176424", "0.6890433", "0.6629641", "0.66096646", "0.6592822", "0.65086484", "0.64996165", "0.6430656", "0.64269215", "0.63308525", "0.6314818", "0.6299123", "0.62588865", "0.62438065", "0.6242464", "0.6218959", "0.61367047", "0.61359924", "0.61223763", "0.6118807", "0.61...
0.71550655
0
finds the most common word from a list of words in a piece of text
def most_common_word(words, text): word_frequency = {w:text.count(w) for w in words} return sorted(words, key=word_frequency.get)[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_frequent_words(words, most_frequent): \n \n # common_words = Counter(sorted(words))\n # print common_words\n common_words = Counter(sorted(words)).most_common(most_frequent)\n print (common_words )\n most_common_words = [w for w, w_count in common_words]\n return most_common_words"...
[ "0.7875434", "0.7755277", "0.75181144", "0.74954784", "0.7432042", "0.7310732", "0.727135", "0.7123813", "0.7071797", "0.70364475", "0.7005478", "0.6933868", "0.690446", "0.6851607", "0.6835552", "0.6816538", "0.6816106", "0.6806948", "0.67923945", "0.678575", "0.6782919", ...
0.8461566
0