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
Convert a multidim measurement to an `openhtf.test_record.Attachment`.
def multidim_measurement_to_attachment(name, measurement): dimensions = list(measurement.dimensions) if measurement.units: dimensions.append( measurements.Dimension.from_unit_descriptor(measurement.units)) dims = [] for d in dimensions: if d.suffix is None: suffix = u'' else: s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attachment_to_multidim_measurement(attachment, name=None):\n data = json.loads(attachment.data)\n\n name = name or data.get('name')\n # attachment_dimn are a list of dicts with keys 'uom_suffix' and 'uom_code'\n attachment_dims = data.get('dimensions', [])\n # attachment_value is a list of lists [[t1, x1,...
[ "0.72609025", "0.60650474", "0.56624556", "0.5234306", "0.5205919", "0.5053746", "0.5025969", "0.49143177", "0.48211223", "0.48179886", "0.47461012", "0.47245294", "0.46942878", "0.46846935", "0.46799025", "0.46730745", "0.46693367", "0.46681827", "0.4656648", "0.4641989", "0...
0.8002156
0
Converts each multidim measurements into attachments for all phases..
def convert_multidim_measurements(all_phases): # Combine actual attachments with attachments we make from multi-dim # measurements. attachment_names = list(itertools.chain.from_iterable( phase.attachments.keys() for phase in all_phases)) attachment_names.extend(itertools.chain.from_iterable([ 'multi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attachment_to_multidim_measurement(attachment, name=None):\n data = json.loads(attachment.data)\n\n name = name or data.get('name')\n # attachment_dimn are a list of dicts with keys 'uom_suffix' and 'uom_code'\n attachment_dims = data.get('dimensions', [])\n # attachment_value is a list of lists [[t1, x1,...
[ "0.6502755", "0.62462246", "0.58033216", "0.54324245", "0.539502", "0.5393443", "0.53379774", "0.52508914", "0.51232845", "0.51208264", "0.5086743", "0.50791055", "0.507189", "0.500965", "0.4997204", "0.4975821", "0.49713874", "0.495982", "0.49417186", "0.49266562", "0.490798...
0.7669266
0
Copy unidimensional measurements to the MfgEvent.
def _copy_unidimensional_measurement(self, phase, name, measurement, mfg_event): mfg_measurement = mfg_event.measurement.add() # Copy basic measurement fields. mfg_measurement.name = name if measurement.docstring: mfg_measurement.description = measurement.do...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fill_event(event):\n is_external = _inspect_descriptor(event.descriptor)\n for data_key, (value, timestamp) in event.data.items():\n if is_external[data_key]:\n # Retrieve a numpy array from filestore\n event.data[data_key][0] = retrieve(value)", "def process_event(self, ev...
[ "0.5493791", "0.5302478", "0.5270012", "0.51520103", "0.5077794", "0.49902377", "0.49824378", "0.49711317", "0.49649778", "0.49266258", "0.49199426", "0.49081537", "0.4902051", "0.48939103", "0.48716244", "0.48658153", "0.48566872", "0.48403275", "0.48326683", "0.48046583", "...
0.72374606
0
Copies attachments into the MfgEvent from the configured phases. If partial uploads are in use (indicated by configuring this class instance with an Attachments cache), this function will exit early if the total attachment data size exceeds a reasonable threshold to avoid the 2 GB serialized proto limit.
def copy_attachments(self, mfg_event: mfg_event_pb2.MfgEvent) -> bool: value_copied_attachment_sizes = [] skipped_attachment_names = [] for phase in self._phases: for name, attachment in sorted(phase.attachments.items()): size = attachment.size attachment_cache_key = AttachmentCacheKey...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_attachments_to_cloud(self, chunk_size=None):\n # ! potentially several api requests can be made by this method.\n chunk_size = chunk_size if chunk_size is not None else DEFAULT_UPLOAD_CHUNK_SIZE\n\n for attachment in self.__attachments:\n if attachment.on_cloud is False:...
[ "0.61932564", "0.59555304", "0.56320876", "0.54939985", "0.54412377", "0.53608817", "0.5349462", "0.5248483", "0.51688045", "0.51037234", "0.5029257", "0.50090903", "0.5003253", "0.4975611", "0.4970235", "0.48952654", "0.48738647", "0.48631048", "0.48576173", "0.4856804", "0....
0.75870556
0
Copies an attachment to mfg_event.
def _copy_attachment(self, name, data, mimetype, mfg_event): attachment = mfg_event.attachment.add() attachment.name = name attachment.value_binary = data if mimetype in test_runs_converter.MIMETYPE_MAP: attachment.type = test_runs_converter.MIMETYPE_MAP[mimetype] elif mimetype == test_runs_pb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_attachments(self, xform):\n existing_names = {a.name for a in self.attachments_list}\n self.attachments_list.extend(\n Attachment(meta.name, meta, meta.content_type, meta.properties)\n for meta in xform.attachments.values()\n if meta.name not in existing_name...
[ "0.61035675", "0.6063148", "0.602835", "0.58456093", "0.57794833", "0.5726989", "0.5690707", "0.5642902", "0.5637596", "0.5578653", "0.5477129", "0.5466101", "0.5419412", "0.5366542", "0.53148806", "0.52834004", "0.52136797", "0.51982874", "0.5194469", "0.5189727", "0.5186343...
0.7725404
0
Extract the original test_record saved as an attachment on a mfg_event.
def test_record_from_mfg_event(mfg_event): for attachment in mfg_event.attachment: if attachment.name == TEST_RECORD_ATTACHMENT_NAME: return json.loads(attachment.value_binary) raise ValueError('Could not find test record JSON in the given MfgEvent.')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _attach_record_as_json(mfg_event, record):\n attachment = mfg_event.attachment.add()\n attachment.name = TEST_RECORD_ATTACHMENT_NAME\n test_record_dict = htf_data.convert_to_base_types(record)\n attachment.value_binary = _convert_object_to_json(test_record_dict)\n attachment.type = test_runs_pb2.TEXT_UTF8...
[ "0.67316943", "0.6527828", "0.62910026", "0.5445438", "0.54262936", "0.53432757", "0.5230048", "0.5221713", "0.52090186", "0.5130671", "0.50289524", "0.50260293", "0.49751303", "0.49623102", "0.49168682", "0.486941", "0.4855046", "0.48480704", "0.4831865", "0.48214445", "0.48...
0.7545419
0
Convert an OpenHTF test record attachment to a multidim measurement. This is a best effort attempt to reverse, as some data is lost in converting from a multidim to an attachment.
def attachment_to_multidim_measurement(attachment, name=None): data = json.loads(attachment.data) name = name or data.get('name') # attachment_dimn are a list of dicts with keys 'uom_suffix' and 'uom_code' attachment_dims = data.get('dimensions', []) # attachment_value is a list of lists [[t1, x1, y1, f1], [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multidim_measurement_to_attachment(name, measurement):\n\n dimensions = list(measurement.dimensions)\n if measurement.units:\n dimensions.append(\n measurements.Dimension.from_unit_descriptor(measurement.units))\n\n dims = []\n for d in dimensions:\n if d.suffix is None:\n suffix = u''\n ...
[ "0.6157673", "0.5323686", "0.52867264", "0.5147524", "0.5087741", "0.506781", "0.5004061", "0.49984238", "0.49962544", "0.49951652", "0.4944247", "0.49229795", "0.49228722", "0.49154544", "0.49131665", "0.4912107", "0.4905844", "0.48937416", "0.48841277", "0.4868167", "0.4867...
0.6709197
0
Initializes a new DMA object. Uses the Default configuration parameters to initialize a DMA. After initialization, the DMA is reset and the interrupts are disabled for DMA.
def __init__(self, address, direction=DMA_FROM_DEV,attr_dict= None): self.buf = None self.direction = direction self.bufLength = None self.phyAddress = address self.DMAengine = ffi.new("XAxiDma *") self.DMAinstance = ffi.new("XAxiDma_Config *") self.Configuration ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gen_config(self, address, direction, attr_dict):\n global DefaultConfig\n global DeviceId\n for key in DefaultConfig.keys():\n self.DMAinstance.__setattr__(key,DefaultConfig[key])\n if direction == DMA_TO_DEV:\n self.DMAinstance.HasS2Mm = 0\n self.D...
[ "0.6091809", "0.5658901", "0.5238449", "0.5192696", "0.51587933", "0.50838625", "0.50613105", "0.5049521", "0.50472456", "0.50324816", "0.5022399", "0.50158256", "0.50068265", "0.49398327", "0.49337935", "0.49308848", "0.4922258", "0.49156177", "0.4895702", "0.4889962", "0.48...
0.6674419
0
Destructor for DMA object. Frees the internal buffer and Resets the DMA.
def __del__(self): if self.buf != None and self.buf != ffi.NULL: self.free_buf() libdma.XAxiDma_Reset(self.DMAengine)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __del__(self):\n if self.fft_dim is not None:\n del self._tmp_fft_array\n del self.fft\n del self.mask\n del self.queue\n del self.ctx\n del self.prg", "def __del__(self):\n if self.fft_dim is not None:\n del self._tmp_fft_array\n...
[ "0.64244795", "0.64224863", "0.639618", "0.639618", "0.63930696", "0.63459104", "0.6310058", "0.62803596", "0.62387246", "0.62387246", "0.62387246", "0.62387246", "0.62387246", "0.62387246", "0.6226848", "0.61518294", "0.6137993", "0.61163706", "0.60824895", "0.6079638", "0.6...
0.79877484
0
Transfer data using DMA (Nonblocking). Used to initiate transfer of data between a physically contiguous buffer and PL. The buffer should be allocated using `create_buf` before this call. The `num_bytes` should be less than buffer size and `DMA_TRANSFER_LIMIT_BYTES`.
def transfer(self,num_bytes,direction=DMA_FROM_DEV): if num_bytes > self.bufLength: raise RuntimeError("Buffer size smaller than the transfer size") if num_bytes > DMA_TRANSFER_LIMIT_BYTES: raise RuntimeError("DMA transfer size > {}".format( DM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(self, address, data, progress_update=None):\n size_remain = len(data)\n\n while size_remain > 0:\n if progress_update is not None:\n progress_update(\n int(100 * (len(data) - size_remain) / len(data)))\n\n part_size = self.__RW_MAX_SIZ...
[ "0.4807644", "0.47439834", "0.47093007", "0.46636268", "0.46625164", "0.46550974", "0.45875773", "0.45558113", "0.4440636", "0.4414443", "0.4286344", "0.42637205", "0.42552963", "0.42488444", "0.4200404", "0.4195978", "0.41915902", "0.41836303", "0.40567458", "0.40462652", "0...
0.7076339
0
Free the memory buffer associated with this object. Use this to free a previously allocated memory buffer. This is specially useful for reallocations.
def free_buf(self): if self.buf == None or self.buf == ffi.NULL: return libxlnk.cma_free(self.buf)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buffer_destroy(self):\n try:\n assert self.buf is not None, \"wtf\"\n assert self.size is not None, \"wtf\"\n assert self.connection is not None, \"wtf\"\n castle_shared_buffer_destroy(self.connection.conn, self.buf, self.size)\n pycastle_log.info(s...
[ "0.69642943", "0.69431484", "0.6923586", "0.6923586", "0.68345565", "0.68345565", "0.681688", "0.67846775", "0.67762417", "0.6767044", "0.6766695", "0.67085606", "0.6549231", "0.65346843", "0.65157795", "0.64967936", "0.6380429", "0.6361872", "0.6326232", "0.632286", "0.62672...
0.7998857
0
Block till DMA is busy or a timeout occurs. Default value of timeout is 10 seconds.
def wait(self, wait_timeout=10): if self._TransferInitiated == 0: return Error = "DMA wait timed out." with timeout(seconds = wait_timeout, error_message = Error): while True: if libdma.XAxiDma_Busy(self.DMAengine,self.direction) == 0: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acquire(self, timeout=None):\r\n pass", "def wait_for_completion(self, timeout=10):\n cur_status = self.runtime_status()\n while cur_status not in ['FAILED', 'KILLED', 'FINISHED']:\n time.sleep(0.2)\n timeout -= 0.2\n cur_status = self.runtime_status()\n ...
[ "0.61897594", "0.6171512", "0.6127206", "0.6031969", "0.5971954", "0.59176093", "0.5874127", "0.58740723", "0.5870611", "0.58507925", "0.5847428", "0.5840137", "0.5829737", "0.58104837", "0.5809625", "0.5734944", "0.57165855", "0.5677718", "0.5671984", "0.5625512", "0.5615836...
0.75207865
0
Get a CFFI pointer to object's internal buffer. This can be accessed like a regular array in python.
def get_buf(self, data_type = "void"): if self.buf is not None: return ffi.cast(data_type + "*", self.buf) else: raise RuntimeError("Buffer not created.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def buffer_data(self):\n # create a ctypes pointer to the buffer\n buffer_ptr = cast(self.data.buffer, POINTER(c_ubyte * self.data.bufferSize))\n\n # contents always returns a copy\n return buffer_ptr.contents", "def RefBuffer(self):\n return self.buffers[self.buffergrade]", ...
[ "0.70719737", "0.6454699", "0.63238037", "0.6246948", "0.6212158", "0.61632776", "0.61422426", "0.6114638", "0.61137015", "0.61079514", "0.6095974", "0.6095974", "0.6095974", "0.609577", "0.6077304", "0.6058983", "0.593203", "0.5892426", "0.58761966", "0.5847394", "0.5834585"...
0.64765877
1
Reconfigure and Reinitialize the DMA IP. Uses a user provided dict to reinitialize the DMA. This method also frees the internal buffer associated with current object. The keys in `attr_dict` should exactly match the ones used in default config. All the keys are not required. The default configuration is defined in dma....
def configure(self, attr_dict=None): self.free_buf() self.__init__(self.phyAddress,self.direction,attr_dict)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _gen_config(self, address, direction, attr_dict):\n global DefaultConfig\n global DeviceId\n for key in DefaultConfig.keys():\n self.DMAinstance.__setattr__(key,DefaultConfig[key])\n if direction == DMA_TO_DEV:\n self.DMAinstance.HasS2Mm = 0\n self.D...
[ "0.6870507", "0.6170703", "0.5568933", "0.52264106", "0.5211273", "0.5099716", "0.5047824", "0.5042919", "0.501541", "0.5008129", "0.49348578", "0.49301088", "0.49276552", "0.4868647", "0.48660493", "0.48159915", "0.48083457", "0.47937152", "0.47897136", "0.4746421", "0.47118...
0.69434756
0
Resolve $ref and $merge in obj, using servicedef for remote references. This function takes an input object which is a dictionary, and evaluates $merge / $ref only if they are present at the root of the object. If need_copy is True, a modifyable shallow copy is returned.
def _eval_shallow(servicedef, obj, need_copy=False): # _eval_shallow() resolves $ref and $merge to their values in # source and with_. This is a *shallow* evaluation in that embedded # $ref or $merge at deeper levels are *not* resolved. # # For example, the following will be resolved: # { $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maybe_resolve(object, resolve):\n if isinstance(object, dict) and object.get('$ref'):\n return resolve(object['$ref'])\n return object", "def _resolve_dict_entry(self, base_obj, obj, session):\n # Interpret '$ref' key if present in obj, continue to resolve\n # recursively if necess...
[ "0.62464815", "0.61979073", "0.5787117", "0.57459426", "0.56157017", "0.5580497", "0.5380721", "0.53573716", "0.51727843", "0.5125576", "0.51039284", "0.50878745", "0.5054683", "0.50543463", "0.5032561", "0.5021628", "0.5018379", "0.50104004", "0.4966884", "0.49604365", "0.49...
0.7659305
0
Return a new dict from source with with_ as a jsonmergepatch.
def json_merge_patch(servicedef, source, with_): if isinstance(source, list) or isinstance(with_, list): return with_ if not isinstance(source, dict): raise TypeError('source must be a dict, got %s' % (type(source))) if not isinstance(with_, dict): raise TypeError('with_ must be a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _merge_sources(dest: Dict[str, Any], source: ConfigSource) -> Dict[str, Any]:\n for key, val in source.items():\n if isinstance(val, dict):\n if key in dest:\n dest[key] = _merge_sources(dest[key], val)\n else:\n dest[key] = val.copy()\n else...
[ "0.68176544", "0.6683074", "0.6657439", "0.64467216", "0.6130949", "0.6095708", "0.5994944", "0.5930889", "0.5930303", "0.5909366", "0.58554596", "0.5845265", "0.58153254", "0.57891977", "0.5770716", "0.575721", "0.5720237", "0.57198954", "0.5692101", "0.5692101", "0.5692101"...
0.76835775
0
Get the couch database.
def get_db(): # this is a bit of a hack, since it assumes all the models talk to the same # db. that said a lot of our code relies on that assumption. # this import is here because of annoying dependencies return Database(settings.COUCH_DATABASE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_db(self):\n self.logger.info('in get_db()')\n try:\n return self.client[self.db_name]\n except Exception as e:\n self.logger.error(f'Error occurred while getting client {e}')", "def get_database(self):\n return self.database", "def get_database(self):\n...
[ "0.75996315", "0.7541116", "0.7478221", "0.7469355", "0.7409623", "0.74087703", "0.7375324", "0.73654824", "0.7352712", "0.7329053", "0.7314676", "0.73024815", "0.7302336", "0.72157574", "0.72157574", "0.7205381", "0.71966976", "0.71935546", "0.71464163", "0.71464163", "0.714...
0.7628401
0
The number of nodes to force an update/read in bigcouch to make sure we have a quorum. Should typically be the number of copies of a doc that end up in the cluster.
def bigcouch_quorum_count(): return (3 if not hasattr(settings, 'BIGCOUCH_QUORUM_COUNT') else settings.BIGCOUCH_QUORUM_COUNT)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_count(self) -> int:\n return pulumi.get(self, \"node_count\")", "def num_nodes(self) -> int:\n return pulumi.get(self, \"num_nodes\")", "def number_of_nodes(self):\n return int(self._data['number_of_nodes'])", "def fixed_node_count(self) -> Optional[int]:\n return pulumi....
[ "0.6945401", "0.6910341", "0.6809", "0.6760374", "0.6662037", "0.66232365", "0.6622689", "0.65614647", "0.654681", "0.64962846", "0.64002955", "0.63923633", "0.6384018", "0.6380716", "0.6362815", "0.6362815", "0.63387084", "0.6315683", "0.62978095", "0.629419", "0.6277318", ...
0.72556967
0
A function for safely applying a change to a couch doc. For getting around ResourceConflict errors that stem from the distributed cloudant nodes
def apply_update(doc, update_fn, max_tries=5): tries = 0 while tries < max_tries: try: update_fn(doc) doc.save() return doc except ResourceConflict: doc = doc.__class__.get(doc._id) tries+=1 raise ResourceConflict("Document update confl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_document(self):\n pass", "def update(self, doc):\n if app.config.get(\"READ_ONLY_MODE\", False) and app.config.get(\"SCRIPTS_READ_ONLY_MODE\", False):\n app.logger.warn(\"System is in READ-ONLY mode, update command cannot run\")\n return\n\n return requests.p...
[ "0.6549985", "0.6186667", "0.6184354", "0.6143458", "0.6079579", "0.6014062", "0.59148175", "0.5863797", "0.5853699", "0.5819036", "0.5745403", "0.5741071", "0.57233113", "0.5709624", "0.5690783", "0.5686154", "0.56716996", "0.565656", "0.5625655", "0.55749387", "0.5573499", ...
0.6657438
0
Register views location in the project. location must be a folder containinng the views you want to publish.
def views(self, location, publish=False): self.package.add_views(location) # register views into project self.application.make("view").add_namespaced_location( self.package.name, self.package.views ) if publish: location_abs_path = self.package._build_pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_view( self, target, view ):\n skins = getToolByName( target, 'portal_skins', None )\n write = self.stream.write\n\n if skins._getOb( view, None ) is not None:\n write( \"Failed to register view '%s' (already exists)\\n\" % view )\n return view\n\n foun...
[ "0.650348", "0.5541443", "0.5502431", "0.5477671", "0.54331136", "0.54153156", "0.5365896", "0.53624594", "0.5269978", "0.5252296", "0.52380717", "0.51152235", "0.51077014", "0.5092043", "0.5059019", "0.5057317", "0.50392365", "0.50302345", "0.4933349", "0.4925995", "0.490798...
0.813258
0
check that the function returns 6 arrays
def test_returns_6(self): print("Testing that get_region_data returns 6 arrays") test = get_region_data(self.wmo_boxes, self.float_name, self.config, self.index, self.pres) self.assertTrue(test.__len__() == 6, "Should return 6 arrays")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multi_return(self):\r\n c = AlphaDiversityCalc(osd)\r\n res = c(data_path=self.otu_table1_fp)\r\n assert_almost_equal(res, array([[2, 1, 1],\r\n [4, 4, 0],\r\n [0, 0, 0]]))", "def test_nbands_gtiff_array(self):\n self.asse...
[ "0.6171257", "0.6095714", "0.60295033", "0.59242857", "0.58715826", "0.5779999", "0.5776983", "0.5773034", "0.57709235", "0.5747728", "0.5733695", "0.5711435", "0.5677225", "0.56669307", "0.56220955", "0.56115824", "0.5610886", "0.5603267", "0.55951834", "0.5573603", "0.55703...
0.7550591
0
Check that, if only bad indices are given, an exception is raised
def test_raise_exception_bad_indices(self): print("Testing exception is raised if indices are bad") with self.assertRaises(Exception) as no_index: get_region_data(self.wmo_boxes, self.float_name, self.config, [], self.pres) self.assertTrue('NO DATA FOUND...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_indexes(self, row, col):\n if min(row, col) < 0 or max(row, col) >= self._n:\n raise IndexError(\n \"Incorrect position (%d, %d) in grid of size %d\" % (\n row, col, self._n\n )\n )", "def test_invalid(self):\n a =...
[ "0.75585335", "0.74471223", "0.7254169", "0.7043304", "0.70192045", "0.7013048", "0.6982934", "0.6889083", "0.6866958", "0.686522", "0.68135303", "0.6775645", "0.6718005", "0.6682806", "0.6665342", "0.6640358", "0.6629157", "0.6608434", "0.6596007", "0.65936697", "0.6579237",...
0.7878643
0
Export merged data to CSV format.
def _export(merged_data, export_config, csv_writer): print('writing merged data to CSV file') columns = export_config.columns csv_writer.writerow(column.name for column in columns) for item in merged_data: nutrients_by_name = { nutrient['nutrient']['id']: nutrient['amount'] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _export_data_to_csv(self, source, target):\n self.log.info(f\"Dumping data into {target}\")\n source.to_csv(target, index=False)", "def _export_csv(x, y, export_to):\r\n\r\n with open(export_to, 'w', newline='') as e:\r\n writer = csv.writer(e, delimiter=',')\r\n ...
[ "0.73520005", "0.71937376", "0.69667894", "0.6924836", "0.68453074", "0.6814207", "0.68059725", "0.6789022", "0.67888296", "0.6773372", "0.67715263", "0.67671627", "0.673209", "0.6724741", "0.662498", "0.6570266", "0.65510094", "0.6544339", "0.6511611", "0.65081745", "0.65047...
0.79536265
0
Read and check the `pyproject.toml` or `flit.ini` file with data about the package.
def read_pkg_ini(path: Path): if path.suffix == '.toml': with path.open() as f: d = toml.load(f) res = prep_toml_config(d, path) else: # Treat all other extensions as the older flit.ini format cp = _read_pkg_ini(path) res = _validate_config(cp, path) if v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detect_package_details() -> Dict:\n retval = {\n 'name': '',\n 'version': ''\n }\n if has_pyproject_toml():\n x = toml.load(pathlib.Path(_find_root(), \"pyproject.toml\"))\n retval = {\n 'name': x['tool']['poetry']['name'],\n 'version': x['tool']['poet...
[ "0.64759076", "0.62828505", "0.60832334", "0.60589606", "0.60215104", "0.57899994", "0.566735", "0.56032705", "0.5552389", "0.5550038", "0.55051345", "0.54967743", "0.5459381", "0.54260105", "0.54105026", "0.5401198", "0.5377862", "0.5372101", "0.5352429", "0.5338127", "0.533...
0.6785215
0
Flatten nested entrypoints dicts. Entry points group names can include dots. But dots in TOML make nested
def flatten_entrypoints(ep): def _flatten(d, prefix): d1 = {} for k, v in d.items(): if isinstance(v, dict): yield from _flatten(v, prefix+'.'+k) else: d1[k] = v if d1: yield prefix, d1 res = {} for k, v in ep.item...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _flatten_metadata(metadata):\r\n if metadata:\r\n # After changing recursive_keypairs` output we need to keep\r\n # flattening output unchanged.\r\n # Example: recursive_keypairs({'a': {'b':{'c':'d'}}}, '.')\r\n # output before: a.b:c=d\r\n # output now: a.b.c=d\r\n ...
[ "0.59880596", "0.56429005", "0.54103106", "0.54102486", "0.54020286", "0.53127784", "0.5280857", "0.5267353", "0.52663046", "0.5265739", "0.5247935", "0.5228424", "0.52254593", "0.5191807", "0.5164662", "0.51024365", "0.5089436", "0.5072555", "0.5055325", "0.5030166", "0.5025...
0.7824824
0
Process & verify the metadata from a config file Pull out the module name we're packaging. Read descriptionfile and check that it's valid rst Convert dashes in key names to underscores (e.g. homepage in config > home_page in metadata)
def _prep_metadata(md_sect, path): if not set(md_sect).issuperset(metadata_required_fields): missing = metadata_required_fields - set(md_sect) raise ConfigError("Required fields missing: " + '\n'.join(missing)) module = md_sect.get('module') if not module.isidentifier(): raise Confi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_content(self, command, vars):\n modules = [line.strip()\n for line in self.dist.get_metadata_lines('top_level.txt')\n if line.strip() and not line.strip().startswith('#')]\n if not modules:\n print >> sys.stderr, 'No modules are listed in to...
[ "0.59436095", "0.5930097", "0.58907914", "0.5869462", "0.58648914", "0.5729982", "0.5701646", "0.5691652", "0.56478477", "0.5566765", "0.55240977", "0.5511493", "0.5498196", "0.54784137", "0.54707885", "0.5466677", "0.54309237", "0.5424845", "0.5420085", "0.5380556", "0.53570...
0.6304364
0
Setup editing data using a regular cohort setup Setup a WikiCohort that will span to all users that we have in the project.
def setUp(self): DatabaseTest.setUp(self) self.common_cohort_4() self.create_wiki_cohort() self.cohort_service = CohortService() self.wiki_cohort = self.cohort_service.get( self.session, self.owner_user_id, by_id=self.basic_wiki_cohort.id ) # This shou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n super().setUp()\n\n # create course with cohorts\n self.manual_cohort_name = \"ManualCohort1\"\n self.auto_cohort_name = \"AutoCohort1\"\n self.course_fixture = CourseFixture(**self.course_info).install()\n self.setup_cohort_config(self.course_fixture, a...
[ "0.6554218", "0.60419846", "0.58714294", "0.5524126", "0.5519026", "0.54560786", "0.5439724", "0.5432877", "0.5373439", "0.5373439", "0.53181887", "0.5308331", "0.5270714", "0.5266665", "0.52658254", "0.5234584", "0.517833", "0.5174957", "0.5163751", "0.5135936", "0.51259047"...
0.7161842
0
Retrieve pages created metric for wiki cohort for project 'wiki' Results of tests should be identical as if we used cohort number 4
def test_pages_created_happy_case(self): metric = PagesCreated( namespaces=[301, 302, 303], start_date='2013-06-19 00:00:00', end_date='2013-08-21 00:00:00' ) results = metric(self.user_ids, self.mwSession) assert_equal(results[self.editors[0].user_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wiki_content(self):\n url = \"https://fr.wikipedia.org/w/api.php?action=query&prop=extracts&exsentences=4&explaintext=&pageids={}&format=json\".format(self.page_id)\n self.page = str(self.page_id)\n self.response = requests.get(url)\n self.data = self.response.json()\n se...
[ "0.5970715", "0.5870254", "0.572436", "0.568515", "0.5632392", "0.55231863", "0.5515825", "0.5454868", "0.5450941", "0.5441367", "0.5437494", "0.5428203", "0.5425592", "0.54148763", "0.5405884", "0.5385945", "0.538428", "0.53364915", "0.53364086", "0.5333015", "0.53160226", ...
0.59241736
1
Retrieve pages created metric for wiki cohort for project 'wiki' Results should include the additional users created by `self.common_cohort_4(cohort=False)`
def test_pages_created_extra_users(self): self.common_cohort_4(cohort=False) metric = PagesCreated( namespaces=[301, 302, 303], start_date='2013-06-19 00:00:00', end_date='2013-08-21 00:00:00' ) results = metric(self.user_ids, self.mwSession) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wiki_content(self):\n url = \"https://fr.wikipedia.org/w/api.php?action=query&prop=extracts&exsentences=4&explaintext=&pageids={}&format=json\".format(self.page_id)\n self.page = str(self.page_id)\n self.response = requests.get(url)\n self.data = self.response.json()\n se...
[ "0.5899427", "0.58024967", "0.57745063", "0.5665779", "0.54686713", "0.5429335", "0.54139596", "0.53866833", "0.5301533", "0.52157295", "0.5210911", "0.5192173", "0.5151628", "0.514351", "0.50706494", "0.5035995", "0.5033115", "0.50247586", "0.5001945", "0.49968684", "0.49889...
0.6355591
0
Invokes the Protocol Compiler to generate a _pb2.py from the given .proto file. Does nothing if the output already exists and is newer than the input.
def generate_proto(source): output = source.replace(".proto", "_pb2.py") if not os.path.exists(output) or ( os.path.exists(source) and os.path.getmtime(source) > os.path.getmtime(output) ): print("Generating %s..." % output) if not os.path.exists(source): sys.stderr.wr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GenerateProto(source):\n\n output = source.replace(\".proto\", \"_pb2.py\")\n\n if not os.path.exists(output) or (\n os.path.exists(source) and\n os.path.getmtime(source) > os.path.getmtime(output)):\n print(\"Generating %s...\" % output)\n\n if not os.path.exists(sour...
[ "0.7261719", "0.72397447", "0.7024743", "0.6940416", "0.69271016", "0.68129927", "0.66452444", "0.6597514", "0.6094194", "0.6063369", "0.6036536", "0.6023367", "0.6022136", "0.6006304", "0.5852", "0.5761504", "0.57238007", "0.562284", "0.5617232", "0.5594211", "0.5563651", ...
0.7507995
0
Add alias to an idol/group (Underscores are spaces)
async def addalias(self, ctx, alias, mem_id: int, mode="idol"): alias = alias.replace("_", " ") if mode.lower() in ["idol", "member", "members", "idols"]: obj = await self.ex.u_group_members.get_member(mem_id) name = f"{obj.full_name} ({obj.stage_name}) [{obj.id}]" elif m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_alias(self, alias):\n if alias != self.name:\n self.alias = alias", "def addAlias(self, alias, node):", "def __make_group_by_atom(self, group_name, name_list):\r\n pass", "def addAlias(self, name):\r\n self._otherNames.append(name.strip().lower())", "def get_group_f...
[ "0.65762883", "0.6531485", "0.64142936", "0.6311301", "0.62942004", "0.6270054", "0.6215449", "0.6202444", "0.61916584", "0.60768545", "0.6028549", "0.5965951", "0.5911946", "0.5901565", "0.5864755", "0.5852211", "0.5840967", "0.5840967", "0.5840967", "0.5798421", "0.5798421"...
0.67773175
0
The role to give a user when they first join the server. Use command without role to delete the welcome role set to the guild.
async def welcomerole(self, ctx, role: discord.Role = None): if not ctx.guild: # command must not be used in DMs. return await ctx.send(await self.ex.get_msg(ctx, "general", "no_dm")) guild = self.ex.cache.welcome_roles.get(ctx.guild) # if the user wants to delete the role. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def userrole(self, ctx, *, role=None):\n server = ctx.message.guild\n\n if not role:\n result = await self.bot.db.config.find_one({'_id': str(server.id)})\n if result and result.get('user_role'):\n await ctx.send(f'The user role restricts which users are abl...
[ "0.70054436", "0.65487665", "0.6437168", "0.6298675", "0.6256273", "0.6251447", "0.61828697", "0.61692184", "0.6161754", "0.6156654", "0.6137174", "0.6129091", "0.60594696", "0.6057495", "0.6056896", "0.6034594", "0.60216343", "0.59853345", "0.59815663", "0.59815663", "0.5978...
0.7361508
0
Set a welcome message or disable welcome in the current channel. Use %user where they should be mentioned. Use %guild_name if the server name should be added.
async def welcome(self, ctx, *, message=None): try: channel_id = ctx.channel.id guild_id = ctx.guild.id server_prefix = await self.ex.get_server_prefix(ctx) server = self.ex.cache.welcome_messages.get(guild_id) welcome_new_users = f"> This server will ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def setwelcome(self, ctx, *, message = None):\n\n isAdmin = ctx.message.author.permissions_in(ctx.message.channel).administrator\n if not isAdmin:\n checkAdmin = self.settings.getServerStat(ctx.message.guild, \"AdminArray\")\n for role in ctx.message.author.roles:\n ...
[ "0.8483016", "0.7790567", "0.73455733", "0.7308362", "0.6960479", "0.6867433", "0.663092", "0.6571328", "0.6532509", "0.6520279", "0.64511997", "0.63572043", "0.6355484", "0.6140851", "0.60997266", "0.6037094", "0.6015206", "0.6003574", "0.60005796", "0.5928389", "0.5882943",...
0.8194529
1
Unmute a user that is already muted.
async def unmute(self, ctx, user: discord.Member = None): try: if not user: return await ctx.send(f"> **<@{ctx.author.id}>, Please specify a user to unmute.**") if user.id == ctx.author.id: return await ctx.send(f"> **<@{ctx.author.id}>, You cannot unmute ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def unmute(self, ctx, user: Redeemed):\n if member == None or member == ctx.message.author:\n await ctx.send(\"You cannot unmute yourself!\")\n return \n await user.remove_roles(discord.utils.get(ctx.guild.roles, name=\"Muted\"))\n await ctx.send(f\"{user.mention}...
[ "0.8070011", "0.7602932", "0.73917466", "0.70347655", "0.7000994", "0.6717318", "0.65731317", "0.6399834", "0.62517285", "0.6171112", "0.6139472", "0.611902", "0.61041653", "0.6092649", "0.6031676", "0.59940195", "0.59929574", "0.5984859", "0.5939585", "0.591522", "0.5912813"...
0.77826923
1
Set the server prefix. If prefix was forgotten, type this command with the default prefix.
async def setprefix(self, ctx, *, prefix=bot_prefix): prefix = prefix.lower() current_server_prefix = await self.ex.get_server_prefix(ctx.guild.id) if len(prefix) > 8: await ctx.send("> **Your prefix can not be more than 8 characters.**") else: # Default prefix '%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def setprefix(self, ctx: Context, prefix: str):\n if ctx.guild is None:\n raise NoPrivateMessage(\"You cannot use this command in a DM\")\n\n if await GuildRepository().set_command_prefix(ctx.guild, prefix):\n message = f\"Command prefix changed to `{prefix}`.\"\n e...
[ "0.7993241", "0.787467", "0.7861366", "0.7730194", "0.7727204", "0.7657434", "0.7640239", "0.7638774", "0.75863314", "0.7553598", "0.73192656", "0.7275514", "0.7252911", "0.71490145", "0.7106655", "0.7083303", "0.7083303", "0.69978535", "0.67571026", "0.66626537", "0.6635001"...
0.8408859
0
Makes Current Channel a temporary channel deleting messages after a certain time period (greater than 1 minute). If delay is 1, it will remove the channel.
async def tempchannel(self, ctx, delay=-1): channel_id = ctx.channel.id try: if delay == -1: await self.ex.conn.execute("DELETE FROM general.TempChannels WHERE chanID = $1", channel_id) self.ex.cache.temp_channels[channel_id] = None return awai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _delete_after(delay: int, message: Message):\n time.sleep(delay)\n message.delete()\n logger.debug(f'Message {message.message_id} in {message.chat.type} chat {message.chat.id} deleted:\\n{message.text}')\n return", "async def delete_thread(thread: discord.Thread, sec_delay: int = 10) -> None:\n ...
[ "0.5987601", "0.5972578", "0.5609783", "0.5569343", "0.5544192", "0.5504571", "0.54900277", "0.54894274", "0.5484144", "0.54553354", "0.54310125", "0.53330386", "0.5291939", "0.52539366", "0.5231801", "0.5169486", "0.50966954", "0.5092604", "0.5086375", "0.50843096", "0.50751...
0.80433017
0
Disable or Enable the ability to play games in a text channel.
async def togglegames(self, ctx, *, channel: discord.TextChannel = None): channel = channel or ctx.channel user = await self.ex.get_user(ctx.author.id) if not channel: log.console(f"Could not find text channel. -> User: {user.id} - Moderator.togglegames") msg = await self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def tc_enable(self, ctx):\n await self.config.guild(ctx.guild).private_textchannels_enabled.set(True)\n await ctx.send(_(\"Private text channels enabled.\"))", "async def tc_disable(self, ctx):\n await self.config.guild(ctx.guild).private_textchannels_enabled.set(False)\n await ...
[ "0.72426176", "0.7108329", "0.66102093", "0.65212935", "0.64946306", "0.63233495", "0.6049498", "0.60425353", "0.60274947", "0.6001617", "0.6000422", "0.58951974", "0.5878869", "0.5738091", "0.5726419", "0.570718", "0.56762326", "0.5660857", "0.5636904", "0.5624036", "0.56229...
0.71440595
1
Determine the minimum clock period of a given synchronous network graph
def clock_period(graph): G0 = graph.copy() for i, j in graph.edges(): if graph.edge[i][j]['weight'] != 0: G0.remove_edge(i,j) sorted_nodes = nx.topological_sort(G0) delta = [0 for node in sorted_nodes] for node in sorted_nodes: in_edges = G0.in_edges(node) d = gra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def negotiatedminimumtransmitinterval(self) :\n\t\ttry :\n\t\t\treturn self._negotiatedminimumtransmitinterval\n\t\texcept Exception as e:\n\t\t\traise e", "def DRFindMinimalEdge(self, flow, edge_lst):\n\t\tarr_time = flow[3]\n\t\tend_time = flow[3] + flow[4]\n\t\tmin_cum_size = float('inf')\n\t\tmin_edge = (-1,...
[ "0.6226937", "0.5969016", "0.5960306", "0.58376765", "0.5671713", "0.56243455", "0.55676866", "0.5561261", "0.5544068", "0.5478313", "0.5476046", "0.5473105", "0.5311162", "0.5275942", "0.5262569", "0.5254871", "0.52359545", "0.5220551", "0.5200419", "0.5199603", "0.51809627"...
0.6710977
0
Tests the ability to parse list (phase) of list (measurements) of tensors into list (expert_id) of lists (phase) of list (measurements) where each value in this List[List[List[int]]] is ID of the active cluster center
def test_partition_to_list_of_ids(): flock_size = 3 # and num_cc = 4 # measurement 0 in phase 0 (output of the flock at the time step 0) meas_0 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] # measurement 1 in phase 0 (flock output at time step 1) meas_1 = [0, 0, 1, 0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _identify_determinism_check(parents_of, descendants_of , root_indices, observed_index):\n list_extract_and_union = lambda list_of_lists, indices: set().union(\n chain.from_iterable(list_of_lists[v] for v in indices))\n parents_of_observed = set(parents_of[observed_index])\n # descendants_of_roo...
[ "0.5051775", "0.5049229", "0.49731857", "0.49444747", "0.49138793", "0.48852348", "0.48235372", "0.48187885", "0.4775503", "0.4760174", "0.4707695", "0.47004578", "0.466569", "0.4661157", "0.46610335", "0.4658122", "0.46512058", "0.46472982", "0.4633909", "0.46306962", "0.463...
0.6526143
0
upgrades the kernel image in all nodes.
def upgrade_kernel(**kwargs): execute("upgrade_kernel_node", env.host_string, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def upgrade_kernel():\n execute(\"upgrade_kernel_node\", env.host_string)", "def refresh_kernels() -> None:\n ...", "def upgrade_kernel_all(reboot='yes'):\n execute('pre_check')\n execute('create_install_repo')\n nodes = []\n with settings(host_string=env.roledefs['all'][0], warn_only=True):\...
[ "0.7149024", "0.6811055", "0.6714276", "0.65232706", "0.6343253", "0.621876", "0.6174456", "0.6145079", "0.5818923", "0.5790783", "0.5543599", "0.54902196", "0.54902196", "0.54793686", "0.5423172", "0.54136807", "0.5375623", "0.53338385", "0.5327317", "0.5295465", "0.52530986...
0.6859755
1
Searches through the specified JSON string looking for HA state enumerations.
def _get_ha_state_from_json(string_json): json_data = json.loads(string_json) jmx_beans = json_data["beans"] # look for NameNodeStatus-State first for jmx_bean in jmx_beans: if "name" not in jmx_bean: continue jmx_bean_name = jmx_bean["name"] if jmx_bean_name == "Hadoop:service=NameNode,nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def states():\n # Query all abbreviations by state\n States = engine.execute(\"SELECT * FROM states\").fetchall()\n \n return jsonify({'States': [dict(row) for row in States]})", "def test_enum(self):\n i = Organism(state='LIVING')\n print(i)\n print(i.state)\n print(i.sta...
[ "0.56411153", "0.5198374", "0.51391184", "0.5120621", "0.5108485", "0.5102108", "0.5051708", "0.5024089", "0.50229275", "0.5012967", "0.49848494", "0.4982494", "0.49381733", "0.49052173", "0.4899822", "0.48988268", "0.4893389", "0.48889798", "0.4881689", "0.48692036", "0.4868...
0.6859972
0
Attempts to correctly coerce a value to an integer. For the case of an integer or a float, this will essentially either NOOP or return a truncated value. If the parameter is a string, then it will first attempt to be coerced from a integer, and failing that, a float.
def _coerce_to_integer(value): try: return int(value) except ValueError: return int(float(value))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def try_int_cast(value):\n try: \n return int(value)\n except:\n return value", "def to_int(value):\n\n if isinstance(value, int):\n return value\n\n elif isinstance(value, string_types):\n return int(value) if value.isdigit() else None", "def try_to_convert(value):\n ...
[ "0.7792822", "0.73420566", "0.7323653", "0.72303414", "0.71984273", "0.7159498", "0.7138155", "0.7006488", "0.69212854", "0.68808705", "0.6771102", "0.6750847", "0.6742076", "0.67270577", "0.67158943", "0.67016", "0.67016", "0.67016", "0.66678286", "0.66505164", "0.6641889", ...
0.80135506
0
Update background via colorpicker.
def update_background(self): color = QColorDialog().getColor() self.model.set('Look', 'background', str(color.name(QColor.HexRgb))) self.model.announce_update()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setBackground(self, color = None):", "def _color_change_mode(self):\r\n self.dlg.exec_()\r\n self.color = self.dlg.currentColor().name()\r\n self.colorPlate.setStyleSheet(\"background-color: %s;\" % self.color)\r\n self.input_scene.get_stk_color(self.color)\r\n return", "...
[ "0.70130575", "0.6885357", "0.67760617", "0.67751163", "0.6733101", "0.66321963", "0.65766007", "0.6510836", "0.6497699", "0.64962745", "0.6441087", "0.6437614", "0.6384083", "0.63471085", "0.63409907", "0.6340877", "0.6330965", "0.63091075", "0.62898254", "0.628445", "0.6268...
0.7579412
0
Uploads data to an 'artificial' history bank on NCBI's servers. Returns a WebEnv and a query_key
def use_epost(self, accession_numbers, webenv): if self.terminated is True: raise ProgramDone url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/epost.fcgi" post_params = {"db": self.database, "api_key": self.api_key} if webenv is not None: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store_history(request):\n if request.session.get('galaxyemail') is None:\n return HttpResponseRedirect(reverse(\"index\"))\n else:\n server = request.POST.get('server')\n gi = GalaxyInstance(url=server, email=request.session.get(\"galaxyemail\"), password=request.session.get(\"galaxy...
[ "0.5529895", "0.5279939", "0.50465393", "0.5036844", "0.4992516", "0.4982763", "0.4882346", "0.48554572", "0.48378453", "0.4836524", "0.48198614", "0.47828782", "0.47683403", "0.47282067", "0.47137108", "0.46966627", "0.46809465", "0.46627095", "0.46611452", "0.46261087", "0....
0.56460917
0
Checks if any sequences did not download correctlly. If discrepancies between the downloaded sequences and the Accesions are found, a new missing sequences list is generated and an attempt is made to fetch the missing sequences.
def missing_checker(self): self.verification_attempt += 1 if self.verification_attempt >= 6: self.finish(False, "After 5 failed attempts to verify the download," " it is apparent that some accession numbers cannot be " "matched to the FASTA tit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_missing_sequence(self, messages):\n community = messages[0].community\n sources = defaultdict(lambda: defaultdict(set))\n\n if __debug__: dprint(\"received \", len(messages), \" missing-sequence message for community \", community.database_id)\n\n # we know that there are buggy c...
[ "0.6455028", "0.6046071", "0.55480504", "0.5388342", "0.5344062", "0.5292522", "0.52783185", "0.5272275", "0.5251674", "0.5244156", "0.5234574", "0.52031505", "0.51632917", "0.5150767", "0.5144186", "0.5106425", "0.51029843", "0.5096479", "0.50596905", "0.50218445", "0.502013...
0.8002731
0
Takes a list of accn numbers, posts it to NCBI to generate an 'artificial' history (webenv and query_key). This avoids download by
def artificial_history(self, accns): if self.terminated is True: raise ProgramDone count = len(accns) # Split the accn list into a list of 200 accns strings accn_strs = self.splitter(list(accns), self.batch_size, "s") batches = [200 * x for x in range(0, len(accn_st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_epost(self, accession_numbers, webenv):\n if self.terminated is True:\n raise ProgramDone\n url = \"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/epost.fcgi\"\n post_params = {\"db\": self.database,\n \"api_key\": self.api_key}\n if webenv is not...
[ "0.56892544", "0.55832124", "0.5223432", "0.5029317", "0.5022156", "0.49680284", "0.49614877", "0.4896509", "0.48705587", "0.48476195", "0.48172727", "0.47777885", "0.4775957", "0.47626606", "0.47480318", "0.47264844", "0.47240952", "0.47213438", "0.47165903", "0.47074118", "...
0.5796782
0
Splits a "list to split" (lts) into a list of lists with length 'size' and returns it. If 'res' == 's', return a list of strings instead (with list elements joined by ',')
def splitter(self, lts, size, res="l"): if res == "l": new_list = [lts[i:i + size] for i in range(0, len(lts), size)] elif res == "s": new_list = [",".join(lts[i:i + size]) for i in range(0, len(lts), size)] return new_list
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repair_size_list(self, str_val):\n return [word for word in str_val[2:-2].split('\\', \\'')]", "def splitList(arr, size):\n arrs = []\n while len(arr) > size:\n pice = arr[:size]\n arrs.append(pice)\n arr = arr[size:]\n arrs.append(arr)\n return arrs", "def resulttol...
[ "0.6046342", "0.5913919", "0.58670187", "0.57972634", "0.57590324", "0.5716384", "0.57093996", "0.5705567", "0.5644215", "0.56146973", "0.5528575", "0.5522426", "0.5468159", "0.54598165", "0.5456563", "0.5431851", "0.53877515", "0.5374089", "0.5356364", "0.529939", "0.5284255...
0.80900824
0
r"""Here we extract the quantum energies (Hartree) from Gaussian outputs
def collect_quantum_energies(quantum_outputs): #here we will cycle throught the outputs in order to detect SCF enery input_files = glob.glob(quantum_outputs) dict_energy = {} #now cycle through all the output gaussian files for f in input_files: #to be sure we take the last indexes p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ReadGaussian():\n # LICHEM calculates this as the optimization energy - self energy.\n # Self energy of the charges = {f} a.u.\n self_line = \" Self energy of the charges\"\n # SCF Done: E({s}) = {f} A.U. after {d} cycles\n SCF_line = \" SCF Done:\"\n with open('LICHM_GaussEnergy_0.log') as ...
[ "0.6411829", "0.624495", "0.6235688", "0.61800325", "0.61267513", "0.60656035", "0.59625137", "0.59247386", "0.5892571", "0.5866871", "0.5851228", "0.583717", "0.58276546", "0.581985", "0.5783999", "0.5736202", "0.5730291", "0.5706874", "0.5705933", "0.57004285", "0.56938505"...
0.65418214
0
r"""Here we extract the molecular mechanics (amber) energies by using Paramfit as evaluator
def collect_amber_energies(top,crd): input_files = glob.glob(crd) dict_energy = {} for f in input_files: phi =int( f.split("/")[-2]) # to be more consistent, we know that in -2 there's phi psi =int( f.split("/")[-1].split(".crd")[0].split("structure_")[1]) #first fix phi and psi val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_energies(data, cencol, save_path = None, eltname = '', **kwargs):\n # element id\n try:\n kalpha = emission[eltname]['ka1']\n kbeta = emission[eltname]['kb']\n except KeyError:\n raise KeyError(\"element identifier not found: \" + eltname)\n\n spectrum = lineout(data, cenco...
[ "0.58930486", "0.58162683", "0.5726842", "0.571812", "0.5710656", "0.56945974", "0.5646338", "0.562493", "0.5602448", "0.55548865", "0.5506868", "0.54986084", "0.54795724", "0.5468456", "0.54624945", "0.54612726", "0.54467165", "0.54089326", "0.53664887", "0.53535944", "0.533...
0.68396723
0
Calls all interaction between user and program, handles program menu and user inputs. It should repeat displaying menu and asking for input until that moment. You should create new functions and call them from main whenever it can make the code cleaner
def main(): is_program_working = True while is_program_working: display.print_program_menu(MAIN_MENU) try: choose_option() except ValueError as err: display.print_command_result(str(err))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main():\n user_interaction()", "def main(self):\n while self.leave_main_menu:\n print(fr.FR[4], fr.FR[5], fr.FR[6], fr.FR[7])\n self.choice_menu = input(fr.FR[8])\n self.main_menu_input()", "def execute_main_menu(self) -> None:\n user_choice = None\n ...
[ "0.7707197", "0.75661355", "0.73659503", "0.73592186", "0.731293", "0.73070616", "0.7302364", "0.72882473", "0.72791016", "0.7232078", "0.72119623", "0.72091335", "0.71037585", "0.7091027", "0.7066254", "0.7044588", "0.7028368", "0.7022981", "0.7002707", "0.6994954", "0.69874...
0.78424555
0
Test MSc thesis skipping.
def test_non_thesis(non_thesis): assert non_thesis is None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test(self):\n self.skipped_test('doctest module has no DocTestSuite class')", "def test_text_found_in_single_slide(collected_seg_motif):\n slide_not_found, error_records_future, error_records_seg, skip_test = collected_seg_motif\n if skip_test:\n pytest.skip(\"File does not have nti_data\...
[ "0.65100604", "0.61150867", "0.60575783", "0.6013728", "0.5994599", "0.5909471", "0.5909471", "0.59016776", "0.58776027", "0.5831309", "0.5829992", "0.5829183", "0.5829183", "0.58144194", "0.58066106", "0.5798917", "0.57887024", "0.5757505", "0.575272", "0.57524014", "0.57522...
0.6297704
1
Check connection and download file trough ftp. !!! Overwrites existing file if not told otherwise
def get_file(self): while not (self.is_connection_working()): print('Connection is not working. Reason should be printed above. Sleeping 5 minutes and retrying.') time.sleep(300) i = 0 while True: if i >= 3: print('Looks like file {} is really ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_ftp(dst_filename, local_path, ftp_host, ftp_login, \r\n ftp_passwd, ftp_directory):\r\n file = open(local_path, 'wb')\r\n print 'Reconnecting ...'\r\n handle = ftp_connect(ftp_host, ftp_login, \r\n ftp_passwd, ftp_directory)\r\n handle.voidcmd('TYPE I...
[ "0.72098696", "0.7201349", "0.70802784", "0.7076183", "0.6888312", "0.68860376", "0.68034256", "0.67744195", "0.6769584", "0.65829825", "0.6521947", "0.64089864", "0.63346887", "0.6311521", "0.63108796", "0.62610817", "0.62602735", "0.6250051", "0.62478083", "0.62124985", "0....
0.7570447
0
Group miler names into threes. Yields a generator.
def _miler_grouper(iterable): length = len(iterable) + 1 if length == 3: yield [each.text for each in iterable] for i in range(3, length, 3): previous = i - 3 group = iterable[previous: i] yield [each.text for each in group]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tanks(self):\n for node_name in self._tanks:\n yield node_name, self._data[node_name]", "def generate_groups():\n groups = group_elements(\n generate_examples(file_name),\n cfg.tfrecord_size)\n\n # pairing groups to unique numbers and \n # filterin...
[ "0.5749507", "0.57052106", "0.5634005", "0.5441492", "0.5434254", "0.54328305", "0.53673345", "0.5300779", "0.52863544", "0.528096", "0.5259079", "0.5252174", "0.52185255", "0.5193279", "0.51650727", "0.5159966", "0.51493865", "0.5129067", "0.51259387", "0.5094809", "0.508104...
0.60315925
0
Set the system to dark mode or not.
def _set_dark_mode(dark_mode: bool): cmd = ["osascript", "-l", "JavaScript", "-e"] if dark_mode: cmd += ["Application('System Events').appearancePreferences.darkMode = true"] else: cmd += ["Application('System Events').appearancePreferences.darkMode = false"] subprocess.run(cmd)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle(self) -> None:\n if self.value is None:\n raise ValueError('Cannot toggle dark mode when it is set to auto.')\n self.value = not self.value", "def dark_mode(grid: bool = False) -> sns.set_theme:\n if grid:\n return sns.set_theme(style=\"darkgrid\")\n return sns.se...
[ "0.7472774", "0.7416975", "0.73232746", "0.7061641", "0.6715365", "0.66123253", "0.6599565", "0.65475965", "0.6503742", "0.6501521", "0.6402629", "0.6387075", "0.6379894", "0.6361234", "0.6331573", "0.63171524", "0.6285561", "0.62850267", "0.62698144", "0.62385845", "0.620727...
0.7586042
0
Executes a function at regular intervals while the condition is false and the amount of attempts < maxAttempts.
def wait_until(condition, delay, max_attempts): attempt = 0 while not condition() and attempt < max_attempts: attempt += 1 time.sleep(delay) if attempt >= max_attempts: raise Exception("Condition is still False after {} attempts.".format(max_attempts))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retry(nattempts, exception=None):\n \n def tryIt(func):\n def wrapper(*args, **kwargs):\n attempts = 0\n while attempts < nattempts - 1:\n try:\n return func(*args, **kwargs)\n except (exception if exception is not None else Ex...
[ "0.6381349", "0.6271347", "0.626039", "0.6252233", "0.6236707", "0.6236707", "0.6170112", "0.616949", "0.616041", "0.6118186", "0.59956497", "0.5974625", "0.59706473", "0.59677565", "0.59341055", "0.59283906", "0.59141976", "0.5908132", "0.5884212", "0.5877493", "0.587489", ...
0.6463625
0
Applies the bridge layer to the final encoder hidden states. The input to the ``forward`` is expected to have already been reshaped for initializing the decoder.
def forward(self, hidden: Union[torch.Tensor, Tuple[torch.Tensor, ...]]) -> Union[torch.Tensor, Tuple[torch.Tensor, ...]]: # First, map the non-tuple version to a 1-tuple for easier processing. # We will undo this at the end if not isinstance(hidden, tuple): hidden = (hidden,) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forward(self, trg_embed, encoder_hidden, encoder_final, \n src_mask, trg_mask, hidden=None, max_len=None):\n \n # the maximum number of steps to unroll the RNN\n #print(\"czw src mask\", src_mask.size())\n #print(\"czw trg embed\", trg...
[ "0.63221574", "0.6157343", "0.6141186", "0.6141186", "0.6122082", "0.6069905", "0.5950378", "0.5930603", "0.584369", "0.58335346", "0.58134943", "0.5795488", "0.57759076", "0.5774589", "0.577322", "0.5769746", "0.57366055", "0.5735398", "0.5673114", "0.5650568", "0.5642992", ...
0.6893193
0
Cook up a mock for the Response with specific arguments.
def response(): def inner(ret_code, ret_value): """Set up response with the given parameters. :param ret_code: Return code for the response :param ret_value: Return value for the response :return: Mocked Responce object with the given parameters """ with mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mocked_requests_get():\n\n class MockResponse:\n def __init__(self, _content, _status):\n self.content = _content\n self.status_code = _status\n\n def content(self):\n return self.content\n\n return MockResponse", "def __call__(self, url, **kwargs):\n ...
[ "0.69786805", "0.6805909", "0.66405565", "0.6631657", "0.6606776", "0.6583181", "0.6576626", "0.6537886", "0.6537886", "0.64663863", "0.6438763", "0.6434038", "0.6428945", "0.6370893", "0.63572294", "0.6318053", "0.6259043", "0.62482667", "0.6245254", "0.6188998", "0.6166345"...
0.7046971
0
Prepare instance of the RPClient for testing.
def rp_client(): client = RPClient('http://endpoint', 'project', 'api_key') client.session = mock.Mock() return client
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_setup(self):\n self.client = Client()", "def setUp(self):\n self.client = api.Client(config.get_config(), api.json_handler)", "def SetUp(self):\n self.client = mock.Client(\n client_class=apis.GetClientClass('edge', 'v1alpha1'))\n self.client.Mock()\n self.addCleanup(se...
[ "0.7082959", "0.68216586", "0.6733405", "0.67294174", "0.67294174", "0.67294174", "0.67294174", "0.66008776", "0.65996695", "0.6582165", "0.6566996", "0.6522097", "0.6515163", "0.6515163", "0.6515163", "0.6515163", "0.6515163", "0.65132797", "0.65132797", "0.64890045", "0.645...
0.7576592
0
First identify strongly connected components, then perform a topological sort on these components.
def robust_topological_sort(graph): components = strongly_connected_components(graph) node_component = { } for component in components: for node in component: node_component[node] = component component_graph = { } for component in components: component_grap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _topological_sort(self):\n self._reset_topological_order()\n\n def is_connected(src, dst):\n \"\"\"Judge two node whether are connected.\"\"\"\n for precursor in dst.precursor_nodes:\n if src == precursor.split(\":\")[0]:\n return 1\n ...
[ "0.77884394", "0.77634776", "0.7567118", "0.7417102", "0.73569095", "0.7079559", "0.7071693", "0.70532393", "0.6956077", "0.69461215", "0.68090934", "0.68090934", "0.6774909", "0.6760821", "0.6727893", "0.6702842", "0.6698396", "0.6693118", "0.6685681", "0.66398513", "0.65748...
0.791022
0
Setter method for enable, mapped from YANG variable /openflow_global/openflow/enable (container)
def _set_enable(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=enable.enable, is_container='container', presence=False, yang_name="enable", rest_name="enable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enable(self, enable):\n\n self._enable = enable", "def _set_enable(self, v, load=False):\n if hasattr(v, \"_utype\"):\n v = v._utype(v)\n try:\n t = YANGDynClass(v,base=YANGBool, default=YANGBool(\"true\"), is_leaf=True, yang_name=\"enable\", rest_name=\"enable\", parent=self, path_hel...
[ "0.69820154", "0.6857531", "0.67534757", "0.6325085", "0.6318583", "0.631292", "0.6296075", "0.6260034", "0.62537766", "0.6223106", "0.62069345", "0.62069345", "0.61553675", "0.60698366", "0.60564065", "0.6018765", "0.6000673", "0.5986916", "0.59683216", "0.5943867", "0.59299...
0.8650957
0
Setter method for default_behavior, mapped from YANG variable /openflow_global/openflow/default_behavior (container)
def _set_default_behavior(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=default_behavior.default_behavior, is_container='container', presence=False, yang_name="default-behavior", rest_name="default-behavior", parent=self, path_helper=self._path_helper, e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def declare_default_behavior(self, default_behavior):\n self.default_behavior = default_behavior\n return default_behavior", "def addDefaultBehavior(self, behavior):\n if not self.proxy:\n self.proxy = self.session.service(\"ALBehaviorManager\")\n return self.proxy.addDefau...
[ "0.82752717", "0.6982904", "0.6949137", "0.62963724", "0.5450344", "0.5448772", "0.54383475", "0.54246575", "0.54055226", "0.54055226", "0.53514224", "0.5333194", "0.5330814", "0.5263133", "0.5213197", "0.5213197", "0.5213197", "0.5213197", "0.5213197", "0.5156198", "0.512626...
0.85603696
0
Setter method for controller, mapped from YANG variable /openflow_global/openflow/controller (list)
def _set_controller(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: t = YANGDynClass(v,base=YANGListType("controller_name",controller.controller, yang_name="controller", rest_name="controller", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setController(self, controller):\n self.__controller = controller", "def get_controllers(self):\n controllers = list()\n try:\n rc, controllers = self.request(\"storage-systems/%s/graph/xpath-filter?query=/controller/id\" % self.ssid)\n except Exception as err:\n ...
[ "0.6521976", "0.58645225", "0.58472323", "0.58284336", "0.5763389", "0.56218415", "0.55767095", "0.55688345", "0.55547214", "0.5547061", "0.5539116", "0.5467746", "0.54673797", "0.54531056", "0.5411129", "0.5410827", "0.54060405", "0.53980416", "0.53915703", "0.534772", "0.53...
0.8297389
0
Return the default value for `option`, if any, and remove entry.
def pop_default(self, option: str) -> Optional[Any]: index = self._get_index(option) assert index is not None value = self._options[index] del self._options[index] default = value[1] if isinstance(value, tuple) else None return default
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def _opt_default(self, ctx, option):\n try:\n guild_options = self.database.get_guild_options(ctx.guild.id)\n setattr(guild_options, option, None)\n self.database.save_item(guild_options)\n await ctx.send(f\"Option {option} set to default\")\n except ...
[ "0.6760411", "0.65564317", "0.6553311", "0.6516406", "0.6490085", "0.64875686", "0.6380336", "0.6361535", "0.63483846", "0.62957925", "0.6284312", "0.62775266", "0.6269285", "0.62651265", "0.6252457", "0.6234434", "0.61861813", "0.6179679", "0.6113699", "0.6093513", "0.608223...
0.8104059
0
Return the number of options.
def __len__(self) -> int: return len(self._options)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __len__(self):\n return len(self.options)", "def __len__(self):\n return len(self._opts) + len(self._groups)", "def get_num_of_choices(self) -> int:\n return len(self._choices)", "def __len__(self):\n return len(self._group._opts)", "def getNumOptions(self):\n ret...
[ "0.794121", "0.7709613", "0.74251413", "0.7398013", "0.7342382", "0.70126665", "0.6692531", "0.6692078", "0.6584036", "0.65786767", "0.65734386", "0.6521867", "0.65074", "0.64801604", "0.6476093", "0.6418688", "0.63508415", "0.6343608", "0.63250947", "0.63137215", "0.62895614...
0.8088431
0
Return string representation of options.
def __repr__(self) -> str: return repr(self._options)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def options(self): # pragma: no cover\r\n return ''", "def _repr_options(self) -> str:\n return \"\"", "def print_options(self):\n for option in self._options.items():\n print \"{0} = {1}\".format(option[0], option[1])", "def _repr_kwargs(self):\n\n ret = \"\"\n ...
[ "0.7476046", "0.72013277", "0.705204", "0.6933768", "0.6907924", "0.68967956", "0.685485", "0.68496054", "0.6847428", "0.6841413", "0.677768", "0.6713493", "0.66648376", "0.6662109", "0.6636157", "0.6566988", "0.65623826", "0.653776", "0.6470584", "0.64371955", "0.64318436", ...
0.8534912
0
Add standard, named arguments to the `ArgumentParser`. Standard argument is given, but can be overwritten as a tuple.
def with_standard_arguments( self, *args: Union[str, Tuple[str, Any]] ) -> "ArgumentParser": remaining = Options(*args) for argument, options in copy.deepcopy( self.standard_arguments ).items(): if remaining.contains(argument): options["defaul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_args_to_parser(parser, args):\n for arg in args:\n parser.add_argument(*arg[0], **arg[1])", "def add_args(parser, args):\n for arg in args:\n parser.add_argument('--' + arg, **global_args_dict[arg])\n return parser", "def add_args(parser: argparse.ArgumentParser):\n pass", "def ...
[ "0.6943771", "0.66722625", "0.659853", "0.655699", "0.65414673", "0.6466156", "0.6443729", "0.6390381", "0.63783085", "0.6319449", "0.6289255", "0.62801075", "0.62572217", "0.6241131", "0.61995006", "0.61995006", "0.61995006", "0.6193463", "0.617723", "0.6083004", "0.6074417"...
0.76276743
0
Attach info of bought products to payload Order lines that contain bought products are retrieved through order
def payload_add_products(self, payload: dict, order: Order, language: str): order_lines: [OrderLine] = OrderLine.objects.filter(order=order.id) items: [dict] = [] area = resolve_area(order) # Additional product orders doesn't have berth product if hasattr(order, "product") and ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _serialize_order_and_product_data(order_data:dict):\n\n placed_orders = []\n ordered_products = []\n\n for order in order_data:\n if order[\"financial_status\"] not in COMPLETE_ORDER_STATUSES:\n continue\n \n items = []\n products = []\n for item in order[...
[ "0.70652825", "0.62057644", "0.61505187", "0.60614854", "0.6022275", "0.60212636", "0.5849996", "0.5847193", "0.58407116", "0.57488716", "0.5704411", "0.5699515", "0.56658226", "0.5630027", "0.5623258", "0.56221735", "0.5589071", "0.556847", "0.5559394", "0.5556886", "0.55552...
0.74106526
0
Attach customer data to payload
def payload_add_customer(self, payload: dict, order: Order): if hasattr(order, "lease") and order.lease.application: application = order.lease.application payload.update( { "email": application.email.strip(), "customer": { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def customer(self, customer):\n\n self._customer = customer", "def customer(self, customer):\n\n self._customer = customer", "def post_customer_attachment_create(self, resource_dict):\n pass", "def payload(self, payload: \"dict\"):\n self._attrs[\"payload\"] = payload", "def pos...
[ "0.6364529", "0.6364529", "0.6265319", "0.609734", "0.6035749", "0.6018018", "0.60165834", "0.6011102", "0.6004045", "0.59907657", "0.59815896", "0.59764946", "0.595555", "0.5942995", "0.5932563", "0.59047496", "0.58961475", "0.58496004", "0.57916206", "0.57781315", "0.576570...
0.7733236
0
Validate that refund notify payload authcode matches
def check_new_refund_authcode(self, request: HttpRequest): return self.check_authcode_params( request, ( "RETURN_CODE", "REFUND_ID", ), )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_check_refund_authcode_invalid(bambora_payment_provider):\n params = {\n \"AUTHCODE\": \"9C60B3077276A38495E2D785D1B5E6A293427BC4025E5C39AB870EA4CF187E0B\",\n \"RETURN_CODE\": \"1\",\n \"REFUND_ID\": \"1234567\",\n }\n rf = RequestFactory()\n request = rf.get(\"/payments/no...
[ "0.70968145", "0.708107", "0.61471677", "0.606707", "0.5810085", "0.5748455", "0.57151407", "0.56722265", "0.5631691", "0.5572529", "0.5549652", "0.55344105", "0.5519106", "0.5519106", "0.5499516", "0.5495058", "0.54815257", "0.5402864", "0.53945", "0.53944844", "0.53767633",...
0.72376555
0
Handle the asynchronous part of payform response Arrives some time after user has completed the payment flow or stopped it abruptly. Skips changing order status if it has been previously set. Although, according to Bambora's documentation, there are some cases where payment status might change from failed to successful...
def handle_notify_request(self): request = self.request logger.debug("Handling Bambora notify request, params: {}.".format(request.GET)) order_number, _timestamp = request.GET.get("ORDER_NUMBER", "-").split("-") try: order = Order.objects.get(order_number=order_number) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def awaiting_payment(self):", "def confirm_handle(self, update, context):\n chat_id = update.effective_chat.id\n response_code = update.callback_query[\"data\"] # caution_ok or caution_cancel\n request_id = context.user_data[\"reviewed_request\"]\n log.info(\"In progress req:%s %s\",...
[ "0.63485616", "0.6150717", "0.61273384", "0.61088336", "0.6058852", "0.6052279", "0.60123897", "0.59015137", "0.5787187", "0.57751393", "0.5763477", "0.57618046", "0.57581127", "0.57351875", "0.5729163", "0.5714295", "0.57141435", "0.57050234", "0.5697127", "0.5690467", "0.56...
0.6524965
0
Redirect back to UI after a successful payment This should be used after a successful payment instead of the standard Django redirect.
def ui_redirect_success(self, order: Order = None) -> HttpResponse: ui_return_url = self.extract_ui_return_url() if ui_return_url: return self._redirect_to_ui( ui_return_url, "success", order, path="/payment-result" ) else: return HttpResponse(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ui_redirect_success(self, order: Order = None) -> HttpResponse:\n ui_return_url = self.extract_ui_return_url()\n if ui_return_url:\n return self._redirect_to_ui(ui_return_url, \"success\", order)\n else:\n return HttpResponse(\n content=\"Payment succes...
[ "0.79106206", "0.74698174", "0.724521", "0.7104725", "0.69066256", "0.6853378", "0.6666597", "0.6590998", "0.6422033", "0.63408065", "0.63101536", "0.6245088", "0.62427443", "0.6137442", "0.6135688", "0.6107578", "0.6105562", "0.60710305", "0.60591173", "0.6042279", "0.604011...
0.79341227
0
Redirect back to UI after a failed payment This should be used after a failed payment instead of the standard Django redirect.
def ui_redirect_failure(self, order: Order = None) -> HttpResponse: ui_return_url = self.extract_ui_return_url() if ui_return_url: return self._redirect_to_ui( ui_return_url, "failure", order, path="/payment-result" ) else: return HttpResponseS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ui_redirect_failure(self, order: Order = None) -> HttpResponse:\n ui_return_url = self.extract_ui_return_url()\n if ui_return_url:\n return self._redirect_to_ui(ui_return_url, \"failure\", order)\n else:\n return HttpResponseServerError(\n content=\"Pay...
[ "0.80557454", "0.7319208", "0.7280784", "0.71900874", "0.6643521", "0.6636223", "0.66347367", "0.64407", "0.6357216", "0.634363", "0.62887836", "0.6171861", "0.6100266", "0.60915905", "0.60643876", "0.6057458", "0.605655", "0.6052979", "0.60327387", "0.5962985", "0.5903627", ...
0.8148067
0
check a given subject contains some template variables
def check_template_variables(subject, vars): for var in vars: expect(subject).to(match(r'\{\{cookiecutter\.' + var + '\}\}'))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __validateTemplateVariables(self, vars):\n for requiredVarName in self.varNames():\n if requiredVarName not in vars:\n raise VariableNotFoundError(\n 'Could not find a value for the variable {0}'.format(\n requiredVarName\n ...
[ "0.6202447", "0.6061297", "0.5915036", "0.5741971", "0.5687373", "0.54741687", "0.5432199", "0.5432199", "0.53529316", "0.5331337", "0.5312817", "0.5312703", "0.5300602", "0.5299662", "0.52986795", "0.52915627", "0.5285575", "0.5272191", "0.5198031", "0.51821196", "0.51681757...
0.70207363
0
Parse how the different variant callers have performed
def parse_callers(variant): callers = { 'gatk': None, 'freebayes': None, 'samtools': None, 'mutect': None, 'pindel': None, } raw_info = variant.INFO.get('set') if raw_info: info = raw_info.split('-') for call in info: if call == 'Filter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_variant_line():\n pass", "def desiredVariantCaller(args, log, exePath):\n\t\n\tif args.variant_caller == 'freebayes':\n\t\tfreebayes.freecommand(args, log, exePath)\n\t\n\t\t\n\telif args.variant_caller == 'xatlas':\n\t\txatlas.xatlascommand(args, log, exePath)\n\n\telif args.variant_caller == 'octopu...
[ "0.5840416", "0.5455543", "0.54217166", "0.5353846", "0.5332486", "0.52575105", "0.52257013", "0.51731515", "0.5166473", "0.5086005", "0.50772935", "0.5072685", "0.49866334", "0.49477035", "0.49466842", "0.49315357", "0.4907221", "0.48919326", "0.48861676", "0.48764256", "0.4...
0.6978532
0
Random page returns a Page type.
def test_random_page_returns_page(mock_requests_get: Mock) -> None: page = wikipedia.get_random_page() assert isinstance(page, wikipedia.Page)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_random_page() -> Dict:\n name = random.choice(wiki_data[\"names\"])\n return get_page_from_name(name)", "def get_random_page(self, lang: str = 'en') -> MediaWikiPage:\n self.set_language('en')\n random_page = self.wiki.random(pages=1)\n return self.get_page(random_page)", "de...
[ "0.7148852", "0.69463736", "0.6764513", "0.6484352", "0.6201317", "0.60459405", "0.58357376", "0.57626563", "0.5742", "0.57255256", "0.5613875", "0.5613875", "0.5524343", "0.5521455", "0.5466338", "0.54627204", "0.54535717", "0.54146665", "0.5393067", "0.534698", "0.53458405"...
0.69979626
1
Creates a new deployment resource pool using v1beta1 API.
def CreateBeta(self, location_ref, deployment_resource_pool_id, autoscaling_metric_specs=None, accelerator_dict=None, min_replica_count=None, max_replica_count=None, machine_type=None): machine_sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pool_create(self, pool_name):\n self.core.api.os.shell.cmd('{0} add apppool /name:\"{1}\"'.format(\n self.APP_CMD, pool_name\n ))", "def create_pool(self, body=None):\r\n return self.post(self.pools_path, body=body)", "def create_pool(self, context, pool):\n LOG.info(...
[ "0.6167923", "0.5760448", "0.5747159", "0.5463949", "0.54068714", "0.53646266", "0.53464913", "0.53220224", "0.52917194", "0.52799445", "0.52324224", "0.5229868", "0.5211266", "0.5117489", "0.5090683", "0.5081805", "0.5066949", "0.50664973", "0.5061848", "0.5025911", "0.49688...
0.59866756
1
Deletes a deployment resource pool using v1beta1 API.
def DeleteBeta(self, deployment_resource_pool_ref): req = self.messages.AiplatformProjectsLocationsDeploymentResourcePoolsDeleteRequest( name=deployment_resource_pool_ref.RelativeName()) operation = self.client.projects_locations_deploymentResourcePools.Delete( req) return operation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_entity(self, context, pool):\n resource_path = \"%s/%s/%s\" % (RESOURCE_PREFIX, POOLS_RESOURCE,\n pool.id)\n msg = _(\"NetScaler driver pool removal: %s\") % pool.id\n LOG.debug(msg)\n self.client.remove_resource(context.tenant_id, resourc...
[ "0.6397726", "0.6235195", "0.6207189", "0.61801", "0.6021349", "0.58845013", "0.57817644", "0.56008065", "0.55686426", "0.5542121", "0.55001605", "0.5479599", "0.5396984", "0.53380674", "0.5324077", "0.53164047", "0.52782357", "0.5266646", "0.51605874", "0.5125277", "0.510422...
0.6869241
0
Describes a deployment resource pool using v1beta1 API.
def DescribeBeta(self, deployment_resource_pool_ref): req = self.messages.AiplatformProjectsLocationsDeploymentResourcePoolsGetRequest( name=deployment_resource_pool_ref.RelativeName()) response = self.client.projects_locations_deploymentResourcePools.Get(req) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_pool(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"resource_pool\")", "def show_pool(self, pool, **_params):\r\n return self.get(self.pool_path % (pool), params=_params)", "def resource_pool_id(self) -> str:\n return pulumi.get(self, \"resource_pool_id\")",...
[ "0.5780057", "0.5699336", "0.56792605", "0.56720954", "0.54815435", "0.52104545", "0.51299936", "0.5119539", "0.51173115", "0.51163334", "0.5099717", "0.50743794", "0.50586873", "0.50559586", "0.50393605", "0.50181895", "0.49597734", "0.49561703", "0.49560535", "0.49499935", ...
0.6153099
0
Lists deployment resource pools using v1beta1 API.
def ListBeta(self, location_ref): req = self.messages.AiplatformProjectsLocationsDeploymentResourcePoolsListRequest( parent=location_ref.RelativeName()) return list_pager.YieldFromList( self.client.projects_locations_deploymentResourcePools, req, field='deploymentResourcePools',...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DescribeBeta(self, deployment_resource_pool_ref):\n req = self.messages.AiplatformProjectsLocationsDeploymentResourcePoolsGetRequest(\n name=deployment_resource_pool_ref.RelativeName())\n\n response = self.client.projects_locations_deploymentResourcePools.Get(req)\n\n return response", "def l...
[ "0.6190245", "0.5821876", "0.57814866", "0.5688545", "0.56875384", "0.55912584", "0.55903196", "0.5504191", "0.54440635", "0.54413265", "0.5398899", "0.53864413", "0.53565186", "0.5314284", "0.53099024", "0.5261335", "0.5193471", "0.515706", "0.5072364", "0.50721616", "0.5047...
0.6893242
0
Queries deployed models sharing a specified deployment resource pool using v1beta1 API.
def QueryDeployedModelsBeta(self, deployment_resource_pool_ref): req = self.messages.AiplatformProjectsLocationsDeploymentResourcePoolsQueryDeployedModelsRequest( deploymentResourcePool=deployment_resource_pool_ref.RelativeName()) response = self.client.projects_locations_deploymentResourcePools.QueryD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_pool(self, name, dc, cluster):\n cluster_obj = self.get_cluster(cluster, dc)\n for rp in cluster_obj.resourcePool.resourcePool:\n if rp.name == name:\n return rp", "def show_pool(self, pool, **_params):\r\n return self.get(self.pool_path % (pool), params=_pa...
[ "0.53051823", "0.52795744", "0.52511835", "0.5218014", "0.516438", "0.50389296", "0.50016934", "0.49136478", "0.47974765", "0.47784764", "0.4772385", "0.4723294", "0.47048357", "0.46706343", "0.46336538", "0.4627076", "0.45228192", "0.45172137", "0.45085022", "0.44901174", "0...
0.6647009
0
Send stream instructions to streamer servers in the form of HTTP POST requests. The streamer_0 is dedicated to the Twitter sample API, so we don't send any keywords or language to track
def stream(): while True: try: r = requests.post("http://streamer_0:5000/stream", json={}) break except requests.exceptions.ConnectionError: logging.error("Could not connect to server streamer_0, retrying") time.sleep(2) continue loggin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_twitter_sample_stream():\n twitter_sample_parameters = {'stall_warnings': 'true', }\n\n r = requests.post('https://stream.twitter.com/1.1/statuses/sample.json',\n data=twitter_sample_parameters,\n auth=oauth_credentials,\n stream=True,\n timeout=300)\n\n ...
[ "0.63548964", "0.62387383", "0.6121778", "0.6034019", "0.6023335", "0.5994436", "0.59045416", "0.58561283", "0.5815107", "0.57337755", "0.57225853", "0.56864727", "0.56481403", "0.55964994", "0.55778885", "0.55158633", "0.5506545", "0.549705", "0.54653", "0.5439399", "0.54226...
0.62821597
1
The start time of the backup task each day. The time is displayed in UTC and denoted by Z.
def backup_time(self) -> str: return pulumi.get(self, "backup_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def created_at(self):\n return self._backup_started", "def start_time(self) -> str:\n return pulumi.get(self, \"start_time\")", "def start_time(self) -> str:\n return pulumi.get(self, \"start_time\")", "def __get_starting_time(self):\n return self.__starting_time", "def start_ti...
[ "0.6906189", "0.6876964", "0.6876964", "0.6751362", "0.6705184", "0.6700239", "0.6675997", "0.66491383", "0.6636427", "0.6608807", "0.65648144", "0.65372765", "0.65337044", "0.64779794", "0.6471189", "0.6471189", "0.6471189", "0.6471189", "0.6471189", "0.6471189", "0.6471189"...
0.70103383
0
The ID of the data center for the backup in the cluster.
def data_center_id(self) -> str: return pulumi.get(self, "data_center_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datacenter_uuid(self) -> str:\n return self.__datacenter_uuid", "def datacenter_uuid(self) -> str:\n return self.__datacenter_uuid", "def datacenter_uuid(self) -> str:\n return self.__datacenter_uuid", "def cluster_id(self) -> str:\n return pulumi.get(self, \"cluster_id\")", ...
[ "0.75936496", "0.75936496", "0.75936496", "0.72891676", "0.72891676", "0.72891676", "0.72891676", "0.72891676", "0.7177754", "0.70222944", "0.70222944", "0.70222944", "0.70222944", "0.6964489", "0.6889661", "0.6805223", "0.6769623", "0.67540145", "0.666994", "0.66475", "0.664...
0.8123032
1
The name of the Cassandra cluster.
def cluster_name(self) -> str: return pulumi.get(self, "cluster_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_name(self):\n return self.name", "def cluster_name(self):\n return self._data['cluster_name']", "def cluster_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"cluster_name\")", "def cluster_name(self) -> pulumi.Input[str]:\n return pulumi.get(self...
[ "0.8315744", "0.8262142", "0.7975982", "0.7804748", "0.7804748", "0.76993036", "0.76993036", "0.76993036", "0.76993036", "0.76993036", "0.72726065", "0.722773", "0.722773", "0.722773", "0.722773", "0.722773", "0.72105026", "0.6832422", "0.6832422", "0.6832422", "0.6832422", ...
0.8575841
1
The count of data centers
def data_center_count(self) -> int: return pulumi.get(self, "data_center_count")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cluster_obs_count(self):\n return(self.merged_data.groupby(\n 'labels').count().transpose().iloc[0, :])", "def __len__(self):\n return len(self.centroid_vector)", "def n_clusters(self):\n return len(self.clusters)", "def get_cluster_count(self) -> int:\n return len(...
[ "0.7283876", "0.7232743", "0.7169243", "0.71611184", "0.7107053", "0.7027403", "0.69237155", "0.68993294", "0.68257225", "0.6823056", "0.67357063", "0.66787183", "0.6539355", "0.65349466", "0.65152055", "0.65119636", "0.649756", "0.64810735", "0.6478128", "0.64774287", "0.644...
0.7926824
0
The lock mode of the cluster.
def lock_mode(self) -> str: return pulumi.get(self, "lock_mode")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getMode(self):\n with self.lock:\n mode = self.mode\n return mode", "def get_sync_mode():\n return sync_mode", "def lock(self):\n print(\"DEPRECATED lock\")\n return self._operations.lock()", "def synchronize_system_mode(self):\n\n return self._synchronize...
[ "0.64043844", "0.6383851", "0.6080558", "0.6042763", "0.59549", "0.5904581", "0.59041375", "0.5851561", "0.58216435", "0.5821436", "0.58177197", "0.58177197", "0.58177197", "0.5806301", "0.579602", "0.5792638", "0.57802457", "0.57779", "0.57779", "0.57779", "0.5743134", "0....
0.83692974
1
The major version of the cluster.
def major_version(self) -> str: return pulumi.get(self, "major_version")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def major_version(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"major_version\")", "def _major_version(self):\n version_tuple = StrictVersion(self.plugin.version).version\n major = '.'.join(map(str, version_tuple[:2]))\n\n return major", "def major_version(self):\n ...
[ "0.8095561", "0.7843806", "0.76737905", "0.7607591", "0.7575507", "0.754319", "0.74550915", "0.74498546", "0.74469775", "0.7446026", "0.736904", "0.72024405", "0.71003544", "0.70603335", "0.7038165", "0.7014413", "0.70022213", "0.6925461", "0.69253856", "0.68997777", "0.68949...
0.82169604
0
The minor version of the cluster.
def minor_version(self) -> str: return pulumi.get(self, "minor_version")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minor_version(self):\n return self.unpack_dword(0x18)", "def operatingsystem_version_minor(self):\n # type: () -> string_types\n return self._operatingsystem_version_minor", "def _getVersionMinor(self):\n return int(self.model.getroot().attrib['versionMinor'])", "def version_m...
[ "0.8041561", "0.77197105", "0.76265764", "0.7584904", "0.75578654", "0.7442324", "0.72093415", "0.7170885", "0.70290256", "0.6951925", "0.6923454", "0.69031334", "0.68804866", "0.6816974", "0.6813891", "0.67073655", "0.6700512", "0.6699301", "0.66885835", "0.6664807", "0.6639...
0.83989275
0
The id of the Cassandra dataCenter.
def data_center_id(self) -> str: return pulumi.get(self, "data_center_id")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datacenter_uuid(self) -> str:\n return self.__datacenter_uuid", "def datacenter_uuid(self) -> str:\n return self.__datacenter_uuid", "def datacenter_uuid(self) -> str:\n return self.__datacenter_uuid", "def get_datacenter_id(options):\n datacenter = get_datacenter(options)\n re...
[ "0.793135", "0.793135", "0.793135", "0.7317481", "0.7270138", "0.7231726", "0.7231726", "0.7231726", "0.7231726", "0.7231726", "0.7115778", "0.67727906", "0.67239213", "0.67239213", "0.67239213", "0.67239213", "0.671187", "0.66127026", "0.65455854", "0.65146637", "0.64771473"...
0.849744
0
The name of the Cassandra dataCenter.
def data_center_name(self) -> str: return pulumi.get(self, "data_center_name")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_center_name(self) -> pulumi.Output[Optional[str]]:\n return pulumi.get(self, \"data_center_name\")", "def data_center_name(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"data_center_name\")", "def data_center_name(self) -> Optional[pulumi.Input[str]]:\n return p...
[ "0.7717032", "0.75523645", "0.75523645", "0.7114478", "0.7084735", "0.7084735", "0.7084735", "0.7064304", "0.7064304", "0.6781281", "0.6699482", "0.66600573", "0.66600573", "0.6552748", "0.65065336", "0.6225733", "0.6187941", "0.614879", "0.60645205", "0.6057441", "0.6017646"...
0.82598627
0
The expire time of the dataCenter.
def expire_time(self) -> str: return pulumi.get(self, "expire_time")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expire_time(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"expire_time\")", "def expire_time(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"expire_time\")", "def expire(self):\n return self._expire", "def expire(self):\n\n return self._expire", "def expir...
[ "0.8030801", "0.8030801", "0.79645157", "0.78908944", "0.781718", "0.77083594", "0.76692665", "0.76692665", "0.76260203", "0.7556715", "0.73039216", "0.71991795", "0.7176995", "0.7171221", "0.71636665", "0.7147248", "0.710315", "0.70974517", "0.7070578", "0.7015195", "0.69594...
0.830514
1
The lock mode of the dataCenter.
def lock_mode(self) -> str: return pulumi.get(self, "lock_mode")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_sync_mode():\n return sync_mode", "def get_lock(self):\n \n svc = \"urn:micasaverde-com:serviceId:DoorLock1\"\n if not svc in self.services:\n raise RuntimeError, \"Device doesn't support the service\"\n \n status = self.get_variable(svc, \"Status\")\n ...
[ "0.65422654", "0.6428599", "0.6367938", "0.6351137", "0.6289856", "0.6230369", "0.62003195", "0.6101583", "0.61009437", "0.6043727", "0.60331035", "0.59956855", "0.5947256", "0.5945854", "0.5944952", "0.5944952", "0.5944952", "0.5937858", "0.5923691", "0.5923691", "0.5923691"...
0.81616527
0
A list of zone ids in which the multi zone.
def multi_zone_ids(self) -> Sequence[str]: return pulumi.get(self, "multi_zone_ids")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_zones(self):\n\n return [zone[\"zone\"] for zone in list(self._zones.values())]", "def zones(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"zones\")", "def zones(self) -> Optional[Sequence[str]]:\n return pulumi.get(self, \"zones\")", "def zones(self) -> pulumi.Ou...
[ "0.7159575", "0.6993688", "0.6993688", "0.6751274", "0.65779436", "0.6566054", "0.6566054", "0.651787", "0.651787", "0.651787", "0.651787", "0.651787", "0.6507346", "0.6439465", "0.64259297", "0.6398418", "0.6349193", "0.6288608", "0.6277708", "0.6234344", "0.62283057", "0....
0.87877804
0
Enviar data a firebase en chat.
def chat_firebase_db(data, room): firebase = pyrebase.initialize_app(config) db = firebase.database() room = "chats/{}".format(room) if exist_node(room): res = db.child(room).update(data) else: res = db.child(room).set(data) # chequear que los tipos de datos correspondan if D...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def send_message(request, token, data):\n # If data exists key 'message'\n try: \n async with request.app['db'].acquire() as conn:\n # First: Get a Chat ID \n chat_id = await PostgreSQL.get_chat_id(conn, data['chat'])\n # Second: Get an Us...
[ "0.5945601", "0.5885655", "0.5726466", "0.5636816", "0.5606796", "0.5509813", "0.54669064", "0.54351664", "0.54160506", "0.5389292", "0.5361889", "0.5330488", "0.53078985", "0.5307206", "0.528037", "0.5271769", "0.52516043", "0.5251307", "0.5247529", "0.52357876", "0.5195051"...
0.7637103
0
Remover query nodo en listado de clientes
def removeQueryAcceptList(specialist_id, client_id, query_id): node_specialist = Params.PREFIX['specialist'] + str(specialist_id) node_client = Params.PREFIX['client'] + str(client_id) node_query = 'queries/{}'.format(Params.PREFIX['query'] + str(query_id)) main_node = "messagesList/specialist/{}/{}/{}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_client(self, client):\n self.clients.remove(client)\n #print(\"removing:\" + str(client))", "def delete_client(client_name):\n global clients\n\n if client_name in clients:\n clients.remove(client_name)\n else:\n print(\"Client isn\\'t in the client list\")", "de...
[ "0.63135034", "0.60841364", "0.6034844", "0.6018608", "0.6016068", "0.59551686", "0.59425634", "0.5939778", "0.5855516", "0.58451337", "0.58380234", "0.5836706", "0.5829893", "0.57973105", "0.5795633", "0.5786648", "0.5775003", "0.571728", "0.56867063", "0.56766844", "0.56701...
0.67282766
0
Actualizar que el archivo se ha subido a firebase.
def mark_uploaded_file(room, message_id, data): node = 'chats/' + room + '/' + Params.PREFIX['message'] + str(message_id) firebase = pyrebase.initialize_app(config) db = firebase.database() if exist_node(node): db.child(node).update(data) if DEBUG_FIREBASE: check_type_data('c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_file_changed(self, path):\n\t\tpass", "def upload_finish(self, cloud_file):", "def mark_failed_file(room, message_id):\n node = 'chats/' + room + '/' + Params.PREFIX['message'] + str(message_id)\n\n if exist_node(node):\n db.child(node).update({\"uploaded\": 5})\n if DEBUG_FIREBASE:\...
[ "0.5850933", "0.5734136", "0.5599197", "0.5582553", "0.5511382", "0.5454009", "0.5451953", "0.5384316", "0.53828573", "0.5379167", "0.53052", "0.53046054", "0.5299708", "0.52650255", "0.52485704", "0.5248307", "0.5247127", "0.52453214", "0.5236779", "0.52170247", "0.5195706",...
0.63946426
0
Elimina nodo de plan de clientes
def delete_actual_plan_client(client_id): node_client = Params.PREFIX['client'] + str(client_id) res = db.child("chosenPlans").child(node_client).remove() return res
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_plante(id):\n plante = get_plante(id)\n nom=plante.get_name()\n db.session.delete(plante)\n get_parterre(plante.get_parterre()).delete_plante(plante)\n p = Actions(\n contenu = \"Suppression de la plante \"+nom + \" au parterre \"+ get_parterre(plante.get_parterre()).get_name(),\n ...
[ "0.6683041", "0.6585937", "0.6452574", "0.6403913", "0.6263275", "0.61772376", "0.6163048", "0.6152784", "0.61446995", "0.61221", "0.60415643", "0.6030683", "0.6026563", "0.6026534", "0.60122067", "0.60094744", "0.59582597", "0.58713466", "0.58478373", "0.58338267", "0.581758...
0.67378336
0
Check if all units_to_check have the same Dimension like the base_units If not
def check_matching_unit_dimension( ureg: UnitRegistry, base_units: str, units_to_check: List[str] ) -> None: base_unit = getattr(ureg, base_units) for unit_string in units_to_check: unit = getattr(ureg, unit_string) if unit.dimensionality != base_unit.dimensionality: raise Dime...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _check_dimensions(self, workspace_to_check):\n for i in range(self._raw_ws.getNumDims()):\n if self._raw_ws.getDimension(i).getNBins() != workspace_to_check._raw_ws.getDimension(i).getNBins():\n return False\n return True", "def _check_dimensions(self, a, b):\n units_a = self._...
[ "0.7206268", "0.70392966", "0.6509244", "0.6361124", "0.62905383", "0.6210107", "0.6205726", "0.6141818", "0.6037354", "0.60307187", "0.60277", "0.60161746", "0.5918802", "0.59185547", "0.590097", "0.58967733", "0.5860953", "0.58545697", "0.5847457", "0.5834344", "0.58069855"...
0.76767266
0
Plot the trace, but make breaks if the atoms pass over the periodic box so that very long lines aren't drawn
def _plot_trace(self, trace, axis, idx): xy = [trace[0].value] for prevrecord, record in zip(trace[:-1], trace[1:]): if np.abs(prevrecord.value[0]-record.value[0]) > self.halfbox[0] or \ np.abs(prevrecord.value[1]-record.value[1]) > self.halfbox[1] : xy = np.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plotTrace(trace):\n for t in trace:\n plt.plot(range(len(t)),t,alpha=0.5)\n plt.ylabel(\"Trace\")\n plt.xlabel(\"Step\")\n\n return", "def plotTI():\n min_dl = dlam[dlam != 0].min()\n S = int(0.4/min_dl)\n fig = pl.figure(figsize = (8,6))\n ax = fig.add_subplot(1,1,1)\n...
[ "0.66492665", "0.6165065", "0.6108714", "0.60504377", "0.6019476", "0.5961473", "0.59493655", "0.5879118", "0.5837775", "0.5822057", "0.58065295", "0.57330096", "0.5724841", "0.5722818", "0.5714079", "0.57126564", "0.57079", "0.5685826", "0.56307256", "0.5625155", "0.5590687"...
0.67566746
0
Test actions with mocked database.
def test_action_mocked(self): with self.mock_global_connection: self.assertEqual(0, Action.count()) manager = Manager(self.connection) self.assertFalse(manager.is_populated()) manager.populate() self.assertTrue(manager.is_populated()) sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUp(self):\n self.database = Mock()", "def test_connect_db_to_query(db):\n assert 1", "def test_action_model(app):\n\n assert Action.query.count() == 2", "def test_create_db(self, db_mock):\n db_mock.return_value = MagicMock()\n result = self.runner.invoke(create_db)\n ...
[ "0.7291352", "0.7084316", "0.70579785", "0.68360525", "0.6754186", "0.67038625", "0.6614222", "0.6507114", "0.64749205", "0.6399585", "0.6368203", "0.6349692", "0.6333031", "0.63309735", "0.6265636", "0.6264407", "0.6256725", "0.62561554", "0.6229721", "0.62240046", "0.622400...
0.7374381
0