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
itkShapePriorMAPCostFunctionBaseIF3F_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionBaseIF3F
def itkShapePriorMAPCostFunctionBaseIF3F_cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF3F_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF3F_cast(*args)", "def cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF3F_cast(*args)", "def itkShapePriorMAPCostFunctionBaseID3D_cast(*args):\n return _ITKCo...
[ "0.8265341", "0.7664924", "0.76572436", "0.76225877", "0.75587803", "0.74810505", "0.74673444", "0.7175391", "0.7102072", "0.6909219", "0.6894713", "0.68894976", "0.685522", "0.67930603", "0.6727198", "0.6714276", "0.67098135", "0.6692786", "0.66739315", "0.6653093", "0.66158...
0.8349684
0
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionID2D
def cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID2D_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionID2D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID2D_cast(*args)", "def itkShapePriorMAPCostFunctionBaseID2D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID2D_cast(*args)", "def itkShapePriorMAPCostFunctionIF2F_ca...
[ "0.73141676", "0.70673996", "0.6843274", "0.66840935", "0.6582692", "0.65562236", "0.64544374", "0.6311978", "0.62989557", "0.62106824", "0.62099963", "0.61970466", "0.617904", "0.61630714", "0.6151838", "0.6122002", "0.609543", "0.60067594", "0.5984658", "0.59663564", "0.595...
0.6689089
3
New() > itkShapePriorMAPCostFunctionID2D Create a new object of the class itkShapePriorMAPCostFunctionID2D and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter ...
def New(*args, **kargs): obj = itkShapePriorMAPCostFunctionID2D.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseID2D.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionIF2F.__New_orig__()\n import itkTemplate\n ...
[ "0.8137347", "0.74477273", "0.74374545", "0.7071052", "0.70291", "0.662702", "0.65856886", "0.65761375", "0.6550787", "0.6507501", "0.6442525", "0.6423178", "0.63393754", "0.6286249", "0.6276019", "0.626917", "0.6257921", "0.6208364", "0.61726797", "0.6158207", "0.6157282", ...
0.81472766
0
itkShapePriorMAPCostFunctionID2D_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionID2D
def itkShapePriorMAPCostFunctionID2D_cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID2D_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionBaseID2D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID2D_cast(*args)", "def cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID2D_cast(*args)", "def cast(*args):\n return _ITKCostFunctionsPython.itkShapeP...
[ "0.77926093", "0.7337416", "0.7182796", "0.7125641", "0.70003897", "0.68776655", "0.6733603", "0.6476927", "0.6475587", "0.6414517", "0.63908046", "0.6361748", "0.624513", "0.6163749", "0.6070874", "0.60321444", "0.6016549", "0.59840125", "0.59824383", "0.5980934", "0.5931624...
0.8083904
0
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionID3D
def cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID3D_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionID3D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID3D_cast(*args)", "def itkShapePriorMAPCostFunctionBaseID3D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID3D_cast(*args)", "def itkShapePriorMAPCostFunctionIF3F_ca...
[ "0.7551205", "0.73524797", "0.7227937", "0.70457846", "0.68000954", "0.6740633", "0.6698036", "0.65933263", "0.6587317", "0.6586712", "0.6578969", "0.6570283", "0.6569771", "0.65605384", "0.65595824", "0.65149385", "0.6512188", "0.65099764", "0.6477185", "0.64730686", "0.6460...
0.6935864
4
New() > itkShapePriorMAPCostFunctionID3D Create a new object of the class itkShapePriorMAPCostFunctionID3D and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter ...
def New(*args, **kargs): obj = itkShapePriorMAPCostFunctionID3D.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseID3D.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionIF3F.__New_orig__()\n import itkTemplate\n ...
[ "0.8356859", "0.7809381", "0.7721349", "0.7109716", "0.702632", "0.68193895", "0.67663026", "0.67349565", "0.6731509", "0.6730895", "0.66711056", "0.6594008", "0.6532657", "0.65133506", "0.64967597", "0.6486613", "0.6472881", "0.64678246", "0.6455502", "0.6423704", "0.6375438...
0.8377686
0
itkShapePriorMAPCostFunctionID3D_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionID3D
def itkShapePriorMAPCostFunctionID3D_cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionID3D_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionBaseID3D_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseID3D_cast(*args)", "def itkShapePriorMAPCostFunctionIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF3F_cast(*args)", "def cast(*args):\n return _ITKCo...
[ "0.796648", "0.7703503", "0.7478354", "0.7477841", "0.73037636", "0.69606185", "0.67794114", "0.6721123", "0.6648853", "0.6635782", "0.6615393", "0.6588962", "0.6553291", "0.65416825", "0.65231425", "0.65204686", "0.6515173", "0.65086496", "0.649258", "0.64867336", "0.6471725...
0.823055
0
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionIF2F
def cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF2F_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionIF2F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF2F_cast(*args)", "def itkShapePriorMAPCostFunctionBaseIF2F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF2F_cast(*args)", "def itkShapePriorMAPCostFunctionIF3F_ca...
[ "0.76491976", "0.749238", "0.70478415", "0.6970403", "0.697026", "0.6734195", "0.6690217", "0.6632464", "0.66307944", "0.65427905", "0.6420354", "0.6400475", "0.63392985", "0.6323308", "0.6307473", "0.62990093", "0.62775564", "0.62742627", "0.62607276", "0.6236481", "0.622592...
0.7055122
2
New() > itkShapePriorMAPCostFunctionIF2F Create a new object of the class itkShapePriorMAPCostFunctionIF2F and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter ...
def New(*args, **kargs): obj = itkShapePriorMAPCostFunctionIF2F.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseIF2F.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionID2D.__New_orig__()\n import itkTemplate\n ...
[ "0.82336086", "0.78440315", "0.7786063", "0.76676893", "0.76346064", "0.7078142", "0.7002258", "0.61907375", "0.61800945", "0.6159311", "0.6153904", "0.61530274", "0.6144896", "0.6137117", "0.6136335", "0.6136335", "0.6118525", "0.6004434", "0.5981893", "0.59577686", "0.59502...
0.82542807
0
itkShapePriorMAPCostFunctionIF2F_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionIF2F
def itkShapePriorMAPCostFunctionIF2F_cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF2F_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionBaseIF2F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF2F_cast(*args)", "def cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF2F_cast(*args)", "def itkShapePriorMAPCostFunctionIF3F_cast(*args):\n return _ITKCo...
[ "0.80269736", "0.7589307", "0.7554484", "0.7497977", "0.7449762", "0.718812", "0.7134716", "0.71172893", "0.7004314", "0.6690077", "0.6677554", "0.6651482", "0.6579511", "0.6458726", "0.6457076", "0.64121693", "0.63438094", "0.62941116", "0.6250574", "0.62317395", "0.6193091"...
0.8209508
0
cast(itkLightObject obj) > itkShapePriorMAPCostFunctionIF3F
def cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF3F_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF3F_cast(*args)", "def itkShapePriorMAPCostFunctionBaseIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF3F_cast(*args)", "def itkShapePriorMAPCostFunctionIF2F_ca...
[ "0.76793736", "0.75645584", "0.7273315", "0.7051506", "0.7025704", "0.70037425", "0.6899321", "0.674652", "0.6704467", "0.6616369", "0.66113853", "0.65884703", "0.65747505", "0.65468156", "0.6540885", "0.6482816", "0.6469499", "0.64639187", "0.6441915", "0.64409536", "0.64209...
0.7125982
3
New() > itkShapePriorMAPCostFunctionIF3F Create a new object of the class itkShapePriorMAPCostFunctionIF3F and set the input and the parameters if some named or nonnamed arguments are passed to that method. New() tries to assign all the non named parameters to the input of the new objects the first non named parameter ...
def New(*args, **kargs): obj = itkShapePriorMAPCostFunctionIF3F.__New_orig__() import itkTemplate itkTemplate.New(obj, *args, **kargs) return obj
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionBaseIF3F.__New_orig__()\n import itkTemplate\n itkTemplate.New(obj, *args, **kargs)\n return obj", "def New(*args, **kargs):\n obj = itkShapePriorMAPCostFunctionID3D.__New_orig__()\n import itkTemplate\n ...
[ "0.83430517", "0.8027772", "0.7915666", "0.7616337", "0.75324714", "0.7118853", "0.7005761", "0.66301626", "0.6621981", "0.65933114", "0.6590974", "0.6532026", "0.65184873", "0.6466652", "0.6410177", "0.6404741", "0.6369389", "0.63545376", "0.63198525", "0.63130546", "0.63026...
0.84030867
0
itkShapePriorMAPCostFunctionIF3F_cast(itkLightObject obj) > itkShapePriorMAPCostFunctionIF3F
def itkShapePriorMAPCostFunctionIF3F_cast(*args): return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF3F_cast(*args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def itkShapePriorMAPCostFunctionBaseIF3F_cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionBaseIF3F_cast(*args)", "def cast(*args):\n return _ITKCostFunctionsPython.itkShapePriorMAPCostFunctionIF3F_cast(*args)", "def itkShapePriorMAPCostFunctionID3D_cast(*args):\n return _ITKCo...
[ "0.8169523", "0.76662076", "0.7587959", "0.7543089", "0.7516897", "0.7429383", "0.724812", "0.7096914", "0.70078087", "0.6930906", "0.67817026", "0.6700992", "0.66370654", "0.6611494", "0.65781975", "0.6522072", "0.65128714", "0.6500653", "0.6498956", "0.64919084", "0.6486791...
0.8326169
0
Transforms a sequence of words to the corresponding sequence of word indices.
def sent_to_idx(self, sent): def _is_num(w): """ Checks if the word should be replaced by <NUM>. """ symbols = list(w) for s in symbols: if s in string.digits: return '<NUM>' return w # Replace numerical expressions wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _seq2Indices(self, sequence, vocab, start, end, unknown):\n if start:\n sequence.insert(0, start)\n if end:\n sequence.append(end)\n return [vocab[token] if token in vocab else vocab[unknown] for token in sequence]", "def convert_to_index(sentences):\n\n\twords=[]\n...
[ "0.7448267", "0.71653074", "0.7153222", "0.70562774", "0.6883426", "0.6823358", "0.67950535", "0.67703414", "0.6770327", "0.6730943", "0.6711324", "0.66610646", "0.6601152", "0.65730244", "0.65699923", "0.6550655", "0.65480447", "0.65451014", "0.6474657", "0.64126396", "0.640...
0.63152647
26
Returns an iterator object.
def __iter__(self): return self
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIter(object):\n iterator = None\n try:\n iterator = iter(object)\n except TypeError:\n pass\n return iterator", "def Iterator():\n return _table.Iterator()", "def __iter__(self) -> Iterator[T]:\n return self", "def __iter__(self):\n return self.new_generator(...
[ "0.78348416", "0.7545588", "0.73436576", "0.73081166", "0.72798884", "0.7146782", "0.7064719", "0.7064719", "0.7064719", "0.7038452", "0.70342577", "0.70269006", "0.6993885", "0.6983573", "0.6953362", "0.6929482", "0.6926676", "0.6906881", "0.69067717", "0.68904996", "0.68514...
0.6731643
46
Get the current mixer master volume.
def get_volume(self): import fcntl import struct knob = bytearray(struct.pack("III", 0, 0, 0)) # VOLUME_DEVICE_ID, VOLUME_KNOB_ID, <Unused> try: fcntl.ioctl(self.mixer_fd, 2, knob, True) _,_,value = struct.unpack("III", knob) return value excep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def volume(self):\n vol = None\n if self._mixer:\n vol = self._mixer.getvolume()\n return vol", "def volume(self) -> int:\n return self.audio_mixer.getvolume()[0]", "def volume():\n vol = sonos.volume\n return vol", "def volume(self):\n return _cantera.reac...
[ "0.79503024", "0.7706911", "0.7612505", "0.74140286", "0.7409908", "0.7378842", "0.7263637", "0.72254914", "0.72254914", "0.7212044", "0.71684396", "0.71597683", "0.70537955", "0.70537955", "0.69722515", "0.6891455", "0.6774336", "0.6721483", "0.66972864", "0.6695001", "0.659...
0.7024125
14
Validates if (valorPagado) is between 1 and 1000_000 not less, nor more 1 represents (un peso) 1_000_000 represents (1.000.000 un millon de pesos) returns True if valid
def is_valid_paid_value_range(value): min_valid_payment = 1 max_valid_payment = 1_000_000 if not min_valid_payment <= value <= max_valid_payment: raise serializers.ValidationError( 'Valor no permitido, debe ser estar entre 1 y 1000000' ) return value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_partial_payment(self, validated_data):\n if self.is_valid():\n return int(validated_data['valorPagado']) < 1_000_000", "def is_valid(self, value: Union[float, int]) -> bool:\n if self.min is not None:\n if self.include_min:\n if value < self.min:\n ...
[ "0.6743427", "0.60432607", "0.5947186", "0.5939321", "0.58391595", "0.57853603", "0.57739466", "0.5750603", "0.5731449", "0.57002676", "0.56377083", "0.55994165", "0.5586822", "0.5582065", "0.5572668", "0.5566113", "0.55643237", "0.55229557", "0.5500206", "0.5496552", "0.5494...
0.6884947
0
return True if valor pagado is less than 1000000
def is_partial_payment(self, validated_data): if self.is_valid(): return int(validated_data['valorPagado']) < 1_000_000
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ge(value, limit):\n return value >= limit", "def lt(value, limit):\n return value < limit", "def le(value, limit):\n return value <= limit", "def _allowed_page(self, box):\n if self._max_page:\n return self._min_page <= box.page <= self._max_page\n else:\n ret...
[ "0.6691004", "0.6418565", "0.63765574", "0.6290223", "0.626006", "0.6005171", "0.59546214", "0.58383375", "0.58325917", "0.580886", "0.5736994", "0.5694589", "0.55755144", "0.55718833", "0.55695707", "0.55679595", "0.55593777", "0.54702985", "0.5464542", "0.5464129", "0.54640...
0.63934225
2
Check if requisite date or timestamp columns exist
def check_cols(self): if self.ad_tab is not None and 'date' not in self.ad_cols: raise DataException("""date column not found in adServer table.""") if self.ad_tab is not None and 'impressions' not in self.ad_cols: raise DataException("""impressions column not found in adServer t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_has_any_timestamp_fields(table_object) -> bool:\n mapper = sqlalchemy.inspect(table_object)\n for column in mapper.all_orm_descriptors:\n try:\n if isinstance(column.type, PSQL_TIMESTAMP) or isinstance(column.type, SQLITE_TIMESTAMP):\n return True\n except Ex...
[ "0.721589", "0.6990198", "0.66115063", "0.65613896", "0.6457431", "0.6433194", "0.6410698", "0.6399919", "0.61740154", "0.6148821", "0.6136418", "0.6041043", "0.6016009", "0.5923861", "0.5907338", "0.5893033", "0.5851846", "0.58355147", "0.5808094", "0.5798766", "0.5777566", ...
0.73802793
0
Return a string with a pretty printed value.
def pretty_print(self, value, add_unit=False): s = "%.1f" % self.internal_to_friendly(value) if add_unit: s += " " + self.friendly_units return s
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty_str(self) -> str:\n ...", "def pretty(val, precision=2):\n if val == 0:\n return \"0\"\n if val == TRACE_VALUE:\n return \"T\"\n return (\"%.\" + str(precision) + \"f\") % (val,)", "def pretty(self):\n return \"(%s) %s-%s\" %(self.number[:3],\n ...
[ "0.81929785", "0.7085131", "0.7053562", "0.7012292", "0.6912405", "0.68955916", "0.68771136", "0.6858008", "0.68495435", "0.67574847", "0.66988415", "0.6684732", "0.6634007", "0.6574395", "0.65711874", "0.6510566", "0.6509782", "0.6476508", "0.6468478", "0.644817", "0.6433342...
0.74328786
1
Return True if the contents of self are equal to other.
def __eq__(self, other): return (self.name == other.name) and (self.wavelength_control == other.wavelength_control) \ and (self.gonio_angles == other.gonio_angles) and (self.wl_angles == other.wl_angles) \ and (self.wavelength_minimum == other.wavelength_minimum) \ ...
{ "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):\r\n if self is other:\r\n return True\r\n if type(self) != type(other):\r\n return False\r\n if self.size() !...
[ "0.8457405", "0.8457405", "0.8346412", "0.8301635", "0.8301635", "0.8263393", "0.8170906", "0.81685007", "0.81321794", "0.8129613", "0.812877", "0.81199074", "0.80871046", "0.8086053", "0.80756724", "0.80567974", "0.8052752", "0.8045209", "0.80364627", "0.80249214", "0.802245...
0.0
-1
Return (wl_min, wl_max) from the list of angles, or (None, None) if not specified.
def get_wavelength_range(self, angles): if self.wavelength_control: wl_center = angles[len(self.gonio_angles)] wl_min = wl_center - self.wavelength_bandwidth/2. wl_max = wl_center + self.wavelength_bandwidth/2. if wl_min < 1e-3: wl_min = 1e-3 if wl_max...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CalcAnglesAndSlantRanges(numRxScanAngles, altitude, angles, minLookAngle):\n IA_Arr = []\n SR_Arr = []\n for i in range(numRxScanAngles):\n ia_arr = SEM.IncidenceAngle(altitude, angles[i] + minLookAngle)\n sr_arr = SEM.SlantRange(altitude, ia_arr, angles[i] + minLookAngle)\n IA_Ar...
[ "0.6077935", "0.60710114", "0.58309764", "0.5729149", "0.5708154", "0.564264", "0.56408995", "0.561172", "0.55999804", "0.55700374", "0.55608904", "0.55137265", "0.5506718", "0.5496514", "0.5489251", "0.54852027", "0.5462924", "0.54557735", "0.5445365", "0.54426765", "0.54380...
0.7613855
0
Return True if the contents of self are equal to other.
def __eq__(self, other): return LimitedGoniometer.__eq__(self,other) and \ (np.deg2rad(self.chi) == other.chi)
{ "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):\r\n if self is other:\r\n return True\r\n if type(self) != type(other):\r\n return False\r\n if self.size() !...
[ "0.8456036", "0.8456036", "0.83450884", "0.8299809", "0.8299809", "0.826243", "0.8168996", "0.8167237", "0.8131265", "0.8127899", "0.8126606", "0.8117907", "0.80864465", "0.8084901", "0.80752355", "0.80563366", "0.80516183", "0.8044838", "0.8036182", "0.802412", "0.80218124",...
0.0
-1
Return True if the contents of self are equal to other.
def __eq__(self, other): return LimitedGoniometer.__eq__(self,other) and \ (np.deg2rad(self.chi) == other.chi) and \ (np.deg2rad(self.omega) == other.omega)
{ "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):\r\n if self is other:\r\n return True\r\n if type(self) != type(other):\r\n return False\r\n if self.size() !...
[ "0.8457405", "0.8457405", "0.8346412", "0.8301635", "0.8301635", "0.8263393", "0.8170906", "0.81685007", "0.81321794", "0.8129613", "0.812877", "0.81199074", "0.80871046", "0.8086053", "0.80756724", "0.80567974", "0.8052752", "0.8045209", "0.80364627", "0.80249214", "0.802245...
0.0
-1
Return True if the contents of self are equal to other.
def __eq__(self, other): return LimitedGoniometer.__eq__(self,other) and \ (np.deg2rad(self.chi) == other.chi)
{ "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):\r\n if self is other:\r\n return True\r\n if type(self) != type(other):\r\n return False\r\n if self.size() !...
[ "0.8457405", "0.8457405", "0.8346412", "0.8301635", "0.8301635", "0.8263393", "0.8170906", "0.81685007", "0.81321794", "0.8129613", "0.812877", "0.81199074", "0.80871046", "0.8086053", "0.80756724", "0.80567974", "0.8052752", "0.8045209", "0.80364627", "0.80249214", "0.802245...
0.0
-1
Return True if the contents of self are equal to other.
def __eq__(self, other): return LimitedGoniometer.__eq__(self,other) and \ (np.deg2rad(self.chi) == other.chi)
{ "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):\r\n if self is other:\r\n return True\r\n if type(self) != type(other):\r\n return False\r\n if self.size() !...
[ "0.8456036", "0.8456036", "0.83450884", "0.8299809", "0.8299809", "0.826243", "0.8168996", "0.8167237", "0.8131265", "0.8127899", "0.8126606", "0.8117907", "0.80864465", "0.8084901", "0.80752355", "0.80563366", "0.80516183", "0.8044838", "0.8036182", "0.802412", "0.80218124",...
0.0
-1
Return True if the contents of self are equal to other.
def __eq__(self, other): return LimitedGoniometer.__eq__(self,other) and \ (np.deg2rad(self.chi) == other.chi)
{ "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):\r\n if self is other:\r\n return True\r\n if type(self) != type(other):\r\n return False\r\n if self.size() !...
[ "0.8457405", "0.8457405", "0.8346412", "0.8301635", "0.8301635", "0.8263393", "0.8170906", "0.81685007", "0.81321794", "0.8129613", "0.812877", "0.81199074", "0.80871046", "0.8086053", "0.80756724", "0.80567974", "0.8052752", "0.8045209", "0.80364627", "0.80249214", "0.802245...
0.0
-1
Return True if the contents of self are equal to other.
def __eq__(self, other): return LimitedGoniometer.__eq__(self,other) and \ (np.deg2rad(self.omega) == other.omega)
{ "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):\r\n if self is other:\r\n return True\r\n if type(self) != type(other):\r\n return False\r\n if self.size() !...
[ "0.8456036", "0.8456036", "0.83450884", "0.8299809", "0.8299809", "0.826243", "0.8168996", "0.8167237", "0.8131265", "0.8127899", "0.8126606", "0.8117907", "0.80864465", "0.8084901", "0.80752355", "0.80563366", "0.80516183", "0.8044838", "0.8036182", "0.802412", "0.80218124",...
0.0
-1
Convert seconds to frame unit.
def second2frame(self, second): sample = int(second * self.fs) frame = int(round(sample/self.hop_len)) return frame
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _to_seconds(value, unit):\n if (not isinstance(value, int)) or (not isinstance(unit, int)):\n raise InstrumentProtocolException(\"Invalid second arguments!\")\n \n if unit == 1:\n return value * 60\n elif unit == 0:\n return value\n else:\n ...
[ "0.7022775", "0.69818187", "0.67261535", "0.6653474", "0.6578642", "0.6578642", "0.657047", "0.64668226", "0.64486164", "0.6438943", "0.642578", "0.63026786", "0.6298996", "0.6293812", "0.6239704", "0.62366056", "0.62306076", "0.62284523", "0.6225818", "0.6193834", "0.6187888...
0.6261944
14
Converts a Tensor or numpy array into a Variable.
def make_var(x, dtype=np.float32, cuda=True, volatile=False, requires_grad=False): if type(x) != Variable: if isinstance(x, np.ndarray): x = torch.from_numpy(x.astype(dtype)) x = Variable(x, volatile=volatile, requires_grad=requires_grad) return make_cuda(x) if cuda else x
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def array2var(array):\n if array.ndim == 3:\n array = array.transpose((2, 0, 1))\n var = Variable(torch.from_numpy(array))\n while len(var.size()) < 4:\n var = var.unsqueeze(0)\n return var", "def np_to_var(x, is_cuda=True, dtype=torch.FloatTensor):\n var = Variable(torch.from_numpy(...
[ "0.77721626", "0.74502933", "0.74213755", "0.7370797", "0.7318588", "0.7266197", "0.7241281", "0.7060068", "0.7036618", "0.7010196", "0.69413644", "0.6895195", "0.6810366", "0.6481117", "0.6417753", "0.6360432", "0.6319292", "0.6308483", "0.6262854", "0.62257695", "0.6157889"...
0.65753967
13
Converts a Variable or a Tensor into a numpy array.
def to_numpy(x): if isinstance(x, np.ndarray): return x if isinstance(x, Variable): x = x.data return x.cpu().numpy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numpy(x):\n if isinstance(x, torch.Tensor):\n x = x.detach().cpu().numpy()\n elif isinstance(x, tf.Tensor):\n x = x.numpy()\n return x.astype(np.float64)", "def to_numpy(tensor):\n raise NotImplementedError", "def to_numpy(x: Union[torch.Tensor, np.ndarray, Any, None]) -> Uni...
[ "0.7395024", "0.7238449", "0.7178595", "0.7160928", "0.71590775", "0.7132097", "0.7120392", "0.7102664", "0.70148325", "0.69829416", "0.67930365", "0.6758009", "0.67474186", "0.6670536", "0.666593", "0.6635416", "0.6609529", "0.6573065", "0.6570553", "0.65506107", "0.6427597"...
0.8183979
0
Returns a list of all trainable parameters in a model.
def trainable_parameters(net): return [p for p in net.parameters() if p.requires_grad]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_trainable_params(model):\n trainable_params = []\n for x in model.parameters():\n if x.requires_grad:\n trainable_params.append(x)\n return trainable_params", "def trainable_variables(self):\n return [v for p in self.parameters for v in p.trainable_variables]\n #...
[ "0.82967734", "0.734262", "0.71602994", "0.7079742", "0.7009472", "0.70061034", "0.69848174", "0.6970714", "0.68420243", "0.6795479", "0.6795479", "0.67876804", "0.6775169", "0.6769371", "0.6759395", "0.6720627", "0.6704742", "0.6683944", "0.66628754", "0.6629731", "0.6598858...
0.705091
4
Gets the id of this AccountManagerColumn.
def id(self) -> str: return self._id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_id(self):\n return self._column_id", "def account_id(self):\n\n return self._account_id", "def account_id(self):\n return self._account_id", "def account_id(self) -> str:\n return self._account_id", "def account_id(self):\n return self.config.account_id", "def a...
[ "0.7471514", "0.7006714", "0.70051616", "0.6926509", "0.67071867", "0.65085435", "0.65085435", "0.65085435", "0.65085435", "0.65085435", "0.65085435", "0.65085435", "0.65085435", "0.6472578", "0.6472578", "0.64357466", "0.6421473", "0.6417635", "0.6417635", "0.63839126", "0.6...
0.0
-1
Sets the id of this AccountManagerColumn.
def id(self, id: str): if id is None: raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 self._id = id
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_id(self, id):\n self.__id = id", "def set_id(self, id_):\n\n self.id_ = id_", "def SetId(self, id):\n self.id = int(id)", "def set_id(self, id):\n self.data['id'] = id", "def set_id(self, id):\n\n\t\tif id is not None and not isinstance(id, int):\n\t\t\traise SDKExceptio...
[ "0.667747", "0.66465724", "0.65939194", "0.65676624", "0.627148", "0.62061906", "0.61554193", "0.6137458", "0.6137458", "0.6137458", "0.6137458", "0.6137458", "0.6137458", "0.6137458", "0.6137458", "0.6137458", "0.6137458", "0.6121585", "0.6116812", "0.6116812", "0.6116812", ...
0.0
-1
Gets the tooltip of this AccountManagerColumn.
def tooltip(self) -> str: return self._tooltip
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tooltip ( self, object ):\n return self.tooltip", "def editorToolTip(self):\n return self._editor.toolTip()", "def GetToolTip(self):\r\n\r\n return self._label", "def get_tooltip_markup(self): # real signature unknown; restored from __doc__\n return \"\"", "def get_toolt...
[ "0.6968679", "0.6950317", "0.6662648", "0.6494173", "0.6385515", "0.63525504", "0.6331788", "0.5978866", "0.5740001", "0.57395476", "0.5335052", "0.5317046", "0.52540386", "0.50361234", "0.5023074", "0.50056267", "0.49575585", "0.49575585", "0.49575585", "0.49293143", "0.4920...
0.7512555
0
Gets the fixed_width of this AccountManagerColumn.
def fixed_width(self) -> bool: return self._fixed_width
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def width(self):\n return self.col", "def GetWidth(self):\r\n\r\n return self._total_col_width", "def Width(self):\n return _table.Table_Width(self)", "def width(cls):\n return cls._width", "def width(self):\n return self['width']", "def get_width(self):\n return...
[ "0.64966404", "0.6395046", "0.6272978", "0.62030005", "0.6103017", "0.6096956", "0.608999", "0.608999", "0.608999", "0.608999", "0.6089004", "0.60867184", "0.6083742", "0.6083742", "0.6083742", "0.6083742", "0.6083742", "0.6083742", "0.6083742", "0.6083742", "0.6083742", "0...
0.6326606
2
Gets the sortable of this AccountManagerColumn.
def sortable(self) -> bool: return self._sortable
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetColumnSorter(self):\n\n return self._custom_sorter", "def orderable(self):\r\n if self.column.orderable is not None:\r\n return self.column.orderable\r\n return self.table.orderable", "def get_sort_by(self):\n\n\t\treturn self.__sort_by", "def name(self) -> SortDirectio...
[ "0.6742037", "0.6181441", "0.5858873", "0.5741792", "0.5738419", "0.5671075", "0.56546056", "0.5624929", "0.5622353", "0.54563135", "0.54278386", "0.5426798", "0.5384043", "0.536925", "0.5241476", "0.5186469", "0.51562107", "0.5098109", "0.5096285", "0.50810295", "0.5045022",...
0.6460801
1
Returns the spontaneous emission rate of a given Rydberg state
def func_spon_318(n, series): if series == "3S1": return 1/state_3S1(n) if series == "3D3": return 1/state_3D3(n)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reward(self,\n state: float) -> float:\n raise NotImplementedError", "def get_rate(sigma, dt=1*units.ns):\n return stats.norm.sf(sigma)/dt", "def ratestate_sl(t,y,o):\n State=y[:o['N']]\n Vel=y[o['N']:2*o['N']] \n Disp=y[2*o['N']:3*o['N']]\n # Slip law\n dStatedt = n...
[ "0.6204472", "0.61656445", "0.61427075", "0.5937661", "0.58525014", "0.58325064", "0.5800026", "0.5766651", "0.57430446", "0.57333356", "0.57132673", "0.56902647", "0.5683718", "0.5623881", "0.56125486", "0.559221", "0.55902225", "0.55899334", "0.5537958", "0.55305094", "0.55...
0.0
-1
Compute the qth quantile of the data along the specified axis.
def quantile( a, q, axis=None, out=None, overwrite_input=False, interpolation="linear", keepdims=False, **kw, ): handle_non_numeric = kw.pop("handle_non_numeric", None) if len(kw) > 0: # pragma: no cover raise TypeError( f"quantile() got an unexpected keywor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantile(self, q, *, axis=0, **kwargs) -> \"Dataset\":\n return self._quantile(q, axis=axis, func=np.quantile, **kwargs)", "def quantile(self, axis: str = 'rows', q: float = 0.5) -> 'DataFrame':\n if not utils.is_number(q):\n raise TypeError('`q` must be a number between 0 and 1')\n ...
[ "0.7689813", "0.72962856", "0.68138355", "0.65774137", "0.657659", "0.6541071", "0.6539727", "0.6539465", "0.64152074", "0.63444734", "0.6299189", "0.62989295", "0.6296212", "0.6255064", "0.62407386", "0.62379444", "0.6235523", "0.6235523", "0.62160426", "0.6193368", "0.61912...
0.6291817
13
Create and configure an instance of the flask application
def create_app(): app = Flask(__name__) # configure app app.config["SQLALCHEMY_DATABASE_URI"] = os.getenv("DATABASE_URI") app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False # initialize database DB.init_app(app) # create table(s) with app.app_context(): DB.create_all() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_app(self):\r\n self.app = Flask(__name__, instance_relative_config=True)\r\n\r\n # Init the secret key of the app -it is a must for flask to run\r\n self.app.config.from_mapping(\r\n SECRET_KEY='!ZNeverSayNever116Z!',\r\n MONGODB_SETTINGS= {'host': 'mongodb://l...
[ "0.8487888", "0.8275142", "0.8235206", "0.81816894", "0.8150391", "0.8049686", "0.8036342", "0.80083245", "0.8007956", "0.8002108", "0.80019945", "0.79816544", "0.796986", "0.79647744", "0.79399467", "0.7938733", "0.79316556", "0.78698766", "0.78653747", "0.7855847", "0.78514...
0.0
-1
Render the homepage landing page template
def homepage(): return render_template('home/index.html',title='Welcome to SYCLIQ') #return render_template_string("Welcome to SYCLIQ")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def landing_page():\n\n return render_template('index.html')", "def home():\n return render_template('homepage.html')", "def homepage():\n\treturn render_template(\"home/a_homepage.html\", title=\"Welcome\")", "def homepage():\n return render_template('homepage.html')", "def render_home():\r\n\tretu...
[ "0.8492362", "0.83183604", "0.8290816", "0.8281598", "0.82541883", "0.82277477", "0.82227284", "0.82155585", "0.81860137", "0.81860137", "0.8168229", "0.81520456", "0.81391907", "0.81175566", "0.81097895", "0.80895907", "0.8034316", "0.7956817", "0.7925025", "0.7925025", "0.7...
0.76035166
82
A string representation of the model.
def __str__(self): return self.Name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __repr__(self):\n\n mod = f\"{self.__class__.__name__} Model\"\n try:\n mod += f': {self.filename}'\n except AttributeError:\n pass\n s = [mod]\n for name, v in self.metadat...
[ "0.8567286", "0.80320746", "0.7939547", "0.78144956", "0.78115743", "0.7782607", "0.7757796", "0.7757796", "0.773894", "0.77152467", "0.7714009", "0.7679083", "0.7661709", "0.765754", "0.7645759", "0.7645759", "0.7628557", "0.762749", "0.75903344", "0.75903344", "0.7569605", ...
0.0
-1
Find the min utility from children nodes
def min_value(tree): min_utility = float("inf") if (is_terminal(tree)): return tree else: #options = [] for node in tree: #options.append(max_value(node)) min_utility = min(min_utility, max_value(node)) return min_utility
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findMin(self):\n curr = self\n while curr.hasLeftChild():\n curr = curr.leftChild\n return curr", "def find_min(self):\n return min(self.nodes, key=int)", "def min(self):\n no = self.root\n if no:\n no = self.__search_node_min_dir(no)\n ...
[ "0.7200102", "0.7070101", "0.6939922", "0.6888341", "0.68484074", "0.684134", "0.68289566", "0.6772278", "0.6713266", "0.66093856", "0.66046596", "0.6590523", "0.65893716", "0.6580788", "0.657738", "0.6547522", "0.6543914", "0.65346396", "0.6498256", "0.6462064", "0.64420354"...
0.6818848
7
Generate a random Wilson coefficient instance for a given basis.
def get_random_wc(eft, basis, scale, cmax=1e-6): basis_obj = wcxf.Basis[eft, basis] _wc = {} for s in basis_obj.sectors.values(): for name, d in s.items(): _wc[name] = cmax * np.random.rand() if not d or 'real' not in d or not d['real']: _wc[name] += 1j * cmax...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_wilson_coeffs(self):\n if self.fit_wc_priors is None:\n return None\n all_random = self.fit_wc_priors.get_random_all()\n return np.asarray([all_random[p] for p in self.fit_wc_names])", "def get_random_wilson_coeffs_start(self):\n if self.fit_wc_function is No...
[ "0.63852865", "0.6068472", "0.594829", "0.58600795", "0.55565286", "0.55515176", "0.5547327", "0.5545818", "0.5495463", "0.54875726", "0.54836637", "0.54665875", "0.54443514", "0.5440874", "0.54266816", "0.54141426", "0.5413743", "0.5411792", "0.5398683", "0.53766716", "0.536...
0.645079
0
Ensures that field name is valid (either predictor or target variable).
def check_field_name(field_name): error_checking.assert_is_string(field_name) if field_name in ALL_PREDICTOR_NAMES + ALL_TARGET_NAMES: return error_string = ( '\nField "{0:s}" is not valid predictor or target variable. Valid ' 'options listed below:\n{1:s}' ).format(field_name...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_nonreserved_name(self):\n try:\n field_name_validator('_identifier')\n except ValidationError:\n self.fail('Field name raised ValidationError unexpectedly')", "def check_imported_name(self, name, field, sourcepath):\n if len(name) > 80:\n raise NameF...
[ "0.7149793", "0.689454", "0.68876296", "0.6558793", "0.6480937", "0.6459299", "0.63830036", "0.63593936", "0.6311762", "0.63055736", "0.6298674", "0.62819093", "0.6271651", "0.62579167", "0.62283677", "0.62101537", "0.61964136", "0.61780494", "0.6177804", "0.61764836", "0.613...
0.8394374
0
Subsets examples by standardatmosphere type.
def subset_by_standard_atmo(example_dict, standard_atmo_enum): check_standard_atmo_type(standard_atmo_enum) good_indices = numpy.where( example_dict[STANDARD_ATMO_FLAGS_KEY] == standard_atmo_enum, )[0] for this_key in ONE_PER_EXAMPLE_KEYS: if isinstance(example_dict[this_key], list): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_examples(self, lines, set_type):\n examples = []\n for (_, data) in enumerate(lines):\n race_id = \"%s-%s\" % (set_type, data[\"race_id\"])\n article = data[\"article\"]\n for i in range(len(data[\"answers\"])):\n truth = str(ord(data[\"answ...
[ "0.5568173", "0.5491898", "0.5491898", "0.5491898", "0.5481069", "0.5444973", "0.5444973", "0.5444973", "0.5444973", "0.540652", "0.5395378", "0.5384594", "0.5358267", "0.53556746", "0.53370214", "0.533454", "0.53276527", "0.53244567", "0.53172475", "0.53160065", "0.53157485"...
0.49319032
92
Returns true if the tag is a link in a row with text including formtype and description
def filter_search_results_entries(tag, form_type, description_text): desc_re = re.compile(description_text, re.I) form_re = re.compile(form_type, re.I) try: return (tag.parent.name == 'td' and tag.name == 'a' and tag['id'] == 'documentsbutton' and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsItemHyperText(self, item):\r\n\r\n return item.IsHyperText()", "def check_link(self, link, links_para):\n href = link['href']\n if not href.startswith('/wiki/') or href == '/wiki/Latin' or href.startswith('#'):\n return False\n if \"<i>\" in link or href in links_par...
[ "0.6330753", "0.6326281", "0.6066449", "0.60287875", "0.59296876", "0.59296876", "0.59296876", "0.58816314", "0.5852668", "0.58284754", "0.57862777", "0.5739203", "0.5729351", "0.56820846", "0.5671082", "0.5636128", "0.5624152", "0.5621257", "0.5618365", "0.5603439", "0.56032...
0.6255833
2
Convenience function to create a tkinter button
def create_buttons(self): buttons = [] for i in range(9): buttons.append(tk.Button(self.game_frame, bg="white", relief="ridge", height=1, width=3, command=self.get_button_callback(i), font=(self.FONT, 48))) return buttons
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_button( self, button_text = \"default text\", command = None ):\n a_button = Tk.Button( self.bottom_inner_frame ,\n width = self.button_width,\n height = self.button_height,\n text = button_text )\n ...
[ "0.81224704", "0.7876855", "0.7850482", "0.765835", "0.763901", "0.7612935", "0.7580199", "0.7507256", "0.7429472", "0.7406342", "0.72745717", "0.71021247", "0.7088453", "0.69614017", "0.6913661", "0.6887658", "0.68665594", "0.68597394", "0.68346685", "0.6819517", "0.67726886...
0.5913148
89
_repr_html_ HTML table describing the Sample. For integration with Jupyter notebook.
def _repr_html_(self): params = OrderedDict() params["Name"] = self.name params["Description"] = self.description params["Ns"] = self.Ns params["Ni"] = self.Ni params["Kinetic Parameter"] = self.kinetic_parameter_type params["Kinetic Parameter Value"] = self.kinet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _repr_html_(self):\n return html_table(self)", "def _repr_html_(self):\n return \"<td><b>{0}</b></td><td>{1}</td>\".format(self.id, self.title)", "def _repr_html_(self): # pragma: no cover\n return u\"\"\"<table>\n <tr><th>Station Name</th><th>Station Number</th><th>State</th></tr>...
[ "0.73318976", "0.6842469", "0.67785317", "0.6767419", "0.67265093", "0.65692014", "0.64481044", "0.6447936", "0.63753736", "0.63327193", "0.6252019", "0.6220914", "0.62089497", "0.62042606", "0.6150762", "0.6150762", "0.6077552", "0.60303164", "0.6023693", "0.5999982", "0.598...
0.68200094
2
A method to check whether a point is above the line between two given points or not.
def is_above_line(point_a, point_b, test_point): d_1 = (point_b[0] - point_a[0]) d_2 = (test_point[1] - point_a[1]) d_3 = (point_b[1] - point_a[1]) d_4 = (test_point[0] - point_a[0]) pos = (d_1 * d_2) - (d_3 * d_4) if pos >= 0: # this means anything on the line is being considered as above ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_on_line(p0, p1, p2, threshold = 0.01):\n p0, p1, p2 = map(lambda tup : np.array(tup[:2]), [p0, p1, p2])\n p1 -= p0\n p2 -= p0\n return abs((p1[0] / p1[1]) - (p2[0] / p2[1])) < threshold", "def isPointOnLine(node1, node2, point):\n m, b, d = geometry.lineSpec(node1, node2)\n if d ...
[ "0.7660042", "0.7553229", "0.7377589", "0.7338142", "0.7243197", "0.71007204", "0.6944409", "0.69046557", "0.6819023", "0.67543", "0.66907287", "0.66396916", "0.6580069", "0.6575543", "0.6561982", "0.6506796", "0.647376", "0.64622396", "0.6460954", "0.64462125", "0.6427939", ...
0.88154113
0
Filter by whether or not the stock item has expired
def filter_expired(self, queryset, name, value): if not common.settings.stock_expiry_enabled(): return queryset if str2bool(value): return queryset.filter(StockItem.EXPIRED_FILTER) else: return queryset.exclude(StockItem.EXPIRED_FILTER)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_expired(self, queryset, name, value):\n if value:\n return queryset.filter(Q(expiration__gte=date.today()) | Q(auto_renew=True))\n return queryset", "def filter(self, event, *args, **kwargs):\n return event[\"expiration_datetime\"] <= datetime.now()", "def getExpired(...
[ "0.7297641", "0.71389735", "0.6657226", "0.656795", "0.6516044", "0.6267126", "0.61987513", "0.6050042", "0.6034353", "0.5943769", "0.5935691", "0.58813155", "0.5877097", "0.5875873", "0.586729", "0.5860001", "0.58404994", "0.5830169", "0.5829711", "0.58045095", "0.5760308", ...
0.7610734
0
Filter by if item is in stock.
def filter_in_stock(self, queryset, name, value): if str2bool(value): return queryset.filter(StockItem.IN_STOCK_FILTER) else: return queryset.exclude(StockItem.IN_STOCK_FILTER)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_available(self, queryset, name, value):\n if str2bool(value):\n # The 'quantity' field is greater than the calculated 'allocated' field\n # Note that the item must also be \"in stock\"\n return queryset.filter(StockItem.IN_STOCK_FILTER).filter(Q(quantity__gt=F('al...
[ "0.69637585", "0.66029406", "0.63809305", "0.6229548", "0.612728", "0.60628104", "0.60581654", "0.6018605", "0.59439766", "0.59330475", "0.59132105", "0.5870643", "0.58599955", "0.58254504", "0.5765053", "0.5745753", "0.57311344", "0.5730713", "0.57156205", "0.5709473", "0.56...
0.7524561
0
Filter stock items by "belongs_to" field being empty.
def filter_installed(self, queryset, name, value): if str2bool(value): return queryset.exclude(belongs_to=None) else: return queryset.filter(belongs_to=None)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty_filter(item, *args, **kwargs):\n return True", "def filter_depleted(self, queryset, name, value):\n if str2bool(value):\n return queryset.filter(quantity__lte=0)\n else:\n return queryset.exclude(quantity__lte=0)", "def filter_queryset(self, queryset):\n ...
[ "0.6004197", "0.55920595", "0.55492985", "0.5501104", "0.54357976", "0.54188424", "0.5405317", "0.537139", "0.5361765", "0.5357368", "0.5340283", "0.53359526", "0.5328712", "0.5273713", "0.52641815", "0.51969504", "0.5143507", "0.5143507", "0.5122787", "0.5091048", "0.5073626...
0.5752922
1
Filter stock items by "belongs_to" field being empty.
def filter_has_installed(self, queryset, name, value): if str2bool(value): return queryset.filter(installed_items__gt=0) else: return queryset.filter(installed_items=0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def empty_filter(item, *args, **kwargs):\n return True", "def filter_installed(self, queryset, name, value):\n if str2bool(value):\n return queryset.exclude(belongs_to=None)\n else:\n return queryset.filter(belongs_to=None)", "def filter_depleted(self, queryset, name, val...
[ "0.6005334", "0.5753073", "0.55929744", "0.55495685", "0.55029976", "0.54379857", "0.5420631", "0.54073215", "0.53723717", "0.53618985", "0.5357204", "0.5341877", "0.53361857", "0.53287303", "0.52744114", "0.5264252", "0.51966304", "0.5143399", "0.5143399", "0.51228213", "0.5...
0.0
-1
Initialize the LightningModule with a model and loss function.
def __init__(self, **kwargs: Any) -> None: super().__init__() # Creates `self.hparams` from kwargs self.save_hyperparameters() self.hyperparams = cast(dict[str, Any], self.hparams) if not isinstance(kwargs["ignore_index"], (int, type(None))): raise ValueError("ignor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, model, train_loader, val_loader, plot_func=None,\n loss_meters=None, loss_hists=None):\n\n self.model = model\n self.init_loss_history(loss_hists)\n self.init_loss_meter(loss_meters)\n\n self.train_loader = train_loader\n self.val_loader = val_l...
[ "0.66203725", "0.64867115", "0.6428751", "0.64224476", "0.625673", "0.6245068", "0.6242763", "0.6242185", "0.620464", "0.617476", "0.617476", "0.61666864", "0.6147512", "0.61470425", "0.6142953", "0.61283267", "0.6122388", "0.61154646", "0.60933894", "0.6084957", "0.60702825"...
0.0
-1
Get future date after adding no. of days
def getfuturedate(runningdate, futuredays): d = (runningdate + datetime.timedelta(days=(futuredays-1))).strftime('%d-%m') return str(d)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_future_date(start_date, days=0, months=0, years=0, date_format=app_constant.DATE_FORMAT):\n start_date = _get_date_time(date_time=start_date, datetime_format=date_format)\n return start_date + relativedelta(days=days, months=months, years=years)", "def dateByDelta(daysInTheFuture=1):\n\ttmDT = date...
[ "0.75117326", "0.73482925", "0.6876353", "0.6876353", "0.6682104", "0.65931815", "0.6585408", "0.65804034", "0.6413974", "0.63006276", "0.62898356", "0.6259354", "0.6251029", "0.61531603", "0.6073424", "0.6063315", "0.6035235", "0.5997385", "0.5990072", "0.59751356", "0.59544...
0.71827954
2
Put a string in lower case and remove punctuation between words. >>> sentence_to_words("Today, they aren't uptodate any more.") ['today', 'they', "aren't", 'uptodate', 'any', 'more']
def sentence_to_words(sentence: str) -> List[str]: return list(map(clean_word, sentence.split(" ")))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sent_to_words(sent: str) -> List[str]:\n return [word for word in sent.split() if word not in string.punctuation]", "def sentence2word(sentence):\n return list(filter(lambda word: word != \"\", [re.sub('[^A-Za-z0-9]+', '', word).lower() for word in sentence.replace(\"' \", \"'\").split(' ')]))", "def...
[ "0.79048526", "0.78433096", "0.7803452", "0.7433612", "0.7354469", "0.73309225", "0.7322376", "0.7200862", "0.71246165", "0.71246165", "0.710914", "0.7093647", "0.70924526", "0.70651555", "0.7049197", "0.70055544", "0.69828856", "0.6974297", "0.6974297", "0.6932027", "0.69200...
0.8471187
0
Invoke 'callback(frame,name,value,old_locals)' on next assign in 'frame' The frame monitored is determined by the 'depth' argument, which gets passed to 'sys._getframe()'. When 'callback' is invoked, 'old_locals' contains a copy of the frame's local variables as they were before the assignment took place, allowing the ...
def decorate_assignment(callback, depth=2, frame=None): frame = enclosing_frame(frame, depth+1) oldtrace = [frame.f_trace] old_locals = frame.f_locals.copy() def tracer(frm, event, arg): if event == 'call': # We don't want to trace into any calls if oldtrace[0]: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorate(*decorators):\n if len(decorators) > 1:\n decorators = list(decorators)\n decorators.reverse()\n\n def callback(frame, k, v, old_locals):\n for d in decorators:\n v = d(v)\n return v\n return decorate_assignment(callback)", "def _attach_closure(origina...
[ "0.55058223", "0.50472826", "0.48795882", "0.47743753", "0.46793133", "0.4618423", "0.45946157", "0.45428437", "0.44986165", "0.4486725", "0.44774422", "0.44619703", "0.4459399", "0.445587", "0.44409385", "0.44137523", "0.43975252", "0.4393957", "0.43420666", "0.43357918", "0...
0.7502854
0
Given a list of claims, return only the earliest claim based on date_column. In the case where two claims have the earliest date, returns all claims from that date.
def get_claims_from_earliest_date(claims, date_column='clm_from_dt'): logger.debug('Get claims from earliest data using date_column - {}'.format(date_column)) if not claims: return [] earliest_date = min(claims, key=lambda x: x.clm_from_dt).clm_from_dt earliest_claims = [ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min_date(self, rows: List[Row], column: DateColumn) -> Date:\n cell_values = [row.values[column.name] for row in rows if row.values[column.name] is not None]\n if not cell_values:\n return Date(-1, -1, -1)\n if not all([isinstance(value, Date) for value in cell_values]):\n ...
[ "0.5762738", "0.5490605", "0.5469911", "0.5418699", "0.5346733", "0.5338688", "0.532422", "0.5244245", "0.5092411", "0.5088298", "0.5047943", "0.50157046", "0.49775702", "0.49495167", "0.49105057", "0.48976403", "0.48877728", "0.48780733", "0.48629734", "0.48522598", "0.48470...
0.89572775
0
Group claims together into eligible instances. Returns a list of eligible instances, which are themselves lists of claims.
def get_eligible_instances(self, claims, date_column='clm_from_dt', window_length=30): logger.debug('Get eligible instances using date_column - {}, window_length - {}'.format( date_column, window_length)) eligible_instances = [] claims_by_beneficiary = self.group_claims_by_field_va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group(self):\n instances = self.instances\n groups = []\n for i in range(len(self.labels)):\n groups.append([instance for instance in instances if instance[-1] == self.labels[i]])\n return groups", "def instances(self):\r\n # It would be more efficient to do this...
[ "0.5597567", "0.5512977", "0.5476534", "0.5289702", "0.51839954", "0.5100008", "0.5057129", "0.5009177", "0.49126115", "0.48998424", "0.48997602", "0.4895895", "0.48468807", "0.48080602", "0.4786781", "0.4775315", "0.47697338", "0.47630087", "0.47540894", "0.4715613", "0.4708...
0.6434869
0
Creating an instance of the specific type from the data passed in the dictionary `data_dict`.
def from_dict(cls, session: "FigoSession", data_dict: dict) -> "ModelBase": return cls(session, **data_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, data):\n return cls(**data)", "def from_data(cls, data):\n return object.__new__(cls)", "def from_dict(cls, data: Dict[str, any]):\n return cls(**data)", "def from_dict(cls, data):\n instance = cls()\n instance._set_data(data)\n return instance", ...
[ "0.73074365", "0.7268067", "0.71198195", "0.6986825", "0.69784653", "0.6940016", "0.68623775", "0.67726564", "0.67612404", "0.6722939", "0.6629707", "0.66250813", "0.66180676", "0.66175634", "0.648683", "0.6478032", "0.6478032", "0.6478032", "0.6478032", "0.6478032", "0.64780...
0.63361514
71
Serialize the ModelBase object to a dictionary.
def dump(self) -> dict: result = {} for attribute in self.__dump_attributes__: value = getattr(self, attribute) if value is not None: result[attribute] = value return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize(self):\n data = {}\n\n for k, v in self.__dict__.items():\n if not k.startswith('__'):\n data[k] = v\n\n return data", "def to_dict(self):\n raise NotImplementedError('To be implemented in subclass.')", "def serialize(self):\n\t\treturn {\n\t\...
[ "0.73165214", "0.72675526", "0.7209445", "0.72065246", "0.72065246", "0.7171559", "0.7155951", "0.71222454", "0.7112498", "0.71088403", "0.71088403", "0.71088403", "0.7103855", "0.7089422", "0.70802945", "0.70802945", "0.70802945", "0.70802945", "0.70802945", "0.70802945", "0...
0.0
-1
Get an array of `Transaction` objects, one for each transaction of the user.
def get_transactions( self, since: Optional[date] = None, count: int = 1000, offset: int = 0, include_pending: bool = False, ) -> List[Transaction]: return self.session.get_transactions( self.account_id, options={ 'since': since...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def all_transactions(self, request):\n user_id = request.data[\"user\"]\n user = User.objects.get(id=user_id)\n user_transactions = user.transactions.all()\n serializer = TransactionSerializer(user_transactions, many=True)\n\n return Response(serializer.data)", "def transaction...
[ "0.7472036", "0.7164495", "0.7066086", "0.70586306", "0.6995129", "0.6977443", "0.69446105", "0.6917769", "0.6902334", "0.6862924", "0.6828298", "0.6770607", "0.66173804", "0.65946376", "0.64367515", "0.63251233", "0.6220455", "0.61784315", "0.61700004", "0.61613107", "0.6123...
0.5953479
26
An array of `Security` objects, one for each security on the account.
def securities(self) -> List[Security]: return self.session.get_securities(self.account_id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def security_entries(self):\n return self._security_entries", "def get_securities(\n self, since: Optional[date] = None, count: int = 1000, offset: int = 0,\n ) -> List[Security]:\n return self.session.get_securities(\n self.account_id, since=since, count=count, offset=offset\n...
[ "0.65226287", "0.6496715", "0.62567973", "0.60445726", "0.5897037", "0.57641405", "0.562759", "0.5601113", "0.55976653", "0.5522327", "0.5521604", "0.5515054", "0.5456484", "0.54538465", "0.5419", "0.5369743", "0.5368674", "0.5317451", "0.53026223", "0.5263922", "0.5198616", ...
0.74608564
0
A method force input to a square matrix in order to make invertible matrix functions callable. This function calls `refit` to update the estimates for H, W and E. `reshape_to_square` will determine the axis with the larger dimensionality and DOWNSAMPLE that axis to the same number of cols/rows as the smaller axis.
def to_square(self, in_place=True): axis_0 = self.I.shape[0] axis_1 = self.I.shape[1] if axis_0 < axis_1: print(f"Reshaping from {self.I.shape} to {(axis_0, axis_0)}" f" with `in_place={in_place}`") I_sq = np.apply_along_axis(signal.resample, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_square(arr):\n\tassert arr.ndim==1 or arr.ndim==2, \"array must be 1 or 2-D\"\n\tif arr.ndim==2:\n\t\tassert arr.shape[1]==1, \"If array is 2d then second dimension must be 1\"\n\t\tarr = arr.reshape(arr.shape[0])\n\tassert arr.shape[0]**0.5 == int(arr.shape[0]**0.5), \"array shape must be square (it is {...
[ "0.5706672", "0.53156036", "0.53156036", "0.5243944", "0.52262706", "0.5201737", "0.5197664", "0.515727", "0.5057486", "0.49696854", "0.49077186", "0.48950228", "0.4875591", "0.48582372", "0.484066", "0.48276943", "0.48259157", "0.48225158", "0.47956923", "0.47914183", "0.476...
0.65743166
0
check if an object is an array
def is_array(self, arr): return isinstance(arr, np.ndarray)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def IsArray(obj):\n return isinstance(obj, (list, tuple))", "def is_arraylike(obj):\n if isinstance(obj, list):\n return True\n elif isinstance(obj, np.ndarray):\n return True\n elif isinstance(obj, pd.Series):\n return True\n elif isinstance(obj, pd.DataFrame):\n retur...
[ "0.85911", "0.81373", "0.77970093", "0.77923864", "0.7679099", "0.7648898", "0.75110435", "0.7435121", "0.7374332", "0.72466815", "0.7200344", "0.71270746", "0.70624727", "0.702911", "0.6971996", "0.6876856", "0.6841297", "0.6829045", "0.68233836", "0.6820877", "0.68065083", ...
0.75714236
6
Resets all settings of guild to default values. Does not clear member data (use forceclear)
async def reset(self, ctx): await self.config.clear_all_guilds() await ctx.send("Reset all settings to default values.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _reset_settings(self, ctx):\n data = await self.get_data(ctx)\n await data.Settings.clear()\n msg = (\"{0.name} ({0.id}) reset all \"\n \"casino settings.\").format(ctx.author)\n await ctx.send(msg)", "def reset(self):\n self.manager.delete_all()\n ...
[ "0.75078434", "0.73965174", "0.7391806", "0.72937673", "0.708105", "0.6944976", "0.6803023", "0.66074216", "0.65506864", "0.6495808", "0.646107", "0.64591414", "0.6425749", "0.64253896", "0.6380298", "0.63676643", "0.6337305", "0.62990415", "0.6234431", "0.62271917", "0.62100...
0.84176004
0
This function prints and plots the confusion matrix. Normalization can be applied by setting `normalize=True`.
def plot_confusion_matrix(y_test, y_pred, classes, normalize=True, title='Average accuracy \n', cmap=plt.cm.Blues, verbose = 0, precision = 0): from sklearn.metrics import confusion_matrix import itertools cm = confusion_mat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_confusion_matrix(cm, classes=[0,1], normalize=False, title='Confusion matrix', print_matrix=False):\n\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n...
[ "0.81922984", "0.80933887", "0.80272716", "0.8016492", "0.79913706", "0.79885876", "0.79777396", "0.7958926", "0.7954523", "0.79347897", "0.7931899", "0.7931772", "0.7928666", "0.7923684", "0.7921764", "0.79213995", "0.7920191", "0.792016", "0.7919876", "0.7915303", "0.791363...
0.79729784
7
Compute the distance between the image of the two walkers.
def image_distance(self, image_a, image_b): return np.average(np.abs(image_a - image_b))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_distance(asteroid_1: Asteroid, asteroid_2: Asteroid) -> float:\n dy = asteroid_2.y - asteroid_1.y\n dx = asteroid_2.x - asteroid_1.x\n return math.sqrt(dy * dy + dx * dx)", "def calculate_distance(self, other):\n return math.sqrt((self.center[0] - other.center[0]) ** 2 + (self.cente...
[ "0.6956604", "0.68596464", "0.68018985", "0.6801206", "0.67524415", "0.6715289", "0.6694984", "0.66926044", "0.6672271", "0.6669403", "0.66688395", "0.6663224", "0.66104704", "0.66072506", "0.6587042", "0.6578706", "0.656639", "0.6556694", "0.65498847", "0.654426", "0.6511978...
0.72036994
0
Returns the total amount donated. Note that this cannot be set directly
def total_donations(self): return sum(self.donations)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_donated(self):\n if not hasattr(self, 'dynamic_total'):\n agg = self.donations.aggregate(Sum('amount'))\n self.dynamic_total = agg['amount__sum']\n return self.current + (self.dynamic_total or 0)", "def total_donation(self):\n return self._total_donation", "...
[ "0.84859663", "0.8416094", "0.79917395", "0.7884996", "0.76701033", "0.74372333", "0.7431798", "0.739323", "0.73892415", "0.72756535", "0.72078335", "0.72069716", "0.71650785", "0.7123221", "0.7105591", "0.7105591", "0.71040183", "0.7099738", "0.70558643", "0.7053128", "0.704...
0.77891296
5
Returns total number of donations. Note that this cannot be set directly
def number_of_donations(self): return len(self.donations)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total_donations(self):\n return sum(self.donations)", "def total_donations(self):\n return sum(self.donations)", "def getTotDonation(self):\n return sum(self.donationList)", "def total_donation(self):\n return self._total_donation", "def getNumDonations(self):\n retur...
[ "0.8589657", "0.8589657", "0.8561676", "0.8109917", "0.7765514", "0.77646714", "0.756193", "0.7560437", "0.7162402", "0.6887679", "0.684835", "0.6672206", "0.6661667", "0.6592879", "0.6580284", "0.6519815", "0.6514637", "0.6445778", "0.6420979", "0.6418378", "0.6355728", "0...
0.77409375
6
Returns average value of donations. Note that this cannot be set directly
def average_gift(self): try: return self.total_donations / self.number_of_donations except ZeroDivisionError: return 0.0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def avg_donation(self):\n return self.tot_donations / self.num_donations", "def avg_donation(self):\n return self.tot_donations / self.num_donations", "def average_donation(self):\n return self.total_donations()/self.num_donations() if self.donations else 0", "def avg_donation(self):\n ...
[ "0.84927326", "0.84927326", "0.84867", "0.84058607", "0.82880247", "0.7492105", "0.72723633", "0.69723827", "0.6849497", "0.6823963", "0.6792132", "0.677094", "0.6732328", "0.6652337", "0.6647455", "0.664182", "0.66305345", "0.66209406", "0.65918636", "0.6548326", "0.6541297"...
0.79894733
5
Given a name string, returns a donor object. If donor name is not found, raises error
def get_donor_by_name(self, name): for donor in self.donors: if donor.name == name: return donor raise NameError(f"{name} not found in existing donors")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_donor(name):\n for donor in OO_mailroom.Donor.donor_db:\n # do a case-insensitive compare\n if name.strip().lower() == donor[0].lower():\n return donor\n\n return None", "def get_donor(self, name):\n return self.donors.get(name, Donor(name))", "def add_donor(self,...
[ "0.7633779", "0.75219125", "0.6728453", "0.63222396", "0.62105775", "0.61620086", "0.6037884", "0.59867156", "0.5873492", "0.5735956", "0.57154506", "0.5705273", "0.5687284", "0.5677311", "0.56625533", "0.56200784", "0.55826783", "0.5555458", "0.55243987", "0.55236936", "0.55...
0.807479
0
Builds a string representation of the board.
def __str__(self): s = "" for i in range(13,25): if (self.p1vec[i] > 0): s += "|W{0:02}|".format(self.p1vec[i]) elif (self.p2vec[25 - i] > 0): s += "|B{0:02}|".format(self.p2vec[25 - i]) else: s += "| |" s += '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n board = ''\n for row in range(self.height):\n if row > 0:\n board += '\\n'\n for col in range(self.width):\n if self.board[row][col] == '':\n board += '| '\n else:\n board += ...
[ "0.8320923", "0.8180966", "0.8119885", "0.8070673", "0.79848176", "0.7885029", "0.7873301", "0.78707016", "0.78653884", "0.78302664", "0.7789334", "0.77801037", "0.77403796", "0.7709853", "0.7686702", "0.7685174", "0.7643388", "0.7600637", "0.75896055", "0.75737107", "0.75179...
0.0
-1
Yield successive nsized chunks from l.
def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]", "def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]", "def get_chunks(self, ...
[ "0.8038813", "0.79248375", "0.7923423", "0.7885103", "0.78773195", "0.7815877", "0.77556044", "0.77441615", "0.7731815", "0.77288336", "0.772473", "0.77028215", "0.76889825", "0.76889825", "0.7664208", "0.76570904", "0.7655856", "0.7655856", "0.76458347", "0.76458347", "0.764...
0.77655786
6
compute the learning rate for the current epoch using stepbased decay function accept current epoch number return alpha, float type
def __call__(self, epoch): exp = np.floor((1 + epoch) / self.dropEvery) alpha = initAlpha * (self.factor ** exp) # return alpha return float(alpha)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate(epoch):\n return alpha / (1 + decay_rate * epoch)", "def learning_rate(epoch):\n return alpha / (1 + decay_rate * epoch)", "def learning_rate_decay(alpha, decay_rate, global_step, decay_step):\n epoc_number = int(global_step / decay_step)\n alpha /= (1 + decay_rate * epoc_...
[ "0.8758059", "0.8758059", "0.83477026", "0.8009185", "0.7997305", "0.79574716", "0.7826597", "0.7772954", "0.77721894", "0.76825863", "0.76820046", "0.7618414", "0.7615923", "0.7547335", "0.75228083", "0.7486968", "0.74644834", "0.7374739", "0.73511374", "0.73485696", "0.7305...
0.75532085
13
compute the learning rate for the current epoch based polynomical decay function accept current epoch number return alpha, float type
def __call__(self, epoch): decay = (1 - (epoch / float(self.maxEpochs))) ** self.power alpha = self.initAlpha * decay # return alpha return float(alpha)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learning_rate(epoch):\n return alpha / (1 + decay_rate * epoch)", "def learning_rate(epoch):\n return alpha / (1 + decay_rate * epoch)", "def learning_rate_decay(alpha, decay_rate, global_step, decay_step):\n epoc_number = int(global_step / decay_step)\n alpha /= (1 + decay_rate * epoc_...
[ "0.86319965", "0.86319965", "0.7959209", "0.7467585", "0.7454682", "0.7447842", "0.7407634", "0.73450756", "0.73330855", "0.7325286", "0.7319644", "0.7210983", "0.7183398", "0.71546346", "0.7076139", "0.7057818", "0.70495206", "0.7008298", "0.6985129", "0.6909909", "0.6901958...
0.80301523
2
Return a list of template names that have to be present in a theme. Not just a constant because maybe it's possible to calculate this dynamically in the future.
def get_required_template_names() -> list[str]: return [ "blog_list_of_posts.html", "post.html", "post_body.html", "episode.html", ]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def theme_names(self):\n return [theme.get('name', 'Error') for theme in self.themes]", "def get_all_theme_template_dirs():\n themes = get_themes()\n template_paths = list()\n\n for theme in themes:\n template_paths.extend(theme.template_dirs)\n\n return template_paths", "def get_temp...
[ "0.6731229", "0.6408916", "0.6401485", "0.6391858", "0.63730115", "0.63392", "0.62435174", "0.62070566", "0.6190701", "0.6169154", "0.6099229", "0.6091006", "0.608577", "0.6076122", "0.60121536", "0.6007308", "0.60067195", "0.59931135", "0.59731764", "0.594328", "0.5937756", ...
0.7397725
0
Convert the column name to a better formatted name
def format_colname(name): colnames = [ "AV", "RV", "EBV", "CAV1", "CAV2", "CAV3", "CAV4", "C1", "C2", "C3", "C4", "x_o", "gamma", "bump_area", "fh2", "nhtot", "nh2", "nhi",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def col_name(col):\n\n if isinstance(col, str):\n return col\n return col.__name__", "def _column_original_name(name):\n if ':' in name:\n return name.split(':')[-1]\n else:\n return name", "def short_column(name : str) -> str:\n return name.split(\"-\")[1]", "def getColNa...
[ "0.76860934", "0.74084234", "0.73931223", "0.73651046", "0.73651046", "0.72613406", "0.7124355", "0.7118157", "0.71164984", "0.6944369", "0.6933407", "0.68166155", "0.67752206", "0.6679174", "0.66615736", "0.66067", "0.6604551", "0.6562995", "0.65421194", "0.65103257", "0.648...
0.72542715
6
Get provider of the record.
def _get_record_import_provider(self, record): """Get an import provider of a given document.""" is_imported = record["created_by"]["type"] == "import" if is_imported: return record["created_by"]["value"]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_provider(self):\n return self.provider", "def provider(self):\n try:\n return self._db.providers[self._dbattr('provider')]\n except KeyError:\n # Provider isn't available (anymore?). Have no choice but to return\n # another provider. Here we just pi...
[ "0.82146305", "0.8005788", "0.78996366", "0.7670486", "0.7670486", "0.766938", "0.76554674", "0.7628194", "0.7616897", "0.7230712", "0.7177769", "0.7141914", "0.69666195", "0.68655115", "0.6838292", "0.6827448", "0.6827448", "0.6760789", "0.6658919", "0.66349775", "0.6603673"...
0.7105691
12
Remove the first component from a path and return it as a string.
def path_child(path): return path_to_str(parse_path(path)[1:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def noTrailingSlash(path):\n return path.split('/')[0]", "def _cleanup_path(path):\n return string.join(filter(None, string.split(path, '/')), '/')", "def strip_path(self):\n return self.path.replace('/', '')", "def strip_path(path):\n name_re = re.compile(\"[^/]*\\.([a-z]+)$\")\n return...
[ "0.7686441", "0.74526405", "0.73586035", "0.73570913", "0.735528", "0.73191434", "0.7178518", "0.7159617", "0.7150616", "0.71197957", "0.70986533", "0.7051172", "0.69395244", "0.6932388", "0.6917461", "0.6913279", "0.67789423", "0.6764077", "0.67176086", "0.66866", "0.6658276...
0.64807355
28
Returns a list of paths of the input nodes of this module.
def input_nodes(self): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def input_node_ids(self):\n return [i for i in range(self.n_inputs)]", "def inputs(self) -> List[str]:\n return self._model.inputs", "def get_input():\n nodes = []\n with open('input') as input_file:\n for line in input_file:\n # Inputs are separated by comma\n ...
[ "0.70373017", "0.702412", "0.6849438", "0.68439394", "0.67668396", "0.6565062", "0.6558921", "0.6525297", "0.6521266", "0.6521266", "0.6521266", "0.6486809", "0.6486809", "0.64483863", "0.64383316", "0.6372665", "0.6363827", "0.63455766", "0.63289434", "0.6328486", "0.6287727...
0.7313676
0
Returns a list of modules that have no upstream connections from other modules in this Tube.
def input_modules(self): return [k for k,v in self.graph.in_degree().iteritems() if v == 0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def no_coupons(self):\n return self._no_coupons", "def getRpmBlacklist():\n global index\n enabledRpms = set()\n for stream in enabledStreams.values():\n enabledRpms = enabledRpms.union(stream.get_rpm_artifacts())\n\n allRpms = set()\n for name in index.get_module_names():\n m...
[ "0.6188808", "0.600324", "0.58423984", "0.5724906", "0.5679772", "0.56591433", "0.5636009", "0.56307167", "0.5559666", "0.55543625", "0.554125", "0.5483249", "0.5478587", "0.54764676", "0.5458931", "0.5458249", "0.5430471", "0.5421711", "0.5416513", "0.5404595", "0.5404567", ...
0.54316
16
Close all the socket and close the connection with the database
def close(self): self.Log.log("Server Closed") for User in self.Users.values(): User.getSocket.shutdown(socket.SHUT_RDWR) User.getSocket.close() self.DB.close_connection() self.Log.closeFile() os._exit(0)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\r\n # close the connection and the socket\r\n self.conn.close()\r\n self.theSocket.close()", "def close_connections(self):\n self.db_connection.close_connections()", "def close(self):\n self.clean()\n\n for conn in self.conn__.values():\n tr...
[ "0.78052187", "0.7776122", "0.7766642", "0.7722363", "0.7544545", "0.7521178", "0.7492628", "0.74777365", "0.7450598", "0.74460244", "0.74344546", "0.74237347", "0.73988765", "0.73916584", "0.7390649", "0.7372357", "0.736095", "0.73101974", "0.7301682", "0.7300117", "0.730011...
0.73687905
16
Is the character Asian?
def is_asian(char): # 0x3000 is ideographic space (i.e. double-byte space) # Anything over is an Asian character return ord(char) > IDEOGRAPHIC_SPACE
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def character(x):\n if (x==\"a\"or x==\"A\"or x==\"e\"or x==\"E\"or x==\"i\"or x==\"I\"or x==\"o\"or x==\"O\"or x==\"u\"or x==\"U\"):\n return('True')\n else:\n return('False')", "def is_english(s):\n return s.isascii()", "def isChar(ch):\n ret = libxml2mod.xmlIsChar(ch)\n retu...
[ "0.7009953", "0.6419129", "0.6399396", "0.6329977", "0.6275846", "0.625407", "0.6245205", "0.6240923", "0.623599", "0.6215488", "0.6210089", "0.62028307", "0.6173283", "0.6169663", "0.616851", "0.6146252", "0.6144196", "0.6144137", "0.61239976", "0.6121634", "0.61169237", "...
0.7950206
0
Filters Asian characters to spaces
def filter_jchars(c): if is_asian(c): return ' ' return c
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter(string):\n # remove all unwanted characters\n return regex2.sub(' ', string)", "def _normalize_asian(cls, sentence: str) ->str:\n sentence = re.sub('([\\\\u4e00-\\\\u9fff\\\\u3400-\\\\u4dbf])', ' \\\\1 ', sentence)\n sentence = re.sub('([\\\\u31c0-\\\\u31ef\\\\u2e80-\\\\u2eff])', '...
[ "0.6703567", "0.66590214", "0.6559933", "0.6559029", "0.6530787", "0.6530787", "0.647398", "0.6464624", "0.6428735", "0.6393514", "0.63887304", "0.6383884", "0.63280165", "0.63105804", "0.6304482", "0.6294817", "0.6281393", "0.6263451", "0.6263451", "0.62509906", "0.6250818",...
0.7080732
0
Transform a dictionary into an object
def dict2obj(dictionary): class Obj(object): def __init__(self, dictionary): self.__dict__.update(dictionary) return Obj(dictionary)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def from_dict(cls, d):\n return cls(**d)", "def from_dict(cls, inp):\n return cls(**{k: v for k, v in inp.items() if k != '__class__'})", "def from_dict(cls, dict_object):\n\n return cls(**dict_object)", "def from_dict(cls, obj):\r\n raise NotImplementedError", "def _from_dict(c...
[ "0.7295608", "0.72149307", "0.71449685", "0.7142519", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", "0.7108952", ...
0.7792454
0
Get the wordcount as an object rather than a dictionary
def get_wordcount_obj(text): return dict2obj(get_wordcount(text))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_count(self):\n return Counter(self._normalize(self._raw_phrase_str))", "def word_count(self):\n\n # split words on default word boundaries for words list\n words = self.phrase.split() \n\n # translate removes punctuation only, normalizes to lower case\n normalized_word...
[ "0.7559499", "0.73307925", "0.7225375", "0.7196283", "0.7188003", "0.71567154", "0.7147245", "0.71105605", "0.70899516", "0.7089896", "0.7077979", "0.7075651", "0.70657235", "0.7003955", "0.69946426", "0.69123805", "0.6886816", "0.6870346", "0.68686366", "0.686018", "0.681107...
0.8658675
0
Function to let the user decide if he wants to search by habitat in csv file, search by habitat in database or search by coordinates. The function prints a string in the console to ask the user if he wants to search by putting in coordinates or the name of the habitat, furthermore it is asking the user if he wants to s...
def question(): print('Enter 1 to search database by habitat with detailed information\nEnter 2 to search database by coordinates \nEnter 3 to search by habitat in csv file for a quick overview without detail') print('habitat search options so far:\n Alpenvorland, Niederrheinisches Tiefland, Oberrheinisches Tie...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_by_habitat():\n habitat = input('Enter name of habitat\\n')\n habitat_search('habitat', habitat)\n print('Status 1 equals nativ')", "def searchUser(database):\n print(\"How do you want to search for a user\\n1.name\\n2.field\\n3.year of study\\n4.areas of interest\\n5.Quit\")\n choice=i...
[ "0.6695713", "0.6568012", "0.64201796", "0.6034079", "0.6018641", "0.5883209", "0.58117354", "0.5711111", "0.5684533", "0.565291", "0.55881894", "0.5575604", "0.55151117", "0.55100626", "0.54991347", "0.5486393", "0.54664874", "0.54324114", "0.5428779", "0.54240894", "0.53955...
0.7823244
0
Create a color based on an boolable value color.
def __init__(self, boolee): super(BinaryColor, self).__init__(1) self.boolee = bool(boolee)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def color(value):\r\n return 'RGB({}, {}, {})'.format(value.red(), value.blue(), value.green())", "def get_color(self, value):\n value = min(max(0,value), 1) * 510\n\n if value < 255:\n redValue = 255\n greenValue = math.sqrt(value) * 16\n greenValue = int(gr...
[ "0.7262096", "0.70305943", "0.6920897", "0.6737177", "0.6608812", "0.6401132", "0.63389426", "0.6324899", "0.6316891", "0.63068956", "0.62482524", "0.6229737", "0.62275225", "0.622272", "0.6172676", "0.6157154", "0.6151304", "0.61472166", "0.61363906", "0.6115662", "0.6089663...
0.0
-1
Centers the digit image
def _fix_crop(im): # Threshold the image and make it binary try: t = threshold_otsu(im) except ValueError: return im im_bw = im > t # Get the bounding box of the digit true_i = np.where(im_bw == True) bbox = (np.min(true_i[0])-1, np.max(true_i[0])+1, np.min(true_i[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def center_image(image):\r\n image.anchor_x = image.width / 2\r\n image.anchor_y = image.height / 2", "def center_image(image):\r\n image.anchor_x = image.width / 2\r\n image.anchor_y = image.height / 2", "def center_image(image):\n image.anchor_x = image.width/2\n image.anchor_y = image.heig...
[ "0.7154526", "0.7154526", "0.70408756", "0.66592675", "0.65745294", "0.65240353", "0.6490536", "0.6484243", "0.6352781", "0.63326603", "0.63240963", "0.62739795", "0.6246467", "0.624072", "0.6185471", "0.6183427", "0.615685", "0.6128446", "0.61228245", "0.6099227", "0.6099012...
0.0
-1
Testing _fetch_law with mock 404 request to raise exception
def test_private_fetch_law_exception(self, mock_requests): mock_requests.get.return_value.status_code = 404 setattr(self.law, 'silent', True) with self.assertRaises(SystemExit): self.law._fetch_law(('test', 'test'), Mock())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_fetch_url_not_ok():\n with patch(\"cheddar.index.remote.get\") as mocked:\n mocked.return_value = MagicMock()\n mocked.return_value.status_code = codes.bad_request\n with assert_raises(NotFoundError):\n fetch_url(\"http://example.com\", TIMEOUT, getLogger())", "def tes...
[ "0.77940136", "0.755831", "0.7542466", "0.7425588", "0.7409825", "0.7313014", "0.7280403", "0.72166383", "0.71769875", "0.7176118", "0.71625316", "0.70512754", "0.7023003", "0.70183665", "0.6997072", "0.6961579", "0.6927141", "0.69259065", "0.691707", "0.6910862", "0.6894505"...
0.82069445
0
Fan out the bullets based upon a constant. Is polymorphic
def angle_bullets(self, level): total_levels = float((level * 2) + 1) level = float(level) for i in range(1, int(total_levels)): if self.b_offset + 1 == i: # left side if total_levels / i >= (total_levels / level): self.x -= 2 * (total_levels - (i * 2)) # Right side els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fire_bullet(settings, screen, ship, bullets):\n if len(bullets) < settings.bullets_allowed: #create a new bullet and add it to the bullets group.bullets\n new_bullet = Bullet(settings, screen, ship.rect.centerx, ship.rect.top)\n bullets.add(new_bullet)# stores the new bullet in the group bulle...
[ "0.6686318", "0.6556954", "0.64881104", "0.6374172", "0.6297407", "0.6270749", "0.62501615", "0.62385374", "0.6175637", "0.61585927", "0.6147215", "0.6147215", "0.6147215", "0.61386454", "0.60985845", "0.60983014", "0.6086863", "0.6072307", "0.6066225", "0.6059452", "0.605293...
0.499261
99
Initialize the test media player.
def __init__(self, hass): self.hass = hass self._volume = 0 self._state = STATE_OFF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.player = Player()", "def testPlayback(self):\n \n pass", "def setUp(self):\n self.music_name = \"Test Music\"\n self.music = Music(name = self.music_name)", "def setUp(self):\r\n self.mod = VideoAnnotationModule(\r\n Mock(),\r\n ...
[ "0.7239926", "0.69533795", "0.65919566", "0.6359524", "0.634036", "0.62335837", "0.6194969", "0.6190293", "0.6169195", "0.6124055", "0.6056517", "0.6047785", "0.59821033", "0.5973933", "0.59624577", "0.5956652", "0.594816", "0.59361875", "0.5916558", "0.5912665", "0.58650625"...
0.0
-1
Play the media player.
def media_play(self): self._state = STATE_PLAYING
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_media_play(self) -> None:\n await self._projector.send_command(PLAY)", "async def async_media_play(self) -> None:\n await self._volumio.play()", "def play(self) -> None:\n self.system.notify(\"Jarvis::Play\")\n self.media.play()", "def play(self):\n self.pla...
[ "0.8326583", "0.793886", "0.7929608", "0.7863994", "0.7801968", "0.7642925", "0.7631622", "0.76120746", "0.7280757", "0.72618544", "0.72616374", "0.7247842", "0.7232999", "0.72322017", "0.7196845", "0.71684426", "0.71096843", "0.709751", "0.7067208", "0.70544285", "0.7022998"...
0.7916762
4
Toggle the power on the media player.
def toggle(self): if self._state in [STATE_OFF, STATE_IDLE, STATE_STANDBY]: self._state = STATE_ON else: self._state = STATE_OFF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def power():\n request_command(tv_command=TVCommand.power)", "async def async_toggle(self):\n await self.async_mute_volume(not self._muted)", "def set_power(self, power: bool):\r\n if not self.backlight:\r\n return\r\n\r\n self.backlight.power = power", "async def power_on(...
[ "0.76578224", "0.7010895", "0.69639224", "0.6952935", "0.6932181", "0.6907897", "0.68941844", "0.6891331", "0.68472993", "0.68458134", "0.6830424", "0.68268526", "0.68005884", "0.66966873", "0.6670634", "0.6644918", "0.66332847", "0.6625038", "0.6616644", "0.6534432", "0.6519...
0.0
-1
Initialize the test media player.
def __init__(self, hass): self.hass = hass self._volume = 0 self._state = STATE_OFF
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.player = Player()", "def testPlayback(self):\n \n pass", "def setUp(self):\n self.music_name = \"Test Music\"\n self.music = Music(name = self.music_name)", "def setUp(self):\r\n self.mod = VideoAnnotationModule(\r\n Mock(),\r\n ...
[ "0.7239926", "0.69533795", "0.65919566", "0.6359524", "0.634036", "0.62335837", "0.6194969", "0.6190293", "0.6169195", "0.6124055", "0.6056517", "0.6047785", "0.59821033", "0.5973933", "0.59624577", "0.5956652", "0.594816", "0.59361875", "0.5916558", "0.5912665", "0.58650625"...
0.0
-1
Play the media player.
def media_play(self): self._state = STATE_PLAYING
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def async_media_play(self) -> None:\n await self._projector.send_command(PLAY)", "async def async_media_play(self) -> None:\n await self._volumio.play()", "def play(self) -> None:\n self.system.notify(\"Jarvis::Play\")\n self.media.play()", "def play(self):\n self.pla...
[ "0.8326583", "0.793886", "0.7929608", "0.7863994", "0.7801968", "0.7642925", "0.7631622", "0.76120746", "0.7280757", "0.72618544", "0.72616374", "0.7247842", "0.7232999", "0.72322017", "0.7196845", "0.71684426", "0.71096843", "0.709751", "0.7067208", "0.70544285", "0.7022998"...
0.7916762
3
Given a row or column, returns whether it is considered in or out of the chessboard using a naive algorithm.
def is_in_chessboard(row_or_col): nonzero, = row_or_col.nonzero() # compute the approximate number of crossed squares squares = 0 for i, j in zip(nonzero, nonzero[1:]): if j - i >= min_square_dim: squares += 1 return squares >= 8
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check(chessboard, row, col, n):\n for i in range(col):\n if chessboard[row][i] == 1:\n return False\n\n for j, i in zip(range(row, -1, -1), range(col, -1, -1)):\n if chessboard[j][i] == 1:\n return False\n \n for j, i in zip(range(row, n, 1), range(col, -1, -1)):...
[ "0.7970713", "0.79626644", "0.7676941", "0.7563215", "0.7474851", "0.741597", "0.7372989", "0.73546726", "0.72765434", "0.72020245", "0.72004414", "0.71695024", "0.7136769", "0.7130269", "0.71214074", "0.7116217", "0.7114132", "0.7105124", "0.70965815", "0.709435", "0.7093464...
0.7881398
2
Convenience wrapper to find chessboard squares directly.
def find_chessboard_squares(image, min_square_dim): return compute_chessboard_squares(find_chessboard(image, min_square_dim))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_squares(self):\n\t\tself.squares = [x for x in range(self.low, self.high + 1) if sqrt(x) == int(sqrt(x))]", "def find_piece(self, piece_to_find):\n for row in range(BOARD_SIZE):\n for col in range(BOARD_SIZE):\n if self.board[row][col] is piece_to_find:\n ...
[ "0.680012", "0.63850665", "0.63850665", "0.6288601", "0.621816", "0.61594605", "0.6061391", "0.6039117", "0.60352516", "0.59699297", "0.5933631", "0.5932371", "0.5918066", "0.5914272", "0.58865654", "0.58426106", "0.58349353", "0.5826552", "0.58201206", "0.58185494", "0.58146...
0.6956288
0