query
stringlengths
10
2k
document
stringlengths
20
51.2k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Sets the left_item_text of this CRFItemMetadata.
def left_item_text(self, left_item_text): self._left_item_text = left_item_text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def leftsetlabel(self, label):\n self._setlabel(ITEM_LEFT_NODE, label)", "def right_item_text(self, right_item_text):\n\n self._right_item_text = right_item_text", "def SetItemLeftImage(self, item, image):\r\n\r\n item.SetLeftImage(image)\r\n\r\n dc = wx.ClientDC(self)\r\n se...
[ "0.65293217", "0.63202965", "0.6260443", "0.6179439", "0.604142", "0.5959585", "0.5953809", "0.5933594", "0.5860581", "0.5860581", "0.5850252", "0.56611806", "0.56546223", "0.5612308", "0.5570203", "0.55116075", "0.55116075", "0.55026764", "0.54403585", "0.5439165", "0.530228...
0.9002481
0
Sets the right_item_text of this CRFItemMetadata.
def right_item_text(self, right_item_text): self._right_item_text = right_item_text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetItemText(self, item, text):\r\n\r\n dc = wx.ClientDC(self)\r\n item.SetText(text)\r\n self.CalculateSize(item, dc)\r\n self.RefreshLine(item)", "def left_item_text(self, left_item_text):\n\n self._left_item_text = left_item_text", "def set_top_right_text(self, text):\n...
[ "0.6028372", "0.5996367", "0.591082", "0.5880386", "0.54957396", "0.547826", "0.53529257", "0.52626866", "0.5250284", "0.5212471", "0.5184038", "0.51346034", "0.5072048", "0.5057587", "0.5002686", "0.49917242", "0.49321666", "0.4909296", "0.48485932", "0.48441127", "0.4830010...
0.8792657
0
Sets the required of this CRFItemMetadata.
def required(self, required): self._required = required
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assignRequiredValues(self):\n return _libsbml.Model_assignRequiredValues(self)", "def required(self):\n return self._required", "def required(self):\n return self._required", "def hasRequiredAttributes(self):\n return _libsbml.Replacing_hasRequiredAttributes(self)", "def set...
[ "0.64178187", "0.5959736", "0.5959736", "0.59229565", "0.58529204", "0.58456004", "0.5776589", "0.5768829", "0.5752423", "0.5734786", "0.5722766", "0.5694942", "0.5658922", "0.5653567", "0.5636462", "0.5596808", "0.55959076", "0.55841094", "0.55795616", "0.55610985", "0.55545...
0.6578217
2
Sets the is_required of this CRFItemMetadata.
def is_required(self, is_required): self._is_required = is_required
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def required(self, required):\n\n self._required = required", "def required(self, required):\n\n self._required = required", "def required(self, required):\n\n self._required = required", "def required(self, required):\n\n self._required = required", "def explicitly_required(sel...
[ "0.6989688", "0.6989688", "0.6989688", "0.6989688", "0.66087073", "0.657061", "0.6490792", "0.64057386", "0.6264708", "0.61659116", "0.6022359", "0.6022359", "0.59371734", "0.59179664", "0.5845794", "0.58247334", "0.58125085", "0.5789793", "0.57676375", "0.57676375", "0.57544...
0.78418905
0
Sets the disp_sequence of this CRFItemMetadata.
def disp_sequence(self, disp_sequence): self._disp_sequence = disp_sequence
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_sequence(self, counter):\n self.seq_counter = counter", "def sequence(self, sequence):\n\n self._sequence = sequence", "def _set_sequence(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=RestrictedClassType(base_type=lon...
[ "0.5289107", "0.509496", "0.5047754", "0.5047754", "0.5047754", "0.49216235", "0.49216235", "0.49216235", "0.48176402", "0.48176402", "0.48176402", "0.48176402", "0.48176402", "0.48176402", "0.45395482", "0.44179404", "0.44072402", "0.43658754", "0.43101555", "0.43101555", "0...
0.7731813
1
Sets the branching_equation of this CRFItemMetadata.
def branching_equation(self, branching_equation): self._branching_equation = branching_equation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_branch(self, value):\n self.update(value)", "def setBranch(self, value):\n value = value.strip()\n while value.endswith('/'):\n value = value[:-1]\n self.getField('branch').set(self, value)", "def setnodeequation(self, node_p=None, eqn=None):\n node_p = sel...
[ "0.55929667", "0.5346937", "0.5125946", "0.50153166", "0.50153166", "0.5015097", "0.48547754", "0.48375183", "0.4801036", "0.47841117", "0.47122127", "0.4665894", "0.46572354", "0.45139357", "0.45127857", "0.45008945", "0.44998997", "0.44949415", "0.4491215", "0.44742322", "0...
0.79911786
0
Sets the hide_from_survey of this CRFItemMetadata.
def hide_from_survey(self, hide_from_survey): self._hide_from_survey = hide_from_survey
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_on_toggle_hidden(self, on_toggle_hidden):\n self.on_toggle_hidden = on_toggle_hidden", "def hide_at_showing(self, hide_at_showing):\n self._hide_at_showing = hide_at_showing", "def hidden(self, hidden):\n\n self._hidden = hidden", "def toggle_hidden(self):\n if self.hidden...
[ "0.57516885", "0.54902035", "0.53918254", "0.51844275", "0.51725155", "0.5113507", "0.5092718", "0.5085322", "0.5068015", "0.5045363", "0.5039749", "0.4987194", "0.4973917", "0.49621585", "0.49437156", "0.49389812", "0.49347004", "0.49243224", "0.49168858", "0.4890537", "0.48...
0.8600312
0
Sets the item_data_type of this CRFItemMetadata.
def item_data_type(self, item_data_type): self._item_data_type = item_data_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetItemType(self, item, ct_type):\r\n\r\n item.SetType(ct_type)\r\n self.CalculatePositions()\r\n self.Refresh()", "def setTypeItem(self,data):\n currNode = self.head\n while currNode is not None:\n currNode.data.setType(data)\n currNode = currNode.nex...
[ "0.71519285", "0.6775733", "0.65547574", "0.65049314", "0.6504456", "0.63082874", "0.62500626", "0.6122837", "0.60807914", "0.6033292", "0.59997714", "0.5999725", "0.597647", "0.59333205", "0.5916967", "0.59019566", "0.59019566", "0.58997554", "0.58950627", "0.58813876", "0.5...
0.85676605
0
Sets the measurement_unit_name of this CRFItemMetadata.
def measurement_unit_name(self, measurement_unit_name): self._measurement_unit_name = measurement_unit_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def measurement_unit(self, measurement_unit):\n\n self._measurement_unit = measurement_unit", "def measurement_unit_string(self, measurement_unit_string):\n\n self._measurement_unit_string = measurement_unit_string", "def setName(self, *args):\n return _libsbml.UnitDefinition_setName(self,...
[ "0.7229388", "0.6934718", "0.63393164", "0.6046975", "0.6046975", "0.6046975", "0.596539", "0.5655794", "0.55701834", "0.548006", "0.544759", "0.54469454", "0.5434645", "0.5434645", "0.5420549", "0.5410422", "0.533727", "0.5335632", "0.5334557", "0.5326491", "0.5288344", "0...
0.8336995
0
Sets the variable_name of this CRFItemMetadata.
def variable_name(self, variable_name): self._variable_name = variable_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setVarName(self, theName):\n self._name = theName\n return self", "def name(self, value):\n self._name = value", "def name(self, value):\n self._name = value", "def set_name(self, item_name):\r\n self.name = item_name", "def set_name(self, name):\n\t\tself.name_ = name", ...
[ "0.66791564", "0.64667934", "0.64667934", "0.6447974", "0.64239323", "0.63295835", "0.6328467", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6216841", "0.6202391", "0.61930305...
0.74065804
0
Sets the label_plain_text of this CRFItemMetadata.
def label_plain_text(self, label_plain_text): self._label_plain_text = label_plain_text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_label_text(self, text: str) -> None:\n self._label_text.set(text)\n self.update_label_text()", "def set_label_text (self, text):\n if text: self.label.set_label(text)", "def set_label(self, text):\n self._label = text", "def setText(self, text):\n assert self.isLabe...
[ "0.71490645", "0.7137557", "0.69139034", "0.66775477", "0.6674038", "0.6582513", "0.6231467", "0.6231467", "0.614886", "0.6105318", "0.6044843", "0.6021978", "0.6013166", "0.6002894", "0.59810686", "0.5956109", "0.59131163", "0.5870921", "0.58265203", "0.5819637", "0.5808743"...
0.8491416
0
Sets the phi_status of this CRFItemMetadata.
def phi_status(self, phi_status): self._phi_status = phi_status
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def set_status(self, status):\n self.status = status", "def status(self, status):\n self._set_property_(self.STATUS, str(status))", "def setStatus(self, status):\n ...
[ "0.5649311", "0.5649311", "0.5649311", "0.55240566", "0.54810035", "0.5382191", "0.5382191", "0.5382191", "0.5382191", "0.5382191", "0.5382191", "0.5382191", "0.5359543", "0.5359543", "0.5359543", "0.5359543", "0.5359543", "0.5359543", "0.5359543", "0.5359543", "0.5359543", ...
0.8404241
0
Sets the left_alignment of this CRFItemMetadata.
def left_alignment(self, left_alignment): self._left_alignment = left_alignment
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_left(self, left):\n self.left = left", "def left(self, left):\n\n self._left = left", "def left(self, left):\n\n self._left = left", "def SetAlignment(self, l):\r\n\r\n self.alignment = l", "def left_item_text(self, left_item_text):\n\n self._left_item_text = left...
[ "0.6574805", "0.6566163", "0.6566163", "0.65345246", "0.6459472", "0.6457593", "0.6424361", "0.6252998", "0.6169644", "0.61551714", "0.6146845", "0.6079131", "0.6060532", "0.5910949", "0.58292276", "0.5822784", "0.5801926", "0.57784015", "0.57485723", "0.57107836", "0.5684591...
0.8885091
0
Sets the info_text of this CRFItemMetadata.
def info_text(self, info_text): self._info_text = info_text
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setInfo(self,item,text):\r\n raise AbstractError", "def setInfoText(self,\n number,\n text):\n for t in self.infoTextList:\n if t.getNumber() == number:\n t.setText(text)\n return t.getNumber()\n return None",...
[ "0.6926397", "0.6424692", "0.6369015", "0.6357641", "0.6239086", "0.617586", "0.6117708", "0.60535467", "0.602097", "0.5993214", "0.5993214", "0.5993214", "0.5993214", "0.5993214", "0.5993214", "0.59922236", "0.59470934", "0.5913392", "0.5908031", "0.5863257", "0.5853784", ...
0.83790463
0
Sets the soft_validation of this CRFItemMetadata.
def soft_validation(self, soft_validation): self._soft_validation = soft_validation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_validation_flag(self):\n self.is_validation = \\\n tf.placeholder_with_default(False, [], 'is_validation')", "def SetValid(self, valid):\r\n\r\n self._valid = valid", "def SetValid(self, valid):\r\n\r\n self._valid = valid", "def setValid(self):\n self.valid = T...
[ "0.5353058", "0.5330346", "0.5330346", "0.49618983", "0.47240362", "0.45421726", "0.45294648", "0.4478989", "0.4466243", "0.4457188", "0.44360343", "0.4405306", "0.43890238", "0.43867642", "0.43867642", "0.43449765", "0.43329006", "0.43329006", "0.43329006", "0.43329006", "0....
0.84250456
0
Sets the study_dictionary of this CRFItemMetadata.
def study_dictionary(self, study_dictionary): self._study_dictionary = study_dictionary
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def study(self, study):\n self.logger.debug(\"In 'study' setter.\")\n\n self._study = study", "def study_id(self, study_id):\n\n self._study_id = study_id", "def study_id(self, study_id):\n\n self._study_id = study_id", "def study_id(self, study_id):\n\n self._study_id = st...
[ "0.7408117", "0.6815802", "0.6815802", "0.6815802", "0.6407298", "0.6392456", "0.57259214", "0.5485375", "0.53085464", "0.5269286", "0.5169496", "0.51042134", "0.5049805", "0.501741", "0.49868628", "0.49790913", "0.4912993", "0.49014467", "0.48720977", "0.47251984", "0.471784...
0.8435421
0
Sets the default_value of this CRFItemMetadata.
def default_value(self, default_value): self._default_value = default_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default(self, default):\n\n self._set_field(\"value\", default)", "def set_value_to_default(self):\n self.setValue(self.default_value)", "def default_value(self, val):\n self.set_property(\"DefaultValue\", val)", "def default_value(self, value: Any) -> None:\n self.sdc_resourc...
[ "0.75924796", "0.74246854", "0.73537934", "0.7249788", "0.7058993", "0.69573045", "0.6925803", "0.6906051", "0.688965", "0.6880264", "0.6880264", "0.6768636", "0.6694588", "0.6691161", "0.6637705", "0.6637705", "0.6621905", "0.6608582", "0.66068643", "0.66010416", "0.6598313"...
0.7476477
2
Sets the subject_group of this CRFItemMetadata.
def subject_group(self, subject_group): self._subject_group = subject_group
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_subject(self, subject):\n self._subject = subject", "def subject_id(self, subject_id):\n\n self._subject_id = subject_id", "def subject(self, subject):\n\n self._subject = subject", "def subject(self, subject):\n\n self._subject = subject", "def subject(self, subject):\n...
[ "0.63580877", "0.61038595", "0.6050062", "0.6050062", "0.6050062", "0.59822106", "0.59822106", "0.59779745", "0.58377683", "0.580582", "0.5786556", "0.5786556", "0.5786556", "0.5765981", "0.5756019", "0.5756019", "0.57335085", "0.5668522", "0.56419635", "0.5600405", "0.559953...
0.8300697
0
Sets the required_query_description of this CRFItemMetadata.
def required_query_description(self, required_query_description): self._required_query_description = required_query_description
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def requires_description(self, requires_description):\n\n self._requires_description = requires_description", "def set_query(self, query):\n return self.set_param(\"query\", query)", "def set_description(self, description):\n self.__description = description", "def set_description(self, ...
[ "0.6304279", "0.5516879", "0.55024374", "0.54877824", "0.5466411", "0.54350024", "0.54346204", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", "0.53840196", ...
0.8806266
0
Sets the used_in_dys_fields of this CRFItemMetadata.
def used_in_dys_fields(self, used_in_dys_fields): self._used_in_dys_fields = used_in_dys_fields
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_used_samples(self, used_sample_id_list):\n self._make_index_list(used_sample_id_list)", "def used_at_enroll(self, used_at_enroll):\n\n self._used_at_enroll = used_at_enroll", "def setTwissWeightUse(self,use_twiss_weight_x,use_twiss_weight_y,use_twiss_weight_z):\n\t\tself.use_twiss_weight_...
[ "0.4862155", "0.48013577", "0.4740472", "0.4716655", "0.46052805", "0.4572636", "0.4572636", "0.45071083", "0.4448688", "0.43448734", "0.43371463", "0.4329086", "0.42889178", "0.42788282", "0.42561445", "0.4182343", "0.41783184", "0.41662297", "0.4162473", "0.41409802", "0.41...
0.8657676
0
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, CRFItemMetadata): return False return self.to_dict() == other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): if not isinstance(other, CRFItemMetadata): return True return self.to_dict() != other.to_dict()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", "0.8042487", ...
0.0
-1
Returns a list containing all values given in whatever. Each list or tuple will be "unpacked", all other elements are added to the resulting list. Examples given >>> as_list('spam') ['spam'] >>> as_list('spam', 'eggs') ['spam', 'eggs'] >>> as_list(('spam', 'eggs')) ['spam', 'eggs'] >>> as_list(['spam', 'eggs']) ['spam'...
def as_list(*whatever): result = [] for w in whatever: if w is None: continue elif isinstance(w, list): result += w elif isinstance(w, tuple): result += w else: result.append(w) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aslist(something):\n return something if isinstance(something, list) else [something]", "def to_list(ls):\r\n if isinstance(ls, (list, tuple)):\r\n return list(ls)\r\n else:\r\n return [ls]", "def convert_to_list(*args):\n converted_list = []\n for arg in args:\n if isin...
[ "0.71835566", "0.70398134", "0.70135355", "0.66638434", "0.6626172", "0.6535758", "0.65164727", "0.64893544", "0.645783", "0.6368578", "0.6313402", "0.6295935", "0.62555295", "0.6254891", "0.6248474", "0.62433916", "0.6223297", "0.6199154", "0.6197535", "0.6157671", "0.613895...
0.73624843
0
Convert dates coming from raw Vitals data into UTC ISO8601 Timestamps.
def cleanVitalsDate(date_str): if date_str[-1] != 'Z': date_str += 'Z' return date_str.replace(' ', 'T')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _dates_to_naive_utc(date_objects):\n\n if len(date_objects) == 0:\n return []\n naive_dates = []\n for date in date_objects:\n if date.tzinfo is not None and date.tzinfo.utcoffset(date) is not None:\n date = date.astimezone(pytz.utc)\n naive_dates.append(date.replace(tz...
[ "0.62865144", "0.6153723", "0.5991039", "0.5784753", "0.57253706", "0.568468", "0.5622829", "0.56227773", "0.56188506", "0.5599182", "0.55792564", "0.556961", "0.5470999", "0.5468242", "0.54329234", "0.54317844", "0.538669", "0.53795314", "0.5339017", "0.5293171", "0.5287467"...
0.5099201
39
Test that `particle_mass` does not return the proton mass when no mass number is specified for hydrogen. In this case, the standard atomic weight should be used to account for the small fraction of deuterium.
def test_particle_mass_for_hydrogen_with_no_mass_number(): assert particle_mass("H", Z=1) > const.m_p assert particle_mass("hydrogen", Z=1) > const.m_p
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mass_energy(particle: Particle, mass_numb: Optional[Integral] = None) -> u.J:\n return particle.mass_energy", "def cal_mass(self):\n\n if not self.check_def(['E','px','py','pz']):\n sys.exit('Particle error: Quadri impulsion not define (error for mass routine)')\n\n\n \n if...
[ "0.68099946", "0.65490735", "0.64468914", "0.63160104", "0.6221143", "0.6172661", "0.6118474", "0.6093364", "0.59432936", "0.5875183", "0.57785344", "0.57763803", "0.57589453", "0.571026", "0.5661141", "0.5650986", "0.5616769", "0.5609225", "0.5605034", "0.5579169", "0.556002...
0.8227859
0
Test that `particle_mass` returns equivalent results for equivalent positional and keyword arguments.
def test_particle_mass_equivalent_args(arg1, kwargs1, arg2, kwargs2, expected): result1 = particle_mass(arg1, **kwargs1) result2 = particle_mass(arg2, **kwargs2) assert u.isclose(result1, result2), ( f"particle_mass({arg1!r}, **{kwargs1}) = {result1!r}, whereas " f"particle_mass({arg2!r}, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_particle_mass_for_hydrogen_with_no_mass_number():\n assert particle_mass(\"H\", Z=1) > const.m_p\n assert particle_mass(\"hydrogen\", Z=1) > const.m_p", "def test_particle_mass_helium():\n assert particle_mass(\"alpha\") > particle_mass(\"He-3 2+\")", "def test_particle_mass_berkelium_249():\...
[ "0.6995093", "0.67936695", "0.65318865", "0.64905214", "0.645848", "0.60648805", "0.5987364", "0.5959909", "0.577817", "0.5735219", "0.57349783", "0.5654347", "0.56446767", "0.5610183", "0.5603175", "0.55926734", "0.5577821", "0.5551926", "0.5537376", "0.54917043", "0.5487187...
0.74628186
0
Test that `known_isotopes`, `common_isotopes`, and `stable_isotopes` return the correct values for hydrogen.
def test_known_common_stable_isotopes(): known_should_be = ["H-1", "D", "T", "H-4", "H-5", "H-6", "H-7"] common_should_be = ["H-1", "D"] stable_should_be = ["He-3", "He-4"] assert known_isotopes("H") == known_should_be, ( f"known_isotopes('H') should return {known_should_be}, but is " ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_known_common_stable_isotopes_cases():\n assert \"H-1\" in known_isotopes(\"H\")\n assert \"D\" in known_isotopes(\"H\")\n assert \"T\" in known_isotopes(\"H\")\n assert \"Be-8\" in known_isotopes(\"Be\")\n assert \"Og-294\" in known_isotopes(118)\n assert \"H-1\" in common_isotopes(\"H\"...
[ "0.7351276", "0.6829534", "0.63703936", "0.59731823", "0.5886229", "0.577467", "0.57032025", "0.5626084", "0.5593469", "0.556932", "0.5524931", "0.5495514", "0.54862934", "0.5479369", "0.54505044", "0.54497933", "0.54299146", "0.5428978", "0.54203016", "0.53863186", "0.538499...
0.69731
1
Test that `half_life` returns `None` and issues a warning for an isotope without halflife data.
def test_half_life_u_220(): isotope_without_half_life_data = "No-248" with pytest.raises(MissingParticleDataError): half_life(isotope_without_half_life_data) pytest.fail( f"This test assumes that {isotope_without_half_life_data} does " f"not have half-life data. If hal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_half_life_unstable_isotopes():\n for isotope in data_about_isotopes:\n if (\n \"half_life\" not in data_about_isotopes[isotope]\n and not data_about_isotopes[isotope]\n ):\n with pytest.raises(MissingParticleDataError):\n half_life(isotope)"...
[ "0.73846316", "0.66037804", "0.61119777", "0.5759902", "0.56929463", "0.5598875", "0.5510697", "0.54345953", "0.53564763", "0.53111714", "0.5294021", "0.527224", "0.52532977", "0.5236458", "0.51426125", "0.51358926", "0.5103761", "0.5103345", "0.50833166", "0.50787294", "0.50...
0.7622593
0
Create an SFO application and return it.
def create_sfo_application(config_db, number, host): efio_config = config_db.getObject("EFIOConfiguration", "EFIO-Configuration-1") #first create the app configuration SFOdal = dal_module('SFOdal','daq/schema/SFOng.schema.xml',[DFdal,dal]) sfo_config = SFOdal.SFOngConfiguration("SFO-Configuration-" + nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_app_instance(script_info):\n return create_app()", "def app():\n app = create_app()\n return app", "def app():\n return create_app()", "def create_app(self):\n raise NotImplementedError", "def create():\n\n return App()", "def new_app(project_name,app_name ):\n from f...
[ "0.7257405", "0.71808183", "0.71390027", "0.713841", "0.7108116", "0.67792016", "0.67628926", "0.6743027", "0.6735409", "0.66556925", "0.66555786", "0.6639376", "0.6592436", "0.65529794", "0.6521404", "0.6448752", "0.643883", "0.64261425", "0.6410081", "0.6400342", "0.6378764...
0.75364757
0
Randomly removes one utterance and reinserts it at another location in the conversation
def utterance_insert(conversation): old_idx = random.randrange(len(conversation)) new_idx = old_idx while new_idx == old_idx: new_idx = random.randrange(len(conversation)) if new_idx > old_idx: return conversation[:old_idx] + conversation[old_idx+1:new_idx] + [conversation[old_idx]] + c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def utterance_replace(conversation, utterance):\n idx = random.randrange(len(conversation))\n res = conversation.copy()\n res[idx] = utterance\n return res", "def handler(event, context):\n send_tweet(random.choice(potential_tweets))", "def handler(event, context):\n send_tweet(random.choice(...
[ "0.73776585", "0.5867125", "0.5867125", "0.58427644", "0.56934404", "0.56923413", "0.56568843", "0.5639355", "0.56371534", "0.55319506", "0.5527897", "0.5512964", "0.54923785", "0.54880035", "0.5472396", "0.5418839", "0.5415362", "0.5392044", "0.5374169", "0.5363067", "0.5308...
0.6937282
1
Get an existing FhirStore resource's state with the given name, id, and optional extra properties used to qualify the lookup.
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'FhirStore': opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = FhirStoreArgs.__new__(FhirStoreArgs) __props__.__dict__["complex_data_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_state_by_id(state_id):\n my_state = storage.get('State', state_id)\n if my_state is None:\n abort(404)\n return jsonify(my_state.to_dict())", "def get_state_by_id(state_id):\n state = storage.get(State, state_id)\n if not state:\n abort(404)\n return jsonify(state.to_dict(...
[ "0.6350847", "0.63462114", "0.63029563", "0.62968063", "0.6285668", "0.6157653", "0.6072632", "0.59514713", "0.59358984", "0.58835745", "0.5881398", "0.58613926", "0.58581984", "0.58253175", "0.57779515", "0.57363844", "0.57188183", "0.57044226", "0.5659024", "0.565853", "0.5...
0.69380313
0
Establish a clean test environment.
def setUp(self): super(TestSheepdogMultiStore, self).setUp() enabled_backends = { "sheepdog1": "sheepdog", "sheepdog2": "sheepdog", } self.conf = self._CONF self.conf(args=[]) self.conf.register_opt(cfg.DictOpt('enabled_backends')) self.con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def teardown_test_env():\n if not keep_tmp_dirs:\n print('\\nCleaning up temporary directories...')\n shutil.rmtree(tmp_elm_dpath, ignore_errors=True)\n shutil.rmtree(tmp_elm_examples_dpath, ignore_errors=True)\n\n print('Removing conda environment used for testing......
[ "0.79925764", "0.7463707", "0.7463707", "0.7230146", "0.71087873", "0.6968578", "0.6877131", "0.6847525", "0.68396896", "0.68036956", "0.68036956", "0.68036956", "0.68036956", "0.68036956", "0.68036956", "0.68036956", "0.6776391", "0.6713096", "0.6713096", "0.6651407", "0.662...
0.0
-1
If beagle argument is set creates Beagle association matrix, otherwise Google Ngram matrix, contains only words that are also in FAN.
def create_corpora_db(beagle=False, normalize=True): if beagle: name = 'beagle_mat' df = pd.read_csv(os.path.join(path, 'beagle.csv'), delimiter=',', skiprows=1, header=None) beagle_animals = df[0].apply(func=lambda x: x.upper()).values beagle_animals = bea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def abstract_words_matrix( corpus, cooccurrence_only = True, ignore_words = Ignore_words ) :\n return words_matrix( corpus, 'AB', cooccurrence_only, ignore_words )", "def gram_matrix(features, normalize=True):\n # *****START OF YOUR CODE (DO NOT DELETE/MODIFY THIS LINE)*****\n\n pass\n\n # *****END O...
[ "0.55857795", "0.5225516", "0.49682835", "0.49476123", "0.4942825", "0.4794095", "0.4736066", "0.4726113", "0.4723754", "0.4720965", "0.46934888", "0.46849233", "0.46745902", "0.46344772", "0.46305037", "0.46117327", "0.46101436", "0.4601533", "0.45998138", "0.45837384", "0.4...
0.59345204
0
Build the specific error string from error_body.
def build_error_msg(error_body: dict) -> str: ret_error_msg = '' for error in error_body: if error.get('field'): ret_error_msg += 'field ' + error['field'] if error.get('message'): ret_error_msg += ' ' + error['message'] return ret_error_msg
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _construct_error_response_body(error_type, error_message):\n # OrderedDict is used to make testing in Py2 and Py3 consistent\n return json.dumps(OrderedDict([(\"Type\", error_type), (\"Message\", error_message)]))", "def buildErrorMessage(self, test, err):\n\n errorMessage = \"\"\n ...
[ "0.6582292", "0.65355015", "0.62723047", "0.62429476", "0.6085947", "0.6065657", "0.6011453", "0.5837405", "0.58361995", "0.58329517", "0.58010226", "0.57803625", "0.5778782", "0.57681894", "0.5762593", "0.5741187", "0.57270885", "0.5720644", "0.57166904", "0.5711386", "0.569...
0.8250948
0
Convert given argument time to iso format with Z ending, if received None returns None.
def create_time(given_time: Any | None) -> str | None: if not given_time: return None if datetime_time := arg_to_datetime(given_time): return datetime_time.strftime(DATE_FORMAT) else: raise DemistoException("Time parameter supplied in invalid, make sure to supply a valid argument")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _make_iso_time(time: datetime,\n date: datetime,\n time_zone: pytz.timezone) -> str:\n time_combined = time.replace(year=date.year,\n month=date.month,\n day=date.day)\n return time_zone.localize(time_comb...
[ "0.6805687", "0.6610044", "0.66091", "0.64571726", "0.64311427", "0.6353851", "0.6266373", "0.622956", "0.62188953", "0.6185057", "0.6176277", "0.61728597", "0.61334056", "0.61228055", "0.6036664", "0.60207325", "0.5996541", "0.5963106", "0.5949644", "0.5936916", "0.58953434"...
0.5735628
27
Create a string time of the current time in date format.
def get_now_time() -> str | None: if now_time := arg_to_datetime('now'): return now_time.strftime(DATE_FORMAT) else: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_date_time():\n date_time = datetime.now()\n date_time_string = date_time.strftime(\"%b-%d-%Y (%H:%M:%S)\")\n return date_time_string", "def str_current_time():\n return strftime(\"%Y_%m_%d_%H_%M_%S_%Z\", gmtime())", "def date_time():\n\n\treturn datetime.now().strftime(\"%d%m%Y_%H%M%S\")", ...
[ "0.79368526", "0.7901701", "0.7859681", "0.7826266", "0.7810316", "0.7798008", "0.7779829", "0.77685195", "0.7747708", "0.7723915", "0.76773983", "0.76629585", "0.76401263", "0.7626165", "0.7624927", "0.7605432", "0.7602854", "0.7602256", "0.7595198", "0.7588721", "0.757204",...
0.0
-1
Assigns categories to this object.
def set_categories(self, categories: NounCategories): self._categories = categories
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def categories(self, categories):\n self._categories = categories", "def categories(self, categories):\n\n self._categories = categories", "def categories(self, categories):\n\n self._categories = categories", "def categories(self, categories):\n\n self._categories = categories", ...
[ "0.7696786", "0.7688389", "0.7688389", "0.7688389", "0.7688389", "0.7318721", "0.72713095", "0.67321116", "0.6605213", "0.65090936", "0.64567316", "0.6404559", "0.6396945", "0.61992157", "0.61852723", "0.61543995", "0.61500776", "0.61007094", "0.60978204", "0.60801387", "0.60...
0.71598285
7
Infer color form color_name and color_index
def populate_color(cls, values): color_name = values.get("color_name") color_index = values.get("color_index") palette = values.get("palette") # Set a default if needed if palette is None: palette = "vtint" if (color_name is None) and (color_index is None):...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_color(self, color_name):\n if not color_name:\n return 0\n\n if color_name == 'ORANGE':\n color = self.COLOR_ORANGE\n else:\n color = getattr(curses, 'COLOR_' + color_name)\n return curses.color_pair(color)", "def getColor(k) :\n colors = [\"...
[ "0.67022604", "0.65705186", "0.64438295", "0.6405792", "0.63680845", "0.6338341", "0.63372713", "0.6332214", "0.63264585", "0.62953573", "0.62869227", "0.6276768", "0.62457067", "0.62185067", "0.6215637", "0.6177213", "0.6174739", "0.6156242", "0.61308336", "0.6128998", "0.61...
0.6138115
18
Extract labeled data for evaluation (superclass)
def getLabeledXYonly(self, trainingData): labeledData, unlabeledData = trainingData return labeledData
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_labels(self):\r\n raise NotImplementedError()", "def get_labels(self):\n raise NotImplementedError()", "def get_labels(self):\n raise NotImplementedError()", "def get_labels(self):\n raise NotImplementedError()", "def classify(self, data):\n abstract", "def get_val_labels(self)...
[ "0.6368569", "0.6297174", "0.6297174", "0.6297174", "0.62276745", "0.6222899", "0.61879694", "0.61879694", "0.61879694", "0.61879694", "0.61879694", "0.61879694", "0.61879694", "0.61879694", "0.6164753", "0.61534077", "0.6150406", "0.6111864", "0.60855955", "0.6068749", "0.60...
0.5952828
38
Scheduling periodic task. Specify a particular time that the job should be run at. Job runs everyday.
def period_day_at(self, at_time="00:00:00"): self.period_at(unit="day", at_time=at_time) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schedule_task(self, name, date):\n pass", "def _schedule_task(self, task: _Task) -> None:\n if isinstance(task.interval, (int, float)):\n task.next = self.sys_loop.call_later(task.interval, self._run_task, task)\n elif isinstance(task.interval, time):\n today = date...
[ "0.699269", "0.69299006", "0.6922602", "0.6592286", "0.6584365", "0.6541961", "0.64261866", "0.6406181", "0.63799226", "0.6329013", "0.62768734", "0.62368757", "0.6223862", "0.6209299", "0.61981905", "0.6187478", "0.6182011", "0.61477786", "0.61419845", "0.6111355", "0.609083...
0.0
-1
Scheduling periodic task. Specify a particular time that the job should be run at. Job runs every month.
def period_month_at(self, at_time="00:00:00", day=1): self.period_at(unit="month", at_time=at_time, day=day) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _run_scheduled_monthly_tasks():\n today = datetime.date.today()\n if today.day == cfg.MONTHLY_JOB_START_DAY:\n worker.add_task(monthly.run)", "def setup_periodic_tasks(sender, **kwargs):\n sender.add_periodic_task(60, scheduled_task.s(), name='A scheduled task')", "def schedule_task(self, n...
[ "0.6963972", "0.6890185", "0.68458617", "0.6544809", "0.6517939", "0.6345112", "0.62222517", "0.6182993", "0.61797035", "0.6162442", "0.61445564", "0.6140372", "0.60516304", "0.6048248", "0.604184", "0.60322577", "0.6000042", "0.5993161", "0.5985276", "0.59547323", "0.5913318...
0.0
-1
Scheduling periodic tasks. Specify a particular time that the job should be run at.
def period_at(self, unit="day", at_time="00:00:00", week_day="Monday", day=1): for task in self._tasks: task.period_at(unit=unit, at_time=at_time, week_day=week_day, day=day) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_periodic_tasks(sender, **kwargs):\n sender.add_periodic_task(60, scheduled_task.s(), name='A scheduled task')", "def update_schedule(self, time=None):\n _update_schedule(self, time=time)", "def update_schedule(self, time=None, for_object=None):\n _update_schedule([self], time, for_ob...
[ "0.7077769", "0.67681086", "0.6664243", "0.6650754", "0.6543233", "0.65153164", "0.65046126", "0.6479757", "0.6469536", "0.63256705", "0.6275581", "0.6254551", "0.62445146", "0.6192633", "0.6178268", "0.6170901", "0.6150304", "0.61391944", "0.6137859", "0.61362755", "0.610097...
0.0
-1
Scheduling periodic tasks. Specify a particular time that the job should be run at. Job runs everyday.
def period_day_at(self, at_time="00:00:00"): for task in self._tasks: task.period_day_at(at_time=at_time) return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_periodic_tasks(sender, **kwargs):\n sender.add_periodic_task(60, scheduled_task.s(), name='A scheduled task')", "def schedule_task(self, name, date):\n pass", "def _schedule_task(self, task: _Task) -> None:\n if isinstance(task.interval, (int, float)):\n task.next = self.s...
[ "0.7208205", "0.679125", "0.6698997", "0.66207963", "0.6603043", "0.6531705", "0.6432124", "0.6417081", "0.6410584", "0.6402689", "0.6398423", "0.6385043", "0.6364421", "0.62830985", "0.6271283", "0.62367946", "0.6221145", "0.61833864", "0.6171695", "0.6168292", "0.61670655",...
0.57839525
51
Tests if a company id is not in the response
def test_read_companies_2(self): resp = self.app.get('/companies') self.assertFalse(b'hooli' in resp.data)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_companies_company_id_push_get(self):\n pass", "def test_companies_no_term(self, setup_data):\n url = reverse('api-v3:search:basic')\n response = self.api_client.get(url, {})\n\n assert response.status_code == status.HTTP_400_BAD_REQUEST", "def test_get_non_existent_campaign...
[ "0.5949096", "0.59180003", "0.58226675", "0.5767492", "0.5766972", "0.56569105", "0.5636592", "0.56111264", "0.56030166", "0.5590129", "0.5586572", "0.55756557", "0.55677444", "0.5566545", "0.5564447", "0.55444264", "0.55204445", "0.55055183", "0.5485161", "0.54840106", "0.54...
0.59711987
0
Plots the aperture numbers of an already identified image.
def plot_apertures(image, ext=1): hdu = fits.open(image) apfile = './database/ape' + image.strip('.fits') + '_{:d}'.format(ext) b = np.array( [i.split()[3:] for i in open(apfile).readlines() if 'begin' in i]) apid = b[:, 0] x = np.array([float(i) for i in b[:, 2]]) sci_exts = np.arra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imshow(img):\n imadd(img)\n plt.ion()\n plt.show()", "def fdplot(self, imx):\n fig = plt.figure()\n maxval = np.max(imx)\n ims = list(map(lambda im: [plt.imshow(np.fabs(im),norm=colors.Normalize(0.0,maxval))], imx))\n animation = anim.ArtistAnimation(fig,ims,interval=50)\...
[ "0.6850963", "0.66999334", "0.66771394", "0.6408717", "0.6364618", "0.6361123", "0.62744814", "0.62495446", "0.6209277", "0.61741704", "0.6165183", "0.61633563", "0.61586225", "0.6157898", "0.6146539", "0.60896647", "0.60829306", "0.6053762", "0.60450023", "0.60450023", "0.60...
0.6196759
9
Return a new instance of Cell with the same attributes. >>> a = Cell('A') >>> b = a.copy() >>> id(a) == id(b) False >>> b.letter 'A'
def copy(self) -> 'Cell': new = Cell(self.letter) new.player = self.player return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\n return LetterBag(self.string())", "def cell(self, cell_id):\r\n return Cell(self, cell_id)", "def duplicate(self):\n\n return Note(self.nbr, self.length, self.vel)", "def copy(self):\n copy = Node(self.ident)\n for k, v in self.iteritems():\n co...
[ "0.61563706", "0.6114937", "0.5972441", "0.58889097", "0.57910013", "0.57872075", "0.57801276", "0.57762635", "0.57762635", "0.57753825", "0.5744021", "0.5728885", "0.5711716", "0.56913495", "0.5685684", "0.5665279", "0.565089", "0.5631783", "0.56301385", "0.56258315", "0.562...
0.78191125
0
Return a new instance of Cell with the same attributes. >>> a = Line([Cell('A')]) >>> b = a.copy() >>> id(a) == id(b) False >>> print([str(cell) for cell in b.cells]) ['A']
def copy(self) -> 'Line': new = Line([cell.copy() for cell in self.cells], self.player) new.player_1, new.player_2 = self.player_1, self.player_2 return new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self) -> 'Cell':\n new = Cell(self.letter)\n new.player = self.player\n return new", "def clone_attributes():\n nr_rows = pcr.clone().nrRows()\n nr_cols = pcr.clone().nrCols()\n cell_size = pcr.clone().cellSize()\n ymax = pcr.clone().north()\n xmin = pcr.clone().west(...
[ "0.6768395", "0.6097601", "0.6081719", "0.59950304", "0.59660435", "0.5961257", "0.595623", "0.59531504", "0.59400535", "0.5890455", "0.58678234", "0.5853545", "0.58471256", "0.5840913", "0.5829538", "0.58224463", "0.58097684", "0.5809664", "0.5791435", "0.57812506", "0.57804...
0.68406516
0
Return a same instance of Grid with different id. >>> a = Grid(2) >>> b = a.copy() >>> id(a) == id(b) False >>> [str(cell) for cell in a.cells] == [str(cell) for cell in b.cells] True
def copy(self) -> 'Grid': return Grid(self.size, [cell.copy() for cell in self.cells], ([line.copy() for line in self.leylines], [line.copy() for line in self.rights], [line.copy() for line in self.lefts]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return other and self.cells == other.cells", "def copy_grid (grid):\r\n import copy\r\n g=copy.deepcopy(grid)\r\n return g", "def copy_grid (grid):\r\n return copy.deepcopy(grid)", "def __eq__(self, other):\n return (type(self) == type(other) and\n ...
[ "0.64407694", "0.6341651", "0.6276714", "0.6236487", "0.6236487", "0.6199839", "0.6120322", "0.60502535", "0.6038855", "0.6006501", "0.5871408", "0.5825499", "0.5761823", "0.57588655", "0.5668199", "0.5668199", "0.5647098", "0.5611203", "0.5602253", "0.5597585", "0.55952597",...
0.6013526
9
Return a list of Line which is the left diagonals based the stonehenge. >>> lefts = get_left([Cell(chr(65 + n)) for n in range(3)], 1) >>> len(lefts) == 2 True >>> print([str(cell) for cell in lefts[1].cells]) ['B', 'C']
def get_left(lst: 'list[Cell]', size: int) -> 'list[Line]': form = {1: [[0], [1, 2]], 2: [[0, 2], [1, 3, 5], [4, 6]], 3: [[0, 2, 5], [1, 3, 6, 9], [4, 7, 10], [8, 11]], 4: [[0, 2, 5, 9], [1, 3, 6, 10, 14], [4, 7, 11, 15], [8, 12, 16], [13, 17]], 5: [[0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def left(cell):\n return [cell[0], cell[1] - 1]", "def get_left_side(grid):\n right = int(grid.width / 2)\n left_side = Grid(\n grid=grid, crop=Crop(left=0, right=right, top=0, bottom=0))\n left_side.find_grid_lines()\n left_side.vert_insert_line(0, distance=-80)\n left_side.get_cells()\...
[ "0.6786309", "0.67843676", "0.64737177", "0.6331378", "0.6299486", "0.62647843", "0.6216665", "0.61981976", "0.61887383", "0.6186787", "0.61515015", "0.60650015", "0.598432", "0.596081", "0.59356296", "0.5920461", "0.59178734", "0.5908398", "0.59080833", "0.59080833", "0.5905...
0.6245129
6
Return a list of Line which is the right diagonals based the stonehenge. >>> rights = get_right([Cell(chr(65 + n)) for n in range(3)], 1) >>> len(rights) == 2 True >>> print([str(cell) for cell in rights[1].cells]) ['A', 'C']
def get_right(lst: 'list[Cell]', size: int) -> 'list[Line]': form = {1: [[1], [0, 2]], 2: [[1, 4], [0, 3, 6], [2, 5]], 3: [[1, 4, 8], [0, 3, 7, 11], [2, 6, 10], [5, 9]], 4: [[1, 4, 8, 13], [0, 3, 7, 12, 17], [2, 6, 11, 16], [5, 10, 15], [9, 14]], 5: [[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def right(cell):\n return [cell[0], cell[1] + 1]", "def get_rights(self):\n return [right.right_id for right in self.rights if right]", "def readRight():\n return readAll()[1]", "def makeLeftRightline(self):\r\n left_lines = []\r\n right_lines = []\r\n for i in self.lines:\r\n...
[ "0.65714717", "0.62094194", "0.5981008", "0.5865039", "0.5864151", "0.5860444", "0.5827388", "0.58205414", "0.57964957", "0.57919747", "0.5749657", "0.57482374", "0.57482374", "0.56747204", "0.5667295", "0.5646859", "0.5646859", "0.5618297", "0.5586302", "0.55718184", "0.5571...
0.5511775
22
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): unload_ok = all( await asyncio.gather( *[ hass.config_entries.async_forward_entry_unload(entry, component) for component in AUGUST_COMPONENTS ] ) ) if unload_ok: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_unload_entry(hass, config_entry):\n unload_ok = await hass.config_entries.async_forward_entry_unload(\n config_entry, \"climate\"\n )\n return unload_ok", "async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n hass.data.pop(DOMAIN)\n return True", ...
[ "0.697284", "0.6888074", "0.6779855", "0.6747459", "0.6689002", "0.6657831", "0.66162205", "0.6603433", "0.65925974", "0.65595686", "0.65411645", "0.6507643", "0.6507643", "0.6507643", "0.6507643", "0.64977276", "0.64931643", "0.6486601", "0.6486601", "0.6486601", "0.6486601"...
0.6462678
23
Given an enum, return a dataframe with two columns, name and value.
def enum_to_dataframe(enum_name): return pd.DataFrame.from_records( np.array( [(measure, enum_value.value) for (measure, enum_value) in enum_name.__members__.items()], dtype=np.dtype([("name", object), ("value", np.int)]), ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_python_enum_direct_values(cls, enum, name=None):\n if name is None:\n name = enum.__name__\n return cls(name, [EnumValue(v.name, python_value=v.value) for v in enum])", "def dataframe(self):\n dictionary = OrderedDict(zip(self.keys, [[value] for value in self.values]))\n ...
[ "0.5660742", "0.55261457", "0.54206884", "0.54070556", "0.5406625", "0.5352523", "0.5335492", "0.5324034", "0.52742356", "0.5272198", "0.52607363", "0.52437747", "0.51617503", "0.51515394", "0.51401687", "0.51266325", "0.5091603", "0.5078142", "0.50741684", "0.5070322", "0.50...
0.82074165
0
Set colormap (for monochromatic images).
def set_cmap(self, cmap: str | Colormap | matplotlib.colors.Colormap): if self._image is None: raise RuntimeError("You add data with `set_data` before setting cmaps") self._image.set_cmap(cmap) self._widget._mgui_set_value(self._image.make_image())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def SetColorMap(self, colormap, contrast=None, bias=None):\n extra = ''\n if contrast is not None:\n extra += '%f,' % contrast\n if bias is not None:\n extra += '%f,' % bias\n fmt = dict(wid=self.wid,cmap=colormap, extra=extra, suffix=self.suffix)\n command...
[ "0.70059067", "0.69095796", "0.68593085", "0.6816785", "0.6675867", "0.6612551", "0.65751547", "0.65690273", "0.6431593", "0.6402875", "0.62970173", "0.6289612", "0.62829554", "0.6260649", "0.62124497", "0.6172346", "0.6172346", "0.61711574", "0.6014789", "0.60009354", "0.600...
0.6667702
5
Evaluates average percent error for over predicted individuals
def average_precent_error_over(individual, test_data, truth_data, name=None, tolerance=0): test_data = np.array(test_data) truth_data = np.array(truth_data) over_predicted_inds = get_over_predicted_inds(test_data, truth_data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mape(actual: np.ndarray, predicted: np.ndarray):\n return np.mean(np.abs(_percentage_error(actual, predicted)))", "def average_percent_error(individual, test_data, truth_data, name=None):\r\n test_data = np.array(test_data)\r\n truth_data = np.array(truth_data)\r\n return np.mean(np.abs(test_data...
[ "0.75486356", "0.73946667", "0.72652286", "0.718417", "0.69294316", "0.6898711", "0.68819416", "0.6868935", "0.68609446", "0.67884284", "0.6768235", "0.6758164", "0.6751609", "0.67299175", "0.6719142", "0.6710507", "0.6710493", "0.6710493", "0.6682026", "0.6659593", "0.665236...
0.6998134
4
Evaluates average percent error for under predicted individuals
def average_precent_error_under(individual, test_data, truth_data, name=None, tolerance=0): test_data = np.array(test_data) truth_data = np.array(truth_data) under_predicted_inds = get_under_predicted_inds(test_data, truth_data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mape(actual: np.ndarray, predicted: np.ndarray):\n return np.mean(np.abs(_percentage_error(actual, predicted)))", "def average_percent_error(individual, test_data, truth_data, name=None):\r\n test_data = np.array(test_data)\r\n truth_data = np.array(truth_data)\r\n return np.mean(np.abs(test_data...
[ "0.7566921", "0.75460577", "0.7303385", "0.726689", "0.70931405", "0.6940705", "0.69137543", "0.6883851", "0.6853096", "0.68450326", "0.682422", "0.67653316", "0.6760597", "0.6727215", "0.6684963", "0.6684963", "0.6683921", "0.66749954", "0.66651565", "0.665493", "0.665493", ...
0.69269395
6
Evaluates max for over predicted individuals
def max_over_prediction_error(individual, test_data, truth_data, name=None, tolerance=0): test_data = np.array(test_data) truth_data = np.array(truth_data) over_predicted_inds = get_over_predicted_inds(test_data, truth_data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_max(self, x):\n y_ = self.predict(x)\n amax = torch.argmax(y_, dim=1).detach()\n t = torch.zeros_like(y_)\n t[torch.arange(y_.shape[0]),amax] = 1\n return t", "def max_error(y_true, y_pred):\n ...", "def predict(probs):\n # Your code here.\n return np.arg...
[ "0.7124452", "0.69448453", "0.67843825", "0.6632996", "0.6613955", "0.65622437", "0.6512489", "0.6471073", "0.64545184", "0.64211154", "0.6414526", "0.6405761", "0.63883746", "0.6387232", "0.63812006", "0.63793397", "0.6376786", "0.6369751", "0.63619035", "0.6354792", "0.6349...
0.6890217
2
Evaluates max for under predicted individuals
def max_under_prediction_error(individual, test_data, truth_data, name=None, tolerance=0): test_data = np.array(test_data) truth_data = np.array(truth_data) under_predicted_inds = get_under_predicted_inds(test_data, truth_data, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def predict_max(self, x):\n y_ = self.predict(x)\n amax = torch.argmax(y_, dim=1).detach()\n t = torch.zeros_like(y_)\n t[torch.arange(y_.shape[0]),amax] = 1\n return t", "def max_error(y_true, y_pred):\n ...", "def max_over_prediction_error(individual, test_data, truth_da...
[ "0.69903034", "0.6911366", "0.69065946", "0.6608711", "0.6575841", "0.65679246", "0.6518311", "0.6497897", "0.64932525", "0.64824593", "0.64532256", "0.64382553", "0.64258474", "0.6414306", "0.64091843", "0.640406", "0.6393506", "0.6360341", "0.6359452", "0.6350099", "0.63365...
0.67016524
3
Calculates the partition distance D(p1, p2), defined as the minimum number of elements that need to be removed from both partitions to make them identical. p1 and p2 should both be a list of lists that form a partition of the numbers {0,...,n 1}. Uses a O(n^3) reduction to a weighted assignment problem by Konovalov, Li...
def _partition_distance(p1, p2, n): m = max(len(p1), len(p2)) p1_str = np.zeros((m, n), dtype=int) for i, x in enumerate(p1): for v in x: p1_str[i][v] = 1 p2_str = np.ones((m, n), dtype=int) for i, x in enumerate(p2): for v in x: p2_str[i][v] = 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _fast_partition_distance(p1_list, p2_list, n):\r\n p1 = {}\r\n for i, box in enumerate(p1_list):\r\n for x in box:\r\n p1[x] = i\r\n p2 = {}\r\n for i, box in enumerate(p2_list):\r\n for x in box:\r\n p2[x] = i\r\n\r\n k = max(len(p1_list), len(p2_list))\r\n ...
[ "0.7254426", "0.62536913", "0.6155785", "0.61091316", "0.608447", "0.6032061", "0.59696275", "0.5932342", "0.59208214", "0.589474", "0.58857083", "0.5875409", "0.5826995", "0.58087784", "0.5765418", "0.57609", "0.5750561", "0.57495695", "0.57424295", "0.57396275", "0.57304263...
0.725696
0
Calculates the partition distance D(p1, p2), defined as the minimum number of elements that need to be removed from both partitions to make them identical. p1 and p2 should both be a list of lists that form a partition of the numbers {0,...,n 1}. This method will fail and return 'None' if D(p1,p2) >= n / 5. Uses an O(n...
def _fast_partition_distance(p1_list, p2_list, n): p1 = {} for i, box in enumerate(p1_list): for x in box: p1[x] = i p2 = {} for i, box in enumerate(p2_list): for x in box: p2[x] = i k = max(len(p1_list), len(p2_list)) similarity = 0 t = n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _partition_distance(p1, p2, n):\r\n m = max(len(p1), len(p2))\r\n p1_str = np.zeros((m, n), dtype=int)\r\n for i, x in enumerate(p1):\r\n for v in x:\r\n p1_str[i][v] = 1\r\n p2_str = np.ones((m, n), dtype=int)\r\n for i, x in enumerate(p2):\r\n for v in x:\r\n ...
[ "0.6638054", "0.5932833", "0.5914954", "0.5753824", "0.56906813", "0.5622601", "0.5613339", "0.5598948", "0.5547656", "0.5530163", "0.5526427", "0.5416784", "0.54054135", "0.54045314", "0.53254265", "0.5286459", "0.52767134", "0.52743787", "0.5269199", "0.52592254", "0.524722...
0.72877955
0
This method returns the module's own network node.
def returnNetworkNode(self): networkNodes = cmds.ls(type="network") for node in networkNodes: attrs = cmds.listAttr(node) if "moduleName" in attrs: if cmds.getAttr(node + ".moduleName") == self.name: networkNode = node return networkN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def returnRigNetworkNode(self):\n modules = []\n networkNodes = cmds.ls(type=\"network\")\n for node in networkNodes:\n attrs = cmds.listAttr(node)\n if \"moduleName\" in attrs:\n if cmds.getAttr(node + \".moduleName\") == self.name:\n ch...
[ "0.78165567", "0.7207643", "0.71700513", "0.71700513", "0.7167058", "0.7131976", "0.71034634", "0.7072098", "0.7026839", "0.7026839", "0.7026839", "0.69613045", "0.6882923", "0.6863912", "0.6863912", "0.68585974", "0.67506695", "0.6632675", "0.6622759", "0.6579087", "0.656046...
0.8388252
0
Rounds number to the nearest integer.
def _nint(x): return int(x + 0.5)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nearest_int(num):\n return int(np.round(num))", "def round_int(num):\n try:\n float(num)\n except TypeError:\n _logger.debug(\"error trying to convert %s to number\" % (str(num)))\n raise pythonerror(\"#syntaxerror\")\n\n if int(float(num)) == num:\n return int(num)\n ...
[ "0.79366326", "0.74619067", "0.72749174", "0.7248814", "0.7067303", "0.70551044", "0.7014115", "0.69925255", "0.6983699", "0.69287765", "0.6881461", "0.68711185", "0.6820282", "0.68105257", "0.67890584", "0.6706344", "0.6690734", "0.66788393", "0.6653125", "0.6627784", "0.661...
0.0
-1
Compute the sum of the inputs.
def execute(self): self.z = self.x + self.y
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summation(self):\n return sum(self.read_ints())", "def sum(*args):\n result = 0\n for i in args:\n result += i\n return result", "def weighted_sum(self, inputs):\r\n weighted_sum = 0\r\n for i in range(self.num_inputs):\r\n weighted_sum += self.weights[i]*inputs[i]\r\n ...
[ "0.7754525", "0.74256814", "0.73749906", "0.7057957", "0.7049035", "0.6941135", "0.69284177", "0.68768907", "0.6872614", "0.6869534", "0.6834482", "0.6832964", "0.6832964", "0.68100387", "0.6809839", "0.68075645", "0.6790888", "0.6756199", "0.67465377", "0.67443043", "0.67188...
0.0
-1
Compute the sum of the inputs.
def execute(self): self.W = self.X+self.y+self.a self.Z = 2*self.W
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summation(self):\n return sum(self.read_ints())", "def sum(*args):\n result = 0\n for i in args:\n result += i\n return result", "def weighted_sum(self, inputs):\r\n weighted_sum = 0\r\n for i in range(self.num_inputs):\r\n weighted_sum += self.weights[i]*inputs[i]\r\n ...
[ "0.7754525", "0.74256814", "0.73749906", "0.7057957", "0.7049035", "0.6941135", "0.69284177", "0.68768907", "0.6872614", "0.6869534", "0.6834482", "0.6832964", "0.6832964", "0.68100387", "0.6809839", "0.68075645", "0.6790888", "0.6756199", "0.67465377", "0.67443043", "0.67188...
0.0
-1
Saves a photo to a user's or community's wall after being uploaded.
def saveWallPhoto(user_id=None, group_id=None, photo=None, server=None,\ hash=None, latitude=None, longitude=None, caption=None): params = { 'user_id': user_id, 'group_id': group_id, 'photo': photo, 'server': server, 'hash': hash, 'latitude': latitud...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _upload_photo(self, user, file_path):\n data = {\n \"full_name\": user.userprofile.full_name,\n \"email\": user.email,\n \"username\": user.username,\n \"lat\": 40.005814,\n \"lng\": -3.42071,\n \"photo\": open(file_path, \"rb\"),\n ...
[ "0.6691851", "0.66714734", "0.6657227", "0.664488", "0.66232306", "0.6553479", "0.64751536", "0.63393843", "0.6316229", "0.62722427", "0.6258768", "0.6209177", "0.6115361", "0.6098984", "0.608613", "0.60363287", "0.60361356", "0.60160226", "0.60141677", "0.601393", "0.6005376...
0.65076274
6
Perform a forward pass of our model on input features, x.
def forward(self, b): #convolutions b= self.bn1(self.pool(self.relu(self.conv1(b)))) b= self.bn2(self.pool(self.relu(self.conv2(b)))) b= self.bn3(self.pool(self.relu(self.conv3(b)))) b= self.bn4(self.pool(self.relu(self.conv4(b)))) #linear b= self.Drop(se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, x):\n x = self.features(x)\n return x", "def feature_forward(self, x):\n raise NotImplementedError", "def forward(self, x):\n #batch_size = x.shape[0]\n out = self.model(x)\n return out", "def forward(self, x, feature_matching=False):\n x = s...
[ "0.8279811", "0.8214417", "0.7877279", "0.7809351", "0.7705823", "0.7688306", "0.76772267", "0.761201", "0.761201", "0.758622", "0.7571312", "0.752987", "0.75200623", "0.7484059", "0.7471597", "0.74682146", "0.7461123", "0.7458709", "0.74435884", "0.7443158", "0.74236834", ...
0.0
-1
Get a list of all inputs of the producer in a given scope
def get_inputs(self, scope: str) -> List[q.Quantity]: if scope not in self.scopes: log.error( "Exception ({}): Tried to get producer inputs in scope {}, which the producer is not forseen for!".format( self.name, scope ) ) ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_inputs(self, scope: str) -> List[q.Quantity]:\n\n inputs: List[q.Quantity] = []\n log.debug(\"Getting inputs for {}\".format(self.name))\n for subproducer in self.producers[scope]:\n log.debug(\" --> {} {}\".format(subproducer, subproducer.get_inputs(scope)))\n i...
[ "0.82990825", "0.6661555", "0.6370058", "0.6351597", "0.6075594", "0.6062941", "0.60619545", "0.60619545", "0.60619545", "0.60299706", "0.59745383", "0.59584606", "0.5941066", "0.5852978", "0.58086884", "0.57177585", "0.56546843", "0.56417155", "0.5637529", "0.5637529", "0.56...
0.82905424
1
Get a list of all outputs of the producer in a given scope
def get_outputs(self, scope: str) -> List[Union[q.QuantityGroup, q.Quantity]]: if scope not in self.scopes: log.error( "Exception ({}): Tried to get producer outputs in scope {}, which the producer is not forseen for!".format( self.name, scope ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_outputs(self, scope: str) -> List[q.Quantity]:\n outputs: List[q.Quantity] = []\n log.debug(\"Getting outputs for {}\".format(self.name))\n for subproducer in self.producers[scope]:\n log.debug(\" --> {} {}\".format(subproducer, subproducer.get_outputs(scope)))\n ...
[ "0.8431583", "0.6664911", "0.66004825", "0.6527819", "0.63512105", "0.61714524", "0.61436665", "0.6094725", "0.6079146", "0.60225374", "0.5965047", "0.5960283", "0.5826755", "0.582528", "0.57493204", "0.5706125", "0.56916547", "0.5677921", "0.5677921", "0.567245", "0.56255406...
0.7958608
1
It returns the symbol_names_list of the symbols which have the given open and close market hours
def get_currencies_with_market_hours(self, open_time = dt.time(0), close_time = dt.time(0)): new_symbol_names_list = [] for symbol_name in self.symbol_names_list: if self[symbol_name].market_hours.open_time != open_time: continue if self[symbol_name].market_hours.close_time != close_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restaurant_opening(H):\n\n if len(H) == 0:\n return [False,False,False]\n\n # opening hours that only state that the shop open leads to unreliable\n # results. This is because the shop never close ! so will be available\n # all the time.\n if all_open(H):\n return [False,False,Fals...
[ "0.57028687", "0.5633411", "0.5617733", "0.55905217", "0.5589117", "0.5587296", "0.5560764", "0.55591494", "0.5550565", "0.5544235", "0.5495295", "0.5445115", "0.54289323", "0.5423907", "0.5365381", "0.53633267", "0.5353565", "0.5351775", "0.53409135", "0.5340421", "0.531163"...
0.8312041
0
Return the default language code. Defaults to en.
def default_language(self) -> str: return self.raw_config.get("default_language", "en")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_language(self):\n return self._default_language", "def get_default_language():\n utility = queryUtility(ILanguageAvailability)\n if utility is not None:\n return utility.getDefaultLanguage()\n return DEFAULT_LANGUAGE", "def Language(self, default=None):\n return se...
[ "0.82115066", "0.80095005", "0.7959154", "0.7921062", "0.79097897", "0.78600115", "0.7807772", "0.775651", "0.7677528", "0.76339364", "0.75720614", "0.7552804", "0.75194055", "0.7460115", "0.7460115", "0.74262625", "0.74150664", "0.737679", "0.73078924", "0.7290816", "0.72578...
0.83896095
0
Return the path to the base folder and the path to the file if it is present in the project.
def check_recursive(base_folders, name): for base_folder in base_folders: for root, dirs, files in os.walk(base_folder): for f in files: if f == name: return osp.dirname(base_folder), root
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_path(self, project_file=None):\n root = os.path.abspath(\n os.path.join(os.path.dirname(__file__), '..', '..')\n )\n if project_file:\n return os.path.join(root, project_file)\n else:\n return root", "def base_path(self):\n return se...
[ "0.79819936", "0.7531974", "0.7505157", "0.7459383", "0.739099", "0.739099", "0.739099", "0.739099", "0.7381139", "0.734673", "0.7309945", "0.7293235", "0.7278318", "0.7263347", "0.7226858", "0.7226858", "0.7150987", "0.71329087", "0.7117191", "0.7064365", "0.70495707", "0....
0.0
-1
Initialize with the specified model
def __init__(self, model, screen):#background self.model = model # The model is a model. self.screen = screen #The display is equal to the function that define's it's results #self.background = background
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(self, model):\n pass", "def initialize_model(self):\n pass", "def __init__(self, model):\n self._model = model", "def init_model(self):\n pass", "def __init__(self, model: Model1D):\n self._model = model", "def __init__(self, model: object):\n self...
[ "0.85981053", "0.8434976", "0.8364906", "0.83220744", "0.8145514", "0.8127357", "0.81113595", "0.81113595", "0.81113595", "0.81113595", "0.81063175", "0.80195975", "0.7868972", "0.78505844", "0.7850389", "0.78146195", "0.78146195", "0.768763", "0.768763", "0.768763", "0.76876...
0.0
-1
Normalize the vector Y using statistics or its range.
def normalize(Y, normalization_type='stats'): Y = np.asarray(Y, dtype=float) if np.max(Y.shape) != Y.size: raise NotImplementedError('Only 1-dimensional arrays are supported.') # Only normalize with non null sdev (divide by zero). For only one # data point both std and ptp return 0. if nor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def normalize_y(y: np.ndarray) -> np.ndarray:\n #print(\"enter bartpy/bartpy/data.py Target normalize_y\")\n \n y_min, y_max = np.min(y), np.max(y)\n output = -0.5 + ((y - y_min) / (y_max - y_min))\n #print(\"-exit bartpy/bartpy/data.py Target normalize_y\")\n return outpu...
[ "0.7810608", "0.7253668", "0.7206295", "0.7157307", "0.6976601", "0.6854291", "0.6724226", "0.6667159", "0.66492325", "0.66268504", "0.6592118", "0.65881664", "0.6514715", "0.6514715", "0.6465964", "0.6457481", "0.6432297", "0.64265746", "0.6416109", "0.637844", "0.63537437",...
0.7215334
2
Set up test data.
def setUp(self): super().setUp() self.data_model = json.loads(DATA_MODEL_JSON) self.set_source_parameter("reports", ["r1", "r3"]) self.expected_software_metrics = str(2 * len(self.data_model["subjects"]["software"]["metrics"])) self.reports["reports"].append( { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n\n self.test_data_path = 'testing/test_data/'", "def setUp(self):\n self.dataset = get_test_dataset()", "def setUpTestData(cls):\n # volunteer user\n common.initialize_empty_volunteer()", "def setUpTestData(cls):\n data_gen.run()", "def setUpTestData(cls...
[ "0.83564", "0.825977", "0.82419825", "0.8071621", "0.8071621", "0.8071621", "0.8071621", "0.7874065", "0.7855246", "0.783438", "0.7805763", "0.77781427", "0.7761605", "0.77067", "0.7682978", "0.76799023", "0.7657977", "0.76328367", "0.76242405", "0.7600356", "0.7600356", "0...
0.0
-1
Test that the number of missing metrics is returned.
async def test_nr_of_metrics(self): response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports]) self.assert_measurement( response, value=str(len(self.entities)), total=self.expected_software_metrics, entities=self.entities, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_nr_of_missing_metrics_without_correct_report(self):\n self.reports[\"reports\"] = []\n response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports])\n self.assert_measurement(response, parse_error=\"No reports found with title or id\")", "async de...
[ "0.7734706", "0.7599532", "0.73082376", "0.70799184", "0.6976542", "0.6914146", "0.67443275", "0.6726959", "0.6638029", "0.6601721", "0.6483042", "0.6462166", "0.6460852", "0.6419965", "0.6398734", "0.6383657", "0.63395655", "0.6333498", "0.63311756", "0.6328884", "0.63281685...
0.6491171
10
Test that an error is thrown for reports that don't exist.
async def test_nr_of_missing_metrics_without_correct_report(self): self.reports["reports"] = [] response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports]) self.assert_measurement(response, parse_error="No reports found with title or id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_nonexistent_report(self):\n command_line = [\"report\", \"notreport\"]\n for prefix in [[], [\"--propagate\"]]:\n self.check_system_exit(prefix + command_line, _PARSE_ERROR)", "def not_existing_error_test(self):\n client = TestClient()\n error = client.run(\"upload...
[ "0.7356565", "0.726487", "0.7098008", "0.7016869", "0.6849468", "0.68316066", "0.6801525", "0.6772856", "0.6755956", "0.6740113", "0.672614", "0.67211014", "0.67134166", "0.67126507", "0.67002004", "0.66914654", "0.66914654", "0.6654457", "0.66468126", "0.66405565", "0.662437...
0.0
-1
Test that the number of nonignored missing metrics is returned when filtered by name.
async def test_subjects_to_ignore_by_name(self): self.set_source_parameter("subjects_to_ignore", ["S2"]) response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports]) self.assert_measurement(response, value=str(int(len(self.entities) / 2)), total=self.expected_softw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_nr_of_missing_metrics_without_correct_report(self):\n self.reports[\"reports\"] = []\n response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports])\n self.assert_measurement(response, parse_error=\"No reports found with title or id\")", "async de...
[ "0.6608841", "0.6546221", "0.6193846", "0.6004651", "0.58711916", "0.58686864", "0.58641356", "0.58052564", "0.5754462", "0.5704622", "0.5686363", "0.5637719", "0.5612656", "0.55562454", "0.5533124", "0.55265105", "0.551701", "0.5516939", "0.5516706", "0.5494192", "0.5463256"...
0.49655575
100
Test that the number of nonignored missing metrics is returned when filtered by uuid.
async def test_subjects_to_ignore_by_uuid(self): first_subject_uuid = first(first(self.reports["reports"])["subjects"].keys()) self.set_source_parameter("subjects_to_ignore", [first_subject_uuid]) response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def test_nr_of_missing_metrics_without_correct_report(self):\n self.reports[\"reports\"] = []\n response = await self.collect(get_request_json_side_effect=[self.data_model, self.reports])\n self.assert_measurement(response, parse_error=\"No reports found with title or id\")", "async de...
[ "0.6714317", "0.6382836", "0.61007744", "0.60346186", "0.583845", "0.5675717", "0.5670212", "0.5667965", "0.56605554", "0.5624069", "0.5600745", "0.5474964", "0.54733664", "0.5469481", "0.5468869", "0.54665935", "0.5451774", "0.5446684", "0.5445941", "0.54322165", "0.5424044"...
0.53281623
36
Test initializing when we do not know the snapshot size. ScaleIO can determine QOS specs based upon volume/snapshot size The QOS keys should always be returned
def test_initialize_connection_without_size(self): snapshot = fake_snapshot.fake_snapshot_obj( self.ctx, **{'volume': self.volume, 'provider_id': self.snapshot_id}) props = self.driver.initialize_connection_snapshot( snapshot, self.connector) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_initialize_connection_with_size(self):\n snapshot = fake_snapshot.fake_snapshot_obj(\n self.ctx, **{'volume': self.volume,\n 'provider_id': self.snapshot_id,\n 'volume_size': 8})\n props = self.driver.initialize_connection_snapshot(\...
[ "0.71484876", "0.7009603", "0.6199546", "0.60999423", "0.6062521", "0.60107756", "0.59381145", "0.57299346", "0.5695891", "0.5653351", "0.56195366", "0.56171346", "0.56138045", "0.5533228", "0.55248827", "0.5520907", "0.5513801", "0.55031806", "0.54938114", "0.5486595", "0.54...
0.6927684
2
Returns the colour of this player's discs.
def get_colour(self) -> str: return self.colour
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_player_disc_colour(self, name):\n player_number = self.game[\"players\"].index(name)\n return self.player_discs[player_number]", "def get_colour(self):\n return self.colour", "def player(self):\n return self._color", "def getColor(self):\n return self.side_color", ...
[ "0.8161153", "0.73895526", "0.72005326", "0.707352", "0.70195776", "0.7014966", "0.6992764", "0.6982498", "0.69815385", "0.69622463", "0.69305474", "0.692226", "0.692226", "0.6916819", "0.69026923", "0.68901616", "0.6877559", "0.68773437", "0.68667895", "0.6866367", "0.686636...
0.71942914
3
Create a schedule with a learning rate that decreases linearly after linearly increasing during a warmup period.
def get_linear_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, last_epoch=-1): def lr_lambda(current_step): if current_step < num_warmup_steps: return float(current_step) / float(max(1, num_warmup_steps)) return max(0.0, float(num_training_steps - current_step) / fl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self,\n lr_schedule: tf.keras.optimizers.schedules.LearningRateSchedule,\n warmup_steps: int,\n **kwargs):\n super(WarmupDecaySchedule, self).__init__()\n self._lr_schedule = lr_schedule\n self._warmup_steps = warmup_steps", "def create_learning_rate_scheduler(\n b...
[ "0.736419", "0.71512073", "0.7127365", "0.70137024", "0.6910342", "0.6903351", "0.67739385", "0.6772756", "0.67273", "0.67093444", "0.6709243", "0.6684552", "0.6680678", "0.6667233", "0.6665098", "0.6650667", "0.6641452", "0.6635425", "0.65719223", "0.6548739", "0.6516521", ...
0.6744681
8
Return the vcs type.
def get_type(self) -> str: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servicetype(self):\n return self._svctype", "def get_type(self):\n\t\treturn call_sdk_function('PrlVmDev_GetType', self.handle)", "def get_type (self):\n return self._stype", "def vehicle_type():\n pass", "def get_type(self):\n return \"TDS2024C\"", "def get_type(self):\n ...
[ "0.68704975", "0.6852127", "0.67800385", "0.67501783", "0.66962165", "0.6632025", "0.6571089", "0.6558308", "0.6530868", "0.65283537", "0.6492114", "0.64838123", "0.64794666", "0.64794666", "0.64794666", "0.64794666", "0.64794666", "0.64794666", "0.64794666", "0.64794666", "0...
0.0
-1
The repository id that uniquely identifies it
def get_repository_id(self) -> str: raise NotImplementedError
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def git_hub_internal_id(self) -> str:\n return pulumi.get(self, \"git_hub_internal_id\")", "def repo_hash(self):\n return self._repo_hash", "def unique_id(self) -> str:\n return pulumi.get(self, \"unique_id\")", "def unique_identifier(self) -> str:\n return pulumi.get(self, \"uniq...
[ "0.69664395", "0.6843681", "0.66932374", "0.6604447", "0.65407324", "0.65407324", "0.65407324", "0.6525081", "0.6525081", "0.6515064", "0.6510921", "0.64741904", "0.6470613", "0.6470613", "0.6470613", "0.6470613", "0.6470613", "0.6470613", "0.6470613", "0.6470613", "0.646603"...
0.85390455
0
Return remote origin url of git repository. Not all repositories have to have remote origin defined. In such case return None.
def get_repository_uri(self) -> str: try: url = subprocess.check_output( ['git', 'config', '--get', 'remote.origin.url'] ).decode('utf-8').strip() return self.norm_uri(url) except subprocess.CalledProcessError as error: # no remote origin d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remote_origin_url(self):\n if self._remote_origin_url:\n return self._remote_origin_url\n\n topleveldata = self.git(\"config\", \"--get\", \"remote.origin.url\")\n self._remote_origin_url = topleveldata[0]\n return self._remote_origin_url", "def origin(self):\n f...
[ "0.829772", "0.7418236", "0.7416508", "0.7264268", "0.7151653", "0.70446867", "0.70420146", "0.69067305", "0.6851595", "0.66004866", "0.64805514", "0.646915", "0.6444972", "0.6394446", "0.6368931", "0.6316557", "0.6293101", "0.62224215", "0.6189845", "0.6129155", "0.60927486"...
0.86246073
0
Add a point of a line segment
def add_segment(self, xpos, ypos): self.def_field['XY_poly'].append([xpos, ypos]) self.def_field['count'] += 1
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def line_to(self, point: Onion[Tuple[float, float], Point2D, Point3D, Point]):\n start_point = self.last_point\n end_point = _point_2d(point)\n self._segments.append(Line3D.create(start_point, end_point))", "def AddLineToPoint(*args):\n return _gdi_.GraphicsPath_AddLineToPoint(*args)"...
[ "0.7739869", "0.7330899", "0.7207136", "0.69768894", "0.696816", "0.6966804", "0.6908191", "0.6820248", "0.67930496", "0.6789007", "0.67782134", "0.6741789", "0.6721932", "0.67196286", "0.6718443", "0.6696807", "0.6693805", "0.66771007", "0.66646767", "0.6664246", "0.6655872"...
0.6955783
6
Tokenizes input query into subtokens and creates subtokens mask. Subtokens mask is an array of the same length as subtokens array and contains zeros and ones in which. If element of mask equals 1, then corresponding subtoken in subtokens array is first subtoken in some word
def _get_subtokens_and_subtokens_mask(query: str, tokenizer: TokenizerSpec) -> Tuple[List[str], List[bool]]: words = query.strip().split() subtokens = [] subtokens_mask = [] for j, word in enumerate(words): word_tokens = tokenizer.text_to_tokens(word) subtokens.extend(word_tokens) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cn_whole_word_mask(input_tokens, ref_ids):\n\n for i in range(len(input_tokens)):\n if i in ref_ids:\n # We move it back by -1 as the ref_ids start at 1, not 0\n input_tokens[i-1] = \"##\" + input_tokens[i-1]\n\n input_tokens = _whole_word_mask(input_tokens)\n\n return inp...
[ "0.58442795", "0.58316994", "0.57017535", "0.5678794", "0.54905945", "0.54370326", "0.5415873", "0.5389693", "0.53139204", "0.5277715", "0.5224822", "0.51846874", "0.5175068", "0.5170389", "0.51338667", "0.5112509", "0.51101583", "0.51063246", "0.51022494", "0.5102237", "0.50...
0.76671034
0
Collates samples into batches.
def collate_fn( self, batch: List[ Tuple[ np.ndarray, np.ndarray, np.ndarray, np.ndarray, int, int, bool, bool, Optional[np.ndarray], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _collate(cls, inbatch, num_devices=None):\n item0 = inbatch[0]\n bsize = len(inbatch)\n if num_devices is None:\n num_devices = 1\n\n samples_per_device = int(np.ceil(bsize / num_devices))\n\n # assert bsize % samples_per_device == 0\n stacked = []\n ...
[ "0.69432867", "0.64297503", "0.63914144", "0.63754904", "0.63682985", "0.63137096", "0.6305106", "0.62924445", "0.6285576", "0.61951643", "0.6148047", "0.61428034", "0.61381173", "0.61337966", "0.6124971", "0.6099794", "0.60826015", "0.6047649", "0.6046589", "0.6045746", "0.6...
0.0
-1
Returns batch used for punctuation and capitalization inference.
def __getitem__( self, idx: int ) -> Union[ Tuple[ndarray, ndarray, ndarray, ndarray, int, int, bool, bool], Tuple[ndarray, ndarray, ndarray, ndarray, int, int, bool, bool, ndarray, List[int]], ]: if not self.use_audio: return ( np.array(self.all_input...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def postprocessing(batch, vocab):\n\n return batch", "def prepare_batch_for_pt_captioning(pretrain_done, action_refinement, batch):\r\n\r\n # select all relevant features from the batch dictionary\r\n image_ind = batch[\"image_indicators\"]\r\n boxes_features = batch[\"boxes_features\"]\r\n boxes ...
[ "0.660769", "0.6230998", "0.60983473", "0.6074984", "0.60664105", "0.6018594", "0.59883904", "0.5978126", "0.5976838", "0.5976089", "0.59567976", "0.58349305", "0.5794789", "0.57840616", "0.5768128", "0.5731337", "0.5719194", "0.57108945", "0.5695814", "0.56747746", "0.566969...
0.0
-1
Apply ``func`` to slices from ``x`` taken along ``axes``. ``args`` and ``kwargs`` are passed as additional arguments. Notes ``func`` must return an array of the same shape as it received.
def apply_along_axes(func: Callable, x: np.ndarray, axis: AxesLike, *args, **kwargs): axis = check_axes(axis) if len(axis) == x.ndim: return func(x) other_axes = negate_indices(axis, x.ndim) begin = np.arange(len(other_axes)) y = np.moveaxis(x, other_axes, begin) result = np.stack([fun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _np_apply_along_axis(func1d, axis: int, arr: np.ndarray) -> np.ndarray:\n\n assert arr.ndim == 2\n assert axis in [0, 1]\n\n if axis == 0:\n result = np.empty(arr.shape[1])\n for i in range(len(result)):\n result[i] = func1d(arr[:, i])\n return result\n\n result = np...
[ "0.63636446", "0.61863154", "0.59292614", "0.5825597", "0.5672151", "0.5624377", "0.55813485", "0.55362743", "0.551828", "0.53555554", "0.5339846", "0.53037703", "0.5293155", "0.52694935", "0.5257027", "0.5247527", "0.52318406", "0.5217438", "0.5213561", "0.5210173", "0.51987...
0.76892954
0
Checks the i (index) against the len(data) to determine if there is no data.
def TestWay2(index): data_len = len(data) if index < -data_len or index > data_len - 1: return None return data[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkIfThereIsData(self, i):\n _, amountOfThings = self.weaviate.Get(\"/\" + i)\n if len(amountOfThings[i]) == 0:\n return False\n else:\n return True", "def empty(self):\n return 0 >= len(self.__data)", "def is_empty(self):\n return len(self.data) == 0"...
[ "0.766388", "0.6940311", "0.6758142", "0.66856706", "0.6639823", "0.6639823", "0.6639823", "0.6639823", "0.6639823", "0.6639823", "0.6639823", "0.6608357", "0.65333563", "0.65018487", "0.64885414", "0.64713067", "0.64207697", "0.6354752", "0.6353594", "0.626497", "0.62578946"...
0.0
-1
Reads one csv file or multiple csv files, and returns it in a pandas dataframe.
def read_csv(self, bucket, key, with_prefix=False, file_extension=None, **kwargs): if with_prefix: files = self.get_prefix_object(bucket=bucket, key=key, file_extension=file_extension) df = pd.concat([p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _read_csv(self) -> pd.DataFrame:\n\n return pd.concat(\n [\n pd.read_csv(f, usecols=[1, 2, 3, 4, 5])\n for f in self.temp_path.iterdir()\n if f.name.endswith(\".csv\")\n ]\n )", "def _parse_csv(csv_file: str) -> pd.DataFrame:\n ...
[ "0.7870702", "0.7476285", "0.7370839", "0.7370839", "0.7370839", "0.72966295", "0.7232605", "0.7149209", "0.7104323", "0.70851994", "0.70777065", "0.70455706", "0.7036612", "0.70045847", "0.69892037", "0.6983357", "0.6956484", "0.69555676", "0.693784", "0.68800646", "0.687505...
0.0
-1
Given a user's query, string construct a list of filters that can be then used to construct the conditions of the Query
def parse_query(self, query: Optional[str]) -> event_filter.ParsedTerms: if query is None: return [] try: parsed_terms = event_search.parse_search_query( query, params=self.filter_params, builder=self, config_overri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_filter_builder(cls, user_attribute: str, value: Any) -> List[Q]:\n attributes = re.compile(r\"Or|And|OR|AND\").split(user_attribute)\n query_builder = []\n for attr in attributes:\n attr = attr.strip().lower()\n cond = {f\"{attr}__icontains\": value}\n ...
[ "0.69267255", "0.6548786", "0.6400207", "0.6373028", "0.6291095", "0.62561405", "0.61860025", "0.61729825", "0.61014223", "0.60604036", "0.5956155", "0.5954664", "0.5933913", "0.5912835", "0.5912238", "0.590824", "0.59073645", "0.5896475", "0.5889046", "0.58543783", "0.582964...
0.0
-1
Transform X using onehot encoding.
def transform(self, X): X = check_array(X, accept_sparse='csc', dtype=np.object, copy=True) n_samples, n_features = X.shape X_int = np.zeros_like(X, dtype=np.int) X_mask = np.ones_like(X, dtype=np.bool) for i in range(n_features): valid_mask = np.in1d(X[:, i], self.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def one_hot_encode(x):\n # TODO: Implement Function\n lb = preprocessing.LabelBinarizer()\n lb.fit([0,1,2,3,4,5,6,7,8,9])\n \n return lb.transform(x)", "def one_hot_encode(x):\n # TODO: Implement Function\n output = np.zeros((len(x), 10))\n \n for i, j in enumerate(x):\n output[...
[ "0.8219971", "0.81998163", "0.8187003", "0.80171347", "0.80086917", "0.7953275", "0.7925757", "0.7909148", "0.7731275", "0.764463", "0.76382214", "0.7606447", "0.75770795", "0.7576713", "0.7539266", "0.75064456", "0.75040966", "0.74916536", "0.7488146", "0.7440699", "0.742351...
0.0
-1
Causes the Robot to rotate left as fast as possible Sets motors to turn opposite directions at speed. 0 <= speed <= 100
def spin_left(self, speed): self.controller.spin_left(speed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_left(self, speed):\n\t\t# You should modify the bias of 4 wheels depending on your hardware.\n\t\tself._front_left_wheel.anticlockwise_rotate(1 + LEFT_FR_BIAS + LEFT_RIGHT_BIAS)\n\t\tself._front_right_wheel.clockwise_rotate(speed + RIGHT_FR_BIAS)\n\t\tself._rear_left_wheel.anticlockwise_rotate(1 + LEFT_RI...
[ "0.7852638", "0.775161", "0.7616733", "0.74549854", "0.7347454", "0.729353", "0.7257087", "0.72477174", "0.71772", "0.71772", "0.7156757", "0.7118537", "0.7016818", "0.700651", "0.6969179", "0.69533086", "0.6908149", "0.68894994", "0.68837357", "0.68516517", "0.685044", "0....
0.7308434
5
Causes the Robot to rotate right as fast as possible Sets motors to turn opposite directions at speed. 0 <= speed <= 100
def spin_right(self, speed): self.controller.spin_right(speed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def turn_right(self, speed):\n\t\t# You should modify the bias of 4 wheels depending on your hardware.\n\t\tself._front_left_wheel.anticlockwise_rotate(speed + LEFT_FR_BIAS + LEFT_RIGHT_BIAS)\n\t\tself._front_right_wheel.clockwise_rotate(1 + RIGHT_FR_BIAS)\n\t\tself._rear_left_wheel.anticlockwise_rotate(speed + LE...
[ "0.77521026", "0.7624899", "0.757172", "0.75193125", "0.7355572", "0.7306608", "0.7278012", "0.72635686", "0.723436", "0.72260785", "0.72260785", "0.72000396", "0.71812797", "0.7167445", "0.70598495", "0.7046352", "0.7002322", "0.70012605", "0.69798976", "0.6939555", "0.69050...
0.74574333
4
Causes the Robot to move directly to the left speed. 0 <= speed <= 100
def left(self, speed): self.controller.front_left_backward(speed) self.controller.front_right_forward(speed) self.controller.rear_left_forward(speed) self.controller.rear_left_backward(speed)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_left(self):\r\n if self.rect.left > 0:\r\n self.rect.left -= self.speed", "def left(self, speed=1):\n self.right_motor.forward(speed)\n self.left_motor.backward(speed)", "def spin_left(self, speed):\n self.controller.spin_left(speed)", "def left(self, speed):\n...
[ "0.78595287", "0.78474736", "0.78360087", "0.78021526", "0.77072096", "0.76930106", "0.7658996", "0.76363075", "0.7622385", "0.7589879", "0.756563", "0.74705434", "0.74255705", "0.742491", "0.74021155", "0.7364568", "0.7342305", "0.7342305", "0.7340583", "0.72892517", "0.7276...
0.7748129
4
(Re)Initializes the weight column of a RBF network picking weights randomly from a Gaussian distribution.
def _random_weight_initialization(self, mean=0, stddev=1): self.slp_weights = np.random.normal(mean, stddev, size=(self.n_rbfs, self.n_targets))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init_weights(self):\n r = np.sqrt(6.) / np.sqrt(self.fc.in_features +\n self.fc.out_features)\n self.fc.weight.data.uniform_(-r, r)\n self.fc.bias.data.fill_(0)", "def init_weights(self):\n r = np.sqrt(6.) / np.sqrt(self.fc.in_features +\n ...
[ "0.72724056", "0.72724056", "0.72034645", "0.7111736", "0.7093619", "0.70541435", "0.69815046", "0.6926433", "0.69173616", "0.69070643", "0.6905444", "0.6878338", "0.6878338", "0.6878338", "0.6873313", "0.6873313", "0.6873313", "0.6862647", "0.6828224", "0.6826938", "0.682311...
0.6952381
7
Changes weights according to the online delta rule.
def delta_learning(self, inputs, targets, eta, val_inputs=None, val_targets=None, early_stop_threshold=10e-5, early_stop_tolerance=100, epochs=10000): pocket_mae = float('inf') pocket_epoch = 0 pocket_weights = None no_improvement = 0 for epoch in tqdm(ran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_weights(self):\n activation, activation_p = self.feedforward()\n # initialize delta_weights\n delta_w = np.zeros(2)\n # simultaneous calculate delta_weights\n for i, element in enumerate(self.y):\n delta_w += (activation[i]-element)*(activation_p[i])*self.X[...
[ "0.7626679", "0.7592226", "0.75178736", "0.74890536", "0.74207324", "0.7363992", "0.7354604", "0.7213113", "0.7058057", "0.6969162", "0.6879029", "0.6835919", "0.6826778", "0.67912084", "0.6739852", "0.6698571", "0.66787505", "0.66658735", "0.66466045", "0.66405475", "0.66383...
0.0
-1
Sets the gradient of all parameters to none. Should be called after the parameters have been updated to stop the unwanted accumulation of the gradients in parameters.
def zero_grad(self): for param in self.params: param.grad = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_grad(self):\n for parameter in self.param():\n parameter.zero_grad()", "def zero_grad(self):\n for p, dp in self.params:\n dp.zero_()", "def zero_grad(self):\n for p in self.parameters():\n if p.grad is not None:\n p.grad.data.zero_(...
[ "0.7759301", "0.7460006", "0.7422826", "0.73939174", "0.73939174", "0.7367194", "0.7287433", "0.7283845", "0.72703683", "0.7225931", "0.7225931", "0.7225931", "0.72108775", "0.7201255", "0.71796215", "0.7090021", "0.7022113", "0.69651496", "0.69644856", "0.69186956", "0.68476...
0.8293764
0
Input vector x > fully connected 1 > ReLU > (fully connected
def forward(self, x): h = self.relu(self.en_x_1(self.dropout(x))) h = self.relu(self.en_x_2(self.dropout(h))) h = self.relu(self.en_x_3(self.dropout(h))) return self.en_x_4_mu(self.dropout(h)), self.en_x_4_sigma(self.dropout(h))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fully_connected_relu(input, size):\n return tf.nn.relu(fully_connected(input, size))", "def ReLU(self, x):\n self.x = x\n output = np.maximum(0, x)\n return output", "def d_relu(x):\n\n return (x > 0) * 1", "def ReLU(self, x):\r\n self.x = x\r\n return np.maximum(x, 0)", "d...
[ "0.75448835", "0.7248909", "0.7188262", "0.7112096", "0.70900255", "0.70703155", "0.6993644", "0.6975085", "0.69515", "0.6936885", "0.6934652", "0.6904244", "0.6886882", "0.6857468", "0.6850114", "0.6834591", "0.6827615", "0.6823396", "0.6815996", "0.6797702", "0.67873406", ...
0.0
-1
Get a valid posse from a board
def find_valid_posse(board: 'List') -> 'List': for i, a in enumerate(board): for j, b in enumerate(board): if j != i: for k, c in enumerate(board): if k not in (i, j) and \ is_valid_posse((a, b, c)): # print((...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_valid_move(board, col):\n\n for row in range(len(board)-1, -1, -1):\n if board[row][col] == Utilities.EMPTY:\n return row\n\n return -1", "def GetMove(self, board):\n move = None\n while True:\n move = input(\"Enter coordinates as XY (e.g. 2...
[ "0.7036016", "0.6865156", "0.68632126", "0.68549365", "0.6833566", "0.67731625", "0.6756172", "0.6719957", "0.6660535", "0.66422975", "0.66183937", "0.6605765", "0.65884095", "0.65753096", "0.65525556", "0.65451723", "0.6538227", "0.6479033", "0.64733577", "0.64473915", "0.64...
0.69133157
1