code
stringlengths
101
5.91M
def visualize_dumped_camera_parameter(dumped_dir: str, interactive: bool=True, show: bool=True): file_list = os.listdir(dumped_dir) camera_para_list = [] for file_name in file_list: file_path = os.path.join(dumped_dir, file_name) if (not check_path_suffix(file_path, ['.json'])): continue else: cam_para = CameraParameter() cam_para.load(file_path) camera_para_list.append(cam_para) camera_vedo_renderer = VedoRenderer() camera_vedo_renderer.set_y_reverse() for camera_para in camera_para_list: camera_vedo_renderer.add_camera(camera_para) if show: camera_vedo_renderer.show(with_axis=False, interactive=interactive)
class Inceptionv3Model(model.Model): def __init__(self, auxiliary=False): self._auxiliary = auxiliary super(Inceptionv3Model, self).__init__('inception3', 299, 32, 0.005) def add_inference(self, cnn): def inception_v3_a(cnn, n): cols = [[('conv', 64, 1, 1)], [('conv', 48, 1, 1), ('conv', 64, 5, 5)], [('conv', 64, 1, 1), ('conv', 96, 3, 3), ('conv', 96, 3, 3)], [('apool', 3, 3, 1, 1, 'SAME'), ('conv', n, 1, 1)]] cnn.inception_module('incept_v3_a', cols) def inception_v3_b(cnn): cols = [[('conv', 384, 3, 3, 2, 2, 'VALID')], [('conv', 64, 1, 1), ('conv', 96, 3, 3), ('conv', 96, 3, 3, 2, 2, 'VALID')], [('mpool', 3, 3, 2, 2, 'VALID')]] cnn.inception_module('incept_v3_b', cols) def inception_v3_c(cnn, n): cols = [[('conv', 192, 1, 1)], [('conv', n, 1, 1), ('conv', n, 1, 7), ('conv', 192, 7, 1)], [('conv', n, 1, 1), ('conv', n, 7, 1), ('conv', n, 1, 7), ('conv', n, 7, 1), ('conv', 192, 1, 7)], [('apool', 3, 3, 1, 1, 'SAME'), ('conv', 192, 1, 1)]] cnn.inception_module('incept_v3_c', cols) def inception_v3_d(cnn): cols = [[('conv', 192, 1, 1), ('conv', 320, 3, 3, 2, 2, 'VALID')], [('conv', 192, 1, 1), ('conv', 192, 1, 7), ('conv', 192, 7, 1), ('conv', 192, 3, 3, 2, 2, 'VALID')], [('mpool', 3, 3, 2, 2, 'VALID')]] cnn.inception_module('incept_v3_d', cols) def inception_v3_e(cnn, pooltype): cols = [[('conv', 320, 1, 1)], [('conv', 384, 1, 1), ('conv', 384, 1, 3)], [('share',), ('conv', 384, 3, 1)], [('conv', 448, 1, 1), ('conv', 384, 3, 3), ('conv', 384, 1, 3)], [('share',), ('share',), ('conv', 384, 3, 1)], [(('mpool' if (pooltype == 'max') else 'apool'), 3, 3, 1, 1, 'SAME'), ('conv', 192, 1, 1)]] cnn.inception_module('incept_v3_e', cols) def incept_v3_aux(cnn): assert (cnn.aux_top_layer is None) cnn.aux_top_layer = cnn.top_layer cnn.aux_top_size = cnn.top_size with cnn.switch_to_aux_top_layer(): cnn.apool(5, 5, 3, 3, mode='VALID') cnn.conv(128, 1, 1, mode='SAME') cnn.conv(768, 5, 5, mode='VALID', stddev=0.01) cnn.reshape([(- 1), 768]) cnn.use_batch_norm = True cnn.conv(32, 3, 3, 2, 2, mode='VALID') cnn.conv(32, 3, 3, 1, 1, mode='VALID') cnn.conv(64, 3, 3, 1, 1, mode='SAME') cnn.mpool(3, 3, 2, 2, mode='VALID') cnn.conv(80, 1, 1, 1, 1, mode='VALID') cnn.conv(192, 3, 3, 1, 1, mode='VALID') cnn.mpool(3, 3, 2, 2, 'VALID') inception_v3_a(cnn, 32) inception_v3_a(cnn, 64) inception_v3_a(cnn, 64) inception_v3_b(cnn) inception_v3_c(cnn, 128) inception_v3_c(cnn, 160) inception_v3_c(cnn, 160) inception_v3_c(cnn, 192) if self._auxiliary: incept_v3_aux(cnn) inception_v3_d(cnn) inception_v3_e(cnn, 'avg') inception_v3_e(cnn, 'max') cnn.apool(8, 8, 1, 1, 'VALID') cnn.reshape([(- 1), 2048])
def generate_launch_description(): logger = LaunchConfiguration('log_level') share_dir = get_package_share_directory('online_fgo') config_common_path = LaunchConfiguration('config_common_path') default_config_common = os.path.join(get_package_share_directory('online_fgo'), 'config/shipping', 'common.yaml') default_config_integrator = os.path.join(get_package_share_directory('online_fgo'), 'config/shipping', 'integrator.yaml') default_config_optimizer = os.path.join(get_package_share_directory('online_fgo'), 'config/shipping', 'optimizer.yaml') declare_config_common_path_cmd = DeclareLaunchArgument('config_common_path', default_value=default_config_common, description='CommonParameters') declare_config_integrtor_path_cmd = DeclareLaunchArgument('config_common_path', default_value=default_config_integrator, description='IntegratorParameters') declare_config_optimizer_path_cmd = DeclareLaunchArgument('config_common_path', default_value=default_config_optimizer, description='OptimizerParameters') online_fgo_node = Node(package='online_fgo', executable='boreas_node', name='online_fgo', namespace='boreas', output='screen', emulate_tty=True, parameters=[config_common_path, default_config_common, default_config_integrator, default_config_optimizer, {}]) plot_node = Node(package='rqt_plot', executable='rqt_plot', name='rqt_plot_fgo', output='screen', parameters=[{'use_sim_time': True}]) ld = LaunchDescription() ld.add_action(DeclareLaunchArgument('log_level', default_value=['debug'], description='Logging level')) ld.add_action(declare_config_common_path_cmd) ld.add_action(declare_config_integrtor_path_cmd) ld.add_action(declare_config_optimizer_path_cmd) ld.add_action(online_fgo_node) return ld
def dump_verilog_readmemb_image_classification(f, loader, *, class_digits=8): for (images, labels) in loader: for (x, t) in zip(images, labels): __dump_bin_int(f, t, class_digits) f.write('_') __dump_bin_img(f, x) f.write('\n')
def test_top_selector_find_top_k_binary_correct_case(): ts = TopSelector() tst = TopSelectorTorch() values = np.array([[0.4, 0.7, 0.1], [0.1, 0.3, 0.6], [0.02, 0.25, 0.2]]) ground_truth = np.array([[True, True, False], [False, True, True], [False, True, True]]) assert np.all((ts.find_top_k_binary(values, k) == ground_truth)) assert torch.equal(tst.find_top_k_binary(torch.from_numpy(values), k), torch.from_numpy(ground_truth))
class SegNeXt(EncoderDecoder): def __init__(self, *args, **kwargs): super(SegNeXt, self).__init__(*args, **kwargs)
class ZeroshotThinkAgent(BaseAgent): def __init__(self, question: str, key: str, llm, context_len: int=2000) -> None: super().__init__(question, key, llm, context_len) self.examples = '' self.agent_prompt = zeroshot_agent_prompt self.name = 'ZeroshotThink_HotPotQA_run_Agent' def forward(self): self._think() (action_type, argument) = self._action() return (action_type, argument) def _build_agent_prompt(self) -> str: return self.agent_prompt.format(question=self.question, scratchpad=self.scratchpad)
def relative_overlap(anaphor, antecedent): ana_tokens = set([tok.lower() for tok in anaphor.attributes['tokens']]) ante_tokens = set([tok.lower() for tok in antecedent.attributes['tokens']]) overlap = (len((ana_tokens & ante_tokens)) / max(len(ana_tokens), len(ante_tokens))) return ('relative_overlap', overlap)
_kwarg({'seed': 'rng'}, deprecated_version='0.21', removed_version='0.23') def unwrap_phase(image, wrap_around=False, rng=None): if (image.ndim not in (1, 2, 3)): raise ValueError('Image must be 1, 2, or 3 dimensional') if isinstance(wrap_around, bool): wrap_around = ([wrap_around] * image.ndim) elif (hasattr(wrap_around, '__getitem__') and (not isinstance(wrap_around, str))): if (len(wrap_around) != image.ndim): raise ValueError('Length of `wrap_around` must equal the dimensionality of image') wrap_around = [bool(wa) for wa in wrap_around] else: raise ValueError('`wrap_around` must be a bool or a sequence with length equal to the dimensionality of image') if (image.ndim == 1): if np.ma.isMaskedArray(image): raise ValueError('1D masked images cannot be unwrapped') if wrap_around[0]: raise ValueError('`wrap_around` is not supported for 1D images') if ((image.ndim in (2, 3)) and (1 in image.shape)): warn('Image has a length 1 dimension. Consider using an array of lower dimensionality to use a more efficient algorithm') if np.ma.isMaskedArray(image): mask = np.require(np.ma.getmaskarray(image), np.uint8, ['C']) else: mask = np.zeros_like(image, dtype=np.uint8, order='C') image_not_masked = np.asarray(np.ma.getdata(image), dtype=np.float64, order='C') image_unwrapped = np.empty_like(image, dtype=np.float64, order='C', subok=False) if (image.ndim == 1): unwrap_1d(image_not_masked, image_unwrapped) elif (image.ndim == 2): unwrap_2d(image_not_masked, mask, image_unwrapped, wrap_around, rng) elif (image.ndim == 3): unwrap_3d(image_not_masked, mask, image_unwrapped, wrap_around, rng) if np.ma.isMaskedArray(image): return np.ma.array(image_unwrapped, mask=mask, fill_value=image.fill_value) else: return image_unwrapped
def softmax_depths_with_mask(x, mask): assert (x.ndim == 3) assert (mask.ndim == 3) x *= mask x -= x.min(axis=2, keepdims=True) x *= mask x -= x.max(axis=2, keepdims=True) e_x = (mask * tt.exp(x)) sums = e_x.sum(axis=2, keepdims=True) y = (e_x / (sums + tt.eq(sums, 0))) y *= mask return y
def _check_valid_optimizer(optimizer_class): if KerasOptimizer: assert issubclass(optimizer_class, (Optimizer, KerasOptimizer)) else: assert issubclass(optimizer_class, Optimizer)
def add_dll(name, deps=[], path=None, dll_name=None, export_files=[], reexports=[], install=True, static=False, staging_link=None): c = DLLComponent(name, dll_name, path, deps, export_files, reexports, install, static, staging_link) reg_component(name, c) return c
class PredictionInputWithSchema(namedtuple('PredictionInputWithSchema', ('decoder_state', 'input_hidden_states', 'schema_states', 'snippets', 'input_sequence', 'previous_queries', 'previous_query_states', 'input_schema'))): __slots__ = ()
class Cg_molecule(): def __init__(self, molecule, molname, topfname=None, forcepred=False): self.heavy_atom_coords = None self.list_heavyatom_names = None self.atom_partitioning = None self.cg_bead_names = [] self.cg_bead_coords = [] self.topout = None logger.info('Entering cg_molecule()') feats = topology.extract_features(molecule) (list_heavy_atoms, self.list_heavyatom_names) = topology.get_atoms(molecule) (conf, self.heavy_atom_coords) = topology.get_heavy_atom_coords(molecule) ring_atoms = topology.get_ring_atoms(molecule) hbond_a = topology.get_hbond_a(feats) hbond_d = topology.get_hbond_d(feats) ring_atoms_flat = list(chain.from_iterable(ring_atoms)) (list_cg_beads, list_bead_pos) = optimization.find_bead_pos(molecule, conf, list_heavy_atoms, self.heavy_atom_coords, ring_atoms, ring_atoms_flat) max_attempts = int(math.ceil((0.5 * len(list_cg_beads)))) logger.info(f'Max. number of attempts: {max_attempts}') attempt = 0 while (attempt < max_attempts): cg_beads = list_cg_beads[attempt] bead_pos = list_bead_pos[attempt] success = True if ((len(cg_beads) < len(list_cg_beads[0])) and ((len(list_heavy_atoms) - (5 * len(cg_beads))) > 3)): success = False self.cg_bead_coords = get_coords(conf, cg_beads, bead_pos, ring_atoms_flat) self.atom_partitioning = optimization.voronoi_atoms(self.cg_bead_coords, self.heavy_atom_coords) logger.info('; Atom partitioning: {atom_partitioning}') (self.cg_bead_names, bead_types, _) = topology.print_atoms(molname, forcepred, cg_beads, molecule, hbond_a, hbond_d, self.atom_partitioning, ring_atoms, ring_atoms_flat, True) if (not self.cg_bead_names): success = False if (not check_additivity(forcepred, bead_types, molecule)): success = False try: (bond_list, const_list, _) = topology.print_bonds(cg_beads, molecule, self.atom_partitioning, self.cg_bead_coords, ring_atoms, trial=True) except Exception: raise if ((not ring_atoms) and ((len(bond_list) + len(const_list)) >= len(self.cg_bead_names))): errval = 3 success = False if ((len(bond_list) + len(const_list)) < (len(self.cg_bead_names) - 1)): errval = 5 success = False if (len(cg_beads) != len(self.cg_bead_names)): success = False errval = 8 if success: header_write = topology.print_header(molname) (self.cg_bead_names, bead_types, atoms_write) = topology.print_atoms(molname, forcepred, cg_beads, molecule, hbond_a, hbond_d, self.atom_partitioning, ring_atoms, ring_atoms_flat, trial=False) (bond_list, const_list, bonds_write) = topology.print_bonds(cg_beads, molecule, self.atom_partitioning, self.cg_bead_coords, ring_atoms, False) (angles_write, angle_list) = topology.print_angles(cg_beads, molecule, self.atom_partitioning, self.cg_bead_coords, bond_list, const_list, ring_atoms) if ((not angles_write) and (len(bond_list) > 1)): errval = 2 if (bond_list and angle_list): if (((len(bond_list) + len(const_list)) < 2) and (len(angle_list) > 0)): errval = 6 if ((not ring_atoms) and (((len(bond_list) + len(const_list)) - len(angle_list)) != 1)): errval = 7 dihedrals_write = topology.print_dihedrals(cg_beads, const_list, ring_atoms, self.cg_bead_coords) self.topout = ((((header_write + atoms_write) + bonds_write) + angles_write) + dihedrals_write) if topfname: with open(topfname, 'w') as fp: fp.write(self.topout) print('Converged to solution in {} iteration(s)'.format((attempt + 1))) break else: attempt += 1 if (attempt == max_attempts): raise RuntimeError('ERROR: no successful mapping found.\nTry running with the --fpred and/or --verbose options.') def output_aa(self, aa_output=None, molname='MOL'): aa_out = output.output_gro(self.heavy_atom_coords, self.list_heavyatom_names, molname) if aa_output: with open(aa_output, 'w') as fp: fp.write(aa_out) else: return aa_out def output_cg(self, cg_output=None, molname='MOL'): cg_out = output.output_gro(self.cg_bead_coords, self.cg_bead_names, molname) if cg_output: with open(cg_output, 'w') as fp: fp.write(cg_out) else: return cg_out
class VolatilityFormatter(GenericDataFormatter): _column_definition = [('Symbol', DataTypes.CATEGORICAL, InputTypes.ID), ('date', DataTypes.DATE, InputTypes.TIME), ('log_vol', DataTypes.REAL_VALUED, InputTypes.TARGET), ('open_to_close', DataTypes.REAL_VALUED, InputTypes.OBSERVED_INPUT), ('days_from_start', DataTypes.REAL_VALUED, InputTypes.KNOWN_INPUT), ('day_of_week', DataTypes.CATEGORICAL, InputTypes.KNOWN_INPUT), ('day_of_month', DataTypes.CATEGORICAL, InputTypes.KNOWN_INPUT), ('week_of_year', DataTypes.CATEGORICAL, InputTypes.KNOWN_INPUT), ('month', DataTypes.CATEGORICAL, InputTypes.KNOWN_INPUT), ('Region', DataTypes.CATEGORICAL, InputTypes.STATIC_INPUT)] def __init__(self): self.identifiers = None self._real_scalers = None self._cat_scalers = None self._target_scaler = None self._num_classes_per_cat_input = None def split_data(self, df, valid_boundary=2016, test_boundary=2018): print('Formatting train-valid-test splits.') index = df['year'] train = df.loc[(index < valid_boundary)] valid = df.loc[((index >= valid_boundary) & (index < test_boundary))] test = df.loc[(index >= test_boundary)] self.set_scalers(train) return (self.transform_inputs(data) for data in [train, valid, test]) def set_scalers(self, df): print('Setting scalers with training data...') column_definitions = self.get_column_definition() id_column = utils.get_single_col_by_input_type(InputTypes.ID, column_definitions) target_column = utils.get_single_col_by_input_type(InputTypes.TARGET, column_definitions) self.identifiers = list(df[id_column].unique()) real_inputs = utils.extract_cols_from_data_type(DataTypes.REAL_VALUED, column_definitions, {InputTypes.ID, InputTypes.TIME}) data = df[real_inputs].values self._real_scalers = sklearn.preprocessing.StandardScaler().fit(data) self._target_scaler = sklearn.preprocessing.StandardScaler().fit(df[[target_column]].values) categorical_inputs = utils.extract_cols_from_data_type(DataTypes.CATEGORICAL, column_definitions, {InputTypes.ID, InputTypes.TIME}) categorical_scalers = {} num_classes = [] for col in categorical_inputs: srs = df[col].apply(str) categorical_scalers[col] = sklearn.preprocessing.LabelEncoder().fit(srs.values) num_classes.append(srs.nunique()) self._cat_scalers = categorical_scalers self._num_classes_per_cat_input = num_classes def transform_inputs(self, df): output = df.copy() if ((self._real_scalers is None) and (self._cat_scalers is None)): raise ValueError('Scalers have not been set!') column_definitions = self.get_column_definition() real_inputs = utils.extract_cols_from_data_type(DataTypes.REAL_VALUED, column_definitions, {InputTypes.ID, InputTypes.TIME}) categorical_inputs = utils.extract_cols_from_data_type(DataTypes.CATEGORICAL, column_definitions, {InputTypes.ID, InputTypes.TIME}) output[real_inputs] = self._real_scalers.transform(df[real_inputs].values) for col in categorical_inputs: string_df = df[col].apply(str) output[col] = self._cat_scalers[col].transform(string_df) return output def format_predictions(self, predictions): output = predictions.copy() column_names = predictions.columns for col in column_names: if (col not in {'forecast_time', 'identifier'}): output[col] = self._target_scaler.inverse_transform(predictions[col].values.reshape((- 1), 1)) return output def get_fixed_params(self): fixed_params = {'total_time_steps': (252 + 5), 'num_encoder_steps': 252, 'num_epochs': 100, 'early_stopping_patience': 5, 'multiprocessing_workers': 5} return fixed_params def get_default_model_params(self): model_params = {'dropout_rate': 0.3, 'hidden_layer_size': 160, 'learning_rate': 0.01, 'minibatch_size': 64, 'max_gradient_norm': 0.01, 'num_heads': 1, 'stack_size': 1} return model_params
def test_connect(corenlp_client): corenlp_client.ensure_alive() assert corenlp_client.is_active assert corenlp_client.is_alive()
class NetStatParser(): layer_prefix = 'LAYER_' def __parse_gdma_item(self, line): items = line.split('|') layer_id = (- 1) tensor_id = (- 1) info = items[0] if info.startswith(self.layer_prefix): layer_id = int(info[len(self.layer_prefix):]) else: tensor_id = int(re.search('\\d+', line).group()) op_type = items[1] start_time = ((int(items[2].split(':')[(- 1)]) / 1000.0) + self.time_offset) bd_id = int(items[3].split(':')[(- 1)]) gdma_id = int(items[4].split(':')[(- 1)]) end_time = ((int(items[5].split(':')[(- 1)]) / 1000.0) + self.time_offset) cost_time = (int(items[6].split(':')[(- 1)]) / 1000.0) direction = int(items[7].split(':')[(- 1)]) byte_size = int(items[8].split(':')[(- 1)]) if (len(items) > 9): bandwidth = float(items[9].split(':')[(- 1)]) else: bandwidth = (float(byte_size) / (1000 * cost_time)) self.last_end_time = max(self.last_end_time, end_time) self.gdma_nodes.append(GDMASimRecord(layer_id=layer_id, tensor_id=tensor_id, info=info, op_type=op_type, start_time=start_time, bd_id=bd_id, gdma_id=gdma_id, end_time=end_time, cost_time=cost_time, direction=direction, byte_size=byte_size, bandwidth=bandwidth)) def __parse_bd_item(self, line): items = line.split('|') layer_id = (- 1) if items[0].startswith(self.layer_prefix): layer_id = int(items[0][len(self.layer_prefix):]) if (len(items) < 7): return op_type = items[1] start_time = ((int(items[2].split(':')[(- 1)]) / 1000.0) + self.time_offset) bd_id = int(items[3].split(':')[(- 1)]) gdma_id = int(items[4].split(':')[(- 1)]) end_time = ((int(items[5].split(':')[(- 1)]) / 1000.0) + self.time_offset) cost_time = (int(items[6].split(':')[(- 1)]) / 1000.0) self.last_end_time = max(self.last_end_time, end_time) self.bd_nodes.append(BDSimRecord(layer_id=layer_id, op_type=op_type, bd_id=bd_id, gdma_id=gdma_id, start_time=start_time, end_time=end_time, cost_time=cost_time)) def __parse_line(self, line): if ('dr' in line): self.__parse_gdma_item(line) else: self.__parse_bd_item(line) def __update_global_data(self, global_info, update_time): bd_idx = 0 gdma_idx = 0 for subnet in global_info.subnet_list: start_time = self.gdma_nodes[gdma_idx].start_time end_time = self.gdma_nodes[gdma_idx].end_time for bd_node in subnet.bd_nodes: if (bd_idx >= len(self.bd_nodes)): continue sim_node = self.bd_nodes[bd_idx] if ((bd_node.bd_id == sim_node.bd_id) and (bd_node.gdma_id == sim_node.gdma_id)): bd_node.sim_info = sim_node if (update_time and (bd_node.layer is not None)): bd_node.layer.update_time(sim_node.start_time, sim_node.end_time) start_time = min(start_time, sim_node.start_time) end_time = max(end_time, sim_node.end_time) bd_idx += 1 for gdma_node in subnet.gdma_nodes: if (gdma_idx >= len(self.gdma_nodes)): continue sim_node = self.gdma_nodes[gdma_idx] if ((gdma_node.bd_id == sim_node.bd_id) and (gdma_node.gdma_id == sim_node.gdma_id)): gdma_node.sim_info = sim_node if (update_time and (gdma_node.layer is not None)): gdma_node.layer.update_time(sim_node.start_time, sim_node.end_time) start_time = min(start_time, sim_node.start_time) end_time = max(end_time, sim_node.end_time) gdma_idx += 1 if ((len(subnet.bd_nodes) > 0) or (len(subnet.gdma_nodes) > 0)): subnet.sim_info = (start_time, end_time) def parse(self, global_info, filename): update_time = global_info.no_perf_data start = False self.gdma_nodes = [] self.bd_nodes = [] self.time_offset = 0 self.last_end_time = 0 if (not os.path.exists(filename)): return global_info with open(filename) as f: for line in f: line = line.strip() strings = re.split('\\s+', line) if (strings == ['ENGINE_BD', 'ENGINE_GDMA']): start = True self.time_offset = self.last_end_time continue elif (start and re.match('-+', strings[0]) and (len(strings) == 1)): start = False continue if start: for s in strings: self.__parse_line(s) if line.startswith('flops:'): global_info.flops += int(re.search('\\d+', line).group()) self.__update_global_data(global_info, update_time) return global_info
class Visualizer(): def __init__(self, opt): self.display_id = opt.display_id self.win_size = 256 self.name = opt.name self.opt = opt if self.opt.display: import visdom self.vis = visdom.Visdom(server=opt.display_server, port=opt.display_port) self.plot_data = None self.plot_res = None self.img_dir = os.path.join(opt.outf, opt.name, 'train', 'images') self.tst_img_dir = os.path.join(opt.outf, opt.name, 'test', 'images') if (not os.path.exists(self.img_dir)): os.makedirs(self.img_dir) if (not os.path.exists(self.tst_img_dir)): os.makedirs(self.tst_img_dir) self.log_name = os.path.join(opt.outf, opt.name, 'loss_log.txt') now = time.strftime('%c') title = f''' {now} ''' info = f'''{opt.abnormal_class}, {opt.nz}, {opt.w_adv}, {opt.w_con}, {opt.w_lat} ''' self.write_to_log_file(text=(title + info)) def normalize(inp): return ((inp - inp.min()) / ((inp.max() - inp.min()) + 1e-05)) def plot_current_errors(self, epoch, counter_ratio, errors): if ((not hasattr(self, 'plot_data')) or (self.plot_data is None)): self.plot_data = {'X': [], 'Y': [], 'legend': list(errors.keys())} self.plot_data['X'].append((epoch + counter_ratio)) self.plot_data['Y'].append([errors[k] for k in self.plot_data['legend']]) self.vis.line(X=np.stack(([np.array(self.plot_data['X'])] * len(self.plot_data['legend'])), 1), Y=np.array(self.plot_data['Y']), opts={'title': (self.name + ' loss over time'), 'legend': self.plot_data['legend'], 'xlabel': 'Epoch', 'ylabel': 'Loss'}, win=4) def plot_performance(self, epoch, counter_ratio, performance): if ((not hasattr(self, 'plot_res')) or (self.plot_res is None)): self.plot_res = {'X': [], 'Y': [], 'legend': list(performance.keys())} self.plot_res['X'].append((epoch + counter_ratio)) self.plot_res['Y'].append([performance[k] for k in self.plot_res['legend']]) self.vis.line(X=np.stack(([np.array(self.plot_res['X'])] * len(self.plot_res['legend'])), 1), Y=np.array(self.plot_res['Y']), opts={'title': (self.name + 'Performance Metrics'), 'legend': self.plot_res['legend'], 'xlabel': 'Epoch', 'ylabel': 'Stats'}, win=5) def print_current_errors(self, epoch, errors): message = (' Loss: [%d/%d] ' % (epoch, self.opt.niter)) for (key, val) in errors.items(): message += ('%s: %.3f ' % (key, val)) print(message) with open(self.log_name, 'a') as log_file: log_file.write(('%s\n' % message)) def write_to_log_file(self, text): with open(self.log_name, 'a') as log_file: log_file.write(('%s\n' % text)) def print_current_performance(self, performance, best): message = ' ' for (key, val) in performance.items(): message += ('%s: %.3f ' % (key, val)) message += ('max AUC: %.3f' % best) print(message) self.write_to_log_file(text=message) def display_current_images(self, reals, fakes, fixed): reals = self.normalize(reals.cpu().numpy()) fakes = self.normalize(fakes.cpu().numpy()) self.vis.images(reals, win=1, opts={'title': 'Reals'}) self.vis.images(fakes, win=2, opts={'title': 'Fakes'}) def save_current_images(self, epoch, reals, fakes, fixed): vutils.save_image(reals, ('%s/reals.png' % self.img_dir), normalize=True) vutils.save_image(fakes, ('%s/fakes.png' % self.img_dir), normalize=True) vutils.save_image(fixed, ('%s/fixed_fakes_%03d.png' % (self.img_dir, (epoch + 1))), normalize=True)
def zooALAAMsampler(G, A, changestats_func_list, theta, performMove, sampler_m): n = len(changestats_func_list) numNodes = len(A) num_not_na = (len(A) - len(np.where((A == NA_VALUE))[0])) accepted = 0 changeTo1ChangeStats = np.zeros(n) changeTo0ChangeStats = np.zeros(n) for k in range(sampler_m): if (len(np.where((A == 1))[0]) == num_not_na): isChangeToZero = True elif (len(np.where((A == 0))[0]) == num_not_na): isChangeToZero = False else: isChangeToZero = (random.uniform(0, 1) < 0.5) i = np.random.choice(np.where((A == (1 if isChangeToZero else 0)))[0]) while (A[i] == NA_VALUE): i = np.random.choice(np.where((A == (1 if isChangeToZero else 0)))[0]) if isChangeToZero: assert (A[i] == 1) A[i] = 0 assert (A[i] == 0) changestats = np.zeros(n) for l in range(n): changestats[l] = changestats_func_list[l](G, A, i) changeSignMul = ((- 1) if isChangeToZero else (+ 1)) total = np.sum(((theta * changeSignMul) * changestats)) Dmax = float(num_not_na) Dy = float(len(np.where((A == 1))[0])) if isChangeToZero: log_proposal_ratio = np.log((Dy / (Dmax - Dy))) else: log_proposal_ratio = np.log(((Dmax - Dy) / Dy)) alpha = np.exp((log_proposal_ratio + total)) if (random.uniform(0, 1) < alpha): accepted += 1 if performMove: if (not isChangeToZero): A[i] = 1 elif isChangeToZero: A[i] = 1 if isChangeToZero: changeTo0ChangeStats += changestats else: changeTo1ChangeStats += changestats elif isChangeToZero: A[i] = 1 acceptance_rate = (float(accepted) / sampler_m) return (acceptance_rate, changeTo1ChangeStats, changeTo0ChangeStats)
class _InputProviderExtractor(ast.NodeVisitor): def __init__(self): self.function_node = None def visit_FunctionDef(self, node): if (self.function_node is not None): return if (node.name != 'skyline_input_provider'): return self.function_node = node
.parametrize('algorithm', ['auto', 'ball_tree', 'kd_tree', 'brute']) .parametrize('novelty', [True, False]) .parametrize('contamination', [0.5, 'auto']) def test_lof_input_dtype_preservation(global_dtype, algorithm, contamination, novelty): X = iris.data.astype(global_dtype, copy=False) iso = neighbors.LocalOutlierFactor(n_neighbors=5, algorithm=algorithm, contamination=contamination, novelty=novelty) iso.fit(X) assert (iso.negative_outlier_factor_.dtype == global_dtype) for method in ('score_samples', 'decision_function'): if hasattr(iso, method): y_pred = getattr(iso, method)(X) assert (y_pred.dtype == global_dtype)
def get_dataset(args): def get_wav(dir): wavs = [] wavs.extend(glob.glob(os.path.join(dir, '**/*.wav'), recursive=True)) wavs.extend(glob.glob(os.path.join(dir, '**/*.flac'), recursive=True)) wavs.extend(glob.glob(os.path.join(dir, '**/*.pcm'), recursive=True)) return wavs if (args.train_dataset == 'mix'): train_signals = get_wav(args.train_signal) train_noises = get_wav(args.train_noise) else: train_signals = get_wav(args.train_signal) train_noises = [signal.replace('clean', 'noisy') for signal in train_signals] if (args.valid_dataset == 'mix'): test_signals = get_wav(args.test_signal) test_noises = get_wav(args.test_noise) else: test_signals = get_wav(args.test_signal) test_noises = [signal.replace('clean', 'noisy') for signal in test_signals] if (args.num_signal > 0): train_signals = train_signals[:args.num_signal] test_signals = test_signals[:args.num_signal] if (args.num_noise > 0): train_noises = train_noises[:args.num_noise] test_noises = test_noises[:args.num_noise] if (args.train_dataset == 'mix'): train_dset = NoiseDataset(train_signals, train_noises, sequence_length=args.sequence_length, is_validation=False, preload=args.preload) else: train_noises = [signal.replace('clean', 'noisy') for signal in train_signals] train_dset = SEDataset(train_signals, train_noises, sequence_length=args.sequence_length, is_validation=False) if (args.valid_dataset == 'mix'): rand = np.random.RandomState(0) rand.shuffle(test_signals) test_signals = test_signals[:1000] valid_dset = NoiseDataset(test_signals, test_noises, sequence_length=args.sequence_length, is_validation=True, preload=args.preload) else: test_noises = [signal.replace('clean', 'noisy') for signal in test_signals] valid_dset = SEDataset(test_signals, test_noises, sequence_length=args.sequence_length, is_validation=True) return dict(train_dset=train_dset, valid_dset=valid_dset)
def store_dict_hdf5(hdf5_file_name, input_dict): def store_group(group, pearent_goup): for (k, v) in list(group.items()): if isinstance(v, dict): if (k not in pearent_goup): tmp_group = pearent_goup.create_group(k) else: tmp_group = pearent_goup[k] store_group(v, tmp_group) else: store_value(k, v, pearent_goup) def store_value(name, value, group): if (value is not None): if (name in group): del group[name] try: if isinstance(name, bytes): name = name.decode() if isinstance(value, str): group[name] = value elif isinstance(value, numpy.ndarray): group.create_dataset(name, data=value, chunks=True, compression='gzip', compression_opts=1) elif isinstance(value, (list, tuple)): value = numpy.array(value) if (value.dtype == numpy.dtype('<U31')): value = [v.encode('utf8') for v in value] group.create_dataset(name, data=value, chunks=True, compression='gzip', compression_opts=1) else: group.create_dataset(name, data=value) except ValueError: group.create_dataset(name, data=value) except TypeError: group.create_dataset(name, data=value) except Exception: print("Error at name='{}' value='{}' group='{}'".format(name, value, group)) raise with h5py.File(hdf5_file_name, 'w') as res_file: store_group(input_dict, res_file)
def _extract_target_file_name(img_src, img_dst, method=None): spl_src = img_src.split('/') spl_dst = img_dst.split('/') if ((len(spl_src) > 1) and (len(spl_dst) > 1)): tmp = ((((((spl_src[(- 2)] + '_') + spl_src[(- 1)][:(- 4)]) + '__') + spl_dst[(- 2)]) + '_') + spl_dst[(- 1)][:(- 4)]) else: tmp = ((spl_src[(- 1)][:(- 4)] + '__') + spl_dst[(- 1)][:(- 4)]) return (tmp if (method is None) else ((method + '_') + tmp))
def print_coeff_dict(coeff_dict, n): for key in coeff_dict: print('{}:{}{}'.format(key, key_to_tabs(n, key), coeff_dict[key]))
def load_index_dataset(img2idx, ans2label, gqa_q='data/GQA-Questions', split='all', mode='train', indices=None): question_path = os.path.join(gqa_q, ('%s_balanced_questions.json' % mode)) with open(question_path, 'r') as f: examples = json.load(f) print(("\t[*] Creating GQA '%s' Active Learning Entries..." % split)) (entries, selected_indices, set_indices) = ([], [], set(indices)) for (idx, ex_key) in enumerate(sorted(examples)): if ((indices is not None) and (idx in set_indices)): (in_dataset, entry) = create_entry(examples[ex_key], ex_key, img2idx, ans2label, idx=idx) assert in_dataset, 'Something went horribly wrong w/ active learning example selection' entries.append(entry) selected_indices.append(idx) return (entries, selected_indices)
_builder('iconqa_instruct') class IconQAInstructBuilder(BaseDatasetBuilder): train_dataset_cls = IconQAInstructDataset eval_dataset_cls = IconQAEvalDataset DATASET_CONFIG_DICT = {'default': 'configs/datasets/iconqa/defaults_instruct.yaml'}
class GaloisGroup_perm(_GaloisMixin, PermutationGroup_generic): _method def transitive_number(self, algorithm=None, recompute=False): _attribute def _gens(self): return NotImplemented def __init__(self, field, algorithm=None, names=None, gc_numbering=False): self._field = field self._default_algorithm = algorithm self._base = field.base_field() self._gc_numbering = gc_numbering if (names is None): names = (field.variable_name() + 'c') self._gc_names = normalize_names(1, names) from sage.categories.permutation_groups import PermutationGroups category = PermutationGroups().FinitelyGenerated().Finite() super(PermutationGroup_generic, self).__init__(category=category) _attribute def _deg(self): if self._gc_numbering: return self.order() else: try: return self._field.degree() except NotImplementedError: return self._field.relative_degree() _attribute def _domain(self): return FiniteEnumeratedSet(range(1, (self._deg + 1))) _attribute def _domain_to_gap(self): return {key: (i + 1) for (i, key) in enumerate(self._domain)} _attribute def _domain_from_gap(self): return {(i + 1): key for (i, key) in enumerate(self._domain)} def ngens(self): return len(self._gens)
def template_match_t2c(target, csv_coords, minrad=minrad_, maxrad=maxrad_, longlat_thresh2=longlat_thresh2_, rad_thresh=rad_thresh_, template_thresh=template_thresh_, target_thresh=target_thresh_, rmv_oor_csvs=0): templ_coords = template_match_t(target, minrad, maxrad, longlat_thresh2, rad_thresh, template_thresh, target_thresh) maxr = 0 if len((templ_coords > 0)): maxr = np.max(templ_coords.T[2]) N_match = 0 frac_dupes = 0 (err_lo, err_la, err_r) = (0, 0, 0) (N_csv, N_detect) = (len(csv_coords), len(templ_coords)) for (lo, la, r) in templ_coords: (Long, Lat, Rad) = csv_coords.T minr = np.minimum(r, Rad) dL = ((((Long - lo) ** 2) + ((Lat - la) ** 2)) / (minr ** 2)) dR = (abs((Rad - r)) / minr) index = ((dR < rad_thresh) & (dL < longlat_thresh2)) index_True = np.where((index == True))[0] N = len(index_True) if (N >= 1): (Lo, La, R) = csv_coords[index_True[0]].T meanr = ((R + r) / 2.0) err_lo += (abs((Lo - lo)) / meanr) err_la += (abs((La - la)) / meanr) err_r += (abs((R - r)) / meanr) if (N > 1): frac_dupes += ((N - 1) / float(len(templ_coords))) N_match += min(1, N) csv_coords = csv_coords[np.where((index == False))] if (len(csv_coords) == 0): break if (rmv_oor_csvs == 1): upper = 15 lower = minrad_ N_large_unmatched = len(np.where(((csv_coords.T[2] > upper) | (csv_coords.T[2] < lower)))[0]) if (N_large_unmatched < N_csv): N_csv -= N_large_unmatched if (N_match >= 1): err_lo = (err_lo / N_match) err_la = (err_la / N_match) err_r = (err_r / N_match) return (N_match, N_csv, N_detect, maxr, err_lo, err_la, err_r, frac_dupes)
class BC5CDRProcessor(DataProcessor): def get_train_examples(self, data_dir): l1 = self._read_data(os.path.join(data_dir, 'train.tsv')) l2 = self._read_data(os.path.join(data_dir, 'devel.tsv')) return self._create_example((l1 + l2), 'train') def get_dev_examples(self, data_dir): return self._create_example(self._read_data(os.path.join(data_dir, 'devel.tsv')), 'dev') def get_test_examples(self, data_dir): return self._create_example(self._read_data(os.path.join(data_dir, 'test.tsv')), 'test') def get_labels(self): return ['B', 'I', 'O'] def _create_example(self, lines, set_type): examples = [] for (i, line) in enumerate(lines): guid = ('%s-%s' % (set_type, i)) text = convert_to_unicode(line[1]) label = convert_to_unicode(line[0]) text = text.split(' ') label = label.split(' ') examples.append(InputExample(guid=guid, words=text, labels=label)) return examples
class LayerTest(unittest.TestCase): def test_activation(self): BaseKerasLayerTest(self, [Activation('linear'), Activation('hard_sigmoid'), Activation('exponential')]).run_test() def test_softplus(self): BaseKerasLayerTest(self, [Activation('softplus'), tf.nn.softplus]).run_test() def test_softsign(self): BaseKerasLayerTest(self, [Activation('softsign'), tf.nn.softsign]).run_test() def test_tanh(self): BaseKerasLayerTest(self, [Activation('tanh'), tf.nn.tanh]).run_test() def test_gelu(self): BaseKerasLayerTest(self, [Activation('gelu'), tf.nn.gelu, partial(tf.nn.gelu, approximate=True)]).run_test() def test_selu(self): BaseKerasLayerTest(self, [Activation('selu'), tf.nn.selu]).run_test() def test_elu(self): BaseKerasLayerTest(self, [Activation('elu'), tf.nn.elu]).run_test() def test_leaky_relu(self): BaseKerasLayerTest(self, [tf.nn.leaky_relu, partial(tf.nn.leaky_relu, alpha=0.5), LeakyReLU(), LeakyReLU(alpha=0.6)]).run_test() def test_relu(self): BaseKerasLayerTest(self, [Activation('relu'), tf.nn.relu, tf.nn.relu6, ReLU(), ReLU(max_value=6, negative_slope=0.001, threshold=1), ReLU(4, 0.001, threshold=0.5), ReLU(2.7)]).run_test() def test_swish(self): BaseKerasLayerTest(self, [tf.nn.swish, tf.nn.silu, Activation('swish')]).run_test() def test_softmax(self): BaseKerasLayerTest(self, [Activation('softmax'), tf.nn.softmax, partial(tf.nn.softmax, axis=1), Softmax(), Softmax(axis=2)]).run_test() def test_sigmoid(self): BaseKerasLayerTest(self, [Activation('sigmoid'), tf.nn.sigmoid]).run_test() def test_zeropadding2d(self): BaseKerasLayerTest(self, [ZeroPadding2D(), ZeroPadding2D(1), ZeroPadding2D((3, 4))]).run_test() def test_upsampling2d(self): BaseKerasLayerTest(self, [UpSampling2D(), UpSampling2D(size=2), UpSampling2D(size=(2, 1)), UpSampling2D(interpolation='bilinear')]).run_test() def test_split(self): BaseKerasLayerTest(self, [partial(tf.split, num_or_size_splits=1), partial(tf.split, num_or_size_splits=2, axis=1)]).run_test() def test_resize(self): BaseKerasLayerTest(self, [partial(tf.image.resize, size=[10, 20]), partial(tf.image.resize, size=[10, 19], preserve_aspect_ratio=False), partial(tf.image.resize, size=[9, 20], preserve_aspect_ratio=True), partial(tf.image.resize, size=[9, 22], method=tf.image.ResizeMethod.NEAREST_NEIGHBOR)]).run_test() def test_reshape(self): BaseKerasLayerTest(self, [Reshape(((- 1),)), Reshape(target_shape=((- 1),)), Reshape(target_shape=(8, 12, 2)), Reshape(target_shape=(64, 3, 1)), partial(tf.reshape, shape=((- 1),)), partial(tf.reshape, shape=(8, 12, 2)), partial(tf.reshape, shape=(64, 3, 1))]).run_test() def test_reduce_sum(self): BaseKerasLayerTest(self, [partial(tf.reduce_sum, axis=0), partial(tf.reduce_sum, axis=1), partial(tf.reduce_sum, axis=0, keepdims=True), partial(tf.reduce_sum, axis=0, keepdims=False)]).run_test() def test_reduce_min(self): BaseKerasLayerTest(self, [partial(tf.reduce_min, axis=0), partial(tf.reduce_min, axis=1), partial(tf.reduce_min, axis=0, keepdims=True), partial(tf.reduce_min, axis=0, keepdims=False)]).run_test() def test_reduce_max(self): BaseKerasLayerTest(self, [partial(tf.reduce_max, axis=0), partial(tf.reduce_max, axis=1), partial(tf.reduce_max, axis=0, keepdims=True), partial(tf.reduce_max, axis=0, keepdims=False)]).run_test() def test_reduce_mean(self): BaseKerasLayerTest(self, [partial(tf.reduce_mean, axis=0), partial(tf.reduce_mean, axis=1), partial(tf.reduce_mean, axis=0, keepdims=True), partial(tf.reduce_mean, axis=0, keepdims=False)]).run_test() def test_prelu(self): BaseKerasLayerTest(self, [PReLU(), PReLU(alpha_initializer='lecun_normalV2'), PReLU(shared_axes=[0, 1]), PReLU(alpha_regularizer=tf.keras.regularizers.L1(0.01))]).run_test() def test_multiply(self): BaseKerasLayerTest(self, [Multiply()], num_of_inputs=3, is_inputs_a_list=True).run_test() def test_math_multiply(self): BaseKerasLayerTest(self, [tf.multiply, partial(tf.multiply, name='mul_test')], num_of_inputs=2).run_test() def test_maxpooling2d(self): BaseKerasLayerTest(self, [MaxPooling2D(), MaxPooling2D(pool_size=(1, 2)), MaxPooling2D(strides=2), MaxPooling2D(padding='same')]).run_test() def test_add(self): BaseKerasLayerTest(self, [Add()], num_of_inputs=3, is_inputs_a_list=True).run_test() def test_math_add(self): BaseKerasLayerTest(self, [tf.add, partial(tf.add, name='add_test')], num_of_inputs=2).run_test() def test_globalaveragepooling2d(self): BaseKerasLayerTest(self, [GlobalAveragePooling2D(), GlobalAveragePooling2D(keepdims=True)]).run_test() def test_flatten(self): BaseKerasLayerTest(self, [Flatten()]).run_test() def test_dropout(self): BaseKerasLayerTest(self, [Dropout(rate=0.2), Dropout(0.3, noise_shape=(8, 2, 3)), Dropout(0.3, noise_shape=(8, 2, 3), seed=2)]).run_test() def test_dot(self): BaseKerasLayerTest(self, [Dot(axes=1), Dot(axes=[2, 1]), Dot(axes=1, normalize=True)], is_inputs_a_list=True, num_of_inputs=2).run_test() def test_depthwiseConv2DTest(self): BaseKerasLayerTest(self, [DepthwiseConv2D(3)]).run_test() def test_dense(self): BaseKerasLayerTest(self, [Dense(2), Dense(1, use_bias=False), Dense(1, kernel_initializer='he_uniformV2')]).run_test() def test_cropping2d(self): BaseKerasLayerTest(self, [Cropping2D(cropping=((1, 2), (2, 2))), Cropping2D(), Cropping2D(2)]).run_test() def test_crop_and_resize(self): boxes = tf.random.uniform(shape=(5, 4)) box_indices = tf.random.uniform(shape=(5,), minval=0, maxval=1, dtype=tf.int32) BaseKerasLayerTest(self, [partial(tf.image.crop_and_resize, boxes=boxes, box_indices=box_indices, crop_size=(22, 19)), partial(tf.image.crop_and_resize, boxes=boxes, box_indices=box_indices, crop_size=(21, 24), method='nearest'), partial(tf.image.crop_and_resize, boxes=boxes, box_indices=box_indices, crop_size=(24, 20), extrapolation_value=0)]).run_test() def test_conv2dtranspose(self): BaseKerasLayerTest(self, [Conv2DTranspose(1, 1)], use_cpu=True).run_test() def test_conv2d(self): BaseKerasLayerTest(self, [Conv2D(1, 1), Conv2D(1, 1, strides=2), Conv2D(1, 1, use_bias=False)]).run_test() def test_concatenate(self): BaseKerasLayerTest(self, [Concatenate(), Concatenate(axis=0), Concatenate(axis=1), partial(tf.concat, axis=0), partial(tf.concat, axis=1)], is_inputs_a_list=True, num_of_inputs=3).run_test() def test_averagepooling2d(self): BaseKerasLayerTest(self, [AveragePooling2D(), AveragePooling2D(pool_size=2), AveragePooling2D(pool_size=(2, 1)), AveragePooling2D(padding='same'), AveragePooling2D(strides=2), AveragePooling2D(strides=(2, 1))]).run_test() def test_combinednms(self): BaseKerasLayerTest(self, [partial(tf.image.combined_non_max_suppression, max_output_size_per_class=5, max_total_size=5)], input_shape=(10, 5, 4)).run_test()
def GetNodeWcc_PUndirNet(Graph, NId, CnCom): return _snap.GetNodeWcc_PUndirNet(Graph, NId, CnCom)
class DataProcessor(ABC): def get_train_examples(self, data_dir) -> List[InputExample]: pass def get_dev_examples(self, data_dir) -> List[InputExample]: pass def get_dev32_examples(self, data_dir) -> List[InputExample]: pass def get_test_examples(self, data_dir) -> List[InputExample]: pass def get_unlabeled_examples(self, data_dir) -> List[InputExample]: pass def get_labels(self) -> List[str]: pass
def sensitivity_index_calc(TPR, FPR): try: return (normal_quantile(TPR) - normal_quantile(FPR)) except TypeError: return 'None'
class HDF5Matrix(object): refs = defaultdict(int) def __init__(self, datapath, dataset, start=0, end=None, normalizer=None): if (h5py is None): raise ImportError('The use of HDF5Matrix requires HDF5 and h5py installed.') if (datapath not in list(self.refs.keys())): f = h5py.File(datapath) self.refs[datapath] = f else: f = self.refs[datapath] self.data = f[dataset] self.start = start if (end is None): self.end = self.data.shape[0] else: self.end = end self.normalizer = normalizer def __len__(self): return (self.end - self.start) def __getitem__(self, key): if isinstance(key, slice): (start, stop) = (key.start, key.stop) if (start is None): start = 0 if (stop is None): stop = self.shape[0] if ((stop + self.start) <= self.end): idx = slice((start + self.start), (stop + self.start)) else: raise IndexError elif isinstance(key, (int, np.integer)): if ((key + self.start) < self.end): idx = (key + self.start) else: raise IndexError elif isinstance(key, np.ndarray): if ((np.max(key) + self.start) < self.end): idx = (self.start + key).tolist() else: raise IndexError elif isinstance(key, list): if ((max(key) + self.start) < self.end): idx = [(x + self.start) for x in key] else: raise IndexError else: raise IndexError if (self.normalizer is not None): return self.normalizer(self.data[idx]) else: return self.data[idx] def shape(self): return (((self.end - self.start),) + self.data.shape[1:]) def dtype(self): return self.data.dtype def ndim(self): return self.data.ndim def size(self): return np.prod(self.shape)
def create_list_stmts(list_graphs): list_stmts = list() for G in list_graphs: edges_list = [e[2]['stmt'] for e in G.edges(data=True)] list_stmts += edges_list return list_stmts
def clean_web_text(st): st = st.replace('<br />', ' ') st = st.replace('&quot;', '"') st = st.replace('<p>', ' ') if ('<a href=' in st): while ('<a href=' in st): start_pos = st.find('<a href=') end_pos = st.find('>', start_pos) if (end_pos != (- 1)): st = (st[:start_pos] + st[(end_pos + 1):]) else: print('incomplete href') print('before', st) st = (st[:start_pos] + st[(start_pos + len('<a href='))]) print('after', st) st = st.replace('</a>', '') while (' ' in st): st = st.replace(' ', ' ') return st
class Tree(object): def __init__(self): self.parent = None self.num_children = 0 self.children = list() def add_child(self, child): child.parent = self self.num_children += 1 self.children.append(child) def size(self): if getattr(self, '_size'): return self._size count = 1 for i in xrange(self.num_children): count += self.children[i].size() self._size = count return self._size def depth(self): if getattr(self, '_depth'): return self._depth count = 0 if (self.num_children > 0): for i in xrange(self.num_children): child_depth = self.children[i].depth() if (child_depth > count): count = child_depth count += 1 self._depth = count return self._depth def __iter__(self): (yield self) for c in self.children: for x in c: (yield x)
def write(file_path: str, content: str): hlog(f'Writing {len(content)} characters to {file_path}') with open(file_path, 'w') as f: f.write(content)
def slot_edit_f1_full(hypothesis: List[str], groundtruth: List[str], **kwargs) -> float: return slot_edit_f1(hypothesis, groundtruth, loop_over_all_slot=True, **kwargs)
def calc_gradient_penalty(netD, real_data, fake_data, input_att): alpha = torch.rand(opt.batch_size, 1) alpha = alpha.expand(real_data.size()) if opt.cuda: alpha = alpha.cuda() interpolates = ((alpha * real_data) + ((1 - alpha) * fake_data)) if opt.cuda: interpolates = interpolates.cuda() interpolates = Variable(interpolates, requires_grad=True) disc_interpolates = netD(interpolates, Variable(input_att)) ones = torch.ones(disc_interpolates.size()) if opt.cuda: ones = ones.cuda() gradients = autograd.grad(outputs=disc_interpolates, inputs=interpolates, grad_outputs=ones, create_graph=True, retain_graph=True, only_inputs=True)[0] gradient_penalty = (((gradients.norm(2, dim=1) - 1) ** 2).mean() * opt.lambda1) return gradient_penalty
def compute_hessian_vector_products(device: torch.device, n_gpu: int, model: torch.nn.Module, inputs: Dict[(str, torch.Tensor)], vectors: torch.FloatTensor, params_filter: Optional[List[str]], weight_decay: Optional[float], weight_decay_ignores: Optional[List[str]]) -> List[torch.FloatTensor]: if (params_filter is None): params_filter = [] model.zero_grad() loss = get_loss_with_weight_decay(model=model, n_gpu=n_gpu, device=device, inputs=inputs, weight_decay=weight_decay, weight_decay_ignores=weight_decay_ignores) grad_tuple = torch.autograd.grad(outputs=loss, inputs=[param for (name, param) in model.named_parameters() if (name not in params_filter)], create_graph=True) model.zero_grad() grad_grad_tuple = torch.autograd.grad(outputs=grad_tuple, inputs=[param for (name, param) in model.named_parameters() if (name not in params_filter)], grad_outputs=vectors, only_inputs=True) return grad_grad_tuple
class CSRNet(nn.Module): def __init__(self, load_weights=False): super(CSRNet, self).__init__() self.seen = 0 self.frontend_feat = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512] self.backend_feat = [512, 512, 512, 256, 128, 64] self.frontend = make_layers(self.frontend_feat) self.backend = make_layers(self.backend_feat, in_channels=512, dilation=True) self.output_layer = nn.Conv2d(64, 1, kernel_size=1) if (not load_weights): mod = models.vgg16(pretrained=True) self._initialize_weights() for i in range(len(self.frontend.state_dict().items())): list(self.frontend.state_dict().items())[i][1].data[:] = list(mod.state_dict().items())[i][1].data[:] def forward(self, x): x = self.frontend(x) x = self.backend(x) x = self.output_layer(x) return x def _initialize_weights(self): for m in self.modules(): if isinstance(m, nn.Conv2d): nn.init.normal_(m.weight, std=0.01) if (m.bias is not None): nn.init.constant_(m.bias, 0) elif isinstance(m, nn.BatchNorm2d): nn.init.constant_(m.weight, 1) nn.init.constant_(m.bias, 0)
class BERTAdam(Optimizer): def __init__(self, params, lr, warmup=(- 1), t_total=(- 1), schedule='warmup_linear', b1=0.9, b2=0.999, e=1e-06, weight_decay_rate=0.01, max_grad_norm=1.0): if (not (lr >= 0.0)): raise ValueError('Invalid learning rate: {} - should be >= 0.0'.format(lr)) if (schedule not in SCHEDULES): raise ValueError('Invalid schedule parameter: {}'.format(schedule)) if ((not (0.0 <= warmup < 1.0)) and (not (warmup == (- 1)))): raise ValueError('Invalid warmup: {} - should be in [0.0, 1.0[ or -1'.format(warmup)) if (not (0.0 <= b1 < 1.0)): raise ValueError('Invalid b1 parameter: {} - should be in [0.0, 1.0['.format(b1)) if (not (0.0 <= b2 < 1.0)): raise ValueError('Invalid b2 parameter: {} - should be in [0.0, 1.0['.format(b2)) if (not (e >= 0.0)): raise ValueError('Invalid epsilon value: {} - should be >= 0.0'.format(e)) defaults = dict(lr=lr, schedule=schedule, warmup=warmup, t_total=t_total, b1=b1, b2=b2, e=e, weight_decay_rate=weight_decay_rate, max_grad_norm=max_grad_norm) super(BERTAdam, self).__init__(params, defaults) def get_lr(self): lr = [] for group in self.param_groups: for p in group['params']: state = self.state[p] if (len(state) == 0): return [0] if (group['t_total'] != (- 1)): schedule_fct = SCHEDULES[group['schedule']] lr_scheduled = (group['lr'] * schedule_fct((state['step'] / group['t_total']), group['warmup'])) else: lr_scheduled = group['lr'] lr.append(lr_scheduled) return lr def step(self, closure=None): loss = None if (closure is not None): loss = closure() for group in self.param_groups: for p in group['params']: if (p.grad is None): continue grad = p.grad.data if grad.is_sparse: raise RuntimeError('Adam does not support sparse gradients, please consider SparseAdam instead') state = self.state[p] if (len(state) == 0): state['step'] = 0 state['next_m'] = torch.zeros_like(p.data) state['next_v'] = torch.zeros_like(p.data) (next_m, next_v) = (state['next_m'], state['next_v']) (beta1, beta2) = (group['b1'], group['b2']) if (group['max_grad_norm'] > 0): clip_grad_norm_(p, group['max_grad_norm']) next_m.mul_(beta1).add_((1 - beta1), grad) next_v.mul_(beta2).addcmul_((1 - beta2), grad, grad) update = (next_m / (next_v.sqrt() + group['e'])) if (group['weight_decay_rate'] > 0.0): update += (group['weight_decay_rate'] * p.data) if (group['t_total'] != (- 1)): schedule_fct = SCHEDULES[group['schedule']] lr_scheduled = (group['lr'] * schedule_fct((state['step'] / group['t_total']), group['warmup'])) else: lr_scheduled = group['lr'] update_with_lr = (lr_scheduled * update) p.data.add_((- update_with_lr)) state['step'] += 1 return loss
def get_row_entities(table, row_index, bridge_entity_name): row_entities = [] for (c_ind, col) in enumerate(table['data'][row_index]): name = col[0] if (not (name == bridge_entity_name)): if (len(table['data'][row_index][c_ind][1]) > 0): row_entities.append({'name': name, 'loc': [row_index, c_ind, 0], 'url': table['data'][row_index][c_ind][1][0]}) else: row_entities.append({'name': name, 'loc': [row_index, c_ind, 0], 'url': None}) return row_entities
def save_config(input_dict): try: input_dict_temp = input_dict.copy() input_dict_temp['engine'] = 'pyrgg' input_dict_temp['pyrgg_version'] = pyrgg.params.PYRGG_VERSION input_dict_temp['output_format'] = pyrgg.params.OUTPUT_FORMAT[input_dict_temp['output_format']] fname = pyrgg.params.CONFIG_FILE_FORMAT.format(input_dict_temp['file_name']) with open(fname, 'w') as json_file: json_dump(input_dict_temp, json_file, indent=2) return os.path.abspath(fname) except BaseException: print(pyrgg.params.PYRGG_CONFIG_SAVE_ERROR_MESSAGE)
class AttentionSaverMNIST(): def __init__(self, output_directory, ats_model, dataset, opts): self.dir = output_directory os.makedirs(self.dir, exist_ok=True) self.ats_model = ats_model self.opts = opts idxs = [random.randrange(0, (len(dataset) - 1)) for _ in range(9)] data = [dataset[i] for i in idxs] self.x_low = torch.stack([d[0] for d in data]).cpu() self.x_high = torch.stack([d[1] for d in data]).cpu() self.label = torch.LongTensor([d[2] for d in data]).numpy() self.writer = SummaryWriter(os.path.join(self.dir, opts.run_name), flush_secs=2) self.__call__((- 1)) def __call__(self, epoch, losses=None, metrics=None): opts = self.opts with torch.no_grad(): (_, att, patches, x_low) = self.ats_model(self.x_low.to(opts.device), self.x_high.to(opts.device)) att = att.unsqueeze(1) att = F.interpolate(att, size=(x_low.shape[(- 2)], x_low.shape[(- 1)])) att = att.cpu() grid = torchvision.utils.make_grid(att, nrow=3, normalize=True, scale_each=True, pad_value=1.0) self.writer.add_image('attention_map', grid, epoch, dataformats='CHW') if (metrics is not None): (train_metrics, test_metrics) = metrics self.writer.add_scalar('Accuracy/Train', train_metrics['accuracy'], epoch) self.writer.add_scalar('Accuracy/Test', test_metrics['accuracy'], epoch) if (losses is not None): (train_loss, test_loss) = losses self.writer.add_scalar('Loss/Train', train_loss, epoch) self.writer.add_scalar('Loss/Test', test_loss, epoch)
def _dump_date(d, delim): if (d is None): d = gmtime() elif isinstance(d, datetime): d = d.utctimetuple() elif isinstance(d, (integer_types, float)): d = gmtime(d) return ('%s, %02d%s%s%s%04d %02d:%02d:%02d GMT' % (('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')[d.tm_wday], d.tm_mday, delim, ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')[(d.tm_mon - 1)], delim, d.tm_year, d.tm_hour, d.tm_min, d.tm_sec))
class MiniBatchLogisticRegression(): lambda_: float alpha: float dim: int random_state: Optional[int] = None def __post_init__(self) -> None: self._m = np.zeros(self.dim) self._q = (np.ones(self.dim) * self.lambda_) self.random_ = check_random_state(self.random_state) def loss(self, w: np.ndarray, *args) -> float: (X, y) = args return ((0.5 * (self._q * (w - self._m)).dot((w - self._m))) + np.log((1 + np.exp(((- y) * w.dot(X.T))))).sum()) def grad(self, w: np.ndarray, *args) -> np.ndarray: (X, y) = args return ((self._q * (w - self._m)) + ((- 1) * ((y * X.T) / (1.0 + np.exp((y * w.dot(X.T))))).T.sum(axis=0))) def sample(self) -> np.ndarray: return self.random_.normal(self._m, self.sd(), size=self.dim) def fit(self, X: np.ndarray, y: np.ndarray): self._m = minimize(self.loss, self._m, args=(X, y), jac=self.grad, method='L-BFGS-B', options={'maxiter': 20, 'disp': False}).x P = ((1 + np.exp((1 + X.dot(self._m)))) ** (- 1)) self._q = (self._q + (P * (1 - P)).dot((X ** 2))) def sd(self) -> np.ndarray: return (self.alpha * (self._q ** (- 1.0))) def predict_proba(self, X: np.ndarray) -> np.ndarray: return sigmoid(X.dot(self._m)) def predict_proba_with_sampling(self, X: np.ndarray) -> np.ndarray: return sigmoid(X.dot(self.sample()))
def preprocess(videos, target_resolution): videos_shape = videos.shape.as_list() all_frames = tf.reshape(videos, ([(- 1)] + videos_shape[(- 3):])) resized_videos = tf.image.resize_bilinear(all_frames, size=target_resolution) target_shape = (([videos_shape[0], (- 1)] + list(target_resolution)) + [3]) output_videos = tf.reshape(resized_videos, target_shape) scaled_videos = (((2.0 * tf.cast(output_videos, tf.float32)) / 255.0) - 1) return scaled_videos
class LazyDirichletSeries(LazyModuleElement): def is_unit(self): if self.is_zero(): return False return self[1].is_unit() def valuation(self): if isinstance(self._coeff_stream, Stream_zero): return self._coeff_stream.order() from sage.functions.log import log return log(ZZ(self._coeff_stream.order())) def _mul_(self, other): P = self.parent() left = self._coeff_stream right = other._coeff_stream if isinstance(left, Stream_zero): return self if isinstance(right, Stream_zero): return other if (isinstance(left, Stream_exact) and (not left._constant) and (left._initial_coefficients == (P._internal_poly_ring.base_ring().one(),)) and (left.order() == 1)): return other if (isinstance(right, Stream_exact) and (not right._constant) and (right._initial_coefficients == (P._internal_poly_ring.base_ring().one(),)) and (right.order() == 1)): return self coeff = Stream_dirichlet_convolve(left, right, P.is_sparse()) return P.element_class(P, coeff) def __invert__(self): P = self.parent() return P.element_class(P, Stream_dirichlet_invert(self._coeff_stream, P.is_sparse())) def __call__(self, p): P = self.parent() coeff_stream = self._coeff_stream if isinstance(coeff_stream, Stream_exact): from sage.rings.cc import CC if (not coeff_stream._constant): try: return sum(((self[k] * (~ (ZZ(k) ** p))) for k in range(1, coeff_stream._degree))) except (ValueError, TypeError, ArithmeticError): pass elif (p in CC): from sage.functions.transcendental import zeta C = coeff_stream._constant ret = sum((((self[k] - C) * (~ (ZZ(k) ** p))) for k in range(1, coeff_stream._degree))) return (ret + (C * zeta(p))) R = PolynomialRing(ZZ, P.variable_name()) p = R(p) if (p.degree() != 1): raise ValueError('the argument must be a linear polynomial of degree 1 with integer coefficients') (b, a) = p if (a < 0): raise ValueError('the leading coefficient must be positive') def coefficient(m): m = ZZ(m) try: n = m.nth_root(a) return (coeff_stream[n] * (n ** (- b))) except ValueError: return ZZ.zero() R = P._internal_poly_ring.base_ring() return P.element_class(P, Stream_function(coefficient, P._sparse, 1)) def _format_series(self, formatter, format_strings=False): P = self.parent() cs = self._coeff_stream v = cs._approximate_order if isinstance(cs, Stream_exact): if (not cs._constant): m = cs._degree else: m = (cs._degree + P.options.constant_length) else: m = (v + P.options.display_length) atomic_repr = P._internal_poly_ring.base_ring()._repr_option('element_is_atomic') mons = [P._monomial(self[i], i) for i in range(v, m) if self[i]] if ((not isinstance(cs, Stream_exact)) or cs._constant): if (P._internal_poly_ring.base_ring() is P.base_ring()): bigO = [('O(%s)' % P._monomial(1, m))] else: bigO = [('O(%s)^%s' % (', '.join((str(g) for g in P._names)), m))] else: bigO = [] from sage.misc.latex import latex from sage.typeset.unicode_art import unicode_art from sage.typeset.ascii_art import ascii_art from sage.misc.repr import repr_lincomb if (formatter == repr): poly = repr_lincomb([(1, mo) for mo in (mons + bigO)], strip_one=True) elif (formatter == latex): poly = repr_lincomb([(1, mo) for mo in (mons + bigO)], is_latex=True, strip_one=True) elif (formatter in [ascii_art, unicode_art]): if (formatter == ascii_art): from sage.typeset.symbols import ascii_left_parenthesis as left_paren from sage.typeset.symbols import ascii_right_parenthesis as right_paren else: from sage.typeset.symbols import unicode_left_parenthesis as left_paren from sage.typeset.symbols import unicode_right_parenthesis as right_paren if atomic_repr: poly = formatter(*(mons + bigO), sep=' + ') else: def parenthesize(m): a = formatter(m) h = a.height() return formatter(left_paren.character_art(h), a, right_paren.character_art(h)) poly = formatter(*([parenthesize(mo) for mo in mons] + bigO), sep=' + ') return poly
class Caffe2Rep(BackendRep): def __init__(self, init_net, predict_net, workspace, uninitialized): super(Caffe2Rep, self).__init__() self.init_net = init_net self.predict_net = predict_net self.workspace = workspace self.uninitialized = uninitialized self.nets_created = False self.ran_init_net = False def _name_scope(self): if (self.predict_net.device_option.device_type == caffe2_pb2.CUDA): return 'gpu_{}'.format(self.predict_net.device_option.device_id) return '' def run(self, inputs, **kwargs): super(Caffe2Rep, self).run(inputs, **kwargs) with core.DeviceScope(self.predict_net.device_option): if isinstance(inputs, dict): with core.NameScope(self._name_scope): for (key, value) in inputs.items(): self.workspace.FeedBlob(key, value) elif (isinstance(inputs, list) or isinstance(inputs, tuple)): if (len(self.uninitialized) != len(inputs)): raise RuntimeError('Expected {} values for uninitialized graph inputs ({}), but got {}.'.format(len(self.uninitialized), ', '.join(self.uninitialized), len(inputs))) for (i, value) in enumerate(inputs): self.workspace.FeedBlob(self.uninitialized[i], value) else: self.workspace.FeedBlob(self.uninitialized[0], inputs) if (not self.nets_created): self.workspace.CreateNet(self.init_net) self.workspace.CreateNet(self.predict_net) self.nets_created = True if (not self.ran_init_net): self.workspace.RunNet(self.init_net.name) self.ran_init_net = True self.workspace.RunNet(self.predict_net.name) output_values = [] for name in self.predict_net.external_output: try: output_values.append(self.workspace.FetchBlob(name)) except Exception: output_values.append(self.workspace.FetchInt8Blob(name)) return namedtupledict('Outputs', self.predict_net.external_output)(*output_values)
def _is_gzip(filename: str) -> bool: return (filename.endswith('.gz') and (not filename.endswith('.tar.gz')))
class OptimWithSheduler(): def __init__(self, optimizer, scheduler_func): self.optimizer = optimizer self.scheduler_func = scheduler_func self.global_step = 0.0 for g in self.optimizer.param_groups: g['initial_lr'] = g['lr'] def zero_grad(self): self.optimizer.zero_grad() def step(self): for g in self.optimizer.param_groups: g['lr'] = self.scheduler_func(step=self.global_step, initial_lr=g['initial_lr']) self.optimizer.step() self.global_step += 1
def test_time_bin_update(): tl = Timeline() detectors = ([{}] * 2) bsm = make_bsm('bsm', tl, encoding_type='time_bin', detectors=detectors) parent = Parent() bsm.attach(parent) detector_list = bsm.detectors bsm.trigger(detector_list[0], {'time': 0}) bsm.trigger(detector_list[0], {'time': (0 + time_bin['bin_separation'])}) assert (len(parent.results) == 1) assert (parent.results[0] == 0) bsm.trigger(detector_list[0], {'time': 1000000.0}) bsm.trigger(detector_list[1], {'time': (1000000.0 + time_bin['bin_separation'])}) assert (len(parent.results) == 2) assert (parent.results[1] == 1) bsm.trigger(detector_list[0], {'time': 2000000.0}) bsm.trigger(detector_list[0], {'time': 2000000.0}) assert (len(parent.results) == 2) bsm.trigger(detector_list[0], {'time': 3000000.0}) bsm.trigger(detector_list[0], {'time': 4000000.0}) assert (len(parent.results) == 2)
_REGISTRY.register() class ImageNet(DatasetBase): dataset_dir = 'imagenet' def __init__(self, cfg): root = os.path.abspath(os.path.expanduser(cfg.DATASET.ROOT)) self.dataset_dir = os.path.join(root, self.dataset_dir) self.image_dir = self.dataset_dir self.preprocessed = os.path.join(self.dataset_dir.replace('group', 'sheng'), 'preprocessed.pkl') self.split_fewshot_dir = os.path.join(self.dataset_dir.replace('group', 'sheng'), 'split_fewshot') mkdir_if_missing(self.split_fewshot_dir) if os.path.exists(self.preprocessed): with open(self.preprocessed, 'rb') as f: preprocessed = pickle.load(f) train = preprocessed['train'] test = preprocessed['test'] else: text_file = './scripts/classnames.txt' classnames = self.read_classnames(text_file) train = self.read_data(classnames, 'train') test = self.read_data(classnames, 'val') preprocessed = {'train': train, 'test': test} with open(self.preprocessed, 'wb') as f: pickle.dump(preprocessed, f, protocol=pickle.HIGHEST_PROTOCOL) num_shots = cfg.DATASET.NUM_SHOTS if (num_shots >= 1): seed = cfg.SEED preprocessed = os.path.join(self.split_fewshot_dir, f'shot_{num_shots}-seed_{seed}.pkl') if os.path.exists(preprocessed): print(f'Loading preprocessed few-shot data from {preprocessed}') with open(preprocessed, 'rb') as file: data = pickle.load(file) train = data['train'] else: train = self.generate_fewshot_dataset(train, num_shots=num_shots) data = {'train': train} print(f'Saving preprocessed few-shot data to {preprocessed}') with open(preprocessed, 'wb') as file: pickle.dump(data, file, protocol=pickle.HIGHEST_PROTOCOL) subsample = cfg.DATASET.SUBSAMPLE_CLASSES (train, test) = OxfordPets.subsample_classes(train, test, subsample=subsample) super().__init__(train_x=train, val=test, test=test) def read_classnames(text_file): classnames = OrderedDict() with open(text_file, 'r') as f: lines = f.readlines() for line in lines: line = line.strip().split(' ') folder = line[0] classname = ' '.join(line[1:]) classnames[folder] = classname return classnames def read_data(self, classnames, split_dir): split_dir = os.path.join(self.image_dir, split_dir) folders = sorted((f.name for f in os.scandir(split_dir) if f.is_dir())) items = [] for (label, folder) in enumerate(folders): imnames = listdir_nohidden(os.path.join(split_dir, folder)) classname = classnames[folder] for imname in imnames: impath = os.path.join(split_dir, folder, imname) item = Datum(impath=impath, label=label, classname=classname) items.append(item) return items
def CreatePythonOperator(f, inputs, outputs, grad_f=None, pass_workspace=False, python_func_type=None, *args, **kwargs): kwargs['token'] = _RegisterPythonImpl(f, grad_f, python_func_type, pass_workspace=pass_workspace) return CreateOperator('Python', inputs, outputs, *args, **kwargs)
def get_solc_version(with_commit_hash: bool=False) -> Version: solc_binary = get_executable() return wrapper._get_solc_version(solc_binary, with_commit_hash)
class Rules(Common): def __init__(self, log_level=Log.error): self.LogLevel = log_level '\n All rules are heuristics; there is no theoretical background.\n ' def __rule1(self, plan): if ((plan['CurrentState'] == State.RUNNING) and (plan['Node Type'] == 'Hash Join') and ('Join Filter' in plan)): if (plan['Plan Rows'] <= plan['Actual Rows']): for p in plan['Plans']: p['CurrentState'] = State.FINISHED def __rule2(self, plan): if ((((plan['CurrentState'] == State.RUNNING) and (plan['Node Type'] == 'Materialize')) or (plan['Node Type'] == 'Hash')) and ((plan['Actual Loops'] > 0) or (plan['Actual Rows'] > 0) or (plan['MergeFlag'] == 'True'))): plan['CurrentState'] = State.FINISHED def __rule3(self, plan): if ((plan['CurrentState'] == State.RUNNING) and self.isScan(plan) and (self.isInner(plan) and (plan['Actual Loops'] > 0))): plan['CurrentState'] = State.FINISHED def __rule4(self, plan): if ((plan['CurrentState'] == State.RUNNING) and self.isScan(plan) and self.isOuter(plan) and (plan['Plan Rows'] <= plan['Actual Rows'])): plan['CurrentState'] = State.FINISHED def __rule5(self, plan): if ((plan['CurrentState'] == State.RUNNING) and self.isScan(plan) and ((self.isOuter(plan) == False) and (self.isInner(plan) == False))): plan['CurrentState'] = State.FINISHED def __rule6(self, plan): if ((plan['CurrentState'] == State.RUNNING) and ((plan['Node Type'] == 'Hash Join') or (plan['Node Type'] == 'Merge Join')) and ('Join Filter' not in plan)): if ((plan['Plan Rows'] * 5) < plan['Actual Rows']): for p in plan['Plans']: if (p['Parent Relationship'] == 'Outer'): plan['Plan Rows'] = p['Plan Rows'] def __op(self, Plans): if isinstance(Plans, list): for plan in Plans: for r in self.rules: r(plan) if ('Plans' in plan): self.__op(plan['Plans']) return else: for r in self.rules: r(Plans) if ('Plans' in Plans): self.__op(Plans['Plans']) return '\n Public method\n ' def apply_rules(self, plans): self.rules = [self.__rule1, self.__rule2, self.__rule3, self.__rule4, self.__rule5, self.__rule6] self.__op(plans)
def test_colormap_max(pyplot): gray = pyplot.get_cmap('gray', 1024) confusion_matrix = np.array([[1.0, 0.0], [0.0, 1.0]]) disp = ConfusionMatrixDisplay(confusion_matrix) disp.plot(cmap=gray) color = disp.text_[(1, 0)].get_color() assert_allclose(color, [1.0, 1.0, 1.0, 1.0])
def get_result(query): (train_loss, val_loss, test_loss, train_acc, val_acc, test_acc, train_cl_loss, val_cl_loss, test_cl_loss, train_cl_acc, val_cl_acc, test_cl_acc) = get_latest_data(query) last_ret = {'trLss': train_loss[(- 1)], 'vaLss': val_loss[(- 1)], 'teLss': test_loss[(- 1)], 'trAcc': train_acc[(- 1)], 'vaAcc': val_acc[(- 1)], 'teAcc': test_acc[(- 1)]} last_cl_ret = {'trLss': train_cl_loss[(- 1)], 'vaLss': val_cl_loss[(- 1)], 'teLss': test_cl_loss[(- 1)], 'trAcc': train_cl_acc[(- 1)], 'vaAcc': val_cl_acc[(- 1)], 'teAcc': test_cl_acc[(- 1)]} i_es = np.argmax(val_acc) es_ret = {'trLss': train_loss[i_es], 'vaLss': val_loss[i_es], 'teLss': test_loss[i_es], 'trAcc': train_acc[i_es], 'vaAcc': val_acc[i_es], 'teAcc': test_acc[i_es]} i_cl_es = np.argmax(val_cl_acc) es_cl_ret = {'trLss': train_cl_loss[i_cl_es], 'vaLss': val_cl_loss[i_cl_es], 'teLss': test_cl_loss[i_cl_es], 'trAcc': train_cl_acc[i_cl_es], 'vaAcc': val_cl_acc[i_cl_es], 'teAcc': test_cl_acc[i_cl_es]} return (last_ret, last_cl_ret, es_ret, es_cl_ret)
class HparamsVQGAN(HparamsBase): def __init__(self, dataset): super().__init__(dataset) self.base_lr = 4.5e-06 self.beta = 0.25 self.diff_aug = False self.gumbel_kl_weight = 1e-08 self.gumbel_straight_through = False self.quantizer = 'nearest' if ((self.dataset == 'churches') or (self.dataset == 'bedrooms')): self.attn_resolutions = [16] self.batch_size = 3 self.ch_mult = [1, 1, 2, 2, 4] self.codebook_size = 1024 self.disc_layers = 3 self.disc_weight_max = 1 self.disc_start_step = 30001 self.emb_dim = 256 self.img_size = 256 self.latent_shape = [1, 16, 16] self.n_channels = 3 self.ndf = 64 self.nf = 128 self.perceptual_weight = 1.0 self.res_blocks = 2 elif (self.dataset == 'ffhq'): self.attn_resolutions = [16] self.batch_size = 3 self.ch_mult = [1, 1, 2, 2, 4] self.codebook_size = 1024 self.disc_layers = 3 self.disc_weight_max = 1 self.disc_start_step = 30001 self.emb_dim = 256 self.img_size = 256 self.latent_shape = [1, 16, 16] self.n_channels = 3 self.ndf = 64 self.nf = 128 self.perceptual_weight = 1.0 self.res_blocks = 2 else: raise KeyError(f'Defaults not defined for VQGAN model on dataset: {self.dataset}')
class BatchInfo(): class VirtualDimBase(object): def short_repr(self): raise NotImplementedError def __repr__(self): return ('%s{%s}' % (self.__class__.__name__, self.short_repr())) class FixedDim(VirtualDimBase): def __init__(self, size: Union[(tf.Tensor, int)], dim_tag: Optional[Dim]=None): self.size = size self.dim_tag = dim_tag def short_repr(self): if isinstance(self.size, int): return ('F(%i)' % self.size) return 'F(?)' class GlobalBatchDim(FixedDim): def __init__(self, size: Union[(tf.Tensor, int)], dim_tag: Optional[Dim]=None): if (not dim_tag): dim_tag = batch_dim super().__init__(size=size, dim_tag=dim_tag) def short_repr(self): if (isinstance(self.size, int) and (self.size >= 0)): return ('B(%i)' % self.size) return 'B' class BeamDim(FixedDim): def __init__(self, beam): super(BatchInfo.BeamDim, self).__init__(size=beam.beam_size) self.beam = beam def short_repr(self): return ('Beam{%r}(%s)' % (self.beam.name, self.size)) class PaddedDim(FixedDim): def __init__(self, dim_tag): super(BatchInfo.PaddedDim, self).__init__(size=dim_tag.get_dim_value()) self.dim_tag = dim_tag def short_repr(self): return ('Padded{%r}' % self.dim_tag.description) class PackedDim(VirtualDimBase): def __init__(self, dim_tag, key_axes): self.dim_tag = dim_tag self.key_axes = key_axes def sizes(self): assert (self.dim_tag.dyn_size is not None) return self.dim_tag.dyn_size def short_repr(self): return ('Packed{%r}' % (self.dim_tag.description,)) def __init__(self, base, new_dim, new_dim_index=None): self.base = base virtual_dims = (list(base.virtual_dims) if base else []) if new_dim: if (new_dim_index is None): assert (not virtual_dims) new_dim_index = 0 if (new_dim_index < 0): assert (new_dim_index == (- 1)) virtual_dims.append(new_dim) else: virtual_dims.insert(new_dim_index, new_dim) self.virtual_dims = virtual_dims self._dim = None self.batch_dim_tag: Optional[Dim] = None if ((not base) and isinstance(new_dim, BatchInfo.GlobalBatchDim)): self.batch_dim_tag = new_dim.dim_tag else: self.batch_dim_tag = Dim(kind=Dim.Types.Batch, description=('batch:%s' % self.short_repr()), batch=self, dimension=self.static_dim) self._global_beam_dims_by_beam_name = {} self._global_padded_dims_by_dim_tag = {} self._packed_dims_by_dim_tag = {} self.descendants = [] self._descendants_by_beam_name = {} self._global_descendants_by_virtual_dims = {} if base: base.descendants.append(self) if isinstance(new_dim, BatchInfo.BeamDim): beam = new_dim.beam assert (beam.name not in base._descendants_by_beam_name) base._descendants_by_beam_name[beam.name] = self global_base = self.get_global_base() assert (tuple(self.virtual_dims) not in global_base._global_descendants_by_virtual_dims) global_base._global_descendants_by_virtual_dims[tuple(self.virtual_dims)] = self def make_global_batch_info(cls, batch_dim): return BatchInfo(base=None, new_dim=BatchInfo.GlobalBatchDim(size=batch_dim)) _global_broadcast_batch = None def make_global_broadcast_batch_info(cls): if cls._global_broadcast_batch: return cls._global_broadcast_batch cls._global_broadcast_batch = BatchInfo(base=None, new_dim=None) return cls._global_broadcast_batch def get_common_batch_info(cls, batches): if (not batches): return None if (len(batches) == 1): return batches[0] batches_ = [] for batch in batches: if (batch and (batch not in batches_)): batches_.append(batch) batches = batches_ if (not batches_): return None if (len(batches) == 1): return batches[0] base = batches[0].get_global_base() all_virtual_dims = [] for batch in batches: for dim in batch.virtual_dims: if (dim not in all_virtual_dims): same_type_last_idx = None for (i, dim_) in enumerate(all_virtual_dims): if (type(dim_) == type(dim)): same_type_last_idx = i if (same_type_last_idx is not None): all_virtual_dims.insert((same_type_last_idx + 1), dim) else: all_virtual_dims.append(dim) for batch in batches: if (set(batch.virtual_dims) == set(all_virtual_dims)): return batch global_batch_dims = [dim for dim in all_virtual_dims if isinstance(dim, BatchInfo.GlobalBatchDim)] assert (len(global_batch_dims) == 1) global_batch_dim = global_batch_dims[0] assert (base.virtual_dims == [global_batch_dim]) beams = [dim for dim in all_virtual_dims if isinstance(dim, BatchInfo.BeamDim)] if beams: base = base.copy_extend_with_beam(SearchBeam.get_combined_beam(*(b.beam for b in beams))) dim_idx = 0 for dim in all_virtual_dims: if (dim in global_batch_dims): dim_idx += (1 + len(beams)) continue if (dim in beams): continue base = base._copy_extend_dim(new_dim=dim, new_dim_idx=dim_idx) dim_idx += 1 return base def __repr__(self): return ('BatchInfo{%s}' % ', '.join([dim.short_repr() for dim in self.virtual_dims])) def short_repr(self): return '&'.join(([dim.short_repr() for dim in self.virtual_dims] or ['Bx'])) def __getstate__(self): raise Exception(('Pickling of BatchInfo is not supported. (%s)' % self)) def dim(self): if (self._dim is not None): return self._dim if (not self.virtual_dims): return 1 if (len(self.virtual_dims) == 1): dim = self.virtual_dims[0] assert isinstance(dim, BatchInfo.FixedDim) return dim.size from returnn.tf.util.basic import same_control_flow_ctx, optional_mul if all((isinstance(dim, BatchInfo.FixedDim) for dim in self.virtual_dims)): dims = self.virtual_dims sizes = [dim.size for dim in dims] with same_control_flow_ctx(sizes): value = optional_mul(*sizes) self._dim = value return value if all((isinstance(dim, (BatchInfo.PackedDim, BatchInfo.GlobalBatchDim)) for dim in self.virtual_dims)): dims = [dim for dim in self.virtual_dims if isinstance(dim, BatchInfo.PackedDim)] if (len(dims) > 1): raise NotImplementedError(('%s: currently only support one packed dim but have %r' % (self, dims))) (dim,) = dims assert isinstance(dim, BatchInfo.PackedDim) with same_control_flow_ctx(dim.dim_tag.dyn_size_ext.placeholder): value = tf.reduce_sum(dim.dim_tag.dyn_size_ext.placeholder) self._dim = value return value raise NotImplementedError(('%r.dim()' % self)) def dim(self, value): assert (len(self.virtual_dims) == 1) dim = self.virtual_dims[0] assert isinstance(dim, BatchInfo.GlobalBatchDim) dim.size = value if dim.dim_tag: dim.dim_tag.capacity = dim.dim_tag.size = (value if (isinstance(value, int) and (value > 0)) else None) self._dim = value def static_dim(self): if (self._dim is not None): return (self._dim if isinstance(self._dim, int) else None) if (not self.virtual_dims): return 1 if (len(self.virtual_dims) == 1): dim = self.virtual_dims[0] assert isinstance(dim, BatchInfo.FixedDim) return (dim.size if isinstance(dim.size, int) else None) from functools import reduce from operator import mul if all((isinstance(dim, BatchInfo.FixedDim) for dim in self.virtual_dims)): dims = self.virtual_dims sizes = [dim.size for dim in dims] if all((isinstance(s, int) for s in sizes)): return reduce(mul, sizes, 1) return None return None def beam(self): beams = [dim for dim in self.virtual_dims if isinstance(dim, BatchInfo.BeamDim)] if beams: return beams[0].beam return None def get_base_chain(self): bases = [] base = self.base while base: bases.append(base) base = base.base return bases def get_global_base(self): if (not self.base): return self return self.get_base_chain()[(- 1)] def get_global_batch_dim(self): global_beam_dims = [dim for dim in self.virtual_dims if isinstance(dim, BatchInfo.GlobalBatchDim)] assert (len(global_beam_dims) == 1) return global_beam_dims[0] def is_global_batch(self): global_beam_dims = [dim for dim in self.virtual_dims if isinstance(dim, BatchInfo.GlobalBatchDim)] return ((len(global_beam_dims) == 1) and (len(self.virtual_dims) == 1)) def is_broadcast(self): return (len(self.virtual_dims) == 0) def _make_beam_dim(self, beam): assert self.virtual_dims root = self.get_global_base() if (beam.name in root._global_beam_dims_by_beam_name): return root._global_beam_dims_by_beam_name[beam.name] new_dim = BatchInfo.BeamDim(beam=beam) root._global_beam_dims_by_beam_name[beam.name] = new_dim return new_dim def _make_packed_dim(self, dim_tag): assert self.virtual_dims assert (dim_tag.dyn_size is not None) dim_tag_base = dim_tag.get_same_base() if (dim_tag_base in self._packed_dims_by_dim_tag): return self._packed_dims_by_dim_tag[dim_tag_base] new_dim = BatchInfo.PackedDim(dim_tag=dim_tag, key_axes=self.virtual_dims) self._packed_dims_by_dim_tag[dim_tag_base] = new_dim return new_dim def _make_padded_dim(self, dim_tag): assert self.virtual_dims root = self.get_global_base() assert (dim_tag.dyn_size is not None) dim_tag_base = dim_tag.get_for_batch_ctx(self, dim_tag.control_flow_ctx) if (dim_tag_base in root._global_padded_dims_by_dim_tag): return root._global_padded_dims_by_dim_tag[dim_tag_base] new_dim = BatchInfo.PaddedDim(dim_tag=dim_tag_base) root._global_padded_dims_by_dim_tag[dim_tag_base] = new_dim return new_dim def _next_spatial_major_index(self): idx = None for (i, dim) in enumerate(self.virtual_dims): if isinstance(dim, BatchInfo.GlobalBatchDim): break if isinstance(dim, BatchInfo.BeamDim): break assert isinstance(dim, BatchInfo.FixedDim) idx = (i + 1) if (idx is not None): return idx return 0 def copy_extend_with_beam(self, beam): assert self.virtual_dims if (self.beam == beam): return self if (beam.name in self._descendants_by_beam_name): return self._descendants_by_beam_name[beam.name] return BatchInfo(base=self, new_dim=self._make_beam_dim(beam), new_dim_index=(self.virtual_dims.index(self.get_global_batch_dim()) + 1)) def copy_remove_beam(self): if (not self.beam): return self assert self.virtual_dims root = self.get_global_base() dims_wo_beam = [dim for dim in self.virtual_dims if (not isinstance(dim, BatchInfo.BeamDim))] return root._global_descendants_by_virtual_dims[tuple(dims_wo_beam)] def copy_remove_dim(self, remove_dim): assert self.virtual_dims root = self.get_global_base() dims_wo_dim = [dim for dim in self.virtual_dims if (dim != remove_dim)] return root._global_descendants_by_virtual_dims[tuple(dims_wo_dim)] def copy_set_beam(self, beam): batch = self.copy_remove_beam() if beam: batch = batch.copy_extend_with_beam(beam) return batch def copy_extend_with_packed_dim_tag(self, dim_tag, batch_major): new_dim = self._make_packed_dim(dim_tag) new_dim_idx = ((- 1) if batch_major else self._next_spatial_major_index()) return self._copy_extend_dim(new_dim=new_dim, new_dim_idx=new_dim_idx) def copy_extend_with_padded_dim_tag(self, dim_tag, batch_major=None, new_dim_idx=None): new_dim = self._make_padded_dim(dim_tag) if (new_dim_idx is None): assert (batch_major is not None) new_dim_idx = ((- 1) if batch_major else self._next_spatial_major_index()) else: assert (batch_major is None) return self._copy_extend_dim(new_dim=new_dim, new_dim_idx=new_dim_idx) def copy_extend_with_padded_or_fixed_dim_tag(self, dim_tag, batch_major=None, new_dim_idx=None): if (dim_tag.dyn_size is not None): new_dim = self._make_padded_dim(dim_tag) else: new_dim = BatchInfo.FixedDim(size=dim_tag.get_dim_value(), dim_tag=dim_tag) if (new_dim_idx is None): assert (batch_major is not None) new_dim_idx = ((- 1) if batch_major else self._next_spatial_major_index()) else: assert (batch_major is None) return self._copy_extend_dim(new_dim=new_dim, new_dim_idx=new_dim_idx) def _copy_extend_dim(self, new_dim, new_dim_idx): assert self.virtual_dims root = self.get_global_base() virtual_dims = list(self.virtual_dims) if (new_dim_idx < 0): assert (new_dim_idx == (- 1)) virtual_dims.append(new_dim) else: virtual_dims.insert(new_dim_idx, new_dim) if (tuple(virtual_dims) in root._global_descendants_by_virtual_dims): return root._global_descendants_by_virtual_dims[tuple(virtual_dims)] return BatchInfo(base=self, new_dim=new_dim, new_dim_index=new_dim_idx)
def default_plotting_new(): plt.rcParams['font.size'] = 15 plt.rcParams['axes.labelsize'] = (1.2 * plt.rcParams['font.size']) plt.rcParams['axes.titlesize'] = (1.2 * plt.rcParams['font.size']) plt.rcParams['legend.fontsize'] = (1.0 * plt.rcParams['font.size']) plt.rcParams['xtick.labelsize'] = (1.0 * plt.rcParams['font.size']) plt.rcParams['ytick.labelsize'] = (1.0 * plt.rcParams['font.size']) plt.rcParams['axes.ymargin'] = 0 plt.rcParams['axes.xmargin'] = 0
.slow .skipif((sys.version_info < (3, 4)), reason='needs Python >= 3.4') .xfail(reason='stacklevels currently missing') def test_warning_calls_stacklevels(warning_calls): (bad_filters, bad_stacklevels) = warning_calls msg = '' if bad_filters: msg += 'warning ignore filter should not be used, instead, use\nscipy._lib._numpy_compat.suppress_warnings (in tests only);\nfound in:\n {}'.format('\n '.join(bad_filters)) msg += '\n\n' if bad_stacklevels: msg += 'warnings should have an appropriate stacklevel:\n {}'.format('\n '.join(bad_stacklevels)) if msg: raise AssertionError(msg)
class FiniteMonoids(CategoryWithAxiom): class ParentMethods(): def nerve(self): from sage.topology.simplicial_set_examples import Nerve return Nerve(self) def rhodes_radical_congruence(self, base_ring=None): from sage.rings.rational_field import QQ if (base_ring is None): base_ring = QQ kS = self.algebra(base_ring) kSrad = kS.radical() res = [] for m in self: for n in self: if ((m == n) or ((n, m) in res)): continue try: kSrad.retract((kS(m) - kS(n))) except ValueError: pass else: res.append((m, n)) return res class ElementMethods(): def pseudo_order(self): self_powers = {self.parent().one(): 0} k = 1 self_power_k = self while (self_power_k not in self_powers): self_powers[self_power_k] = k k += 1 self_power_k = (self_power_k * self) return [k, self_powers[self_power_k]]
def _create_sparse_poisson1d(n): P1d = sparse.diags([([(- 1)] * (n - 1)), ([2] * n), ([(- 1)] * (n - 1))], [(- 1), 0, 1]) assert_equal(P1d.shape, (n, n)) return P1d
class Optimizer(Registrable): default_implementation = 'adam' def from_params(cls, model_parameters: List[torch.nn.Parameter], params: Params): if isinstance(params, str): optimizer = params params = Params({}) else: optimizer = params.pop_choice('type', Optimizer.list_available()) return Optimizer.by_name(optimizer)(model_parameters, **params.as_dict())
class TestUtilGetIthRange(unittest.TestCase): def setUp(self): self.test_list = [((0, 16), 4), ((0, 44), 5), ((5, 39), 7), ((10, 41), 8), ((10, 43), 8)] def test_coverage(self): for (rng, num) in self.test_list: last_end = rng[0] for idx in range(num): (beg, end) = util.get_ith_range(rng, idx, num) self.assertEqual(beg, last_end) last_end = end self.assertEqual(last_end, rng[1]) def test_equal_size(self): for (rng, num) in self.test_list: min_size = float('inf') max_size = (- float('inf')) for idx in range(num): (beg, end) = util.get_ith_range(rng, idx, num) min_size = min(min_size, (end - beg)) max_size = max(max_size, (end - beg)) self.assertLessEqual((max_size - min_size), 1)
() def mock_MemoryItem_from_text(mocker: MockerFixture, mock_embedding: Embedding): mocker.patch.object(file_ops.MemoryItem, 'from_text', new=(lambda content, source_type, metadata: MemoryItem(raw_content=content, summary=f"Summary of content '{content}'", chunk_summaries=[f"Summary of content '{content}'"], chunks=[content], e_summary=mock_embedding, e_chunks=[mock_embedding], metadata=(metadata | {'source_type': source_type}))))
def to_case_call(instring, tokensStart, retTokens): tok = retTokens cases = list(tok.case) elze = getattr(tok, 'else', None) if elze: cases.append(elze) return {'case': cases}
def precision(cdict, ldict): return numpy.mean([numpy.mean([mult_precision(el1, el2, cdict, ldict) for el2 in cdict if (cdict[el1] & cdict[el2])]) for el1 in cdict])
class RandomBlur(object): def __init__(self, prob=0.5): self.prob = prob def __call__(self, image): if (random.random() < self.prob): sigma = np.random.choice([3, 5, 7, 9]) image = cv2.GaussianBlur(image, (sigma, sigma), 0) return image
class ResNet(nn.Module): __factory = {18: torchvision.models.resnet18, 34: torchvision.models.resnet34, 50: torchvision.models.resnet50, 101: torchvision.models.resnet101, 152: torchvision.models.resnet152} def __init__(self, depth, pretrained=True, cut_at_pooling=False, num_features=0, norm=False, dropout=0, num_classes=0, FCN=False, T=1, dim=256): super(ResNet, self).__init__() self.depth = depth self.pretrained = pretrained self.cut_at_pooling = cut_at_pooling self.FCN = FCN self.T = T self.reduce_dim = dim if (depth not in ResNet.__factory): raise KeyError('Unsupported depth:', depth) self.base = ResNet.__factory[depth](pretrained=pretrained) if self.FCN: self.base.layer4[0].conv2.stride = (1, 1) self.base.layer4[0].downsample[0].stride = (1, 1) self.num_features = num_features self.num_classes = num_classes self.dropout = dropout self.local_conv = nn.Conv2d(2048, self.num_features, kernel_size=1, padding=0, bias=False) init.kaiming_normal(self.local_conv.weight, mode='fan_out') self.feat_bn2d = nn.BatchNorm2d(self.num_features) init.constant(self.feat_bn2d.weight, 1) init.constant(self.feat_bn2d.bias, 0) self.instance0 = nn.Linear(self.num_features, self.num_classes) init.normal(self.instance0.weight, std=0.001) init.constant(self.instance0.bias, 0) self.instance1 = nn.Linear(self.num_features, self.num_classes) init.normal(self.instance1.weight, std=0.001) init.constant(self.instance1.bias, 0) self.instance2 = nn.Linear(self.num_features, self.num_classes) init.normal(self.instance2.weight, std=0.001) init.constant(self.instance2.bias, 0) self.instance3 = nn.Linear(self.num_features, self.num_classes) init.normal(self.instance3.weight, std=0.001) init.constant(self.instance3.bias, 0) self.instance4 = nn.Linear(self.num_features, self.num_classes) init.normal(self.instance4.weight, std=0.001) init.constant(self.instance4.bias, 0) self.instance5 = nn.Linear(self.num_features, self.num_classes) init.normal(self.instance5.weight, std=0.001) init.constant(self.instance5.bias, 0) self.drop = nn.Dropout(self.dropout) self.local_mask = nn.Conv2d(self.reduce_dim, 6, kernel_size=1, padding=0, bias=True) init.kaiming_normal(self.local_mask.weight, mode='fan_out') init.constant(self.local_mask.bias, 0) elif (not self.cut_at_pooling): self.num_features = num_features self.norm = norm self.dropout = dropout self.has_embedding = (num_features > 0) self.num_classes = num_classes out_planes = self.base.fc.in_features if self.has_embedding: self.feat = nn.Linear(out_planes, self.num_features, bias=False) self.feat_bn = nn.BatchNorm1d(self.num_features) init.kaiming_normal(self.feat.weight, mode='fan_out') init.constant(self.feat_bn.weight, 1) init.constant(self.feat_bn.bias, 0) else: self.num_features = out_planes if (self.dropout > 0): self.drop = nn.Dropout(self.dropout) if (self.num_classes > 0): self.classifier = nn.Linear(self.num_features, self.num_classes) init.normal(self.classifier.weight, std=0.001) init.constant(self.classifier.bias, 0) if (not self.pretrained): self.reset_params() def forward(self, x): for (name, module) in self.base._modules.items(): if (name == 'avgpool'): break x = module(x) if self.cut_at_pooling: return x if self.FCN: T = self.T y = self.drop(x).unsqueeze(1) stride = (2048 / self.reduce_dim) y = F.avg_pool3d(y, kernel_size=(stride, 1, 1), stride=(stride, 1, 1)).squeeze(1) center = F.avg_pool2d(y, (y.size(2), y.size(3))) y = (y - center.expand_as(y)) local_mask = self.local_mask(y) local_mask = F.softmax((T * local_mask)) lw = local_mask.chunk(6, 1) x = (x * 6) f0 = (x * lw[0].expand_as(x)) f1 = (x * lw[1].expand_as(x)) f2 = (x * lw[2].expand_as(x)) f3 = (x * lw[3].expand_as(x)) f4 = (x * lw[4].expand_as(x)) f5 = (x * lw[5].expand_as(x)) f0 = F.avg_pool2d(f0, kernel_size=(f0.size(2), f0.size(3))) f1 = F.avg_pool2d(f1, kernel_size=(f1.size(2), f1.size(3))) f2 = F.avg_pool2d(f2, kernel_size=(f2.size(2), f2.size(3))) f3 = F.avg_pool2d(f3, kernel_size=(f3.size(2), f3.size(3))) f4 = F.avg_pool2d(f4, kernel_size=(f4.size(2), f4.size(3))) f5 = F.avg_pool2d(f5, kernel_size=(f5.size(2), f5.size(3))) x = torch.cat((f0, f1, f2, f3, f4, f5), 2) feat = torch.cat((f0, f1, f2, f3, f4, f5), 2) out0 = (feat / feat.norm(2, 1).unsqueeze(1).expand_as(feat)) x = self.drop(x) x = self.local_conv(x) out1 = x.view(x.size(0), (- 1)) out1 = (x / x.norm(2, 1).unsqueeze(1).expand_as(x)) x = self.feat_bn2d(x) out1 = (x / x.norm(2, 1).unsqueeze(1).expand_as(x)) x = F.relu(x) x = x.chunk(6, 2) x0 = x[0].contiguous().view(x[0].size(0), (- 1)) x1 = x[1].contiguous().view(x[1].size(0), (- 1)) x2 = x[2].contiguous().view(x[2].size(0), (- 1)) x3 = x[3].contiguous().view(x[3].size(0), (- 1)) x4 = x[4].contiguous().view(x[4].size(0), (- 1)) x5 = x[5].contiguous().view(x[5].size(0), (- 1)) c0 = self.instance0(x0) c1 = self.instance1(x1) c2 = self.instance2(x2) c3 = self.instance3(x3) c4 = self.instance4(x4) c5 = self.instance5(x5) return (out0, (c0, c1, c2, c3, c4, c5), local_mask) x = F.avg_pool2d(x, x.size()[2:]) x = x.view(x.size(0), (- 1)) out1 = x out1 = (x / x.norm(2, 1).unsqueeze(1).expand_as(x)) if self.has_embedding: x = self.feat(x) x = self.feat_bn(x) out2 = (x / x.norm(2, 1).unsqueeze(1).expand_as(x)) if self.norm: x = (x / x.norm(2, 1).unsqueeze(1).expand_as(x)) if (self.dropout > 0): x = self.drop(x) if (self.num_classes > 0): x = self.classifier(x) return (out2, x) def reset_params(self): for m in self.modules(): if isinstance(m, nn.Conv2d): init.kaiming_normal(m.weight, mode='fan_out') if (m.bias is not None): init.constant(m.bias, 0) elif isinstance(m, nn.BatchNorm2d): init.constant(m.weight, 1) init.constant(m.bias, 0) elif isinstance(m, nn.Linear): init.normal(m.weight, std=0.001) if (m.bias is not None): init.constant(m.bias, 0)
def get(seed=0, fixed_order=False, pc_valid=0.1): data = {} taskcla = [] size = [1, 28, 28] nperm = 10 seeds = np.array(list(range(nperm)), dtype=int) if (not fixed_order): seeds = shuffle(seeds, random_state=seed) if (not os.path.isdir(pmnist_dir)): os.makedirs(pmnist_dir) mean = (0.1307,) std = (0.3081,) dat = {} dat['train'] = datasets.MNIST(mnist_dir, train=True, download=True, transform=transforms.Compose([transforms.ToTensor(), transforms.Normalize(mean, std)])) dat['test'] = datasets.MNIST(mnist_dir, train=False, download=True, transform=transforms.Compose([transforms.ToTensor(), transforms.Normalize(mean, std)])) for (i, r) in enumerate(seeds): print(i, end=',') sys.stdout.flush() data[i] = {} data[i]['name'] = 'pmnist-{:d}'.format(i) data[i]['ncla'] = 10 for s in ['train', 'test']: loader = torch.utils.data.DataLoader(dat[s], batch_size=1, shuffle=False) data[i][s] = {'x': [], 'y': []} for (image, target) in loader: aux = image.view((- 1)).numpy() aux = shuffle(aux, random_state=((r * 100) + i)) image = torch.FloatTensor(aux).view(size) data[i][s]['x'].append(image) data[i][s]['y'].append(target.numpy()[0]) for s in ['train', 'test']: data[i][s]['x'] = torch.stack(data[i][s]['x']).view((- 1), size[0], size[1], size[2]) data[i][s]['y'] = torch.LongTensor(np.array(data[i][s]['y'], dtype=int)).view((- 1)) torch.save(data[i][s]['x'], os.path.join(os.path.expanduser(pmnist_dir), ((('data' + str(r)) + s) + 'x.bin'))) torch.save(data[i][s]['y'], os.path.join(os.path.expanduser(pmnist_dir), ((('data' + str(r)) + s) + 'y.bin'))) print() else: for (i, r) in enumerate(seeds): data[i] = dict.fromkeys(['name', 'ncla', 'train', 'test']) data[i]['ncla'] = 10 data[i]['name'] = 'pmnist-{:d}'.format(i) for s in ['train', 'test']: data[i][s] = {'x': [], 'y': []} data[i][s]['x'] = torch.load(os.path.join(os.path.expanduser(pmnist_dir), ((('data' + str(r)) + s) + 'x.bin'))) data[i][s]['y'] = torch.load(os.path.join(os.path.expanduser(pmnist_dir), ((('data' + str(r)) + s) + 'y.bin'))) for t in data.keys(): r = np.arange(data[t]['train']['x'].size(0)) r = np.array(r, dtype=int) nvalid = int((pc_valid * len(r))) ivalid = torch.LongTensor(r[:nvalid]) itrain = torch.LongTensor(r[nvalid:]) data[t]['valid'] = {} data[t]['valid']['x'] = data[t]['train']['x'][ivalid].clone() data[t]['valid']['y'] = data[t]['train']['y'][ivalid].clone() data[t]['train']['x'] = data[t]['train']['x'][itrain].clone() data[t]['train']['y'] = data[t]['train']['y'][itrain].clone() n = 0 for t in data.keys(): taskcla.append((t, data[t]['ncla'])) n += data[t]['ncla'] data['ncla'] = n return (data, taskcla, size)
def find_variable_in_nodes(id, nodes): matchs = [node for node in nodes if (isinstance(node, Variable) and (node.id == id))] assert (len(matchs) == 1) return matchs[0]
def register_types(module): root_module = module.get_root() module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE', 'LOG_PREFIX_LEVEL', 'LOG_PREFIX_ALL'], import_from_module='ns.core') module.add_enum('Result_e', ['SUCCESS', 'FAILURE']) module.add_enum('SetupRelease_e', ['setup', 'release']) module.add_enum('CeBitmap_e', ['TA', 'DRX', 'CR']) module.add_enum('NormalExtended_e', ['normal', 'extended']) module.add_class('Address', import_from_module='ns.network') module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address'], import_from_module='ns.network') module.add_class('AllocationRetentionPriority') module.add_class('AttributeConstructionList', import_from_module='ns.core') module.add_class('Item', import_from_module='ns.core', outer_class=root_module['ns3::AttributeConstructionList']) typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator', u'ns3::AttributeConstructionList::CIterator') typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator*', u'ns3::AttributeConstructionList::CIterator*') typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator&', u'ns3::AttributeConstructionList::CIterator&') module.add_class('BandInfo', import_from_module='ns.spectrum') module.add_class('Buffer', import_from_module='ns.network') module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::Buffer']) module.add_class('BufferSizeLevelBsr') module.add_class('BuildBroadcastListElement_s') module.add_enum('Type_e', ['BCCH', 'PCCH'], outer_class=root_module['ns3::BuildBroadcastListElement_s']) module.add_class('BuildDataListElement_s') module.add_class('BuildRarListElement_s') module.add_class('BwPart_s') module.add_class('ByteTagIterator', import_from_module='ns.network') module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagIterator']) module.add_class('ByteTagList', import_from_module='ns.network') module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList']) module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator']) module.add_class('CallbackBase', import_from_module='ns.core') module.add_class('CqasFlowPerf_t') module.add_class('CqiConfig_s') module.add_class('CqiListElement_s') module.add_enum('CqiType_e', ['P10', 'P11', 'P20', 'P21', 'A12', 'A22', 'A20', 'A30', 'A31'], outer_class=root_module['ns3::CqiListElement_s']) module.add_class('DataOutputCallback', allow_subclassing=True, import_from_module='ns.stats') module.add_class('DataRate', import_from_module='ns.network') module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeChecker']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeValue']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase']) module.add_class('DefaultDeleter', template_parameters=['ns3::EpcTft']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::EventImpl']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation']) module.add_class('DefaultDeleter', template_parameters=['ns3::LteChunkProcessor']) module.add_class('DefaultDeleter', template_parameters=['ns3::LteControlMessage']) module.add_class('DefaultDeleter', template_parameters=['ns3::LteHarqPhy']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::NixVector']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Packet']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::SpectrumModel']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::SpectrumSignalParameters']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::SpectrumValue']) module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor']) module.add_class('DefaultDeleter', template_parameters=['ns3::VendorSpecificValue']) module.add_class('DefaultDeleter', template_parameters=['ns3::X2CellInfo']) module.add_class('DefaultDeleter', template_parameters=['ns3::X2IfaceInfo']) module.add_class('DlDciListElement_s') module.add_enum('Format_e', ['ONE', 'ONE_A', 'ONE_B', 'ONE_C', 'ONE_D', 'TWO', 'TWO_A', 'TWO_B'], outer_class=root_module['ns3::DlDciListElement_s']) module.add_enum('VrbFormat_e', ['VRB_DISTRIBUTED', 'VRB_LOCALIZED'], outer_class=root_module['ns3::DlDciListElement_s']) module.add_enum('Ngap_e', ['GAP1', 'GAP2'], outer_class=root_module['ns3::DlDciListElement_s']) module.add_class('DlInfoListElement_s') module.add_enum('HarqStatus_e', ['ACK', 'NACK', 'DTX'], outer_class=root_module['ns3::DlInfoListElement_s']) module.add_class('DlSchedulingCallbackInfo') module.add_class('DrxConfig_s') module.add_class('EpcEnbS1SapProvider', allow_subclassing=True) module.add_class('BearerToBeSwitched', outer_class=root_module['ns3::EpcEnbS1SapProvider']) module.add_class('PathSwitchRequestParameters', outer_class=root_module['ns3::EpcEnbS1SapProvider']) module.add_class('EpcEnbS1SapUser', allow_subclassing=True) module.add_class('DataRadioBearerSetupRequestParameters', outer_class=root_module['ns3::EpcEnbS1SapUser']) module.add_class('InitialContextSetupRequestParameters', outer_class=root_module['ns3::EpcEnbS1SapUser']) module.add_class('PathSwitchRequestAcknowledgeParameters', outer_class=root_module['ns3::EpcEnbS1SapUser']) module.add_class('EpcS11Sap') module.add_class('Fteid', outer_class=root_module['ns3::EpcS11Sap']) module.add_class('GtpcMessage', outer_class=root_module['ns3::EpcS11Sap']) module.add_class('Uli', outer_class=root_module['ns3::EpcS11Sap']) module.add_class('EpcS11SapMme', parent=root_module['ns3::EpcS11Sap']) module.add_class('BearerContextCreated', outer_class=root_module['ns3::EpcS11SapMme']) module.add_class('BearerContextRemoved', outer_class=root_module['ns3::EpcS11SapMme']) module.add_class('CreateSessionResponseMessage', parent=root_module['ns3::EpcS11Sap::GtpcMessage'], outer_class=root_module['ns3::EpcS11SapMme']) module.add_class('DeleteBearerRequestMessage', parent=root_module['ns3::EpcS11Sap::GtpcMessage'], outer_class=root_module['ns3::EpcS11SapMme']) module.add_class('ModifyBearerResponseMessage', parent=root_module['ns3::EpcS11Sap::GtpcMessage'], outer_class=root_module['ns3::EpcS11SapMme']) module.add_enum('Cause', ['REQUEST_ACCEPTED', 'REQUEST_ACCEPTED_PARTIALLY', 'REQUEST_REJECTED', 'CONTEXT_NOT_FOUND'], outer_class=root_module['ns3::EpcS11SapMme::ModifyBearerResponseMessage']) module.add_class('EpcS11SapSgw', parent=root_module['ns3::EpcS11Sap']) module.add_class('BearerContextRemovedSgwPgw', outer_class=root_module['ns3::EpcS11SapSgw']) module.add_class('BearerContextToBeCreated', outer_class=root_module['ns3::EpcS11SapSgw']) module.add_class('BearerContextToBeRemoved', outer_class=root_module['ns3::EpcS11SapSgw']) module.add_class('CreateSessionRequestMessage', parent=root_module['ns3::EpcS11Sap::GtpcMessage'], outer_class=root_module['ns3::EpcS11SapSgw']) module.add_class('DeleteBearerCommandMessage', parent=root_module['ns3::EpcS11Sap::GtpcMessage'], outer_class=root_module['ns3::EpcS11SapSgw']) module.add_class('DeleteBearerResponseMessage', parent=root_module['ns3::EpcS11Sap::GtpcMessage'], outer_class=root_module['ns3::EpcS11SapSgw']) module.add_class('ModifyBearerRequestMessage', parent=root_module['ns3::EpcS11Sap::GtpcMessage'], outer_class=root_module['ns3::EpcS11SapSgw']) module.add_class('EpcS1apSap') module.add_class('EpcS1apSapEnb', parent=root_module['ns3::EpcS1apSap']) module.add_class('ErabSwitchedInUplinkItem', outer_class=root_module['ns3::EpcS1apSapEnb']) module.add_class('ErabToBeSetupItem', outer_class=root_module['ns3::EpcS1apSapEnb']) module.add_class('EpcS1apSapMme', parent=root_module['ns3::EpcS1apSap']) module.add_class('ErabSetupItem', outer_class=root_module['ns3::EpcS1apSapMme']) module.add_class('ErabSwitchedInDownlinkItem', outer_class=root_module['ns3::EpcS1apSapMme']) module.add_class('ErabToBeReleasedIndication', outer_class=root_module['ns3::EpcS1apSapMme']) module.add_class('EpcX2Sap') module.add_enum('UlInterferenceOverloadIndicationItem', ['HighInterference', 'MediumInterference', 'LowInterference'], outer_class=root_module['ns3::EpcX2Sap']) module.add_enum('LoadIndicator', ['LowLoad', 'MediumLoad', 'HighLoad', 'Overload'], outer_class=root_module['ns3::EpcX2Sap']) module.add_enum('IdCause', ['HandoverDesirableForRadioReason', 'TimeCriticalHandover'], outer_class=root_module['ns3::EpcX2Sap']) module.add_class('CellInformationItem', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('CellMeasurementResultItem', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('CompositeAvailCapacity', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('ErabAdmittedItem', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('ErabNotAdmittedItem', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('ErabToBeSetupItem', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('ErabsSubjectToStatusTransferItem', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('HandoverPreparationFailureParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('HandoverRequestAckParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('HandoverRequestParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('LoadInformationParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('RelativeNarrowbandTxBand', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('ResourceStatusUpdateParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('SnStatusTransferParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('UeContextReleaseParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('UeDataParams', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('UlHighInterferenceInformationItem', outer_class=root_module['ns3::EpcX2Sap']) module.add_class('EpcX2SapProvider', parent=root_module['ns3::EpcX2Sap']) module.add_class('EpcX2SapUser', parent=root_module['ns3::EpcX2Sap']) module.add_class('EutranMeasurementMapping') module.add_class('EventId', import_from_module='ns.core') module.add_class('FfMacCschedSapProvider', allow_subclassing=True) module.add_class('CschedCellConfigReqParameters', outer_class=root_module['ns3::FfMacCschedSapProvider']) module.add_enum('HoppingMode_e', ['inter', 'interintra'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters']) module.add_enum('PhichResource_e', ['PHICH_R_ONE_SIXTH', 'PHICH_R_HALF', 'PHICH_R_ONE', 'PHICH_R_TWO'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters']) module.add_enum('DuplexMode_e', ['DM_TDD', 'DM_FDD'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters']) module.add_enum('Enable64Qam_e', ['MOD_16QAM', 'MOD_64QAM'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedCellConfigReqParameters']) module.add_class('CschedLcConfigReqParameters', outer_class=root_module['ns3::FfMacCschedSapProvider']) module.add_class('CschedLcReleaseReqParameters', outer_class=root_module['ns3::FfMacCschedSapProvider']) module.add_class('CschedUeConfigReqParameters', outer_class=root_module['ns3::FfMacCschedSapProvider']) module.add_enum('MeasGapConfigPattern_e', ['MGP_GP1', 'MGP_GP2', 'OFF'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters']) module.add_enum('OpenClosedLoop_e', ['noneloop', 'openloop', 'closedloop'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters']) module.add_enum('RepMode_e', ['rm12', 'rm20', 'rm22', 'rm30', 'rm31', 'nonemode'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters']) module.add_enum('FeedbackMode_e', ['bundling', 'multiplexing'], outer_class=root_module['ns3::FfMacCschedSapProvider::CschedUeConfigReqParameters']) module.add_class('CschedUeReleaseReqParameters', outer_class=root_module['ns3::FfMacCschedSapProvider']) module.add_class('FfMacCschedSapUser', allow_subclassing=True) module.add_class('CschedCellConfigCnfParameters', outer_class=root_module['ns3::FfMacCschedSapUser']) module.add_class('CschedCellConfigUpdateIndParameters', outer_class=root_module['ns3::FfMacCschedSapUser']) module.add_class('CschedLcConfigCnfParameters', outer_class=root_module['ns3::FfMacCschedSapUser']) module.add_class('CschedLcReleaseCnfParameters', outer_class=root_module['ns3::FfMacCschedSapUser']) module.add_class('CschedUeConfigCnfParameters', outer_class=root_module['ns3::FfMacCschedSapUser']) module.add_class('CschedUeConfigUpdateIndParameters', outer_class=root_module['ns3::FfMacCschedSapUser']) module.add_class('CschedUeReleaseCnfParameters', outer_class=root_module['ns3::FfMacCschedSapUser']) module.add_class('FfMacSchedSapProvider', allow_subclassing=True) module.add_class('SchedDlCqiInfoReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedDlMacBufferReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedDlPagingBufferReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedDlRachInfoReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedDlRlcBufferReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedDlTriggerReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedUlCqiInfoReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedUlMacCtrlInfoReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedUlNoiseInterferenceReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedUlSrInfoReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('SchedUlTriggerReqParameters', outer_class=root_module['ns3::FfMacSchedSapProvider']) module.add_class('FfMacSchedSapUser', allow_subclassing=True) module.add_class('SchedDlConfigIndParameters', outer_class=root_module['ns3::FfMacSchedSapUser']) module.add_class('SchedUlConfigIndParameters', outer_class=root_module['ns3::FfMacSchedSapUser']) module.add_class('GbrQosInformation') module.add_class('GtpcIes') module.add_enum('Cause_t', ['RESERVED', 'REQUEST_ACCEPTED'], outer_class=root_module['ns3::GtpcIes']) module.add_class('HarqProcessInfoElement_t') module.add_class('Hasher', import_from_module='ns.core') module.add_class('HigherLayerSelected_s') module.add_class('ImsiLcidPair_t') module.add_class('Inet6SocketAddress', import_from_module='ns.network') root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address']) module.add_class('InetSocketAddress', import_from_module='ns.network') root_module['ns3::InetSocketAddress'].implicitly_converts_to(root_module['ns3::Address']) module.add_class('Ipv4Address', import_from_module='ns.network') root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address']) module.add_class('Ipv4AddressHelper', import_from_module='ns.internet') module.add_class('Ipv4InterfaceAddress', import_from_module='ns.internet') module.add_enum('InterfaceAddressScope_e', ['HOST', 'LINK', 'GLOBAL'], outer_class=root_module['ns3::Ipv4InterfaceAddress'], import_from_module='ns.internet') module.add_class('Ipv4InterfaceContainer', import_from_module='ns.internet') typehandlers.add_type_alias(u'std::vector< std::pair< ns3::Ptr< ns3::Ipv4 >, unsigned int > > const_iterator', u'ns3::Ipv4InterfaceContainer::Iterator') typehandlers.add_type_alias(u'std::vector< std::pair< ns3::Ptr< ns3::Ipv4 >, unsigned int > > const_iterator*', u'ns3::Ipv4InterfaceContainer::Iterator*') typehandlers.add_type_alias(u'std::vector< std::pair< ns3::Ptr< ns3::Ipv4 >, unsigned int > > const_iterator&', u'ns3::Ipv4InterfaceContainer::Iterator&') module.add_class('Ipv4Mask', import_from_module='ns.network') module.add_class('Ipv6Address', import_from_module='ns.network') root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address']) module.add_class('Ipv6AddressHelper', import_from_module='ns.internet') module.add_class('Ipv6InterfaceAddress', import_from_module='ns.internet') module.add_enum('State_e', ['TENTATIVE', 'DEPRECATED', 'PREFERRED', 'PERMANENT', 'HOMEADDRESS', 'TENTATIVE_OPTIMISTIC', 'INVALID'], outer_class=root_module['ns3::Ipv6InterfaceAddress'], import_from_module='ns.internet') module.add_enum('Scope_e', ['HOST', 'LINKLOCAL', 'GLOBAL'], outer_class=root_module['ns3::Ipv6InterfaceAddress'], import_from_module='ns.internet') module.add_class('Ipv6InterfaceContainer', import_from_module='ns.internet') typehandlers.add_type_alias(u'std::vector< std::pair< ns3::Ptr< ns3::Ipv6 >, unsigned int > > const_iterator', u'ns3::Ipv6InterfaceContainer::Iterator') typehandlers.add_type_alias(u'std::vector< std::pair< ns3::Ptr< ns3::Ipv6 >, unsigned int > > const_iterator*', u'ns3::Ipv6InterfaceContainer::Iterator*') typehandlers.add_type_alias(u'std::vector< std::pair< ns3::Ptr< ns3::Ipv6 >, unsigned int > > const_iterator&', u'ns3::Ipv6InterfaceContainer::Iterator&') module.add_class('Ipv6Prefix', import_from_module='ns.network') module.add_class('LogComponent', import_from_module='ns.core') typehandlers.add_type_alias(u'std::map< std::string, ns3::LogComponent * >', u'ns3::LogComponent::ComponentList') typehandlers.add_type_alias(u'std::map< std::string, ns3::LogComponent * >*', u'ns3::LogComponent::ComponentList*') typehandlers.add_type_alias(u'std::map< std::string, ns3::LogComponent * >&', u'ns3::LogComponent::ComponentList&') module.add_class('LogicalChannelConfigListElement_s') module.add_enum('Direction_e', ['DIR_UL', 'DIR_DL', 'DIR_BOTH'], outer_class=root_module['ns3::LogicalChannelConfigListElement_s']) module.add_enum('QosBearerType_e', ['QBT_NON_GBR', 'QBT_GBR'], outer_class=root_module['ns3::LogicalChannelConfigListElement_s']) module.add_class('LteAnrSapProvider', allow_subclassing=True) module.add_class('LteAnrSapUser', allow_subclassing=True) module.add_class('LteAsSapProvider', allow_subclassing=True) module.add_class('LteAsSapUser', allow_subclassing=True) module.add_class('LteCcmMacSapProvider', allow_subclassing=True) module.add_class('LteCcmRrcSapProvider', allow_subclassing=True) module.add_class('LcsConfig', outer_class=root_module['ns3::LteCcmRrcSapProvider']) module.add_class('LteCcmRrcSapUser', allow_subclassing=True) module.add_class('LteEnbCmacSapProvider', allow_subclassing=True) module.add_class('AllocateNcRaPreambleReturnValue', outer_class=root_module['ns3::LteEnbCmacSapProvider']) module.add_class('LcInfo', outer_class=root_module['ns3::LteEnbCmacSapProvider']) module.add_class('RachConfig', outer_class=root_module['ns3::LteEnbCmacSapProvider']) module.add_class('UeConfig', outer_class=root_module['ns3::LteEnbCmacSapProvider']) module.add_class('LteEnbCmacSapUser', allow_subclassing=True) module.add_class('UeConfig', outer_class=root_module['ns3::LteEnbCmacSapUser']) module.add_class('LteEnbCphySapProvider', allow_subclassing=True) module.add_class('LteEnbCphySapUser') module.add_class('LteEnbPhySapProvider', allow_subclassing=True) module.add_class('LteEnbPhySapUser', allow_subclassing=True) module.add_class('LteFfConverter') module.add_class('LteFfrRrcSapProvider', allow_subclassing=True) module.add_class('LteFfrRrcSapUser', allow_subclassing=True) module.add_class('LteFfrSapProvider', allow_subclassing=True) module.add_class('LteFfrSapUser') module.add_class('LteFlowId_t') module.add_class('LteGlobalPathlossDatabase', allow_subclassing=True) module.add_class('LteHandoverManagementSapProvider', allow_subclassing=True) module.add_class('LteHandoverManagementSapUser', allow_subclassing=True) module.add_class('LteMacSapProvider', allow_subclassing=True) module.add_class('ReportBufferStatusParameters', outer_class=root_module['ns3::LteMacSapProvider']) module.add_class('TransmitPduParameters', outer_class=root_module['ns3::LteMacSapProvider']) module.add_class('LteMacSapUser', allow_subclassing=True) module.add_class('ReceivePduParameters', outer_class=root_module['ns3::LteMacSapUser']) module.add_class('TxOpportunityParameters', outer_class=root_module['ns3::LteMacSapUser']) module.add_class('LteMiErrorModel') module.add_class('LtePdcpSapProvider', allow_subclassing=True) module.add_class('TransmitPdcpSduParameters', outer_class=root_module['ns3::LtePdcpSapProvider']) module.add_class('LtePdcpSapUser', allow_subclassing=True) module.add_class('ReceivePdcpSduParameters', outer_class=root_module['ns3::LtePdcpSapUser']) module.add_class('LteRlcSapProvider', allow_subclassing=True) module.add_class('TransmitPdcpPduParameters', outer_class=root_module['ns3::LteRlcSapProvider']) module.add_class('LteRlcSapUser', allow_subclassing=True) module.add_class('LteRrcSap') module.add_enum('ReestablishmentCause', ['RECONFIGURATION_FAILURE', 'HANDOVER_FAILURE', 'OTHER_FAILURE'], outer_class=root_module['ns3::LteRrcSap']) module.add_class('AntennaInfoCommon', outer_class=root_module['ns3::LteRrcSap']) module.add_class('AntennaInfoDedicated', outer_class=root_module['ns3::LteRrcSap']) module.add_class('AntennaInfoUl', outer_class=root_module['ns3::LteRrcSap']) module.add_class('AsConfig', outer_class=root_module['ns3::LteRrcSap']) module.add_class('BlackCellsToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('CarrierBandwidthEutra', outer_class=root_module['ns3::LteRrcSap']) module.add_class('CarrierFreqEutra', outer_class=root_module['ns3::LteRrcSap']) module.add_class('CellAccessRelatedInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('CellIdentification', outer_class=root_module['ns3::LteRrcSap']) module.add_class('CellSelectionInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('CellsToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('CgiInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('DrbToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('FreqInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('HandoverPreparationInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('LogicalChannelConfig', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MasterInformationBlock', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasConfig', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasGapConfig', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('action', ['SETUP', 'RESET'], outer_class=root_module['ns3::LteRrcSap::MeasGapConfig']) module.add_enum('gap', ['GP0', 'GP1'], outer_class=root_module['ns3::LteRrcSap::MeasGapConfig']) module.add_class('MeasIdToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasObjectEutra', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasObjectToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasResultBestNeighCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasResultEutra', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasResultScell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasResultServFreqList', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasResults', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MeasurementReport', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MobilityControlInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('MobilityStateParameters', outer_class=root_module['ns3::LteRrcSap']) module.add_class('NonCriticalExtensionConfiguration', outer_class=root_module['ns3::LteRrcSap']) module.add_class('NonUlConfiguration', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PdschConfigCommon', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PdschConfigDedicated', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('db', ['dB_6', 'dB_4dot77', 'dB_3', 'dB_1dot77', 'dB0', 'dB1', 'dB2', 'dB3'], outer_class=root_module['ns3::LteRrcSap::PdschConfigDedicated']) module.add_class('PhysCellIdRange', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PhysicalConfigDedicated', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PhysicalConfigDedicatedSCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PlmnIdentityInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PrachConfigSCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PreambleInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('PuschConfigDedicatedSCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('QuantityConfig', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RaSupervisionInfo', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RachConfigCommon', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RachConfigDedicated', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RadioResourceConfigCommon', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RadioResourceConfigCommonSCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RadioResourceConfigCommonSib', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RadioResourceConfigDedicated', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RadioResourceConfigDedicatedSCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('ReestabUeIdentity', outer_class=root_module['ns3::LteRrcSap']) module.add_class('ReportConfigEutra', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('', ['EVENT', 'PERIODICAL'], outer_class=root_module['ns3::LteRrcSap::ReportConfigEutra']) module.add_enum('', ['EVENT_A1', 'EVENT_A2', 'EVENT_A3', 'EVENT_A4', 'EVENT_A5'], outer_class=root_module['ns3::LteRrcSap::ReportConfigEutra']) module.add_enum('report', ['REPORT_STRONGEST_CELLS', 'REPORT_CGI'], outer_class=root_module['ns3::LteRrcSap::ReportConfigEutra']) module.add_enum('', ['RSRP', 'RSRQ'], outer_class=root_module['ns3::LteRrcSap::ReportConfigEutra']) module.add_enum('', ['SAME_AS_TRIGGER_QUANTITY', 'BOTH'], outer_class=root_module['ns3::LteRrcSap::ReportConfigEutra']) module.add_enum('', ['MS120', 'MS240', 'MS480', 'MS640', 'MS1024', 'MS2048', 'MS5120', 'MS10240', 'MIN1', 'MIN6', 'MIN12', 'MIN30', 'MIN60', 'SPARE3', 'SPARE2', 'SPARE1'], outer_class=root_module['ns3::LteRrcSap::ReportConfigEutra']) module.add_class('ReportConfigToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RlcConfig', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('direction', ['AM', 'UM_BI_DIRECTIONAL', 'UM_UNI_DIRECTIONAL_UL', 'UM_UNI_DIRECTIONAL_DL'], outer_class=root_module['ns3::LteRrcSap::RlcConfig']) module.add_class('RrcConnectionReconfiguration', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionReconfigurationCompleted', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionReestablishment', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionReestablishmentComplete', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionReestablishmentReject', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionReestablishmentRequest', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionReject', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionRelease', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionRequest', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionSetup', outer_class=root_module['ns3::LteRrcSap']) module.add_class('RrcConnectionSetupCompleted', outer_class=root_module['ns3::LteRrcSap']) module.add_class('SCellToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('SoundingRsUlConfigCommon', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('action', ['SETUP', 'RESET'], outer_class=root_module['ns3::LteRrcSap::SoundingRsUlConfigCommon']) module.add_class('SoundingRsUlConfigDedicated', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('action', ['SETUP', 'RESET'], outer_class=root_module['ns3::LteRrcSap::SoundingRsUlConfigDedicated']) module.add_class('SpeedStatePars', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('action', ['SETUP', 'RESET'], outer_class=root_module['ns3::LteRrcSap::SpeedStatePars']) module.add_class('SpeedStateScaleFactors', outer_class=root_module['ns3::LteRrcSap']) module.add_class('SrbToAddMod', outer_class=root_module['ns3::LteRrcSap']) module.add_class('SystemInformation', outer_class=root_module['ns3::LteRrcSap']) module.add_class('SystemInformationBlockType1', outer_class=root_module['ns3::LteRrcSap']) module.add_class('SystemInformationBlockType2', outer_class=root_module['ns3::LteRrcSap']) module.add_class('ThresholdEutra', outer_class=root_module['ns3::LteRrcSap']) module.add_enum('', ['THRESHOLD_RSRP', 'THRESHOLD_RSRQ'], outer_class=root_module['ns3::LteRrcSap::ThresholdEutra']) module.add_class('UlConfiguration', outer_class=root_module['ns3::LteRrcSap']) module.add_class('UlPowerControlCommonSCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('UlPowerControlDedicatedSCell', outer_class=root_module['ns3::LteRrcSap']) module.add_class('LteSpectrumValueCatcher') module.add_class('LteSpectrumValueHelper') module.add_class('LteUeCcmRrcSapProvider', allow_subclassing=True) module.add_class('LcsConfig', outer_class=root_module['ns3::LteUeCcmRrcSapProvider']) module.add_class('LteUeCcmRrcSapUser', allow_subclassing=True) module.add_class('LteUeCmacSapProvider', allow_subclassing=True) module.add_class('LogicalChannelConfig', outer_class=root_module['ns3::LteUeCmacSapProvider']) module.add_class('RachConfig', outer_class=root_module['ns3::LteUeCmacSapProvider']) module.add_class('LteUeCmacSapUser', allow_subclassing=True) module.add_class('LteUeConfig_t') module.add_class('LteUeCphySapProvider', allow_subclassing=True) module.add_class('LteUeCphySapUser', allow_subclassing=True) module.add_class('UeMeasurementsElement', outer_class=root_module['ns3::LteUeCphySapUser']) module.add_class('UeMeasurementsParameters', outer_class=root_module['ns3::LteUeCphySapUser']) module.add_class('LteUePhySapProvider', allow_subclassing=True) module.add_class('LteUePhySapUser', allow_subclassing=True) module.add_class('LteUeRrcSapProvider', parent=root_module['ns3::LteRrcSap']) module.add_class('CompleteSetupParameters', outer_class=root_module['ns3::LteUeRrcSapProvider']) module.add_class('LteUeRrcSapUser', parent=root_module['ns3::LteRrcSap']) module.add_class('SetupParameters', outer_class=root_module['ns3::LteUeRrcSapUser']) module.add_class('Mac48Address', import_from_module='ns.network') typehandlers.add_type_alias(u'void ( * ) ( ns3::Mac48Address )', u'ns3::Mac48Address::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Mac48Address )*', u'ns3::Mac48Address::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Mac48Address )&', u'ns3::Mac48Address::TracedCallback&') root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address']) module.add_class('Mac64Address', import_from_module='ns.network') root_module['ns3::Mac64Address'].implicitly_converts_to(root_module['ns3::Address']) module.add_class('Mac8Address', import_from_module='ns.network') root_module['ns3::Mac8Address'].implicitly_converts_to(root_module['ns3::Address']) module.add_class('MacCeListElement_s') module.add_enum('MacCeType_e', ['BSR', 'PHR', 'CRNTI'], outer_class=root_module['ns3::MacCeListElement_s']) module.add_class('MacCeValue_u') module.add_class('Names', import_from_module='ns.core') module.add_class('NetDeviceContainer', import_from_module='ns.network') typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::NetDevice > > const_iterator', u'ns3::NetDeviceContainer::Iterator') typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::NetDevice > > const_iterator*', u'ns3::NetDeviceContainer::Iterator*') typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::NetDevice > > const_iterator&', u'ns3::NetDeviceContainer::Iterator&') module.add_class('NodeContainer', import_from_module='ns.network') typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator', u'ns3::NodeContainer::Iterator') typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator*', u'ns3::NodeContainer::Iterator*') typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator&', u'ns3::NodeContainer::Iterator&') module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core') module.add_class('ObjectDeleter', import_from_module='ns.core') module.add_class('ObjectFactory', import_from_module='ns.core') module.add_class('PacketMetadata', import_from_module='ns.network') module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata']) module.add_enum('ItemType', ['PAYLOAD', 'HEADER', 'TRAILER'], outer_class=root_module['ns3::PacketMetadata::Item'], import_from_module='ns.network') module.add_class('ItemIterator', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata']) module.add_class('PacketTagIterator', import_from_module='ns.network') module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagIterator']) module.add_class('PacketTagList', import_from_module='ns.network') module.add_class('TagData', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagList']) module.add_class('PagingInfoListElement_s') module.add_class('ParameterLogger', import_from_module='ns.core') module.add_class('PhichListElement_s') module.add_enum('Phich_e', ['ACK', 'NACK'], outer_class=root_module['ns3::PhichListElement_s']) module.add_class('PhyReceptionStatParameters') typehandlers.add_type_alias(u'void ( * ) ( ns3::PhyReceptionStatParameters const )', u'ns3::PhyReceptionStatParameters::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::PhyReceptionStatParameters const )*', u'ns3::PhyReceptionStatParameters::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::PhyReceptionStatParameters const )&', u'ns3::PhyReceptionStatParameters::TracedCallback&') module.add_class('PhyTransmissionStatParameters') typehandlers.add_type_alias(u'void ( * ) ( ns3::PhyTransmissionStatParameters const )', u'ns3::PhyTransmissionStatParameters::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::PhyTransmissionStatParameters const )*', u'ns3::PhyTransmissionStatParameters::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::PhyTransmissionStatParameters const )&', u'ns3::PhyTransmissionStatParameters::TracedCallback&') module.add_class('RachListElement_s') module.add_class('RadioBearerStatsConnector') module.add_class('RealProtocolRlcSapUser', parent=root_module['ns3::LteRlcSapUser']) module.add_class('RlcPduListElement_s') module.add_class('SbMeasResult_s') module.add_class('SequenceNumber10') module.add_class('SiConfiguration_s') module.add_class('SiMessageListElement_s') module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core') module.add_enum('', ['NO_CONTEXT'], outer_class=root_module['ns3::Simulator'], import_from_module='ns.core') module.add_class('SpsConfig_s') module.add_class('SrConfig_s') module.add_class('SrListElement_s') module.add_class('StatisticalSummary', allow_subclassing=True, import_from_module='ns.stats') module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase']) module.add_class('TagBuffer', import_from_module='ns.network') module.add_class('TbId_t') module.add_class('TbStats_t') module.add_class('TimeWithUnit', import_from_module='ns.core') module.add_class('TransmissionModesLayers') module.add_class('TypeId', import_from_module='ns.core') module.add_enum('AttributeFlag', ['ATTR_GET', 'ATTR_SET', 'ATTR_CONSTRUCT', 'ATTR_SGC'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core') module.add_enum('SupportLevel', ['SUPPORTED', 'DEPRECATED', 'OBSOLETE'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core') module.add_class('AttributeInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId']) module.add_class('TraceSourceInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId']) typehandlers.add_type_alias(u'uint32_t', u'ns3::TypeId::hash_t') typehandlers.add_type_alias(u'uint32_t*', u'ns3::TypeId::hash_t*') typehandlers.add_type_alias(u'uint32_t&', u'ns3::TypeId::hash_t&') module.add_class('UeCapabilities_s') module.add_class('UeSelected_s') module.add_class('UlCqi_s') module.add_enum('Type_e', ['SRS', 'PUSCH', 'PUCCH_1', 'PUCCH_2', 'PRACH'], outer_class=root_module['ns3::UlCqi_s']) module.add_class('UlDciListElement_s') module.add_class('UlGrant_s') module.add_class('UlInfoListElement_s') module.add_enum('ReceptionStatus_e', ['Ok', 'NotOk', 'NotValid'], outer_class=root_module['ns3::UlInfoListElement_s']) module.add_class('UplinkLteGlobalPathlossDatabase', parent=root_module['ns3::LteGlobalPathlossDatabase']) module.add_class('Vector2D', import_from_module='ns.core') module.add_class('Vector3D', import_from_module='ns.core') module.add_class('VendorSpecificListElement_s') module.add_class('empty', import_from_module='ns.core') module.add_class('fdbetsFlowPerf_t') module.add_class('fdtbfqsFlowPerf_t') module.add_class('int64x64_t', import_from_module='ns.core') module.add_enum('impl_type', ['int128_impl', 'cairo_impl', 'ld_impl'], outer_class=root_module['ns3::int64x64_t'], import_from_module='ns.core') module.add_class('pfsFlowPerf_t') module.add_class('pssFlowPerf_t') module.add_class('tbInfo_t') module.add_class('tdbetsFlowPerf_t') module.add_class('tdtbfqsFlowPerf_t') module.add_class('Chunk', import_from_module='ns.network', parent=root_module['ns3::ObjectBase']) module.add_class('DownlinkLteGlobalPathlossDatabase', parent=root_module['ns3::LteGlobalPathlossDatabase']) module.add_class('EpsBearer', parent=root_module['ns3::ObjectBase']) module.add_enum('Qci', ['GBR_CONV_VOICE', 'GBR_CONV_VIDEO', 'GBR_GAMING', 'GBR_NON_CONV_VIDEO', 'GBR_MC_PUSH_TO_TALK', 'GBR_NMC_PUSH_TO_TALK', 'GBR_MC_VIDEO', 'GBR_V2X', 'NGBR_IMS', 'NGBR_VIDEO_TCP_OPERATOR', 'NGBR_VOICE_VIDEO_GAMING', 'NGBR_VIDEO_TCP_PREMIUM', 'NGBR_VIDEO_TCP_DEFAULT', 'NGBR_MC_DELAY_SIGNAL', 'NGBR_MC_DATA', 'NGBR_V2X', 'NGBR_LOW_LAT_EMBB', 'DGBR_DISCRETE_AUT_SMALL', 'DGBR_DISCRETE_AUT_LARGE', 'DGBR_ITS', 'DGBR_ELECTRICITY'], outer_class=root_module['ns3::EpsBearer']) module.add_class('EpsBearerTag', parent=root_module['ns3::Tag']) module.add_class('Header', import_from_module='ns.network', parent=root_module['ns3::Chunk']) module.add_class('Ipv4Header', import_from_module='ns.internet', parent=root_module['ns3::Header']) module.add_enum('DscpType', ['DscpDefault', 'DSCP_CS1', 'DSCP_AF11', 'DSCP_AF12', 'DSCP_AF13', 'DSCP_CS2', 'DSCP_AF21', 'DSCP_AF22', 'DSCP_AF23', 'DSCP_CS3', 'DSCP_AF31', 'DSCP_AF32', 'DSCP_AF33', 'DSCP_CS4', 'DSCP_AF41', 'DSCP_AF42', 'DSCP_AF43', 'DSCP_CS5', 'DSCP_EF', 'DSCP_CS6', 'DSCP_CS7'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet') module.add_enum('EcnType', ['ECN_NotECT', 'ECN_ECT1', 'ECN_ECT0', 'ECN_CE'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet') module.add_class('LteCcmMacSapUser', parent=root_module['ns3::LteMacSapUser']) module.add_class('LteEnbRrcSapProvider', parent=root_module['ns3::LteRrcSap']) module.add_class('CompleteSetupUeParameters', outer_class=root_module['ns3::LteEnbRrcSapProvider']) module.add_class('LteEnbRrcSapUser', parent=root_module['ns3::LteRrcSap']) module.add_class('SetupUeParameters', outer_class=root_module['ns3::LteEnbRrcSapUser']) module.add_class('LtePdcpHeader', parent=root_module['ns3::Header']) module.add_enum('', ['CONTROL_PDU', 'DATA_PDU'], outer_class=root_module['ns3::LtePdcpHeader']) module.add_class('LtePhyTag', parent=root_module['ns3::Tag']) module.add_class('LteRadioBearerTag', parent=root_module['ns3::Tag']) module.add_class('LteRlcAmHeader', parent=root_module['ns3::Header']) module.add_enum('DataControlPdu_t', ['CONTROL_PDU', 'DATA_PDU'], outer_class=root_module['ns3::LteRlcAmHeader']) module.add_enum('ControPduType_t', ['STATUS_PDU'], outer_class=root_module['ns3::LteRlcAmHeader']) module.add_enum('FramingInfoFirstByte_t', ['FIRST_BYTE', 'NO_FIRST_BYTE'], outer_class=root_module['ns3::LteRlcAmHeader']) module.add_enum('FramingInfoLastByte_t', ['LAST_BYTE', 'NO_LAST_BYTE'], outer_class=root_module['ns3::LteRlcAmHeader']) module.add_enum('ExtensionBit_t', ['DATA_FIELD_FOLLOWS', 'E_LI_FIELDS_FOLLOWS'], outer_class=root_module['ns3::LteRlcAmHeader']) module.add_enum('ResegmentationFlag_t', ['PDU', 'SEGMENT'], outer_class=root_module['ns3::LteRlcAmHeader']) module.add_enum('PollingBit_t', ['STATUS_REPORT_NOT_REQUESTED', 'STATUS_REPORT_IS_REQUESTED'], outer_class=root_module['ns3::LteRlcAmHeader']) module.add_enum('LastSegmentFlag_t', ['NO_LAST_PDU_SEGMENT', 'LAST_PDU_SEGMENT'], outer_class=root_module['ns3::LteRlcAmHeader']) typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::DataControlPdu_t', u'ns3::LteRlcAmHeader::DataControlPdu_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::DataControlPdu_t*', u'ns3::LteRlcAmHeader::DataControlPdu_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::DataControlPdu_t&', u'ns3::LteRlcAmHeader::DataControlPdu_t&') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ControPduType_t', u'ns3::LteRlcAmHeader::ControPduType_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ControPduType_t*', u'ns3::LteRlcAmHeader::ControPduType_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ControPduType_t&', u'ns3::LteRlcAmHeader::ControPduType_t&') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::FramingInfoFirstByte_t', u'ns3::LteRlcAmHeader::FramingInfoFirstByte_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::FramingInfoFirstByte_t*', u'ns3::LteRlcAmHeader::FramingInfoFirstByte_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::FramingInfoFirstByte_t&', u'ns3::LteRlcAmHeader::FramingInfoFirstByte_t&') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::FramingInfoLastByte_t', u'ns3::LteRlcAmHeader::FramingInfoLastByte_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::FramingInfoLastByte_t*', u'ns3::LteRlcAmHeader::FramingInfoLastByte_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::FramingInfoLastByte_t&', u'ns3::LteRlcAmHeader::FramingInfoLastByte_t&') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ExtensionBit_t', u'ns3::LteRlcAmHeader::ExtensionBit_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ExtensionBit_t*', u'ns3::LteRlcAmHeader::ExtensionBit_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ExtensionBit_t&', u'ns3::LteRlcAmHeader::ExtensionBit_t&') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ResegmentationFlag_t', u'ns3::LteRlcAmHeader::ResegmentationFlag_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ResegmentationFlag_t*', u'ns3::LteRlcAmHeader::ResegmentationFlag_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::ResegmentationFlag_t&', u'ns3::LteRlcAmHeader::ResegmentationFlag_t&') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::PollingBit_t', u'ns3::LteRlcAmHeader::PollingBit_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::PollingBit_t*', u'ns3::LteRlcAmHeader::PollingBit_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::PollingBit_t&', u'ns3::LteRlcAmHeader::PollingBit_t&') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::LastSegmentFlag_t', u'ns3::LteRlcAmHeader::LastSegmentFlag_t') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::LastSegmentFlag_t*', u'ns3::LteRlcAmHeader::LastSegmentFlag_t*') typehandlers.add_type_alias(u'ns3::LteRlcAmHeader::LastSegmentFlag_t&', u'ns3::LteRlcAmHeader::LastSegmentFlag_t&') module.add_class('LteRlcHeader', parent=root_module['ns3::Header']) module.add_enum('ExtensionBit_t', ['DATA_FIELD_FOLLOWS', 'E_LI_FIELDS_FOLLOWS'], outer_class=root_module['ns3::LteRlcHeader']) module.add_enum('FramingInfoFirstByte_t', ['FIRST_BYTE', 'NO_FIRST_BYTE'], outer_class=root_module['ns3::LteRlcHeader']) module.add_enum('FramingInfoLastByte_t', ['LAST_BYTE', 'NO_LAST_BYTE'], outer_class=root_module['ns3::LteRlcHeader']) typehandlers.add_type_alias(u'ns3::LteRlcHeader::ExtensionBit_t', u'ns3::LteRlcHeader::ExtensionBit_t') typehandlers.add_type_alias(u'ns3::LteRlcHeader::ExtensionBit_t*', u'ns3::LteRlcHeader::ExtensionBit_t*') typehandlers.add_type_alias(u'ns3::LteRlcHeader::ExtensionBit_t&', u'ns3::LteRlcHeader::ExtensionBit_t&') typehandlers.add_type_alias(u'ns3::LteRlcHeader::FramingInfoFirstByte_t', u'ns3::LteRlcHeader::FramingInfoFirstByte_t') typehandlers.add_type_alias(u'ns3::LteRlcHeader::FramingInfoFirstByte_t*', u'ns3::LteRlcHeader::FramingInfoFirstByte_t*') typehandlers.add_type_alias(u'ns3::LteRlcHeader::FramingInfoFirstByte_t&', u'ns3::LteRlcHeader::FramingInfoFirstByte_t&') typehandlers.add_type_alias(u'ns3::LteRlcHeader::FramingInfoLastByte_t', u'ns3::LteRlcHeader::FramingInfoLastByte_t') typehandlers.add_type_alias(u'ns3::LteRlcHeader::FramingInfoLastByte_t*', u'ns3::LteRlcHeader::FramingInfoLastByte_t*') typehandlers.add_type_alias(u'ns3::LteRlcHeader::FramingInfoLastByte_t&', u'ns3::LteRlcHeader::FramingInfoLastByte_t&') module.add_class('LteRlcSduStatusTag', parent=root_module['ns3::Tag']) module.add_enum('SduStatus_t', ['FULL_SDU', 'FIRST_SEGMENT', 'MIDDLE_SEGMENT', 'LAST_SEGMENT', 'ANY_SEGMENT'], outer_class=root_module['ns3::LteRlcSduStatusTag']) typehandlers.add_type_alias(u'ns3::LteRlcSduStatusTag::SduStatus_t', u'ns3::LteRlcSduStatusTag::SduStatus_t') typehandlers.add_type_alias(u'ns3::LteRlcSduStatusTag::SduStatus_t*', u'ns3::LteRlcSduStatusTag::SduStatus_t*') typehandlers.add_type_alias(u'ns3::LteRlcSduStatusTag::SduStatus_t&', u'ns3::LteRlcSduStatusTag::SduStatus_t&') module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object']) module.add_class('PacketBurst', import_from_module='ns.network', parent=root_module['ns3::Object']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::PacketBurst const > )', u'ns3::PacketBurst::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::PacketBurst const > )*', u'ns3::PacketBurst::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::PacketBurst const > )&', u'ns3::PacketBurst::TracedCallback&') module.add_class('PdcpTag', parent=root_module['ns3::Tag']) module.add_class('PropagationDelayModel', import_from_module='ns.propagation', parent=root_module['ns3::Object']) module.add_class('PropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::Object']) module.add_class('RadioEnvironmentMapHelper', parent=root_module['ns3::Object']) module.add_class('RandomPropagationDelayModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationDelayModel']) module.add_class('RandomPropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object']) module.add_class('RangePropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('RlcTag', parent=root_module['ns3::Tag']) module.add_class('SequentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeChecker', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeChecker>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::EpcTft', 'ns3::empty', 'ns3::DefaultDeleter<ns3::EpcTft>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::EpcTftClassifier', 'ns3::empty', 'ns3::DefaultDeleter<ns3::EpcTftClassifier>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::EventImpl', 'ns3::empty', 'ns3::DefaultDeleter<ns3::EventImpl>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Hash::Implementation>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Ipv4MulticastRoute', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4MulticastRoute>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Ipv4Route', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4Route>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::LteChunkProcessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::LteChunkProcessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::LteControlMessage', 'ns3::empty', 'ns3::DefaultDeleter<ns3::LteControlMessage>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::LteHarqPhy', 'ns3::empty', 'ns3::DefaultDeleter<ns3::LteHarqPhy>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::NixVector', 'ns3::empty', 'ns3::DefaultDeleter<ns3::NixVector>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Packet', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Packet>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::SpectrumModel', 'ns3::empty', 'ns3::DefaultDeleter<ns3::SpectrumModel>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::SpectrumSignalParameters', 'ns3::empty', 'ns3::DefaultDeleter<ns3::SpectrumSignalParameters>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::SpectrumValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::SpectrumValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::VendorSpecificValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::VendorSpecificValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::X2CellInfo', 'ns3::empty', 'ns3::DefaultDeleter<ns3::X2CellInfo>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::X2IfaceInfo', 'ns3::empty', 'ns3::DefaultDeleter<ns3::X2IfaceInfo>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) module.add_class('Socket', import_from_module='ns.network', parent=root_module['ns3::Object']) module.add_enum('SocketErrno', ['ERROR_NOTERROR', 'ERROR_ISCONN', 'ERROR_NOTCONN', 'ERROR_MSGSIZE', 'ERROR_AGAIN', 'ERROR_SHUTDOWN', 'ERROR_OPNOTSUPP', 'ERROR_AFNOSUPPORT', 'ERROR_INVAL', 'ERROR_BADF', 'ERROR_NOROUTETOHOST', 'ERROR_NODEV', 'ERROR_ADDRNOTAVAIL', 'ERROR_ADDRINUSE', 'SOCKET_ERRNO_LAST'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network') module.add_enum('SocketType', ['NS3_SOCK_STREAM', 'NS3_SOCK_SEQPACKET', 'NS3_SOCK_DGRAM', 'NS3_SOCK_RAW'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network') module.add_enum('SocketPriority', ['NS3_PRIO_BESTEFFORT', 'NS3_PRIO_FILLER', 'NS3_PRIO_BULK', 'NS3_PRIO_INTERACTIVE_BULK', 'NS3_PRIO_INTERACTIVE', 'NS3_PRIO_CONTROL'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network') module.add_enum('Ipv6MulticastFilterMode', ['INCLUDE', 'EXCLUDE'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network') module.add_class('SocketIpTosTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) module.add_class('SocketIpTtlTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) module.add_class('SocketIpv6HopLimitTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) module.add_class('SocketIpv6TclassTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) module.add_class('SocketPriorityTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) module.add_class('SocketSetDontFragmentTag', import_from_module='ns.network', parent=root_module['ns3::Tag']) module.add_class('SpectrumInterference', import_from_module='ns.spectrum', parent=root_module['ns3::Object']) module.add_class('SpectrumModel', import_from_module='ns.spectrum', parent=root_module['ns3::SimpleRefCount< ns3::SpectrumModel, ns3::empty, ns3::DefaultDeleter<ns3::SpectrumModel> >']) module.add_class('SpectrumPhy', import_from_module='ns.spectrum', parent=root_module['ns3::Object']) module.add_class('SpectrumPropagationLossModel', import_from_module='ns.spectrum', parent=root_module['ns3::Object']) module.add_class('SpectrumSignalParameters', import_from_module='ns.spectrum', parent=root_module['ns3::SimpleRefCount< ns3::SpectrumSignalParameters, ns3::empty, ns3::DefaultDeleter<ns3::SpectrumSignalParameters> >']) module.add_class('SpectrumValue', import_from_module='ns.spectrum', parent=root_module['ns3::SimpleRefCount< ns3::SpectrumValue, ns3::empty, ns3::DefaultDeleter<ns3::SpectrumValue> >']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumValue > )', u'ns3::SpectrumValue::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumValue > )*', u'ns3::SpectrumValue::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumValue > )&', u'ns3::SpectrumValue::TracedCallback&') module.add_class('ThreeLogDistancePropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('Time', import_from_module='ns.core') module.add_enum('Unit', ['Y', 'D', 'H', 'MIN', 'S', 'MS', 'US', 'NS', 'PS', 'FS', 'LAST'], outer_class=root_module['ns3::Time'], import_from_module='ns.core') typehandlers.add_type_alias(u'void ( * ) ( ns3::Time )', u'ns3::Time::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Time )*', u'ns3::Time::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Time )&', u'ns3::Time::TracedCallback&') root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t']) module.add_class('TraceSourceAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >']) module.add_class('Trailer', import_from_module='ns.network', parent=root_module['ns3::Chunk']) module.add_class('TriangularRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('TwoRayGroundPropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('UeManager', parent=root_module['ns3::Object']) module.add_enum('State', ['INITIAL_RANDOM_ACCESS', 'CONNECTION_SETUP', 'CONNECTION_REJECTED', 'ATTACH_REQUEST', 'CONNECTED_NORMALLY', 'CONNECTION_RECONFIGURATION', 'CONNECTION_REESTABLISHMENT', 'HANDOVER_PREPARATION', 'HANDOVER_JOINING', 'HANDOVER_PATH_SWITCH', 'HANDOVER_LEAVING', 'NUM_STATES'], outer_class=root_module['ns3::UeManager']) typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, ns3::UeManager::State const, ns3::UeManager::State const )', u'ns3::UeManager::StateTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, ns3::UeManager::State const, ns3::UeManager::State const )*', u'ns3::UeManager::StateTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, ns3::UeManager::State const, ns3::UeManager::State const )&', u'ns3::UeManager::StateTracedCallback&') module.add_class('UniformRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('VendorSpecificValue', parent=root_module['ns3::SimpleRefCount< ns3::VendorSpecificValue, ns3::empty, ns3::DefaultDeleter<ns3::VendorSpecificValue> >']) module.add_class('WeibullRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('X2CellInfo', parent=root_module['ns3::SimpleRefCount< ns3::X2CellInfo, ns3::empty, ns3::DefaultDeleter<ns3::X2CellInfo> >']) module.add_class('X2IfaceInfo', parent=root_module['ns3::SimpleRefCount< ns3::X2IfaceInfo, ns3::empty, ns3::DefaultDeleter<ns3::X2IfaceInfo> >']) module.add_class('ZetaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('ZipfRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('Application', import_from_module='ns.network', parent=root_module['ns3::Object']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Time const &, ns3::Address const & )', u'ns3::Application::DelayAddressCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Time const &, ns3::Address const & )*', u'ns3::Application::DelayAddressCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Time const &, ns3::Address const & )&', u'ns3::Application::DelayAddressCallback&') typehandlers.add_type_alias(u'void ( * ) ( std::string const &, std::string const & )', u'ns3::Application::StateTransitionCallback') typehandlers.add_type_alias(u'void ( * ) ( std::string const &, std::string const & )*', u'ns3::Application::StateTransitionCallback*') typehandlers.add_type_alias(u'void ( * ) ( std::string const &, std::string const & )&', u'ns3::Application::StateTransitionCallback&') module.add_class('Asn1Header', parent=root_module['ns3::Header']) module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >']) module.add_class('AttributeChecker', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >']) module.add_class('AttributeValue', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >']) module.add_class('BooleanChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('BooleanValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('CallbackChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >']) module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('CcHelper', parent=root_module['ns3::Object']) module.add_class('Channel', import_from_module='ns.network', parent=root_module['ns3::Object']) module.add_class('ComponentCarrier', parent=root_module['ns3::Object']) module.add_class('ComponentCarrierBaseStation', parent=root_module['ns3::ComponentCarrier']) module.add_class('ComponentCarrierEnb', parent=root_module['ns3::ComponentCarrierBaseStation']) module.add_class('ComponentCarrierUe', parent=root_module['ns3::ComponentCarrier']) module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('ConstantSpeedPropagationDelayModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationDelayModel']) module.add_class('DataCalculator', import_from_module='ns.stats', parent=root_module['ns3::Object']) module.add_class('DataOutputInterface', import_from_module='ns.stats', parent=root_module['ns3::Object']) module.add_class('DataRateChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('DataRateValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('DeterministicRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('DoubleValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('EmpiricalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('EmptyAttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::AttributeAccessor']) module.add_class('EmptyAttributeChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('EnumChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('EnumValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('EpcEnbApplication', parent=root_module['ns3::Application']) module.add_class('EpsFlowId_t', outer_class=root_module['ns3::EpcEnbApplication']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )', u'ns3::EpcEnbApplication::RxTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )*', u'ns3::EpcEnbApplication::RxTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )&', u'ns3::EpcEnbApplication::RxTracedCallback&') module.add_class('EpcHelper', parent=root_module['ns3::Object']) module.add_class('EpcMme', parent=root_module['ns3::Object']) module.add_class('EpcMmeApplication', parent=root_module['ns3::Application']) module.add_class('EpcPgwApplication', parent=root_module['ns3::Application']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )', u'ns3::EpcPgwApplication::RxTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )*', u'ns3::EpcPgwApplication::RxTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )&', u'ns3::EpcPgwApplication::RxTracedCallback&') module.add_class('EpcSgwApplication', parent=root_module['ns3::Application']) module.add_class('EpcSgwPgwApplication', parent=root_module['ns3::Application']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )', u'ns3::EpcSgwPgwApplication::RxTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )*', u'ns3::EpcSgwPgwApplication::RxTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet > )&', u'ns3::EpcSgwPgwApplication::RxTracedCallback&') module.add_class('EpcTft', parent=root_module['ns3::SimpleRefCount< ns3::EpcTft, ns3::empty, ns3::DefaultDeleter<ns3::EpcTft> >']) module.add_enum('Direction', ['DOWNLINK', 'UPLINK', 'BIDIRECTIONAL'], outer_class=root_module['ns3::EpcTft']) module.add_class('PacketFilter', outer_class=root_module['ns3::EpcTft']) module.add_class('EpcTftClassifier', parent=root_module['ns3::SimpleRefCount< ns3::EpcTftClassifier, ns3::empty, ns3::DefaultDeleter<ns3::EpcTftClassifier> >']) module.add_class('EpcUeNas', parent=root_module['ns3::Object']) module.add_enum('State', ['OFF', 'ATTACHING', 'IDLE_REGISTERED', 'CONNECTING_TO_EPC', 'ACTIVE', 'NUM_STATES'], outer_class=root_module['ns3::EpcUeNas']) typehandlers.add_type_alias(u'void ( * ) ( ns3::EpcUeNas::State const, ns3::EpcUeNas::State const )', u'ns3::EpcUeNas::StateTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::EpcUeNas::State const, ns3::EpcUeNas::State const )*', u'ns3::EpcUeNas::StateTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::EpcUeNas::State const, ns3::EpcUeNas::State const )&', u'ns3::EpcUeNas::StateTracedCallback&') module.add_class('EpcX2', parent=root_module['ns3::Object']) module.add_class('EpcX2HandoverPreparationFailureHeader', parent=root_module['ns3::Header']) module.add_class('EpcX2HandoverRequestAckHeader', parent=root_module['ns3::Header']) module.add_class('EpcX2HandoverRequestHeader', parent=root_module['ns3::Header']) module.add_class('EpcX2Header', parent=root_module['ns3::Header']) module.add_enum('ProcedureCode_t', ['HandoverPreparation', 'LoadIndication', 'SnStatusTransfer', 'UeContextRelease', 'ResourceStatusReporting'], outer_class=root_module['ns3::EpcX2Header']) module.add_enum('TypeOfMessage_t', ['InitiatingMessage', 'SuccessfulOutcome', 'UnsuccessfulOutcome'], outer_class=root_module['ns3::EpcX2Header']) module.add_class('EpcX2LoadInformationHeader', parent=root_module['ns3::Header']) module.add_class('EpcX2ResourceStatusUpdateHeader', parent=root_module['ns3::Header']) module.add_class('EpcX2SnStatusTransferHeader', parent=root_module['ns3::Header']) module.add_class('EpcX2UeContextReleaseHeader', parent=root_module['ns3::Header']) module.add_class('ErlangRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >']) module.add_class('ExponentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('FfMacScheduler', parent=root_module['ns3::Object']) module.add_enum('UlCqiFilter_t', ['SRS_UL_CQI', 'PUSCH_UL_CQI'], outer_class=root_module['ns3::FfMacScheduler']) module.add_class('FixedRssLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('FriisPropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('GammaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('GtpcHeader', parent=root_module['ns3::Header']) module.add_enum('InterfaceType_t', ['S1U_ENB_GTPU', 'S5_SGW_GTPU', 'S5_PGW_GTPU', 'S5_SGW_GTPC', 'S5_PGW_GTPC', 'S11_MME_GTPC'], outer_class=root_module['ns3::GtpcHeader']) module.add_enum('MessageType_t', ['Reserved', 'CreateSessionRequest', 'CreateSessionResponse', 'ModifyBearerRequest', 'ModifyBearerResponse', 'DeleteSessionRequest', 'DeleteSessionResponse', 'DeleteBearerCommand', 'DeleteBearerRequest', 'DeleteBearerResponse'], outer_class=root_module['ns3::GtpcHeader']) module.add_class('Fteid_t', outer_class=root_module['ns3::GtpcHeader']) module.add_class('GtpcModifyBearerRequestMessage', parent=[root_module['ns3::GtpcHeader'], root_module['ns3::GtpcIes']]) module.add_class('BearerContextToBeModified', outer_class=root_module['ns3::GtpcModifyBearerRequestMessage']) module.add_class('GtpcModifyBearerResponseMessage', parent=[root_module['ns3::GtpcHeader'], root_module['ns3::GtpcIes']]) module.add_class('GtpuHeader', parent=root_module['ns3::Header']) module.add_class('IntegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('Ipv4', import_from_module='ns.internet', parent=root_module['ns3::Object']) module.add_class('Ipv4AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('Ipv4AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('Ipv4MaskChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('Ipv4MaskValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('Ipv4MulticastRoute', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >']) module.add_class('Ipv4Route', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >']) module.add_class('Ipv6', import_from_module='ns.internet', parent=root_module['ns3::Object']) module.add_class('Ipv6AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('Ipv6AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('Ipv6PrefixChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('Ipv6PrefixValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('LogDistancePropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('LogNormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('LteAmc', parent=root_module['ns3::Object']) module.add_enum('AmcModel', ['PiroEW2010', 'MiErrorModel'], outer_class=root_module['ns3::LteAmc']) module.add_class('LteAnr', parent=root_module['ns3::Object']) module.add_class('LteChunkProcessor', parent=root_module['ns3::SimpleRefCount< ns3::LteChunkProcessor, ns3::empty, ns3::DefaultDeleter<ns3::LteChunkProcessor> >']) module.add_class('LteControlMessage', parent=root_module['ns3::SimpleRefCount< ns3::LteControlMessage, ns3::empty, ns3::DefaultDeleter<ns3::LteControlMessage> >']) module.add_enum('MessageType', ['DL_DCI', 'UL_DCI', 'DL_CQI', 'UL_CQI', 'BSR', 'DL_HARQ', 'RACH_PREAMBLE', 'RAR', 'MIB', 'SIB1'], outer_class=root_module['ns3::LteControlMessage']) module.add_class('LteEnbComponentCarrierManager', parent=root_module['ns3::Object']) module.add_class('LteEnbMac', parent=root_module['ns3::Object']) typehandlers.add_type_alias(u'void ( * ) ( uint32_t const, uint32_t const, uint16_t const, uint8_t const, uint16_t const, uint8_t const, uint16_t const, uint8_t const )', u'ns3::LteEnbMac::DlSchedulingTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint32_t const, uint32_t const, uint16_t const, uint8_t const, uint16_t const, uint8_t const, uint16_t const, uint8_t const )*', u'ns3::LteEnbMac::DlSchedulingTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint32_t const, uint32_t const, uint16_t const, uint8_t const, uint16_t const, uint8_t const, uint16_t const, uint8_t const )&', u'ns3::LteEnbMac::DlSchedulingTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint32_t const, uint32_t const, uint16_t const, uint8_t const, uint16_t const )', u'ns3::LteEnbMac::UlSchedulingTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint32_t const, uint32_t const, uint16_t const, uint8_t const, uint16_t const )*', u'ns3::LteEnbMac::UlSchedulingTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint32_t const, uint32_t const, uint16_t const, uint8_t const, uint16_t const )&', u'ns3::LteEnbMac::UlSchedulingTracedCallback&') module.add_class('LteEnbRrc', parent=root_module['ns3::Object']) module.add_enum('LteEpsBearerToRlcMapping_t', ['RLC_SM_ALWAYS', 'RLC_UM_ALWAYS', 'RLC_AM_ALWAYS', 'PER_BASED'], outer_class=root_module['ns3::LteEnbRrc']) typehandlers.add_type_alias(u'void ( * ) ( uint16_t const, uint16_t const )', u'ns3::LteEnbRrc::NewUeContextTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t const, uint16_t const )*', u'ns3::LteEnbRrc::NewUeContextTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t const, uint16_t const )&', u'ns3::LteEnbRrc::NewUeContextTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const )', u'ns3::LteEnbRrc::ConnectionHandoverTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const )*', u'ns3::LteEnbRrc::ConnectionHandoverTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const )&', u'ns3::LteEnbRrc::ConnectionHandoverTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, uint16_t const )', u'ns3::LteEnbRrc::HandoverStartTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, uint16_t const )*', u'ns3::LteEnbRrc::HandoverStartTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, uint16_t const )&', u'ns3::LteEnbRrc::HandoverStartTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, ns3::LteRrcSap::MeasurementReport const )', u'ns3::LteEnbRrc::ReceiveReportTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, ns3::LteRrcSap::MeasurementReport const )*', u'ns3::LteEnbRrc::ReceiveReportTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t const, uint16_t const, uint16_t const, ns3::LteRrcSap::MeasurementReport const )&', u'ns3::LteEnbRrc::ReceiveReportTracedCallback&') module.add_class('LteEnbRrcProtocolIdeal', parent=root_module['ns3::Object']) module.add_class('LteEnbRrcProtocolReal', parent=root_module['ns3::Object']) module.add_class('LteFfrAlgorithm', parent=root_module['ns3::Object']) module.add_class('LteFfrDistributedAlgorithm', parent=root_module['ns3::LteFfrAlgorithm']) module.add_class('LteFfrEnhancedAlgorithm', parent=root_module['ns3::LteFfrAlgorithm']) module.add_class('LteFfrSoftAlgorithm', parent=root_module['ns3::LteFfrAlgorithm']) module.add_class('LteFrHardAlgorithm', parent=root_module['ns3::LteFfrAlgorithm']) module.add_class('LteFrNoOpAlgorithm', parent=root_module['ns3::LteFfrAlgorithm']) module.add_class('LteFrSoftAlgorithm', parent=root_module['ns3::LteFfrAlgorithm']) module.add_class('LteFrStrictAlgorithm', parent=root_module['ns3::LteFfrAlgorithm']) module.add_class('LteHandoverAlgorithm', parent=root_module['ns3::Object']) module.add_class('LteHarqPhy', parent=root_module['ns3::SimpleRefCount< ns3::LteHarqPhy, ns3::empty, ns3::DefaultDeleter<ns3::LteHarqPhy> >']) module.add_class('LteHelper', parent=root_module['ns3::Object']) module.add_class('LteHexGridEnbTopologyHelper', parent=root_module['ns3::Object']) module.add_class('LteInterference', parent=root_module['ns3::Object']) module.add_class('LtePdcp', parent=root_module['ns3::Object']) module.add_class('Status', outer_class=root_module['ns3::LtePdcp']) typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t )', u'ns3::LtePdcp::PduTxTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t )*', u'ns3::LtePdcp::PduTxTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t )&', u'ns3::LtePdcp::PduTxTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint16_t const, uint8_t const, uint32_t const, uint64_t const )', u'ns3::LtePdcp::PduRxTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t const, uint8_t const, uint32_t const, uint64_t const )*', u'ns3::LtePdcp::PduRxTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t const, uint8_t const, uint32_t const, uint64_t const )&', u'ns3::LtePdcp::PduRxTracedCallback&') module.add_class('LtePhy', parent=root_module['ns3::Object']) module.add_class('LteRadioBearerInfo', parent=root_module['ns3::Object']) module.add_class('LteRlc', parent=root_module['ns3::Object']) typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t )', u'ns3::LteRlc::NotifyTxTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t )*', u'ns3::LteRlc::NotifyTxTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t )&', u'ns3::LteRlc::NotifyTxTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t, uint64_t )', u'ns3::LteRlc::ReceiveTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t, uint64_t )*', u'ns3::LteRlc::ReceiveTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint8_t, uint32_t, uint64_t )&', u'ns3::LteRlc::ReceiveTracedCallback&') module.add_class('LteRlcAm', parent=root_module['ns3::LteRlc']) module.add_class('LteRlcSm', parent=root_module['ns3::LteRlc']) module.add_class('LteRlcTm', parent=root_module['ns3::LteRlc']) module.add_class('LteRlcUm', parent=root_module['ns3::LteRlc']) module.add_class('LteSignalingRadioBearerInfo', parent=root_module['ns3::LteRadioBearerInfo']) module.add_class('LteSpectrumPhy', parent=root_module['ns3::SpectrumPhy']) module.add_enum('State', ['IDLE', 'TX_DL_CTRL', 'TX_DATA', 'TX_UL_SRS', 'RX_DL_CTRL', 'RX_DATA', 'RX_UL_SRS'], outer_class=root_module['ns3::LteSpectrumPhy']) module.add_class('LteSpectrumSignalParameters', parent=root_module['ns3::SpectrumSignalParameters']) module.add_class('LteSpectrumSignalParametersDataFrame', parent=root_module['ns3::SpectrumSignalParameters']) module.add_class('LteSpectrumSignalParametersDlCtrlFrame', parent=root_module['ns3::SpectrumSignalParameters']) module.add_class('LteSpectrumSignalParametersUlSrsFrame', parent=root_module['ns3::SpectrumSignalParameters']) module.add_class('LteStatsCalculator', parent=root_module['ns3::Object']) module.add_class('LteUeComponentCarrierManager', parent=root_module['ns3::Object']) module.add_class('LteUeMac', parent=root_module['ns3::Object']) module.add_class('LteUePhy', parent=root_module['ns3::LtePhy']) module.add_enum('State', ['CELL_SEARCH', 'SYNCHRONIZED', 'NUM_STATES'], outer_class=root_module['ns3::LteUePhy']) typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, ns3::LteUePhy::State, ns3::LteUePhy::State )', u'ns3::LteUePhy::StateTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, ns3::LteUePhy::State, ns3::LteUePhy::State )*', u'ns3::LteUePhy::StateTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, ns3::LteUePhy::State, ns3::LteUePhy::State )&', u'ns3::LteUePhy::StateTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, double, uint8_t )', u'ns3::LteUePhy::RsrpSinrTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, double, uint8_t )*', u'ns3::LteUePhy::RsrpSinrTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, double, uint8_t )&', u'ns3::LteUePhy::RsrpSinrTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, double, bool, uint8_t )', u'ns3::LteUePhy::RsrpRsrqTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, double, bool, uint8_t )*', u'ns3::LteUePhy::RsrpRsrqTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, double, bool, uint8_t )&', u'ns3::LteUePhy::RsrpRsrqTracedCallback&') module.add_class('LteUePowerControl', parent=root_module['ns3::Object']) typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double )', u'ns3::LteUePowerControl::TxPowerTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double )*', u'ns3::LteUePowerControl::TxPowerTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double )&', u'ns3::LteUePowerControl::TxPowerTracedCallback&') module.add_class('LteUeRrc', parent=root_module['ns3::Object']) module.add_enum('State', ['IDLE_START', 'IDLE_CELL_SEARCH', 'IDLE_WAIT_MIB_SIB1', 'IDLE_WAIT_MIB', 'IDLE_WAIT_SIB1', 'IDLE_CAMPED_NORMALLY', 'IDLE_WAIT_SIB2', 'IDLE_RANDOM_ACCESS', 'IDLE_CONNECTING', 'CONNECTED_NORMALLY', 'CONNECTED_HANDOVER', 'CONNECTED_PHY_PROBLEM', 'CONNECTED_REESTABLISHING', 'NUM_STATES'], outer_class=root_module['ns3::LteUeRrc']) typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t )', u'ns3::LteUeRrc::CellSelectionTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t )*', u'ns3::LteUeRrc::CellSelectionTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t )&', u'ns3::LteUeRrc::CellSelectionTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t )', u'ns3::LteUeRrc::ImsiCidRntiTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t )*', u'ns3::LteUeRrc::ImsiCidRntiTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t )&', u'ns3::LteUeRrc::ImsiCidRntiTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t, uint16_t )', u'ns3::LteUeRrc::MibSibHandoverTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t, uint16_t )*', u'ns3::LteUeRrc::MibSibHandoverTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t, uint16_t )&', u'ns3::LteUeRrc::MibSibHandoverTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t, ns3::LteUeRrc::State, ns3::LteUeRrc::State )', u'ns3::LteUeRrc::StateTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t, ns3::LteUeRrc::State, ns3::LteUeRrc::State )*', u'ns3::LteUeRrc::StateTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint64_t, uint16_t, uint16_t, ns3::LteUeRrc::State, ns3::LteUeRrc::State )&', u'ns3::LteUeRrc::StateTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::LteUeRrc >, std::list< ns3::LteRrcSap::SCellToAddMod > )', u'ns3::LteUeRrc::SCarrierConfiguredTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::LteUeRrc >, std::list< ns3::LteRrcSap::SCellToAddMod > )*', u'ns3::LteUeRrc::SCarrierConfiguredTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::LteUeRrc >, std::list< ns3::LteRrcSap::SCellToAddMod > )&', u'ns3::LteUeRrc::SCarrierConfiguredTracedCallback&') module.add_class('LteUeRrcProtocolIdeal', parent=root_module['ns3::Object']) module.add_class('LteUeRrcProtocolReal', parent=root_module['ns3::Object']) module.add_class('Mac48AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('Mac48AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('Mac64AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('Mac64AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('MacStatsCalculator', parent=root_module['ns3::LteStatsCalculator']) module.add_class('MatrixPropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('MibLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('MinMaxAvgTotalCalculator', import_from_module='ns.stats', template_parameters=['unsigned int'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']]) module.add_class('MinMaxAvgTotalCalculator', import_from_module='ns.stats', template_parameters=['unsigned long'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']]) module.add_class('MobilityModel', import_from_module='ns.mobility', parent=root_module['ns3::Object']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::MobilityModel const > )', u'ns3::MobilityModel::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::MobilityModel const > )*', u'ns3::MobilityModel::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::MobilityModel const > )&', u'ns3::MobilityModel::TracedCallback&') module.add_class('NakagamiPropagationLossModel', import_from_module='ns.propagation', parent=root_module['ns3::PropagationLossModel']) module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object']) module.add_enum('PacketType', ['PACKET_HOST', 'NS3_PACKET_HOST', 'PACKET_BROADCAST', 'NS3_PACKET_BROADCAST', 'PACKET_MULTICAST', 'NS3_PACKET_MULTICAST', 'PACKET_OTHERHOST', 'NS3_PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice'], import_from_module='ns.network') typehandlers.add_type_alias(u'void ( * ) ( )', u'ns3::NetDevice::LinkChangeTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( )*', u'ns3::NetDevice::LinkChangeTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( )&', u'ns3::NetDevice::LinkChangeTracedCallback&') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::NetDevice::ReceiveCallback') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::NetDevice::ReceiveCallback*') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::NetDevice::ReceiveCallback&') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', u'ns3::NetDevice::PromiscReceiveCallback') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::NetDevice::PromiscReceiveCallback*') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::NetDevice::PromiscReceiveCallback&') module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >']) module.add_class('NoOpComponentCarrierManager', parent=root_module['ns3::LteEnbComponentCarrierManager']) module.add_class('NoOpHandoverAlgorithm', parent=root_module['ns3::LteHandoverAlgorithm']) module.add_class('Node', import_from_module='ns.network', parent=root_module['ns3::Object']) typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Node::ProtocolHandler') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Node::ProtocolHandler*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Node::ProtocolHandler&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Node::DeviceAdditionListener') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Node::DeviceAdditionListener*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Node::DeviceAdditionListener&') module.add_class('NormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > )', u'ns3::Packet::TracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > )*', u'ns3::Packet::TracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > )&', u'ns3::Packet::TracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )', u'ns3::Packet::AddressTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )*', u'ns3::Packet::AddressTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )&', u'ns3::Packet::AddressTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )', u'ns3::Packet::TwoAddressTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )*', u'ns3::Packet::TwoAddressTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )&', u'ns3::Packet::TwoAddressTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )', u'ns3::Packet::Mac48AddressTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )*', u'ns3::Packet::Mac48AddressTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )&', u'ns3::Packet::Mac48AddressTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )', u'ns3::Packet::SizeTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )*', u'ns3::Packet::SizeTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )&', u'ns3::Packet::SizeTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, double )', u'ns3::Packet::SinrTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, double )*', u'ns3::Packet::SinrTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, double )&', u'ns3::Packet::SinrTracedCallback&') module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream']) module.add_class('PfFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('PhyRxStatsCalculator', parent=root_module['ns3::LteStatsCalculator']) module.add_class('PhyStatsCalculator', parent=root_module['ns3::LteStatsCalculator']) module.add_class('PhyTxStatsCalculator', parent=root_module['ns3::LteStatsCalculator']) module.add_class('PointToPointEpcHelper', parent=root_module['ns3::EpcHelper']) module.add_class('PointerChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('PointerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('PssFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('RachPreambleLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('RadioBearerStatsCalculator', parent=root_module['ns3::LteStatsCalculator']) module.add_class('RarLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('Rar', outer_class=root_module['ns3::RarLteControlMessage']) module.add_class('RemSpectrumPhy', parent=root_module['ns3::SpectrumPhy']) module.add_class('RrComponentCarrierManager', parent=root_module['ns3::NoOpComponentCarrierManager']) module.add_class('RrFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('RrcAsn1Header', parent=root_module['ns3::Asn1Header']) module.add_class('RrcDlCcchMessage', parent=root_module['ns3::RrcAsn1Header']) module.add_class('RrcDlDcchMessage', parent=root_module['ns3::RrcAsn1Header']) module.add_class('RrcUlCcchMessage', parent=root_module['ns3::RrcAsn1Header']) module.add_class('RrcUlDcchMessage', parent=root_module['ns3::RrcAsn1Header']) module.add_class('Sib1LteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('SimpleUeComponentCarrierManager', parent=root_module['ns3::LteUeComponentCarrierManager']) module.add_class('SpectrumChannel', import_from_module='ns.spectrum', parent=root_module['ns3::Channel']) typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumPhy const >, ns3::Ptr< ns3::SpectrumPhy const >, double )', u'ns3::SpectrumChannel::LossTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumPhy const >, ns3::Ptr< ns3::SpectrumPhy const >, double )*', u'ns3::SpectrumChannel::LossTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumPhy const >, ns3::Ptr< ns3::SpectrumPhy const >, double )&', u'ns3::SpectrumChannel::LossTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::MobilityModel const >, ns3::Ptr< ns3::MobilityModel const >, double, double, double, double )', u'ns3::SpectrumChannel::GainTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::MobilityModel const >, ns3::Ptr< ns3::MobilityModel const >, double, double, double, double )*', u'ns3::SpectrumChannel::GainTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::MobilityModel const >, ns3::Ptr< ns3::MobilityModel const >, double, double, double, double )&', u'ns3::SpectrumChannel::GainTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumSignalParameters > )', u'ns3::SpectrumChannel::SignalParametersTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumSignalParameters > )*', u'ns3::SpectrumChannel::SignalParametersTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::SpectrumSignalParameters > )&', u'ns3::SpectrumChannel::SignalParametersTracedCallback&') module.add_class('SrsCqiRntiVsp', parent=root_module['ns3::VendorSpecificValue']) module.add_class('StringChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('StringValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('TdBetFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('TdMtFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('TdTbfqFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('TimeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('TtaFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('TypeIdChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('TypeIdValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('UintegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('UlDciLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('Vector2DChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('Vector2DValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('Vector3DChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) module.add_class('Vector3DValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) module.add_class('VirtualNetDevice', import_from_module='ns.virtual_net_device', parent=root_module['ns3::NetDevice']) typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::Address const &, ns3::Address const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::VirtualNetDevice::SendCallback') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::Address const &, ns3::Address const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::VirtualNetDevice::SendCallback*') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::Address const &, ns3::Address const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::VirtualNetDevice::SendCallback&') module.add_class('A2A4RsrqHandoverAlgorithm', parent=root_module['ns3::LteHandoverAlgorithm']) module.add_class('A3RsrpHandoverAlgorithm', parent=root_module['ns3::LteHandoverAlgorithm']) module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker']) module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue']) module.add_class('BsrLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<const ns3::Packet>', 'unsigned short', 'const ns3::Address &', 'const ns3::Address &', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<const ns3::Packet>', 'unsigned short', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['bool', 'ns3::Ptr<ns3::Packet>', 'const ns3::Address &', 'const ns3::Address &', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['bool', 'ns3::Ptr<ns3::Socket>', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'const ns3::SpectrumValue &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'ns3::DlSchedulingCallbackInfo', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'ns3::EpcUeNas::State', 'ns3::EpcUeNas::State', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'ns3::PhyReceptionStatParameters', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'ns3::PhyTransmissionStatParameters', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<const ns3::MobilityModel>', 'ns3::Ptr<const ns3::MobilityModel>', 'double', 'double', 'double', 'double', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<const ns3::MobilityModel>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<const ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<const ns3::PacketBurst>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<const ns3::SpectrumPhy>', 'ns3::Ptr<const ns3::SpectrumPhy>', 'double', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::LteUeRrc>', 'std::list<ns3::LteRrcSap::SCellToAddMod, std::allocator<ns3::LteRrcSap::SCellToAddMod> >', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<const ns3::Packet>', 'unsigned short', 'const ns3::Address &', 'const ns3::Address &', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::SpectrumSignalParameters>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned int', 'unsigned int', 'unsigned short', 'unsigned char', 'unsigned short', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned long', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'unsigned long', 'unsigned short', 'unsigned short', 'ns3::LteRrcSap::MeasurementReport', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'unsigned long', 'unsigned short', 'unsigned short', 'ns3::LteUeRrc::State', 'ns3::LteUeRrc::State', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'unsigned long', 'unsigned short', 'unsigned short', 'ns3::UeManager::State', 'ns3::UeManager::State', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned long', 'unsigned short', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned long', 'unsigned short', 'unsigned short', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'ns3::Ptr<ns3::SpectrumValue>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'unsigned char', 'unsigned int', 'unsigned long', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'unsigned short', 'double', 'double', 'bool', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'unsigned short', 'double', 'double', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'unsigned short', 'double', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'unsigned short', 'double', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', template_parameters=['void', 'unsigned short', 'unsigned short', 'ns3::LteUePhy::State', 'ns3::LteUePhy::State', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned short', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase']) module.add_class('CqaFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('DlCqiLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('DlDciLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('DlHarqFeedbackLteControlMessage', parent=root_module['ns3::LteControlMessage']) module.add_class('EmuEpcHelper', parent=root_module['ns3::EpcHelper']) module.add_class('FdBetFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('FdMtFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('FdTbfqFfMacScheduler', parent=root_module['ns3::FfMacScheduler']) module.add_class('GtpcCreateSessionRequestMessage', parent=[root_module['ns3::GtpcHeader'], root_module['ns3::GtpcIes']]) module.add_class('BearerContextToBeCreated', outer_class=root_module['ns3::GtpcCreateSessionRequestMessage']) module.add_class('GtpcCreateSessionResponseMessage', parent=[root_module['ns3::GtpcHeader'], root_module['ns3::GtpcIes']]) module.add_class('BearerContextCreated', outer_class=root_module['ns3::GtpcCreateSessionResponseMessage']) module.add_class('GtpcDeleteBearerCommandMessage', parent=[root_module['ns3::GtpcHeader'], root_module['ns3::GtpcIes']]) module.add_class('BearerContext', outer_class=root_module['ns3::GtpcDeleteBearerCommandMessage']) module.add_class('GtpcDeleteBearerRequestMessage', parent=[root_module['ns3::GtpcHeader'], root_module['ns3::GtpcIes']]) module.add_class('GtpcDeleteBearerResponseMessage', parent=[root_module['ns3::GtpcHeader'], root_module['ns3::GtpcIes']]) module.add_class('HandoverPreparationInfoHeader', parent=root_module['ns3::RrcAsn1Header']) module.add_class('LteDataRadioBearerInfo', parent=root_module['ns3::LteRadioBearerInfo']) module.add_class('LteEnbPhy', parent=root_module['ns3::LtePhy']) typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, uint8_t )', u'ns3::LteEnbPhy::ReportUeSinrTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, uint8_t )*', u'ns3::LteEnbPhy::ReportUeSinrTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t, double, uint8_t )&', u'ns3::LteEnbPhy::ReportUeSinrTracedCallback&') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, ns3::Ptr< ns3::SpectrumValue > )', u'ns3::LteEnbPhy::ReportInterferenceTracedCallback') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, ns3::Ptr< ns3::SpectrumValue > )*', u'ns3::LteEnbPhy::ReportInterferenceTracedCallback*') typehandlers.add_type_alias(u'void ( * ) ( uint16_t, ns3::Ptr< ns3::SpectrumValue > )&', u'ns3::LteEnbPhy::ReportInterferenceTracedCallback&') module.add_class('LteNetDevice', parent=root_module['ns3::NetDevice']) module.add_class('LteUeNetDevice', parent=root_module['ns3::LteNetDevice']) module.add_class('MeasurementReportHeader', parent=root_module['ns3::RrcUlDcchMessage']) module.add_class('RrcConnectionReconfigurationCompleteHeader', parent=root_module['ns3::RrcUlDcchMessage']) module.add_class('RrcConnectionReconfigurationHeader', parent=root_module['ns3::RrcDlDcchMessage']) module.add_class('RrcConnectionReestablishmentCompleteHeader', parent=root_module['ns3::RrcUlDcchMessage']) module.add_class('RrcConnectionReestablishmentHeader', parent=root_module['ns3::RrcDlCcchMessage']) module.add_class('RrcConnectionReestablishmentRejectHeader', parent=root_module['ns3::RrcDlCcchMessage']) module.add_class('RrcConnectionReestablishmentRequestHeader', parent=root_module['ns3::RrcUlCcchMessage']) module.add_class('RrcConnectionRejectHeader', parent=root_module['ns3::RrcDlCcchMessage']) module.add_class('RrcConnectionReleaseHeader', parent=root_module['ns3::RrcDlDcchMessage']) module.add_class('RrcConnectionRequestHeader', parent=root_module['ns3::RrcUlCcchMessage']) module.add_class('RrcConnectionSetupCompleteHeader', parent=root_module['ns3::RrcUlDcchMessage']) module.add_class('RrcConnectionSetupHeader', parent=root_module['ns3::RrcDlCcchMessage']) module.add_class('LteEnbNetDevice', parent=root_module['ns3::LteNetDevice']) module.add_container('std::vector< ns3::CeBitmap_e >', 'ns3::CeBitmap_e', container_type=u'vector') module.add_container('std::vector< std::vector< ns3::RlcPduListElement_s > >', 'std::vector< ns3::RlcPduListElement_s >', container_type=u'vector') module.add_container('std::vector< unsigned char >', 'unsigned char', container_type=u'vector') module.add_container('std::vector< unsigned short >', 'short unsigned int', container_type=u'vector') module.add_container('std::vector< ns3::DlInfoListElement_s::HarqStatus_e >', 'ns3::DlInfoListElement_s::HarqStatus_e', container_type=u'vector') module.add_container('std::list< ns3::EpcEnbS1SapProvider::BearerToBeSwitched >', 'ns3::EpcEnbS1SapProvider::BearerToBeSwitched', container_type=u'list') module.add_container('std::list< ns3::EpcS11SapMme::BearerContextCreated >', 'ns3::EpcS11SapMme::BearerContextCreated', container_type=u'list') module.add_container('std::list< ns3::EpcS11SapMme::BearerContextRemoved >', 'ns3::EpcS11SapMme::BearerContextRemoved', container_type=u'list') module.add_container('std::list< ns3::EpcS11SapSgw::BearerContextToBeCreated >', 'ns3::EpcS11SapSgw::BearerContextToBeCreated', container_type=u'list') module.add_container('std::list< ns3::EpcS11SapSgw::BearerContextToBeRemoved >', 'ns3::EpcS11SapSgw::BearerContextToBeRemoved', container_type=u'list') module.add_container('std::list< ns3::EpcS11SapSgw::BearerContextRemovedSgwPgw >', 'ns3::EpcS11SapSgw::BearerContextRemovedSgwPgw', container_type=u'list') module.add_container('std::list< ns3::EpcS1apSapEnb::ErabToBeSetupItem >', 'ns3::EpcS1apSapEnb::ErabToBeSetupItem', container_type=u'list') module.add_container('std::list< ns3::EpcS1apSapEnb::ErabSwitchedInUplinkItem >', 'ns3::EpcS1apSapEnb::ErabSwitchedInUplinkItem', container_type=u'list') module.add_container('std::list< ns3::EpcS1apSapMme::ErabToBeReleasedIndication >', 'ns3::EpcS1apSapMme::ErabToBeReleasedIndication', container_type=u'list') module.add_container('std::list< ns3::EpcS1apSapMme::ErabSetupItem >', 'ns3::EpcS1apSapMme::ErabSetupItem', container_type=u'list') module.add_container('std::list< ns3::EpcS1apSapMme::ErabSwitchedInDownlinkItem >', 'ns3::EpcS1apSapMme::ErabSwitchedInDownlinkItem', container_type=u'list') module.add_container('std::vector< bool >', 'bool', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::UlInterferenceOverloadIndicationItem >', 'ns3::EpcX2Sap::UlInterferenceOverloadIndicationItem', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::UlHighInterferenceInformationItem >', 'ns3::EpcX2Sap::UlHighInterferenceInformationItem', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::ErabToBeSetupItem >', 'ns3::EpcX2Sap::ErabToBeSetupItem', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::ErabAdmittedItem >', 'ns3::EpcX2Sap::ErabAdmittedItem', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::ErabNotAdmittedItem >', 'ns3::EpcX2Sap::ErabNotAdmittedItem', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::ErabsSubjectToStatusTransferItem >', 'ns3::EpcX2Sap::ErabsSubjectToStatusTransferItem', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::CellInformationItem >', 'ns3::EpcX2Sap::CellInformationItem', container_type=u'vector') module.add_container('std::vector< ns3::EpcX2Sap::CellMeasurementResultItem >', 'ns3::EpcX2Sap::CellMeasurementResultItem', container_type=u'vector') module.add_container('std::vector< ns3::VendorSpecificListElement_s >', 'ns3::VendorSpecificListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::LogicalChannelConfigListElement_s >', 'ns3::LogicalChannelConfigListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::PagingInfoListElement_s >', 'ns3::PagingInfoListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::DlInfoListElement_s >', 'ns3::DlInfoListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::RachListElement_s >', 'ns3::RachListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::CqiListElement_s >', 'ns3::CqiListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::UlInfoListElement_s >', 'ns3::UlInfoListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::SrListElement_s >', 'ns3::SrListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::MacCeListElement_s >', 'ns3::MacCeListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::BuildDataListElement_s >', 'ns3::BuildDataListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::BuildRarListElement_s >', 'ns3::BuildRarListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::BuildBroadcastListElement_s >', 'ns3::BuildBroadcastListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::UlDciListElement_s >', 'ns3::UlDciListElement_s', container_type=u'vector') module.add_container('std::vector< ns3::PhichListElement_s >', 'ns3::PhichListElement_s', container_type=u'vector') module.add_container('std::list< ns3::EpcTft::PacketFilter >', 'ns3::EpcTft::PacketFilter', container_type=u'list') module.add_container('std::map< std::string, ns3::LogComponent * >', ('std::string', 'ns3::LogComponent *'), container_type=u'map') module.add_container('std::vector< ns3::LteCcmRrcSapProvider::LcsConfig >', 'ns3::LteCcmRrcSapProvider::LcsConfig', container_type=u'vector') module.add_container('std::vector< ns3::LteRrcSap::LogicalChannelConfig >', 'ns3::LteRrcSap::LogicalChannelConfig', container_type=u'vector') module.add_container('std::map< unsigned short, std::vector< double > >', ('short unsigned int', 'std::vector< double >'), container_type=u'map') module.add_container('std::vector< int >', 'int', container_type=u'vector') module.add_container('ns3::HarqProcessInfoList_t', 'ns3::HarqProcessInfoElement_t', container_type=u'vector') module.add_container('std::list< ns3::LteRrcSap::SrbToAddMod >', 'ns3::LteRrcSap::SrbToAddMod', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::DrbToAddMod >', 'ns3::LteRrcSap::DrbToAddMod', container_type=u'list') module.add_container('std::list< unsigned char >', 'unsigned char', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::CellsToAddMod >', 'ns3::LteRrcSap::CellsToAddMod', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::BlackCellsToAddMod >', 'ns3::LteRrcSap::BlackCellsToAddMod', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::MeasObjectToAddMod >', 'ns3::LteRrcSap::MeasObjectToAddMod', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::ReportConfigToAddMod >', 'ns3::LteRrcSap::ReportConfigToAddMod', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::MeasIdToAddMod >', 'ns3::LteRrcSap::MeasIdToAddMod', container_type=u'list') module.add_container('std::list< unsigned int >', 'unsigned int', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::MeasResultScell >', 'ns3::LteRrcSap::MeasResultScell', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::MeasResultBestNeighCell >', 'ns3::LteRrcSap::MeasResultBestNeighCell', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::MeasResultEutra >', 'ns3::LteRrcSap::MeasResultEutra', container_type=u'list') module.add_container('std::list< ns3::LteRrcSap::SCellToAddMod >', 'ns3::LteRrcSap::SCellToAddMod', container_type=u'list') module.add_container('std::map< int, double >', ('int', 'double'), container_type=u'map') module.add_container('std::vector< ns3::LteUeCcmRrcSapProvider::LcsConfig >', 'ns3::LteUeCcmRrcSapProvider::LcsConfig', container_type=u'vector') module.add_container('std::vector< ns3::LteUeCphySapUser::UeMeasurementsElement >', 'ns3::LteUeCphySapUser::UeMeasurementsElement', container_type=u'vector') module.add_container('std::vector< ns3::HigherLayerSelected_s >', 'ns3::HigherLayerSelected_s', container_type=u'vector') module.add_container('std::vector< ns3::SiMessageListElement_s >', 'ns3::SiMessageListElement_s', container_type=u'vector') module.add_container('std::list< ns3::Ptr< ns3::Packet > >', 'ns3::Ptr< ns3::Packet >', container_type=u'list') module.add_container('std::vector< ns3::Ipv6Address >', 'ns3::Ipv6Address', container_type=u'vector') module.add_container('std::vector< double >', 'double', container_type=u'vector') module.add_container('ns3::Bands', 'ns3::BandInfo', container_type=u'vector') module.add_container('std::map< unsigned char, ns3::ComponentCarrier >', ('unsigned char', 'ns3::ComponentCarrier'), container_type=u'map') module.add_container('std::list< ns3::GtpcModifyBearerRequestMessage::BearerContextToBeModified >', 'ns3::GtpcModifyBearerRequestMessage::BearerContextToBeModified', container_type=u'list') module.add_container('std::map< unsigned int, unsigned int >', ('unsigned int', 'unsigned int'), container_type=u'map') module.add_container('std::map< unsigned char, ns3::Ptr< ns3::ComponentCarrierBaseStation > >', ('unsigned char', 'ns3::Ptr< ns3::ComponentCarrierBaseStation >'), container_type=u'map') module.add_container('std::list< ns3::Ptr< ns3::LteControlMessage > >', 'ns3::Ptr< ns3::LteControlMessage >', container_type=u'list') module.add_container('std::list< ns3::GtpcCreateSessionRequestMessage::BearerContextToBeCreated >', 'ns3::GtpcCreateSessionRequestMessage::BearerContextToBeCreated', container_type=u'list') module.add_container('std::list< ns3::GtpcCreateSessionResponseMessage::BearerContextCreated >', 'ns3::GtpcCreateSessionResponseMessage::BearerContextCreated', container_type=u'list') module.add_container('std::list< ns3::GtpcDeleteBearerCommandMessage::BearerContext >', 'ns3::GtpcDeleteBearerCommandMessage::BearerContext', container_type=u'list') module.add_container('std::list< ns3::UlDciLteControlMessage >', 'ns3::UlDciLteControlMessage', container_type=u'list') module.add_container('std::map< unsigned char, ns3::Ptr< ns3::ComponentCarrierUe > >', ('unsigned char', 'ns3::Ptr< ns3::ComponentCarrierUe >'), container_type=u'map') typehandlers.add_type_alias(u'std::vector< unsigned char >', u'ns3::DlHarqProcessesStatus_t') typehandlers.add_type_alias(u'std::vector< unsigned char >*', u'ns3::DlHarqProcessesStatus_t*') typehandlers.add_type_alias(u'std::vector< unsigned char >&', u'ns3::DlHarqProcessesStatus_t&') typehandlers.add_type_alias(u'std::vector< unsigned char >', u'ns3::DlHarqProcessesTimer_t') typehandlers.add_type_alias(u'std::vector< unsigned char >*', u'ns3::DlHarqProcessesTimer_t*') typehandlers.add_type_alias(u'std::vector< unsigned char >&', u'ns3::DlHarqProcessesTimer_t&') typehandlers.add_type_alias(u'std::vector< ns3::DlDciListElement_s >', u'ns3::DlHarqProcessesDciBuffer_t') typehandlers.add_type_alias(u'std::vector< ns3::DlDciListElement_s >*', u'ns3::DlHarqProcessesDciBuffer_t*') typehandlers.add_type_alias(u'std::vector< ns3::DlDciListElement_s >&', u'ns3::DlHarqProcessesDciBuffer_t&') typehandlers.add_type_alias(u'std::vector< std::vector< ns3::RlcPduListElement_s > >', u'ns3::RlcPduList_t') typehandlers.add_type_alias(u'std::vector< std::vector< ns3::RlcPduListElement_s > >*', u'ns3::RlcPduList_t*') typehandlers.add_type_alias(u'std::vector< std::vector< ns3::RlcPduListElement_s > >&', u'ns3::RlcPduList_t&') typehandlers.add_type_alias(u'std::vector< std::vector< std::vector< ns3::RlcPduListElement_s > > >', u'ns3::DlHarqRlcPduListBuffer_t') typehandlers.add_type_alias(u'std::vector< std::vector< std::vector< ns3::RlcPduListElement_s > > >*', u'ns3::DlHarqRlcPduListBuffer_t*') typehandlers.add_type_alias(u'std::vector< std::vector< std::vector< ns3::RlcPduListElement_s > > >&', u'ns3::DlHarqRlcPduListBuffer_t&') typehandlers.add_type_alias(u'std::vector< ns3::UlDciListElement_s >', u'ns3::UlHarqProcessesDciBuffer_t') typehandlers.add_type_alias(u'std::vector< ns3::UlDciListElement_s >*', u'ns3::UlHarqProcessesDciBuffer_t*') typehandlers.add_type_alias(u'std::vector< ns3::UlDciListElement_s >&', u'ns3::UlHarqProcessesDciBuffer_t&') typehandlers.add_type_alias(u'std::vector< unsigned char >', u'ns3::UlHarqProcessesStatus_t') typehandlers.add_type_alias(u'std::vector< unsigned char >*', u'ns3::UlHarqProcessesStatus_t*') typehandlers.add_type_alias(u'std::vector< unsigned char >&', u'ns3::UlHarqProcessesStatus_t&') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, unsigned int >', u'ns3::Uint32Map') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, unsigned int >*', u'ns3::Uint32Map*') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, unsigned int >&', u'ns3::Uint32Map&') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, unsigned long >', u'ns3::Uint64Map') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, unsigned long >*', u'ns3::Uint64Map*') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, unsigned long >&', u'ns3::Uint64Map&') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::Ptr< ns3::MinMaxAvgTotalCalculator< unsigned int > > >', u'ns3::Uint32StatsMap') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::Ptr< ns3::MinMaxAvgTotalCalculator< unsigned int > > >*', u'ns3::Uint32StatsMap*') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::Ptr< ns3::MinMaxAvgTotalCalculator< unsigned int > > >&', u'ns3::Uint32StatsMap&') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::Ptr< ns3::MinMaxAvgTotalCalculator< unsigned long > > >', u'ns3::Uint64StatsMap') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::Ptr< ns3::MinMaxAvgTotalCalculator< unsigned long > > >*', u'ns3::Uint64StatsMap*') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::Ptr< ns3::MinMaxAvgTotalCalculator< unsigned long > > >&', u'ns3::Uint64StatsMap&') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, double >', u'ns3::DoubleMap') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, double >*', u'ns3::DoubleMap*') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, double >&', u'ns3::DoubleMap&') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::LteFlowId_t >', u'ns3::FlowIdMap') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::LteFlowId_t >*', u'ns3::FlowIdMap*') typehandlers.add_type_alias(u'std::map< ns3::ImsiLcidPair_t, ns3::LteFlowId_t >&', u'ns3::FlowIdMap&') typehandlers.add_type_alias(u'std::vector< std::vector< ns3::Ptr< ns3::PacketBurst > > >', u'ns3::DlHarqProcessesBuffer_t') typehandlers.add_type_alias(u'std::vector< std::vector< ns3::Ptr< ns3::PacketBurst > > >*', u'ns3::DlHarqProcessesBuffer_t*') typehandlers.add_type_alias(u'std::vector< std::vector< ns3::Ptr< ns3::PacketBurst > > >&', u'ns3::DlHarqProcessesBuffer_t&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::SpectrumValue const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LteChunkProcessorCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::SpectrumValue const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LteChunkProcessorCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::SpectrumValue const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LteChunkProcessorCallback&') typehandlers.add_type_alias(u'std::map< ns3::TbId_t, ns3::tbInfo_t >', u'ns3::expectedTbs_t') typehandlers.add_type_alias(u'std::map< ns3::TbId_t, ns3::tbInfo_t >*', u'ns3::expectedTbs_t*') typehandlers.add_type_alias(u'std::map< ns3::TbId_t, ns3::tbInfo_t >&', u'ns3::expectedTbs_t&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LtePhyRxDataEndErrorCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LtePhyRxDataEndErrorCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LtePhyRxDataEndErrorCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LtePhyRxDataEndOkCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LtePhyRxDataEndOkCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LtePhyRxDataEndOkCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, std::list< ns3::Ptr< ns3::LteControlMessage > >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LtePhyRxCtrlEndOkCallback') typehandlers.add_type_alias(u'ns3::Callback< void, std::list< ns3::Ptr< ns3::LteControlMessage > >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LtePhyRxCtrlEndOkCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, std::list< ns3::Ptr< ns3::LteControlMessage > >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LtePhyRxCtrlEndOkCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LtePhyRxCtrlEndErrorCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LtePhyRxCtrlEndErrorCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LtePhyRxCtrlEndErrorCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, unsigned short, ns3::Ptr< ns3::SpectrumValue >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LtePhyRxPssCallback') typehandlers.add_type_alias(u'ns3::Callback< void, unsigned short, ns3::Ptr< ns3::SpectrumValue >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LtePhyRxPssCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, unsigned short, ns3::Ptr< ns3::SpectrumValue >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LtePhyRxPssCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::DlInfoListElement_s, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LtePhyDlHarqFeedbackCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::DlInfoListElement_s, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LtePhyDlHarqFeedbackCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::DlInfoListElement_s, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LtePhyDlHarqFeedbackCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::UlInfoListElement_s, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::LtePhyUlHarqFeedbackCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::UlInfoListElement_s, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::LtePhyUlHarqFeedbackCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::UlInfoListElement_s, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::LtePhyUlHarqFeedbackCallback&') typehandlers.add_type_alias(u'std::vector< ns3::HarqProcessInfoElement_t >', u'ns3::HarqProcessInfoList_t') typehandlers.add_type_alias(u'std::vector< ns3::HarqProcessInfoElement_t >*', u'ns3::HarqProcessInfoList_t*') typehandlers.add_type_alias(u'std::vector< ns3::HarqProcessInfoElement_t >&', u'ns3::HarqProcessInfoList_t&') typehandlers.add_type_alias(u'void ( * ) ( std::ostream & )', u'ns3::TimePrinter') typehandlers.add_type_alias(u'void ( * ) ( std::ostream & )*', u'ns3::TimePrinter*') typehandlers.add_type_alias(u'void ( * ) ( std::ostream & )&', u'ns3::TimePrinter&') typehandlers.add_type_alias(u'void ( * ) ( std::ostream & )', u'ns3::NodePrinter') typehandlers.add_type_alias(u'void ( * ) ( std::ostream & )*', u'ns3::NodePrinter*') typehandlers.add_type_alias(u'void ( * ) ( std::ostream & )&', u'ns3::NodePrinter&') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::GenericPhyTxStartCallback') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::GenericPhyTxStartCallback*') typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::GenericPhyTxStartCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::GenericPhyTxEndCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::GenericPhyTxEndCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::GenericPhyTxEndCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::GenericPhyRxStartCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::GenericPhyRxStartCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::GenericPhyRxStartCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::GenericPhyRxEndErrorCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::GenericPhyRxEndErrorCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::GenericPhyRxEndErrorCallback&') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::GenericPhyRxEndOkCallback') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::GenericPhyRxEndOkCallback*') typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::GenericPhyRxEndOkCallback&') typehandlers.add_type_alias(u'ns3::Vector3D', u'ns3::Vector') typehandlers.add_type_alias(u'ns3::Vector3D*', u'ns3::Vector*') typehandlers.add_type_alias(u'ns3::Vector3D&', u'ns3::Vector&') module.add_typedef(root_module['ns3::Vector3D'], 'Vector') typehandlers.add_type_alias(u'ns3::Vector3DValue', u'ns3::VectorValue') typehandlers.add_type_alias(u'ns3::Vector3DValue*', u'ns3::VectorValue*') typehandlers.add_type_alias(u'ns3::Vector3DValue&', u'ns3::VectorValue&') module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue') typehandlers.add_type_alias(u'ns3::Vector3DChecker', u'ns3::VectorChecker') typehandlers.add_type_alias(u'ns3::Vector3DChecker*', u'ns3::VectorChecker*') typehandlers.add_type_alias(u'ns3::Vector3DChecker&', u'ns3::VectorChecker&') module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker') typehandlers.add_type_alias(u'std::vector< double >', u'ns3::Values') typehandlers.add_type_alias(u'std::vector< double >*', u'ns3::Values*') typehandlers.add_type_alias(u'std::vector< double >&', u'ns3::Values&') typehandlers.add_type_alias(u'std::vector< ns3::BandInfo >', u'ns3::Bands') typehandlers.add_type_alias(u'std::vector< ns3::BandInfo >*', u'ns3::Bands*') typehandlers.add_type_alias(u'std::vector< ns3::BandInfo >&', u'ns3::Bands&') typehandlers.add_type_alias(u'uint32_t', u'ns3::SpectrumModelUid_t') typehandlers.add_type_alias(u'uint32_t*', u'ns3::SpectrumModelUid_t*') typehandlers.add_type_alias(u'uint32_t&', u'ns3::SpectrumModelUid_t&') nested_module = module.add_cpp_namespace('Config') register_types_ns3_Config(nested_module) nested_module = module.add_cpp_namespace('FatalImpl') register_types_ns3_FatalImpl(nested_module) nested_module = module.add_cpp_namespace('Hash') register_types_ns3_Hash(nested_module) nested_module = module.add_cpp_namespace('TracedValueCallback') register_types_ns3_TracedValueCallback(nested_module) nested_module = module.add_cpp_namespace('internal') register_types_ns3_internal(nested_module)
def TorchPixelNormPattern(patterns: list): def is_c_dim(x: list): return ((len(x) == 1) and (x[0] == 1)) reducemean_input = OuterNode() pow_tensor = OuterNode(tensor_value=2) add_0_tensor = OuterNode(attr_name='eps') mul_tensor = OuterNode(is_tensor=True) add_1_tensor = OuterNode(is_tensor=True) _reducemean_0 = PatternNode('ReduceMean', [reducemean_input], ['axes'], attrcheck=AttrCheck(attrs=['axes'], func=is_c_dim)) _sub = PatternNode('Sub', [reducemean_input, _reducemean_0]) _pow = PatternNode('Pow', [_sub, pow_tensor]) _reducemean_1 = PatternNode('ReduceMean', [_pow], attrcheck=AttrCheck(attrs=['axes'], func=is_c_dim)) _add_0 = PatternNode('Add', [_reducemean_1, add_0_tensor]) _sqrt = PatternNode('Sqrt', [_add_0]) _div = PatternNode('Div', [_sub, _sqrt]) mul = PatternNode('Mul', [_div, mul_tensor]) _add_1 = PatternNode('Add', [mul, add_1_tensor]) epsilon_attrfunc = AttrFunctor([add_0_tensor], ['eps']) layernorm_aff = PatternNode('PixelNormalization', [reducemean_input, mul_tensor, add_1_tensor], attrmap={'epsilon': epsilon_attrfunc}) patterns.append(ReformInfo(name='pixelnorm_aff', src_nodes=[_reducemean_0, _sub, _pow, _reducemean_1, _add_0, _sqrt, _div, mul, _add_1], dst_nodes=[layernorm_aff])) layernorm = PatternNode('PixelNormalization', [reducemean_input], attrmap={'epsilon': epsilon_attrfunc}) patterns.append(ReformInfo(name='pixelnorm', src_nodes=[_reducemean_0, _sub, _pow, _reducemean_1, _add_0, _sqrt, _div], dst_nodes=[layernorm]))
def ensure_dir(d, verbose=True): if (not os.path.exists(d)): if verbose: print('Directory {} do not exist; creating...'.format(d)) os.makedirs(d)
class Up(nn.Module): def __init__(self, in_ch, out_ch, norm_layer=nn.BatchNorm2d, use_bias=False): super(Up, self).__init__() self.up = nn.Sequential(nn.ConvTranspose2d(in_ch, out_ch, kernel_size=3, stride=2, padding=1, output_padding=1, bias=use_bias), norm_layer(out_ch), nn.ReLU(True)) def forward(self, x): x = self.up(x) return x
def unfill_isogeny_matrix(M): n = M.nrows() M1 = copy(M) zero = Integer(0) for i in range(n): M1[(i, i)] = zero for j in range(i): if (not M1[(i, j)].is_prime()): M1[(i, j)] = zero M1[(j, i)] = zero return M1
def _get_builtin_metadata(dataset_name): return _get_gqa_metadata([]) raise KeyError('No built-in metadata for dataset {}'.format(dataset_name))
class SchemaOptmDataLoader(BaseDataLoader): def __init__(self, q_optm_pairs_dict, mode, batch_size, shuffle=False): BaseDataLoader.__init__(self, batch_size=batch_size) self.mode = mode self.optm_pair_tup_list = [] self.total_questions = len(q_optm_pairs_dict) for (q_idx, optm_pairs) in q_optm_pairs_dict.items(): for (pos_sc, neg_sc) in optm_pairs: self.optm_pair_tup_list.append((q_idx, pos_sc, neg_sc)) n_pairs = len(self.optm_pair_tup_list) self.optm_pair_tup_list.sort(key=(lambda _tup: _tup[0])) if shuffle: np.random.shuffle(self.optm_pair_tup_list) global_input_dict = {} for (q_idx, pos_sc, neg_sc) in self.optm_pair_tup_list: for sc in (pos_sc, neg_sc): sc_np_dict = sc.input_np_dict for (k, v) in sc_np_dict.items(): global_input_dict.setdefault(k, []).append(v) LogInfo.logs('%d <pos, neg> pairs saved in dataloader [%s].', n_pairs, mode) self.prepare_np_input_list(global_input_dict=global_input_dict, n_rows=(2 * n_pairs))
def conv2d_basic(x, W, bias): conv = tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME') return tf.nn.bias_add(conv, bias)
class Interaction(): request: Request response: Response checks: list[Check] status: Status data_generation_method: DataGenerationMethod recorded_at: str = field(default_factory=(lambda : datetime.datetime.now().isoformat())) def from_requests(cls, case: Case, response: requests.Response, status: Status, checks: list[Check]) -> Interaction: return cls(request=Request.from_prepared_request(response.request), response=Response.from_requests(response), status=status, checks=checks, data_generation_method=cast(DataGenerationMethod, case.data_generation_method)) def from_wsgi(cls, case: Case, response: WSGIResponse, headers: dict[(str, Any)], elapsed: float, status: Status, checks: list[Check]) -> Interaction: import requests session = requests.Session() session.headers.update(headers) return cls(request=Request.from_case(case, session), response=Response.from_wsgi(response, elapsed), status=status, checks=checks, data_generation_method=cast(DataGenerationMethod, case.data_generation_method))
class LabelEmbedModel(nn.Module): def __init__(self, n_labels, emb_dim=104, dropout_p=0.4, eye=False): super(LabelEmbedModel, self).__init__() self.eye = eye self.dropout = nn.Dropout(dropout_p) self.e = nn.Embedding(n_labels, emb_dim, max_norm=1.0, scale_grad_by_freq=False) self.init_weights() def init_weights(self, scale=0.0001): if self.eye: torch.nn.init.eye_(self.e.weight) else: self.e.state_dict()['weight'].uniform_((- scale), scale) def forward(self, x): return self.dropout(self.e(x))
def test_sanitize_output_no_response(case_factory): case = case_factory(headers={'Authorization': 'Bearer token'}, query={'api_key': '12345'}) sanitize_output(case) assert (case.headers == {'Authorization': '[Filtered]'}) assert (case.query == {'api_key': '[Filtered]'})
class FHDR(object): _OFFSET_DEVADDR = 0 _LEN_DEVADDR = 4 _OFFSET_FCTRL = (_OFFSET_DEVADDR + _LEN_DEVADDR) _LEN_FCTRL = 1 _OFFSET_FCNT = (_OFFSET_FCTRL + _LEN_FCTRL) _LEN_FCNT = 2 _OFFSET_FOPTS = (_OFFSET_FCNT + _LEN_FCNT) _MASK_ADR = 128 _MASK_ACK = 32 _MASK_FOPTSLEN = 15 def __init__(self, msg): self._msg = msg def length(self): return (((self._LEN_DEVADDR + self._LEN_FCTRL) + self._LEN_FCNT) + self.fOptsLen) def devAddr(self): return extractBytes(self._msg.payloadBytes, self._OFFSET_DEVADDR, self._LEN_DEVADDR, True, True) def devAddr(self, devAddr): self._msg.payloadBytes = replaceBytes(self._msg.payloadBytes, self._OFFSET_DEVADDR, self._LEN_DEVADDR, devAddr, checkLength=True, switchEndian=True) def _fCtrl(self): return self._msg.payloadBytes[self._OFFSET_FCTRL] _fCtrl.setter def _fCtrl(self, fCtrl): self._msg.payloadBytes = replaceBytes(self._msg.payloadBytes, self._OFFSET_FCTRL, self._LEN_FCTRL, [fCtrl]) def fCnt(self): return extractNumber(self._msg.payloadBytes, self._OFFSET_FCNT, self._LEN_FCNT) def fCnt(self, fCnt): self._msg.payloadBytes = replaceNumber(self._msg.payloadBytes, self._OFFSET_FCNT, self._LEN_FCNT, fCnt) def _getFOptsDict(self): raise NotImplementedError('Missing implementation of _getFOptsDir()') def _decryptFOpts(self, rawFOpts): return rawFOpts def fOpts(self): rawFOpts = self._msg.payloadBytes[self._OFFSET_FOPTS:(self._OFFSET_FOPTS + self.fOptsLen)] rawFOpts = self._decryptFOpts(rawFOpts) fOptsDict = self._getFOptsDict() idx = 0 fOpts = [] while (idx < len(rawFOpts)): cid = rawFOpts[idx] idx += 1 if (not (cid in fOptsDict)): break fOptClass = fOptsDict[cid] if ((idx + fOptClass.length) > len(rawFOpts)): break fOpts += [fOptClass(data=rawFOpts[idx:(idx + fOptClass.length)])] idx += fOptClass.length return tuple(fOpts) def fOpts(self, fOpts): raise NotImplementedError() def addFOpt(self, fOpt): self.fOpts = (list(self.fOpts) + [fOpt]) def adr(self): return (getWithMask(self._fCtrl, self._MASK_ADR) > 0) def ack(self): return (getWithMask(self._fCtrl, self._MASK_ACK) > 0) def fOptsLen(self): return getWithMask(self._fCtrl, self._MASK_FOPTSLEN) def _printFCtrlEntries(self, fCtrl): return [(self._MASK_ADR, 'ADR', ('ADR Set' if self.adr else 'No ADR')), (self._MASK_ACK, 'ACK', ('Ack Set' if self.ack else 'No ACK')), (self._MASK_FOPTSLEN, 'FOptsLen', str(self.fOptsLen))] def print(self, depth=0): pad = (depth * ' ') fCtrl = self._fCtrl fCtrlEntries = sorted(self._printFCtrlEntries(fCtrl), reverse=True) fCtrlText = (pad + 'FCtrl: {:08b}\n'.format(fCtrl)) for entry in fCtrlEntries: fCtrlText += (pad + ' ') maskedVal = '{:08b}'.format((fCtrl & entry[0])) fCtrlText += ''.join((('.' if (((entry[0] >> (7 - x)) & 1) == 0) else maskedVal[x]) for x in range(8))) fCtrlText += ((((' ' + entry[1]) + ': ') + entry[2]) + '\n') return ((((((pad + 'DevAddr: {}\n'.format(hexToStr(self.devAddr))) + pad) + 'FCnt: {}\n'.format(self.fCnt)) + fCtrlText) + pad) + 'FOpts: ... ({} byte(s))'.format(self.fOptsLen))
def colbertv2_post_request_v2(url: str, query: str, k: int): headers = {'Content-Type': 'application/json; charset=utf-8'} payload = {'query': query, 'k': k} res = requests.post(url, json=payload, headers=headers, timeout=10) return res.json()['topk'][:k]
class AlgebraicNumberPowQQAction(Action): def __init__(self, G, S): Action.__init__(self, G, S, False, operator.pow) def _act_(self, e, x): if (not x): return x n = e.numerator() d = e.denominator() if (d == 1): return x._pow_int(n) S = self.codomain() if ((S is AA) and ((d % 2) == 0) and (x.sign() < 0)): S = QQbar if isinstance(x._descr, ANRational): rt = rational_exact_root(abs(x._descr._value), d) if (rt is not None): if (x._descr._value < 0): if (S is AA): return AlgebraicReal(ANRational(((- rt) ** n))) else: z = QQbar.zeta((2 * d))._pow_int(n) return (z * AlgebraicNumber(ANRational((rt ** n)))) return S(ANRational((rt ** n))) if (S is AA): pow_n = x._pow_int(n) poly = ((AAPoly.gen() ** d) - pow_n) range = pow_n.interval_fast(RIF) if ((d % 2) == 0): result_min = 0 else: result_min = min(range.lower(), (- 1)) result_max = max(range.upper(), 1) return AlgebraicReal(ANRoot(poly, RIF(result_min, result_max))) argument_is_pi = False for prec in short_prec_seq(): if (prec is None): isgn = x.imag().sign() val = x._value argument = val.argument() if (isgn == 0): argument = argument.parent().pi() argument_is_pi = True elif (isgn > 0): if (argument < 0): argument = (argument + (2 * argument.parent().pi())) elif (argument > 0): argument = (argument - (2 * argument.parent().pi())) else: val = x._interval_fast(prec) if (is_RealIntervalFieldElement(val) or (not val.crosses_log_branch_cut())): argument = val.argument() if (val.imag().is_zero() and (val.real() < 0)): argument_is_pi = True break target_abs = (abs(val) ** e) target_arg = (argument * e) for prec in tail_prec_seq(): if ((target_abs.relative_diameter() < RR_1_10) and ((target_arg * d).absolute_diameter() < RR_1_10)): break val = x._interval_fast(prec) target_abs = (abs(val) ** e) argument = val.argument() if argument_is_pi: argument = argument.parent().pi() target_arg = (argument * e) pow_n = (x ** n) poly = ((QQbarPoly.gen() ** d) - pow_n) prec = target_abs.prec() if (argument_is_pi and (d == 2)): target_real = 0 else: target_real = (target_arg.cos() * target_abs) target = ComplexIntervalField(prec)(target_real, (target_arg.sin() * target_abs)) return AlgebraicNumber(ANRoot(poly, target)) def _repr_name_(self): return 'Rational Powering'
def _make_legal_action_mask_w_riichi(state, hand, c_p): legal_action_mask = jnp.zeros(NUM_ACTION, dtype=jnp.bool_) legal_action_mask = legal_action_mask.at[Action.TSUMOGIRI].set(TRUE) legal_action_mask = legal_action_mask.at[Action.TSUMO].set((Hand.can_tsumo(hand[c_p]) & Yaku.judge(state._hand[c_p], state._melds[c_p], state._n_meld[c_p], state._last_draw, state._riichi[c_p], FALSE, _dora_array(state, state._riichi[c_p]))[0].any())) return legal_action_mask
class Network(nn.Module): def __init__(self, stage=3): super(Network, self).__init__() self.stage = stage self.enhance = EnhanceNetwork(layers=1, channels=3) self.calibrate = CalibrateNetwork(layers=3, channels=16) self._criterion = LossFunction() def weights_init(self, m): if isinstance(m, nn.Conv2d): m.weight.data.normal_(0, 0.02) m.bias.data.zero_() if isinstance(m, nn.BatchNorm2d): m.weight.data.normal_(1.0, 0.02) def forward(self, input): (ilist, rlist, inlist, attlist) = ([], [], [], []) input_op = input for i in range(self.stage): inlist.append(input_op) i = self.enhance(input_op) r = (input / i) r = torch.clamp(r, 0, 1) att = self.calibrate(r) input_op = (input + att) ilist.append(i) rlist.append(r) attlist.append(torch.abs(att)) return (ilist, rlist, inlist, attlist) def _loss(self, input): (i_list, en_list, in_list, _) = self(input) loss = 0 for i in range(self.stage): loss += self._criterion(in_list[i], i_list[i]) return loss
('/some/path/bad') def targetRedirection(request): target = re.match('(^\\w+:\\/\\/[^\\/]+)(\\/\\w+)', request.path) target = target.group(2) return redirect(target)
.script def my_script_ref_add(ref_t1: RRef[torch.Tensor], t2: torch.Tensor) -> torch.Tensor: t1 = ref_t1.to_here() return torch.add(t1, t2)
def test_ListOffset_append2(): def f17(builder): content = builder.begin_list() content.append(1.1) content.append(2.2) content.append(3.3) builder.end_list() builder.begin_list() builder.end_list() builder.begin_list() content.append(4.4) content.append(5.5) builder.end_list() builder = lb.ListOffset(np.int32, lb.Numpy(np.float64)) assert (len(builder) == 0) layout = builder.snapshot() assert isinstance(layout, ak.contents.ListOffsetArray) assert (ak.to_list(layout) == []) f17(builder) layout = builder.snapshot() assert isinstance(layout, ak.contents.ListOffsetArray) assert (ak.to_list(layout) == [[1.1, 2.2, 3.3], [], [4.4, 5.5]]) error = '' assert builder.is_valid(error), error assert (len(builder) == 3) builder.clear() assert (len(builder) == 0)
def load_data_tensors_TW(filename, limit=(- 1)): return torch.from_numpy(np.load(filename)).float()
.script def hard_swish_jit(x, inplace: bool=False): return (x * (x + 3).clamp(min=0, max=6).div(6.0))
def analyze(pipeline, train, test=None, hyperparams=None): if (test is None): test = train if (not isinstance(pipeline, MLPipeline)): pipeline = _load_pipeline(pipeline, hyperparams) events = _run_pipeline(pipeline, train, test) return _build_events_df(events)
class TypeProperty(Property): def dtype(self): return type def from_string(s): dtype = pydoc.locate(s) if (dtype is None): raise ValueError('No type "{}" found.'.format(s)) if (not isinstance(dtype, type)): raise ValueError('Object "{}" is not a type.'.format(dtype)) return dtype def from_json(obj, context=None): if (obj is None): return None if isinstance(obj, str): return TypeProperty.from_string(obj) else: raise TypeError('Cannot parse type from: {}'.format(obj))
.parametrize('implementation, dtype', [pytest.param('MPI', dace.float32, marks=pytest.mark.mpi), pytest.param('MPI', dace.float64, marks=pytest.mark.mpi)]) def test_mpi(implementation, dtype): from mpi4py import MPI as MPI4PY np_dtype = getattr(np, dtype.to_string()) comm = MPI4PY.COMM_WORLD rank = comm.Get_rank() commsize = comm.Get_size() mpi_sdfg = None if (commsize < 2): raise ValueError('This test is supposed to be run with at least two processes!') for r in range(0, commsize): if (r == rank): sdfg = make_sdfg(dtype) mpi_sdfg = sdfg.compile() comm.Barrier() size = 8 A = np.full(size, 1, dtype=np_dtype) B = np.full(size, 42, dtype=np_dtype) root = np.array([0], dtype=np.int32) mpi_sdfg(inbuf=A, outbuf=B, root=root, n=size) if ((rank == root) and (not np.allclose(B, np.full(size, commsize, dtype=np_dtype)))): raise ValueError('The received values are not what I expected on root.') if ((rank != root) and (not np.allclose(B, np.full(size, 42, dtype=np_dtype)))): raise ValueError('The received values are not what I expected on non-root nodes.')