input
stringlengths
11
7.65k
target
stringlengths
22
8.26k
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _read_flow(self, file_name): return _read_pfm(file_name)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def __init__(self, root, split="train", transforms=None): super().__init__(root=root, transforms=transforms) verify_str_arg(split, "split", valid_values=("train", "test")) root = Path(root) / "hd1k" if split == "train": # There are 36 "sequences" and we don't want seq i to ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _read_flow(self, file_name): return _read_16bits_png_with_flow_and_valid_mask(file_name)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _read_flo(file_name): """Read .flo file in Middlebury format""" # Code adapted from: # http://stackoverflow.com/questions/28013200/reading-middlebury-flow-files-with-python-bytes-array-numpy # Everything needs to be in little Endian according to # https://vision.middlebury.edu/flow/code/flow-cod...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _read_16bits_png_with_flow_and_valid_mask(file_name): flow_and_valid = _read_png_16(file_name).to(torch.float32) flow, valid_flow_mask = flow_and_valid[:2, :, :], flow_and_valid[2, :, :] flow = (flow - 2 ** 15) / 64 # This conversion is explained somewhere on the kitti archive valid_flow_mask = va...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def LogPABotMessage(message): _pabotlog.info(message)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_engine_module_name(): engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") assert engine.name == "foobar"
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def resource_setup(cls): super(VolumesActionsTest, cls).resource_setup() # Create a test shared volume for attach/detach tests cls.volume = cls.create_volume()
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_attach_detach_volume_to_instance(self): """Test attaching and detaching volume to instance""" # Create a server server = self.create_server() # Volume is attached and detached successfully from an instance self.volumes_client.attach_volume(self.volume['id'], ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_volume_bootable(self): """Test setting and retrieving bootable flag of a volume""" for bool_bootable in [True, False]: self.volumes_client.set_bootable_volume(self.volume['id'], bootable=bool_bootable) fetched_volume = ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_get_volume_attachment(self): """Test getting volume attachments Attach a volume to a server, and then retrieve volume's attachments info. """ # Create a server server = self.create_server() # Verify that a volume's attachment information is retrieved ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_volume_upload(self): """Test uploading volume to create an image""" # NOTE(gfidente): the volume uploaded in Glance comes from setUpClass, # it is shared with the other tests. After it is uploaded in Glance, # there is no way to delete it from Cinder, so we delete it from Glance...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_reserve_unreserve_volume(self): """Test reserving and unreserving volume""" # Mark volume as reserved. self.volumes_client.reserve_volume(self.volume['id']) # To get the volume info body = self.volumes_client.show_volume(self.volume['id'])['volume'] self.assertIn...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def setup_loader(request): setup_loader_modules = {pdbedit: {}} with pytest.helpers.loader_mock(request, setup_loader_modules) as loader_mock: yield loader_mock
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_disk_usage_sensor_is_stateless(): sensor = disk_usage.DiskUsage() ok_([] != sensor.measure())
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_when_no_users_returned_no_data_should_be_returned(verbose): expected_users = {} if verbose else [] with patch.dict( pdbedit.__salt__, { "cmd.run_all": MagicMock( return_value={"stdout": "", "stderr": "", "retcode": 0} ) }, ): a...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_when_verbose_and_retcode_is_nonzero_output_should_be_had(): expected_stderr = "this is something fnord" with patch.dict( pdbedit.__salt__, { "cmd.run_all": MagicMock( return_value={"stdout": "", "stderr": expected_stderr, "retcode": 1} ) }...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_when_verbose_and_single_good_output_expected_data_should_be_parsed(): expected_data = { "roscivs": { "unix username": "roscivs", "nt username": "bottia", "full name": "Roscivs Bottia", "user sid": "42", "primary group sid": "99", ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def parse_record(self, metadata, line): factors = line.split('|') if len(factors) < 7: return registry, cc, type_, start, value, dete, status = factors[:7] if type_ not in ('ipv4', 'ipv6'): return return Record(metadata, start, type_, value, cc)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def setup_args(parser=None): if parser is None: parser = ParlaiParser(True, True, 'Check tasks for common errors') # Get command line arguments parser.add_argument('-ltim', '--log-every-n-secs', type=float, default=2) parser.add_argument('-d', '--display-examples', type='bool', default=False) ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def get_list(arg=None): """get list of messages""" frappe.form_dict['limit_start'] = int(frappe.form_dict['limit_start']) frappe.form_dict['limit_page_length'] = int(frappe.form_dict['limit_page_length']) frappe.form_dict['user'] = frappe.session['user'] # set all messages as read frappe.db.begin() frappe.db.sq...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def report(world, counts, log_time): report = world.report() log = { 'missing_text': counts['missing_text'], 'missing_labels': counts['missing_labels'], 'missing_label_candidates': counts['missing_label_candidates'], 'empty_string_label_candidates': counts['empty_string_label_can...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def get_active_users(): data = frappe.db.sql("""select name, (select count(*) from tabSessions where user=tabUser.name and timediff(now(), lastupdate) < time("01:00:00")) as has_session from tabUser where enabled=1 and ifnull(user_type, '')!='Website User' and name not in ({}) order by first_name""".fo...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def warn(txt, act, opt): if opt.get('display_examples'): print(txt + ":\n" + str(act)) else: warn_once(txt)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def post(txt, contact, parenttype=None, notify=False, subject=None): """post message""" d = frappe.new_doc('Communication') d.communication_type = 'Notification' if parenttype else 'Chat' d.subject = subject d.content = txt d.reference_doctype = 'User' d.reference_name = contact d.sender = frappe.session.user ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def verify(opt): if opt['datatype'] == 'train': logging.warning("changing datatype from train to train:ordered") opt['datatype'] = 'train:ordered' opt.log() # create repeat label agent and assign it to the specified task agent = RepeatLabelAgent(opt) world = create_task(opt, agent) ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def delete(arg=None): frappe.get_doc("Communication", frappe.form_dict['name']).delete()
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def verify_data(opt): counts = verify(opt) print(counts) return counts
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def setup_args(cls): return setup_args()
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def run(self): return verify_data(self.opt)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def block_size_filter(entity): return ( entity.size[0] * 2 >= entity.size[1] * 2 and entity.size[1] <= 16 and entity.size[3] <= 4 )
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def __init__(self, auth_provider): super(SnapshotsClientJSON, self).__init__(auth_provider) self.service = CONF.volume.catalog_type self.build_interval = CONF.volume.build_interval self.build_timeout = CONF.volume.build_timeout
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def list_snapshots(self, params=None): """List all the snapshot.""" url = 'snapshots' if params: url += '?%s' % urllib.urlencode(params) resp, body = self.get(url) body = json.loads(body) return resp, body['snapshots']
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def list_snapshots_with_detail(self, params=None): """List the details of all snapshots.""" url = 'snapshots/detail' if params: url += '?%s' % urllib.urlencode(params) resp, body = self.get(url) body = json.loads(body) return resp, body['snapshots']
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def get_snapshot(self, snapshot_id): """Returns the details of a single snapshot.""" url = "snapshots/%s" % str(snapshot_id) resp, body = self.get(url) body = json.loads(body) return resp, body['snapshot']
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def create_snapshot(self, volume_id, **kwargs): """ Creates a new snapshot. volume_id(Required): id of the volume. force: Create a snapshot even if the volume attached (Default=False) display_name: Optional snapshot Name. display_description: User friendly snapshot descri...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def update_snapshot(self, snapshot_id, **kwargs): """Updates a snapshot.""" put_body = json.dumps({'snapshot': kwargs}) resp, body = self.put('snapshots/%s' % snapshot_id, put_body) body = json.loads(body) return resp, body['snapshot']
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _get_snapshot_status(self, snapshot_id): resp, body = self.get_snapshot(snapshot_id) status = body['status'] # NOTE(afazekas): snapshot can reach an "error" # state in a "normal" lifecycle if (status == 'error'): raise exceptions.SnapshotBuildErrorException( ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def wait_for_snapshot_status(self, snapshot_id, status): """Waits for a Snapshot to reach a given status.""" start_time = time.time() old_value = value = self._get_snapshot_status(snapshot_id) while True: dtime = time.time() - start_time time.sleep(self.build_inte...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def delete_snapshot(self, snapshot_id): """Delete Snapshot.""" return self.delete("snapshots/%s" % str(snapshot_id))
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def is_resource_deleted(self, id): try: self.get_snapshot(id) except exceptions.NotFound: return True return False
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def reset_snapshot_status(self, snapshot_id, status): """Reset the specified snapshot's status.""" post_body = json.dumps({'os-reset_status': {"status": status}}) resp, body = self.post('snapshots/%s/action' % snapshot_id, post_body) return resp, body
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def update_snapshot_status(self, snapshot_id, status, progress): """Update the specified snapshot's status.""" post_body = { 'status': status, 'progress': progress } post_body = json.dumps({'os-update_snapshot_status': post_body}) url = 'snapshots/%s/actio...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def create_snapshot_metadata(self, snapshot_id, metadata): """Create metadata for the snapshot.""" put_body = json.dumps({'metadata': metadata}) url = "snapshots/%s/metadata" % str(snapshot_id) resp, body = self.post(url, put_body) body = json.loads(body) return resp, bod...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def get_snapshot_metadata(self, snapshot_id): """Get metadata of the snapshot.""" url = "snapshots/%s/metadata" % str(snapshot_id) resp, body = self.get(url) body = json.loads(body) return resp, body['metadata']
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def update_snapshot_metadata(self, snapshot_id, metadata): """Update metadata for the snapshot.""" put_body = json.dumps({'metadata': metadata}) url = "snapshots/%s/metadata" % str(snapshot_id) resp, body = self.put(url, put_body) body = json.loads(body) return resp, body...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def update_snapshot_metadata_item(self, snapshot_id, id, meta_item): """Update metadata item for the snapshot.""" put_body = json.dumps({'meta': meta_item}) url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id)) resp, body = self.put(url, put_body) body = json.loads(body)...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def delete_snapshot_metadata_item(self, snapshot_id, id): """Delete metadata item for the snapshot.""" url = "snapshots/%s/metadata/%s" % (str(snapshot_id), str(id)) resp, body = self.delete(url) return resp, body
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_stmt_simplify(): ib = tvm.tir.ir_builder.create() A = ib.pointer("float32", name="A") C = ib.pointer("float32", name="C") n = te.size_var("n") with ib.for_range(0, n, name="i") as i: with ib.if_scope(i < 12): A[i] = C[i] body = tvm.tir.LetStmt(n, 10, ib.get()) m...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_thread_extent_simplify(): ib = tvm.tir.ir_builder.create() A = ib.pointer("float32", name="A") C = ib.pointer("float32", name="C") n = te.size_var("n") tx = te.thread_axis("threadIdx.x") ty = te.thread_axis("threadIdx.y") ib.scope_attr(tx, "thread_extent", n) ib.scope_attr(tx, "...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_if_likely(): ib = tvm.tir.ir_builder.create() A = ib.pointer("float32", name="A") C = ib.pointer("float32", name="C") n = te.size_var("n") tx = te.thread_axis("threadIdx.x") ty = te.thread_axis("threadIdx.y") ib.scope_attr(tx, "thread_extent", 32) ib.scope_attr(ty, "thread_exten...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def name(self): if self._values['name'] is None: return None name = str(self._values['name']).strip() if name == '': raise F5ModuleError( "You must specify a name for this module" ) return name
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def f(i): start = W[i] extent = W[i + 1] - W[i] rv = te.reduce_axis((0, extent)) return te.sum(X[rv + start], axis=rv)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def __init__(self, client): self.client = client self.have = None self.want = Parameters(self.client.module.params) self.changes = Parameters()
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def cumsum(X): """ Y[i] = sum(X[:i]) """ (m,) = X.shape s_state = te.placeholder((m + 1,), dtype="int32", name="state") s_init = te.compute((1,), lambda _: tvm.tir.const(0, "int32")) s_update = te.compute((m + 1,), lambda l: s_state[l - 1] + X[l - 1]) retu...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _set_changed_options(self): changed = {} for key in Parameters.returnables: if getattr(self.want, key) is not None: changed[key] = getattr(self.want, key) if changed: self.changes = Parameters(changed)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def sls(n, d): gg = te.reduce_axis((0, lengths[n])) indices_idx = length_offsets[n] + gg data_idx = indices[indices_idx] data_val = data[data_idx, d] return te.sum(data_val, axis=gg)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _update_changed_options(self): changed = {} for key in Parameters.updatables: if getattr(self.want, key) is not None: attr1 = getattr(self.want, key) attr2 = getattr(self.have, key) if attr1 != attr2: changed[key] = attr...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _pool_is_licensed(self): if self.have.state == 'LICENSED': return True return False
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _pool_is_unlicensed_eula_unaccepted(self, current): if current.state != 'LICENSED' and not self.want.accept_eula: return True return False
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def exec_module(self): changed = False result = dict() state = self.want.state try: if state == "present": changed = self.present() elif state == "absent": changed = self.absent() except iControlUnexpectedHTTPError as e: ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def exists(self): collection = self.client.api.cm.shared.licensing.pools_s.get_collection( requests_params=dict( params="$filter=name+eq+'{0}'".format(self.want.name) ) ) if len(collection) == 1: return True elif len(collection) == 0: ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def should_update(self): if self._pool_is_licensed(): return False if self._pool_is_unlicensed_eula_unaccepted(): return False return True
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def update(self): self.have = self.read_current_from_device() if not self.should_update(): return False if self.module.check_mode: return True self.update_on_device() return True
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def update_on_device(self): collection = self.client.api.cm.shared.licensing.pools_s.get_collection( requests_params=dict( params="$filter=name+eq+'{0}'".format(self.want.name) ) ) resource = collection.pop() resource.modify( state='REL...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def create(self): self._set_changed_options() if self.client.check_mode: return True if self.want.base_key is None: raise F5ModuleError( "You must specify a 'base_key' when creating a license pool" ) self.create_on_device() retu...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def read_current_from_device(self): collection = self.client.api.cm.shared.licensing.pools_s.get_collection( requests_params=dict( params="$filter=name+eq+'{0}'".format(self.want.name) ) ) resource = collection.pop() result = resource.attrs ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def create_on_device(self): resource = self.client.api.cm.shared.licensing.pools_s.pool.create( name=self.want.name, baseRegKey=self.want.base_key, method="AUTOMATIC" ) return self._wait_for_license_pool_state_to_activate(resource)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def _wait_for_license_pool_state_to_activate(self, pool): error_values = ['EXPIRED', 'FAILED'] # Wait no more than 5 minutes for x in range(1, 30): pool.refresh() if pool.state == 'LICENSED': return True elif pool.state == 'WAITING_FOR_EULA_ACC...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def remove(self): if self.client.check_mode: return True self.remove_from_device() if self.exists(): raise F5ModuleError("Failed to delete the license pool") return True
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def remove_from_device(self): collection = self.client.api.cm.shared.licensing.pools_s.get_collection( requests_params=dict( params="$filter=name+eq+'{0}'".format(self.want.name) ) ) resource = collection.pop() if resource: resource.del...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def __init__(self): self.supports_check_mode = True self.argument_spec = dict( accept_eula=dict( type='bool', default='no', choices=BOOLEANS ), base_key=dict( required=False, no_log=True ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def main(): if not HAS_F5SDK: raise F5ModuleError("The python f5-sdk module is required") spec = ArgumentSpec() client = AnsibleF5Client( argument_spec=spec.argument_spec, supports_check_mode=spec.supports_check_mode, f5_product_name=spec.f5_product_name ) try: ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def __init__(self, protocol: ProtocolAnalyzerContainer, label_index: int, msg_index: int, proto_view: int, parent=None): super().__init__(parent) self.ui = Ui_FuzzingDialog() self.ui.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) self.setWindowFlags(Qt.Wind...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def setUp(self): self.oFile = vhdlFile.vhdlFile(lFile) self.assertIsNone(eError) self.oFile.set_indent_map(dIndentMap)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def message(self): return self.protocol.messages[int(self.ui.spinBoxFuzzMessage.value() - 1)]
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def test_rule_300(self): oRule = iteration_scheme.rule_300() self.assertTrue(oRule) self.assertEqual(oRule.name, 'iteration_scheme') self.assertEqual(oRule.identifier, '300') lExpected = [13, 17] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extrac...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def current_label_index(self): return self.ui.comboBoxFuzzingLabel.currentIndex()
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def current_label(self) -> ProtocolLabel: if len(self.message.message_type) == 0: return None cur_label = self.message.message_type[self.current_label_index].get_copy() self.message.message_type[self.current_label_index] = cur_label cur_label.fuzz_values = [fv for fv in cur_...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def current_label_start(self): if self.current_label and self.message: return self.message.get_label_range(self.current_label, self.proto_view, False)[0] else: return -1
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def current_label_end(self): if self.current_label and self.message: return self.message.get_label_range(self.current_label, self.proto_view, False)[1] else: return -1
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def message_data(self): if self.proto_view == 0: return self.message.plain_bits_str elif self.proto_view == 1: return self.message.plain_hex_str elif self.proto_view == 2: return self.message.plain_ascii_str else: return None
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def create_connects(self): self.ui.spinBoxFuzzingStart.valueChanged.connect(self.on_fuzzing_start_changed) self.ui.spinBoxFuzzingEnd.valueChanged.connect(self.on_fuzzing_end_changed) self.ui.comboBoxFuzzingLabel.currentIndexChanged.connect(self.on_combo_box_fuzzing_label_current_index_changed) ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def update_message_data_string(self): fuz_start = self.current_label_start fuz_end = self.current_label_end num_proto_bits = 10 num_fuz_bits = 16 proto_start = fuz_start - num_proto_bits preambel = "... " if proto_start <= 0: proto_start = 0 ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def closeEvent(self, event: QCloseEvent): settings.write("{}/geometry".format(self.__class__.__name__), self.saveGeometry()) super().closeEvent(event)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_fuzzing_start_changed(self, value: int): self.ui.spinBoxFuzzingEnd.setMinimum(self.ui.spinBoxFuzzingStart.value()) new_start = self.message.convert_index(value - 1, self.proto_view, 0, False)[0] self.current_label.start = new_start self.current_label.fuzz_values[:] = [] se...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_fuzzing_end_changed(self, value: int): self.ui.spinBoxFuzzingStart.setMaximum(self.ui.spinBoxFuzzingEnd.value()) new_end = self.message.convert_index(value - 1, self.proto_view, 0, False)[1] + 1 self.current_label.end = new_end self.current_label.fuzz_values[:] = [] self.u...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_combo_box_fuzzing_label_current_index_changed(self, index: int): self.fuzz_table_model.fuzzing_label = self.current_label self.fuzz_table_model.update() self.update_message_data_string() self.ui.tblFuzzingValues.resize_me() self.ui.spinBoxFuzzingStart.blockSignals(True) ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_btn_add_row_clicked(self): self.current_label.add_fuzz_value() self.fuzz_table_model.update()
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_btn_del_row_clicked(self): min_row, max_row, _, _ = self.ui.tblFuzzingValues.selection_range() self.delete_lines(min_row, max_row)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def delete_lines(self, min_row, max_row): if min_row == -1: self.current_label.fuzz_values = self.current_label.fuzz_values[:-1] else: self.current_label.fuzz_values = self.current_label.fuzz_values[:min_row] + self.current_label.fuzz_values[ ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_remove_duplicates_state_changed(self): self.fuzz_table_model.remove_duplicates = self.ui.chkBRemoveDuplicates.isChecked() self.fuzz_table_model.update() self.remove_duplicates()
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def set_add_spinboxes_maximum_on_label_change(self): nbits = self.current_label.end - self.current_label.start # Use Bit Start/End for maximum calc. if nbits >= 32: nbits = 31 max_val = 2 ** nbits - 1 self.ui.sBAddRangeStart.setMaximum(max_val - 1) self.ui.sBAddRange...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_fuzzing_range_start_changed(self, value: int): self.ui.sBAddRangeEnd.setMinimum(value) self.ui.sBAddRangeStep.setMaximum(self.ui.sBAddRangeEnd.value() - value)
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_fuzzing_range_end_changed(self, value: int): self.ui.sBAddRangeStart.setMaximum(value - 1) self.ui.sBAddRangeStep.setMaximum(value - self.ui.sBAddRangeStart.value())
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_lower_bound_checked_changed(self): if self.ui.checkBoxLowerBound.isChecked(): self.ui.spinBoxLowerBound.setEnabled(True) self.ui.spinBoxBoundaryNumber.setEnabled(True) elif not self.ui.checkBoxUpperBound.isChecked(): self.ui.spinBoxLowerBound.setEnabled(False) ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_upper_bound_checked_changed(self): if self.ui.checkBoxUpperBound.isChecked(): self.ui.spinBoxUpperBound.setEnabled(True) self.ui.spinBoxBoundaryNumber.setEnabled(True) elif not self.ui.checkBoxLowerBound.isChecked(): self.ui.spinBoxUpperBound.setEnabled(False) ...
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_lower_bound_changed(self): self.ui.spinBoxUpperBound.setMinimum(self.ui.spinBoxLowerBound.value()) self.ui.spinBoxBoundaryNumber.setMaximum(math.ceil((self.ui.spinBoxUpperBound.value() - self.ui.spinBoxLowerBound.value()) / 2))
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_upper_bound_changed(self): self.ui.spinBoxLowerBound.setMaximum(self.ui.spinBoxUpperBound.value() - 1) self.ui.spinBoxBoundaryNumber.setMaximum(math.ceil((self.ui.spinBoxUpperBound.value() - self.ui.spinBoxLowerBound.value()) / 2))
def dist(a, b): return sum((i-j)**2 for i, j in zip(a, b))
def on_random_range_min_changed(self): self.ui.spinBoxRandomMaximum.setMinimum(self.ui.spinBoxRandomMinimum.value())