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
Return bdaqmid corresponding to an index.
def GetBDAQMid(self, index): return self._bdaqmids[index]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qindex2index(index):\n r = index.row()\n c = index.column()\n if c > 0x10:\n return (0x10 * r) + c - 0x11\n else:\n return (0x10 * r) + c", "def get_id(self, index):\n return self.__keys[index]", "def get_index(self, index):\n return self.get_...
[ "0.6528486", "0.58731806", "0.5741325", "0.5674524", "0.5642983", "0.5593458", "0.55704445", "0.55371284", "0.55042464", "0.5444057", "0.5420806", "0.5414107", "0.5401721", "0.5376091", "0.53653544", "0.5362031", "0.5356424", "0.5294231", "0.5288574", "0.52797323", "0.5256762...
0.7945044
0
Remove existing strategy from the model.
def RemoveStrategy(self): self.strategy = None self.postracker = None
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unload(self):\r\n self.gox.signal_strategy_unload(self, None)\r\n self.strategy_object_list = []", "def remove(self):\n self.model_or_sim.remove_package(self)", "def delete_model(self):\n os.remove(self.filepath)\n self.cmodel = None", "def remove_model(self, model):\n ...
[ "0.6563255", "0.6157167", "0.6131671", "0.6086076", "0.60653824", "0.6010454", "0.59444267", "0.58840036", "0.58366513", "0.5824092", "0.5808003", "0.57579666", "0.573553", "0.57235825", "0.57235825", "0.57235825", "0.57235825", "0.57235825", "0.57235825", "0.57235825", "0.57...
0.788478
0
Update the strategy frequency.
def UpdateFrequency(self, newfreq): if self.strategy: setattr(self.strategy, managers.UTICK, newfreq)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_frequencies():\n pass", "def _update(self, count=True, forced=False):", "def change_frequency(self):\n if not self.ftext.text():\n return\n frequency = float(self.ftext.text())\n if frequency > 6.0:\n frequency = 6.0\n self.qbpm.change_frequency(f...
[ "0.7685292", "0.69893366", "0.6860977", "0.67751503", "0.6760968", "0.6751761", "0.6685722", "0.66378486", "0.6615687", "0.6576171", "0.6569539", "0.6564842", "0.6536715", "0.65170115", "0.65103734", "0.6373934", "0.63418764", "0.63390464", "0.6316844", "0.6234857", "0.622544...
0.8178904
0
Attach the disk to the instance at mountpoint using info.
def attach_volume(self, context, connection_info, instance, mountpoint, disk_bus=None, device_type=None, encryption=None):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attach_volume(self, instance_name, device_path, mountpoint):\n return True", "def _AttachDisk(self, idx, params, _):\n uuid = params.get(\"uuid\", None)\n name = params.get(constants.IDISK_NAME, None)\n\n disk = self.GenericGetDiskInfo(uuid, name)\n\n # Rename disk before attaching (if dis...
[ "0.7112061", "0.70221376", "0.7012122", "0.6979955", "0.68031716", "0.6700837", "0.6697146", "0.6559337", "0.6488255", "0.63370275", "0.61489516", "0.6141329", "0.60744673", "0.6069949", "0.6043172", "0.59649885", "0.59368604", "0.57600784", "0.57503486", "0.57471454", "0.573...
0.75799954
0
Detach the disk attached to the instance.
def detach_volume(self, connection_info, instance, mountpoint, encryption=None):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detach(self):\r\n\r\n return self.driver.detach_volume(volume=self)", "def detachDisk(positive, alias, vmName):\n logger.info(\"Detaching disk %s from vm %s\", alias, vmName)\n disk_attachment = get_disk_attachment(vmName, alias, attr='name')\n return DISK_ATTACHMENTS_API.delete(disk_attachme...
[ "0.74193597", "0.7338237", "0.721738", "0.71526825", "0.714438", "0.7000114", "0.6941674", "0.69158816", "0.68212986", "0.67936045", "0.6760271", "0.67468965", "0.6729655", "0.66621906", "0.6634049", "0.657201", "0.6467935", "0.63898975", "0.63229585", "0.62806314", "0.625914...
0.7359824
1
Return usage info for volumes attached to vms on a given host.
def get_all_volume_usage(self, context, compute_host_bdms): volusage = [] return volusage
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_volume_info(host, disk_object, dc_obj):\n host_resource = get_host_resource_by_name(host)\n\n vol_id = disk_object.get_image_id()\n sd_id = disk_object.get_storage_domains().get_storage_domain()[0].get_id()\n image_id = disk_object.get_id()\n sp_id = dc_obj.get_id()\n\n args = {\n ...
[ "0.6463681", "0.62752587", "0.6237475", "0.6067815", "0.5918124", "0.586192", "0.58459896", "0.57930577", "0.57628095", "0.57522666", "0.5672278", "0.5626577", "0.56147677", "0.56082857", "0.55949056", "0.55703175", "0.5569759", "0.5569127", "0.5548287", "0.5530609", "0.55292...
0.7156149
0
Removes the named VM, as if it crashed. For testing.
def test_remove_vm(self, instance_name): self.instances.pop(instance_name)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove():\n vbox = Vbox(env.vm_name)\n vbox.remove()", "def destroy_vm(self, name_of_vm):\n self.power_off(name_of_vm)\n # import pdb;pdb.name_of_vm()\n vm = self.get_dc_object([vim.VirtualMachine], name_of_vm)\n task = vm.Destroy_Task()\n WaitForTask(task)\n s...
[ "0.7664913", "0.7518741", "0.71721107", "0.70731395", "0.69732076", "0.6950697", "0.66600686", "0.6613145", "0.651427", "0.65076905", "0.6507135", "0.64830834", "0.6366839", "0.6351328", "0.622328", "0.6189141", "0.6183088", "0.61540633", "0.61245495", "0.61129415", "0.609335...
0.7901843
0
Calls a method within the module specified with args provided.
def _call_method(self, module, method, *args, **kwargs): return self.invoke_api(module, method, *args, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exec_module(cls, *args, **kwargs): # real signature unknown\n pass", "def exec_module(cls, *args, **kwargs): # real signature unknown\n pass", "def _call_method(self, module, method, *args, **kwargs):\n if not self._is_vim_object(module):\n return self.invoke_api(module, met...
[ "0.71005887", "0.71005887", "0.67746526", "0.67205906", "0.66875315", "0.6634551", "0.63056356", "0.6267577", "0.6220619", "0.62195957", "0.61969537", "0.61894363", "0.61247283", "0.6002316", "0.599401", "0.59516126", "0.59427494", "0.59212786", "0.59182453", "0.58980024", "0...
0.7608473
0
Iterate through the order and get all recurring billing items
def get_recurring_orderitems(self): subscriptions = [] for orderitem in self.order.orderitem_set.all(): product = orderitem.product if product.is_subscription: self.log_extra("Found subscription product: %s", product.slug) if product.subscriptionpr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recurring(self):\n return self.filter(total_billing_cycles__isnull=True)", "def get_all_orders():", "def get_all_orders(): \n data = order_obj.get_all_orders()\n return data", "def get_billing_items(self, identifier):\n\n mask = \"\"\"mask[\n id, description, hostName, doma...
[ "0.6549946", "0.6459227", "0.586903", "0.56301016", "0.55795187", "0.5551268", "0.5542085", "0.55151325", "0.54951745", "0.5471996", "0.54617655", "0.54159284", "0.54017246", "0.53745145", "0.5372561", "0.5370826", "0.536859", "0.5344888", "0.52568704", "0.5231659", "0.522990...
0.6720224
0
Send a log message if EXTRA_LOGGING is set in settings.
def log_extra(self, msg, *args): if self.settings.EXTRA_LOGGING.value: self.log.info("(Extra logging) " + msg, *args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(message):\n if LOGPLEASE:\n logging.info(message)", "def debug_log(self, msg, *args, **kwargs):\n if self.debug:\n self.log.debug(msg, *args, **kwargs)", "def logger(self, message):\n if hasattr(self.log, '__call__'):\n self.log(message.strip())", "def lo...
[ "0.64407986", "0.6168677", "0.6071726", "0.6048908", "0.5984047", "0.59096014", "0.58847517", "0.58728087", "0.581197", "0.57885957", "0.5749739", "0.57324046", "0.5715226", "0.5708756", "0.5693098", "0.5669395", "0.5666494", "0.56495476", "0.56373507", "0.5629469", "0.562078...
0.8017174
0
Obtain exactly one item from the iterable or raise an exception.
def exactly_one(iterable): i = iter(iterable) try: item = next(i) except StopIteration: raise ValueError("Too few items. Expected exactly one.") try: next(i) except StopIteration: return item raise ValueError("Too many items. Expected exactly one.")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_only(seq: Iterable[T]) -> T:\n it = iter(seq)\n try:\n first_element = it.__next__()\n # we use the sentinel approach rather than the usual (evil) Python \"attempt can catch the\n # exception\" approach to avoid raising zillions of spurious exceptions on the expected\n # c...
[ "0.73700535", "0.71891385", "0.6987197", "0.68558383", "0.683411", "0.683213", "0.6811499", "0.6796202", "0.6796202", "0.668981", "0.66084677", "0.6602133", "0.65939295", "0.6576815", "0.657131", "0.6566624", "0.64851004", "0.64576167", "0.63524705", "0.6350618", "0.634518", ...
0.82768756
0
Obtain the last item from an iterable.
def last(iterable): d = deque(iterable, maxlen=1) try: return d.pop() except IndexError: raise ValueError("Cannot return last item from empty iterable {!r}".format(iterable))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last(iterable):\n it = iter(iterable)\n item = next(it)\n for item in it:\n pass\n return item", "def last(iterator):\n item = None\n for item in iterator:\n pass\n return item", "def return_last(iter):\n for thing in iter:\n pass\n return thing", "def last...
[ "0.87920225", "0.8336608", "0.8012257", "0.7952512", "0.7778646", "0.7550775", "0.71611106", "0.7121031", "0.7003908", "0.6988808", "0.69499695", "0.6938263", "0.6879468", "0.68462396", "0.6845747", "0.67840874", "0.678374", "0.6782314", "0.6776444", "0.67622405", "0.67414", ...
0.8511971
1
Given a sequence of proof terms, take resolution on them one by one.
def resolution(self, step): res_pts = [self.proof[num] for num in step.assms] pt_0 = self.proof[step.assms[0]] arity1 = self.steps[step.assms[0]-1].arity for i in step.assms[1:]: arity2 = self.steps[i-1].arity assert self.proof[i].prop == self.steps[i-1].concl, i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findLinkedTerms(self):\n for key in self.summaryDict.keys(): # v' in the formula\n if self.getCoverFromModalityInDictionnary(self.summaryDict, key) == 0:\n correlation = 0\n else:\n dep = self.getCoverFromModalityInDictionnary(self.summaryFilteredDict...
[ "0.5308942", "0.5248787", "0.52151734", "0.5174763", "0.5106836", "0.5090688", "0.50833756", "0.5019919", "0.49778193", "0.4962607", "0.49478337", "0.4927897", "0.49254432", "0.49050832", "0.4892555", "0.48887312", "0.48810247", "0.48710805", "0.48520687", "0.48300308", "0.48...
0.5916597
0
Provides a context manager for doing model inference. This puts certain layers into "inference mode", if necessary (e.g. batch normalization and dropout).
def inference_mode_on(): Layer.inference_mode = True with ng.metadata(mode="inference"): yield Layer.inference_mode = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inference_context(model):\n training_mode = model.training\n model.eval()\n yield\n model.train(training_mode)", "def inference(model, data, diagnostics, seed, extra_fitting_args):\n pass", "def inference(self, dataset, model_dir):\n raise NotImplementedError", "def create_inference...
[ "0.7924351", "0.66990066", "0.6458931", "0.6441347", "0.6344806", "0.63110465", "0.6292445", "0.61777896", "0.6047463", "0.5930157", "0.58026665", "0.57661873", "0.57472277", "0.5713225", "0.56964165", "0.5596042", "0.5596042", "0.55773693", "0.5556982", "0.55514663", "0.5489...
0.71585065
1
Initialization function for the lut. After using the initialization to fill the whole array, set the part that represents padding to be 0.
def lut_init(self, axes, pad_word_axis, pad_idx): init_w = self.init(axes) if axes.index(pad_word_axis) is 0: init_w[pad_idx] = 0 else: init_w[:, pad_idx] = 0 return init_w
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def padding(old, l):\n new = deepcopy(old)\n for i, j in enumerate(new):\n new[i] += [0] * (l - len(j))\n new[i] = j[:l]\n return new", "def zero_pad(data):\n N = len(data)\n pow_2 = np.ceil(np.log2(N))\n return np.pad(data,(0,int((2**pow_2)-N)),'constant')", "def pad_with_zeros...
[ "0.57504845", "0.57208264", "0.55567306", "0.5440776", "0.53998905", "0.5392926", "0.5346752", "0.52881277", "0.5240125", "0.5209327", "0.51652426", "0.51546246", "0.51528627", "0.5150088", "0.5145783", "0.51411784", "0.5137112", "0.51338357", "0.5132683", "0.5129447", "0.511...
0.74816704
0
Create the filter axes. They are ordered as (C, D, H, W, K).
def _filter_axes(self, channel_axes, spatial_axes): f_axes = ng.make_axes() f_axes += ng.make_axis(length=self.nout, name="K") f_axes += channel_axes for key, ax in zip(self.spatial_keys, spatial_axes): f_axes += ng.make_axis(length=self.filter_spatial_shape[key], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter_axes(self, channel_axis, spatial_axes):\n f_axes = ng.make_axis(length=self.nout, name=\"K\")\n for key, ax in zip(\"DHW\", spatial_axes):\n f_axes += ng.make_axis(length=self.filter_shape[key],\n name=ax.name)\n f_axes += channel_axis\n...
[ "0.74516636", "0.6499571", "0.62619257", "0.62412906", "0.6160327", "0.6132655", "0.5812254", "0.5753394", "0.55952036", "0.55551445", "0.55383164", "0.55284905", "0.5506311", "0.54356974", "0.53720635", "0.5354197", "0.5346949", "0.5231423", "0.5220264", "0.5207294", "0.5195...
0.7154249
1
Create the convolution output axes.
def _output_axes(self, in_obj, pad_int): output_axes = ng.make_axes() for ax in in_obj.axes: name = ax.name if name in self.conv_axis_names: output_axes += ng.make_axis(name=ax.name, length=utils.conv_output_dim( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_conv_output_axes(input, filter, conv_params):\n # type: (TensorOp, TensorOp, Dict) -> Axes\n number_output_features = filter.axes[-1].length\n mini_batch_size = input.axes[-1].length\n\n input_d, input_h, input_w = input.axes.lengths[1:4] # axes order C, D, H, W, N\n filter_d, filter_h, fi...
[ "0.7661946", "0.7352949", "0.7192119", "0.6087903", "0.60874796", "0.60789174", "0.60517323", "0.5962896", "0.5934195", "0.58397484", "0.582829", "0.5807316", "0.5701961", "0.5685399", "0.56428283", "0.56378", "0.5607991", "0.5599755", "0.5593294", "0.5579488", "0.55709165", ...
0.7492919
1
Get integer padding values for each spatial axis. If padding is asymmetric, return the required manual paddings.
def _get_pad_int(self, spatial_axes): # Manual padding might be required for asymmetric paddings manual_pad = {} padding_int = {} for name, ax in zip(self.spatial_keys, spatial_axes): pad = utils.ConvParameters(ax.length, self.filter_spa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_pad_int(self, axes):\n # Manual padding might be required for asymmetric paddings\n manual_pad = {}\n padding_int = {}\n for name, ax in zip(self.pool_axis_names, axes):\n pad = utils.ConvParameters(ax.length,\n self.pool_shape[n...
[ "0.74670684", "0.7420271", "0.69187814", "0.68692887", "0.6839506", "0.68172926", "0.6625459", "0.661594", "0.65719265", "0.6523223", "0.6506822", "0.6498268", "0.6497893", "0.63914186", "0.63773", "0.6366422", "0.62827", "0.62254727", "0.61800945", "0.61369365", "0.61293054"...
0.7919041
0
Create the filter axes. They are ordered as (K, D, H, W, C).
def _filter_axes(self, channel_axis, spatial_axes): f_axes = ng.make_axis(length=self.nout, name="K") for key, ax in zip("DHW", spatial_axes): f_axes += ng.make_axis(length=self.filter_shape[key], name=ax.name) f_axes += channel_axis return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _filter_axes(self, channel_axes, spatial_axes):\n f_axes = ng.make_axes()\n f_axes += ng.make_axis(length=self.nout, name=\"K\")\n f_axes += channel_axes\n for key, ax in zip(self.spatial_keys, spatial_axes):\n f_axes += ng.make_axis(length=self.filter_spatial_shape[key],...
[ "0.7061723", "0.6328764", "0.6086109", "0.60675657", "0.5965842", "0.5962679", "0.55877304", "0.5564867", "0.5475261", "0.5450346", "0.5436063", "0.5395516", "0.5379075", "0.53688693", "0.53572947", "0.5324945", "0.5273135", "0.5239883", "0.5197603", "0.5147273", "0.5143321",...
0.73524797
0
Create the deconvolution output axes.
def _output_axes(self, in_obj, pad_int): output_axes = ng.make_axes() for ax in in_obj.axes: name = ax.name if name in self.conv_axis_names: output_axes += ng.make_axis(name=ax.name, length=utils.deconv_output_dim(ax.len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __call__(self, in_obj, channel_axes=\"C\", spatial_axes=(\"D\", \"H\", \"W\"), **kwargs):\n output = super(Deconvolution, self).__call__(in_obj, channel_axes, spatial_axes, **kwargs)\n return self._slice_output(output, spatial_axes, **kwargs)", "def make_conv_output_axes(input, filter, conv_par...
[ "0.6600882", "0.6512945", "0.6240972", "0.620487", "0.6190723", "0.6060082", "0.6006831", "0.5991179", "0.5951186", "0.5951137", "0.58947194", "0.5878189", "0.5848726", "0.5846914", "0.5805691", "0.5782366", "0.5744223", "0.5723216", "0.56546867", "0.563938", "0.56088835", ...
0.656358
1
Get integer padding values for each axis. If padding is asymmetric, return the required manual paddings.
def _get_pad_int(self, axes): # Manual padding might be required for asymmetric paddings manual_pad = {} padding_int = {} for name, ax in zip(self.pool_axis_names, axes): pad = utils.ConvParameters(ax.length, self.pool_shape[name], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_pad_int(self, spatial_axes):\n # Manual padding might be required for asymmetric paddings\n manual_pad = {}\n padding_int = {}\n for name, ax in zip(self.spatial_keys, spatial_axes):\n pad = utils.ConvParameters(ax.length,\n self...
[ "0.73760635", "0.70292467", "0.67624974", "0.67057866", "0.6551189", "0.6527535", "0.6488737", "0.6471581", "0.6398685", "0.6383349", "0.6362462", "0.6361514", "0.63430554", "0.63392824", "0.6220768", "0.61472887", "0.6120855", "0.6040636", "0.6040091", "0.6036621", "0.595441...
0.7482885
0
Create the pooling output axes.
def _output_axes(self, in_obj, pad_int): output_axes = ng.make_axes() for ax in in_obj.axes: name = ax.name if name in self.pool_axis_names: output_axes += ng.make_axis(name=name, length=utils.conv_output_dim(ax.length, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pool_op(self, in_obj, pool_axes):\n manual_pad = collections.OrderedDict([(ax.name, (0, 0)) for ax in in_obj.axes])\n pad_int, extra_pad = self._get_pad_int(pool_axes)\n manual_pad.update(extra_pad)\n if any((pad != (0, 0)) for pad in manual_pad.values()):\n in_obj = ng....
[ "0.6783506", "0.62494135", "0.60730106", "0.5980152", "0.59566844", "0.5922597", "0.58838063", "0.5869608", "0.57832056", "0.57643634", "0.56859326", "0.5636432", "0.5632888", "0.55650336", "0.55625474", "0.549513", "0.5488764", "0.5483506", "0.5480738", "0.54502887", "0.5445...
0.7195969
0
Slice output to desired shape given by deconv_out_shape
def _slice_output(self, output, spatial_axes, **kwargs): if self.deconv_out_shape is None: return output if isinstance(spatial_axes, dict): spatial_axes = tuple(spatial_axes.get(name, name) for name in ("D", "H", "W")) elif isinstance(sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def slice_output_shape(input_shape):\n shape_1 = input_shape[0]\n shape_2 = 80\n shape_3 = input_shape[2]\n return (shape_1, shape_2, shape_3)", "def _squeeze_output(out):\r\n out = out.squeeze()\r\n if out.ndim == 0:\r\n out = out[()]\r\n return out", "def output_reshape(ct):\n ...
[ "0.70831054", "0.6761576", "0.66313136", "0.6393305", "0.6357284", "0.629436", "0.62509036", "0.62246907", "0.621388", "0.6152387", "0.61450714", "0.61170775", "0.6114104", "0.6026817", "0.60165524", "0.60165524", "0.60165524", "0.59306437", "0.5909184", "0.5898397", "0.58895...
0.7285818
0
Compute a deconvolution over in_obj
def __call__(self, in_obj, channel_axes="C", spatial_axes=("D", "H", "W"), **kwargs): output = super(Deconvolution, self).__call__(in_obj, channel_axes, spatial_axes, **kwargs) return self._slice_output(output, spatial_axes, **kwargs)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _conv_op(self, in_obj, channel_axes, spatial_axes):\n\n manual_pad = collections.OrderedDict([(ax.name, (0, 0)) for ax in in_obj.axes])\n pad_int, extra_pad = self._get_pad_int(spatial_axes)\n manual_pad.update(extra_pad)\n if any((pad != (0, 0)) for pad in manual_pad.values()):\n ...
[ "0.6474561", "0.6416828", "0.6388879", "0.6168792", "0.6160192", "0.6092755", "0.5938092", "0.5935818", "0.59309554", "0.5918654", "0.590212", "0.5895692", "0.58778983", "0.58704996", "0.58675754", "0.57710433", "0.56697917", "0.5654541", "0.56469446", "0.56134385", "0.560946...
0.71887773
0
Given a list of cells, combine the individual state_info's of the cells into a single state_info for the collection of cells, i.e. do the equivalent of sum([c.state_info for c in cells], []), but using itertools instead because it's much faster
def _cells_state_info(cells): return list(itertools.chain(*[c.state_info for c in cells]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _combine_omnipage_cell_list(table, inds, row_flag):\n if row_flag:\n row_or_col_list = [table[i, :] for i in inds]\n else:\n row_or_col_list = [table[:, i] for i in inds]\n return [' '.join(_unique_sorted([str(k) for k in j])).strip()\n for j in zip(*row_or_col_list)]", "def...
[ "0.53551733", "0.5274854", "0.5060582", "0.49974838", "0.496517", "0.48731998", "0.4826265", "0.48187545", "0.4786807", "0.4734661", "0.47343242", "0.4716697", "0.46995485", "0.46986324", "0.46858564", "0.46833917", "0.46762833", "0.46357366", "0.46302217", "0.4623123", "0.46...
0.7432871
0
Given a list of cells, initialize the states of the individual cells together by doing the equivalent of sum([c.initialize_states(kwargs) for c in cells], []), but using itertools instead because it's much faster
def _cells_initialize_states(cells, batch_axis, **kwargs): return list(itertools.chain( *[c.initialize_states(batch_axis, **kwargs) for c in cells]))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize_cells(self):\n for loc in np.ndindex(*self.shape): # TODO: see if nested for loop is faster than this\n c = Cell(loc, self)\n self.cells.append(c)", "def create_iterables(self):\n iterables = [[0, 1], [0, 1], [0, 1],\n [0, 1], [0, 1], [0, 1],...
[ "0.6383152", "0.63666826", "0.6025529", "0.59512055", "0.5893001", "0.57383454", "0.5733948", "0.57162946", "0.5703301", "0.56930435", "0.56870705", "0.5666645", "0.56311667", "0.55474085", "0.55270493", "0.55179924", "0.54676026", "0.54474306", "0.54134625", "0.5404968", "0....
0.86237913
0
Unroll the cell for num_steps steps.
def unroll(cell, num_steps, inputs, init_states=None, reset_cells=True, return_sequence=True, reverse_mode=False): recurrent_axis = inputs.axes.recurrent_axis() recurrent_axis_idx = len(cell.feature_axes) batch_axis = inputs.axes.batch_axis() out_axes = cell.feature_axes + batch_axis if i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unroll_cell(self, decoder_inputs, initial_state, loop_function, cell):\n pass", "def fold_unroll(cell, fold, length, inputs, begin_state=None, layout='NTC'):\n cell.reset()\n\n inputs, _, F, batch_size = _format_sequence(length, inputs, layout, False)\n begin_state = _get_begin_state(cell, F, beg...
[ "0.6567133", "0.647948", "0.6255634", "0.62448305", "0.6042708", "0.5770145", "0.5750804", "0.56965303", "0.5601399", "0.53311074", "0.5281608", "0.5258098", "0.5168075", "0.5160226", "0.5158495", "0.5141035", "0.5117448", "0.5101255", "0.50683206", "0.5047122", "0.50363326",...
0.687197
0
Create a new mention finder to find a given list of mention types. entityTypes = list of mention types (e.g. group, outcome) to find
def __init__(self, entityTypes, tokenClassifier): Finder.__init__(self, entityTypes) self.tokenClassifier = tokenClassifier if self.tokenClassifier != None: self.finderType = 'mention.'+self.tokenClassifier.classifierType else: self.finderType = 'mention'
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def entities(self, params=None, **kwargs):\n entities = entity_map()\n\n # Sort entities into type => <set of aliases>.\n type_to_aliases = {}\n for alias in entities:\n entity = entities[alias]\n\n if isinstance(entity, Facility):\n type_name = 'Facilities'\n elif isinstance(enti...
[ "0.548936", "0.53434336", "0.5073382", "0.50559545", "0.5006649", "0.5000927", "0.49018753", "0.4899283", "0.48503044", "0.48402494", "0.4830563", "0.4823236", "0.48019728", "0.4800545", "0.47958317", "0.47294486", "0.46860445", "0.46614227", "0.4642066", "0.4610926", "0.4610...
0.6929863
0
compute classifier features for each token in each abstract in a given list of abstracts.
def computeFeatures(self, absList): raise NotImplementedError("Need to implement computeFeatures()")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tokenize_abstracts(abstracts):\n\n tokenized_abstracts_list = []\n for abstract in abstracts:\n tokens = nltk.word_tokenize(abstract)\n tokenized_abstracts_list.append(tokens)\n return tokenized_abstracts_list", "def computeFeatures(self, absList, mode=''):\n raise NotImplementedErro...
[ "0.624462", "0.62424415", "0.6225621", "0.5921949", "0.5816261", "0.5813086", "0.5795551", "0.57948124", "0.5740147", "0.57276946", "0.5717184", "0.57068926", "0.56946427", "0.56593144", "0.5658686", "0.5652911", "0.56022424", "0.56008846", "0.5594525", "0.55912507", "0.55830...
0.62984097
0
compute RPF stats for detected mentions in a list of abstracts. write results to output stream. write final RPF stats to statOut write TP/FP/FN to errorOut
def computeStats(self, absList, statOut=None, errorOut=None): stats = EntityStats(self.entityTypes) for abs in absList: errorOut.write('---'+abs.id+'---\n') # identify ALL annotated mentions, even in sentences we are not focused on # for sentence in abs.allSentences(): # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def computeStats(self, absList, statOut, errorOut):\n \n nMentions = 0\n pSum = 0\n rSum = 0\n for abstract in absList:\n # build hash of annotated clusters/chains keyed by ID\n errorOut.write('\\n---- '+abstract.id+' ----\\n')\n trueChainLengths = {}\n entityList = abstract....
[ "0.65849566", "0.5925648", "0.5819624", "0.57653034", "0.5762071", "0.5727758", "0.5691433", "0.56473553", "0.5570363", "0.55676913", "0.55645865", "0.55539656", "0.55180854", "0.5451508", "0.5381246", "0.5380846", "0.53807884", "0.53778684", "0.5371544", "0.5353347", "0.5350...
0.6283277
1
write a message to a given output stream
def write(self, out, message): if out != None: out.write(message)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write(self, msg, *_):\n if self.out is not None:\n self.out.write(msg)\n self.out.flush()", "def _write_stream(self, stream_id, content):\n # We have to be careful about how we encode the bytes. It's better to assume it is utf-8 and just\n # serialize it that way.\n encoded...
[ "0.7389709", "0.69831085", "0.68361956", "0.67861736", "0.677018", "0.66936415", "0.6660411", "0.6635271", "0.66243285", "0.6623509", "0.66060543", "0.6497261", "0.64774483", "0.64748174", "0.63748026", "0.6370138", "0.6370138", "0.63609517", "0.6360882", "0.6360357", "0.6352...
0.7655083
0
Compute lists of detected and annotated mentions and compare them. count number of true positives, false positives, and false negatives.
def compareAnnotatedAndDetected(self, sentence, mType, irStats, errorOut=None): aList = sentence.getAnnotatedMentions(mType, recomputeMentions=True) dList = sentence.getDetectedMentions(mType, recomputeMentions=True) if len(aList) == 0 and len(dList) == 0: return self.compareMentionLists(dLi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compareMentionLists(self, dList, aList, mType, irStats, errorOut=None):\n # build lists of overlapping mentions for annotated and detected mentions in this sentence\n potentialMatches = {}\n for aMention in aList:\n potentialMatches[aMention] = []\n for dMention in dList:\n potentialMatch...
[ "0.67164296", "0.64145726", "0.613983", "0.6108635", "0.60373306", "0.5994101", "0.5844405", "0.5815301", "0.58053136", "0.56646466", "0.5660439", "0.5660156", "0.5652913", "0.56374556", "0.5599953", "0.55947095", "0.5588759", "0.5588722", "0.5547049", "0.55327773", "0.552873...
0.7307794
0
compare list of annotated mentions with list of detected mentions. count number of true positives, false positives, and false negatives.
def compareMentionLists(self, dList, aList, mType, irStats, errorOut=None): # build lists of overlapping mentions for annotated and detected mentions in this sentence potentialMatches = {} for aMention in aList: potentialMatches[aMention] = [] for dMention in dList: potentialMatches[dMention...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compareAnnotatedAndDetected(self, sentence, mType, irStats, errorOut=None):\n aList = sentence.getAnnotatedMentions(mType, recomputeMentions=True)\n dList = sentence.getDetectedMentions(mType, recomputeMentions=True) \n if len(aList) == 0 and len(dList) == 0:\n return\n self.compareMentio...
[ "0.7023873", "0.6436592", "0.63096875", "0.59876", "0.58981645", "0.5846465", "0.5844285", "0.58240235", "0.58189034", "0.5724267", "0.55928034", "0.5576252", "0.5550993", "0.5538654", "0.5529423", "0.5477881", "0.546384", "0.5460951", "0.54609233", "0.5443485", "0.5435216", ...
0.6937542
1
Returns a plotted table on an axs. Based on statistics for central tendancy, can take one column or more. Requires an matplot lib `axs` as input to be used.
def table_central_tend(data, axs, f=2): # Central tendacy v_mean = round(data.mean(), f) v_median = round(data.median(), f) # Use built in tex only, no depandancy needed sample_mean_str = "mean, " + r' $\bar x$ ' sample_median_str = "median" # Concatenate the statistics and symbols sy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_table(self, axn: str = \"table\", df: Optional[DataFrame] = None) -> None:\n if self.axes is None:\n axs = self.initialize_figure(mosaic=[[axn]], figsize=(6, 4), return_ax=True)\n else:\n axs = self.axes\n\n if df is None:\n df = DataFrame([\"empty\"])...
[ "0.64666414", "0.629224", "0.6126542", "0.60390544", "0.58691555", "0.5715039", "0.5713977", "0.56380343", "0.56379694", "0.56378335", "0.5608983", "0.5569364", "0.55638283", "0.55580723", "0.55462444", "0.55326843", "0.5463168", "0.54459053", "0.5418356", "0.5393956", "0.539...
0.6815292
0
Returns a plotted table on an axs. Based on statistics for disperssion, can take one column or more. Requires an matplot lib `axs` as input to be used.
def table_disperssion(data, axs, f=2): # Measures of disperssion v_bessel_sd = round(data.std(), f) v_var = round(data.var(), f) v_range = round((data.max()-data.min()), f) v_iqr = round((data.quantile(0.75)-data.quantile(0.25)), f) v_mad = round(data.mad(), f) # Use built in tex only, no ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_table(self, axn: str = \"table\", df: Optional[DataFrame] = None) -> None:\n if self.axes is None:\n axs = self.initialize_figure(mosaic=[[axn]], figsize=(6, 4), return_ax=True)\n else:\n axs = self.axes\n\n if df is None:\n df = DataFrame([\"empty\"])...
[ "0.64039075", "0.617259", "0.6116411", "0.59898764", "0.5832481", "0.5824055", "0.5775828", "0.57557863", "0.56359196", "0.56138456", "0.55944836", "0.5584237", "0.5572196", "0.55337507", "0.5525587", "0.5466326", "0.5462922", "0.5445544", "0.5437162", "0.54298645", "0.542424...
0.62601465
1
Returns a plotted table on an axs. Based on statistics for distribution, can take one column or more. Requires an matplot lib `axs` as input to be used.
def table_distribution(data, axs, f=2): # Measures of distribution v_max = round(data.max(), f) v_95 = round((data.quantile(0.95)), f) v_90 = round((data.quantile(0.9)), f) v_75 = round((data.quantile(0.75)), f) v_50 = round((data.quantile(0.5)), f) v_25 = round((data.quantile(0.25)), f) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table(ax: Axes, data: DataFrame | Series, **kwargs) -> Table:\n plot_backend = _get_plot_backend(\"matplotlib\")\n return plot_backend.table(\n ax=ax, data=data, rowLabels=None, colLabels=None, **kwargs\n )", "def plot_table(self, axn: str = \"table\", df: Optional[DataFrame] = None) -> None:...
[ "0.6402386", "0.6203925", "0.6012154", "0.57367206", "0.56446254", "0.56413215", "0.56215644", "0.56149924", "0.55738074", "0.555902", "0.5548091", "0.5471502", "0.5443948", "0.540761", "0.53955144", "0.53447646", "0.53437424", "0.53368604", "0.53203785", "0.5313929", "0.5298...
0.6416024
0
Returns a plotted table on an axs. Simpy creates a small table with the count of samples and column headers. Intended to act as the top of a set of tables. Requires an matplot lib `axs` as input to be used.
def table_top(data, name, axs): # Count v_count = [] for i in name: v_col_size = data[i].size v_count.append(v_col_size) # Use built in tex only, no depandancy needed sample_count_str = "samples, " + r' $n$ ' symbols = pd.DataFrame([sample_count_str]) val = pd.DataFrame([v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table(ax: Axes, data: DataFrame | Series, **kwargs) -> Table:\n plot_backend = _get_plot_backend(\"matplotlib\")\n return plot_backend.table(\n ax=ax, data=data, rowLabels=None, colLabels=None, **kwargs\n )", "def plot_table(self, axn: str = \"table\", df: Optional[DataFrame] = None) -> None:...
[ "0.6636303", "0.62570447", "0.59922016", "0.58673024", "0.5672084", "0.5577076", "0.55361027", "0.5517768", "0.55032074", "0.54658043", "0.54374826", "0.5432732", "0.5390313", "0.53773123", "0.5351929", "0.53117126", "0.52992725", "0.52894443", "0.526929", "0.52465236", "0.51...
0.6466206
1
Sets style settings on a table. Requires an matplot lib `axs` as input to be used. Enforces style settings onto that axs.
def table_settings(axs_num, table_name): table_props = table_name.properties() table_cells = table_props['child_artists'] # matplotlib setting # iterate through cells of a table to change properties for cell in table_cells: cell._text.set_fontsize(15) cell._text.set_color('#192...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_styles(plt, matplotlib):\n\n try:\n plt.style.use('default') \n for param, value in plt_params_dict.items():\n matplotlib.rcParams[param] = value\n params = {'mathtext.default': 'regular' } \n plt.rcParams.update(params)\n except:\n ...
[ "0.6217304", "0.59189606", "0.58773714", "0.5363297", "0.529926", "0.527115", "0.5224783", "0.52156645", "0.51874053", "0.51756155", "0.5173207", "0.51480645", "0.5089802", "0.507126", "0.50237226", "0.49920684", "0.49623072", "0.49523818", "0.49471563", "0.49456948", "0.4942...
0.735611
0
Creates a plotted table of descriptive statistics.
def descriptive_table(data, column_name, fig_size=(8, 8)): # Set up figure dimensions and sub components. sheet, axs = plt.subplots(4, 1, figsize=fig_size) # Heights ratio is based on the number of rows in each # table, this relates to the number of statistics each # sub table will show. gs = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def table_summary():\n \n t = dict()\n t['name'] = get_names()\n t['Name'] = [get_properties(name)['label'] for name in t['name']]\n N = len(t['name'])\n \n # host\n t['host'] = ['Sagittarius', 'Sagittarius', 'none', 'Gaia-Sausage-Enceladus', 'Sagittarius', 'Sequoia / Arjuna / I\\'itoi', 'S...
[ "0.64671993", "0.63206184", "0.62217784", "0.6156925", "0.6149821", "0.6114673", "0.61127305", "0.6099334", "0.6062513", "0.60417926", "0.60378116", "0.5995212", "0.59413856", "0.5903425", "0.5895154", "0.58884484", "0.58857155", "0.5882201", "0.5853967", "0.58519465", "0.584...
0.7500924
0
create documentation as simple HTML, using the supplied path, which is interpreted as the project root. The documentation will be surroundeded with very basic HTML boilerplate, i.e. you probably do not want to use this method, which is a wrapper around get_documentation_body, and supply your own HTML boilerplate before...
def get_documentation(path=""): return """<HTML><head><title>Python Minidoc for """+path+"""</title></head> <body> """+get_documentation_body(path)+""" </body></html>"""
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_documentation(self, css_path=None, base_url=None):\n if base_url is None:\n first_key = next(iter(self.conf_doc))\n conf = self.conf_doc[first_key]\n else:\n conf = self.conf_doc[\"/\" + base_url]\n\n return (\n 200,\n \"\"\"<!DOCT...
[ "0.67940426", "0.66304994", "0.6588725", "0.6524229", "0.64368373", "0.6319469", "0.6250843", "0.62383306", "0.6214085", "0.62133044", "0.6146423", "0.6126285", "0.6115011", "0.60907006", "0.6083795", "0.6074013", "0.60439724", "0.6003797", "0.59726506", "0.59555364", "0.5947...
0.77786535
0
Heteronity measure function. It should be noted that I substitute sum(vector) from sum_squared. Some mistakes can arise due to this purpose
def heterogen(vector): vector = [el for el in vector if el > 0] sum_squared = (sum(vector)) ** 2 squares = map(lambda x: x * (x - 1), vector) delta = sum_squared - sum(vector) if delta > 0: prob = (delta - sum(squares)) / float(delta) else: prob = 0 return prob
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vf_squared_hellinger(x, y, critic):\n p = 1.0 - torch.exp(-critic(x))\n q = 1.0 - torch.exp(-critic(y))\n return torch.mean(p - (q/(1-q)))", "def _calc_Hc(self, signal):\n\n return 2.8 * np.nanstd(signal)", "def inhale_efficiency(self) -> _VectorisedFloat:\n return self.η_inhale", ...
[ "0.61793756", "0.6156195", "0.6097398", "0.6042531", "0.5997857", "0.59823656", "0.59759235", "0.5953194", "0.5927179", "0.5912538", "0.5900989", "0.5869575", "0.5856831", "0.585217", "0.58473444", "0.580972", "0.57908636", "0.5788946", "0.5761239", "0.5745539", "0.5744894", ...
0.6275125
0
Generates all tests cases for a GEMM microkernel.
def generate_test_cases(ukernel, mr, k_block, isa): _, test_name = ukernel.split("_", 1) _, datatype, ukernel_type, _ = ukernel.split("_", 3) test_args = [ukernel] return xngen.preprocess(PACK_TEST_CODE, { "TEST_NAME": test_name.upper().replace("UKERNEL_", ""), "UKERNEL_TYPE": ukernel_type.upper(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_KGE_methods(model_name):\n testing_function(model_name)", "def test_generate_all_testing(self):\n pass", "def testgen(self):\n self.parse()\n self.generate()", "def tests():", "def test():\n\t\treturn [\"vice.multizone\",\n\t\t\t[\n\t\t\t\ttest_from_output(),\n\t\t\t\tmig_m...
[ "0.6356984", "0.6329179", "0.6058904", "0.5985874", "0.59467685", "0.5932151", "0.59172386", "0.5886024", "0.5883808", "0.58833915", "0.5840056", "0.5799488", "0.57936954", "0.57375807", "0.5693975", "0.56644064", "0.5638442", "0.5610446", "0.55895394", "0.5586659", "0.557715...
0.66081387
0
Sync file source to dest
def sync_file(source, dest, dryrun=False, diff=False): if diff: if not exists(dest): logger.info(("Destination '{}' does not exist:".format(dest), " skipping diff")) return with open(source) as a: with open(dest) as b: s1 =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _copy_file ( self, source, dest ):\n return", "def copy(self, src_path: str, tgt_path: str) -> None:", "def copy(self, source_host, dest_host, filename):", "def copy_file(source_file, target_file):\n\t# print('\\n\\nCopying [{}] to [{}].\\n\\n'.format(source_file, target_file))\n\trun_rsync([source_...
[ "0.6974644", "0.68930113", "0.6891386", "0.6765977", "0.67231584", "0.6550781", "0.6504014", "0.6470677", "0.63714147", "0.63575894", "0.62633055", "0.62472004", "0.62472004", "0.62472004", "0.6213031", "0.6193602", "0.61707354", "0.61391485", "0.61217904", "0.61214125", "0.6...
0.69120526
1
Function which automatically sets an exposire time such that the average intensity in the camera images is 'targetIntensity'
def find_exposure_time(cam,targetIntensity=100,margin=5): from numpy import mean if targetIntensity < 0 or targetIntensity > 255: print("Invalid target intensity") return 1 minExposure = 0.01 # Smallest value in ms maxExposure = 80 counter = 0 # Calculate exposures at the diff...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tune_exposure_time(camera, target, initial_exptime, min_exptime=0, max_exptime=None,\n max_steps=5, tolerance=0.1, cutout_size=256, bias=None, **kwargs):\n camera.logger.info(f\"Tuning exposure time for {camera}.\")\n\n images_dir = camera.get_config(\"directories.images\", None)\n ...
[ "0.71642697", "0.6080449", "0.60105157", "0.5899675", "0.5737851", "0.57146853", "0.5641477", "0.5489508", "0.54747295", "0.5439164", "0.5424886", "0.5414795", "0.5378947", "0.5367175", "0.5364558", "0.53452235", "0.53417873", "0.5340514", "0.53373754", "0.52857375", "0.52779...
0.703297
1
A function that creates the user paddle
def create_paddle(self, pos): self.shape("square") self.penup() self.color("blue") self.shapesize(stretch_wid=1, stretch_len=4) self.setpos(pos)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getPaddle(self):\n return Paddle()", "def new_game():\r\n \r\n global paddle1_pos, paddle2_pos, paddle1_vel, paddle2_vel # these are numbers\r\n global score1, score2 # these are ints\r\n \r\n # initialise the positons, velocity of paddles, and scores of players.\r\n paddle1_pos = H...
[ "0.6745972", "0.64317685", "0.6356615", "0.6160553", "0.6098694", "0.6085133", "0.60210156", "0.5916166", "0.5859541", "0.58264154", "0.58034784", "0.578718", "0.57084256", "0.57044506", "0.56902385", "0.5576419", "0.55714655", "0.5560821", "0.5558044", "0.5557991", "0.555049...
0.70745236
0
Extract the CSS declaration around the given position.
def _extract_css_declaration(self, ac, styleClassifier, trg, is_for_calltip=False): DEBUG = DebugStatus #DEBUG = True #PERF: Use accessor.gen_chars_and_styles() if possible. try: ac.resetToPosition(trg.pos) p, ch, style = ac.getPre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_position(self, position):", "def elements_position(self, selector):\n attr, pattern, val = self.parser_selector(selector, attr='identifier')\n\n strip = lambda v: v.strip()\n\n if pattern:\n val = locals()[pattern](val)\n\n\n def identifier(query):\n retu...
[ "0.5486392", "0.5393296", "0.5300908", "0.5157982", "0.5035882", "0.49647793", "0.49503165", "0.4924343", "0.49232784", "0.4919716", "0.49102503", "0.4879096", "0.48680133", "0.48434153", "0.47953552", "0.4792464", "0.47892663", "0.47704002", "0.4770048", "0.4767887", "0.4747...
0.6803759
0
Register language support with the Manager.
def register(mgr): mgr.set_lang_info(lang, silvercity_lexer=CSSLexer(), buf_class=CSSBuffer, langintel_class=CSSLangIntel, is_cpln_lang=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_game_language_subscriber(event):\n request = event.request\n # TODO: look up game language from a cookie or something\n en = db.get_by_identifier_query(db.t.Language, u'en').first()\n request.tmpl_context.game_language = en", "def setLanguage(self, translator: ghidra.program.util.LanguageTran...
[ "0.63181674", "0.6169716", "0.59083724", "0.5867996", "0.58526134", "0.57024425", "0.57021755", "0.5701746", "0.56978625", "0.5690859", "0.5625662", "0.5609462", "0.55977046", "0.5581769", "0.5573173", "0.5572357", "0.5570256", "0.5531588", "0.5516688", "0.5481292", "0.547609...
0.71172
0
Call after notifier timeout or processed event to check if the program should terminate.
def check_main_stop(notifier): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_terminate(self):\n pass", "def test_terminate_run(self):\n pass", "def handle_termination(self):\n pass", "def check_termination(self) -> bool:\n return self.terminate", "def __exit__(self, exc_type, exc_value, traceback):\n if self.returncode is None and self.proc...
[ "0.6717264", "0.66706556", "0.6639872", "0.6634525", "0.6587442", "0.65862644", "0.6508719", "0.64766693", "0.64387584", "0.64387584", "0.64321905", "0.64121026", "0.6358221", "0.6338427", "0.6337538", "0.63262683", "0.6324838", "0.6317632", "0.6312474", "0.6300536", "0.62808...
0.72217506
0
Always returns the widget, creating one if no current instance exists
def widget(self): if self.widget_instance is None: self.widget_instance = self.widget_class(settings=self.settings) return self.widget_instance
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_widget(self):\n\t\treturn None", "def get_widget(self):\r\n return None", "def getWidget(self):\n if self.__widget is None:\n self.__widget = self.createWidget(self.__parent)\n hooks = self.getHooks()\n if hooks is not None:\n hooks.viewWidg...
[ "0.7231976", "0.7222826", "0.71262175", "0.6965019", "0.68230003", "0.6606461", "0.659004", "0.6489969", "0.64566183", "0.641995", "0.6392658", "0.6347045", "0.6330786", "0.6318223", "0.63119763", "0.61843294", "0.6175768", "0.6164428", "0.61581355", "0.6142356", "0.6125436",...
0.780208
0
Store the widget settings in this flow and remove it from the passed settings layout.
def deselect_widget(self, settings): if self.widget_instance: self.settings = self.widget_instance.get_settings() self.widget_instance = None current_setting_item = settings.takeAt(0) if current_setting_item: current_setting_item.widget().deleteLater() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_layout(self, layout: Layout):\n self.layouts.pop(layout, None)", "def _clear_gui_settings(self):\n self._settings.clear()\n self._settings.sync()\n self.gui_settings_clear_button.setEnabled(False)\n self.cleared = True", "def remove_layout(self, layout):\n\n ...
[ "0.6029419", "0.5720786", "0.5576734", "0.545593", "0.5422754", "0.5388249", "0.5365285", "0.53313774", "0.5319288", "0.5231639", "0.5218475", "0.52031684", "0.5201091", "0.51799446", "0.517654", "0.51620686", "0.51608", "0.51577705", "0.51485753", "0.5138839", "0.5133913", ...
0.6526072
0
Checks if a given migration script name has already been executed against this database.
def check_migration(self, migration: str) -> bool: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_exists(self):\n\n return os.path.isfile(os.path.join(self.scripts_dir, self.python_name))", "def is_migrated_before():\n\n global migration_sign\n if os.path.exists(migration_sign):\n return True\n else:\n return False", "def _is_non_real_command_found(self, script_data):\n...
[ "0.614944", "0.6089585", "0.60354674", "0.60084146", "0.59065694", "0.5823774", "0.5776442", "0.5734036", "0.5726742", "0.57071155", "0.57049215", "0.56707036", "0.56460166", "0.5644467", "0.56159735", "0.5583992", "0.5568545", "0.5549832", "0.55248946", "0.5498679", "0.54621...
0.62848705
0
Insert the given migration into the _MigrationsRun table.
def update_migrations_run(self, migration: str): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_migrations(self, migrations):\n with self.internal_db.begin() as conn:\n for migration in migrations:\n conn.execute(\n \"INSERT INTO migration (name) \" \"VALUES ('%s');\" % migration\n )", "def run_migration(self, migration: str):\...
[ "0.6739179", "0.6299863", "0.62400484", "0.5966218", "0.5836835", "0.5790835", "0.5692351", "0.5618229", "0.5618169", "0.5581772", "0.55558246", "0.5523925", "0.5503373", "0.5392908", "0.53832996", "0.5312781", "0.53054965", "0.5258299", "0.52449775", "0.5219013", "0.5194695"...
0.6500243
1
Assert that ret is as expected
def verify_ret(self, ret, expected_ret): assert ret == expected_ret, ( "Function should return: " + ret_vals_dictionary[expected_ret] + ".\nInstead returned: " + ret_vals_dictionary[ret] )
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assertion_passed(self, func):", "def test_unit(self):\n self.assertTrue(return_true())", "def test_should_be_ok(self):\n self.assertTrue(True)", "def assertReturns(rtype):\n def check_returns(func):\n @wraps(func)\n def wrapped_func(*args, **kwds):\n retv...
[ "0.71568924", "0.70153856", "0.6888419", "0.68762743", "0.6791112", "0.6758023", "0.67320305", "0.6685891", "0.6594677", "0.65407693", "0.6522941", "0.64063513", "0.640348", "0.6390991", "0.6390034", "0.63731635", "0.63705343", "0.6368727", "0.63404477", "0.63290125", "0.6324...
0.8016156
0
Tests digest data mechs
def test_digest_data(self, mech, data): ret, digested_data = c_digest(self.h_session, data, mech) self.verify_ret(ret, CKR_OK) assert len(digested_data) > 0, "The digested data should have a length" assert data != digested_data, "Digested data should not be the same as the original strin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def digest(self):\n pass", "def digest(self):\n pass", "def digest(self):\n pass", "def test_str_with_data(self):\n data = b'\\x00\\x01\\x02\\x03'\n digest_value = DigestValue(data)\n self._test_str(digest_value, str(data))", "def test_010(self):\n calculator = ...
[ "0.67761403", "0.67761403", "0.67761403", "0.6729145", "0.64079225", "0.63451827", "0.63451827", "0.63451827", "0.63451827", "0.63451827", "0.63451827", "0.6271026", "0.62410635", "0.6239406", "0.6196442", "0.61466837", "0.6110236", "0.6104734", "0.6050555", "0.60361606", "0....
0.8185931
0
Checks if the acceptance ratio or maximum iterations is reached
def single_iteration_condition(args): return np.logical_and( np.greater(args[-3], acceptance_ratio), np.less(args[-2], max_iteration))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_convergence(self, time_step):\n \n ##compare the average episode length between two loop\n if self.past_episode == time_step:\n self.convergence = True\n else:\n self.convergence = False", "def test_convergence(self, time_step):\n \n ##comp...
[ "0.6803158", "0.6803158", "0.6721316", "0.6673236", "0.649509", "0.64930516", "0.6422876", "0.63096845", "0.6304908", "0.6214944", "0.61827135", "0.61529905", "0.613734", "0.6118663", "0.6102597", "0.60772574", "0.60533637", "0.6036281", "0.60237837", "0.6006274", "0.59957045...
0.716327
0
Fills containers and calculates distances All parameters and summaries of simulations made at those parameters (and their distance from the summary of the observed data) are kept in containers for ease of use. This function sets the ``all`` attribute of these containers with the passed summaries and parameters (and dis...
def set_samples(self, parameters, summaries, distances=None, replace=False): if distances is None: distances = jax.vmap( lambda target, F: self.distance_measure( summaries, target, F))(self.target_summaries, self.F) if (self.parameters....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fillstation(self, stanames, all=None, plot=None, summary=None, From=None, To=None, by=None,\n how='mean', variables=None, distance=None, sort_cor=True, constant=True, cor_lim=None):\n\n if all == True:\n stations = self.network.getsta([], all=True).values()\n else:\n...
[ "0.56989044", "0.50126624", "0.49523053", "0.4929002", "0.4917026", "0.4851263", "0.48271608", "0.4822689", "0.4796284", "0.47489873", "0.47026354", "0.46610367", "0.4643256", "0.46427402", "0.4603709", "0.45961693", "0.45687324", "0.45621866", "0.45471042", "0.4514141", "0.4...
0.6270599
0
Get token from the storage by token_name and username.
def get_token_by_username(self, token_name, username): args = (token_name, username) row = self.db_manager.execute_sql_and_fetchone( SQL_TOKEN_GET_BY_TOKEN_USERNAME, args ) if row: token_object = convert_db_row_to_dict(row, TOKEN_MODEL_FIELDS) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_token(id=None, name=None):\n\tif id is None and name is None:\n\t\tname = config['username']\n\treturn get_user(id=id, name=name, get_missing=False).token", "def token_by_owner(username):\n return Token.query.filter_by(owner=username).first()", "def _get_token(self):\n return user.get_tok...
[ "0.75296414", "0.7063065", "0.6634913", "0.6587599", "0.65856594", "0.65776986", "0.64540553", "0.64417773", "0.64417773", "0.63905823", "0.6359355", "0.63377416", "0.6332766", "0.6272585", "0.626637", "0.6266115", "0.6264914", "0.6258217", "0.6233344", "0.62162817", "0.62115...
0.7691706
0
parse and run the turtle program, producing an image. return the image (as a filename?)
def run_turtle_program(source): ast = parser.parse(source) t = turtle.Turtle() for stmt in ast.statement: do_statement(stmt, t) canvas = turtle.Screen().getcanvas() canvas.postscript(file='image.eps') img = Image.open('image.eps') img.save('image.png', 'png') turtle.Screen().bye...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def saveImage(turtle, filename):\n ts = turtle.getscreen()\n tc = ts.getcanvas()\n tc.postscript(file=filename)", "def main():\n tmp_dir = xm.constants['dir_tmp']\n exr_f = join(tmp_dir, 'test.exr')\n exr = EXR(exr_f)\n exr.extract_normal(join(tmp_dir, 'test.png'), vis=True)", "def main():\n ...
[ "0.66624415", "0.6060211", "0.60250473", "0.5991611", "0.5983499", "0.59735477", "0.5825115", "0.5824906", "0.5777183", "0.5756378", "0.57338184", "0.56626606", "0.566012", "0.5658301", "0.5580608", "0.5556367", "0.55391324", "0.5536966", "0.55120844", "0.54929626", "0.547938...
0.7995979
0
Tests the maximax fn
def test_maximax(): f = np.asarray([ [0.99, 1.0, 0.5], [0.69, 0.6, 0.6]]) R = common_metrics.maximax(f, maximise=True) expected = np.asarray( [1.0, 0.69]) assert np.allclose(R, expected) R = common_metrics.maximax(f, maximise=False) expected = np.asarray( [-0.5, -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximizer(evaluate):\n def strategy(player, board):\n def score_move(move):\n return evaluate(player, Othello.make_move(move, player, list(board)))\n return max(Othello.legal_moves(player, board), key=score_move)\n return strategy", "def test_find_largest(self):\n larges...
[ "0.7044211", "0.6821906", "0.6805151", "0.6742624", "0.67249966", "0.6700263", "0.6686053", "0.661849", "0.66156197", "0.66018206", "0.659575", "0.6558958", "0.6555396", "0.655198", "0.6548324", "0.6520838", "0.64753556", "0.64723724", "0.6428882", "0.6411126", "0.6392643", ...
0.79445547
0
Tests the Laplace fn
def test_laplace(): f = np.asarray([ [0.99, 1.0, 0.5], [0.69, 0.6, 0.6]]) R = common_metrics.laplace(f, maximise=True) expected = np.asarray( [0.83, 0.63]) assert np.allclose(R, expected) R = common_metrics.laplace(f, maximise=False) expected = np.asarray( [-0.83,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def a_test_laplace():\n model = ARIMAX(formula=\"y ~ x1\", data=data, ar=1, ma=1, family=Exponential())\n x = model.fit('Laplace')\n assert(len(model.latent_variables.z_list) == 4)\n lvs = np.array([i.value for i in model.latent_variables.z_list])\n assert(len(lvs[np.isnan(lvs)]) == 0)", "def a_te...
[ "0.72667736", "0.7121572", "0.6567624", "0.6396213", "0.6273471", "0.60401195", "0.58256054", "0.56461614", "0.5599439", "0.5565884", "0.55239224", "0.55215263", "0.5492814", "0.5412461", "0.5412252", "0.53845686", "0.53729516", "0.53642994", "0.53386897", "0.53046286", "0.52...
0.7378338
0
Tests the minimax_regret fn
def test_minimax_regret(): f = np.asarray([ [0.99, 1.0, 0.5], [0.69, 0.6, 0.6]]) R = common_metrics.minimax_regret(f, maximise=True) expected = np.asarray( [-0.1, -0.4]) assert np.allclose(R, expected) R = common_metrics.minimax_regret(f, maximise=False) expected = np.asa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_regress(self):\r\n x = [0, 12, 29.5, 43, 53, 62.5, 75.5, 85, 93]\r\n y = [8.98, 8.14, 6.67, 6.08, 5.90, 5.83, 4.68, 4.20, 3.72]\r\n self.assertFloatEqual(regress(x, y), (-0.05322, 8.7038), 0.001)\r\n # higher precision from OpenOffice\r\n self.assertFloatEqual(regress(x,...
[ "0.6133892", "0.59743285", "0.584011", "0.55133736", "0.5493546", "0.54772586", "0.5439533", "0.5432923", "0.54194605", "0.5386318", "0.53721267", "0.5313838", "0.5308108", "0.52519023", "0.52404577", "0.5208454", "0.5201797", "0.51906943", "0.5181717", "0.517464", "0.516129"...
0.770568
0
Tests the percentile_regret fn
def test_percentile_regret(): f = np.asarray([ [0.99, 1.0, 0.5], [0.69, 0.6, 0.6]]) R = common_metrics.percentile_regret(f, maximise=True, percentile=0.5) expected = np.asarray( [0.0, -0.3]) assert np.allclose(R, expected) R = common_metrics.percentile_regret(f, maximise=Fals...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_calculation_of_quantile(alpha: Any) -> None:\n n = 30\n check_alpha_and_n_samples(alpha, n)", "def test__quantile(self):\r\n # regular cases\r\n sample_data = array(range(25, 42))\r\n assert_almost_equal(_quantile(sample_data, 0.5), median(sample_data))\r\n\r\n # ...
[ "0.6634793", "0.6602073", "0.6511077", "0.6510798", "0.64590746", "0.6381094", "0.6362796", "0.633054", "0.6321114", "0.6284327", "0.626895", "0.62191373", "0.61997247", "0.61240596", "0.6115809", "0.61138546", "0.610881", "0.59470975", "0.5904325", "0.59035945", "0.58971494"...
0.8310882
0
Tests the mean_variance fn
def test_mean_variance(): f = np.asarray([ [0.99, 1.0, 0.5], [0.69, 0.6, 0.6]]) R = common_metrics.mean_variance(f, maximise=True) expected = np.asarray( [1.42320289996384, 1.54948632859709]) assert np.allclose(R, expected) R = common_metrics.mean_variance(f, maximise=False) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_variance(self):\n self.assertEqual(variance(list1, sample=False), np.var(list1))\n self.assertEqual(variance(list1), np.var(list1, ddof=1))", "def test_predict_mean_variance(self):\n lik = self._standard_likelihood()\n input_mean = Variable(TensorType([0.0]))\n input_v...
[ "0.80704737", "0.777593", "0.7494635", "0.7262066", "0.7157619", "0.6950645", "0.6944921", "0.6888636", "0.6888636", "0.6876363", "0.6846463", "0.68175846", "0.66643274", "0.6646647", "0.6567007", "0.6567007", "0.6567007", "0.6552458", "0.65489817", "0.6546654", "0.6544595", ...
0.7823844
1
Tests the undesirable_deviations fn
def test_undesirable_deviations(): f = np.asarray([ [0.99, 1.0, 0.5], [0.69, 0.6, 0.6]]) R = common_metrics.undesirable_deviations(f, maximise=True) expected = np.asarray( [-0.245, 0.0]) assert np.allclose(R, expected) R = common_metrics.undesirable_deviations(f, maximise=Fal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_stddev(self):\n self.assertEqual(stddev(list1, sample=False), np.std(list1))\n self.assertEqual(stddev(list1), np.std(list1, ddof=1))", "def allowedDeviation(self, lower, upper=None, msg=None):\n return allowed_deviation(lower, upper, msg)", "def test_mixed_incomplete_data_2():\n ...
[ "0.6607664", "0.65282196", "0.6420958", "0.6356108", "0.6301525", "0.61906475", "0.61337507", "0.6122744", "0.6097631", "0.5991103", "0.58946663", "0.5888784", "0.5869099", "0.58275855", "0.5796584", "0.5736681", "0.57045794", "0.5692008", "0.5681096", "0.56480706", "0.563014...
0.81727505
0
Tests the percentile skew fn
def test_percentile_skew(): f = np.asarray([ [0.99, 1.0, 0.5], [0.69, 0.6, 0.61]]) R = common_metrics.percentile_skew(f, maximise=True) expected = np.asarray( [0.96, -0.777777777777779]) assert np.allclose(R, expected) R = common_metrics.percentile_skew(f, maximise=False) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_percentile_kurtosis():\n f = np.asarray([\n [0.99, 1.0, 0.5, 0.52],\n [0.69, 0.6, 0.61, 1.0]])\n R = common_metrics.percentile_kurtosis(f, maximise=True)\n expected = np.asarray(\n [1.06382979, 5.0])\n assert np.allclose(R, expected)", "def test_lots_of_percentiles(self)...
[ "0.64033365", "0.63303274", "0.6269127", "0.62636626", "0.62064844", "0.60701036", "0.6063214", "0.6048836", "0.6026952", "0.59726375", "0.5954569", "0.5940382", "0.5877444", "0.5845502", "0.578347", "0.5763043", "0.5729505", "0.57232666", "0.5709021", "0.5695031", "0.5659054...
0.80108
0
Tests the percentile kurtosis fn
def test_percentile_kurtosis(): f = np.asarray([ [0.99, 1.0, 0.5, 0.52], [0.69, 0.6, 0.61, 1.0]]) R = common_metrics.percentile_kurtosis(f, maximise=True) expected = np.asarray( [1.06382979, 5.0]) assert np.allclose(R, expected)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_valid_calculation_of_quantile(alpha: Any) -> None:\n n = 30\n check_alpha_and_n_samples(alpha, n)", "def calc_kurtosis(sig):\n return kurtosis(sig)", "def kurtosis(self) -> float:\n return float(ss.kurtosis(self.tsdf.pct_change(), fisher=True, bias=True, nan_policy='omit'))", "def k...
[ "0.659924", "0.6551488", "0.64938307", "0.6469376", "0.6296186", "0.60896367", "0.6081468", "0.6069125", "0.602806", "0.60106987", "0.6009993", "0.59498876", "0.59466994", "0.5946249", "0.5943504", "0.5876415", "0.583249", "0.5811206", "0.5785323", "0.5775423", "0.5739732", ...
0.7832344
0
Function used to read the corpus for training (old version).
def deprecated_read_corpus(filename): train_list = read_xml(filename, 1) corpus = [] for pair in train_list: corpus += [strip_multiple_whitespaces(pair.t)] corpus += [strip_multiple_whitespaces(pair.h)] return corpus
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_corpus():\n # Define directory structure\n parent_path = os.getcwd() + '/'\n corpus_path = parent_path + 'corpus_data/'\n corpus_name = corpus_path + 'train_corpus_vocab.pickle'\n # Load corpus vocabulary\n with open(corpus_name, 'rb') as handle:\n train_vocab = pickle.load(handl...
[ "0.73244303", "0.7174164", "0.7146987", "0.6780772", "0.67489094", "0.6740784", "0.6627824", "0.65085244", "0.6502357", "0.6485583", "0.6474232", "0.6469331", "0.6435133", "0.6425884", "0.6361243", "0.6269834", "0.62694544", "0.61683667", "0.6163791", "0.6159709", "0.60779965...
0.73263
0
Increase or decrease the resolution of a distribution. Scales the resolution of the distribution by first interpolating the data values and then resampling it at the positions specified in the reference distribution. If the `scale` parameter is specified, the number of points in each dimension will be increased `scale`...
def scale_grid(self, reference_distribution=None, new_resolution=None): if reference_distribution is None: reference_distribution = self if new_resolution is None: new_resolution = reference_distribution.resolution scale = 1 else: scale = new_reso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scale(self, scale):\n\n self._scale = scale", "def scale(self, scale):\n\n self._scale = scale", "def with_scale_op(self, scale):\n\t\tself.variables['scale'] = scale\n\t\treturn self", "def scale(self, scale):\n self.coords = self.coords * scale\n return self", "def set_sca...
[ "0.65477973", "0.65477973", "0.62743556", "0.62523687", "0.61580896", "0.61553645", "0.61139524", "0.60290205", "0.5963627", "0.59028816", "0.58840287", "0.58265793", "0.57973707", "0.5793271", "0.578469", "0.577135", "0.57707953", "0.5713229", "0.57025945", "0.5695182", "0.5...
0.67478675
0
Determine which site to render given the hostname. Currently we have 2 renderings of sites, "pending" and "ncats". They differs in aesthetics, yet sharing the same backend. Hostname "biothings.ncats.io" and "biothings[|.ci|.test].transltr.io" use "ncats" rendering, while "pending.biothings.io" uses "pending".
def hostname_to_site(hostname: str) -> str: if hostname == "biothings.ncats.io" or hostname.endswith("transltr.io"): return "ncats" return "pending"
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def host_to_site(host):\n\n if host:\n # www.facebook.com m.facebook.com l.facebook.com lm.facebook.com\n if host.endswith('facebook.com'):\n return 'Facebook'\n # youtu.be www.youtube.com youtube.com m.youtube.com\n elif host.endswith('youtube.com') or host == 'youtu.be':...
[ "0.67882705", "0.57860607", "0.5658386", "0.5654703", "0.56485164", "0.5624197", "0.56084806", "0.55898887", "0.5582621", "0.5553793", "0.5553094", "0.550446", "0.5491108", "0.5476203", "0.5476005", "0.54712963", "0.546804", "0.546804", "0.5465417", "0.54653466", "0.54581463"...
0.7363288
0
Get the cosine similarity matrix from the embedding as a Pandas DataFrame.
def get_cosine_similarity_df(word2vec: Word2Vec) -> pd.DataFrame: sim = get_cosine_similarity(word2vec) return pd.DataFrame(sim, index=word2vec.wv.index2word, columns=word2vec.wv.index2word)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_similarity(df):\n count = CountVectorizer()\n count_matrix = count.fit_transform(df[\"bag_of_words\"])\n cosine_sim = cosine_similarity(count_matrix, count_matrix)\n return cosine_sim", "def _calculate_similarities(self) -> pd.DataFrame:\n\n df_encoded_articles = self._db_connection.ge...
[ "0.7234511", "0.6991583", "0.6946937", "0.68768257", "0.65643364", "0.6388998", "0.6264799", "0.61277986", "0.612138", "0.6115123", "0.6112033", "0.60728824", "0.60516924", "0.5977526", "0.5932496", "0.59059745", "0.5899762", "0.582879", "0.58085597", "0.5782091", "0.56256443...
0.76576155
0
Create a workflow queue
def add(ctx, wf_name, wf_version, wf_owner): jess_url = ctx.obj.get('JT_CONFIG').get('jess_server') if wf_owner is None: wf_owner = ctx.obj.get('JT_CONFIG').get('jt_account') url = "%s/queues/owner/%s/workflow/%s/ver/%s" % (jess_url, wf_owner, wf_name, wf_version) r = requests.post(url) if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _queue_create(self, **kwargs):\n name = self.generate_random_name()\n return self.clients(\"zaqar\").queue(name, **kwargs)", "def _create_queue(self):\n # Instantiate\n queue = pbs.queue(verbose=not self.quiet)\n\n if self.q == 'ember':\n # Submitting to Utah emb...
[ "0.6942579", "0.66524434", "0.6572549", "0.648934", "0.63773924", "0.63448215", "0.63364196", "0.62668824", "0.6258213", "0.6220978", "0.62111425", "0.6170667", "0.6101163", "0.60690314", "0.60477155", "0.60386324", "0.6012786", "0.6001777", "0.5967533", "0.5931258", "0.59293...
0.6898098
1
Open a workflow queue
def open(queue_id): r = update_queue_state(queue_id, 'open') if r.status_code != 200: click.echo('Open queue failed, please ensure input is correct.') else: click.echo(r.text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_workflow(self, **params):\n raise NotImplementedError", "def __init__(self, workflow):\n self.workflow = workflow", "def start_workflow(self, workflow_name, workflow_input, **params):\n raise NotImplementedError", "def on_channel_open(new_channel):\n global channel\n chan...
[ "0.5858807", "0.5655057", "0.5632103", "0.55643636", "0.5441331", "0.54325885", "0.5398457", "0.5371928", "0.5335743", "0.533102", "0.53260267", "0.5324544", "0.532239", "0.5315641", "0.53023946", "0.5290867", "0.52795565", "0.527409", "0.52734566", "0.52717185", "0.52413005"...
0.7445993
0
Close a workflow queue
def close(queue_id): r = update_queue_state(queue_id, 'close') if r.status_code != 200: click.echo('Close queue failed, please ensure input is correct.') else: click.echo(r.text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close(self):\n self.input_queue.put(None)\n self.input_queue.join()", "def exit_queue(self, name=None):\r\n if(name):\r\n self.log.debug(\"EXITING queue: (%s)\" % (name))\r\n self._queues[name].release()\r\n self.log.debug(\"SUCCESS EXITING queue: (%s)\" ...
[ "0.642828", "0.6139574", "0.6111436", "0.60830665", "0.5898193", "0.58823055", "0.5876393", "0.583515", "0.58262885", "0.57727635", "0.57590497", "0.57177114", "0.5715811", "0.5668772", "0.5659588", "0.56331134", "0.5620639", "0.5619311", "0.56096524", "0.5590741", "0.5587805...
0.7493398
0
Reads sea ice mask
def read_seaice_mask(file=r'C:\Users\apbarret\Documents\data\sea_ice_index\Arctic_region_mask_Meier_AnnGlaciol2007.msk'): cols = 304 rows = 448 img = np.fromfile(file, dtype='byte').reshape(rows, cols) return img
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_mask(self):\n mask_file = fetch_one_file(self.ica_dir, self._mask_fname, pat_type='re.match')\n return niimg.load_img(mask_file)", "def read_region_mask(grid='Nh50km'):\n\n mask_path = ('/oldhome/apbarret/data/seaice_indices/'\n 'Arctic_region_mask_Meier_AnnGlaciol2007_N...
[ "0.60069513", "0.59866613", "0.56588846", "0.5600343", "0.5474177", "0.5440845", "0.543682", "0.53643864", "0.5361416", "0.53063095", "0.5299723", "0.5291374", "0.5290301", "0.5229145", "0.52269757", "0.52161676", "0.5201707", "0.51518387", "0.51318836", "0.5130881", "0.51244...
0.7320507
0
For each observed character, append observed runlengths of that character to a list in a dictionary with key=char
def count_runlength_per_character(sequence): character_counts = defaultdict(list) current_character = None for character in sequence: if character != current_character: character_counts[character].append(1) else: character_counts[character][-1] += 1 current_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _create_dictionaries(self, chars):\n dictionary = dict()\n for char in chars:\n dictionary[char] = len(dictionary)\n reverse_dictionary = dict(zip(dictionary.values(), dictionary.keys()))\n return dictionary, reverse_dictionary", "def update_char_histogram(s,hist = dict()):\r\n ...
[ "0.6133791", "0.61164045", "0.58835137", "0.58087814", "0.58062124", "0.577302", "0.5753303", "0.574885", "0.5735104", "0.57193017", "0.5699817", "0.56469935", "0.56469935", "0.56187785", "0.56006825", "0.5579962", "0.55670226", "0.55447185", "0.5544331", "0.55127746", "0.550...
0.7153474
0
Format output as a row with index 050 (max_count) with normalized log probabilities of each length. Each comma separated row is preceded with a header describing which bases the prior corresponds to. Since observed reads are not directional, counts for complementary bases are summed together (A+T, G+C)
def print_all_counts_as_shasta_matrix(all_counts, max_count=50, pseudocount=1): a_t_counts = all_counts["A"] + all_counts["T"] g_c_counts = all_counts["G"] + all_counts["C"] total = 0 for i in range(max_count + 1): total += max(pseudocount, a_t_counts[i]) line = list() for i in range(m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format_split_libraries_fastq_log(count_barcode_not_in_map,\r\n count_too_short,\r\n count_too_many_N,\r\n count_bad_illumina_qual_digit,\r\n count_barcode_errors_excee...
[ "0.61965764", "0.55557483", "0.55227757", "0.5508419", "0.54903924", "0.54385847", "0.5424107", "0.5422831", "0.5291813", "0.5266468", "0.52504617", "0.5247569", "0.5234036", "0.520332", "0.5193628", "0.51752245", "0.5163459", "0.51611245", "0.51465124", "0.51452625", "0.5126...
0.5927525
1
To make sure we follow the rules for channel opening (see sepctrum doc) 0,1,2,4 or 8 per module, same number of channel per module if both are used If this is not respected, open unused channels to comply Also, order the label correctly to comply with Spectrum multiplexing (Alternate on each module in numerical order)
def check_chan(chan): chan = sorted(chan) assert all([c in range(16) for c in chan]),\ "All spectrum channels must be between and 15" num = len([c for c in chan if c < 8]) chan = chan[:num],chan[num:] nchan = max(len(chan[0]),len(chan[1])) while nchan not in [1,2,4,8]: nchan += 1 if len(chan[0])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manage_channels(_) -> int:\n return 1 << 4", "def manage_channels(_) -> int:\n return 1 << 4", "def test_switch_channels(self):\n\t\t# not available yet, experimental\n\t\tpass", "def num_channels(self):\n return 3", "def test_channels_first(self):\n\t\tdetails = self.watcher.describe(...
[ "0.6028733", "0.6028733", "0.6014569", "0.5881849", "0.57059354", "0.55728966", "0.55078214", "0.5452189", "0.5366916", "0.53582627", "0.5342205", "0.53277797", "0.52655023", "0.52529305", "0.52440494", "0.5243839", "0.52283365", "0.52131444", "0.51890916", "0.5166996", "0.51...
0.60648745
0
Helper method for sorting tweets in chronological order.
def sort_tweets(tweets): tweets.sort(key=lambda x: x.get_date()) return tweets
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tweet_sort(twitter_data, results, cmp):\r\n \r\n # Insertion sort\r\n for i in range(1, len(results)):\r\n current = results[i]\r\n position = i\r\n while position > 0 and cmp(twitter_data, results[position - 1], current) > 0:\r\n results[position] = results[position - ...
[ "0.74844646", "0.7461296", "0.6951029", "0.67573065", "0.63485456", "0.611729", "0.6102695", "0.60897636", "0.6069729", "0.6059522", "0.6047878", "0.6047267", "0.5914891", "0.5894959", "0.58686423", "0.5860879", "0.5839468", "0.58268726", "0.57980865", "0.5797689", "0.5782641...
0.8429142
0
Sets the preffered bin size for output. input "mode" can be any of "hours", "days", "weeks", 0, 1 or 2.
def set_output_mode(self, mode="minutes"): if (mode == "minutes") | (mode == "hours") | (mode == "days") | (mode == "weeks"): self.output_mode = mode else: try: self.output_mode = self.output_modes[mode] except Exception, e: DLOG("Outpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bw(self, mode):\n self.bandwidth = 0\n if (mode=='a'):\n self.bandwidth = 54\n elif(mode=='b'):\n self.bandwidth = 11\n elif(mode=='g'):\n self.bandwidth = 54 \n elif(mode=='n'):\n self.bandwidth = 600\n elif(mode=='ac'):...
[ "0.64814997", "0.5791871", "0.5663989", "0.5389112", "0.53047895", "0.52575004", "0.5253156", "0.5176985", "0.51385313", "0.5133968", "0.51074135", "0.50738156", "0.5017597", "0.49853322", "0.49836484", "0.49836484", "0.49836484", "0.49768755", "0.4972224", "0.4947991", "0.49...
0.5839458
1
Analyze a hashtag given as input. Amount of tweets are 200 be default, but can be given as argument also. Returns analyzed tweets in a list.
def analyze_hashtag(self, hashtag, count=200): tweets = [] for x in xrange(0, int(count / 100)): tweets.extend(self.tweet_fetcher.get_tweets(hashtag)) analyzed_tweets = sort_tweets(self.sa.classify(tweets)) self.analyzed_tweets = analyzed_tweets return analyzed_tw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_by_hashtag(tweets: list, hashtag: str) -> list:\n tweets_with_hashtag = {} # findall(): Kui tekstis on rohkem kui üks regulaaravaldisele vastav alamsõne saab kõikide vastete järjendi moodustada funktsiooniga findall()\n pattern = r\"#\\w+\" # \\w : tähed, numbrid, alakriips, + : 1 või rohkem\n ...
[ "0.6920718", "0.6833779", "0.675189", "0.66098684", "0.6514208", "0.6490846", "0.6407932", "0.62542325", "0.6223964", "0.6129735", "0.6091279", "0.60504276", "0.5977461", "0.5949544", "0.5946573", "0.59057504", "0.5902749", "0.5883308", "0.58803743", "0.586219", "0.5854543", ...
0.81691366
0
Set analyzed tweets sorted. E.g. from saved analyzed tweets.
def set_analyzed_tweets(self, tweets): slim_tweets = [SlimTweet(tweet) for tweet in tweets] self.analyzed_tweets = sort_tweets(slim_tweets)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sort(self):\n self.words = set(sorted(self.words))", "def sort_tweets(tweets):\n tweets.sort(key=lambda x: x.get_date())\n return tweets", "def set_trec_order(self):\n for k in self._run:\n self._run[k].sort(key=lambda x:(x.get_score(),x.get_doc()),reverse=True)\n ...
[ "0.6755012", "0.62385756", "0.601142", "0.60002726", "0.5931617", "0.5790273", "0.5523183", "0.55016154", "0.54319304", "0.5425356", "0.5424972", "0.54047394", "0.5361439", "0.5345621", "0.5344535", "0.5337149", "0.53292656", "0.5318276", "0.52926177", "0.52854353", "0.528004...
0.83614945
0
Outputs analyzed tweets in bins. Bin size (hours, days or weeks) determined by self.output_mode
def output_tweets(self): if self.analyzed_tweets is None: return None splitter = 0 if (self.output_mode == "days"): splitter = 86400 # 1 day in seconds pass elif (self.output_mode == "weeks"): splitter = 604800 # 1 week in seconds ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_histogram(spiketrains, bin_size, t_start=None, t_stop=None,\n output='counts', binary=False):\n # Bin the spike trains and sum across columns\n bs = BinnedSpikeTrain(spiketrains, t_start=t_start, t_stop=t_stop,\n bin_size=bin_size)\n\n if binary:\n ...
[ "0.59255564", "0.59204584", "0.57994825", "0.5772476", "0.5754282", "0.56141067", "0.5580331", "0.5579957", "0.55621636", "0.55621636", "0.55580896", "0.5532407", "0.55076605", "0.5490347", "0.53597844", "0.5341103", "0.53104323", "0.5293909", "0.52776015", "0.5274892", "0.52...
0.82005036
0
Given a json path (using jsonpath notation), to a json patch (RFC 6902) which can be used to remove the document fragment pointed by the input path Note that such conversion is not formally specified anywhere, so the conversion rules are experimentationbased
def from_path_to_jsonpatch(matchedpath): logging.info("starting. filter path: %s", matchedpath) # First step: path format change # typical input: $['ietf-yang-library:modules-state']['module'][57] # desired output: /ietf-yang-library:modules-state/module/57 matchedpath = matchedpath.replace("$.",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prefixed(self, path: List[str]) -> \"JsonPatch\":\n return JsonPatch([\n JsonPatchOperation(\n op=op.op,\n path=[*path, *op.path],\n value=op.value)\n for op in self\n ])", "def push_path(path, diffs):\n for key in reversed(p...
[ "0.57485837", "0.54352486", "0.5391403", "0.5389081", "0.538902", "0.53637743", "0.53559333", "0.53352666", "0.53110945", "0.52599907", "0.52183264", "0.5205005", "0.5175974", "0.5173113", "0.5170655", "0.5149336", "0.51125824", "0.51051855", "0.5088135", "0.50403416", "0.501...
0.71641725
0
Performs the prefiltering of a json file
def prefilter(json_arg, initial_prefilter): if not initial_prefilter: logging.info("prefilter not found!") # whether it is filtered or not, return as json so it can be handled uniformly from now on return json.loads(json_arg) with open(initial_prefilter) as f: lines = f.read()....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def filter_json_file(filename, filters_list):\n filename = filename.replace(\" \", \"\")\n print(\"Filters List {}\".format(filters_list))\n if isinstance(filters_list, list) is False:\n filters_list = [filters_list]\n with open(robot_dir + \"/output/original/{}_orig.json\".format(filename), \"r...
[ "0.7008582", "0.64491796", "0.63941675", "0.63912183", "0.6214865", "0.5879361", "0.5761348", "0.5693378", "0.5604411", "0.56026095", "0.5592775", "0.5553474", "0.55489975", "0.55380446", "0.5530673", "0.55257964", "0.5513254", "0.5474688", "0.5462171", "0.54521024", "0.54150...
0.77999103
0
Main function. Prefilters the input files using provided prefiltering patterns, then returns number of differences (and the differences themselves, when requested)
def prefilter_json_files_then_compare(args): logging.info("prefilter_json_files_then_compare: starting!") with open(args.initialFile) as f: json_initial = file.read(f) with open(args.finalFile) as f2: json_final = file.read(f2) patch = jsonpatch.JsonPatch.from_diff(json_initial, json_f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def main(\n file_pattern=INFILE_PATTERN,\n # folder_pattern=INFOLDER_PATTERN,\n tol_td=TOLERANCE_TIMEDELTA,\n outlier=OUTLIER_THRESHOLD,\n args=ARGS,\n):\n # Initialize IO-directories and setup logging\n path_in, path_out = initialize_io()\n\n # path_diffs = path_out / \"diff_imgs\"\n # ...
[ "0.618691", "0.61734617", "0.6023388", "0.5770834", "0.57630765", "0.5635864", "0.56322664", "0.5628903", "0.56088793", "0.5608539", "0.5580531", "0.55753785", "0.5561271", "0.55429035", "0.552018", "0.5514539", "0.5488725", "0.542185", "0.5407473", "0.5395535", "0.53643066",...
0.6542992
0
Return the sum of the first n numbers of sequence S
def linear_sum(S, n): if n == 0: return 0 else: return linear_sum(S, n - 1) + S[n - 1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def linear_sum(S, n):\n if n == 0:\n return 0\n else:\n return linear_sum(S, n-1) + S[n-1]", "def sum_of_nth( n ):\n if n > 0:\n return sum( range(n + 1) )\n else:\n return 0", "def sum_series(n, first=0, second=1):\n if n == 1:\n return first\n elif n == 2:...
[ "0.76841", "0.7444881", "0.72330695", "0.72233206", "0.71733654", "0.7087734", "0.7078644", "0.70632255", "0.7057611", "0.7053824", "0.70530355", "0.70193213", "0.6922918", "0.68946594", "0.6832259", "0.6748849", "0.67027134", "0.6694901", "0.6611888", "0.6601319", "0.6569598...
0.766399
1
Update class Update an class, identified by "class_name". It permits partial updates (maintaining constant the rest of the class info). The attributes to update are included in kwargs. To support a partial update, the first step is to get the class info because the service directory only provides full update.
def update(self, class_name, **kwargs): class_obj = self.get(class_name) class_obj.update(kwargs) response = self.client.post(Classes.PATH_CLASS_TEMPLATE.format(class_name=class_name), body=class_obj) return response
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_update(self, *args):\n if len(args) == 1:\n args = [ele for ele in args[0].split(' ')]\n if args[0] == '':\n print(\"** class name missing **\")\n return\n if args[0] not in self.list_classes:\n print(\"** class doesn't exist **\")\n ...
[ "0.66147435", "0.6480898", "0.6371645", "0.6344272", "0.6316442", "0.625787", "0.6200667", "0.61956793", "0.6190176", "0.61770034", "0.61499053", "0.60016674", "0.5948246", "0.59319293", "0.5903669", "0.57902175", "0.5737991", "0.5720873", "0.56708974", "0.56708974", "0.56708...
0.8564456
0
Delete an class Delete an class identified by "class_name"
def delete(self, class_name): return self.client.delete(Classes.PATH_CLASS_TEMPLATE.format(class_name=class_name))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_destroy(self, arg):\n if len(arg) == 0:\n print(\"** class name missing **\")\n return\n coms = tuple(arg.split())\n if coms[0] not in self.cls:\n print(\"** class doesn't exist **\")\n elif len(coms) < 2:\n print(\"** instance id missi...
[ "0.71252465", "0.69804424", "0.6953482", "0.6947389", "0.69018453", "0.68608165", "0.68567073", "0.6838112", "0.6836245", "0.68336", "0.6813786", "0.6794098", "0.6673387", "0.6561163", "0.654488", "0.6510977", "0.6471283", "0.63775885", "0.628025", "0.6266746", "0.6247461", ...
0.84382033
0
Returns the required resources for the given training method.
def required_resources_for_method(method, uses_pretrained_r_net): if method == 'ppo_plus_eco': # We need to rent 2 GPUs, because with this amount of RAM, GCP won't allow # us to rent only one. return (105472, 16, 2) if method == 'ppo_plus_ec' and not uses_pretrained_r_net: return (52224, 12, 1) re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resources(self):\n return list(self.get_inputs()) + list(self.get_outputs())", "def get_resources(self):\n return []", "def resources(self):\n return self.__resources", "def _GetResourceLoaders():\n loaders = []\n\n # Add all paths to list if they are specified on the command line (wil...
[ "0.59075975", "0.58460414", "0.5659363", "0.5576517", "0.55648386", "0.5517262", "0.5499891", "0.5462048", "0.5450394", "0.54441565", "0.5433045", "0.54239994", "0.54126656", "0.54065466", "0.54039216", "0.54039216", "0.54039216", "0.54039216", "0.5390593", "0.53260726", "0.5...
0.74345803
0
Creates and launches a VM on Google Cloud compute engine.
def launch_vm(vm_id, vm_metadata): print('\nCreating disk and vm with ID:', vm_id) vm_metadata['vm_id'] = vm_id ram_mbs, num_cpus, num_gpus = required_resources_for_method( vm_metadata['method'], bool(vm_metadata['pretrained_r_nets_path'])) create_disk_cmd = ( 'gcloud compute disks create ' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_gce_instance(args, ip_address):\n Print.GN('Creating GCE VM.')\n instance_name = GCE_INSTANCE_NAME.lower()\n firewall_tag = 'https-server' if args.https_only else LEO_FIREWALL_RULE\n cmd = ['gcloud', 'compute', 'instances', 'create',\n instance_name,\n '--image-family', '...
[ "0.72538877", "0.72196287", "0.6990168", "0.69501716", "0.68095875", "0.64573157", "0.64194506", "0.6372524", "0.6343484", "0.6325651", "0.6299524", "0.6254636", "0.62357014", "0.6076735", "0.60734236", "0.60668397", "0.6060681", "0.5957012", "0.5925895", "0.5918209", "0.5886...
0.75047314
0
remove elements from values that are not part of form if elements in `to_remove` contains a '!' it will ignore everything EXCEPT the !, can not mix ! and normal, if it detects a ! it will ignore all besides elements with !
def remove_from_values(values, to_remove): to_keep = [] for x in to_remove: if '!' in x: to_keep.append(x.replace("!", "")) if len(to_keep) == 0: for x in to_remove: del values[x] else: tmp_values = values.copy() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_values(self, name, remove):\n # Do we need to modify a mask's lib def.?\n if not self.is_array(name) and self._is_array_item(name):\n name = self._maskname_from_item(name)\n # Are any meta undefined codes provided? - Warn user!\n values = self._get_value_loc(name)\...
[ "0.6221369", "0.61069876", "0.6103691", "0.60917854", "0.5998779", "0.5948206", "0.59433925", "0.59233046", "0.59129953", "0.5878356", "0.5876084", "0.580941", "0.5638583", "0.5597303", "0.55797964", "0.55451703", "0.55345356", "0.54755443", "0.5473616", "0.5463152", "0.54576...
0.80732477
0
Function plot_obs(rxLoc,d) Generate a 2d interpolated plot from scatter points of data INPUT
def plot_obs_2D(rxLoc, d=None, varstr='TMI Obs', vmin=None, vmax=None, levels=None, fig=None, axs=None): from scipy.interpolate import griddata import pylab as plt # Plot result if fig is None: fig = plt.figure() if axs is None: axs = plt.subplot() plt.sca(axs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_plot(x,y):", "def scatter_stat(obs, model, label, xlabel, ylabel, rasterized=False):\n\n pl.scatter(obs, model, s=1, color=c2, rasterized=rasterized)\n lim_and_line2(obs, model)\n pl.xlabel(xlabel)\n pl.ylabel(ylabel)", "def save_plot_interpolate(input_samples, samples, idx, identifier, n...
[ "0.6011397", "0.5986594", "0.59757596", "0.59473705", "0.5904608", "0.58929086", "0.58712304", "0.58073235", "0.57341915", "0.57297295", "0.5701801", "0.5694246", "0.5684777", "0.56670064", "0.56571454", "0.56532675", "0.56177986", "0.5595032", "0.5587592", "0.5575011", "0.55...
0.81654465
0
Returns the cursor coordinates as a tuple (x, y).
def cursor_coordinates(self): text = self.getText() lines = text.split("\n") pos = self.getCursorPos() if pos == 0: return (0, 0) i = 0 cursor_row = -1 cursor_col = -1 for row, line in enumerate(lines): i += len(line) + 1 # we need...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coordinates(self) -> Tuple[int, int]:\n return self.x, self.y", "def getMousePosition(self):\n return (self.mouseData.x, self.mouseData.y)", "def cursorPosGL(self):\n globalPos = QtGui.QCursor.pos()\n pos = self.mapFromGlobal(globalPos)\n y = self.size().height() - pos.y(...
[ "0.7824512", "0.7726604", "0.76174706", "0.76174706", "0.75677025", "0.7565198", "0.75248986", "0.7379414", "0.7330282", "0.72748744", "0.72602683", "0.72091806", "0.7191261", "0.7189939", "0.7050582", "0.70483506", "0.70447123", "0.7040171", "0.70338386", "0.70088947", "0.70...
0.7819652
1
Focuses the "prev" cell. Moves the cursor to the proper position.
def focus_prev_cell(self, prev): x, y = self._cell_input.cursor_coordinates() y_new = prev._cell_input.rows() - 1 prev._cell_input.set_cursor_coordinates(x, y_new) prev.set_focus()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def focus_prev(self):\n self.focus_item(forward=False)", "def _prev(self, _):\n self.notebook.SetSelection(self.idx-1)", "def focus_next_cell(self, next):\n x, y = self._cell_input.cursor_coordinates()\n y_new = 0\n next._cell_input.set_cursor_coordinates(x, y_new)\n n...
[ "0.7651945", "0.74857336", "0.6641398", "0.65821093", "0.64603764", "0.64561605", "0.6435459", "0.6334366", "0.6332495", "0.63032544", "0.6289549", "0.6205924", "0.6180435", "0.6161628", "0.6105949", "0.61046416", "0.6073891", "0.60474837", "0.5960907", "0.5882112", "0.586161...
0.85488623
0
Focuses the "next" cell. Moves the cursor to the proper position.
def focus_next_cell(self, next): x, y = self._cell_input.cursor_coordinates() y_new = 0 next._cell_input.set_cursor_coordinates(x, y_new) next.set_focus() self.lost_focus(force=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _next(self, _):\n self.notebook.SetSelection(self.idx+1)", "def focus_next(self):\n self.focus_item()", "def next(self):\n self.jumpahead(1)", "def move_to_next_cell(self, create=False):\n if self._active_cell < self.num_cells()-1:\n current_cell = self._cell_list[s...
[ "0.7646229", "0.7625387", "0.70269966", "0.68980944", "0.64222103", "0.6386664", "0.6382788", "0.6369909", "0.6353012", "0.6218585", "0.62098944", "0.6159042", "0.6122109", "0.6112056", "0.6112056", "0.61118174", "0.611045", "0.6102978", "0.6070798", "0.6044282", "0.60154325"...
0.8417928
0
Joins this cell with the previous cell. It doesn't delete the current cell (this is the job of the Worksheet to properly delete ourselves).
def join_with_prev(self, prev): if prev._cell_input.getText() == "": new_text = self._cell_input.getText() else: new_text = prev._cell_input.getText() if self._cell_input.getText() != "": new_text += "\n" + self._cell_input.getText() y_new = pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_backward():\r\n point().delete_left_char()\r\n set_point(point().offset(-1))", "def _delete(self):\n self.prev.next = self.next\n self.next.prev = self.prev", "def focus_prev_cell(self, prev):\n x, y = self._cell_input.cursor_coordinates()\n y_new = prev._cell_input.row...
[ "0.5954091", "0.5862837", "0.582299", "0.56134", "0.55469036", "0.54742885", "0.5445057", "0.5317975", "0.5310467", "0.52803475", "0.5277451", "0.52689356", "0.5197231", "0.5184458", "0.5116611", "0.5108614", "0.510692", "0.5083509", "0.5083509", "0.50660044", "0.5053383", ...
0.6454845
0
Moves to the next cell. create .... if True, creates the next cell if we are at the end of the worksheet
def move_to_next_cell(self, create=False): if self._active_cell < self.num_cells()-1: current_cell = self._cell_list[self._active_cell] next_cell = self._cell_list[self._active_cell+1] current_cell.focus_next_cell(next_cell) elif create: self.add_cell() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_next_cell(self, cell, auto, i, j, next):\r\n move_list = {1: [i - 1, j - 1], 2: [i - 1, j], 3: [i - 1, j + 1], 4: [i, j + 1], 5: [i + 1, j + 1],\r\n 6: [i + 1, j], 7: [i + 1, j - 1], 8: [i, j - 1]}\r\n\r\n def prob_sick():\r\n ''' check the probability of a cr...
[ "0.64226735", "0.6207801", "0.6127847", "0.6035226", "0.59616894", "0.59289956", "0.57356495", "0.5691281", "0.5688103", "0.5622672", "0.559166", "0.55331457", "0.55153364", "0.54764044", "0.54577273", "0.5436615", "0.54298186", "0.54120505", "0.53717905", "0.53711927", "0.53...
0.74477285
0
Updates the cell id > active index mapping.
def update_id2idx(self): self._id2idx = {} for n, cell in enumerate(self._cell_list): self._id2idx[cell.id()] = n
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _update_in_db(db_values: list, sheet_cells: List[Cell], indices: Iterable[int]) -> List[int]:\n # print('Entering _update_in_db')\n mod_idx = []\n for i in indices:\n if db_values[i] != sheet_cells[i].value and (db_values[i] or sheet_cells[i].value):\n db_values[i...
[ "0.58209056", "0.5769968", "0.5764713", "0.5733865", "0.5632195", "0.5628743", "0.5600656", "0.5409752", "0.53816265", "0.5359478", "0.5354873", "0.5332774", "0.5331675", "0.52668226", "0.5264521", "0.52564687", "0.52549136", "0.5241691", "0.5241589", "0.5239948", "0.5236718"...
0.7694175
0
Inserts an element "new_elem" before the element "elem".
def insertChildBefore(new_elem, elem): parent = DOM.getParent(elem) id = DOM.getChildIndex(parent, elem) DOM.insertChild(parent, new_elem, id)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wrap_with(old_el, new_el):\n new_el.insert_before(old_el)\n new_el.append(old_el)\n return new_el", "def prepend_element(self, element):\n\n pass", "def insert_element_before_similar(self, parent, new_child):\n new_tag = self.tag_base_name(new_child.tag)\n for i, child in enum...
[ "0.71355605", "0.69677913", "0.6811626", "0.6761492", "0.67238426", "0.64580613", "0.63880986", "0.63516754", "0.63296306", "0.6283591", "0.6275506", "0.6227607", "0.62055457", "0.6180249", "0.6157978", "0.61048913", "0.6090873", "0.6085723", "0.6082616", "0.59911156", "0.594...
0.86346006
0
Prevents the current event's default behavior.
def event_preventDefault(): event = DOM.eventGetCurrentEvent() if event.preventDefault: event.preventDefault() else: event.returnValue = False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _prevent_default_event(self, e):\n if e.target is self.node:\n if not (e.altKey is True and e.ctrlKey is True and e.shiftKey is True):\n e.preventDefault()", "def preventContextMenu(self, setting=True):\n if setting:\n if self.onContextMenu: retu...
[ "0.77278936", "0.67206496", "0.6367158", "0.6188951", "0.6186308", "0.6146374", "0.61462164", "0.6137589", "0.61199397", "0.6106635", "0.608739", "0.608739", "0.60655683", "0.6055399", "0.6053924", "0.5991946", "0.5972741", "0.595977", "0.59427965", "0.593023", "0.5912482", ...
0.7761421
0