query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Fout = StepsLoopElim(z, nstep, refr, Fin)
def _StepsLoopElim(z, nstep, _refr, Fin): if Fin._curvature != 0.0: raise ValueError('Cannot operate on spherical coords.' + 'Use Convert() first') if type(_refr) != _np.ndarray: refr=_np.ones((Fin.N,Fin.N))*_refr else: refr = _refr if Fin.field.sha...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def Steps(Fin, z, nstep = 1, refr = 1.0, save_ram=False, use_scipy=False):\n if use_scipy:\n print('Warning! Non-functional develop version for testing')\n return _TODOStepsScipy(z, nstep, refr, Fin)\n else:\n if save_ram:\n \"\"\"Loops version goes line by line and therefore ...
[ "0.7072827", "0.59755373", "0.5941127", "0.5819327", "0.5669764", "0.5650059", "0.55588233", "0.550102", "0.5428784", "0.54131347", "0.5399875", "0.53977257", "0.5364044", "0.532903", "0.5315553", "0.53038126", "0.5219699", "0.51920843", "0.51919526", "0.51860845", "0.5165078...
0.74516803
0
Sends out currently buffered tuples into the OutStream
def send_out_tuples(self): self._flush_remaining()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _flow_out(self):\n print(\"MESSENGER: flow_out online!\")\n while self.running:\n if self.sendbuffer:\n msg = self.sendbuffer.pop(0)\n for slc in (msg[i:i+1024] for i in range(0, len(msg), 1024)):\n self.sock.send(slc)\n time....
[ "0.64052886", "0.62859136", "0.6081198", "0.60260135", "0.58672017", "0.5828772", "0.5827336", "0.5813244", "0.5698249", "0.5698249", "0.5698249", "0.56707245", "0.56384087", "0.5621822", "0.5609799", "0.55863214", "0.5537483", "0.5507712", "0.5496249", "0.54878914", "0.54779...
0.816756
0
Add a new data tuple to the currently buffered set of tuples
def add_data_tuple(self, stream_id, new_data_tuple, tuple_size_in_bytes): if (self.current_data_tuple_set is None) or \ (self.current_data_tuple_set.stream.id != stream_id) or \ (len(self.current_data_tuple_set.tuples) >= self.data_tuple_set_capacity) or \ (self.current_data_tuple_size_in_by...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append_data(self, state, action, reward, next_state, finish): \r\n if len(self.data) < self.max_data:\r\n # if the list isn't already full we simply push the result \r\n # in the end of the list\r\n self.data.append(tuple((state, action, reward,\r\n ...
[ "0.67178386", "0.65612733", "0.6535137", "0.6501272", "0.6490034", "0.6437124", "0.6398622", "0.6361082", "0.63548344", "0.6224621", "0.61989343", "0.6176607", "0.61067885", "0.60862386", "0.60395473", "0.6039271", "0.5998674", "0.5998224", "0.5989515", "0.5973817", "0.596023...
0.75670093
0
Add a new control (Ack/Fail) tuple to the currently buffered set of tuples
def add_control_tuple(self, new_control_tuple, tuple_size_in_bytes, is_ack): if self.current_control_tuple_set is None: self._init_new_control_tuple() elif is_ack and (len(self.current_control_tuple_set.fails) > 0 or len(self.current_control_tuple_set.acks) >= self.control_tuple_set_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ack(self, tup_id):\n pass", "def mark(self, packets: list, ack:int):\n for p in packets:\n p.status = not (ack >= p.seq)", "def _add(self, sample):#obs_t, action, reward, obs_tp1, done):\n\n if self._next_idx >= len(self._buffer): #appends data if max capacity not reached yet\n ...
[ "0.63012135", "0.5405185", "0.5358342", "0.53100806", "0.53058296", "0.5279377", "0.5255119", "0.5180453", "0.5161624", "0.51415145", "0.50948703", "0.5082164", "0.50232875", "0.5011171", "0.49852023", "0.49677417", "0.49541932", "0.49541774", "0.494576", "0.49396497", "0.492...
0.65910095
0
Gets the in_crc_errors of this EthernetInterfaceStateCounters.
def in_crc_errors(self) -> str: return self._in_crc_errors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_error_count(self):\n return sum(1 for outcome in (r.outcome for r in self.values()) if outcome == Result.ERROR)", "def error_codes(self):\n self._sort_measurements()\n return self._error_codes", "def errors(self):\n return self._errors", "def errors(self):\n return ...
[ "0.60573727", "0.6008693", "0.5983023", "0.5976196", "0.5958705", "0.5941452", "0.5934648", "0.5934648", "0.5861613", "0.58460724", "0.57943374", "0.57753783", "0.57616436", "0.5757811", "0.5754062", "0.57420915", "0.57180834", "0.5715814", "0.55849123", "0.5571359", "0.55596...
0.7398159
0
Sets the in_crc_errors of this EthernetInterfaceStateCounters.
def in_crc_errors(self, in_crc_errors: str): self._in_crc_errors = in_crc_errors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_crc_errors(self) -> str:\n return self._in_crc_errors", "def pin_errors(self):\n for m in range(self.stage_width_list[-1]):\n error, _ = rqrmilib.calculate_submodel_error(self._get_native_object(), self.probe, len(self)-1, m)\n if error < 0: error = 0\n self....
[ "0.5896342", "0.5395938", "0.5179257", "0.50623256", "0.5042801", "0.50183034", "0.4890702", "0.48866343", "0.48642448", "0.48521268", "0.47887892", "0.4782435", "0.4781247", "0.47763357", "0.47662553", "0.47409695", "0.47344616", "0.47318164", "0.47045618", "0.46937796", "0....
0.73171175
0
Gets the out_mac_control_frames of this EthernetInterfaceStateCounters.
def out_mac_control_frames(self) -> str: return self._out_mac_control_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_control_frames(self, out_mac_control_frames: str):\n\n self._out_mac_control_frames = out_mac_control_frames", "def in_mac_control_frames(self) -> str:\n return self._in_mac_control_frames", "def get_output_states(self):\n return self.states[-self.num_output_states:]", "def o...
[ "0.7033605", "0.60319555", "0.5943384", "0.5885427", "0.52819777", "0.5132673", "0.51014555", "0.4915829", "0.48474354", "0.48359475", "0.48331392", "0.47986776", "0.47774732", "0.4737987", "0.47231963", "0.47011515", "0.4689595", "0.46890107", "0.46843612", "0.467629", "0.46...
0.7588379
0
Sets the out_mac_control_frames of this EthernetInterfaceStateCounters.
def out_mac_control_frames(self, out_mac_control_frames: str): self._out_mac_control_frames = out_mac_control_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_control_frames(self) -> str:\n return self._out_mac_control_frames", "def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n self._out_mac_pause_frames = out_mac_pause_frames", "def in_mac_control_frames(self, in_mac_control_frames: str):\n\n self._in_mac_control_frames...
[ "0.6493217", "0.62620753", "0.6197687", "0.52695286", "0.5215957", "0.5204796", "0.5107184", "0.48446578", "0.48292714", "0.48252577", "0.478978", "0.46264517", "0.45676315", "0.44905856", "0.44511288", "0.44125572", "0.44035754", "0.43936077", "0.4371298", "0.4369013", "0.43...
0.7815788
0
Gets the in_jabber_frames of this EthernetInterfaceStateCounters.
def in_jabber_frames(self) -> str: return self._in_jabber_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in8021q_frames(self) -> str:\n return self._in8021q_frames", "def frames(self):\n return self._frames", "def getBitstreamFrames(self):\n \n return self.bitstream_frames", "def frames(self) -> Optional[Tuple[int, ...]]:\n return self._frames", "def frames(self):\n ...
[ "0.6378796", "0.603588", "0.59283817", "0.5758429", "0.57235897", "0.56103545", "0.5593466", "0.55206674", "0.54036635", "0.5347683", "0.51754403", "0.51677436", "0.50893164", "0.50881815", "0.5049036", "0.50094336", "0.4955013", "0.4928021", "0.48765078", "0.48586693", "0.48...
0.64101976
0
Sets the in_jabber_frames of this EthernetInterfaceStateCounters.
def in_jabber_frames(self, in_jabber_frames: str): self._in_jabber_frames = in_jabber_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in8021q_frames(self, in8021q_frames: str):\n\n self._in8021q_frames = in8021q_frames", "def setBitstreamFrames(self, bitstream_frames):\n \n self.bitstream_frames = bitstream_frames", "def in_fragment_frames(self, in_fragment_frames: str):\n\n self._in_fragment_frames = in_fragm...
[ "0.6271759", "0.56085837", "0.5374923", "0.52433604", "0.5203372", "0.5111489", "0.5054765", "0.5042748", "0.48753044", "0.47989285", "0.47920913", "0.47463813", "0.47160676", "0.46952754", "0.46630594", "0.46541592", "0.4636371", "0.46317798", "0.46167383", "0.46044758", "0....
0.7030803
0
Gets the in_mac_control_frames of this EthernetInterfaceStateCounters.
def in_mac_control_frames(self) -> str: return self._in_mac_control_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_control_frames(self) -> str:\n return self._out_mac_control_frames", "def out_mac_control_frames(self, out_mac_control_frames: str):\n\n self._out_mac_control_frames = out_mac_control_frames", "def in_mac_control_frames(self, in_mac_control_frames: str):\n\n self._in_mac_contro...
[ "0.7189915", "0.60180163", "0.56577426", "0.5392892", "0.53714496", "0.519221", "0.5056037", "0.4978782", "0.49660945", "0.49532452", "0.49423724", "0.49228832", "0.4908662", "0.48266155", "0.48219743", "0.48202595", "0.4776814", "0.47630805", "0.47527596", "0.4747052", "0.47...
0.6799863
1
Sets the in_mac_control_frames of this EthernetInterfaceStateCounters.
def in_mac_control_frames(self, in_mac_control_frames: str): self._in_mac_control_frames = in_mac_control_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_control_frames(self, out_mac_control_frames: str):\n\n self._out_mac_control_frames = out_mac_control_frames", "def in_mac_pause_frames(self, in_mac_pause_frames: str):\n\n self._in_mac_pause_frames = in_mac_pause_frames", "def in_mac_control_frames(self) -> str:\n return self....
[ "0.67043686", "0.6038861", "0.5672515", "0.56510836", "0.53274435", "0.5254562", "0.4445458", "0.4445458", "0.4445458", "0.4444518", "0.4444518", "0.4444518", "0.44442022", "0.4410699", "0.43730503", "0.43190497", "0.4313677", "0.4313513", "0.43134677", "0.4304009", "0.427478...
0.74428856
0
Gets the out_mac_pause_frames of this EthernetInterfaceStateCounters.
def out_mac_pause_frames(self) -> str: return self._out_mac_pause_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n self._out_mac_pause_frames = out_mac_pause_frames", "def in_mac_pause_frames(self) -> str:\n return self._in_mac_pause_frames", "def out_mac_control_frames(self) -> str:\n return self._out_mac_control_frames", "def out_mac_co...
[ "0.7055911", "0.7000019", "0.6444536", "0.5876658", "0.5625761", "0.5483489", "0.5453817", "0.52632076", "0.50456977", "0.5024305", "0.49135113", "0.4865369", "0.47719425", "0.46946684", "0.46814248", "0.46787965", "0.46339795", "0.4571558", "0.45673487", "0.45552033", "0.448...
0.79727316
0
Sets the out_mac_pause_frames of this EthernetInterfaceStateCounters.
def out_mac_pause_frames(self, out_mac_pause_frames: str): self._out_mac_pause_frames = out_mac_pause_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_pause_frames(self) -> str:\n return self._out_mac_pause_frames", "def in_mac_pause_frames(self, in_mac_pause_frames: str):\n\n self._in_mac_pause_frames = in_mac_pause_frames", "def out_mac_control_frames(self, out_mac_control_frames: str):\n\n self._out_mac_control_frames = ou...
[ "0.7026317", "0.6995726", "0.6505345", "0.63402236", "0.5147634", "0.5043103", "0.5042597", "0.49938437", "0.49938437", "0.48698333", "0.48266417", "0.47526026", "0.46683708", "0.46634778", "0.46389803", "0.46296802", "0.4624143", "0.46109292", "0.4595691", "0.44697273", "0.4...
0.8089411
0
Gets the out8021q_frames of this EthernetInterfaceStateCounters.
def out8021q_frames(self) -> str: return self._out8021q_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in8021q_frames(self) -> str:\n return self._in8021q_frames", "def out8021q_frames(self, out8021q_frames: str):\n\n self._out8021q_frames = out8021q_frames", "def get_output_states(self):\n return self.states[-self.num_output_states:]", "def getRxBitstreamFrames(self):\n \n ...
[ "0.71820015", "0.6744631", "0.5510278", "0.5383207", "0.5346667", "0.5344923", "0.5344923", "0.53183883", "0.5306723", "0.53010005", "0.5296889", "0.5202992", "0.5148645", "0.51365405", "0.5051905", "0.5047685", "0.49978513", "0.4979188", "0.49165463", "0.49043173", "0.489526...
0.7720255
0
Sets the out8021q_frames of this EthernetInterfaceStateCounters.
def out8021q_frames(self, out8021q_frames: str): self._out8021q_frames = out8021q_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out8021q_frames(self) -> str:\n return self._out8021q_frames", "def in8021q_frames(self, in8021q_frames: str):\n\n self._in8021q_frames = in8021q_frames", "def in8021q_frames(self) -> str:\n return self._in8021q_frames", "def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n...
[ "0.6585833", "0.65762675", "0.59554595", "0.55730844", "0.5493888", "0.5312083", "0.528559", "0.52488816", "0.51416796", "0.50839984", "0.5076395", "0.5046384", "0.5038749", "0.5011937", "0.48653182", "0.4750888", "0.47085947", "0.46981674", "0.46793467", "0.46746898", "0.466...
0.7767299
0
Gets the in_mac_pause_frames of this EthernetInterfaceStateCounters.
def in_mac_pause_frames(self) -> str: return self._in_mac_pause_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_pause_frames(self) -> str:\n return self._out_mac_pause_frames", "def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n self._out_mac_pause_frames = out_mac_pause_frames", "def in_mac_pause_frames(self, in_mac_pause_frames: str):\n\n self._in_mac_pause_frames = in_mac_...
[ "0.7584451", "0.6313009", "0.62560797", "0.5867498", "0.55427855", "0.5449392", "0.53424543", "0.53121024", "0.51813775", "0.5081472", "0.50513446", "0.49324334", "0.4919263", "0.48718634", "0.48567387", "0.4841383", "0.48389903", "0.48388624", "0.48338", "0.47508964", "0.470...
0.7560741
1
Sets the in_mac_pause_frames of this EthernetInterfaceStateCounters.
def in_mac_pause_frames(self, in_mac_pause_frames: str): self._in_mac_pause_frames = in_mac_pause_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out_mac_pause_frames(self, out_mac_pause_frames: str):\n\n self._out_mac_pause_frames = out_mac_pause_frames", "def in_mac_pause_frames(self) -> str:\n return self._in_mac_pause_frames", "def out_mac_pause_frames(self) -> str:\n return self._out_mac_pause_frames", "def in_mac_control...
[ "0.725123", "0.66274834", "0.6350998", "0.57935256", "0.5363373", "0.5258837", "0.5258837", "0.5089063", "0.49907425", "0.4956762", "0.49190828", "0.48682356", "0.48596698", "0.4829827", "0.48048517", "0.4776468", "0.47563368", "0.46719763", "0.46446732", "0.4624764", "0.4622...
0.7816998
0
Gets the in8021q_frames of this EthernetInterfaceStateCounters.
def in8021q_frames(self) -> str: return self._in8021q_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out8021q_frames(self) -> str:\n return self._out8021q_frames", "def in8021q_frames(self, in8021q_frames: str):\n\n self._in8021q_frames = in8021q_frames", "def out8021q_frames(self, out8021q_frames: str):\n\n self._out8021q_frames = out8021q_frames", "def frames(self):\n retur...
[ "0.71351194", "0.6339355", "0.59229636", "0.5713465", "0.56837994", "0.56006235", "0.5552843", "0.55029756", "0.54313314", "0.54275054", "0.53166056", "0.53166056", "0.5247261", "0.5225429", "0.5166954", "0.5117023", "0.50822496", "0.5033245", "0.50320005", "0.50072026", "0.4...
0.78286594
0
Sets the in8021q_frames of this EthernetInterfaceStateCounters.
def in8021q_frames(self, in8021q_frames: str): self._in8021q_frames = in8021q_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def out8021q_frames(self, out8021q_frames: str):\n\n self._out8021q_frames = out8021q_frames", "def in8021q_frames(self) -> str:\n return self._in8021q_frames", "def out8021q_frames(self) -> str:\n return self._out8021q_frames", "def _set_state(self, v, load=False):\n if hasattr(v, \"...
[ "0.6929949", "0.625094", "0.5601833", "0.54671025", "0.5442822", "0.53836894", "0.5382144", "0.52150905", "0.5097022", "0.5054032", "0.5022572", "0.5015778", "0.5008591", "0.4955244", "0.4928791", "0.49045807", "0.48670253", "0.48636985", "0.48587534", "0.48559695", "0.485124...
0.78415835
0
Gets the in_fragment_frames of this EthernetInterfaceStateCounters.
def in_fragment_frames(self) -> str: return self._in_fragment_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in8021q_frames(self) -> str:\n return self._in8021q_frames", "def frames(self):\n return self._frames", "def frames(self) -> Optional[Tuple[int, ...]]:\n return self._frames", "def getBitstreamFrames(self):\n \n return self.bitstream_frames", "def frames(self) -> Set[...
[ "0.5892541", "0.5762407", "0.57438266", "0.5615864", "0.5420732", "0.53444934", "0.5216942", "0.5213491", "0.51945573", "0.5155906", "0.5154812", "0.51483124", "0.5137256", "0.5103703", "0.50683904", "0.5063307", "0.50345653", "0.5019307", "0.49768865", "0.49248967", "0.48932...
0.6254691
0
Sets the in_fragment_frames of this EthernetInterfaceStateCounters.
def in_fragment_frames(self, in_fragment_frames: str): self._in_fragment_frames = in_fragment_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in8021q_frames(self, in8021q_frames: str):\n\n self._in8021q_frames = in8021q_frames", "def in_mac_pause_frames(self, in_mac_pause_frames: str):\n\n self._in_mac_pause_frames = in_mac_pause_frames", "def setBitstreamFrames(self, bitstream_frames):\n \n self.bitstream_frames = bi...
[ "0.54070026", "0.5126206", "0.50561106", "0.49960083", "0.48903358", "0.486504", "0.48114645", "0.4711915", "0.4579438", "0.4569958", "0.45637053", "0.4553623", "0.4540556", "0.45011696", "0.4493236", "0.44772264", "0.44738507", "0.44633648", "0.4433969", "0.4379525", "0.4347...
0.6931512
0
Gets the in_undersize_frames of this EthernetInterfaceStateCounters.
def in_undersize_frames(self) -> str: return self._in_undersize_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_undersize_frames(self, in_undersize_frames: str):\n\n self._in_undersize_frames = in_undersize_frames", "def in_oversize_frames(self) -> str:\n return self._in_oversize_frames", "def dropped_frames(self):\n # type: () -> int\n return self._dropped_frames", "def _interFrameL...
[ "0.6350905", "0.5982443", "0.5291823", "0.52876616", "0.52365714", "0.52146083", "0.5165647", "0.5130818", "0.5070019", "0.5034629", "0.49446666", "0.49277195", "0.49043852", "0.48926738", "0.4868733", "0.48662025", "0.48474854", "0.48189792", "0.48124316", "0.48051026", "0.4...
0.7037414
0
Sets the in_undersize_frames of this EthernetInterfaceStateCounters.
def in_undersize_frames(self, in_undersize_frames: str): self._in_undersize_frames = in_undersize_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_oversize_frames(self, in_oversize_frames: str):\n\n self._in_oversize_frames = in_oversize_frames", "def in_undersize_frames(self) -> str:\n return self._in_undersize_frames", "def over_under(self, over_under):\n\n self._over_under = over_under", "def under_payout(self, under_payo...
[ "0.65120375", "0.57702565", "0.5469838", "0.51008725", "0.48230788", "0.4763972", "0.46930653", "0.4678629", "0.46650538", "0.45932403", "0.4580401", "0.45391226", "0.44710118", "0.44421825", "0.44421756", "0.44021887", "0.43817115", "0.4364254", "0.43604407", "0.43545508", "...
0.7754978
0
Gets the in_oversize_frames of this EthernetInterfaceStateCounters.
def in_oversize_frames(self) -> str: return self._in_oversize_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_undersize_frames(self) -> str:\n return self._in_undersize_frames", "def in_oversize_frames(self, in_oversize_frames: str):\n\n self._in_oversize_frames = in_oversize_frames", "def frames(self):\n return self._frames", "def _interFrameLen(self):\n return np.ceil((self.inter...
[ "0.60285544", "0.5985725", "0.5692084", "0.5522027", "0.5459115", "0.5455486", "0.54516566", "0.54265106", "0.53659225", "0.5323712", "0.5282424", "0.52705806", "0.5253019", "0.52148193", "0.5199649", "0.5123746", "0.51229596", "0.5093464", "0.5066823", "0.50545615", "0.50390...
0.681758
0
Sets the in_oversize_frames of this EthernetInterfaceStateCounters.
def in_oversize_frames(self, in_oversize_frames: str): self._in_oversize_frames = in_oversize_frames
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_undersize_frames(self, in_undersize_frames: str):\n\n self._in_undersize_frames = in_undersize_frames", "def in_oversize_frames(self) -> str:\n return self._in_oversize_frames", "def set_frame_size(self, frame_size_selector):\n raise NotImplementedError", "def in_undersize_frames(...
[ "0.63065225", "0.5737221", "0.5047642", "0.48290065", "0.4820693", "0.47127584", "0.46951994", "0.4627127", "0.46249563", "0.46246624", "0.45549476", "0.45269623", "0.44501114", "0.439822", "0.4381662", "0.43761912", "0.43570787", "0.43373895", "0.43185344", "0.43166107", "0....
0.75814646
0
Return only subset with values inside the percentile range.
def filter_percentile(df, col, up=95, down=5): pup = np.percentile(df[col].values, up) pdw = np.percentile(df[col].values, down) s = (df[col]<pup) & (df[col]>pdw) df2 = df[s] return df2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def percentile_between(self,\n min_percentile,\n max_percentile,\n mask=NotSpecified):\n return PercentileFilter(\n self,\n min_percentile=min_percentile,\n max_percentile=max_percentile,\n ...
[ "0.67882454", "0.67687726", "0.6670917", "0.6535926", "0.6529078", "0.6382206", "0.6361281", "0.63064474", "0.6273474", "0.623942", "0.6221624", "0.6217038", "0.6201381", "0.6169943", "0.61354387", "0.6128372", "0.60845566", "0.6081166", "0.6005251", "0.5995939", "0.5987703",...
0.68299216
0
Computes the distance of the shortest route beween pickup and dropoff points and adds additional column for the distance and duration.
def add_shortest_route(df): df['gmaps_dist'] = df.apply(lambda row: gmaps.getTotDist((row['pick_lon'], row['pick_lat']), (row['drop_lon'], row['drop_lat'])), axis=1) df['gmaps_dur'] = df.apply(lambda row: gmaps.getTotDur((row['pick_lon'], row['pick_lat']), (row['drop_lon'], row['drop_lat'])), axis=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_cols_distances(df):\n #create a column for haversine distance\n df['distance'] = haversine_array(df['pickup_longitude'], df['pickup_latitude'],\n df['dropoff_longitude'], df['dropoff_latitude'])\n\n df['manhattan_distance'] = dummy_manhattan_distance(df['pick...
[ "0.63980764", "0.63126314", "0.5934025", "0.5911284", "0.58578235", "0.58176494", "0.5728206", "0.5717512", "0.5642322", "0.5629971", "0.56161964", "0.56111544", "0.5578633", "0.55760974", "0.556775", "0.5538084", "0.55039656", "0.5483769", "0.54639286", "0.54306823", "0.5425...
0.687315
0
Filters out the entries that fall outside the given times times are defined in hours (023 h format)
def keep_daytimes(df, hours=range(0,24)): within_hours = lambda x: x.hour in hours df2 = df[df.pick_date.map(within_hours)] df2 = df2[df2.drop_date.map(within_hours)] return df2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def times_filter(d, times, meets_criteria=matches_timestr):\n mapping = map(type, times)\n if [ str, type(None), type(None) ] == mapping and meets_criteria(times[0]):\n d1 = doytimestr_to_datetime('%d:%s:00' % (d[0].year, times[0].replace('/',':')))\n #return '%s' % d1\n return d1, d1, ...
[ "0.6455543", "0.62802154", "0.6087417", "0.60471296", "0.60293597", "0.5940264", "0.58868945", "0.58801603", "0.58434105", "0.5817196", "0.57278675", "0.5706595", "0.57003665", "0.5651122", "0.5650807", "0.56497914", "0.56266606", "0.5610156", "0.56089383", "0.55980426", "0.5...
0.65106636
0
Retains only entries that have start and end points on keep_Manhattan
def keep_Manhattan(df): df2 = df.apply(lambda row: gmaps.onManhattan(row['pick_lat'], row['pick_lon']), axis=1) df2 = df2.apply(lambda row: gmaps.onManhattan(row['drop_lat'], row['drop_lon']), axis=1) return df2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mask_infeasible(self):\n ns = len(self)-1\n # mask entries with i+j+k > ns\n for ii in range(len(self)):\n for jj in range(len(self)):\n for kk in range(len(self)):\n if ii+jj+kk > ns:\n self.mask[ii,jj,kk] = True\n ...
[ "0.54532963", "0.53986764", "0.5377654", "0.5143955", "0.51214784", "0.51173705", "0.50975764", "0.5091678", "0.5089652", "0.50875735", "0.5046918", "0.50441074", "0.50204355", "0.4992703", "0.4977792", "0.49614924", "0.4941866", "0.49053788", "0.4876171", "0.48715258", "0.48...
0.70864785
0
Gets meta information about a User. This call requires an access token. Returns a map of User Metainformation, including their name, email address and identities for scope you've initialized this client for. User's will have the ability to restrict what is being sent back, so you make no assumptions.
def get_user_info(self): if self._access_token is None: raise RequiresAccessTokenError() response = self.__make_oauth_request(USER_INFO_URL, token=self._access_token, signed=True) return simplejson.loads(response.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_info(self):\r\n param = {}\r\n param['appid'] = self.apiKey\r\n param['nonce'] = int(time.time()*1000)\r\n param['timestamp'] = int(time.time())\r\n return self.__signed_GET('/api/v1/users/me', param, self.timeout)", "def userinfo(self, access_token: str) -> dict[str, ...
[ "0.74935466", "0.74522954", "0.73099357", "0.72829753", "0.71101224", "0.7093765", "0.705634", "0.7036187", "0.7020108", "0.6884064", "0.68525213", "0.6781138", "0.6754601", "0.6740212", "0.6739092", "0.66530573", "0.665027", "0.66388005", "0.6638445", "0.6636103", "0.6633674...
0.752399
0
Retrieves a user's photos based on the Query passed in. This call requires an access token.
def get_photos(self,query=None): if self._access_token is None: raise RequiresAccessTokenError() parameters = self.__get_default_oauth_params() base_url = CONTENT_ROOT_URL + 'photos/' if query is not None: query_post = simplejson.dumps(query, cls=JSONFac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_user_photos(self, user_id, count = 30, page = 1):\n uri = 'users/' + user_id + '/photos'\n options = { 'per_page': count, 'page': page }\n return self.make_request(uri, options)", "def getUserPhotos(user_id=None, offset=None, count=None, extended=None,\\\n sort=None):\n param...
[ "0.7614485", "0.7255964", "0.69195616", "0.67747796", "0.67344743", "0.65135425", "0.6310514", "0.621922", "0.62016976", "0.61329424", "0.609697", "0.6043526", "0.60157907", "0.60153955", "0.6014898", "0.60011506", "0.5959358", "0.594674", "0.59426105", "0.59329635", "0.59193...
0.78311
0
Pushes a list of photos for user_id specified into Trove associated to your service. This call requires an access token. Returns a map of the status of your push.
def push_photos(self, user_id, photos_list= []): if self._access_token is None: raise RequiresAccessTokenError() if photos_list is None: return parameters = self.__get_default_oauth_params() json_photos_list = simplejson.dumps(photos_list, cls...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_photos(self, user_id):\n\n json_photos = self._receive_photos_from_vk(user_id)\n return self._parse_photos(json_photos)", "def get_user_photos(self, user_id, count = 30, page = 1):\n uri = 'users/' + user_id + '/photos'\n options = { 'per_page': count, 'page': page }\n return self....
[ "0.60709953", "0.59057105", "0.574265", "0.54020333", "0.53772634", "0.5354139", "0.5322702", "0.5288253", "0.5244493", "0.52202344", "0.52050126", "0.51932615", "0.5093127", "0.5091334", "0.50782126", "0.5063789", "0.50014734", "0.49831143", "0.49274778", "0.48915923", "0.48...
0.7733553
0
Gets all the services Trove provides for the scope set for this client. This call requires an access token. Returns a list of service names
def get_services(self): if self._access_token is None: raise RequiresAccessTokenError() response = self.__make_oauth_request(ADD_URLS_FOR_SERVICES_URL, token=self._access_token, signed=True) return simplejson.loads(response.read()).keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_services(ctx):\n pass", "def get_services(self):\r\n return get_service_list()", "def services(self):\n return self.agent.http.get(\n lambda x: json.loads(x.body), '/v1/agent/services')", "async def api_get_services(g: WalletTypeInfo = Depends(get_key_type)):\n ...
[ "0.6984469", "0.69412225", "0.66245526", "0.66235155", "0.6579205", "0.65485835", "0.65166736", "0.6498914", "0.6463897", "0.6399903", "0.6384081", "0.636843", "0.6330748", "0.6315071", "0.6284407", "0.6248869", "0.62268686", "0.622128", "0.6209543", "0.61957484", "0.6181952"...
0.7277586
0
This creates a URL that allows a user to add a service to their Trove and then immediately bounce back to your service. If a redirect_url URL is specified it uses that, otherwise it uses your application's default. This call requires an access token. Returns a onetime use URL for the user
def get_url_for_service(self, service, redirect_url=None): if self._access_token is None: raise RequiresAccessTokenError() response = self.__make_oauth_request(ADD_URLS_FOR_SERVICES_URL, token=self._access_token, signed=True) services = simplejson.loads(response.read()) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GenerateUrl():\n params = {}\n params['client_id'] = Constants.USER['CLIENT_ID']\n params['redirect_uri'] = Constants.AUTH['REDIRECT']\n params['scope'] = Constants.AUTH['SCOPE']\n params['response_type'] = 'code'\n return '%s?%s' % (Constants.OAUTH, FormatUrl(params))", "def create_login_url(dest_url)...
[ "0.59354043", "0.57290274", "0.5727787", "0.5565489", "0.5514525", "0.5430484", "0.5423735", "0.5421983", "0.54210055", "0.53864574", "0.5351164", "0.5340485", "0.5326271", "0.53262687", "0.5283748", "0.5280621", "0.5240119", "0.5233878", "0.52310467", "0.5212325", "0.521141"...
0.6821791
0
A formatted string for the time
def _time_str(self): try: if not self._time: raise ValueError format_ = '%a, %d %b %Y %H:%M:%S' return datetime.fromtimestamp(float(self._time)).strftime(format_) except ValueError: return plastic_date()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time_string(self):\n return f\"{self.year} {self.month:02} \" \\\n f\"{self.start_day:02} {self.start_hour:02} 00 {self.get_duration():6}\"", "def get_time_str():\n return time.strftime(time_fmt)", "def timestr():\n return dt.strftime(dt.now(),'%H:%M:%S')", "def get_time() -> ...
[ "0.8351121", "0.83088106", "0.8237446", "0.8126203", "0.80516624", "0.79543203", "0.7938748", "0.7932358", "0.7905305", "0.7883502", "0.7874176", "0.77869517", "0.77774405", "0.7762425", "0.7730145", "0.77095145", "0.7668199", "0.76607364", "0.7654668", "0.76154906", "0.76074...
0.84001446
0
A list of time, size and sum as strings
def strings(self): return [str(self._time), str(self._size), str(self._sum)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum(self):\n\n return time_stat(self, stat=\"sum\")", "def daily_speed_sum_reduce(key, values):\n\tyield \"%s: %s, %s\\n\" % (key, sum([int(value) for value in values]), len(values))", "def sum_syllable_durations(syllable_tuple):\n# if syllable_tuple[0] == None:\n# return\n total_duration =...
[ "0.57643455", "0.5715434", "0.5670051", "0.56625825", "0.56625825", "0.56625825", "0.5645925", "0.56295544", "0.562888", "0.55296034", "0.54768246", "0.5448791", "0.5442174", "0.5436426", "0.54074717", "0.5381458", "0.5375841", "0.5375841", "0.5375841", "0.53742474", "0.53070...
0.70482224
0
Make sure all keys are in items If any key is missing add an empty signature
def pad_keys(items, keys): for key in keys: if key not in items: items[key] = EmptySignature() return items
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unique_upload_items(upload_items: List[JSONDict]) -> None:\n validated = UploadCollection(items=upload_items)\n assert validated.dict() == upload_items", "def checkitems(f):\n if hasattr(f, 'keys'):\n for key in f.keys():\n checkitems(f[key])", "def test_signature_verificati...
[ "0.6055478", "0.60164857", "0.5805301", "0.57510453", "0.57400286", "0.56953305", "0.56633586", "0.55882996", "0.5567685", "0.5565619", "0.5561965", "0.5554082", "0.5496323", "0.5495257", "0.54891974", "0.5474858", "0.54696745", "0.5441635", "0.5414766", "0.5410849", "0.53883...
0.7530774
0
Gives a dict of default values for the default basenames
def default_values(): return pad_keys({}, default_basenames())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_default_paths(self):\n return {key: value.default_path for key, value in self}", "def _set_defaults(self):\n defaults = {key: val[0][1].replace(\"*\", \"\")\n for key, val in self._filetypes.items()}\n defaults[\"default\"] = None\n defaults[\"video\"] = \"....
[ "0.72069955", "0.68583864", "0.66325927", "0.6597134", "0.64112484", "0.6309855", "0.6276205", "0.6239227", "0.6172898", "0.6125212", "0.60756797", "0.6060313", "0.5901511", "0.58948237", "0.5881978", "0.58784825", "0.5855825", "0.57867914", "0.5762056", "0.57578444", "0.5742...
0.7826241
0
Write default values to the data file
def write_default_values(): values = default_values() write_files(values, path_to_data()) return values
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_defaults(self):\n\n pass", "def set_default_values_as_needed(self):\n if self.verbose:\n click.echo('Updating required default values')\n for field in ARGUMENTS_DEFAULT_VALUES:\n if self.__class__.__name__ in ARGUMENTS_DEFAULT_VALUES[field][1]:\n ...
[ "0.6948151", "0.6358153", "0.62285906", "0.610469", "0.60925806", "0.6059484", "0.6034509", "0.60153824", "0.601108", "0.58532745", "0.5852114", "0.5850187", "0.58239406", "0.58199143", "0.58171266", "0.57971406", "0.577454", "0.5718938", "0.5703511", "0.56956714", "0.5683636...
0.8526922
0
Read old date, size and md5sum for those basenames If old values are not present, write defaults
def old_values(basenames): p = path_to_data() if not p.isfile(): if not p.parent.isdir(): p.parent.makedirs_p() return write_default_values() else: return read_old_values(basenames)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _load_md5s(self) -> None:\n self._md5s = {}\n path = os.path.join(self.path, \".fairly_md5\")\n try:\n with open(path, \"r\") as file:\n reader = csv.reader(file)\n for name, date, size, md5 in reader:\n self._md5s[name] = (date, ...
[ "0.61071485", "0.56512654", "0.54872435", "0.5477451", "0.5371913", "0.53684896", "0.531933", "0.5300759", "0.5288781", "0.52639645", "0.5258812", "0.5214125", "0.5174853", "0.51652807", "0.5146789", "0.51180816", "0.5077627", "0.5072585", "0.5070994", "0.50675404", "0.506678...
0.670406
0
takes a list mxd_lst of integers and floats
def sum_mixed_list(mxd_lst: List[Union[int, float]]) -> float: return sum(mxd_lst)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_floats(lst):\n vals = []\n for arg in lst:\n vals.append( float(arg) )\n return vals", "def list_to_float(l: list) -> [list, int]:\n\n # Initialisations\n l_o = []\n l_f = 0\n\n # Loop through the list\n for i in l:\n\n # Add the current list item as a float\n ...
[ "0.7161662", "0.6370329", "0.60965574", "0.6052821", "0.5977938", "0.59646046", "0.59522206", "0.5904633", "0.5861298", "0.5849342", "0.5801846", "0.57935387", "0.5791203", "0.57400674", "0.57291776", "0.5706854", "0.5706854", "0.5699537", "0.5677725", "0.563607", "0.56122833...
0.6796813
1
Resolve a country code, either by its iso code or its real name.
def resolveCountryCode(country_code): country_name = None if len(country_code) > 2: country_name = country_code country_code = next((cc for cc, country in countries.items() if country == country_code), None) if country_code not in countries: logger.error("Country code %s unknown. For...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country(alpha_2_code: str) -> None:", "def country_codes(country):\n countryObject = None\n try:\n countryObject = pycountry.countries.search_fuzzy(country)\n return countryObject[0].alpha_2\n except LookupError:\n pass\n try:\n splittedCountry = country.split(',')[0]\...
[ "0.76490396", "0.7576613", "0.75510937", "0.7456982", "0.73273176", "0.72916764", "0.72532296", "0.7127266", "0.7006585", "0.696231", "0.67665356", "0.6718253", "0.669792", "0.6670854", "0.66699326", "0.66288614", "0.6560287", "0.6465518", "0.6420241", "0.64155555", "0.638095...
0.7722758
0
Execute an elasticsearch query.
def executeQuery(es_client, index_name, query): try: result = es_client.search(index=index_name, body=query) except: etype, evalue, etb = sys.exc_info() logger.error('The query %s failed. Exception: %s, Error: %s.' % (query, etype, evalue)) sys.exit(255) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute_query():\n start_time = time.time()\n\n queries = request.json[\"queries\"]\n random_command = request.json[\"random_command\"]\n\n \"\"\" Running the queries against the pre-loaded index. \"\"\"\n output_dict = runner.run_queries(queries, random_command)\n\n \"\"\" Dumping the result...
[ "0.66292334", "0.6508774", "0.64909714", "0.64459985", "0.63409144", "0.62607425", "0.6243883", "0.6243883", "0.62395334", "0.6232509", "0.6217999", "0.6172825", "0.6111878", "0.6098865", "0.60955876", "0.60763067", "0.6066732", "0.60407966", "0.6032059", "0.5990485", "0.5990...
0.8146923
0
Get a list of ipaddresses via an elasticsearch query. The query needs to return the ipaddresses as first aggregated field in result['aggregations']. The easiest way to build such a query is to use the kibana facet module and copy the used query via the info button of this module.
def getIpListFromElasticsearch(query_name, min_term_count=0): es = connect() result = executeQuery(es, index_name, elasticsearch_queries.queries[query_name]) try: hits = result['aggregations'].itervalues().next()['buckets'] hit_count = len(hits) except: logger.error("The search d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _generate_es_query_external():\n\n internal_ips = [net[0] for service in Service.objects.all() for net in get_internal_ips(service)]\n\n query_object = {\n \"size\": 0,\n \"query\": {\n \"constant_score\": {\n \"filter\": {\n \"and\": [\n ...
[ "0.6376308", "0.6355661", "0.6335526", "0.6106069", "0.6073363", "0.6058697", "0.6056291", "0.59692895", "0.5961701", "0.591934", "0.5782333", "0.5775313", "0.576883", "0.5756681", "0.57089597", "0.5665999", "0.56554145", "0.56516623", "0.56351364", "0.5598572", "0.55883455",...
0.79240066
0
Get the contents of a given url and parse out all contained ip addresses.
def getIpListFromUrl(url): ip_list = [] try: url_content = urllib2.urlopen(url).read() except: etype, evalue, etb = sys.exc_info() logger.error('Failed to retrieve ip list from %s. Exception: %s, Error: %s.' % (url, etype, evalue)) sys.exit(255) regex_ip = re.compile('(\d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getBaseIP(url: str) -> list:\n \n response = requests.get(url) #get data \n\n ip_sets = response.text\n ip_list = re.findall(r'(?:\\d{1,3}\\.)+(?:\\d{1,3})', ip_sets)\n \n return ip_list", "def public_ip_url(url, sanitize=(lambda x:x)):\n reply = requests.get(url)\n if reply.status_code == 200:\n...
[ "0.7436882", "0.6440063", "0.6356581", "0.62754", "0.6145245", "0.6119254", "0.59713084", "0.5853543", "0.584543", "0.5794866", "0.57793134", "0.5765688", "0.5758061", "0.57507443", "0.57174253", "0.56947297", "0.56870025", "0.5656026", "0.56544685", "0.5651182", "0.56426984"...
0.7709024
0
Creates an ipset via If the ipset already exists it will be flushed.
def createIpSetList(set_list_name): result = subprocess.Popen("/usr/sbin/ipset list", shell=True, stdout=subprocess.PIPE).stdout.read() if "Name: %s" % set_list_name in result: # Flush existing set. #result = subprocess.Popen("/usr/sbin/ipset flush %s 2>&1" % set_list_name, shell=True, stdout=su...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create(self, name):\n command = [\n 'ipset create -exist ' + name + ' hash:net family inet maxelem 536870912',\n ]\n self.__run(command)", "def _add(self, name, ipset_name, ip):\n if name != 'whitelist-total':\n command = [\n 'ipset -exist add...
[ "0.72504485", "0.62594074", "0.60417557", "0.5949366", "0.5767696", "0.5720751", "0.568111", "0.56809855", "0.56697416", "0.557517", "0.53935766", "0.53624547", "0.5358984", "0.5348951", "0.5305357", "0.5276135", "0.5258385", "0.5249081", "0.52208227", "0.51972437", "0.514751...
0.68966055
1
Add a list of ip addresses to an existing ipset.
def addIpAddressesToIpSet(set_list_name, ip_addresses): for ip_address in ip_addresses: result = subprocess.Popen("/usr/sbin/ipset -A %s %s 2>&1" % (set_list_name, ip_address), shell=True, stdout=subprocess.PIPE).stdout.read() if result.strip() != "": logger.error("Could not add ip addre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_ips(self, ip_addresses: Iterable[str], **kwargs):\n _, ip_entities = _GEO_LITE.lookup_ip(ip_addr_list=ip_addresses)\n self.add_ip_cluster(ip_entities=ip_entities, **kwargs)", "def _add(self, name, ipset_name, ip):\n if name != 'whitelist-total':\n command = [\n ...
[ "0.676467", "0.649732", "0.64929414", "0.6141549", "0.60247886", "0.5960413", "0.5927123", "0.58467174", "0.577371", "0.57610315", "0.57310015", "0.5678567", "0.5670974", "0.56174296", "0.5593991", "0.5582271", "0.55734146", "0.5557675", "0.5535049", "0.5508964", "0.54320335"...
0.79702735
0
Flush the iptables INPUT chain. That will effectively unblock all currently blocked ip addresses.
def unblockAll(): result = subprocess.Popen("/sbin/iptables -F INPUT 2>&1", shell=True, stdout=subprocess.PIPE).stdout.read() if result.strip() != "": logger.error("Could not flush INPUT chain. Error: %s." % (result)) result = subprocess.Popen("/usr/sbin/ipset destroy 2>&1", shell=True, stdout=subpr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def flush_iptables(host, chain='OUTPUT'):\n host_resource = rhevm_helpers.get_host_resource(host, config.HOSTS_PW)\n return host_resource.firewall.chain(chain).clean_rules()", "def flushRules(self):\n self.chain.flush()", "def flushInput(self):\n self.sock.setblocking(0)\n try:\n ...
[ "0.67647374", "0.60715204", "0.6070052", "0.6000688", "0.59887236", "0.5711426", "0.5533895", "0.5495388", "0.5492287", "0.54293615", "0.5379646", "0.52421033", "0.52314407", "0.51725656", "0.5118544", "0.50936925", "0.5092832", "0.5034186", "0.5031313", "0.5024817", "0.50185...
0.75055516
0
Print out a list of all configured elasticsearch queries available for selecting ip address to be blocked.
def listQueries(): for query_name in elasticsearch_queries.queries.keys(): logger.info("Query name: %s" % query_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIpListFromElasticsearch(query_name, min_term_count=0):\n es = connect()\n result = executeQuery(es, index_name, elasticsearch_queries.queries[query_name])\n try:\n hits = result['aggregations'].itervalues().next()['buckets']\n hit_count = len(hits)\n except:\n logger.error(\...
[ "0.6158994", "0.6017932", "0.6011655", "0.58202475", "0.57494557", "0.56817764", "0.56529844", "0.5557907", "0.5548523", "0.55275244", "0.54807305", "0.5458461", "0.5399382", "0.53940016", "0.5391546", "0.5324692", "0.5306906", "0.52373856", "0.52199477", "0.52037805", "0.518...
0.65595114
0
Calculates the deltas for this layer as a hidden layer.
def calcDeltaHiddenLayer(self, WeightedDelta): return self.prevZ*(1.0-self.prevZ)*(WeightedDelta)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_hidden_delta(self):\r\n out = self.activation\r\n outedges = self.out_edges\r\n wsum = 0.0\r\n for edge in outedges:\r\n wsum += edge.old_weight*(edge.dest.delta)\r\n self.delta = out*(1-out)*wsum", "def compute_deltas(self, target):\n self.deltas[...
[ "0.77027667", "0.6774457", "0.67510605", "0.6679201", "0.6302988", "0.6302988", "0.6144385", "0.6093085", "0.6083357", "0.60093915", "0.5951483", "0.595041", "0.5948563", "0.5891299", "0.5876201", "0.5858596", "0.5755565", "0.57287306", "0.568319", "0.5663905", "0.56586814", ...
0.74919724
1
As the dict has_key >>> y = Yaco() >>> y['a'] = 1 >>> y.b.c = 2 >>> assert(y.has_key('a')) >>> assert(y.b.has_key('c')) >>> assert(y.has_key('b.c'))
def has_key(self, key): if '.' in key: first, second = key.split('.', 1) return self[first].has_key(second) else: return key in self.keys()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has(self, key):", "def has_key(self, key):\n return self.__dict__.has_key(key)", "def __contains__(self, key):\n try:\n self[key]\n return True\n except:\n return False", "def has(self, key):\n return False", "def has_deep_key(obj, key):\n\tif isinstance(key, str):\n\...
[ "0.6898479", "0.6491651", "0.6433575", "0.64167064", "0.6337533", "0.61512095", "0.6133311", "0.60946065", "0.60766256", "0.60649073", "0.6049347", "0.60473657", "0.60371643", "0.6036208", "0.603536", "0.59960073", "0.59705555", "0.5891124", "0.5886708", "0.58793646", "0.5850...
0.6626589
1
as getattr, expect for when there is a '.' in the key. it is possible to ask for yacoobject[''] this is a form of leaf loading but means, give me the root. So checking for that
def __getitem__(self, key): #print( key) if key == '': return self if not isinstance(key, str): return self.__getattr__(key) elif not '.' in key: return self.__getattr__(key) else: k1, k2 = key.split('.', 1) return se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __getitem__(self, key):\n key_split = key.split('.')\n current = self\n for k in key_split:\n current = getattr(current, k)\n return current", "def get_attr(obj: Any, key: str):\n if key.strip() == \"\":\n return obj\n for k in key.s...
[ "0.67005324", "0.6678772", "0.6678772", "0.6677924", "0.65971226", "0.65925825", "0.63411015", "0.63033617", "0.62176967", "0.61889416", "0.6156453", "0.6141544", "0.6126625", "0.6086024", "0.6030427", "0.60022116", "0.59987247", "0.58459353", "0.5821275", "0.5765317", "0.575...
0.69875765
0
as setattr, except for when there is a dot in the key
def __setitem__(self, key, value): if not '.' in key: return self.__setattr__(key, value) else: k1, k2 = key.split('.', 1) self.__getattr__(k1)[k2] = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __setitem__(self, key, value):\n if not isinstance(key, str) or '.' not in key:\n return dict.__setitem__(self, key, value)\n\n obj, token = _descend(self, key)\n return dict.__setitem__(obj, token, value)", "def __setitem__(self, key, value):\n if '.' in key:\n ...
[ "0.7555581", "0.75074935", "0.6982534", "0.6826406", "0.6823249", "0.6806088", "0.67791414", "0.67757636", "0.67564523", "0.6711114", "0.6623909", "0.658507", "0.6549267", "0.6541366", "0.6478689", "0.646065", "0.6453051", "0.6436351", "0.6428386", "0.6317634", "0.63160384", ...
0.79765624
0
Recursively parse a list & replace all dicts with Yaco objects
def _list_parser(self, old_list): for i, item in enumerate(old_list): if isinstance(item, dict): old_list[i] = Yaco(item) elif isinstance(item, list): old_list[i] = self._list_parser(item) else: pass return old_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _populate_attributes(self, obj, traverse_list=True):\n for key, value in obj.__dict__.items():\n if isinstance(value, dict):\n obj.__dict__[key] = self._reconstruct_object(value)\n elif isinstance(value, list):\n obj.__dict__[key] = [self._reconstruct_...
[ "0.6077241", "0.6071965", "0.59434056", "0.5891732", "0.5702263", "0.56620353", "0.54863834", "0.54181623", "0.5404956", "0.53706634", "0.53459495", "0.5338", "0.5303963", "0.5240408", "0.52308273", "0.52279073", "0.5220153", "0.5219189", "0.5162217", "0.51530033", "0.5148448...
0.71860534
0
Prepare & parse data for export >>> y = Yaco() >>> y.a = 1 >>> y.b = 2 >>> y._c = 3 >>> assert(y._c == 3) >>> d = y.get_data() >>> assert('a' in d) >>> assert('b' in d) >>> assert(not 'c' in d) >>> y._private = ['b'] >>> d = y.get_data() >>> assert('a' in d) >>> assert(not 'b' in d) >>> assert(not '_c' in d)
def get_data(self): data = {} _priv = self.get('_private', []) def check_data(v): if isinstance(v, Yaco): v = v.get_data() elif isinstance(v, list): v = [check_data(x) for x in v] return v for k in list(self.keys()): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data():\n pass", "def get_data():\n pass", "def get_data():\n pass", "def get_data():\n pass", "def _get_data(self):\n raise NotImplementedError()", "def prepare_data(self):", "def _extract_data(self, *args, **kwargs) -> None:\n raise NotImplementedError", "def g...
[ "0.6033262", "0.59212184", "0.59212184", "0.59212184", "0.5885019", "0.5820558", "0.5727447", "0.5716499", "0.5660484", "0.56455", "0.563034", "0.5621592", "0.55754626", "0.55695856", "0.5569359", "0.5569359", "0.55690813", "0.55388504", "0.55290484", "0.5504952", "0.5502008"...
0.6746213
0
This function moves 2 disks from from_rod to to_rod with the help of mid_rod
def _move_disks(from_rod, to_rod, mid_rod, number_of_disks): if number_of_disks <= 2: # Actually this is not needed. _move_one_step(from_rod, mid_rod) _move_one_step(from_rod, to_rod) _move_one_step(mid_rod, to_rod) print("from_rod: %s", from_rod.arr) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_of_king_and_rook(self, from_row, from_col, to_row, to_col): \n #provjere da li su kraljevi ili topovi inicirali pomijeranje\n if(from_row == 7 and from_col == 0):\n self.wrl_moved = True\n elif(from_row == 7 and from_col == 7):\n self.wrr_moved = True\n e...
[ "0.5708684", "0.5702798", "0.54862374", "0.54733807", "0.54640585", "0.53849787", "0.53009045", "0.5207499", "0.51961225", "0.51937234", "0.51713866", "0.5087997", "0.50724465", "0.50438124", "0.50176406", "0.5010497", "0.5007928", "0.50027186", "0.49800694", "0.49612483", "0...
0.8267158
0
r""" Generate a simple cubic lattice matching the shape of the provided tempate
def cubic_template(template, spacing=1, connectivity=6, node_prefix='node', edge_prefix='edge'): template = np.atleast_3d(template).astype(bool) # Generate a full cubic network temp = cubic(shape=template.shape, spacing=spacing, connectivity=connectivity, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createFccLattice(nx, ny, nz, lat, atoms):\n nb = 4 # number of atoms in this basis\n\n basis = [ (0.25, 0.25, 0.25),\n (0.25, 0.75, 0.75),\n (0.75, 0.25, 0.75),\n (0.75, 0.75, 0.25)\n ]\n\n idx = 0\n # loop over ix,iy,iz\n for ix in range(nx...
[ "0.5739595", "0.57269806", "0.5519372", "0.55041337", "0.55027515", "0.54527545", "0.544388", "0.54365593", "0.54315346", "0.540072", "0.53777605", "0.53012806", "0.5280157", "0.5267458", "0.5255607", "0.525268", "0.52456284", "0.5195154", "0.51804876", "0.51540697", "0.51492...
0.61785316
0
Initializes a new CATVehicle environment. CATVehicle doesnt use controller_manager, therefore we wont reset the controllers in the standard fashion. For the moment we wont reset them.
def __init__(self): rospy.logdebug("Start CATVehicle_ENV INIT...") self.controllers_list = [] self.publishers_array = [] self.robot_name_space = "" self.reset_controls = False # We launch the init function of the Parent Class robot_gaz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_init(self):\n self.controller = gameController.Controller()", "def __init__(self, env, action_repeat=1):\n super().__init__(env)\n if self.env.mujoco_robot.name == \"sawyer\":\n from robosuite.controllers import SawyerIKController\n\n self.controller = SawyerIKCo...
[ "0.65783614", "0.65707076", "0.6448456", "0.63336813", "0.6316084", "0.63071257", "0.6196903", "0.61957055", "0.6131324", "0.61229354", "0.611013", "0.6098227", "0.6090123", "0.608812", "0.6060484", "0.60446596", "0.6040509", "0.60338044", "0.602286", "0.5954583", "0.5941651"...
0.7219373
0
Checks that all the publishers are working
def _check_publishers_connection(self): rate = rospy.Rate(10) # 10hz; HOW DOES THIS WORK FOR CATVEHICLE/ self._check_cmd_vel_pub() rospy.logdebug("All Publishers READY")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_all_publishers_ready(self):\n #rospy.logdebug(\"CHECK ALL PUBLISHERS CONNECTION:\")\n self._check_publisher_ready(self._publish_cmd_vel.name,\n self._publish_cmd_vel)\n self._check_publisher_ready(self._publish_takeoff.name,\n ...
[ "0.84447545", "0.76781994", "0.7609279", "0.707225", "0.6680602", "0.650268", "0.6417987", "0.63376284", "0.6209604", "0.61780393", "0.61495805", "0.61152196", "0.6104922", "0.6104922", "0.60826063", "0.60811275", "0.6079149", "0.5971992", "0.5948528", "0.58961207", "0.577824...
0.77768606
1
It will move the car based on the linear and angular speeds given. (no) It will wait untill those twists are achived reading from the odometry topic.
def move_car(self, linear_speed, angular_speed, epsilon=0.05, update_rate=10, min_laser_distance=-1): cmd_vel_value = Twist() # Describes linear motion and angular motion of robot cmd_vel_value.linear.x = linear_speed cmd_vel_value.angular.z = angular_speed rospy.logwarn("CATVehicle Base...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_car(self):\n import interface\n self.reset_position()\n print(\"move car during %f s...\" % self.portion_duration*self.nbr_portions)\n\n X, Y = [], []\n t_debut = time.time()\n while time.time() - t_debut < self.portion_duration*self.nbr_portions:\n cur...
[ "0.7435274", "0.72977984", "0.7052102", "0.6954833", "0.68684995", "0.68374693", "0.6832791", "0.67486525", "0.674386", "0.67203355", "0.66854525", "0.6677653", "0.6654552", "0.6614448", "0.6614448", "0.6608492", "0.66065294", "0.65468276", "0.65284157", "0.652828", "0.652777...
0.8023494
0
It states based on the laser scan if the robot has crashed or not. Crashed means that the minimum laser reading is lower than the min_laser_distance value given. If min_laser_distance == 1, it returns always false, because its the way to deactivate this check.
def has_crashed(self, min_distance): robot_has_crashed = False dist = self.distsb.data if (dist <= min_distance): rospy.logwarn("CATVehicle HAS CRASHED >>> item = " + str(dist)+" < "+str(min_distance)) robot_has_crashed = True return robot_has_crashed
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __is_terminal(self, reward):\n\n # Initialize the terminal signals to false\n done = 0\n exit_cond = 0\n\n # Find readings that are below the set minimum. If there are multiple readings below the threshold, a crash\n # likely occurred and the episode should end\n # pri...
[ "0.6302682", "0.59496963", "0.5720969", "0.57199204", "0.56063974", "0.55191565", "0.5511361", "0.54964745", "0.548656", "0.546086", "0.5457037", "0.5451448", "0.5446378", "0.5445406", "0.5443389", "0.5424419", "0.5397192", "0.53923285", "0.53882724", "0.53723824", "0.5359846...
0.65438414
0
Find all local extremum indexes. The output extremum_indexes will hold the locations in y which hold the extremums, it will also be sorted from biggest extremum of y to smallest extremum of y. This function considers a localmaximum to be a point which is either bigger then both its neighbours or bigger then or and equa...
def my_local_extremum(y, min_or_max, do_plot=True): if min_or_max == 'max': y_prime = y elif min_or_max == 'min': y_prime = -y else: sys.exit("You must declare what min_or_max of extremums you're looking for, max or min!") dy = np.diff(y_prime) indicator = np.diff(np.sign(dy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def local_max(x, threshold=1e-5):\n maxima = np.r_[True, x[1:] > x[:-1]] & np.r_[x[:-1] > x[1:] , True]\n # select all local maxima above the threshold\n maxima_f = maxima & np.r_[x > threshold , True][:-1]\n peak_indices = np.where(maxima_f==True)[0]\n return np.array(peak_indices)", "def get_lo...
[ "0.60181546", "0.5849876", "0.5662839", "0.5538779", "0.5527528", "0.5486187", "0.5335532", "0.5292168", "0.5165666", "0.5139783", "0.5137228", "0.5127807", "0.51208293", "0.5119657", "0.50657743", "0.505991", "0.5051801", "0.5025604", "0.5022622", "0.50162184", "0.5010988", ...
0.7035026
0
Reset all motor bounds to default. It writes directly to the .Experiment file
def reset_bounds_to_default(self) -> None: self.write_to_experiment_file(self.DEFAULT_BOUNDS, is_motor_bounds=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setAllZero(self):\n self.robot.set_joint([0,0,0,0,0])\n self.robot.save_config()", "def reset_all(self):\n self.vna.write(reset(self.model))\n self.using_correction = False\n return 0", "def reset(self):\r\n # TODO: have reset flag such that it forces all the botto...
[ "0.67191756", "0.6347794", "0.63331574", "0.6190031", "0.61632496", "0.60549647", "0.6039379", "0.6032612", "0.5916413", "0.57943016", "0.5765333", "0.57536703", "0.56618965", "0.565021", "0.5644383", "0.5638336", "0.5635795", "0.56178623", "0.56178623", "0.56178623", "0.5579...
0.807964
0
Method to print the current bounds
def list_bounds(self) -> None: print("") print( "Mu = {}".format(self.experiment_file_dict["motors"]["mu"]["bounds"]) ) print( "Eta = {}".format(self.experiment_file_dict["motors"]["eta"]["bounds"]) ) print( "Chi = {}".f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def printLimits():\n print(\"MinX:\",Drawable._minX)\n print(\"MaxX:\",Drawable._maxX)\n print(\"MinY:\",Drawable._minY)\n print(\"MaxY:\",Drawable._maxY)", "def draw_bounds():\n\n pass", "def __str__(self):\n template = ('Bounds: minx={f}, miny={f}, minz={f}\\n '\n...
[ "0.7215724", "0.71709335", "0.673883", "0.6685811", "0.6685811", "0.6685811", "0.6685811", "0.6685811", "0.6685811", "0.6685811", "0.6685811", "0.6528126", "0.65150255", "0.6498794", "0.6490254", "0.64102936", "0.64002216", "0.63592964", "0.6355361", "0.63303196", "0.63029194...
0.741064
0
Returns True if the sentence has less than `min_len` number of words
def is_short_sentence(s:str, min_len=8) -> str: return len(s.split(' ')) < min_len
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isShortWord(self, word):\n return len(word) < 4 and word not in self.valid_short_words", "def is_sentence(sentence):\n return len(sentence.split(' ')) > 1", "def _get_num_sentences(doc: Doc, min_sen_length=5):\n return len([sent for sent in list(doc.sents) if len(sent.text.strip())>min_sen_length]...
[ "0.7110784", "0.6683015", "0.6578736", "0.6559528", "0.65010715", "0.6469109", "0.6408499", "0.63572896", "0.6222498", "0.619234", "0.6152855", "0.6135031", "0.6134708", "0.6118702", "0.6107853", "0.60927236", "0.60927236", "0.6068517", "0.6061218", "0.604379", "0.6043686", ...
0.8114343
0
Returns True if the sentence passes the MIN_LINE_LENGTH configuration Redefine this function with desired helper functions, returning true if you want to keep the line
def filter_line(line:str) -> bool: fails = is_short_sentence(line, MIN_LINE_LENGTH) return not fails
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _CheckLineLength(self, last_token, state):\n # Start from the last token so that we have the flag object attached to\n # and DOC_FLAG tokens.\n line_number = last_token.line_number\n token = last_token\n\n # Build a representation of the string where spaces indicate potential\n # line-break l...
[ "0.6847241", "0.6644436", "0.6478467", "0.6366687", "0.6366687", "0.6346874", "0.63363194", "0.6306809", "0.630569", "0.62562096", "0.61191267", "0.61184096", "0.59889305", "0.59883976", "0.59460294", "0.5928991", "0.5904485", "0.5858822", "0.5845432", "0.5815043", "0.5815043...
0.75755507
0
From a chunk of characters, decide whether to return the processed characters or Nothing. If the input is the empty string "", raise StopIteration
def read_outcomes(chars:str) -> Union[str, None]: if chars == '': raise StopIteration line = process_line(chars) if filter_line(line): return line return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_till_unescaped_char(stream, chars):\n rv = \"\"\n while True:\n escaped = False\n for c in chars:\n if EscapeCharToken.starts_here(stream, c):\n rv += stream.next() + stream.next()\n escaped = True\n if not escaped:\n c = str...
[ "0.59868234", "0.5907415", "0.5746512", "0.56942636", "0.55695397", "0.55680895", "0.5547705", "0.55463934", "0.54908234", "0.5483067", "0.54022354", "0.53712815", "0.53637695", "0.5339196", "0.51908356", "0.51681167", "0.5152748", "0.5140798", "0.51358616", "0.5113957", "0.5...
0.67257506
0
Extract `n` chars from opened file `f`
def get_chars(n:int, f) -> Union[str, None]: chars = f.read(n) return read_outcomes(chars)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_chars(infile, n=10000):\n reader = partial(get_chars, n)\n return read_on(reader, infile)", "def chars(count):\n\n global offset\n\n bytes=midifile[offset:offset+count]\n offset+=count\n return bytes", "def read_nchars(string, n=1):\n return string[:n]", "def read_count(f, n)...
[ "0.83833665", "0.7074271", "0.67157036", "0.65879625", "0.64804506", "0.64299506", "0.62674767", "0.62458295", "0.6154341", "0.61165184", "0.5969367", "0.5942755", "0.5874661", "0.58517283", "0.58208233", "0.5791072", "0.56950164", "0.56736636", "0.5568988", "0.55522245", "0....
0.7531543
1
Read from an open file `f` according to the function `reader`
def read_on(reader, f): while True: try: line = reader(f) except StopIteration: break if line is not None: yield line
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_file(\n file_path: Union[str, pathlib.Path],\n reader_name: Optional[str] = None,\n **reader_args: Any,\n) -> Reader:\n with open(file_path, mode=\"rb\") as input_stream:\n return read_stream(input_stream, reader_name)", "def read(self, f):\n return self.parse(f.read())", "de...
[ "0.6748001", "0.6486405", "0.6454402", "0.62687963", "0.6249147", "0.6249147", "0.62337327", "0.62152284", "0.61968464", "0.619053", "0.61562616", "0.61446905", "0.6093729", "0.6074262", "0.6046682", "0.60329247", "0.59486264", "0.59415835", "0.59174466", "0.5914084", "0.5908...
0.7060929
0
Extract `n` characters in batches from opened `infile`
def extract_chars(infile, n=10000): reader = partial(get_chars, n) return read_on(reader, infile)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_chunks(l, n = 10):\n \n for i in range(0, len(l), n): yield l[i: i + n]", "def split_by_n(seq, n):\n while seq:\n yield seq[:n]\n seq = seq[n:]", "def generate_batches(source,n=20):\n blist=[]\n with open(source) as f_source:\n start=next_n_lines(f_sourc...
[ "0.6691966", "0.644548", "0.6406096", "0.6393058", "0.63859624", "0.63522196", "0.63397235", "0.6329659", "0.6316414", "0.63117784", "0.6284999", "0.6275023", "0.62709254", "0.62621665", "0.62603945", "0.62516356", "0.62388295", "0.6223719", "0.62031865", "0.61872655", "0.618...
0.7796246
0
Extract sentences from a file into a new file indicated by `outfname`.
def extract_sentences_to_file(infile, outfname:str): out = open(outfname, 'x') linegen = extract_lines(infile) for line in linegen: out.write(line + "\n") out.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize_with_sentencepiece(in_file, out_file, sp_model_filename):\n sp = sentencepiece.SentencePieceProcessor()\n sp.load(sp_model_filename)\n packer = msgpack.Packer()\n for line in in_file:\n ids = sp.encode_as_ids(line.rstrip())\n out_file.write(packer.pack(ids))", "def extract_...
[ "0.6032002", "0.5976846", "0.58660066", "0.5752771", "0.57520777", "0.56802106", "0.56794167", "0.56420624", "0.5628355", "0.5465277", "0.534662", "0.5321517", "0.529187", "0.5280357", "0.5271641", "0.5270532", "0.52486604", "0.5247361", "0.5227606", "0.521117", "0.5188483", ...
0.8542763
0
Main function for creating the outdir and saving the processed sentences to that file
def main(infile, outdir): outfname = Path(infile).stem + '.txt' outdir = Path(outdir) outdir.mkdir(parents=True, exist_ok=True) outfile = outdir / outfname out_path = extract_sentences_to_file(infile, outfile) return out_path
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n filepath = input(\"Enter the Source File: \")\n with open(filepath, encoding=\"utf-8\") as f:\n sentences = f.readlines()\n sentences = \" \".join(sentences)\n\n summary = summarize_sentences(sentences)\n\n filepath_index = filepath.find(\".txt\")\n outputpath = filepath[:fil...
[ "0.6580007", "0.65144515", "0.6496518", "0.6137109", "0.61325854", "0.6097931", "0.6071918", "0.60058165", "0.5979739", "0.5966034", "0.59430885", "0.5942694", "0.59344786", "0.5918845", "0.59121776", "0.5906765", "0.5893273", "0.58864534", "0.5874044", "0.5873504", "0.583959...
0.6960881
0
Returns a list of possible diagnosis, if any, given a list of symptoms. For example, if german measles has the symptoms 'runny nose', 'fever', 'headache' and 'rash', the system will return a list containing a dict with the diagnosis. symptoms = ['runnynose', 'fever', 'headache', 'rash'] doctor = Doctor('medical') resul...
def diagnose(self, symptoms, age_group=None): prolog = Prolog() if age_group is not None: prolog.assertz('age_group(patient,%s)' % age_group) for symptom in symptoms: prolog.assertz('symptom(patient,%s)' % symptom) prolog.consult(self.prolog_file) return list(prolog.query('hypothesis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diagnose(patient: Patient) -> Disease:\n symptom_lists = Doctor.check_symptoms()\n for idx, value in enumerate(symptom_lists):\n print(idx + 1, end=': ')\n print(value)\n list_num = input_integer('Select set of symptoms do you have, Enter number (i.e 1): ') - 1\n ...
[ "0.6930058", "0.65888613", "0.5761655", "0.56876", "0.54945457", "0.54335344", "0.5386989", "0.5385509", "0.5284007", "0.5262071", "0.519582", "0.51953393", "0.50684696", "0.50117284", "0.49715564", "0.49382475", "0.49373138", "0.4930419", "0.49265516", "0.4855278", "0.482884...
0.7524301
0
Convenience wrapper around diagnose that returns only one result. If no results are found, this returns None.
def diagnose_one(self, symptoms, age_group=None): try: return self.diagnose(symptoms, age_group=age_group)[0] except IndexError: return None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diagnose(patient: Patient) -> Disease:\n symptom_lists = Doctor.check_symptoms()\n for idx, value in enumerate(symptom_lists):\n print(idx + 1, end=': ')\n print(value)\n list_num = input_integer('Select set of symptoms do you have, Enter number (i.e 1): ') - 1\n ...
[ "0.540709", "0.52838403", "0.50949544", "0.49411562", "0.48334944", "0.47625622", "0.47504145", "0.4722249", "0.4666538", "0.4665239", "0.4658295", "0.46503997", "0.46331224", "0.46240985", "0.45917788", "0.45883182", "0.4586515", "0.45854995", "0.45789608", "0.45501754", "0....
0.72394943
0
classpaddleslim.nas.RLNAS(key, configs, use_gpu=False, server_addr=("", 8881), is_server=True, is_sync=False, save_controller=None, load_controller=None, kwargs)
def test_RLNAS1(self): port = 8773 # config = [('MobileNetV2BlockSpace', {'block_mask': [0]})] config = [("ResNetBlockSpace2", {"block_mask": [0]})] rlnas = RLNAS( key="lstm", configs=config, server_addr=("", port), is_sync=False, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train_nasnetmobile():\n\n # load data\n training_sets = load_augmented_dataset()\n\n # build models\n model_nas = build_nasnet()\n\n baseWeights_t = model_nas.get_weights()\n\n # NOTE: You can still leave this alone if you've only downloaded the fully augmented set.\n for training_set in t...
[ "0.55138034", "0.5161739", "0.4982233", "0.49589643", "0.4900475", "0.48999295", "0.48920074", "0.48488998", "0.48337922", "0.47930655", "0.4791438", "0.4790291", "0.47739714", "0.47307554", "0.47282207", "0.4725035", "0.47107428", "0.4709866", "0.46765238", "0.46713734", "0....
0.62039995
0
Returns True if this is a channel (for the benefit of tempalates)
def is_channel(self): return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def single_channel():\n return True", "def discretized_on_current_channel(self, channel):\n return channel.frequency.value == self.channel.frequency.value", "def is_channel(target, channel_prefixes='!&#+'):\n return len(target) > 1 and target[0] in channel_prefixes", "def is_party_channel(ch...
[ "0.7300747", "0.66407454", "0.6600495", "0.65939754", "0.6541701", "0.64368176", "0.63891566", "0.63749844", "0.6347093", "0.63457596", "0.6313041", "0.6300811", "0.62795174", "0.62716013", "0.62596995", "0.6258918", "0.6241316", "0.6231847", "0.62231165", "0.6206009", "0.620...
0.8063512
0
Creates tags or increments tag counts as neccesary.
def _add_tags(self): if self.version != 'live': return tags = [t.strip() for t in self.tags_text.split(',')] tags = list(set(tags)) for tag_name in tags: tag_slug = slugify(tag_name) if tag_slug: try: tag = Tag.ob...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tag_updater(self, tags):\n for tag in tags:\n #check if the tag exists\n exists = False\n tag = self.tags.find_one({'TagName': tag})\n if tag is not None:\n self.tags.update_one({'TagName': tag}, {'$set': {'Count': tag['Count']+1}}) \n ...
[ "0.6784511", "0.6330996", "0.6210781", "0.61919886", "0.61767066", "0.612998", "0.60254365", "0.6004772", "0.5946851", "0.5872528", "0.5865492", "0.57023764", "0.5651251", "0.56375575", "0.56291467", "0.56090564", "0.5593918", "0.5592295", "0.556104", "0.5549158", "0.5519224"...
0.6558367
1
Returns maximum number of guests you can satisfy
def max_guests(appetite: list[int], cake: list[int]) -> int: guest_count = 0 appetite_index = len(appetite) - 1 cake_index = len(cake) - 1 while appetite_index >= 0 and cake_index >= 0: appetite_size = appetite[appetite_index] cake_size = cake[cake_index] if cake_size >= appet...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def max_individuals(self) -> int:\n return self.group_size.upper * self.groups_allowed", "def find_max_guesses():\n print(\"You'll get 5 guesses per problem!\")\n return 5", "def get_number_of_non_exhausted_votes(self):\n return (\n len(self._ballots) * self._number_of_votes_pr_v...
[ "0.67058694", "0.6673283", "0.6292351", "0.62110734", "0.6177681", "0.6132566", "0.61130244", "0.61001515", "0.60693204", "0.60392797", "0.60035145", "0.5987563", "0.59809804", "0.5945763", "0.5935348", "0.5923318", "0.5913736", "0.59127784", "0.5906886", "0.590217", "0.59005...
0.77078587
0
Computes and returns the [calculated] value on the given model instance.
def __get__(self, model_instance, model_class): if model_instance is None: return self return self.calc_fn(model_instance)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_value(self, *args, **kwargs):\n\n return None", "def __call__(self, model):\n\n result = self.relation(model)\n return 0.5 * result.T @ result", "def dynamic_model(self, input_val: float) -> float:\n pass", "def value(self):\n return self.compute_value()", "de...
[ "0.69268477", "0.6654632", "0.65778863", "0.6527613", "0.65083015", "0.64636713", "0.6463034", "0.6463034", "0.6463034", "0.63449645", "0.6339843", "0.6229939", "0.61346275", "0.6132822", "0.6132822", "0.6122014", "0.6119308", "0.61153156", "0.61153156", "0.61079353", "0.6087...
0.7754616
0
run_net(inputs, parameter) Parameters = [R, p_inE/I, f_in, f_EE, f_EI, f_IE, f_II, tau_ex, tau_inh]
def run_net(inputs, **parameter): #---- set numpy random state for each run---- np.random.set_state(np_state) # -----parameter setting------- n_ex = 1600 n_inh = int(n_ex/4) n_input = MNIST_shape[1]*coding_n n_read = n_ex+n_inh R = parameter['R'] f_in = parameter['f_in'] f_EE ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_net(inputs, **parameter):\n\n # ---- set numpy random state for each run----\n np.random.set_state(np_state)\n\n # -----parameter setting-------\n n_ex = 1600\n n_inh = int(n_ex / 4)\n n_input = MNIST_shape[1] * coding_n\n n_read = n_ex + n_inh\n\n R = parameter['R']\n f_in = par...
[ "0.81640816", "0.63192445", "0.62156385", "0.595561", "0.5870949", "0.58452916", "0.58400714", "0.5837377", "0.57914275", "0.57614464", "0.5746423", "0.574472", "0.5679576", "0.5575889", "0.5570358", "0.55618316", "0.55574334", "0.55442166", "0.5531581", "0.55223185", "0.5505...
0.81521267
1
This method return Djangolike formset dictionary using the model's description.
def get_model_as_formset(self, client_id): # Basement formset = { 'form-TOTAL_FORMS': str(len(self.storage)), 'form-INITIAL_FORMS': u'0', } # Fill the formset for record_index, record in enumerate(self.storage): prefix = 'form-%i' % record_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_formset(self):\n result = generic_inlineformset_factory(\n self.inline_model, **self.get_factory_kwargs()\n )\n return result", "def get_formset(self, **kwargs):\n return self.formsets[kwargs.get('prefix')](\n data=self.get_form_kwargs().get('data'),\n ...
[ "0.63856494", "0.61528933", "0.6102678", "0.6097033", "0.60158974", "0.6006137", "0.59983814", "0.5964322", "0.59016794", "0.57746387", "0.57705826", "0.57312673", "0.5719457", "0.57028717", "0.56976926", "0.5688197", "0.5686967", "0.5644262", "0.5630537", "0.5630537", "0.562...
0.67006874
0
Insert a record into the model. Parameter 'card' has an information obtained from UI dialogs.
def insert_new(self, card): handlers = { 'flyer': (self.prepare_flyer, 'card_ordinary'), 'test': (self.prepare_proxy('test'), 'card_ordinary'), 'once': (self.prepare_proxy('once'), 'card_ordinary'), 'abonement': (self.prepare_abonement, 'card_ordinary'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_card(db_conn, data):\n\n schema = get_card_schema(data)\n if not schema:\n return data, [{\n 'name': 'kind',\n 'message': 'Missing card kind.',\n }]\n card, errors = insert_entity(schema, db_conn, data)\n if not errors:\n save_entity_to_es('card', d...
[ "0.6982756", "0.68885905", "0.6880583", "0.6847278", "0.6847278", "0.6847278", "0.6847278", "0.68147707", "0.6768524", "0.67009217", "0.66705394", "0.66541356", "0.66238844", "0.6605976", "0.654898", "0.65487415", "0.6494008", "0.64791137", "0.6402424", "0.63386464", "0.63296...
0.7850888
0
Load mock file that simulates an API response.
def load_mock_response(file_name): with open('test_data/' + file_name, mode='r') as f: return json.loads(f.read())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_mock_response(file_name: str) -> str:\n with open(f'test_data/{file_name}', encoding='utf-8') as mock_file:\n return mock_file.read()", "def load_mock_response(file_name: str) -> str:\n with open(f'test_data/{file_name}', mode='r', encoding='utf-8') as mock_file:\n return mock_file.r...
[ "0.74785966", "0.7454955", "0.7240601", "0.68846744", "0.6445932", "0.63486123", "0.63376623", "0.631958", "0.62420946", "0.6150939", "0.6132258", "0.61184406", "0.61017144", "0.60947496", "0.6093183", "0.60773385", "0.6044469", "0.60404176", "0.60317177", "0.6010863", "0.598...
0.7828066
0
Return all tools of the given type, this could be used for reporting available tools.
def get_all_tools(project, user_paths, tool_type='synthesis'): if tool_type == 'synthesis': registry = synthesis_tool_class_registry elif tool_type == 'simulation': registry = simulation_tool_class_registry else: log.error( 'Invalid tool type specified: {0}'.format(tool_t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tools(self):\r\n\t\tlogger.debug(\"Getting the tools\")\r\n\t\t\r\n\t\treturn db.get_items('tools')", "def get(self):\n print(\"print tools!\")\n tools = get_tools()\n # print(tools[0].supportedDataTypes)\n\n return tools, 200", "def get_tools(cls):\n pass", "def to...
[ "0.73291826", "0.72031176", "0.71366954", "0.6986073", "0.6820919", "0.67988825", "0.6646422", "0.65677077", "0.6390492", "0.63729286", "0.62827396", "0.60710996", "0.59705836", "0.58918965", "0.5885029", "0.5877147", "0.5835992", "0.58298546", "0.58201313", "0.5769404", "0.5...
0.7333869
0
Force the quantity to always be a decimal
def quantity(self, value): self._quantity = Decimal(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_qty_decimal(self):\n return self._is_qty_decimal", "def format_quantity(self, quantity):\n precision = self._size_limits[3] or 8\n qty = \"{:0.0{}f}\".format(truncate(quantity, precision), precision)\n\n if '.' in qty:\n qty = qty.rstrip('0').rstrip('.')\n\n r...
[ "0.7161097", "0.68324983", "0.6621311", "0.6469663", "0.6458594", "0.64521664", "0.63412654", "0.63225275", "0.628677", "0.62567186", "0.62470514", "0.62255293", "0.6134543", "0.61175036", "0.6041531", "0.60316956", "0.60264915", "0.60126615", "0.60087824", "0.59997076", "0.5...
0.7295339
0
Force the price to always be a decimal
def price(self, value): self._price = Decimal(value)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_default_w_decimals(self):\n self.assertEqual(currency(188.00), \"$188.00\")", "def price_pounds(self):\n price = '{0:03d}'.format(self.price)\n return price[:-2] + '.' + price[-2:]", "def test_no_decimals_01(self):\n self.assertEqual(currency(188.01, False), \"$188.01\")", ...
[ "0.7094489", "0.69616205", "0.69607484", "0.69215906", "0.6918236", "0.6917614", "0.6878256", "0.6877267", "0.68123305", "0.6707481", "0.6675492", "0.6626306", "0.6549107", "0.65450263", "0.652165", "0.652165", "0.65029174", "0.649064", "0.6486598", "0.6452186", "0.6442555", ...
0.7397563
0
Force the transaction_date to always be a date
def transaction_date(self, value): if value: self._transaction_date = ( parse(value).date() if isinstance(value, type_check) else value )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settlement_date(self, value):\n if value:\n self._settlement_date = (\n parse(value).date() if isinstance(value, type_check) else value\n )", "def _to_date(self, x):\n if isinstance(x, datetime.datetime):\n return x.date()\n return x", "d...
[ "0.7126179", "0.66136134", "0.6456516", "0.62412924", "0.6194103", "0.6152451", "0.60337865", "0.6033443", "0.59777486", "0.59462726", "0.59258175", "0.5900989", "0.58872056", "0.5856111", "0.5850375", "0.5832078", "0.5816813", "0.5816813", "0.5792783", "0.57875675", "0.57874...
0.8238179
0
Force the settlement_date to always be a date
def settlement_date(self, value): if value: self._settlement_date = ( parse(value).date() if isinstance(value, type_check) else value )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def settlement_date(self) -> datetime.date:\n return self.__settlement_date", "def transaction_date(self, value):\n if value:\n self._transaction_date = (\n parse(value).date() if isinstance(value, type_check) else value\n )", "def __get_settlement_date():\n ...
[ "0.76742023", "0.72175974", "0.6680841", "0.65097", "0.6473954", "0.6407193", "0.64039", "0.6372702", "0.63582903", "0.6351273", "0.63417256", "0.63310933", "0.62912256", "0.62886894", "0.62055326", "0.62000686", "0.6159297", "0.61090297", "0.61087847", "0.610252", "0.6100886...
0.83972543
0
Force the execution_time to always be a datetime
def execution_time(self, value): if value: self._execution_time = ( parse(value) if isinstance(value, type_check) else value )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute_time(self, value):\n # unfied unit and rounded to two decimals\n unfied_execute_time = convert_execute_time_to_ms(value)\n self._execute_time = round(unfied_execute_time, 2)", "def analysisStartTime(self, val: WQXTime) -> None:\r\n self.__analysisStartTime = None if val is...
[ "0.65430146", "0.60205144", "0.60101604", "0.60045856", "0.58497965", "0.5821389", "0.5818415", "0.5803576", "0.574614", "0.57313335", "0.57167023", "0.57060647", "0.56994534", "0.5648756", "0.5609526", "0.5606317", "0.5606317", "0.5604037", "0.5594047", "0.55648106", "0.5545...
0.7654762
0
The total effect of the net_affecting charges (note affect vs effect here). Currently this is single currency only (AMAAS110). Cast to Decimal in case the result is zero (no net_affecting charges).
def charges_net_effect(self): return Decimal( sum( [ charge.charge_value for charge in self.charges.values() if charge.net_affecting ] ) )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def total(self):\n total_price = self.get_total_amount()\n discounts = self.get_total_discount()\n\n return total_price - discounts", "def cash_ratio(self):\n return self.cash / self.current_liabilities", "def effectiveness(self):\n self._effectiveness = 0.20 * self.ANA + 0.2...
[ "0.62570715", "0.6235157", "0.6229145", "0.6225129", "0.6173853", "0.6153339", "0.61397296", "0.61204726", "0.6097956", "0.6082619", "0.6073412", "0.60558987", "0.6020385", "0.6011036", "0.5980294", "0.5978931", "0.59489465", "0.5926228", "0.5893641", "0.5872979", "0.58686703...
0.82955116
0
Sendet mithilfe von Pushsafer eine Nachricht
def send_push_nachricht(message: str, pushsafer_code: str, title: str = "Termin Verfuegbar!"): # all device = "a" # Alarm icon = 2 # Buzzer sound = 8 # 3mal vibration = 3 # nicht automatisch loeschen ttl = 0 # Hoechste priority = 2 # nach 60 erneut senden bis gesehen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_message(data):\n pass", "def receive(self, message):", "def receive_message(self, message):", "def send(self, msg):\n pass", "def send(self, msg):\n pass", "def send(self, msg):\n pass", "def onMessage(self, payload, isBinary):", "def msg(self, message):\n\n ...
[ "0.62871474", "0.615343", "0.6148093", "0.6147419", "0.6147419", "0.6147419", "0.6109751", "0.60672027", "0.60147476", "0.6001791", "0.5995767", "0.59900343", "0.59823275", "0.59698623", "0.5958427", "0.5944661", "0.59252435", "0.5921991", "0.5919877", "0.5891617", "0.5868126...
0.6838706
0
Generates the panel with observables from the perspective of the econometrician.
def generate_panel(self): self.PanelData = self.RawData.filter(['ID', 'X', 'Z', 'W', 'R', 'β', 'LFP', 'H'], axis=1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_3D_pane(self):\n\t\t\n panel = wx.Panel(self,-1)\n self.interactor3d = wxVTKRenderWindowInteractor(panel, -1, (600,800))\n self.generate_button = wx.Button(panel, label=\"Generate 3D view\")\n self.text_position = wx.StaticText(panel, -1, \"Dose (Gy) \" , wx.Point(0, 0))\n ...
[ "0.5822185", "0.56380796", "0.54971856", "0.5481443", "0.54485613", "0.5352204", "0.53094614", "0.5296331", "0.52601194", "0.5218966", "0.5210436", "0.518101", "0.51385695", "0.5124731", "0.51218325", "0.5101968", "0.5072587", "0.5044487", "0.50364894", "0.50178945", "0.50137...
0.6341032
0
The first time you call this you must set entityUrl. After that you can omit it and it will be read from the auth config file. If entityUrl is None and there is no auth config file, an error will be raised. Upon instantiation a TentApp object will perform server discovery on the entityUrl, so you should expect a short ...
def __init__(self,entityUrl): debugMain('init: entityUrl = %s'%entityUrl) self.entityUrl = entityUrl # details of this app # basic self.name = 'python-tent-client' self.description = 'description of my test app' # urls self.url = 'http://zzzzexample.c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n super().__init__()\n\n etc_conf_names = ('app.conf', 'app.local.conf')\n conf_paths = [os.path.join(APP_DIR, 'etc', c) for c in etc_conf_names]\n\n user_config_path = os.path.join(\n os.path.expanduser('~'),\n '.config',\n 'url_mana...
[ "0.5930825", "0.5766059", "0.562763", "0.5608219", "0.560792", "0.5570426", "0.55552876", "0.5537502", "0.5519522", "0.5497142", "0.54907936", "0.5478157", "0.5469426", "0.5448025", "0.5441701", "0.54389256", "0.5421363", "0.54090375", "0.53671926", "0.53667283", "0.53561354"...
0.7250778
0
Set a value for one of the profile types on your profile.
def putProfile(profileType,value): # PUT /profile/$profileType pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setprofile(variable, value, account, pair):\n stm = shared_morphene_instance()\n if mph.rpc is not None:\n mph.rpc.rpcconnect()\n keys = []\n values = []\n if pair:\n for p in pair:\n key, value = p.split(\"=\")\n keys.append(key)\n values.append(va...
[ "0.62649393", "0.62135774", "0.5811043", "0.58019555", "0.5728354", "0.57046384", "0.567126", "0.553151", "0.5468558", "0.54529685", "0.5448728", "0.5417685", "0.5405339", "0.5376646", "0.5354739", "0.5340065", "0.53230983", "0.5317463", "0.5317463", "0.5297634", "0.5295307",...
0.735219
0
Begin following the given entity. Note that unlike the other followrelated methods, this one uses an entity URL instead of an id.
def follow(self,entityUrl): # POST /followings debugMain('follow') resource = '/followings' requestUrl = self.apiRootUrls[0] + resource headers = dict(DEFAULT_HEADERS) headers['Content-Type'] = 'application/vnd.tent.v0+json' debugRequest('following via: %s'%reque...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def follow(self, follower, followee):\n pass", "def follow_by_id(self, uid: int) -> None:\n self.api.follow(uid)", "def post(self, entity):\n try:\n post_data = json.loads(request.data)\n except json.JSONDecodeError as e:\n raise APIBadRequest(str(e))\n\n ...
[ "0.71358424", "0.6845082", "0.6720478", "0.64408076", "0.63872206", "0.63474435", "0.630175", "0.62473756", "0.6211255", "0.61956847", "0.61947787", "0.61834157", "0.6181174", "0.61511886", "0.61261123", "0.6122579", "0.6069343", "0.6034747", "0.5955918", "0.5955918", "0.5934...
0.72356147
0
Get the entities I'm following. Any additional keyword arguments will be passed to the server as request parameters.
def getFollowings(self,id=None,**kwargs): # GET /followings [/$id] debugMain('getEntitiesIFollow') if id is None: return self._genericGet('/followings',**kwargs) else: return self._genericGet('/followings/%s'%id,**kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def follows(self):\r\n request = http.Request('GET', '{0}/follows/'.format(self.get_url()))\r\n\r\n return request, parsers.parse_json", "def get_queryset(self, *args, **kwargs):\n following_username = self.kwargs.get(self.look_url_kwarg)\n following_users = FollowUser.objects.filter(...
[ "0.6508579", "0.6142639", "0.6072729", "0.59768176", "0.5956215", "0.5956215", "0.5956215", "0.5927792", "0.58932525", "0.5850283", "0.5850283", "0.5850283", "0.5850283", "0.5821432", "0.5779557", "0.5762189", "0.57424575", "0.569764", "0.56891656", "0.56775564", "0.56272036"...
0.65000534
1
Get an attachment from a post.
def getPostAttachment(self,id,filename): # GET /posts/$id/attachments/$filename pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def get_post(self, ctx: commands.Context, postid: int):\n async with ctx.typing():\n data = await self.get_post_by_id(ctx, postid)\n post_e = await self.post_data_to_embed(data)\n attach = await self.get_file_from_post_data(data)\n\n await ctx.send(\n ...
[ "0.7024374", "0.69360787", "0.6919723", "0.64980155", "0.63949233", "0.6368701", "0.63519263", "0.6237288", "0.62060934", "0.6101195", "0.6044315", "0.59931964", "0.5916383", "0.58937657", "0.587449", "0.58533704", "0.58168054", "0.57541746", "0.5718239", "0.56452817", "0.560...
0.7864439
0
Return a generator which iterates through all of the user's followers, newest first, making multiple GET requests behind the scenes.
def generateFollowers(self): for f in self._genericGenerator(self.getFollowers): yield f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_followers(self):\n rsp = self.session.get(self.url + \"/followers\")\n soup = self.getSoup(rsp.content)\n followers = soup.find_all('div', class_ = 'zm-person-item')\n if not followers:\n return\n i, follower = 0, None\n for follower in followers:\n ...
[ "0.783788", "0.74431777", "0.74431777", "0.74431777", "0.74263054", "0.74263054", "0.74263054", "0.74263054", "0.73227763", "0.7203902", "0.71986866", "0.71812487", "0.71171474", "0.6965164", "0.6947185", "0.6837922", "0.6835353", "0.67833805", "0.6730657", "0.67303383", "0.6...
0.8014086
0
processing a heartbeat packet
def test_process_packet_heartbeat(self): pkt = {'type': 'heartbeat', 'endpoint': '' } self.ns.process_packet(pkt) assert not self.environ['socketio'].error.called
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _process_heartbeat(response, socket_info):\n if response['type'] != 'heartbeat':\n raise Exception(\"_process_heartbeat() called for a non-heartbeat\"\n f\" request (type: {response['type']}).\")\n timestamp_ms = response['timestampms']\n heartbeat_seq...
[ "0.7398658", "0.7028856", "0.6883857", "0.65677446", "0.6533718", "0.6520467", "0.63512844", "0.62842196", "0.62828034", "0.6271007", "0.618947", "0.6145808", "0.6137599", "0.6130562", "0.61243564", "0.61050403", "0.6088869", "0.60710937", "0.603116", "0.60236067", "0.6012661...
0.7398087
1