repo_name
stringlengths 5
92
| path
stringlengths 4
232
| copies
stringclasses 19
values | size
stringlengths 4
7
| content
stringlengths 721
1.04M
| license
stringclasses 15
values | hash
int64 -9,223,277,421,539,062,000
9,223,102,107B
| line_mean
float64 6.51
99.9
| line_max
int64 15
997
| alpha_frac
float64 0.25
0.97
| autogenerated
bool 1
class |
---|---|---|---|---|---|---|---|---|---|---|
mila/django-noticebox | setup.py | 1 | 1110 | #!/usr/bin/env python
import codecs
from setuptools import setup, find_packages
url='http://github.com/mila/django-noticebox/tree/master'
try:
long_description = codecs.open('README.rst', "r", "utf-8").read()
except IOError:
long_description = "See %s" % url
setup(
name='django-noticebox',
version=__import__("noticebox").__version__,
description='Django-noticebox is a reusable Django application which '
'provides functionality for sending notices to site users. '
'The notices can be displayed when user signs in, '
'sent by email or both.',
long_description=long_description,
author='Miloslav Pojman',
author_email='[email protected]',
url=url,
packages=find_packages(),
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Framework :: Django',
],
include_package_data=True,
zip_safe=False,
)
| bsd-3-clause | -6,995,972,845,359,806,000 | 29 | 76 | 0.637838 | false |
neumark/unimodel | test/test_model_registry.py | 1 | 1934 | from unittest import TestCase
from test.helpers import flatten
from test.fixtures import TreeNode, tree_data
from unimodel.model import Unimodel, Field
from unimodel.types import *
import json
from unimodel.model import ModelRegistry
from unimodel.backends.json.serializer import JSONSerializer, JSONValidationException
class ModelRegistryTestCase(TestCase):
""" Demonstrates the use of the model registry.
The idea is that a bare-bones "interface class"
(one presumably generated or constructed at runtime
from some sort of schema) can be swapped out with an
"implementation class" with a rich set of model methods """
def test_implementation_class(self):
""" serialize unicode and binary data """
class NestedIface(Unimodel):
x = Field(Int)
class OuterIface(Unimodel):
u = Field(UTF8, required=True)
s = Field(Binary)
nested = Field(Struct(NestedIface))
class OuterImpl(OuterIface):
def useful_method(self):
return len(self.u or '') + len(self.s or '')
class NestedImpl(NestedIface):
CONST = 7
def another_method(self, x):
return self.CONST * x
model_registry = ModelRegistry()
model_registry.register(NestedIface, NestedImpl)
model_registry.register(OuterIface, OuterImpl)
data = OuterIface(u="asdf", s="jj", nested=NestedIface(x=7))
serializer = JSONSerializer(model_registry=model_registry)
s = serializer.serialize(data)
data_read = serializer.deserialize(OuterIface, s)
self.assertEquals(data_read.__class__, OuterImpl)
self.assertEquals(data_read.nested.__class__, NestedImpl)
# methods of impl classes can be called
self.assertEquals(data_read.useful_method(), 6)
self.assertEquals(data_read.nested.another_method(1), 7)
| apache-2.0 | -5,014,833,171,416,685,000 | 35.490566 | 85 | 0.664426 | false |
CriticalD20/Sine-Cosine | sinecosine.py | 1 | 2215 | """
sinecosine.py
Author: James Napier
Credit: http://www.discoveryplayground.com/computer-programming-for-kids/rgb-colors/, Mr. Dennison
Assignment:
In this assignment you must use *list comprehensions* to generate sprites that show the behavior
of certain mathematical functions: sine and cosine.
The sine and cosine functions are provided in the Python math library. These functions are used
to relate *angles* to *rectangular* (x,y) coordinate systems and can be very useful in computer
game design.
Unlike the last assignment using ggame`, this one will not provide any "skeleton" code to fill
in. You should use your submission for the Picture assignment
(https://github.com/HHS-IntroProgramming/Picture) as a reference for starting this assignment.
See:
https://github.com/HHS-IntroProgramming/Sine-Cosine/blob/master/README.md
for a detailed list of requirements for this assignment.
https://github.com/HHS-IntroProgramming/Standards-and-Syllabus/wiki/Displaying-Graphics
for general information on how to use ggame.
https://github.com/HHS-IntroProgramming/Standards-and-Syllabus/wiki/Programmed-Graphics
for general information on using list comprehensions to generate graphics.
http://brythonserver.github.io/ggame/
for detailed information on ggame.
"""
from ggame import App, Color, CircleAsset, LineStyle, Sprite
from math import sin, cos, radians
blue=Color(0x0000ff, 1.0)
red=Color(0xff0000, 1.0)
purple=Color(0xa020f0, 1.00)
black=Color(0x000000, 1.0)
thinline=LineStyle(1, black)
mycircle=CircleAsset(5, thinline, blue)
mycircle2=CircleAsset(5, thinline, red)
mycircle3=CircleAsset(5, thinline, purple)
xcoordinates=range(0, 360, 10)
ycoordinates=[100+100*sin(radians(x))for x in xcoordinates]
y2coordinates=[100+100*cos(radians(x))for x in xcoordinates]
x2coordinates=[100+100*cos(radians(x))for x in xcoordinates]
y3coordinates=[400+100*sin(radians(x))for x in xcoordinates]
xy=zip(xcoordinates, ycoordinates)
xy2=zip(xcoordinates, y2coordinates)
x2y3=zip(x2coordinates, y3coordinates)
#use ziping for lists tomorrow of Friday
sprites=[Sprite(mycircle, x)for x in xy]
sprites=[Sprite(mycircle2, x)for x in xy2]
sprites=[Sprite(mycircle3, x)for x in x2y3]
myapp=App()
myapp.run()
| mit | -7,328,395,108,479,366,000 | 35.311475 | 98 | 0.792777 | false |
brendandc/multilingual-google-image-scraper | create-language-zip.py | 1 | 3067 | import optparse
import os
optparser = optparse.OptionParser()
optparser.add_option("-l", "--language", dest="language", default="French", help="Language to package")
optparser.add_option("-b", "--bucket", dest="bucket", default="brendan.callahan.thesis", help="S3 bucket name")
optparser.add_option("-p", "--prefix", dest="prefix", help="Alternate prefix for the filenames, default is lower case language name")
optparser.add_option("-S", action="store_true", dest="skip_completed_words", help="Allows multiple passes so we can resume if any failures")
(opts, _) = optparser.parse_args()
# TODO: un-hard code the base destination and source paths
BASE_DESTINATION_PATH = '/mnt/storage2/intermediate/'
BASE_SOURCE_PATH = '/mnt/storage/'+opts.language+'/'
BASE_TAR_PATH = BASE_DESTINATION_PATH + opts.language.lower()
file_prefix = opts.prefix or opts.language.lower()
big_tar_file_name = file_prefix+"-package.tar"
sample_tar_file_name = file_prefix+"-sample.tar"
big_tar_path = BASE_DESTINATION_PATH + big_tar_file_name
sample_tar_path = BASE_DESTINATION_PATH + sample_tar_file_name
if not os.path.exists(BASE_DESTINATION_PATH):
os.makedirs(BASE_DESTINATION_PATH)
if not opts.skip_completed_words:
tar_cmd = "tar cvf "+ big_tar_path+" --files-from /dev/null"
os.system(tar_cmd)
sample_cmd = "tar cvf "+ sample_tar_path+" --files-from /dev/null"
os.system(sample_cmd)
os.system("cd " + BASE_SOURCE_PATH + " && tar rf "+big_tar_path+" all_errors.json")
targz_files = []
for folder_name in os.listdir(BASE_SOURCE_PATH):
print(folder_name)
targz_file = folder_name + '.tar.gz'
targz_path = BASE_DESTINATION_PATH + targz_file
targz_files.append(targz_file)
# if skip completed words param was passed, and the filepath exists skip this and move onto the next
# assume there are no incomplete files (that they are cleaned up manually)
if opts.skip_completed_words and os.path.isfile(targz_path):
continue
add_folder_cmd = "cd " + BASE_SOURCE_PATH + " && tar -czf "+targz_path+" "+folder_name
print(add_folder_cmd)
os.system(add_folder_cmd)
add_folders_cmd = "cd " + BASE_DESTINATION_PATH + " && tar rf "+big_tar_file_name+" "+" ".join(targz_files)
print(add_folders_cmd)
os.system(add_folders_cmd)
sample_files = sorted(targz_files)[0:100]
add_folders_cmd_sample = "cd " + BASE_DESTINATION_PATH + " && tar rf "+sample_tar_file_name+" "+" ".join(sample_files)
print(add_folders_cmd_sample)
os.system(add_folders_cmd_sample)
os.system("cd " + BASE_DESTINATION_PATH + " && mv " + big_tar_file_name + " ..")
os.system("cd " + BASE_DESTINATION_PATH + " && mv " + sample_tar_file_name + " ..")
# TODO make aws upload optional
package_upload_cmd = "aws s3 cp /mnt/storage2/" + big_tar_file_name + " s3://" + opts.bucket + "/packages/" + \
big_tar_file_name
sample_upload_cmd = "aws s3 cp /mnt/storage2/" + sample_tar_file_name + " s3://" + opts.bucket + "/samples/" + \
sample_tar_file_name
os.system(package_upload_cmd)
os.system(sample_upload_cmd)
| mit | -8,948,385,637,682,369,000 | 41.597222 | 140 | 0.681774 | false |
hadim/spindle_tracker | spindle_tracker/io/trackmate.py | 1 | 5663 | import itertools
import xml.etree.cElementTree as et
import networkx as nx
import pandas as pd
import numpy as np
def trackmate_peak_import(trackmate_xml_path, get_tracks=False):
"""Import detected peaks with TrackMate Fiji plugin.
Parameters
----------
trackmate_xml_path : str
TrackMate XML file path.
get_tracks : boolean
Add tracks to label
"""
root = et.fromstring(open(trackmate_xml_path).read())
objects = []
object_labels = {'FRAME': 't_stamp',
'POSITION_T': 't',
'POSITION_X': 'x',
'POSITION_Y': 'y',
'POSITION_Z': 'z',
'MEAN_INTENSITY': 'I',
'ESTIMATED_DIAMETER': 'w',
'QUALITY': 'q',
'ID': 'spot_id',
'MEAN_INTENSITY': 'mean_intensity',
'MEDIAN_INTENSITY': 'median_intensity',
'MIN_INTENSITY': 'min_intensity',
'MAX_INTENSITY': 'max_intensity',
'TOTAL_INTENSITY': 'total_intensity',
'STANDARD_DEVIATION': 'std_intensity',
'CONTRAST': 'contrast',
'SNR': 'snr'}
features = root.find('Model').find('FeatureDeclarations').find('SpotFeatures')
features = [c.get('feature') for c in features.getchildren()] + ['ID']
spots = root.find('Model').find('AllSpots')
trajs = pd.DataFrame([])
objects = []
for frame in spots.findall('SpotsInFrame'):
for spot in frame.findall('Spot'):
single_object = []
for label in features:
single_object.append(spot.get(label))
objects.append(single_object)
trajs = pd.DataFrame(objects, columns=features)
trajs = trajs.astype(np.float)
# Apply initial filtering
initial_filter = root.find("Settings").find("InitialSpotFilter")
trajs = filter_spots(trajs,
name=initial_filter.get('feature'),
value=float(initial_filter.get('value')),
isabove=True if initial_filter.get('isabove') == 'true' else False)
# Apply filters
spot_filters = root.find("Settings").find("SpotFilterCollection")
for spot_filter in spot_filters.findall('Filter'):
trajs = filter_spots(trajs,
name=spot_filter.get('feature'),
value=float(spot_filter.get('value')),
isabove=True if spot_filter.get('isabove') == 'true' else False)
trajs = trajs.loc[:, object_labels.keys()]
trajs.columns = [object_labels[k] for k in object_labels.keys()]
trajs['label'] = np.arange(trajs.shape[0])
# Get tracks
if get_tracks:
filtered_track_ids = [int(track.get('TRACK_ID')) for track in root.find('Model').find('FilteredTracks').findall('TrackID')]
new_trajs = pd.DataFrame()
label_id = 0
trajs = trajs.set_index('spot_id')
tracks = root.find('Model').find('AllTracks')
for track in tracks.findall('Track'):
track_id = int(track.get("TRACK_ID"))
if track_id in filtered_track_ids:
spot_ids = [(edge.get('SPOT_SOURCE_ID'), edge.get('SPOT_TARGET_ID'), edge.get('EDGE_TIME')) for edge in track.findall('Edge')]
spot_ids = np.array(spot_ids).astype('float')
spot_ids = pd.DataFrame(spot_ids, columns=['source', 'target', 'time'])
spot_ids = spot_ids.sort_values(by='time')
spot_ids = spot_ids.set_index('time')
# Build graph
graph = nx.Graph()
for t, spot in spot_ids.iterrows():
graph.add_edge(int(spot['source']), int(spot['target']), attr_dict=dict(t=t))
# Find graph extremities by checking if number of neighbors is equal to 1
tracks_extremities = [node for node in graph.nodes() if len(graph.neighbors(node)) == 1]
paths = []
# Find all possible paths between extremities
for source, target in itertools.combinations(tracks_extremities, 2):
# Find all path between two nodes
for path in nx.all_simple_paths(graph, source=source, target=target):
# Now we need to check wether this path respect the time logic contraint
# edges can only go in one direction of the time
# Build times vector according to path
t = []
for i, node_srce in enumerate(path[:-1]):
node_trgt = path[i+1]
t.append(graph.edge[node_srce][node_trgt]['t'])
# Will be equal to 1 if going to one time direction
if len(np.unique(np.sign(np.diff(t)))) == 1:
paths.append(path)
# Add each individual trajectory to a new DataFrame called new_trajs
for path in paths:
traj = trajs.loc[path].copy()
traj['label'] = label_id
label_id += 1
new_trajs = new_trajs.append(traj)
trajs = new_trajs
trajs.set_index(['t_stamp', 'label'], inplace=True)
trajs = trajs.sort_index()
return trajs
def filter_spots(spots, name, value, isabove):
if isabove:
spots = spots[spots[name] > value]
else:
spots = spots[spots[name] < value]
return spots
| bsd-3-clause | 6,876,808,598,429,822,000 | 36.753333 | 142 | 0.529931 | false |
kronat/ns-3-dev-git | src/network/bindings/modulegen__gcc_ILP32.py | 1 | 773065 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
return True
pybindgen.settings.error_handler = ErrorHandler()
import sys
def module_init():
root_module = Module('ns.network', cpp_namespace='::ns3')
return root_module
def register_types(module):
root_module = module.get_root()
## packetbb.h (module 'network'): ns3::PbbAddressLength [enumeration]
module.add_enum('PbbAddressLength', ['IPV4', 'IPV6'])
## ethernet-header.h (module 'network'): ns3::ethernet_header_t [enumeration]
module.add_enum('ethernet_header_t', ['LENGTH', 'VLAN', 'QINQ'])
## queue-size.h (module 'network'): ns3::QueueSizeUnit [enumeration]
module.add_enum('QueueSizeUnit', ['PACKETS', 'BYTES'])
## log.h (module 'core'): ns3::LogLevel [enumeration]
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')
## address.h (module 'network'): ns3::Address [class]
module.add_class('Address')
## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address'])
## application-container.h (module 'network'): ns3::ApplicationContainer [class]
module.add_class('ApplicationContainer')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Application > > const_iterator', u'ns3::ApplicationContainer::Iterator')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Application > > const_iterator*', u'ns3::ApplicationContainer::Iterator*')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Application > > const_iterator&', u'ns3::ApplicationContainer::Iterator&')
## ascii-file.h (module 'network'): ns3::AsciiFile [class]
module.add_class('AsciiFile')
## trace-helper.h (module 'network'): ns3::AsciiTraceHelper [class]
module.add_class('AsciiTraceHelper')
## trace-helper.h (module 'network'): ns3::AsciiTraceHelperForDevice [class]
module.add_class('AsciiTraceHelperForDevice', allow_subclassing=True)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList [class]
module.add_class('AttributeConstructionList', import_from_module='ns.core')
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item [struct]
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&')
## buffer.h (module 'network'): ns3::Buffer [class]
module.add_class('Buffer')
## buffer.h (module 'network'): ns3::Buffer::Iterator [class]
module.add_class('Iterator', outer_class=root_module['ns3::Buffer'])
## packet.h (module 'network'): ns3::ByteTagIterator [class]
module.add_class('ByteTagIterator')
## packet.h (module 'network'): ns3::ByteTagIterator::Item [class]
module.add_class('Item', outer_class=root_module['ns3::ByteTagIterator'])
## byte-tag-list.h (module 'network'): ns3::ByteTagList [class]
module.add_class('ByteTagList')
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator [class]
module.add_class('Iterator', outer_class=root_module['ns3::ByteTagList'])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item [struct]
module.add_class('Item', outer_class=root_module['ns3::ByteTagList::Iterator'])
## callback.h (module 'core'): ns3::CallbackBase [class]
module.add_class('CallbackBase', import_from_module='ns.core')
## channel-list.h (module 'network'): ns3::ChannelList [class]
module.add_class('ChannelList')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Channel > > const_iterator', u'ns3::ChannelList::Iterator')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Channel > > const_iterator*', u'ns3::ChannelList::Iterator*')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Channel > > const_iterator&', u'ns3::ChannelList::Iterator&')
## data-output-interface.h (module 'stats'): ns3::DataOutputCallback [class]
module.add_class('DataOutputCallback', allow_subclassing=True, import_from_module='ns.stats')
## data-rate.h (module 'network'): ns3::DataRate [class]
module.add_class('DataRate')
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeChecker'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeValue'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::EventImpl'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NetDeviceQueue> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::NetDeviceQueue'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::NixVector'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::OutputStreamWrapper> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::OutputStreamWrapper'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::Packet'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbAddressBlock> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::PbbAddressBlock'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbMessage> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::PbbMessage'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbTlv> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::PbbTlv'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::QueueItem> [struct]
module.add_class('DefaultDeleter', template_parameters=['ns3::QueueItem'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor'])
## delay-jitter-estimation.h (module 'network'): ns3::DelayJitterEstimation [class]
module.add_class('DelayJitterEstimation')
## event-id.h (module 'core'): ns3::EventId [class]
module.add_class('EventId', import_from_module='ns.core')
## hash.h (module 'core'): ns3::Hasher [class]
module.add_class('Hasher', import_from_module='ns.core')
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class]
module.add_class('Inet6SocketAddress')
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class]
root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class]
module.add_class('InetSocketAddress')
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class]
root_module['ns3::InetSocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## ipv4-address.h (module 'network'): ns3::Ipv4Address [class]
module.add_class('Ipv4Address')
## ipv4-address.h (module 'network'): ns3::Ipv4Address [class]
root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address'])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask [class]
module.add_class('Ipv4Mask')
## ipv6-address.h (module 'network'): ns3::Ipv6Address [class]
module.add_class('Ipv6Address')
## ipv6-address.h (module 'network'): ns3::Ipv6Address [class]
root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
module.add_class('Ipv6Prefix')
## log.h (module 'core'): ns3::LogComponent [class]
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&')
## mac16-address.h (module 'network'): ns3::Mac16Address [class]
module.add_class('Mac16Address')
## mac16-address.h (module 'network'): ns3::Mac16Address [class]
root_module['ns3::Mac16Address'].implicitly_converts_to(root_module['ns3::Address'])
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
module.add_class('Mac48Address')
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&')
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address'])
## mac64-address.h (module 'network'): ns3::Mac64Address [class]
module.add_class('Mac64Address')
## mac64-address.h (module 'network'): ns3::Mac64Address [class]
root_module['ns3::Mac64Address'].implicitly_converts_to(root_module['ns3::Address'])
## mac8-address.h (module 'network'): ns3::Mac8Address [class]
module.add_class('Mac8Address')
## mac8-address.h (module 'network'): ns3::Mac8Address [class]
root_module['ns3::Mac8Address'].implicitly_converts_to(root_module['ns3::Address'])
## net-device-container.h (module 'network'): ns3::NetDeviceContainer [class]
module.add_class('NetDeviceContainer')
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&')
## node-container.h (module 'network'): ns3::NodeContainer [class]
module.add_class('NodeContainer')
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&')
## node-list.h (module 'network'): ns3::NodeList [class]
module.add_class('NodeList')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator', u'ns3::NodeList::Iterator')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator*', u'ns3::NodeList::Iterator*')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator&', u'ns3::NodeList::Iterator&')
## non-copyable.h (module 'core'): ns3::NonCopyable [class]
module.add_class('NonCopyable', destructor_visibility='protected', import_from_module='ns.core')
## object-base.h (module 'core'): ns3::ObjectBase [class]
module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core')
## object.h (module 'core'): ns3::ObjectDeleter [struct]
module.add_class('ObjectDeleter', import_from_module='ns.core')
## object-factory.h (module 'core'): ns3::ObjectFactory [class]
module.add_class('ObjectFactory', import_from_module='ns.core')
## packet-metadata.h (module 'network'): ns3::PacketMetadata [class]
module.add_class('PacketMetadata')
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item [struct]
module.add_class('Item', outer_class=root_module['ns3::PacketMetadata'])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::ItemType [enumeration]
module.add_enum('ItemType', ['PAYLOAD', 'HEADER', 'TRAILER'], outer_class=root_module['ns3::PacketMetadata::Item'])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator [class]
module.add_class('ItemIterator', outer_class=root_module['ns3::PacketMetadata'])
## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress [class]
module.add_class('PacketSocketAddress')
## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress [class]
root_module['ns3::PacketSocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## packet-socket-helper.h (module 'network'): ns3::PacketSocketHelper [class]
module.add_class('PacketSocketHelper')
## packet.h (module 'network'): ns3::PacketTagIterator [class]
module.add_class('PacketTagIterator')
## packet.h (module 'network'): ns3::PacketTagIterator::Item [class]
module.add_class('Item', outer_class=root_module['ns3::PacketTagIterator'])
## packet-tag-list.h (module 'network'): ns3::PacketTagList [class]
module.add_class('PacketTagList')
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData [struct]
module.add_class('TagData', outer_class=root_module['ns3::PacketTagList'])
## log.h (module 'core'): ns3::ParameterLogger [class]
module.add_class('ParameterLogger', import_from_module='ns.core')
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock [class]
module.add_class('PbbAddressTlvBlock')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressTlv > > iterator', u'ns3::PbbAddressTlvBlock::Iterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressTlv > > iterator*', u'ns3::PbbAddressTlvBlock::Iterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressTlv > > iterator&', u'ns3::PbbAddressTlvBlock::Iterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressTlv > > const_iterator', u'ns3::PbbAddressTlvBlock::ConstIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressTlv > > const_iterator*', u'ns3::PbbAddressTlvBlock::ConstIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressTlv > > const_iterator&', u'ns3::PbbAddressTlvBlock::ConstIterator&')
## packetbb.h (module 'network'): ns3::PbbTlvBlock [class]
module.add_class('PbbTlvBlock')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator', u'ns3::PbbTlvBlock::Iterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator*', u'ns3::PbbTlvBlock::Iterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator&', u'ns3::PbbTlvBlock::Iterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator', u'ns3::PbbTlvBlock::ConstIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator*', u'ns3::PbbTlvBlock::ConstIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator&', u'ns3::PbbTlvBlock::ConstIterator&')
## pcap-file.h (module 'network'): ns3::PcapFile [class]
module.add_class('PcapFile')
## trace-helper.h (module 'network'): ns3::PcapHelper [class]
module.add_class('PcapHelper')
## trace-helper.h (module 'network'): ns3::PcapHelper::DataLinkType [enumeration]
module.add_enum('DataLinkType', ['DLT_NULL', 'DLT_EN10MB', 'DLT_PPP', 'DLT_RAW', 'DLT_IEEE802_11', 'DLT_LINUX_SLL', 'DLT_PRISM_HEADER', 'DLT_IEEE802_11_RADIO', 'DLT_IEEE802_15_4', 'DLT_NETLINK'], outer_class=root_module['ns3::PcapHelper'])
## trace-helper.h (module 'network'): ns3::PcapHelperForDevice [class]
module.add_class('PcapHelperForDevice', allow_subclassing=True)
## queue-size.h (module 'network'): ns3::QueueSize [class]
module.add_class('QueueSize')
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int> [class]
module.add_class('SequenceNumber32')
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short> [class]
module.add_class('SequenceNumber16')
## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper [class]
module.add_class('SimpleNetDeviceHelper')
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> [class]
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'))
## simulator.h (module 'core'): ns3::Simulator [class]
module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core')
## simulator.h (module 'core'): ns3::Simulator [enumeration]
module.add_enum('', ['NO_CONTEXT'], outer_class=root_module['ns3::Simulator'], import_from_module='ns.core')
## data-calculator.h (module 'stats'): ns3::StatisticalSummary [class]
module.add_class('StatisticalSummary', allow_subclassing=True, import_from_module='ns.stats')
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs [class]
module.add_class('SystemWallClockMs', import_from_module='ns.core')
## tag.h (module 'network'): ns3::Tag [class]
module.add_class('Tag', parent=root_module['ns3::ObjectBase'])
## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
module.add_class('TagBuffer')
## nstime.h (module 'core'): ns3::TimeWithUnit [class]
module.add_class('TimeWithUnit', import_from_module='ns.core')
## traced-value.h (module 'core'): ns3::TracedValue<unsigned int> [class]
module.add_class('TracedValue', import_from_module='ns.core', template_parameters=['unsigned int'])
## type-id.h (module 'core'): ns3::TypeId [class]
module.add_class('TypeId', import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::AttributeFlag [enumeration]
module.add_enum('AttributeFlag', ['ATTR_GET', 'ATTR_SET', 'ATTR_CONSTRUCT', 'ATTR_SGC'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::SupportLevel [enumeration]
module.add_enum('SupportLevel', ['SUPPORTED', 'DEPRECATED', 'OBSOLETE'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation [struct]
module.add_class('AttributeInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId'])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation [struct]
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&')
## empty.h (module 'core'): ns3::empty [class]
module.add_class('empty', import_from_module='ns.core')
## int64x64-128.h (module 'core'): ns3::int64x64_t [class]
module.add_class('int64x64_t', import_from_module='ns.core')
## int64x64-128.h (module 'core'): ns3::int64x64_t::impl_type [enumeration]
module.add_enum('impl_type', ['int128_impl', 'cairo_impl', 'ld_impl'], outer_class=root_module['ns3::int64x64_t'], import_from_module='ns.core')
## chunk.h (module 'network'): ns3::Chunk [class]
module.add_class('Chunk', parent=root_module['ns3::ObjectBase'])
## packet-socket.h (module 'network'): ns3::DeviceNameTag [class]
module.add_class('DeviceNameTag', parent=root_module['ns3::Tag'])
## flow-id-tag.h (module 'network'): ns3::FlowIdTag [class]
module.add_class('FlowIdTag', parent=root_module['ns3::Tag'])
## header.h (module 'network'): ns3::Header [class]
module.add_class('Header', parent=root_module['ns3::Chunk'])
## llc-snap-header.h (module 'network'): ns3::LlcSnapHeader [class]
module.add_class('LlcSnapHeader', parent=root_module['ns3::Header'])
## object.h (module 'core'): ns3::Object [class]
module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
## object.h (module 'core'): ns3::Object::AggregateIterator [class]
module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object'])
## packet-burst.h (module 'network'): ns3::PacketBurst [class]
module.add_class('PacketBurst', 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&')
## packet-socket.h (module 'network'): ns3::PacketSocketTag [class]
module.add_class('PacketSocketTag', parent=root_module['ns3::Tag'])
## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class]
module.add_class('PcapFileWrapper', parent=root_module['ns3::Object'])
## queue.h (module 'network'): ns3::QueueBase [class]
module.add_class('QueueBase', parent=root_module['ns3::Object'])
## queue-limits.h (module 'network'): ns3::QueueLimits [class]
module.add_class('QueueLimits', parent=root_module['ns3::Object'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader [class]
module.add_class('RadiotapHeader', parent=root_module['ns3::Header'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::FrameFlag [enumeration]
module.add_enum('FrameFlag', ['FRAME_FLAG_NONE', 'FRAME_FLAG_CFP', 'FRAME_FLAG_SHORT_PREAMBLE', 'FRAME_FLAG_WEP', 'FRAME_FLAG_FRAGMENTED', 'FRAME_FLAG_FCS_INCLUDED', 'FRAME_FLAG_DATA_PADDING', 'FRAME_FLAG_BAD_FCS', 'FRAME_FLAG_SHORT_GUARD'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::ChannelFlags [enumeration]
module.add_enum('ChannelFlags', ['CHANNEL_FLAG_NONE', 'CHANNEL_FLAG_TURBO', 'CHANNEL_FLAG_CCK', 'CHANNEL_FLAG_OFDM', 'CHANNEL_FLAG_SPECTRUM_2GHZ', 'CHANNEL_FLAG_SPECTRUM_5GHZ', 'CHANNEL_FLAG_PASSIVE', 'CHANNEL_FLAG_DYNAMIC', 'CHANNEL_FLAG_GFSK'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::McsKnown [enumeration]
module.add_enum('McsKnown', ['MCS_KNOWN_NONE', 'MCS_KNOWN_BANDWIDTH', 'MCS_KNOWN_INDEX', 'MCS_KNOWN_GUARD_INTERVAL', 'MCS_KNOWN_HT_FORMAT', 'MCS_KNOWN_FEC_TYPE', 'MCS_KNOWN_STBC', 'MCS_KNOWN_NESS', 'MCS_KNOWN_NESS_BIT_1'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::McsFlags [enumeration]
module.add_enum('McsFlags', ['MCS_FLAGS_NONE', 'MCS_FLAGS_BANDWIDTH_40', 'MCS_FLAGS_BANDWIDTH_20L', 'MCS_FLAGS_BANDWIDTH_20U', 'MCS_FLAGS_GUARD_INTERVAL', 'MCS_FLAGS_HT_GREENFIELD', 'MCS_FLAGS_FEC_TYPE', 'MCS_FLAGS_STBC_STREAMS', 'MCS_FLAGS_NESS_BIT_0'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::AmpduFlags [enumeration]
module.add_enum('AmpduFlags', ['A_MPDU_STATUS_NONE', 'A_MPDU_STATUS_REPORT_ZERO_LENGTH', 'A_MPDU_STATUS_IS_ZERO_LENGTH', 'A_MPDU_STATUS_LAST_KNOWN', 'A_MPDU_STATUS_LAST', 'A_MPDU_STATUS_DELIMITER_CRC_ERROR', 'A_MPDU_STATUS_DELIMITER_CRC_KNOWN'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::VhtKnown [enumeration]
module.add_enum('VhtKnown', ['VHT_KNOWN_NONE', 'VHT_KNOWN_STBC', 'VHT_KNOWN_TXOP_PS_NOT_ALLOWED', 'VHT_KNOWN_GUARD_INTERVAL', 'VHT_KNOWN_SHORT_GI_NSYM_DISAMBIGUATION', 'VHT_KNOWN_LDPC_EXTRA_OFDM_SYMBOL', 'VHT_KNOWN_BEAMFORMED', 'VHT_KNOWN_BANDWIDTH', 'VHT_KNOWN_GROUP_ID', 'VHT_KNOWN_PARTIAL_AID'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::VhtFlags [enumeration]
module.add_enum('VhtFlags', ['VHT_FLAGS_NONE', 'VHT_FLAGS_STBC', 'VHT_FLAGS_TXOP_PS_NOT_ALLOWED', 'VHT_FLAGS_GUARD_INTERVAL', 'VHT_FLAGS_SHORT_GI_NSYM_DISAMBIGUATION', 'VHT_FLAGS_LDPC_EXTRA_OFDM_SYMBOL', 'VHT_FLAGS_BEAMFORMED'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::HeData1 [enumeration]
module.add_enum('HeData1', ['HE_DATA1_FORMAT_EXT_SU', 'HE_DATA1_FORMAT_MU', 'HE_DATA1_FORMAT_TRIG', 'HE_DATA1_BSS_COLOR_KNOWN', 'HE_DATA1_BEAM_CHANGE_KNOWN', 'HE_DATA1_UL_DL_KNOWN', 'HE_DATA1_DATA_MCS_KNOWN', 'HE_DATA1_DATA_DCM_KNOWN', 'HE_DATA1_CODING_KNOWN', 'HE_DATA1_LDPC_XSYMSEG_KNOWN', 'HE_DATA1_STBC_KNOWN', 'HE_DATA1_SPTL_REUSE_KNOWN', 'HE_DATA1_SPTL_REUSE2_KNOWN', 'HE_DATA1_SPTL_REUSE3_KNOWN', 'HE_DATA1_SPTL_REUSE4_KNOWN', 'HE_DATA1_BW_RU_ALLOC_KNOWN', 'HE_DATA1_DOPPLER_KNOWN'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::HeData2 [enumeration]
module.add_enum('HeData2', ['HE_DATA2_PRISEC_80_KNOWN', 'HE_DATA2_GI_KNOWN', 'HE_DATA2_NUM_LTF_SYMS_KNOWN', 'HE_DATA2_PRE_FEC_PAD_KNOWN', 'HE_DATA2_TXBF_KNOWN', 'HE_DATA2_PE_DISAMBIG_KNOWN', 'HE_DATA2_TXOP_KNOWN', 'HE_DATA2_MIDAMBLE_KNOWN', 'HE_DATA2_RU_OFFSET', 'HE_DATA2_RU_OFFSET_KNOWN', 'HE_DATA2_PRISEC_80_SEC'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::HeData3 [enumeration]
module.add_enum('HeData3', ['HE_DATA3_BSS_COLOR', 'HE_DATA3_BEAM_CHANGE', 'HE_DATA3_UL_DL', 'HE_DATA3_DATA_MCS', 'HE_DATA3_DATA_DCM', 'HE_DATA3_CODING', 'HE_DATA3_LDPC_XSYMSEG', 'HE_DATA3_STBC'], outer_class=root_module['ns3::RadiotapHeader'])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::HeData5 [enumeration]
module.add_enum('HeData5', ['HE_DATA5_DATA_BW_RU_ALLOC_40MHZ', 'HE_DATA5_DATA_BW_RU_ALLOC_80MHZ', 'HE_DATA5_DATA_BW_RU_ALLOC_160MHZ', 'HE_DATA5_DATA_BW_RU_ALLOC_26T', 'HE_DATA5_DATA_BW_RU_ALLOC_52T', 'HE_DATA5_DATA_BW_RU_ALLOC_106T', 'HE_DATA5_DATA_BW_RU_ALLOC_242T', 'HE_DATA5_DATA_BW_RU_ALLOC_484T', 'HE_DATA5_DATA_BW_RU_ALLOC_996T', 'HE_DATA5_DATA_BW_RU_ALLOC_2x996T', 'HE_DATA5_GI_1_6', 'HE_DATA5_GI_3_2', 'HE_DATA5_LTF_SYM_SIZE', 'HE_DATA5_NUM_LTF_SYMS', 'HE_DATA5_PRE_FEC_PAD', 'HE_DATA5_TXBF', 'HE_DATA5_PE_DISAMBIG'], outer_class=root_module['ns3::RadiotapHeader'])
## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class]
module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object'])
## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable [class]
module.add_class('SequentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > [class]
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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > [class]
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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > [class]
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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NetDeviceQueue, ns3::empty, ns3::DefaultDeleter<ns3::NetDeviceQueue> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::NetDeviceQueue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::NetDeviceQueue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, 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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::OutputStreamWrapper', 'ns3::empty', 'ns3::DefaultDeleter<ns3::OutputStreamWrapper>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, 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'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbAddressBlock', 'ns3::empty', 'ns3::DefaultDeleter<ns3::PbbAddressBlock>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbMessage', 'ns3::empty', 'ns3::DefaultDeleter<ns3::PbbMessage>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbPacket', 'ns3::Header', 'ns3::DefaultDeleter<ns3::PbbPacket>'], parent=root_module['ns3::Header'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbTlv', 'ns3::empty', 'ns3::DefaultDeleter<ns3::PbbTlv>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::QueueItem, ns3::empty, ns3::DefaultDeleter<ns3::QueueItem> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::QueueItem', 'ns3::empty', 'ns3::DefaultDeleter<ns3::QueueItem>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
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'))
## sll-header.h (module 'network'): ns3::SllHeader [class]
module.add_class('SllHeader', parent=root_module['ns3::Header'])
## sll-header.h (module 'network'): ns3::SllHeader::PacketType [enumeration]
module.add_enum('PacketType', ['UNICAST_FROM_PEER_TO_ME', 'BROADCAST_BY_PEER', 'MULTICAST_BY_PEER', 'INTERCEPTED_PACKET', 'SENT_BY_US'], outer_class=root_module['ns3::SllHeader'])
## socket.h (module 'network'): ns3::Socket [class]
module.add_class('Socket', parent=root_module['ns3::Object'])
## socket.h (module 'network'): ns3::Socket::SocketErrno [enumeration]
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'])
## socket.h (module 'network'): ns3::Socket::SocketType [enumeration]
module.add_enum('SocketType', ['NS3_SOCK_STREAM', 'NS3_SOCK_SEQPACKET', 'NS3_SOCK_DGRAM', 'NS3_SOCK_RAW'], outer_class=root_module['ns3::Socket'])
## socket.h (module 'network'): ns3::Socket::SocketPriority [enumeration]
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'])
## socket.h (module 'network'): ns3::Socket::Ipv6MulticastFilterMode [enumeration]
module.add_enum('Ipv6MulticastFilterMode', ['INCLUDE', 'EXCLUDE'], outer_class=root_module['ns3::Socket'])
## socket-factory.h (module 'network'): ns3::SocketFactory [class]
module.add_class('SocketFactory', parent=root_module['ns3::Object'])
## socket.h (module 'network'): ns3::SocketIpTosTag [class]
module.add_class('SocketIpTosTag', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpTtlTag [class]
module.add_class('SocketIpTtlTag', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag [class]
module.add_class('SocketIpv6HopLimitTag', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpv6TclassTag [class]
module.add_class('SocketIpv6TclassTag', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketPriorityTag [class]
module.add_class('SocketPriorityTag', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag [class]
module.add_class('SocketSetDontFragmentTag', parent=root_module['ns3::Tag'])
## nstime.h (module 'core'): ns3::Time [class]
module.add_class('Time', import_from_module='ns.core')
## nstime.h (module 'core'): ns3::Time::Unit [enumeration]
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&')
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
module.add_class('TraceSourceAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
## trailer.h (module 'network'): ns3::Trailer [class]
module.add_class('Trailer', parent=root_module['ns3::Chunk'])
## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable [class]
module.add_class('TriangularRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable [class]
module.add_class('UniformRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable [class]
module.add_class('WeibullRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class]
module.add_class('ZetaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable [class]
module.add_class('ZipfRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## application.h (module 'network'): ns3::Application [class]
module.add_class('Application', 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&')
## attribute.h (module 'core'): ns3::AttributeAccessor [class]
module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
## attribute.h (module 'core'): ns3::AttributeChecker [class]
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> >'])
## attribute.h (module 'core'): ns3::AttributeValue [class]
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> >'])
## boolean.h (module 'core'): ns3::BooleanChecker [class]
module.add_class('BooleanChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## boolean.h (module 'core'): ns3::BooleanValue [class]
module.add_class('BooleanValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## callback.h (module 'core'): ns3::CallbackChecker [class]
module.add_class('CallbackChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## callback.h (module 'core'): ns3::CallbackImplBase [class]
module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
## callback.h (module 'core'): ns3::CallbackValue [class]
module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## channel.h (module 'network'): ns3::Channel [class]
module.add_class('Channel', parent=root_module['ns3::Object'])
## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class]
module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## data-calculator.h (module 'stats'): ns3::DataCalculator [class]
module.add_class('DataCalculator', import_from_module='ns.stats', parent=root_module['ns3::Object'])
## data-collection-object.h (module 'stats'): ns3::DataCollectionObject [class]
module.add_class('DataCollectionObject', import_from_module='ns.stats', parent=root_module['ns3::Object'])
## data-output-interface.h (module 'stats'): ns3::DataOutputInterface [class]
module.add_class('DataOutputInterface', import_from_module='ns.stats', parent=root_module['ns3::Object'])
## data-rate.h (module 'network'): ns3::DataRateChecker [class]
module.add_class('DataRateChecker', parent=root_module['ns3::AttributeChecker'])
## data-rate.h (module 'network'): ns3::DataRateValue [class]
module.add_class('DataRateValue', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable [class]
module.add_class('DeterministicRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## double.h (module 'core'): ns3::DoubleValue [class]
module.add_class('DoubleValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## dynamic-queue-limits.h (module 'network'): ns3::DynamicQueueLimits [class]
module.add_class('DynamicQueueLimits', parent=root_module['ns3::QueueLimits'])
## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable [class]
module.add_class('EmpiricalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor [class]
module.add_class('EmptyAttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::AttributeAccessor'])
## attribute.h (module 'core'): ns3::EmptyAttributeChecker [class]
module.add_class('EmptyAttributeChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## attribute.h (module 'core'): ns3::EmptyAttributeValue [class]
module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## enum.h (module 'core'): ns3::EnumChecker [class]
module.add_class('EnumChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## enum.h (module 'core'): ns3::EnumValue [class]
module.add_class('EnumValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable [class]
module.add_class('ErlangRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## error-model.h (module 'network'): ns3::ErrorModel [class]
module.add_class('ErrorModel', parent=root_module['ns3::Object'])
## ethernet-header.h (module 'network'): ns3::EthernetHeader [class]
module.add_class('EthernetHeader', parent=root_module['ns3::Header'])
## ethernet-trailer.h (module 'network'): ns3::EthernetTrailer [class]
module.add_class('EthernetTrailer', parent=root_module['ns3::Trailer'])
## event-impl.h (module 'core'): ns3::EventImpl [class]
module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable [class]
module.add_class('ExponentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable [class]
module.add_class('GammaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## integer.h (module 'core'): ns3::IntegerValue [class]
module.add_class('IntegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker [class]
module.add_class('Ipv4AddressChecker', parent=root_module['ns3::AttributeChecker'])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue [class]
module.add_class('Ipv4AddressValue', parent=root_module['ns3::AttributeValue'])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker [class]
module.add_class('Ipv4MaskChecker', parent=root_module['ns3::AttributeChecker'])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue [class]
module.add_class('Ipv4MaskValue', parent=root_module['ns3::AttributeValue'])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker [class]
module.add_class('Ipv6AddressChecker', parent=root_module['ns3::AttributeChecker'])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue [class]
module.add_class('Ipv6AddressValue', parent=root_module['ns3::AttributeValue'])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker [class]
module.add_class('Ipv6PrefixChecker', parent=root_module['ns3::AttributeChecker'])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue [class]
module.add_class('Ipv6PrefixValue', parent=root_module['ns3::AttributeValue'])
## error-model.h (module 'network'): ns3::ListErrorModel [class]
module.add_class('ListErrorModel', parent=root_module['ns3::ErrorModel'])
## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable [class]
module.add_class('LogNormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## mac16-address.h (module 'network'): ns3::Mac16AddressChecker [class]
module.add_class('Mac16AddressChecker', parent=root_module['ns3::AttributeChecker'])
## mac16-address.h (module 'network'): ns3::Mac16AddressValue [class]
module.add_class('Mac16AddressValue', parent=root_module['ns3::AttributeValue'])
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker [class]
module.add_class('Mac48AddressChecker', parent=root_module['ns3::AttributeChecker'])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue [class]
module.add_class('Mac48AddressValue', parent=root_module['ns3::AttributeValue'])
## mac64-address.h (module 'network'): ns3::Mac64AddressChecker [class]
module.add_class('Mac64AddressChecker', parent=root_module['ns3::AttributeChecker'])
## mac64-address.h (module 'network'): ns3::Mac64AddressValue [class]
module.add_class('Mac64AddressValue', parent=root_module['ns3::AttributeValue'])
## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<unsigned int> [class]
module.add_class('MinMaxAvgTotalCalculator', import_from_module='ns.stats', template_parameters=['unsigned int'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']])
## net-device.h (module 'network'): ns3::NetDevice [class]
module.add_class('NetDevice', parent=root_module['ns3::Object'])
## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration]
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'])
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&')
## net-device-queue-interface.h (module 'network'): ns3::NetDeviceQueue [class]
module.add_class('NetDeviceQueue', parent=root_module['ns3::SimpleRefCount< ns3::NetDeviceQueue, ns3::empty, ns3::DefaultDeleter<ns3::NetDeviceQueue> >'])
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::NetDeviceQueue::WakeCallback')
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::NetDeviceQueue::WakeCallback*')
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::NetDeviceQueue::WakeCallback&')
## net-device-queue-interface.h (module 'network'): ns3::NetDeviceQueueInterface [class]
module.add_class('NetDeviceQueueInterface', parent=root_module['ns3::Object'])
typehandlers.add_type_alias(u'std::function< unsigned long long ( ns3::Ptr< ns3::QueueItem > ) >', u'ns3::NetDeviceQueueInterface::SelectQueueCallback')
typehandlers.add_type_alias(u'std::function< unsigned long long ( ns3::Ptr< ns3::QueueItem > ) >*', u'ns3::NetDeviceQueueInterface::SelectQueueCallback*')
typehandlers.add_type_alias(u'std::function< unsigned long long ( ns3::Ptr< ns3::QueueItem > ) >&', u'ns3::NetDeviceQueueInterface::SelectQueueCallback&')
## nix-vector.h (module 'network'): ns3::NixVector [class]
module.add_class('NixVector', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
## node.h (module 'network'): ns3::Node [class]
module.add_class('Node', 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&')
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable [class]
module.add_class('NormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class]
module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue [class]
module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper [class]
module.add_class('OutputStreamWrapper', parent=root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
## packet.h (module 'network'): ns3::Packet [class]
module.add_class('Packet', 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&')
## packet-data-calculators.h (module 'network'): ns3::PacketSizeMinMaxAvgTotalCalculator [class]
module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
## packet-socket.h (module 'network'): ns3::PacketSocket [class]
module.add_class('PacketSocket', parent=root_module['ns3::Socket'])
## packet-socket-client.h (module 'network'): ns3::PacketSocketClient [class]
module.add_class('PacketSocketClient', parent=root_module['ns3::Application'])
## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory [class]
module.add_class('PacketSocketFactory', parent=root_module['ns3::SocketFactory'])
## packet-socket-server.h (module 'network'): ns3::PacketSocketServer [class]
module.add_class('PacketSocketServer', parent=root_module['ns3::Application'])
## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class]
module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## packetbb.h (module 'network'): ns3::PbbAddressBlock [class]
module.add_class('PbbAddressBlock', parent=root_module['ns3::SimpleRefCount< ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >'])
typehandlers.add_type_alias(u'std::list< ns3::Address > iterator', u'ns3::PbbAddressBlock::AddressIterator')
typehandlers.add_type_alias(u'std::list< ns3::Address > iterator*', u'ns3::PbbAddressBlock::AddressIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Address > iterator&', u'ns3::PbbAddressBlock::AddressIterator&')
typehandlers.add_type_alias(u'std::list< ns3::Address > const_iterator', u'ns3::PbbAddressBlock::ConstAddressIterator')
typehandlers.add_type_alias(u'std::list< ns3::Address > const_iterator*', u'ns3::PbbAddressBlock::ConstAddressIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Address > const_iterator&', u'ns3::PbbAddressBlock::ConstAddressIterator&')
typehandlers.add_type_alias(u'std::list< unsigned char > iterator', u'ns3::PbbAddressBlock::PrefixIterator')
typehandlers.add_type_alias(u'std::list< unsigned char > iterator*', u'ns3::PbbAddressBlock::PrefixIterator*')
typehandlers.add_type_alias(u'std::list< unsigned char > iterator&', u'ns3::PbbAddressBlock::PrefixIterator&')
typehandlers.add_type_alias(u'std::list< unsigned char > const_iterator', u'ns3::PbbAddressBlock::ConstPrefixIterator')
typehandlers.add_type_alias(u'std::list< unsigned char > const_iterator*', u'ns3::PbbAddressBlock::ConstPrefixIterator*')
typehandlers.add_type_alias(u'std::list< unsigned char > const_iterator&', u'ns3::PbbAddressBlock::ConstPrefixIterator&')
typehandlers.add_type_alias(u'ns3::PbbAddressTlvBlock::Iterator', u'ns3::PbbAddressBlock::TlvIterator')
typehandlers.add_type_alias(u'ns3::PbbAddressTlvBlock::Iterator*', u'ns3::PbbAddressBlock::TlvIterator*')
typehandlers.add_type_alias(u'ns3::PbbAddressTlvBlock::Iterator&', u'ns3::PbbAddressBlock::TlvIterator&')
typehandlers.add_type_alias(u'ns3::PbbAddressTlvBlock::ConstIterator', u'ns3::PbbAddressBlock::ConstTlvIterator')
typehandlers.add_type_alias(u'ns3::PbbAddressTlvBlock::ConstIterator*', u'ns3::PbbAddressBlock::ConstTlvIterator*')
typehandlers.add_type_alias(u'ns3::PbbAddressTlvBlock::ConstIterator&', u'ns3::PbbAddressBlock::ConstTlvIterator&')
## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv4 [class]
module.add_class('PbbAddressBlockIpv4', parent=root_module['ns3::PbbAddressBlock'])
## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv6 [class]
module.add_class('PbbAddressBlockIpv6', parent=root_module['ns3::PbbAddressBlock'])
## packetbb.h (module 'network'): ns3::PbbMessage [class]
module.add_class('PbbMessage', parent=root_module['ns3::SimpleRefCount< ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >'])
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator', u'ns3::PbbMessage::TlvIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator*', u'ns3::PbbMessage::TlvIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator&', u'ns3::PbbMessage::TlvIterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator', u'ns3::PbbMessage::ConstTlvIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator*', u'ns3::PbbMessage::ConstTlvIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator&', u'ns3::PbbMessage::ConstTlvIterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressBlock > > iterator', u'ns3::PbbMessage::AddressBlockIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressBlock > > iterator*', u'ns3::PbbMessage::AddressBlockIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressBlock > > iterator&', u'ns3::PbbMessage::AddressBlockIterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressBlock > > const_iterator', u'ns3::PbbMessage::ConstAddressBlockIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressBlock > > const_iterator*', u'ns3::PbbMessage::ConstAddressBlockIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbAddressBlock > > const_iterator&', u'ns3::PbbMessage::ConstAddressBlockIterator&')
## packetbb.h (module 'network'): ns3::PbbMessageIpv4 [class]
module.add_class('PbbMessageIpv4', parent=root_module['ns3::PbbMessage'])
## packetbb.h (module 'network'): ns3::PbbMessageIpv6 [class]
module.add_class('PbbMessageIpv6', parent=root_module['ns3::PbbMessage'])
## packetbb.h (module 'network'): ns3::PbbPacket [class]
module.add_class('PbbPacket', parent=root_module['ns3::SimpleRefCount< ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >'])
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator', u'ns3::PbbPacket::TlvIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator*', u'ns3::PbbPacket::TlvIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > iterator&', u'ns3::PbbPacket::TlvIterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator', u'ns3::PbbPacket::ConstTlvIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator*', u'ns3::PbbPacket::ConstTlvIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbTlv > > const_iterator&', u'ns3::PbbPacket::ConstTlvIterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbMessage > > iterator', u'ns3::PbbPacket::MessageIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbMessage > > iterator*', u'ns3::PbbPacket::MessageIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbMessage > > iterator&', u'ns3::PbbPacket::MessageIterator&')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbMessage > > const_iterator', u'ns3::PbbPacket::ConstMessageIterator')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbMessage > > const_iterator*', u'ns3::PbbPacket::ConstMessageIterator*')
typehandlers.add_type_alias(u'std::list< ns3::Ptr< ns3::PbbMessage > > const_iterator&', u'ns3::PbbPacket::ConstMessageIterator&')
## packetbb.h (module 'network'): ns3::PbbTlv [class]
module.add_class('PbbTlv', parent=root_module['ns3::SimpleRefCount< ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >'])
## probe.h (module 'stats'): ns3::Probe [class]
module.add_class('Probe', import_from_module='ns.stats', parent=root_module['ns3::DataCollectionObject'])
## queue.h (module 'network'): ns3::Queue<ns3::Packet> [class]
module.add_class('Queue', template_parameters=['ns3::Packet'], parent=root_module['ns3::QueueBase'])
typehandlers.add_type_alias(u'ns3::Packet', u'ns3::Queue< ns3::Packet > ItemType')
typehandlers.add_type_alias(u'ns3::Packet*', u'ns3::Queue< ns3::Packet > ItemType*')
typehandlers.add_type_alias(u'ns3::Packet&', u'ns3::Queue< ns3::Packet > ItemType&')
module.add_typedef(root_module['ns3::Packet'], 'ItemType')
## queue.h (module 'network'): ns3::Queue<ns3::QueueDiscItem> [class]
module.add_class('Queue', template_parameters=['ns3::QueueDiscItem'], parent=root_module['ns3::QueueBase'])
typehandlers.add_type_alias(u'ns3::QueueDiscItem', u'ns3::Queue< ns3::QueueDiscItem > ItemType')
typehandlers.add_type_alias(u'ns3::QueueDiscItem*', u'ns3::Queue< ns3::QueueDiscItem > ItemType*')
typehandlers.add_type_alias(u'ns3::QueueDiscItem&', u'ns3::Queue< ns3::QueueDiscItem > ItemType&')
## queue-item.h (module 'network'): ns3::QueueItem [class]
module.add_class('QueueItem', parent=root_module['ns3::SimpleRefCount< ns3::QueueItem, ns3::empty, ns3::DefaultDeleter<ns3::QueueItem> >'])
## queue-item.h (module 'network'): ns3::QueueItem::Uint8Values [enumeration]
module.add_enum('Uint8Values', ['IP_DSFIELD'], outer_class=root_module['ns3::QueueItem'])
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::QueueItem const > )', u'ns3::QueueItem::TracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::QueueItem const > )*', u'ns3::QueueItem::TracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::QueueItem const > )&', u'ns3::QueueItem::TracedCallback&')
## queue-size.h (module 'network'): ns3::QueueSizeChecker [class]
module.add_class('QueueSizeChecker', parent=root_module['ns3::AttributeChecker'])
## queue-size.h (module 'network'): ns3::QueueSizeValue [class]
module.add_class('QueueSizeValue', parent=root_module['ns3::AttributeValue'])
## error-model.h (module 'network'): ns3::RateErrorModel [class]
module.add_class('RateErrorModel', parent=root_module['ns3::ErrorModel'])
## error-model.h (module 'network'): ns3::RateErrorModel::ErrorUnit [enumeration]
module.add_enum('ErrorUnit', ['ERROR_UNIT_BIT', 'ERROR_UNIT_BYTE', 'ERROR_UNIT_PACKET'], outer_class=root_module['ns3::RateErrorModel'])
## error-model.h (module 'network'): ns3::ReceiveListErrorModel [class]
module.add_class('ReceiveListErrorModel', parent=root_module['ns3::ErrorModel'])
## simple-channel.h (module 'network'): ns3::SimpleChannel [class]
module.add_class('SimpleChannel', parent=root_module['ns3::Channel'])
## simple-net-device.h (module 'network'): ns3::SimpleNetDevice [class]
module.add_class('SimpleNetDevice', parent=root_module['ns3::NetDevice'])
## nstime.h (module 'core'): ns3::TimeValue [class]
module.add_class('TimeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## type-id.h (module 'core'): ns3::TypeIdChecker [class]
module.add_class('TypeIdChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## type-id.h (module 'core'): ns3::TypeIdValue [class]
module.add_class('TypeIdValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## uinteger.h (module 'core'): ns3::UintegerValue [class]
module.add_class('UintegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## address.h (module 'network'): ns3::AddressChecker [class]
module.add_class('AddressChecker', parent=root_module['ns3::AttributeChecker'])
## address.h (module 'network'): ns3::AddressValue [class]
module.add_class('AddressValue', parent=root_module['ns3::AttributeValue'])
## error-model.h (module 'network'): ns3::BinaryErrorModel [class]
module.add_class('BinaryErrorModel', parent=root_module['ns3::ErrorModel'])
## error-model.h (module 'network'): ns3::BurstErrorModel [class]
module.add_class('BurstErrorModel', parent=root_module['ns3::ErrorModel'])
## callback.h (module 'core'): ns3::CallbackImpl<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> [class]
module.add_class('CallbackImpl', 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'])
## callback.h (module 'core'): ns3::CallbackImpl<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> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<const ns3::Packet>', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<const ns3::QueueDiscItem>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<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> [class]
module.add_class('CallbackImpl', 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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
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'])
## callback.h (module 'core'): ns3::CallbackImpl<void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned int', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## basic-data-calculators.h (module 'stats'): ns3::CounterCalculator<unsigned int> [class]
module.add_class('CounterCalculator', import_from_module='ns.stats', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
## drop-tail-queue.h (module 'network'): ns3::DropTailQueue<ns3::Packet> [class]
module.add_class('DropTailQueue', template_parameters=['ns3::Packet'], parent=root_module['ns3::Queue< ns3::Packet >'])
## drop-tail-queue.h (module 'network'): ns3::DropTailQueue<ns3::QueueDiscItem> [class]
module.add_class('DropTailQueue', template_parameters=['ns3::QueueDiscItem'], parent=root_module['ns3::Queue< ns3::QueueDiscItem >'])
## error-channel.h (module 'network'): ns3::ErrorChannel [class]
module.add_class('ErrorChannel', parent=root_module['ns3::SimpleChannel'])
## packet-data-calculators.h (module 'network'): ns3::PacketCounterCalculator [class]
module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >'])
## packet-probe.h (module 'network'): ns3::PacketProbe [class]
module.add_class('PacketProbe', parent=root_module['ns3::Probe'])
## packetbb.h (module 'network'): ns3::PbbAddressTlv [class]
module.add_class('PbbAddressTlv', parent=root_module['ns3::PbbTlv'])
## queue-item.h (module 'network'): ns3::QueueDiscItem [class]
module.add_class('QueueDiscItem', parent=root_module['ns3::QueueItem'])
module.add_container('std::map< std::string, ns3::LogComponent * >', ('std::string', 'ns3::LogComponent *'), container_type=u'map')
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::list< unsigned int >', 'unsigned int', container_type=u'list')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned int, int >', u'ns3::SequenceNumber32')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned int, int >*', u'ns3::SequenceNumber32*')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned int, int >&', u'ns3::SequenceNumber32&')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned short, short >', u'ns3::SequenceNumber16')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned short, short >*', u'ns3::SequenceNumber16*')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned short, short >&', u'ns3::SequenceNumber16&')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned char, signed char >', u'ns3::SequenceNumber8')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned char, signed char >*', u'ns3::SequenceNumber8*')
typehandlers.add_type_alias(u'ns3::SequenceNumber< unsigned char, signed char >&', u'ns3::SequenceNumber8&')
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'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&')
## Register a nested module for the namespace FatalImpl
nested_module = module.add_cpp_namespace('FatalImpl')
register_types_ns3_FatalImpl(nested_module)
## Register a nested module for the namespace Hash
nested_module = module.add_cpp_namespace('Hash')
register_types_ns3_Hash(nested_module)
## Register a nested module for the namespace TracedValueCallback
nested_module = module.add_cpp_namespace('TracedValueCallback')
register_types_ns3_TracedValueCallback(nested_module)
## Register a nested module for the namespace addressUtils
nested_module = module.add_cpp_namespace('addressUtils')
register_types_ns3_addressUtils(nested_module)
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace tests
nested_module = module.add_cpp_namespace('tests')
register_types_ns3_tests(nested_module)
def register_types_ns3_FatalImpl(module):
root_module = module.get_root()
def register_types_ns3_Hash(module):
root_module = module.get_root()
## hash-function.h (module 'core'): ns3::Hash::Implementation [class]
module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, std::size_t const )', u'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, std::size_t const )*', u'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, std::size_t const )&', u'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, std::size_t const )', u'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, std::size_t const )*', u'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, std::size_t const )&', u'ns3::Hash::Hash64Function_ptr&')
## Register a nested module for the namespace Function
nested_module = module.add_cpp_namespace('Function')
register_types_ns3_Hash_Function(nested_module)
def register_types_ns3_Hash_Function(module):
root_module = module.get_root()
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a [class]
module.add_class('Fnv1a', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32 [class]
module.add_class('Hash32', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64 [class]
module.add_class('Hash64', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3 [class]
module.add_class('Murmur3', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
def register_types_ns3_TracedValueCallback(module):
root_module = module.get_root()
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time, ns3::Time )', u'ns3::TracedValueCallback::Time')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time, ns3::Time )*', u'ns3::TracedValueCallback::Time*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time, ns3::Time )&', u'ns3::TracedValueCallback::Time&')
typehandlers.add_type_alias(u'void ( * ) ( ns3::SequenceNumber32, ns3::SequenceNumber32 )', u'ns3::TracedValueCallback::SequenceNumber32')
typehandlers.add_type_alias(u'void ( * ) ( ns3::SequenceNumber32, ns3::SequenceNumber32 )*', u'ns3::TracedValueCallback::SequenceNumber32*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::SequenceNumber32, ns3::SequenceNumber32 )&', u'ns3::TracedValueCallback::SequenceNumber32&')
typehandlers.add_type_alias(u'void ( * ) ( bool, bool )', u'ns3::TracedValueCallback::Bool')
typehandlers.add_type_alias(u'void ( * ) ( bool, bool )*', u'ns3::TracedValueCallback::Bool*')
typehandlers.add_type_alias(u'void ( * ) ( bool, bool )&', u'ns3::TracedValueCallback::Bool&')
typehandlers.add_type_alias(u'void ( * ) ( int8_t, int8_t )', u'ns3::TracedValueCallback::Int8')
typehandlers.add_type_alias(u'void ( * ) ( int8_t, int8_t )*', u'ns3::TracedValueCallback::Int8*')
typehandlers.add_type_alias(u'void ( * ) ( int8_t, int8_t )&', u'ns3::TracedValueCallback::Int8&')
typehandlers.add_type_alias(u'void ( * ) ( uint8_t, uint8_t )', u'ns3::TracedValueCallback::Uint8')
typehandlers.add_type_alias(u'void ( * ) ( uint8_t, uint8_t )*', u'ns3::TracedValueCallback::Uint8*')
typehandlers.add_type_alias(u'void ( * ) ( uint8_t, uint8_t )&', u'ns3::TracedValueCallback::Uint8&')
typehandlers.add_type_alias(u'void ( * ) ( int16_t, int16_t )', u'ns3::TracedValueCallback::Int16')
typehandlers.add_type_alias(u'void ( * ) ( int16_t, int16_t )*', u'ns3::TracedValueCallback::Int16*')
typehandlers.add_type_alias(u'void ( * ) ( int16_t, int16_t )&', u'ns3::TracedValueCallback::Int16&')
typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t )', u'ns3::TracedValueCallback::Uint16')
typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t )*', u'ns3::TracedValueCallback::Uint16*')
typehandlers.add_type_alias(u'void ( * ) ( uint16_t, uint16_t )&', u'ns3::TracedValueCallback::Uint16&')
typehandlers.add_type_alias(u'void ( * ) ( int32_t, int32_t )', u'ns3::TracedValueCallback::Int32')
typehandlers.add_type_alias(u'void ( * ) ( int32_t, int32_t )*', u'ns3::TracedValueCallback::Int32*')
typehandlers.add_type_alias(u'void ( * ) ( int32_t, int32_t )&', u'ns3::TracedValueCallback::Int32&')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )', u'ns3::TracedValueCallback::Uint32')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )*', u'ns3::TracedValueCallback::Uint32*')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )&', u'ns3::TracedValueCallback::Uint32&')
typehandlers.add_type_alias(u'void ( * ) ( double, double )', u'ns3::TracedValueCallback::Double')
typehandlers.add_type_alias(u'void ( * ) ( double, double )*', u'ns3::TracedValueCallback::Double*')
typehandlers.add_type_alias(u'void ( * ) ( double, double )&', u'ns3::TracedValueCallback::Double&')
typehandlers.add_type_alias(u'void ( * ) ( )', u'ns3::TracedValueCallback::Void')
typehandlers.add_type_alias(u'void ( * ) ( )*', u'ns3::TracedValueCallback::Void*')
typehandlers.add_type_alias(u'void ( * ) ( )&', u'ns3::TracedValueCallback::Void&')
def register_types_ns3_addressUtils(module):
root_module = module.get_root()
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_tests(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3Address_methods(root_module, root_module['ns3::Address'])
register_Ns3ApplicationContainer_methods(root_module, root_module['ns3::ApplicationContainer'])
register_Ns3AsciiFile_methods(root_module, root_module['ns3::AsciiFile'])
register_Ns3AsciiTraceHelper_methods(root_module, root_module['ns3::AsciiTraceHelper'])
register_Ns3AsciiTraceHelperForDevice_methods(root_module, root_module['ns3::AsciiTraceHelperForDevice'])
register_Ns3AttributeConstructionList_methods(root_module, root_module['ns3::AttributeConstructionList'])
register_Ns3AttributeConstructionListItem_methods(root_module, root_module['ns3::AttributeConstructionList::Item'])
register_Ns3Buffer_methods(root_module, root_module['ns3::Buffer'])
register_Ns3BufferIterator_methods(root_module, root_module['ns3::Buffer::Iterator'])
register_Ns3ByteTagIterator_methods(root_module, root_module['ns3::ByteTagIterator'])
register_Ns3ByteTagIteratorItem_methods(root_module, root_module['ns3::ByteTagIterator::Item'])
register_Ns3ByteTagList_methods(root_module, root_module['ns3::ByteTagList'])
register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator'])
register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
register_Ns3ChannelList_methods(root_module, root_module['ns3::ChannelList'])
register_Ns3DataOutputCallback_methods(root_module, root_module['ns3::DataOutputCallback'])
register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate'])
register_Ns3DefaultDeleter__Ns3AttributeAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeAccessor >'])
register_Ns3DefaultDeleter__Ns3AttributeChecker_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeChecker >'])
register_Ns3DefaultDeleter__Ns3AttributeValue_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeValue >'])
register_Ns3DefaultDeleter__Ns3CallbackImplBase_methods(root_module, root_module['ns3::DefaultDeleter< ns3::CallbackImplBase >'])
register_Ns3DefaultDeleter__Ns3EventImpl_methods(root_module, root_module['ns3::DefaultDeleter< ns3::EventImpl >'])
register_Ns3DefaultDeleter__Ns3HashImplementation_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Hash::Implementation >'])
register_Ns3DefaultDeleter__Ns3NetDeviceQueue_methods(root_module, root_module['ns3::DefaultDeleter< ns3::NetDeviceQueue >'])
register_Ns3DefaultDeleter__Ns3NixVector_methods(root_module, root_module['ns3::DefaultDeleter< ns3::NixVector >'])
register_Ns3DefaultDeleter__Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::DefaultDeleter< ns3::OutputStreamWrapper >'])
register_Ns3DefaultDeleter__Ns3Packet_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Packet >'])
register_Ns3DefaultDeleter__Ns3PbbAddressBlock_methods(root_module, root_module['ns3::DefaultDeleter< ns3::PbbAddressBlock >'])
register_Ns3DefaultDeleter__Ns3PbbMessage_methods(root_module, root_module['ns3::DefaultDeleter< ns3::PbbMessage >'])
register_Ns3DefaultDeleter__Ns3PbbTlv_methods(root_module, root_module['ns3::DefaultDeleter< ns3::PbbTlv >'])
register_Ns3DefaultDeleter__Ns3QueueItem_methods(root_module, root_module['ns3::DefaultDeleter< ns3::QueueItem >'])
register_Ns3DefaultDeleter__Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::TraceSourceAccessor >'])
register_Ns3DelayJitterEstimation_methods(root_module, root_module['ns3::DelayJitterEstimation'])
register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
register_Ns3Hasher_methods(root_module, root_module['ns3::Hasher'])
register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress'])
register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress'])
register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
register_Ns3Mac16Address_methods(root_module, root_module['ns3::Mac16Address'])
register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
register_Ns3Mac64Address_methods(root_module, root_module['ns3::Mac64Address'])
register_Ns3Mac8Address_methods(root_module, root_module['ns3::Mac8Address'])
register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
register_Ns3NodeList_methods(root_module, root_module['ns3::NodeList'])
register_Ns3NonCopyable_methods(root_module, root_module['ns3::NonCopyable'])
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter'])
register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory'])
register_Ns3PacketMetadata_methods(root_module, root_module['ns3::PacketMetadata'])
register_Ns3PacketMetadataItem_methods(root_module, root_module['ns3::PacketMetadata::Item'])
register_Ns3PacketMetadataItemIterator_methods(root_module, root_module['ns3::PacketMetadata::ItemIterator'])
register_Ns3PacketSocketAddress_methods(root_module, root_module['ns3::PacketSocketAddress'])
register_Ns3PacketSocketHelper_methods(root_module, root_module['ns3::PacketSocketHelper'])
register_Ns3PacketTagIterator_methods(root_module, root_module['ns3::PacketTagIterator'])
register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item'])
register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList'])
register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
register_Ns3ParameterLogger_methods(root_module, root_module['ns3::ParameterLogger'])
register_Ns3PbbAddressTlvBlock_methods(root_module, root_module['ns3::PbbAddressTlvBlock'])
register_Ns3PbbTlvBlock_methods(root_module, root_module['ns3::PbbTlvBlock'])
register_Ns3PcapFile_methods(root_module, root_module['ns3::PcapFile'])
register_Ns3PcapHelper_methods(root_module, root_module['ns3::PcapHelper'])
register_Ns3PcapHelperForDevice_methods(root_module, root_module['ns3::PcapHelperForDevice'])
register_Ns3QueueSize_methods(root_module, root_module['ns3::QueueSize'])
register_Ns3SequenceNumber32_methods(root_module, root_module['ns3::SequenceNumber32'])
register_Ns3SequenceNumber16_methods(root_module, root_module['ns3::SequenceNumber16'])
register_Ns3SimpleNetDeviceHelper_methods(root_module, root_module['ns3::SimpleNetDeviceHelper'])
register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
register_Ns3StatisticalSummary_methods(root_module, root_module['ns3::StatisticalSummary'])
register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs'])
register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit'])
register_Ns3TracedValue__Unsigned_int_methods(root_module, root_module['ns3::TracedValue< unsigned int >'])
register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
register_Ns3TypeIdAttributeInformation_methods(root_module, root_module['ns3::TypeId::AttributeInformation'])
register_Ns3TypeIdTraceSourceInformation_methods(root_module, root_module['ns3::TypeId::TraceSourceInformation'])
register_Ns3Empty_methods(root_module, root_module['ns3::empty'])
register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t'])
register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk'])
register_Ns3DeviceNameTag_methods(root_module, root_module['ns3::DeviceNameTag'])
register_Ns3FlowIdTag_methods(root_module, root_module['ns3::FlowIdTag'])
register_Ns3Header_methods(root_module, root_module['ns3::Header'])
register_Ns3LlcSnapHeader_methods(root_module, root_module['ns3::LlcSnapHeader'])
register_Ns3Object_methods(root_module, root_module['ns3::Object'])
register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
register_Ns3PacketBurst_methods(root_module, root_module['ns3::PacketBurst'])
register_Ns3PacketSocketTag_methods(root_module, root_module['ns3::PacketSocketTag'])
register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper'])
register_Ns3QueueBase_methods(root_module, root_module['ns3::QueueBase'])
register_Ns3QueueLimits_methods(root_module, root_module['ns3::QueueLimits'])
register_Ns3RadiotapHeader_methods(root_module, root_module['ns3::RadiotapHeader'])
register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream'])
register_Ns3SequentialRandomVariable_methods(root_module, root_module['ns3::SequentialRandomVariable'])
register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
register_Ns3SimpleRefCount__Ns3NetDeviceQueue_Ns3Empty_Ns3DefaultDeleter__lt__ns3NetDeviceQueue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::NetDeviceQueue, ns3::empty, ns3::DefaultDeleter<ns3::NetDeviceQueue> >'])
register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
register_Ns3SimpleRefCount__Ns3PbbAddressBlock_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbAddressBlock__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >'])
register_Ns3SimpleRefCount__Ns3PbbMessage_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbMessage__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >'])
register_Ns3SimpleRefCount__Ns3PbbPacket_Ns3Header_Ns3DefaultDeleter__lt__ns3PbbPacket__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >'])
register_Ns3SimpleRefCount__Ns3PbbTlv_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbTlv__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >'])
register_Ns3SimpleRefCount__Ns3QueueItem_Ns3Empty_Ns3DefaultDeleter__lt__ns3QueueItem__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::QueueItem, ns3::empty, ns3::DefaultDeleter<ns3::QueueItem> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3SllHeader_methods(root_module, root_module['ns3::SllHeader'])
register_Ns3Socket_methods(root_module, root_module['ns3::Socket'])
register_Ns3SocketFactory_methods(root_module, root_module['ns3::SocketFactory'])
register_Ns3SocketIpTosTag_methods(root_module, root_module['ns3::SocketIpTosTag'])
register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag'])
register_Ns3SocketIpv6HopLimitTag_methods(root_module, root_module['ns3::SocketIpv6HopLimitTag'])
register_Ns3SocketIpv6TclassTag_methods(root_module, root_module['ns3::SocketIpv6TclassTag'])
register_Ns3SocketPriorityTag_methods(root_module, root_module['ns3::SocketPriorityTag'])
register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor'])
register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer'])
register_Ns3TriangularRandomVariable_methods(root_module, root_module['ns3::TriangularRandomVariable'])
register_Ns3UniformRandomVariable_methods(root_module, root_module['ns3::UniformRandomVariable'])
register_Ns3WeibullRandomVariable_methods(root_module, root_module['ns3::WeibullRandomVariable'])
register_Ns3ZetaRandomVariable_methods(root_module, root_module['ns3::ZetaRandomVariable'])
register_Ns3ZipfRandomVariable_methods(root_module, root_module['ns3::ZipfRandomVariable'])
register_Ns3Application_methods(root_module, root_module['ns3::Application'])
register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor'])
register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker'])
register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue'])
register_Ns3BooleanChecker_methods(root_module, root_module['ns3::BooleanChecker'])
register_Ns3BooleanValue_methods(root_module, root_module['ns3::BooleanValue'])
register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker'])
register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
register_Ns3Channel_methods(root_module, root_module['ns3::Channel'])
register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable'])
register_Ns3DataCalculator_methods(root_module, root_module['ns3::DataCalculator'])
register_Ns3DataCollectionObject_methods(root_module, root_module['ns3::DataCollectionObject'])
register_Ns3DataOutputInterface_methods(root_module, root_module['ns3::DataOutputInterface'])
register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker'])
register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue'])
register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable'])
register_Ns3DoubleValue_methods(root_module, root_module['ns3::DoubleValue'])
register_Ns3DynamicQueueLimits_methods(root_module, root_module['ns3::DynamicQueueLimits'])
register_Ns3EmpiricalRandomVariable_methods(root_module, root_module['ns3::EmpiricalRandomVariable'])
register_Ns3EmptyAttributeAccessor_methods(root_module, root_module['ns3::EmptyAttributeAccessor'])
register_Ns3EmptyAttributeChecker_methods(root_module, root_module['ns3::EmptyAttributeChecker'])
register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
register_Ns3EnumChecker_methods(root_module, root_module['ns3::EnumChecker'])
register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue'])
register_Ns3ErlangRandomVariable_methods(root_module, root_module['ns3::ErlangRandomVariable'])
register_Ns3ErrorModel_methods(root_module, root_module['ns3::ErrorModel'])
register_Ns3EthernetHeader_methods(root_module, root_module['ns3::EthernetHeader'])
register_Ns3EthernetTrailer_methods(root_module, root_module['ns3::EthernetTrailer'])
register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
register_Ns3ExponentialRandomVariable_methods(root_module, root_module['ns3::ExponentialRandomVariable'])
register_Ns3GammaRandomVariable_methods(root_module, root_module['ns3::GammaRandomVariable'])
register_Ns3IntegerValue_methods(root_module, root_module['ns3::IntegerValue'])
register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker'])
register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue'])
register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker'])
register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue'])
register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker'])
register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue'])
register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker'])
register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue'])
register_Ns3ListErrorModel_methods(root_module, root_module['ns3::ListErrorModel'])
register_Ns3LogNormalRandomVariable_methods(root_module, root_module['ns3::LogNormalRandomVariable'])
register_Ns3Mac16AddressChecker_methods(root_module, root_module['ns3::Mac16AddressChecker'])
register_Ns3Mac16AddressValue_methods(root_module, root_module['ns3::Mac16AddressValue'])
register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker'])
register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue'])
register_Ns3Mac64AddressChecker_methods(root_module, root_module['ns3::Mac64AddressChecker'])
register_Ns3Mac64AddressValue_methods(root_module, root_module['ns3::Mac64AddressValue'])
register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice'])
register_Ns3NetDeviceQueue_methods(root_module, root_module['ns3::NetDeviceQueue'])
register_Ns3NetDeviceQueueInterface_methods(root_module, root_module['ns3::NetDeviceQueueInterface'])
register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
register_Ns3Node_methods(root_module, root_module['ns3::Node'])
register_Ns3NormalRandomVariable_methods(root_module, root_module['ns3::NormalRandomVariable'])
register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
register_Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::OutputStreamWrapper'])
register_Ns3Packet_methods(root_module, root_module['ns3::Packet'])
register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, root_module['ns3::PacketSizeMinMaxAvgTotalCalculator'])
register_Ns3PacketSocket_methods(root_module, root_module['ns3::PacketSocket'])
register_Ns3PacketSocketClient_methods(root_module, root_module['ns3::PacketSocketClient'])
register_Ns3PacketSocketFactory_methods(root_module, root_module['ns3::PacketSocketFactory'])
register_Ns3PacketSocketServer_methods(root_module, root_module['ns3::PacketSocketServer'])
register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable'])
register_Ns3PbbAddressBlock_methods(root_module, root_module['ns3::PbbAddressBlock'])
register_Ns3PbbAddressBlockIpv4_methods(root_module, root_module['ns3::PbbAddressBlockIpv4'])
register_Ns3PbbAddressBlockIpv6_methods(root_module, root_module['ns3::PbbAddressBlockIpv6'])
register_Ns3PbbMessage_methods(root_module, root_module['ns3::PbbMessage'])
register_Ns3PbbMessageIpv4_methods(root_module, root_module['ns3::PbbMessageIpv4'])
register_Ns3PbbMessageIpv6_methods(root_module, root_module['ns3::PbbMessageIpv6'])
register_Ns3PbbPacket_methods(root_module, root_module['ns3::PbbPacket'])
register_Ns3PbbTlv_methods(root_module, root_module['ns3::PbbTlv'])
register_Ns3Probe_methods(root_module, root_module['ns3::Probe'])
register_Ns3Queue__Ns3Packet_methods(root_module, root_module['ns3::Queue< ns3::Packet >'])
register_Ns3Queue__Ns3QueueDiscItem_methods(root_module, root_module['ns3::Queue< ns3::QueueDiscItem >'])
register_Ns3QueueItem_methods(root_module, root_module['ns3::QueueItem'])
register_Ns3QueueSizeChecker_methods(root_module, root_module['ns3::QueueSizeChecker'])
register_Ns3QueueSizeValue_methods(root_module, root_module['ns3::QueueSizeValue'])
register_Ns3RateErrorModel_methods(root_module, root_module['ns3::RateErrorModel'])
register_Ns3ReceiveListErrorModel_methods(root_module, root_module['ns3::ReceiveListErrorModel'])
register_Ns3SimpleChannel_methods(root_module, root_module['ns3::SimpleChannel'])
register_Ns3SimpleNetDevice_methods(root_module, root_module['ns3::SimpleNetDevice'])
register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue'])
register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker'])
register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue'])
register_Ns3UintegerValue_methods(root_module, root_module['ns3::UintegerValue'])
register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker'])
register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue'])
register_Ns3BinaryErrorModel_methods(root_module, root_module['ns3::BinaryErrorModel'])
register_Ns3BurstErrorModel_methods(root_module, root_module['ns3::BurstErrorModel'])
register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< 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 >'])
register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< 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 >'])
register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Ns3ObjectBase___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3QueueDiscItem__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< 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 >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Unsigned_int_Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CounterCalculator__Unsigned_int_methods(root_module, root_module['ns3::CounterCalculator< unsigned int >'])
register_Ns3DropTailQueue__Ns3Packet_methods(root_module, root_module['ns3::DropTailQueue< ns3::Packet >'])
register_Ns3DropTailQueue__Ns3QueueDiscItem_methods(root_module, root_module['ns3::DropTailQueue< ns3::QueueDiscItem >'])
register_Ns3ErrorChannel_methods(root_module, root_module['ns3::ErrorChannel'])
register_Ns3PacketCounterCalculator_methods(root_module, root_module['ns3::PacketCounterCalculator'])
register_Ns3PacketProbe_methods(root_module, root_module['ns3::PacketProbe'])
register_Ns3PbbAddressTlv_methods(root_module, root_module['ns3::PbbAddressTlv'])
register_Ns3QueueDiscItem_methods(root_module, root_module['ns3::QueueDiscItem'])
register_Ns3HashImplementation_methods(root_module, root_module['ns3::Hash::Implementation'])
register_Ns3HashFunctionFnv1a_methods(root_module, root_module['ns3::Hash::Function::Fnv1a'])
register_Ns3HashFunctionHash32_methods(root_module, root_module['ns3::Hash::Function::Hash32'])
register_Ns3HashFunctionHash64_methods(root_module, root_module['ns3::Hash::Function::Hash64'])
register_Ns3HashFunctionMurmur3_methods(root_module, root_module['ns3::Hash::Function::Murmur3'])
return
def register_Ns3Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## address.h (module 'network'): ns3::Address::Address() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::Address::Address(uint8_t type, uint8_t const * buffer, uint8_t len) [constructor]
cls.add_constructor([param('uint8_t', 'type'), param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): ns3::Address::Address(ns3::Address const & address) [constructor]
cls.add_constructor([param('ns3::Address const &', 'address')])
## address.h (module 'network'): bool ns3::Address::CheckCompatible(uint8_t type, uint8_t len) const [member function]
cls.add_method('CheckCompatible',
'bool',
[param('uint8_t', 'type'), param('uint8_t', 'len')],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::CopyAllFrom(uint8_t const * buffer, uint8_t len) [member function]
cls.add_method('CopyAllFrom',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): uint32_t ns3::Address::CopyAllTo(uint8_t * buffer, uint8_t len) const [member function]
cls.add_method('CopyAllTo',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint8_t', 'len')],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::CopyFrom(uint8_t const * buffer, uint8_t len) [member function]
cls.add_method('CopyFrom',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): uint32_t ns3::Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'uint32_t',
[param('uint8_t *', 'buffer')],
is_const=True)
## address.h (module 'network'): void ns3::Address::Deserialize(ns3::TagBuffer buffer) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'buffer')])
## address.h (module 'network'): uint8_t ns3::Address::GetLength() const [member function]
cls.add_method('GetLength',
'uint8_t',
[],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## address.h (module 'network'): bool ns3::Address::IsInvalid() const [member function]
cls.add_method('IsInvalid',
'bool',
[],
is_const=True)
## address.h (module 'network'): bool ns3::Address::IsMatchingType(uint8_t type) const [member function]
cls.add_method('IsMatchingType',
'bool',
[param('uint8_t', 'type')],
is_const=True)
## address.h (module 'network'): static uint8_t ns3::Address::Register() [member function]
cls.add_method('Register',
'uint8_t',
[],
is_static=True)
## address.h (module 'network'): void ns3::Address::Serialize(ns3::TagBuffer buffer) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'buffer')],
is_const=True)
return
def register_Ns3ApplicationContainer_methods(root_module, cls):
## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer(ns3::ApplicationContainer const & arg0) [constructor]
cls.add_constructor([param('ns3::ApplicationContainer const &', 'arg0')])
## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer() [constructor]
cls.add_constructor([])
## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer(ns3::Ptr<ns3::Application> application) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Application >', 'application')])
## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer(std::string name) [constructor]
cls.add_constructor([param('std::string', 'name')])
## application-container.h (module 'network'): void ns3::ApplicationContainer::Add(ns3::ApplicationContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::ApplicationContainer', 'other')])
## application-container.h (module 'network'): void ns3::ApplicationContainer::Add(ns3::Ptr<ns3::Application> application) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::Application >', 'application')])
## application-container.h (module 'network'): void ns3::ApplicationContainer::Add(std::string name) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'name')])
## application-container.h (module 'network'): ns3::ApplicationContainer::Iterator ns3::ApplicationContainer::Begin() const [member function]
cls.add_method('Begin',
'ns3::ApplicationContainer::Iterator',
[],
is_const=True)
## application-container.h (module 'network'): ns3::ApplicationContainer::Iterator ns3::ApplicationContainer::End() const [member function]
cls.add_method('End',
'ns3::ApplicationContainer::Iterator',
[],
is_const=True)
## application-container.h (module 'network'): ns3::Ptr<ns3::Application> ns3::ApplicationContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::Application >',
[param('uint32_t', 'i')],
is_const=True)
## application-container.h (module 'network'): uint32_t ns3::ApplicationContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## application-container.h (module 'network'): void ns3::ApplicationContainer::Start(ns3::Time start) [member function]
cls.add_method('Start',
'void',
[param('ns3::Time', 'start')])
## application-container.h (module 'network'): void ns3::ApplicationContainer::StartWithJitter(ns3::Time start, ns3::Ptr<ns3::RandomVariableStream> rv) [member function]
cls.add_method('StartWithJitter',
'void',
[param('ns3::Time', 'start'), param('ns3::Ptr< ns3::RandomVariableStream >', 'rv')])
## application-container.h (module 'network'): void ns3::ApplicationContainer::Stop(ns3::Time stop) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time', 'stop')])
return
def register_Ns3AsciiFile_methods(root_module, cls):
## ascii-file.h (module 'network'): ns3::AsciiFile::AsciiFile() [constructor]
cls.add_constructor([])
## ascii-file.h (module 'network'): bool ns3::AsciiFile::Fail() const [member function]
cls.add_method('Fail',
'bool',
[],
is_const=True)
## ascii-file.h (module 'network'): bool ns3::AsciiFile::Eof() const [member function]
cls.add_method('Eof',
'bool',
[],
is_const=True)
## ascii-file.h (module 'network'): void ns3::AsciiFile::Open(std::string const & filename, std::ios_base::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::ios_base::openmode', 'mode')])
## ascii-file.h (module 'network'): void ns3::AsciiFile::Close() [member function]
cls.add_method('Close',
'void',
[])
## ascii-file.h (module 'network'): void ns3::AsciiFile::Read(std::string & line) [member function]
cls.add_method('Read',
'void',
[param('std::string &', 'line')])
## ascii-file.h (module 'network'): static bool ns3::AsciiFile::Diff(std::string const & f1, std::string const & f2, uint64_t & lineNumber) [member function]
cls.add_method('Diff',
'bool',
[param('std::string const &', 'f1'), param('std::string const &', 'f2'), param('uint64_t &', 'lineNumber')],
is_static=True)
return
def register_Ns3AsciiTraceHelper_methods(root_module, cls):
## trace-helper.h (module 'network'): ns3::AsciiTraceHelper::AsciiTraceHelper(ns3::AsciiTraceHelper const & arg0) [constructor]
cls.add_constructor([param('ns3::AsciiTraceHelper const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::AsciiTraceHelper::AsciiTraceHelper() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): ns3::Ptr<ns3::OutputStreamWrapper> ns3::AsciiTraceHelper::CreateFileStream(std::string filename, std::ios_base::openmode filemode=std::ios_base::out) [member function]
cls.add_method('CreateFileStream',
'ns3::Ptr< ns3::OutputStreamWrapper >',
[param('std::string', 'filename'), param('std::ios_base::openmode', 'filemode', default_value='std::ios_base::out')])
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDequeueSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultDequeueSinkWithContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDequeueSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultDequeueSinkWithoutContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDropSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultDropSinkWithContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDropSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultDropSinkWithoutContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultEnqueueSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultEnqueueSinkWithContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultEnqueueSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultEnqueueSinkWithoutContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultReceiveSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultReceiveSinkWithContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultReceiveSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('DefaultReceiveSinkWithoutContext',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')],
is_static=True)
## trace-helper.h (module 'network'): std::string ns3::AsciiTraceHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr<ns3::NetDevice> device, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromDevice',
'std::string',
[param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'useObjectNames', default_value='true')])
## trace-helper.h (module 'network'): std::string ns3::AsciiTraceHelper::GetFilenameFromInterfacePair(std::string prefix, ns3::Ptr<ns3::Object> object, uint32_t interface, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromInterfacePair',
'std::string',
[param('std::string', 'prefix'), param('ns3::Ptr< ns3::Object >', 'object'), param('uint32_t', 'interface'), param('bool', 'useObjectNames', default_value='true')])
return
def register_Ns3AsciiTraceHelperForDevice_methods(root_module, cls):
## trace-helper.h (module 'network'): ns3::AsciiTraceHelperForDevice::AsciiTraceHelperForDevice(ns3::AsciiTraceHelperForDevice const & arg0) [constructor]
cls.add_constructor([param('ns3::AsciiTraceHelperForDevice const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::AsciiTraceHelperForDevice::AsciiTraceHelperForDevice() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool explicitFilename=false) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'explicitFilename', default_value='false')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Ptr<ns3::NetDevice> nd) [member function]
cls.add_method('EnableAscii',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Ptr< ns3::NetDevice >', 'nd')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, std::string ndName, bool explicitFilename=false) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::string', 'prefix'), param('std::string', 'ndName'), param('bool', 'explicitFilename', default_value='false')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, std::string ndName) [member function]
cls.add_method('EnableAscii',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('std::string', 'ndName')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::string', 'prefix'), param('ns3::NetDeviceContainer', 'd')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::NetDeviceContainer d) [member function]
cls.add_method('EnableAscii',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::NetDeviceContainer', 'd')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, ns3::NodeContainer n) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::string', 'prefix'), param('ns3::NodeContainer', 'n')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::NodeContainer n) [member function]
cls.add_method('EnableAscii',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::NodeContainer', 'n')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename) [member function]
cls.add_method('EnableAscii',
'void',
[param('std::string', 'prefix'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'explicitFilename')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, uint32_t nodeid, uint32_t deviceid) [member function]
cls.add_method('EnableAscii',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAsciiAll(std::string prefix) [member function]
cls.add_method('EnableAsciiAll',
'void',
[param('std::string', 'prefix')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAsciiAll(ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
cls.add_method('EnableAsciiAll',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')])
## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAsciiInternal(ns3::Ptr<ns3::OutputStreamWrapper> stream, std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool explicitFilename) [member function]
cls.add_method('EnableAsciiInternal',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'explicitFilename')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3AttributeConstructionList_methods(root_module, cls):
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList(ns3::AttributeConstructionList const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeConstructionList const &', 'arg0')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList() [constructor]
cls.add_constructor([])
## attribute-construction-list.h (module 'core'): void ns3::AttributeConstructionList::Add(std::string name, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::Ptr<ns3::AttributeValue> value) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'name'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::Ptr< ns3::AttributeValue >', 'value')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::CIterator ns3::AttributeConstructionList::Begin() const [member function]
cls.add_method('Begin',
'ns3::AttributeConstructionList::CIterator',
[],
is_const=True)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::CIterator ns3::AttributeConstructionList::End() const [member function]
cls.add_method('End',
'ns3::AttributeConstructionList::CIterator',
[],
is_const=True)
## attribute-construction-list.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeConstructionList::Find(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('Find',
'ns3::Ptr< ns3::AttributeValue >',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True)
return
def register_Ns3AttributeConstructionListItem_methods(root_module, cls):
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item() [constructor]
cls.add_constructor([])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item(ns3::AttributeConstructionList::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeConstructionList::Item const &', 'arg0')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::checker [variable]
cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::value [variable]
cls.add_instance_attribute('value', 'ns3::Ptr< ns3::AttributeValue >', is_const=False)
return
def register_Ns3Buffer_methods(root_module, cls):
## buffer.h (module 'network'): ns3::Buffer::Buffer(ns3::Buffer const & o) [constructor]
cls.add_constructor([param('ns3::Buffer const &', 'o')])
## buffer.h (module 'network'): ns3::Buffer::Buffer() [constructor]
cls.add_constructor([])
## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize) [constructor]
cls.add_constructor([param('uint32_t', 'dataSize')])
## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize, bool initialize) [constructor]
cls.add_constructor([param('uint32_t', 'dataSize'), param('bool', 'initialize')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(uint32_t end) [member function]
cls.add_method('AddAtEnd',
'void',
[param('uint32_t', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(ns3::Buffer const & o) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Buffer const &', 'o')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtStart(uint32_t start) [member function]
cls.add_method('AddAtStart',
'void',
[param('uint32_t', 'start')])
## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::Begin() const [member function]
cls.add_method('Begin',
'ns3::Buffer::Iterator',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::CopyData(std::ostream * os, uint32_t size) const [member function]
cls.add_method('CopyData',
'void',
[param('std::ostream *', 'os'), param('uint32_t', 'size')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::CopyData(uint8_t * buffer, uint32_t size) const [member function]
cls.add_method('CopyData',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')],
is_const=True)
## buffer.h (module 'network'): ns3::Buffer ns3::Buffer::CreateFragment(uint32_t start, uint32_t length) const [member function]
cls.add_method('CreateFragment',
'ns3::Buffer',
[param('uint32_t', 'start'), param('uint32_t', 'length')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Deserialize(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::End() const [member function]
cls.add_method('End',
'ns3::Buffer::Iterator',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint8_t const * ns3::Buffer::PeekData() const [member function]
cls.add_method('PeekData',
'uint8_t const *',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::RemoveAtEnd(uint32_t end) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::RemoveAtStart(uint32_t start) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'start')])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3BufferIterator_methods(root_module, cls):
## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator(ns3::Buffer::Iterator const & arg0) [constructor]
cls.add_constructor([param('ns3::Buffer::Iterator const &', 'arg0')])
## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator() [constructor]
cls.add_constructor([])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size) [member function]
cls.add_method('CalculateIpChecksum',
'uint16_t',
[param('uint16_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size, uint32_t initialChecksum) [member function]
cls.add_method('CalculateIpChecksum',
'uint16_t',
[param('uint16_t', 'size'), param('uint32_t', 'initialChecksum')])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetDistanceFrom(ns3::Buffer::Iterator const & o) const [member function]
cls.add_method('GetDistanceFrom',
'uint32_t',
[param('ns3::Buffer::Iterator const &', 'o')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetRemainingSize() const [member function]
cls.add_method('GetRemainingSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsEnd() const [member function]
cls.add_method('IsEnd',
'bool',
[],
is_const=True)
## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsStart() const [member function]
cls.add_method('IsStart',
'bool',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next() [member function]
cls.add_method('Next',
'void',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next(uint32_t delta) [member function]
cls.add_method('Next',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::PeekU8() [member function]
cls.add_method('PeekU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function]
cls.add_method('Prev',
'void',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev(uint32_t delta) [member function]
cls.add_method('Prev',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(uint8_t * buffer, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(ns3::Buffer::Iterator start, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function]
cls.add_method('ReadLsbtohU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadLsbtohU32() [member function]
cls.add_method('ReadLsbtohU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadLsbtohU64() [member function]
cls.add_method('ReadLsbtohU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadNtohU16() [member function]
cls.add_method('ReadNtohU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadNtohU32() [member function]
cls.add_method('ReadNtohU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadNtohU64() [member function]
cls.add_method('ReadNtohU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadU16() [member function]
cls.add_method('ReadU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadU32() [member function]
cls.add_method('ReadU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadU64() [member function]
cls.add_method('ReadU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::ReadU8() [member function]
cls.add_method('ReadU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Write',
'void',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Write',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU16(uint16_t data) [member function]
cls.add_method('WriteHtolsbU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU32(uint32_t data) [member function]
cls.add_method('WriteHtolsbU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU64(uint64_t data) [member function]
cls.add_method('WriteHtolsbU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU16(uint16_t data) [member function]
cls.add_method('WriteHtonU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU32(uint32_t data) [member function]
cls.add_method('WriteHtonU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU64(uint64_t data) [member function]
cls.add_method('WriteHtonU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU16(uint16_t data) [member function]
cls.add_method('WriteU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU32(uint32_t data) [member function]
cls.add_method('WriteU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU64(uint64_t data) [member function]
cls.add_method('WriteU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data, uint32_t len) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'data'), param('uint32_t', 'len')])
return
def register_Ns3ByteTagIterator_methods(root_module, cls):
## packet.h (module 'network'): ns3::ByteTagIterator::ByteTagIterator(ns3::ByteTagIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagIterator const &', 'arg0')])
## packet.h (module 'network'): bool ns3::ByteTagIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet.h (module 'network'): ns3::ByteTagIterator::Item ns3::ByteTagIterator::Next() [member function]
cls.add_method('Next',
'ns3::ByteTagIterator::Item',
[])
return
def register_Ns3ByteTagIteratorItem_methods(root_module, cls):
## packet.h (module 'network'): ns3::ByteTagIterator::Item::Item(ns3::ByteTagIterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagIterator::Item const &', 'arg0')])
## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetEnd() const [member function]
cls.add_method('GetEnd',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetStart() const [member function]
cls.add_method('GetStart',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): void ns3::ByteTagIterator::Item::GetTag(ns3::Tag & tag) const [member function]
cls.add_method('GetTag',
'void',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::TypeId ns3::ByteTagIterator::Item::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
return
def register_Ns3ByteTagList_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList() [constructor]
cls.add_constructor([])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList(ns3::ByteTagList const & o) [constructor]
cls.add_constructor([param('ns3::ByteTagList const &', 'o')])
## byte-tag-list.h (module 'network'): ns3::TagBuffer ns3::ByteTagList::Add(ns3::TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) [member function]
cls.add_method('Add',
'ns3::TagBuffer',
[param('ns3::TypeId', 'tid'), param('uint32_t', 'bufferSize'), param('int32_t', 'start'), param('int32_t', 'end')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Add(ns3::ByteTagList const & o) [member function]
cls.add_method('Add',
'void',
[param('ns3::ByteTagList const &', 'o')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtEnd(int32_t appendOffset) [member function]
cls.add_method('AddAtEnd',
'void',
[param('int32_t', 'appendOffset')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtStart(int32_t prependOffset) [member function]
cls.add_method('AddAtStart',
'void',
[param('int32_t', 'prependOffset')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Adjust(int32_t adjustment) [member function]
cls.add_method('Adjust',
'void',
[param('int32_t', 'adjustment')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator ns3::ByteTagList::Begin(int32_t offsetStart, int32_t offsetEnd) const [member function]
cls.add_method('Begin',
'ns3::ByteTagList::Iterator',
[param('int32_t', 'offsetStart'), param('int32_t', 'offsetEnd')],
is_const=True)
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::RemoveAll() [member function]
cls.add_method('RemoveAll',
'void',
[])
return
def register_Ns3ByteTagListIterator_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Iterator(ns3::ByteTagList::Iterator const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagList::Iterator const &', 'arg0')])
## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::Iterator::GetOffsetStart() const [member function]
cls.add_method('GetOffsetStart',
'uint32_t',
[],
is_const=True)
## byte-tag-list.h (module 'network'): bool ns3::ByteTagList::Iterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item ns3::ByteTagList::Iterator::Next() [member function]
cls.add_method('Next',
'ns3::ByteTagList::Iterator::Item',
[])
return
def register_Ns3ByteTagListIteratorItem_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::ByteTagList::Iterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagList::Iterator::Item const &', 'arg0')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::TagBuffer buf) [constructor]
cls.add_constructor([param('ns3::TagBuffer', 'buf')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::buf [variable]
cls.add_instance_attribute('buf', 'ns3::TagBuffer', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::end [variable]
cls.add_instance_attribute('end', 'int32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::size [variable]
cls.add_instance_attribute('size', 'uint32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::start [variable]
cls.add_instance_attribute('start', 'int32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
return
def register_Ns3CallbackBase_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::CallbackBase const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackBase const &', 'arg0')])
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::Ptr<ns3::CallbackImplBase> ns3::CallbackBase::GetImpl() const [member function]
cls.add_method('GetImpl',
'ns3::Ptr< ns3::CallbackImplBase >',
[],
is_const=True)
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::Ptr<ns3::CallbackImplBase> impl) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::CallbackImplBase >', 'impl')],
visibility='protected')
return
def register_Ns3ChannelList_methods(root_module, cls):
## channel-list.h (module 'network'): ns3::ChannelList::ChannelList() [constructor]
cls.add_constructor([])
## channel-list.h (module 'network'): ns3::ChannelList::ChannelList(ns3::ChannelList const & arg0) [constructor]
cls.add_constructor([param('ns3::ChannelList const &', 'arg0')])
## channel-list.h (module 'network'): static uint32_t ns3::ChannelList::Add(ns3::Ptr<ns3::Channel> channel) [member function]
cls.add_method('Add',
'uint32_t',
[param('ns3::Ptr< ns3::Channel >', 'channel')],
is_static=True)
## channel-list.h (module 'network'): static ns3::ChannelList::Iterator ns3::ChannelList::Begin() [member function]
cls.add_method('Begin',
'ns3::ChannelList::Iterator',
[],
is_static=True)
## channel-list.h (module 'network'): static ns3::ChannelList::Iterator ns3::ChannelList::End() [member function]
cls.add_method('End',
'ns3::ChannelList::Iterator',
[],
is_static=True)
## channel-list.h (module 'network'): static ns3::Ptr<ns3::Channel> ns3::ChannelList::GetChannel(uint32_t n) [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[param('uint32_t', 'n')],
is_static=True)
## channel-list.h (module 'network'): static uint32_t ns3::ChannelList::GetNChannels() [member function]
cls.add_method('GetNChannels',
'uint32_t',
[],
is_static=True)
return
def register_Ns3DataOutputCallback_methods(root_module, cls):
## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback() [constructor]
cls.add_constructor([])
## data-output-interface.h (module 'stats'): ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [constructor]
cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')])
## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('int', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, uint32_t val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('uint32_t', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, double val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('double', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, std::string val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('std::string', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, ns3::Time val) [member function]
cls.add_method('OutputSingleton',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h (module 'stats'): void ns3::DataOutputCallback::OutputStatistic(std::string key, std::string variable, ns3::StatisticalSummary const * statSum) [member function]
cls.add_method('OutputStatistic',
'void',
[param('std::string', 'key'), param('std::string', 'variable'), param('ns3::StatisticalSummary const *', 'statSum')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3DataRate_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('>=')
## data-rate.h (module 'network'): ns3::DataRate::DataRate(ns3::DataRate const & arg0) [constructor]
cls.add_constructor([param('ns3::DataRate const &', 'arg0')])
## data-rate.h (module 'network'): ns3::DataRate::DataRate() [constructor]
cls.add_constructor([])
## data-rate.h (module 'network'): ns3::DataRate::DataRate(uint64_t bps) [constructor]
cls.add_constructor([param('uint64_t', 'bps')])
## data-rate.h (module 'network'): ns3::DataRate::DataRate(std::string rate) [constructor]
cls.add_constructor([param('std::string', 'rate')])
## data-rate.h (module 'network'): ns3::Time ns3::DataRate::CalculateBitsTxTime(uint32_t bits) const [member function]
cls.add_method('CalculateBitsTxTime',
'ns3::Time',
[param('uint32_t', 'bits')],
is_const=True)
## data-rate.h (module 'network'): ns3::Time ns3::DataRate::CalculateBytesTxTime(uint32_t bytes) const [member function]
cls.add_method('CalculateBytesTxTime',
'ns3::Time',
[param('uint32_t', 'bytes')],
is_const=True)
## data-rate.h (module 'network'): double ns3::DataRate::CalculateTxTime(uint32_t bytes) const [member function]
cls.add_method('CalculateTxTime',
'double',
[param('uint32_t', 'bytes')],
deprecated=True, is_const=True)
## data-rate.h (module 'network'): uint64_t ns3::DataRate::GetBitRate() const [member function]
cls.add_method('GetBitRate',
'uint64_t',
[],
is_const=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeAccessor_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeAccessor> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeAccessor > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeAccessor>::Delete(ns3::AttributeAccessor * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeAccessor *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeChecker_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeChecker> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeChecker > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeChecker>::Delete(ns3::AttributeChecker * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeChecker *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeValue_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeValue> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeValue > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeValue>::Delete(ns3::AttributeValue * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeValue *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3CallbackImplBase_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase>::DefaultDeleter(ns3::DefaultDeleter<ns3::CallbackImplBase> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::CallbackImplBase > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::CallbackImplBase>::Delete(ns3::CallbackImplBase * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::CallbackImplBase *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3EventImpl_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl>::DefaultDeleter(ns3::DefaultDeleter<ns3::EventImpl> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::EventImpl > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::EventImpl>::Delete(ns3::EventImpl * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::EventImpl *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3HashImplementation_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation>::DefaultDeleter(ns3::DefaultDeleter<ns3::Hash::Implementation> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::Hash::Implementation > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::Hash::Implementation>::Delete(ns3::Hash::Implementation * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Hash::Implementation *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3NetDeviceQueue_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NetDeviceQueue>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NetDeviceQueue>::DefaultDeleter(ns3::DefaultDeleter<ns3::NetDeviceQueue> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::NetDeviceQueue > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::NetDeviceQueue>::Delete(ns3::NetDeviceQueue * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::NetDeviceQueue *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3NixVector_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector>::DefaultDeleter(ns3::DefaultDeleter<ns3::NixVector> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::NixVector > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::NixVector>::Delete(ns3::NixVector * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::NixVector *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3OutputStreamWrapper_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::OutputStreamWrapper>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::OutputStreamWrapper>::DefaultDeleter(ns3::DefaultDeleter<ns3::OutputStreamWrapper> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::OutputStreamWrapper > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::OutputStreamWrapper>::Delete(ns3::OutputStreamWrapper * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::OutputStreamWrapper *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3Packet_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet>::DefaultDeleter(ns3::DefaultDeleter<ns3::Packet> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::Packet > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::Packet>::Delete(ns3::Packet * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Packet *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3PbbAddressBlock_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbAddressBlock>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbAddressBlock>::DefaultDeleter(ns3::DefaultDeleter<ns3::PbbAddressBlock> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::PbbAddressBlock > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::PbbAddressBlock>::Delete(ns3::PbbAddressBlock * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::PbbAddressBlock *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3PbbMessage_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbMessage>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbMessage>::DefaultDeleter(ns3::DefaultDeleter<ns3::PbbMessage> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::PbbMessage > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::PbbMessage>::Delete(ns3::PbbMessage * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::PbbMessage *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3PbbTlv_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbTlv>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::PbbTlv>::DefaultDeleter(ns3::DefaultDeleter<ns3::PbbTlv> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::PbbTlv > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::PbbTlv>::Delete(ns3::PbbTlv * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::PbbTlv *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3QueueItem_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::QueueItem>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::QueueItem>::DefaultDeleter(ns3::DefaultDeleter<ns3::QueueItem> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::QueueItem > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::QueueItem>::Delete(ns3::QueueItem * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::QueueItem *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3TraceSourceAccessor_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor>::DefaultDeleter(ns3::DefaultDeleter<ns3::TraceSourceAccessor> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::TraceSourceAccessor > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::TraceSourceAccessor>::Delete(ns3::TraceSourceAccessor * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::TraceSourceAccessor *', 'object')],
is_static=True)
return
def register_Ns3DelayJitterEstimation_methods(root_module, cls):
## delay-jitter-estimation.h (module 'network'): ns3::DelayJitterEstimation::DelayJitterEstimation(ns3::DelayJitterEstimation const & arg0) [constructor]
cls.add_constructor([param('ns3::DelayJitterEstimation const &', 'arg0')])
## delay-jitter-estimation.h (module 'network'): ns3::DelayJitterEstimation::DelayJitterEstimation() [constructor]
cls.add_constructor([])
## delay-jitter-estimation.h (module 'network'): ns3::Time ns3::DelayJitterEstimation::GetLastDelay() const [member function]
cls.add_method('GetLastDelay',
'ns3::Time',
[],
is_const=True)
## delay-jitter-estimation.h (module 'network'): uint64_t ns3::DelayJitterEstimation::GetLastJitter() const [member function]
cls.add_method('GetLastJitter',
'uint64_t',
[],
is_const=True)
## delay-jitter-estimation.h (module 'network'): static void ns3::DelayJitterEstimation::PrepareTx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('PrepareTx',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')],
is_static=True)
## delay-jitter-estimation.h (module 'network'): void ns3::DelayJitterEstimation::RecordRx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('RecordRx',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
return
def register_Ns3EventId_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## event-id.h (module 'core'): ns3::EventId::EventId(ns3::EventId const & arg0) [constructor]
cls.add_constructor([param('ns3::EventId const &', 'arg0')])
## event-id.h (module 'core'): ns3::EventId::EventId() [constructor]
cls.add_constructor([])
## event-id.h (module 'core'): ns3::EventId::EventId(ns3::Ptr<ns3::EventImpl> const & impl, uint64_t ts, uint32_t context, uint32_t uid) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::EventImpl > const &', 'impl'), param('uint64_t', 'ts'), param('uint32_t', 'context'), param('uint32_t', 'uid')])
## event-id.h (module 'core'): void ns3::EventId::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-id.h (module 'core'): uint32_t ns3::EventId::GetContext() const [member function]
cls.add_method('GetContext',
'uint32_t',
[],
is_const=True)
## event-id.h (module 'core'): uint64_t ns3::EventId::GetTs() const [member function]
cls.add_method('GetTs',
'uint64_t',
[],
is_const=True)
## event-id.h (module 'core'): uint32_t ns3::EventId::GetUid() const [member function]
cls.add_method('GetUid',
'uint32_t',
[],
is_const=True)
## event-id.h (module 'core'): bool ns3::EventId::IsExpired() const [member function]
cls.add_method('IsExpired',
'bool',
[],
is_const=True)
## event-id.h (module 'core'): bool ns3::EventId::IsRunning() const [member function]
cls.add_method('IsRunning',
'bool',
[],
is_const=True)
## event-id.h (module 'core'): ns3::EventImpl * ns3::EventId::PeekEventImpl() const [member function]
cls.add_method('PeekEventImpl',
'ns3::EventImpl *',
[],
is_const=True)
return
def register_Ns3Hasher_methods(root_module, cls):
## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Hasher const & arg0) [constructor]
cls.add_constructor([param('ns3::Hasher const &', 'arg0')])
## hash.h (module 'core'): ns3::Hasher::Hasher() [constructor]
cls.add_constructor([])
## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Ptr<ns3::Hash::Implementation> hp) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Hash::Implementation >', 'hp')])
## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')])
## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(std::string const s) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('std::string const', 's')])
## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')])
## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(std::string const s) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('std::string const', 's')])
## hash.h (module 'core'): ns3::Hasher & ns3::Hasher::clear() [member function]
cls.add_method('clear',
'ns3::Hasher &',
[])
return
def register_Ns3Inet6SocketAddress_methods(root_module, cls):
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [constructor]
cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor]
cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor]
cls.add_constructor([param('ns3::Ipv6Address', 'ipv6')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(uint16_t port) [constructor]
cls.add_constructor([param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6, uint16_t port) [constructor]
cls.add_constructor([param('char const *', 'ipv6'), param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6) [constructor]
cls.add_constructor([param('char const *', 'ipv6')])
## inet6-socket-address.h (module 'network'): static ns3::Inet6SocketAddress ns3::Inet6SocketAddress::ConvertFrom(ns3::Address const & addr) [member function]
cls.add_method('ConvertFrom',
'ns3::Inet6SocketAddress',
[param('ns3::Address const &', 'addr')],
is_static=True)
## inet6-socket-address.h (module 'network'): ns3::Ipv6Address ns3::Inet6SocketAddress::GetIpv6() const [member function]
cls.add_method('GetIpv6',
'ns3::Ipv6Address',
[],
is_const=True)
## inet6-socket-address.h (module 'network'): uint16_t ns3::Inet6SocketAddress::GetPort() const [member function]
cls.add_method('GetPort',
'uint16_t',
[],
is_const=True)
## inet6-socket-address.h (module 'network'): static bool ns3::Inet6SocketAddress::IsMatchingType(ns3::Address const & addr) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'addr')],
is_static=True)
## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetIpv6(ns3::Ipv6Address ipv6) [member function]
cls.add_method('SetIpv6',
'void',
[param('ns3::Ipv6Address', 'ipv6')])
## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetPort(uint16_t port) [member function]
cls.add_method('SetPort',
'void',
[param('uint16_t', 'port')])
return
def register_Ns3InetSocketAddress_methods(root_module, cls):
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [constructor]
cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4, uint16_t port) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ipv4'), param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ipv4')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(uint16_t port) [constructor]
cls.add_constructor([param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4, uint16_t port) [constructor]
cls.add_constructor([param('char const *', 'ipv4'), param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4) [constructor]
cls.add_constructor([param('char const *', 'ipv4')])
## inet-socket-address.h (module 'network'): static ns3::InetSocketAddress ns3::InetSocketAddress::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::InetSocketAddress',
[param('ns3::Address const &', 'address')],
is_static=True)
## inet-socket-address.h (module 'network'): ns3::Ipv4Address ns3::InetSocketAddress::GetIpv4() const [member function]
cls.add_method('GetIpv4',
'ns3::Ipv4Address',
[],
is_const=True)
## inet-socket-address.h (module 'network'): uint16_t ns3::InetSocketAddress::GetPort() const [member function]
cls.add_method('GetPort',
'uint16_t',
[],
is_const=True)
## inet-socket-address.h (module 'network'): uint8_t ns3::InetSocketAddress::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## inet-socket-address.h (module 'network'): static bool ns3::InetSocketAddress::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetIpv4(ns3::Ipv4Address address) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ipv4Address', 'address')])
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetPort(uint16_t port) [member function]
cls.add_method('SetPort',
'void',
[param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
return
def register_Ns3Ipv4Address_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(ns3::Ipv4Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Address const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(uint32_t address) [constructor]
cls.add_constructor([param('uint32_t', 'address')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(char const * address) [constructor]
cls.add_constructor([param('char const *', 'address')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::CombineMask(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('CombineMask',
'ns3::Ipv4Address',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Ipv4Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::Deserialize(uint8_t const * buf) [member function]
cls.add_method('Deserialize',
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
cls.add_method('GetAny',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::GetSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('GetSubnetDirectedBroadcast',
'ns3::Ipv4Address',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsAny() const [member function]
cls.add_method('IsAny',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsEqual(ns3::Ipv4Address const & other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv4Address const &', 'other')],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalMulticast() const [member function]
cls.add_method('IsLocalMulticast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalhost() const [member function]
cls.add_method('IsLocalhost',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('IsSubnetDirectedBroadcast',
'bool',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Serialize(uint8_t * buf) const [member function]
cls.add_method('Serialize',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(uint32_t address) [member function]
cls.add_method('Set',
'void',
[param('uint32_t', 'address')])
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(char const * address) [member function]
cls.add_method('Set',
'void',
[param('char const *', 'address')])
return
def register_Ns3Ipv4Mask_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(ns3::Ipv4Mask const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Mask const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(uint32_t mask) [constructor]
cls.add_constructor([param('uint32_t', 'mask')])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(char const * mask) [constructor]
cls.add_constructor([param('char const *', 'mask')])
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::Get() const [member function]
cls.add_method('Get',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::GetInverse() const [member function]
cls.add_method('GetInverse',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): uint16_t ns3::Ipv4Mask::GetPrefixLength() const [member function]
cls.add_method('GetPrefixLength',
'uint16_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsEqual(ns3::Ipv4Mask other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv4Mask', 'other')],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsMatch(ns3::Ipv4Address a, ns3::Ipv4Address b) const [member function]
cls.add_method('IsMatch',
'bool',
[param('ns3::Ipv4Address', 'a'), param('ns3::Ipv4Address', 'b')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Set(uint32_t mask) [member function]
cls.add_method('Set',
'void',
[param('uint32_t', 'mask')])
return
def register_Ns3Ipv6Address_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(char const * address) [constructor]
cls.add_constructor([param('char const *', 'address')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(uint8_t * address) [constructor]
cls.add_constructor([param('uint8_t *', 'address')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const & addr) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const &', 'addr')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const * addr) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const *', 'addr')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6Address::CombinePrefix(ns3::Ipv6Prefix const & prefix) [member function]
cls.add_method('CombinePrefix',
'ns3::Ipv6Address',
[param('ns3::Ipv6Prefix const &', 'prefix')])
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Ipv6Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::Deserialize(uint8_t const * buf) [member function]
cls.add_method('Deserialize',
'ns3::Ipv6Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllHostsMulticast() [member function]
cls.add_method('GetAllHostsMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllNodesMulticast() [member function]
cls.add_method('GetAllNodesMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllRoutersMulticast() [member function]
cls.add_method('GetAllRoutersMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAny() [member function]
cls.add_method('GetAny',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::GetBytes(uint8_t * buf) const [member function]
cls.add_method('GetBytes',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv6Address::GetIpv4MappedAddress() const [member function]
cls.add_method('GetIpv4MappedAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllHostsMulticast() const [member function]
cls.add_method('IsAllHostsMulticast',
'bool',
[],
deprecated=True, is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllNodesMulticast() const [member function]
cls.add_method('IsAllNodesMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllRoutersMulticast() const [member function]
cls.add_method('IsAllRoutersMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAny() const [member function]
cls.add_method('IsAny',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsDocumentation() const [member function]
cls.add_method('IsDocumentation',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsEqual(ns3::Ipv6Address const & other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv6Address const &', 'other')],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsIpv4MappedAddress() const [member function]
cls.add_method('IsIpv4MappedAddress',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocal() const [member function]
cls.add_method('IsLinkLocal',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocalMulticast() const [member function]
cls.add_method('IsLinkLocalMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLocalhost() const [member function]
cls.add_method('IsLocalhost',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): static bool ns3::Ipv6Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsSolicitedMulticast() const [member function]
cls.add_method('IsSolicitedMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac16Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac16Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac48Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac48Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac64Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac64Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac8Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac8Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac16Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac16Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac48Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac48Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac64Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac64Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac8Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac8Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeIpv4MappedAddress(ns3::Ipv4Address addr) [member function]
cls.add_method('MakeIpv4MappedAddress',
'ns3::Ipv6Address',
[param('ns3::Ipv4Address', 'addr')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeSolicitedAddress(ns3::Ipv6Address addr) [member function]
cls.add_method('MakeSolicitedAddress',
'ns3::Ipv6Address',
[param('ns3::Ipv6Address', 'addr')],
is_static=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Serialize(uint8_t * buf) const [member function]
cls.add_method('Serialize',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(char const * address) [member function]
cls.add_method('Set',
'void',
[param('char const *', 'address')])
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(uint8_t * address) [member function]
cls.add_method('Set',
'void',
[param('uint8_t *', 'address')])
return
def register_Ns3Ipv6Prefix_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix) [constructor]
cls.add_constructor([param('uint8_t *', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix) [constructor]
cls.add_constructor([param('char const *', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t prefix) [constructor]
cls.add_constructor([param('uint8_t', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const & prefix) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const &', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const * prefix) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const *', 'prefix')])
## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::GetBytes(uint8_t * buf) const [member function]
cls.add_method('GetBytes',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): uint8_t ns3::Ipv6Prefix::GetPrefixLength() const [member function]
cls.add_method('GetPrefixLength',
'uint8_t',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsEqual(ns3::Ipv6Prefix const & other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv6Prefix const &', 'other')],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsMatch(ns3::Ipv6Address a, ns3::Ipv6Address b) const [member function]
cls.add_method('IsMatch',
'bool',
[param('ns3::Ipv6Address', 'a'), param('ns3::Ipv6Address', 'b')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
return
def register_Ns3LogComponent_methods(root_module, cls):
## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [constructor]
cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
## log.h (module 'core'): ns3::LogComponent::LogComponent(std::string const & name, std::string const & file, ns3::LogLevel const mask=::ns3::LogLevel::LOG_NONE) [constructor]
cls.add_constructor([param('std::string const &', 'name'), param('std::string const &', 'file'), param('ns3::LogLevel const', 'mask', default_value='::ns3::LogLevel::LOG_NONE')])
## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel const level) [member function]
cls.add_method('Disable',
'void',
[param('ns3::LogLevel const', 'level')])
## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel const level) [member function]
cls.add_method('Enable',
'void',
[param('ns3::LogLevel const', 'level')])
## log.h (module 'core'): std::string ns3::LogComponent::File() const [member function]
cls.add_method('File',
'std::string',
[],
is_const=True)
## log.h (module 'core'): static ns3::LogComponent::ComponentList * ns3::LogComponent::GetComponentList() [member function]
cls.add_method('GetComponentList',
'ns3::LogComponent::ComponentList *',
[],
is_static=True)
## log.h (module 'core'): static std::string ns3::LogComponent::GetLevelLabel(ns3::LogLevel const level) [member function]
cls.add_method('GetLevelLabel',
'std::string',
[param('ns3::LogLevel const', 'level')],
is_static=True)
## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel const level) const [member function]
cls.add_method('IsEnabled',
'bool',
[param('ns3::LogLevel const', 'level')],
is_const=True)
## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
cls.add_method('IsNoneEnabled',
'bool',
[],
is_const=True)
## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
cls.add_method('Name',
'char const *',
[],
is_const=True)
## log.h (module 'core'): void ns3::LogComponent::SetMask(ns3::LogLevel const level) [member function]
cls.add_method('SetMask',
'void',
[param('ns3::LogLevel const', 'level')])
return
def register_Ns3Mac16Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## mac16-address.h (module 'network'): ns3::Mac16Address::Mac16Address(ns3::Mac16Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac16Address const &', 'arg0')])
## mac16-address.h (module 'network'): ns3::Mac16Address::Mac16Address() [constructor]
cls.add_constructor([])
## mac16-address.h (module 'network'): ns3::Mac16Address::Mac16Address(char const * str) [constructor]
cls.add_constructor([param('char const *', 'str')])
## mac16-address.h (module 'network'): static ns3::Mac16Address ns3::Mac16Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac16Address',
[],
is_static=True)
## mac16-address.h (module 'network'): static ns3::Mac16Address ns3::Mac16Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac16Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac16-address.h (module 'network'): void ns3::Mac16Address::CopyFrom(uint8_t const * buffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'buffer')])
## mac16-address.h (module 'network'): void ns3::Mac16Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'buffer')],
is_const=True)
## mac16-address.h (module 'network'): static bool ns3::Mac16Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3Mac48Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(ns3::Mac48Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48Address const &', 'arg0')])
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(char const * str) [constructor]
cls.add_constructor([param('char const *', 'str')])
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac48Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyFrom(uint8_t const * buffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'buffer')])
## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'buffer')],
is_const=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv4Address address) [member function]
cls.add_method('GetMulticast',
'ns3::Mac48Address',
[param('ns3::Ipv4Address', 'address')],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv6Address address) [member function]
cls.add_method('GetMulticast',
'ns3::Mac48Address',
[param('ns3::Ipv6Address', 'address')],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast6Prefix() [member function]
cls.add_method('GetMulticast6Prefix',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticastPrefix() [member function]
cls.add_method('GetMulticastPrefix',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True)
## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsGroup() const [member function]
cls.add_method('IsGroup',
'bool',
[],
is_const=True)
## mac48-address.h (module 'network'): static bool ns3::Mac48Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3Mac64Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## mac64-address.h (module 'network'): ns3::Mac64Address::Mac64Address(ns3::Mac64Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac64Address const &', 'arg0')])
## mac64-address.h (module 'network'): ns3::Mac64Address::Mac64Address() [constructor]
cls.add_constructor([])
## mac64-address.h (module 'network'): ns3::Mac64Address::Mac64Address(char const * str) [constructor]
cls.add_constructor([param('char const *', 'str')])
## mac64-address.h (module 'network'): static ns3::Mac64Address ns3::Mac64Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac64Address',
[],
is_static=True)
## mac64-address.h (module 'network'): static ns3::Mac64Address ns3::Mac64Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac64Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac64-address.h (module 'network'): void ns3::Mac64Address::CopyFrom(uint8_t const * buffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'buffer')])
## mac64-address.h (module 'network'): void ns3::Mac64Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'buffer')],
is_const=True)
## mac64-address.h (module 'network'): static bool ns3::Mac64Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3Mac8Address_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_output_stream_operator()
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address(ns3::Mac8Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac8Address const &', 'arg0')])
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address() [constructor]
cls.add_constructor([])
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address(uint8_t addr) [constructor]
cls.add_constructor([param('uint8_t', 'addr')])
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac8Address',
[],
is_static=True)
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac8Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac8-address.h (module 'network'): void ns3::Mac8Address::CopyFrom(uint8_t const * pBuffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'pBuffer')])
## mac8-address.h (module 'network'): void ns3::Mac8Address::CopyTo(uint8_t * pBuffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'pBuffer')],
is_const=True)
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Mac8Address',
[],
is_static=True)
## mac8-address.h (module 'network'): static bool ns3::Mac8Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3NetDeviceContainer_methods(root_module, cls):
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & arg0) [constructor]
cls.add_constructor([param('ns3::NetDeviceContainer const &', 'arg0')])
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer() [constructor]
cls.add_constructor([])
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::Ptr<ns3::NetDevice> dev) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::NetDevice >', 'dev')])
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(std::string devName) [constructor]
cls.add_constructor([param('std::string', 'devName')])
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & a, ns3::NetDeviceContainer const & b) [constructor]
cls.add_constructor([param('ns3::NetDeviceContainer const &', 'a'), param('ns3::NetDeviceContainer const &', 'b')])
## net-device-container.h (module 'network'): void ns3::NetDeviceContainer::Add(ns3::NetDeviceContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::NetDeviceContainer', 'other')])
## net-device-container.h (module 'network'): void ns3::NetDeviceContainer::Add(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'device')])
## net-device-container.h (module 'network'): void ns3::NetDeviceContainer::Add(std::string deviceName) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'deviceName')])
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::Iterator ns3::NetDeviceContainer::Begin() const [member function]
cls.add_method('Begin',
'ns3::NetDeviceContainer::Iterator',
[],
is_const=True)
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::Iterator ns3::NetDeviceContainer::End() const [member function]
cls.add_method('End',
'ns3::NetDeviceContainer::Iterator',
[],
is_const=True)
## net-device-container.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::NetDeviceContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'i')],
is_const=True)
## net-device-container.h (module 'network'): uint32_t ns3::NetDeviceContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
return
def register_Ns3NodeContainer_methods(root_module, cls):
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer() [constructor]
cls.add_constructor([])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::Ptr<ns3::Node> node) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(std::string nodeName) [constructor]
cls.add_constructor([param('std::string', 'nodeName')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d, ns3::NodeContainer const & e) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd'), param('ns3::NodeContainer const &', 'e')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::NodeContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::NodeContainer', 'other')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(std::string nodeName) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'nodeName')])
## node-container.h (module 'network'): ns3::NodeContainer::Iterator ns3::NodeContainer::Begin() const [member function]
cls.add_method('Begin',
'ns3::NodeContainer::Iterator',
[],
is_const=True)
## node-container.h (module 'network'): bool ns3::NodeContainer::Contains(uint32_t id) const [member function]
cls.add_method('Contains',
'bool',
[param('uint32_t', 'id')],
is_const=True)
## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n) [member function]
cls.add_method('Create',
'void',
[param('uint32_t', 'n')])
## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n, uint32_t systemId) [member function]
cls.add_method('Create',
'void',
[param('uint32_t', 'n'), param('uint32_t', 'systemId')])
## node-container.h (module 'network'): ns3::NodeContainer::Iterator ns3::NodeContainer::End() const [member function]
cls.add_method('End',
'ns3::NodeContainer::Iterator',
[],
is_const=True)
## node-container.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NodeContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::Node >',
[param('uint32_t', 'i')],
is_const=True)
## node-container.h (module 'network'): static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function]
cls.add_method('GetGlobal',
'ns3::NodeContainer',
[],
is_static=True)
## node-container.h (module 'network'): uint32_t ns3::NodeContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
return
def register_Ns3NodeList_methods(root_module, cls):
## node-list.h (module 'network'): ns3::NodeList::NodeList() [constructor]
cls.add_constructor([])
## node-list.h (module 'network'): ns3::NodeList::NodeList(ns3::NodeList const & arg0) [constructor]
cls.add_constructor([param('ns3::NodeList const &', 'arg0')])
## node-list.h (module 'network'): static uint32_t ns3::NodeList::Add(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('Add',
'uint32_t',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_static=True)
## node-list.h (module 'network'): static ns3::NodeList::Iterator ns3::NodeList::Begin() [member function]
cls.add_method('Begin',
'ns3::NodeList::Iterator',
[],
is_static=True)
## node-list.h (module 'network'): static ns3::NodeList::Iterator ns3::NodeList::End() [member function]
cls.add_method('End',
'ns3::NodeList::Iterator',
[],
is_static=True)
## node-list.h (module 'network'): static uint32_t ns3::NodeList::GetNNodes() [member function]
cls.add_method('GetNNodes',
'uint32_t',
[],
is_static=True)
## node-list.h (module 'network'): static ns3::Ptr<ns3::Node> ns3::NodeList::GetNode(uint32_t n) [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[param('uint32_t', 'n')],
is_static=True)
return
def register_Ns3NonCopyable_methods(root_module, cls):
## non-copyable.h (module 'core'): ns3::NonCopyable::NonCopyable() [constructor]
cls.add_constructor([],
visibility='protected')
return
def register_Ns3ObjectBase_methods(root_module, cls):
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase() [constructor]
cls.add_constructor([])
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')])
## object-base.h (module 'core'): void ns3::ObjectBase::GetAttribute(std::string name, ns3::AttributeValue & value) const [member function]
cls.add_method('GetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
is_const=True)
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & value) const [member function]
cls.add_method('GetAttributeFailSafe',
'bool',
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
is_const=True)
## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## object-base.h (module 'core'): static ns3::TypeId ns3::ObjectBase::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## object-base.h (module 'core'): void ns3::ObjectBase::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-base.h (module 'core'): bool ns3::ObjectBase::SetAttributeFailSafe(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttributeFailSafe',
'bool',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceConnect',
'bool',
[param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceConnectWithoutContext',
'bool',
[param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceDisconnect',
'bool',
[param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceDisconnectWithoutContext',
'bool',
[param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): void ns3::ObjectBase::ConstructSelf(ns3::AttributeConstructionList const & attributes) [member function]
cls.add_method('ConstructSelf',
'void',
[param('ns3::AttributeConstructionList const &', 'attributes')],
visibility='protected')
## object-base.h (module 'core'): void ns3::ObjectBase::NotifyConstructionCompleted() [member function]
cls.add_method('NotifyConstructionCompleted',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3ObjectDeleter_methods(root_module, cls):
## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter() [constructor]
cls.add_constructor([])
## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter(ns3::ObjectDeleter const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectDeleter const &', 'arg0')])
## object.h (module 'core'): static void ns3::ObjectDeleter::Delete(ns3::Object * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Object *', 'object')],
is_static=True)
return
def register_Ns3ObjectFactory_methods(root_module, cls):
cls.add_output_stream_operator()
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(ns3::ObjectFactory const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactory const &', 'arg0')])
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(std::string typeId) [constructor]
cls.add_constructor([param('std::string', 'typeId')])
## object-factory.h (module 'core'): ns3::Ptr<ns3::Object> ns3::ObjectFactory::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::Object >',
[],
is_const=True)
## object-factory.h (module 'core'): ns3::TypeId ns3::ObjectFactory::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
## object-factory.h (module 'core'): void ns3::ObjectFactory::Set(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('Set',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(ns3::TypeId tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('ns3::TypeId', 'tid')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(char const * tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('char const *', 'tid')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(std::string tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('std::string', 'tid')])
return
def register_Ns3PacketMetadata_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(uint64_t uid, uint32_t size) [constructor]
cls.add_constructor([param('uint64_t', 'uid'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(ns3::PacketMetadata const & o) [constructor]
cls.add_constructor([param('ns3::PacketMetadata const &', 'o')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddAtEnd(ns3::PacketMetadata const & o) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::PacketMetadata const &', 'o')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddHeader(ns3::Header const & header, uint32_t size) [member function]
cls.add_method('AddHeader',
'void',
[param('ns3::Header const &', 'header'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddPaddingAtEnd(uint32_t end) [member function]
cls.add_method('AddPaddingAtEnd',
'void',
[param('uint32_t', 'end')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddTrailer(ns3::Trailer const & trailer, uint32_t size) [member function]
cls.add_method('AddTrailer',
'void',
[param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::PacketMetadata::BeginItem(ns3::Buffer buffer) const [member function]
cls.add_method('BeginItem',
'ns3::PacketMetadata::ItemIterator',
[param('ns3::Buffer', 'buffer')],
is_const=True)
## packet-metadata.h (module 'network'): ns3::PacketMetadata ns3::PacketMetadata::CreateFragment(uint32_t start, uint32_t end) const [member function]
cls.add_method('CreateFragment',
'ns3::PacketMetadata',
[param('uint32_t', 'start'), param('uint32_t', 'end')],
is_const=True)
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Deserialize(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::Enable() [member function]
cls.add_method('Enable',
'void',
[],
is_static=True)
## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::EnableChecking() [member function]
cls.add_method('EnableChecking',
'void',
[],
is_static=True)
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packet-metadata.h (module 'network'): uint64_t ns3::PacketMetadata::GetUid() const [member function]
cls.add_method('GetUid',
'uint64_t',
[],
is_const=True)
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtEnd(uint32_t end) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'end')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtStart(uint32_t start) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'start')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveHeader(ns3::Header const & header, uint32_t size) [member function]
cls.add_method('RemoveHeader',
'void',
[param('ns3::Header const &', 'header'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveTrailer(ns3::Trailer const & trailer, uint32_t size) [member function]
cls.add_method('RemoveTrailer',
'void',
[param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3PacketMetadataItem_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item() [constructor]
cls.add_constructor([])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item(ns3::PacketMetadata::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketMetadata::Item const &', 'arg0')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::current [variable]
cls.add_instance_attribute('current', 'ns3::Buffer::Iterator', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentSize [variable]
cls.add_instance_attribute('currentSize', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromEnd [variable]
cls.add_instance_attribute('currentTrimedFromEnd', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromStart [variable]
cls.add_instance_attribute('currentTrimedFromStart', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::isFragment [variable]
cls.add_instance_attribute('isFragment', 'bool', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::type [variable]
cls.add_instance_attribute('type', 'ns3::PacketMetadata::Item::ItemType', is_const=False)
return
def register_Ns3PacketMetadataItemIterator_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata::ItemIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketMetadata::ItemIterator const &', 'arg0')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata const * metadata, ns3::Buffer buffer) [constructor]
cls.add_constructor([param('ns3::PacketMetadata const *', 'metadata'), param('ns3::Buffer', 'buffer')])
## packet-metadata.h (module 'network'): bool ns3::PacketMetadata::ItemIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item ns3::PacketMetadata::ItemIterator::Next() [member function]
cls.add_method('Next',
'ns3::PacketMetadata::Item',
[])
return
def register_Ns3PacketSocketAddress_methods(root_module, cls):
## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress::PacketSocketAddress(ns3::PacketSocketAddress const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSocketAddress const &', 'arg0')])
## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress::PacketSocketAddress() [constructor]
cls.add_constructor([])
## packet-socket-address.h (module 'network'): static ns3::PacketSocketAddress ns3::PacketSocketAddress::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::PacketSocketAddress',
[param('ns3::Address const &', 'address')],
is_static=True)
## packet-socket-address.h (module 'network'): ns3::Address ns3::PacketSocketAddress::GetPhysicalAddress() const [member function]
cls.add_method('GetPhysicalAddress',
'ns3::Address',
[],
is_const=True)
## packet-socket-address.h (module 'network'): uint16_t ns3::PacketSocketAddress::GetProtocol() const [member function]
cls.add_method('GetProtocol',
'uint16_t',
[],
is_const=True)
## packet-socket-address.h (module 'network'): uint32_t ns3::PacketSocketAddress::GetSingleDevice() const [member function]
cls.add_method('GetSingleDevice',
'uint32_t',
[],
is_const=True)
## packet-socket-address.h (module 'network'): static bool ns3::PacketSocketAddress::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## packet-socket-address.h (module 'network'): bool ns3::PacketSocketAddress::IsSingleDevice() const [member function]
cls.add_method('IsSingleDevice',
'bool',
[],
is_const=True)
## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetAllDevices() [member function]
cls.add_method('SetAllDevices',
'void',
[])
## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetPhysicalAddress(ns3::Address const address) [member function]
cls.add_method('SetPhysicalAddress',
'void',
[param('ns3::Address const', 'address')])
## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetProtocol(uint16_t protocol) [member function]
cls.add_method('SetProtocol',
'void',
[param('uint16_t', 'protocol')])
## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetSingleDevice(uint32_t device) [member function]
cls.add_method('SetSingleDevice',
'void',
[param('uint32_t', 'device')])
return
def register_Ns3PacketSocketHelper_methods(root_module, cls):
## packet-socket-helper.h (module 'network'): ns3::PacketSocketHelper::PacketSocketHelper() [constructor]
cls.add_constructor([])
## packet-socket-helper.h (module 'network'): ns3::PacketSocketHelper::PacketSocketHelper(ns3::PacketSocketHelper const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSocketHelper const &', 'arg0')])
## packet-socket-helper.h (module 'network'): void ns3::PacketSocketHelper::Install(ns3::Ptr<ns3::Node> node) const [member function]
cls.add_method('Install',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_const=True)
## packet-socket-helper.h (module 'network'): void ns3::PacketSocketHelper::Install(std::string nodeName) const [member function]
cls.add_method('Install',
'void',
[param('std::string', 'nodeName')],
is_const=True)
## packet-socket-helper.h (module 'network'): void ns3::PacketSocketHelper::Install(ns3::NodeContainer c) const [member function]
cls.add_method('Install',
'void',
[param('ns3::NodeContainer', 'c')],
is_const=True)
return
def register_Ns3PacketTagIterator_methods(root_module, cls):
## packet.h (module 'network'): ns3::PacketTagIterator::PacketTagIterator(ns3::PacketTagIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagIterator const &', 'arg0')])
## packet.h (module 'network'): bool ns3::PacketTagIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet.h (module 'network'): ns3::PacketTagIterator::Item ns3::PacketTagIterator::Next() [member function]
cls.add_method('Next',
'ns3::PacketTagIterator::Item',
[])
return
def register_Ns3PacketTagIteratorItem_methods(root_module, cls):
## packet.h (module 'network'): ns3::PacketTagIterator::Item::Item(ns3::PacketTagIterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagIterator::Item const &', 'arg0')])
## packet.h (module 'network'): void ns3::PacketTagIterator::Item::GetTag(ns3::Tag & tag) const [member function]
cls.add_method('GetTag',
'void',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::TypeId ns3::PacketTagIterator::Item::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
return
def register_Ns3PacketTagList_methods(root_module, cls):
## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList() [constructor]
cls.add_constructor([])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList(ns3::PacketTagList const & o) [constructor]
cls.add_constructor([param('ns3::PacketTagList const &', 'o')])
## packet-tag-list.h (module 'network'): void ns3::PacketTagList::Add(ns3::Tag const & tag) const [member function]
cls.add_method('Add',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData const * ns3::PacketTagList::Head() const [member function]
cls.add_method('Head',
'ns3::PacketTagList::TagData const *',
[],
is_const=True)
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Peek(ns3::Tag & tag) const [member function]
cls.add_method('Peek',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Remove(ns3::Tag & tag) [member function]
cls.add_method('Remove',
'bool',
[param('ns3::Tag &', 'tag')])
## packet-tag-list.h (module 'network'): void ns3::PacketTagList::RemoveAll() [member function]
cls.add_method('RemoveAll',
'void',
[])
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Replace(ns3::Tag & tag) [member function]
cls.add_method('Replace',
'bool',
[param('ns3::Tag &', 'tag')])
return
def register_Ns3PacketTagListTagData_methods(root_module, cls):
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData() [constructor]
cls.add_constructor([])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData(ns3::PacketTagList::TagData const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagList::TagData const &', 'arg0')])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::count [variable]
cls.add_instance_attribute('count', 'uint32_t', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::data [variable]
cls.add_instance_attribute('data', 'uint8_t [ 1 ]', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::next [variable]
cls.add_instance_attribute('next', 'ns3::PacketTagList::TagData *', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::size [variable]
cls.add_instance_attribute('size', 'uint32_t', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
return
def register_Ns3ParameterLogger_methods(root_module, cls):
## log.h (module 'core'): ns3::ParameterLogger::ParameterLogger(ns3::ParameterLogger const & arg0) [constructor]
cls.add_constructor([param('ns3::ParameterLogger const &', 'arg0')])
## log.h (module 'core'): ns3::ParameterLogger::ParameterLogger(std::ostream & os) [constructor]
cls.add_constructor([param('std::ostream &', 'os')])
return
def register_Ns3PbbAddressTlvBlock_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::PbbAddressTlvBlock(ns3::PbbAddressTlvBlock const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbAddressTlvBlock const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::PbbAddressTlvBlock() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressTlvBlock::Back() const [member function]
cls.add_method('Back',
'ns3::Ptr< ns3::PbbAddressTlv >',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::Iterator ns3::PbbAddressTlvBlock::Begin() [member function]
cls.add_method('Begin',
'ns3::PbbAddressTlvBlock::Iterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::ConstIterator ns3::PbbAddressTlvBlock::Begin() const [member function]
cls.add_method('Begin',
'ns3::PbbAddressTlvBlock::ConstIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Clear() [member function]
cls.add_method('Clear',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')])
## packetbb.h (module 'network'): bool ns3::PbbAddressTlvBlock::Empty() const [member function]
cls.add_method('Empty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::Iterator ns3::PbbAddressTlvBlock::End() [member function]
cls.add_method('End',
'ns3::PbbAddressTlvBlock::Iterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::ConstIterator ns3::PbbAddressTlvBlock::End() const [member function]
cls.add_method('End',
'ns3::PbbAddressTlvBlock::ConstIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::Iterator ns3::PbbAddressTlvBlock::Erase(ns3::PbbAddressTlvBlock::Iterator position) [member function]
cls.add_method('Erase',
'ns3::PbbAddressTlvBlock::Iterator',
[param('std::list< ns3::Ptr< ns3::PbbAddressTlv > > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::Iterator ns3::PbbAddressTlvBlock::Erase(ns3::PbbAddressTlvBlock::Iterator first, ns3::PbbAddressTlvBlock::Iterator last) [member function]
cls.add_method('Erase',
'ns3::PbbAddressTlvBlock::Iterator',
[param('std::list< ns3::Ptr< ns3::PbbAddressTlv > > iterator', 'first'), param('std::list< ns3::Ptr< ns3::PbbAddressTlv > > iterator', 'last')])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressTlvBlock::Front() const [member function]
cls.add_method('Front',
'ns3::Ptr< ns3::PbbAddressTlv >',
[],
is_const=True)
## packetbb.h (module 'network'): uint32_t ns3::PbbAddressTlvBlock::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::Iterator ns3::PbbAddressTlvBlock::Insert(ns3::PbbAddressTlvBlock::Iterator position, ns3::Ptr<ns3::PbbAddressTlv> const tlv) [member function]
cls.add_method('Insert',
'ns3::PbbAddressTlvBlock::Iterator',
[param('std::list< ns3::Ptr< ns3::PbbAddressTlv > > iterator', 'position'), param('ns3::Ptr< ns3::PbbAddressTlv > const', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PopBack() [member function]
cls.add_method('PopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PopFront() [member function]
cls.add_method('PopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Print(std::ostream & os, int level) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os'), param('int', 'level')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PushBack(ns3::Ptr<ns3::PbbAddressTlv> tlv) [member function]
cls.add_method('PushBack',
'void',
[param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PushFront(ns3::Ptr<ns3::PbbAddressTlv> tlv) [member function]
cls.add_method('PushFront',
'void',
[param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True)
## packetbb.h (module 'network'): int ns3::PbbAddressTlvBlock::Size() const [member function]
cls.add_method('Size',
'int',
[],
is_const=True)
return
def register_Ns3PbbTlvBlock_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## packetbb.h (module 'network'): ns3::PbbTlvBlock::PbbTlvBlock(ns3::PbbTlvBlock const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbTlvBlock const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbTlvBlock::PbbTlvBlock() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbTlvBlock::Back() const [member function]
cls.add_method('Back',
'ns3::Ptr< ns3::PbbTlv >',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbTlvBlock::Iterator ns3::PbbTlvBlock::Begin() [member function]
cls.add_method('Begin',
'ns3::PbbTlvBlock::Iterator',
[])
## packetbb.h (module 'network'): ns3::PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::Begin() const [member function]
cls.add_method('Begin',
'ns3::PbbTlvBlock::ConstIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Clear() [member function]
cls.add_method('Clear',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')])
## packetbb.h (module 'network'): bool ns3::PbbTlvBlock::Empty() const [member function]
cls.add_method('Empty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbTlvBlock::Iterator ns3::PbbTlvBlock::End() [member function]
cls.add_method('End',
'ns3::PbbTlvBlock::Iterator',
[])
## packetbb.h (module 'network'): ns3::PbbTlvBlock::ConstIterator ns3::PbbTlvBlock::End() const [member function]
cls.add_method('End',
'ns3::PbbTlvBlock::ConstIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase(ns3::PbbTlvBlock::Iterator position) [member function]
cls.add_method('Erase',
'ns3::PbbTlvBlock::Iterator',
[param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbTlvBlock::Iterator ns3::PbbTlvBlock::Erase(ns3::PbbTlvBlock::Iterator first, ns3::PbbTlvBlock::Iterator last) [member function]
cls.add_method('Erase',
'ns3::PbbTlvBlock::Iterator',
[param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'first'), param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'last')])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbTlvBlock::Front() const [member function]
cls.add_method('Front',
'ns3::Ptr< ns3::PbbTlv >',
[],
is_const=True)
## packetbb.h (module 'network'): uint32_t ns3::PbbTlvBlock::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbTlvBlock::Iterator ns3::PbbTlvBlock::Insert(ns3::PbbTlvBlock::Iterator position, ns3::Ptr<ns3::PbbTlv> const tlv) [member function]
cls.add_method('Insert',
'ns3::PbbTlvBlock::Iterator',
[param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PopBack() [member function]
cls.add_method('PopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PopFront() [member function]
cls.add_method('PopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Print(std::ostream & os, int level) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os'), param('int', 'level')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PushBack(ns3::Ptr<ns3::PbbTlv> tlv) [member function]
cls.add_method('PushBack',
'void',
[param('ns3::Ptr< ns3::PbbTlv >', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PushFront(ns3::Ptr<ns3::PbbTlv> tlv) [member function]
cls.add_method('PushFront',
'void',
[param('ns3::Ptr< ns3::PbbTlv >', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True)
## packetbb.h (module 'network'): int ns3::PbbTlvBlock::Size() const [member function]
cls.add_method('Size',
'int',
[],
is_const=True)
return
def register_Ns3PcapFile_methods(root_module, cls):
## pcap-file.h (module 'network'): ns3::PcapFile::PcapFile() [constructor]
cls.add_constructor([])
## pcap-file.h (module 'network'): void ns3::PcapFile::Clear() [member function]
cls.add_method('Clear',
'void',
[])
## pcap-file.h (module 'network'): void ns3::PcapFile::Close() [member function]
cls.add_method('Close',
'void',
[])
## pcap-file.h (module 'network'): static bool ns3::PcapFile::Diff(std::string const & f1, std::string const & f2, uint32_t & sec, uint32_t & usec, uint32_t & packets, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT) [member function]
cls.add_method('Diff',
'bool',
[param('std::string const &', 'f1'), param('std::string const &', 'f2'), param('uint32_t &', 'sec'), param('uint32_t &', 'usec'), param('uint32_t &', 'packets'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT')],
is_static=True)
## pcap-file.h (module 'network'): bool ns3::PcapFile::Eof() const [member function]
cls.add_method('Eof',
'bool',
[],
is_const=True)
## pcap-file.h (module 'network'): bool ns3::PcapFile::Fail() const [member function]
cls.add_method('Fail',
'bool',
[],
is_const=True)
## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetDataLinkType() [member function]
cls.add_method('GetDataLinkType',
'uint32_t',
[])
## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetMagic() [member function]
cls.add_method('GetMagic',
'uint32_t',
[])
## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetSigFigs() [member function]
cls.add_method('GetSigFigs',
'uint32_t',
[])
## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetSnapLen() [member function]
cls.add_method('GetSnapLen',
'uint32_t',
[])
## pcap-file.h (module 'network'): bool ns3::PcapFile::GetSwapMode() [member function]
cls.add_method('GetSwapMode',
'bool',
[])
## pcap-file.h (module 'network'): int32_t ns3::PcapFile::GetTimeZoneOffset() [member function]
cls.add_method('GetTimeZoneOffset',
'int32_t',
[])
## pcap-file.h (module 'network'): uint16_t ns3::PcapFile::GetVersionMajor() [member function]
cls.add_method('GetVersionMajor',
'uint16_t',
[])
## pcap-file.h (module 'network'): uint16_t ns3::PcapFile::GetVersionMinor() [member function]
cls.add_method('GetVersionMinor',
'uint16_t',
[])
## pcap-file.h (module 'network'): void ns3::PcapFile::Init(uint32_t dataLinkType, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT, int32_t timeZoneCorrection=ns3::PcapFile::ZONE_DEFAULT, bool swapMode=false, bool nanosecMode=false) [member function]
cls.add_method('Init',
'void',
[param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'timeZoneCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT'), param('bool', 'swapMode', default_value='false'), param('bool', 'nanosecMode', default_value='false')])
## pcap-file.h (module 'network'): bool ns3::PcapFile::IsNanoSecMode() [member function]
cls.add_method('IsNanoSecMode',
'bool',
[])
## pcap-file.h (module 'network'): void ns3::PcapFile::Open(std::string const & filename, std::ios_base::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::ios_base::openmode', 'mode')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Read(uint8_t * const data, uint32_t maxBytes, uint32_t & tsSec, uint32_t & tsUsec, uint32_t & inclLen, uint32_t & origLen, uint32_t & readLen) [member function]
cls.add_method('Read',
'void',
[param('uint8_t * const', 'data'), param('uint32_t', 'maxBytes'), param('uint32_t &', 'tsSec'), param('uint32_t &', 'tsUsec'), param('uint32_t &', 'inclLen'), param('uint32_t &', 'origLen'), param('uint32_t &', 'readLen')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, uint8_t const * const data, uint32_t totalLen) [member function]
cls.add_method('Write',
'void',
[param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('uint8_t const * const', 'data'), param('uint32_t', 'totalLen')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('Write',
'void',
[param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('ns3::Ptr< ns3::Packet const >', 'p')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, ns3::Header const & header, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('Write',
'void',
[param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('ns3::Header const &', 'header'), param('ns3::Ptr< ns3::Packet const >', 'p')])
## pcap-file.h (module 'network'): ns3::PcapFile::SNAPLEN_DEFAULT [variable]
cls.add_static_attribute('SNAPLEN_DEFAULT', 'uint32_t const', is_const=True)
## pcap-file.h (module 'network'): ns3::PcapFile::ZONE_DEFAULT [variable]
cls.add_static_attribute('ZONE_DEFAULT', 'int32_t const', is_const=True)
return
def register_Ns3PcapHelper_methods(root_module, cls):
## trace-helper.h (module 'network'): ns3::PcapHelper::PcapHelper(ns3::PcapHelper const & arg0) [constructor]
cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::PcapHelper::PcapHelper() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): ns3::Ptr<ns3::PcapFileWrapper> ns3::PcapHelper::CreateFile(std::string filename, std::ios_base::openmode filemode, ns3::PcapHelper::DataLinkType dataLinkType, uint32_t snapLen=std::numeric_limits<unsigned int>::max(), int32_t tzCorrection=0) [member function]
cls.add_method('CreateFile',
'ns3::Ptr< ns3::PcapFileWrapper >',
[param('std::string', 'filename'), param('std::ios_base::openmode', 'filemode'), param('ns3::PcapHelper::DataLinkType', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='std::numeric_limits<unsigned int>::max()'), param('int32_t', 'tzCorrection', default_value='0')])
## trace-helper.h (module 'network'): std::string ns3::PcapHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr<ns3::NetDevice> device, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromDevice',
'std::string',
[param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'useObjectNames', default_value='true')])
## trace-helper.h (module 'network'): std::string ns3::PcapHelper::GetFilenameFromInterfacePair(std::string prefix, ns3::Ptr<ns3::Object> object, uint32_t interface, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromInterfacePair',
'std::string',
[param('std::string', 'prefix'), param('ns3::Ptr< ns3::Object >', 'object'), param('uint32_t', 'interface'), param('bool', 'useObjectNames', default_value='true')])
return
def register_Ns3PcapHelperForDevice_methods(root_module, cls):
## trace-helper.h (module 'network'): ns3::PcapHelperForDevice::PcapHelperForDevice(ns3::PcapHelperForDevice const & arg0) [constructor]
cls.add_constructor([param('ns3::PcapHelperForDevice const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::PcapHelperForDevice::PcapHelperForDevice() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool promiscuous=false, bool explicitFilename=false) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false'), param('bool', 'explicitFilename', default_value='false')])
## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, std::string ndName, bool promiscuous=false, bool explicitFilename=false) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'prefix'), param('std::string', 'ndName'), param('bool', 'promiscuous', default_value='false'), param('bool', 'explicitFilename', default_value='false')])
## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, ns3::NetDeviceContainer d, bool promiscuous=false) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'prefix'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous', default_value='false')])
## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, ns3::NodeContainer n, bool promiscuous=false) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'prefix'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous', default_value='false')])
## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false) [member function]
cls.add_method('EnablePcap',
'void',
[param('std::string', 'prefix'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous', default_value='false')])
## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcapAll(std::string prefix, bool promiscuous=false) [member function]
cls.add_method('EnablePcapAll',
'void',
[param('std::string', 'prefix'), param('bool', 'promiscuous', default_value='false')])
## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcapInternal(std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool promiscuous, bool explicitFilename) [member function]
cls.add_method('EnablePcapInternal',
'void',
[param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous'), param('bool', 'explicitFilename')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3QueueSize_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('>=')
## queue-size.h (module 'network'): ns3::QueueSize::QueueSize(ns3::QueueSize const & arg0) [constructor]
cls.add_constructor([param('ns3::QueueSize const &', 'arg0')])
## queue-size.h (module 'network'): ns3::QueueSize::QueueSize() [constructor]
cls.add_constructor([])
## queue-size.h (module 'network'): ns3::QueueSize::QueueSize(ns3::QueueSizeUnit unit, uint32_t value) [constructor]
cls.add_constructor([param('ns3::QueueSizeUnit', 'unit'), param('uint32_t', 'value')])
## queue-size.h (module 'network'): ns3::QueueSize::QueueSize(std::string size) [constructor]
cls.add_constructor([param('std::string', 'size')])
## queue-size.h (module 'network'): ns3::QueueSizeUnit ns3::QueueSize::GetUnit() const [member function]
cls.add_method('GetUnit',
'ns3::QueueSizeUnit',
[],
is_const=True)
## queue-size.h (module 'network'): uint32_t ns3::QueueSize::GetValue() const [member function]
cls.add_method('GetValue',
'uint32_t',
[],
is_const=True)
return
def register_Ns3SequenceNumber32_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber32'], root_module['ns3::SequenceNumber32'], param('ns3::SequenceNumber< unsigned int, int > const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber32'], root_module['ns3::SequenceNumber32'], param('int', u'right'))
cls.add_inplace_numeric_operator('+=', param('int', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::SequenceNumber32'], root_module['ns3::SequenceNumber32'], param('int', u'right'))
cls.add_inplace_numeric_operator('-=', param('int', u'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('>=')
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int>::SequenceNumber() [constructor]
cls.add_constructor([])
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int>::SequenceNumber(unsigned int value) [constructor]
cls.add_constructor([param('unsigned int', 'value')])
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int>::SequenceNumber(ns3::SequenceNumber<unsigned int, int> const & value) [constructor]
cls.add_constructor([param('ns3::SequenceNumber< unsigned int, int > const &', 'value')])
## sequence-number.h (module 'network'): unsigned int ns3::SequenceNumber<unsigned int, int>::GetValue() const [member function]
cls.add_method('GetValue',
'unsigned int',
[],
is_const=True)
return
def register_Ns3SequenceNumber16_methods(root_module, cls):
cls.add_binary_comparison_operator('!=')
cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber16'], root_module['ns3::SequenceNumber16'], param('ns3::SequenceNumber< unsigned short, short > const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber16'], root_module['ns3::SequenceNumber16'], param('short int', u'right'))
cls.add_inplace_numeric_operator('+=', param('short int', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::SequenceNumber16'], root_module['ns3::SequenceNumber16'], param('short int', u'right'))
cls.add_inplace_numeric_operator('-=', param('short int', u'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('>=')
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short>::SequenceNumber() [constructor]
cls.add_constructor([])
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short>::SequenceNumber(short unsigned int value) [constructor]
cls.add_constructor([param('short unsigned int', 'value')])
## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short>::SequenceNumber(ns3::SequenceNumber<unsigned short, short> const & value) [constructor]
cls.add_constructor([param('ns3::SequenceNumber< unsigned short, short > const &', 'value')])
## sequence-number.h (module 'network'): short unsigned int ns3::SequenceNumber<unsigned short, short>::GetValue() const [member function]
cls.add_method('GetValue',
'short unsigned int',
[],
is_const=True)
return
def register_Ns3SimpleNetDeviceHelper_methods(root_module, cls):
## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper(ns3::SimpleNetDeviceHelper const & arg0) [constructor]
cls.add_constructor([param('ns3::SimpleNetDeviceHelper const &', 'arg0')])
## simple-net-device-helper.h (module 'network'): ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper() [constructor]
cls.add_constructor([])
## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::Ptr<ns3::Node> node) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_const=True)
## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::SimpleChannel> channel) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::SimpleChannel >', 'channel')],
is_const=True)
## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::NodeContainer const & c) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::NodeContainer const &', 'c')],
is_const=True)
## simple-net-device-helper.h (module 'network'): ns3::NetDeviceContainer ns3::SimpleNetDeviceHelper::Install(ns3::NodeContainer const & c, ns3::Ptr<ns3::SimpleChannel> channel) const [member function]
cls.add_method('Install',
'ns3::NetDeviceContainer',
[param('ns3::NodeContainer const &', 'c'), param('ns3::Ptr< ns3::SimpleChannel >', 'channel')],
is_const=True)
## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetChannel(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetChannel',
'void',
[param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')])
## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetChannelAttribute(std::string n1, ns3::AttributeValue const & v1) [member function]
cls.add_method('SetChannelAttribute',
'void',
[param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')])
## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function]
cls.add_method('SetDeviceAttribute',
'void',
[param('std::string', 'n1'), param('ns3::AttributeValue const &', 'v1')])
## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(bool pointToPointMode) [member function]
cls.add_method('SetNetDevicePointToPointMode',
'void',
[param('bool', 'pointToPointMode')])
## simple-net-device-helper.h (module 'network'): void ns3::SimpleNetDeviceHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function]
cls.add_method('SetQueue',
'void',
[param('std::string', 'type'), param('std::string', 'n1', default_value='""'), param('ns3::AttributeValue const &', 'v1', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n2', default_value='""'), param('ns3::AttributeValue const &', 'v2', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n3', default_value='""'), param('ns3::AttributeValue const &', 'v3', default_value='ns3::EmptyAttributeValue()'), param('std::string', 'n4', default_value='""'), param('ns3::AttributeValue const &', 'v4', default_value='ns3::EmptyAttributeValue()')])
return
def register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount(ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter > const &', 'o')])
return
def register_Ns3Simulator_methods(root_module, cls):
## simulator.h (module 'core'): ns3::Simulator::Simulator(ns3::Simulator const & arg0) [constructor]
cls.add_constructor([param('ns3::Simulator const &', 'arg0')])
## simulator.h (module 'core'): static void ns3::Simulator::Cancel(ns3::EventId const & id) [member function]
cls.add_method('Cancel',
'void',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Destroy() [member function]
cls.add_method('Destroy',
'void',
[],
is_static=True)
## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetContext() [member function]
cls.add_method('GetContext',
'uint32_t',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetDelayLeft(ns3::EventId const & id) [member function]
cls.add_method('GetDelayLeft',
'ns3::Time',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static uint64_t ns3::Simulator::GetEventCount() [member function]
cls.add_method('GetEventCount',
'uint64_t',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Ptr<ns3::SimulatorImpl> ns3::Simulator::GetImplementation() [member function]
cls.add_method('GetImplementation',
'ns3::Ptr< ns3::SimulatorImpl >',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetMaximumSimulationTime() [member function]
cls.add_method('GetMaximumSimulationTime',
'ns3::Time',
[],
is_static=True)
## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetSystemId() [member function]
cls.add_method('GetSystemId',
'uint32_t',
[],
is_static=True)
## simulator.h (module 'core'): static bool ns3::Simulator::IsExpired(ns3::EventId const & id) [member function]
cls.add_method('IsExpired',
'bool',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static bool ns3::Simulator::IsFinished() [member function]
cls.add_method('IsFinished',
'bool',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Now() [member function]
cls.add_method('Now',
'ns3::Time',
[],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Remove(ns3::EventId const & id) [member function]
cls.add_method('Remove',
'void',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::SetImplementation(ns3::Ptr<ns3::SimulatorImpl> impl) [member function]
cls.add_method('SetImplementation',
'void',
[param('ns3::Ptr< ns3::SimulatorImpl >', 'impl')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
cls.add_method('SetScheduler',
'void',
[param('ns3::ObjectFactory', 'schedulerFactory')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Stop() [member function]
cls.add_method('Stop',
'void',
[],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Stop(ns3::Time const & delay) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'delay')],
is_static=True)
return
def register_Ns3StatisticalSummary_methods(root_module, cls):
## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary() [constructor]
cls.add_constructor([])
## data-calculator.h (module 'stats'): ns3::StatisticalSummary::StatisticalSummary(ns3::StatisticalSummary const & arg0) [constructor]
cls.add_constructor([param('ns3::StatisticalSummary const &', 'arg0')])
## data-calculator.h (module 'stats'): long int ns3::StatisticalSummary::getCount() const [member function]
cls.add_method('getCount',
'long int',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMax() const [member function]
cls.add_method('getMax',
'double',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMean() const [member function]
cls.add_method('getMean',
'double',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getMin() const [member function]
cls.add_method('getMin',
'double',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSqrSum() const [member function]
cls.add_method('getSqrSum',
'double',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getStddev() const [member function]
cls.add_method('getStddev',
'double',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getSum() const [member function]
cls.add_method('getSum',
'double',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): double ns3::StatisticalSummary::getVariance() const [member function]
cls.add_method('getVariance',
'double',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3SystemWallClockMs_methods(root_module, cls):
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [constructor]
cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')])
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs() [constructor]
cls.add_constructor([])
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::End() [member function]
cls.add_method('End',
'int64_t',
[])
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedReal() const [member function]
cls.add_method('GetElapsedReal',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedSystem() const [member function]
cls.add_method('GetElapsedSystem',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedUser() const [member function]
cls.add_method('GetElapsedUser',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): void ns3::SystemWallClockMs::Start() [member function]
cls.add_method('Start',
'void',
[])
return
def register_Ns3Tag_methods(root_module, cls):
## tag.h (module 'network'): ns3::Tag::Tag() [constructor]
cls.add_constructor([])
## tag.h (module 'network'): ns3::Tag::Tag(ns3::Tag const & arg0) [constructor]
cls.add_constructor([param('ns3::Tag const &', 'arg0')])
## tag.h (module 'network'): void ns3::Tag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_pure_virtual=True, is_virtual=True)
## tag.h (module 'network'): uint32_t ns3::Tag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## tag.h (module 'network'): static ns3::TypeId ns3::Tag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## tag.h (module 'network'): void ns3::Tag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## tag.h (module 'network'): void ns3::Tag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3TagBuffer_methods(root_module, cls):
## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(ns3::TagBuffer const & arg0) [constructor]
cls.add_constructor([param('ns3::TagBuffer const &', 'arg0')])
## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(uint8_t * start, uint8_t * end) [constructor]
cls.add_constructor([param('uint8_t *', 'start'), param('uint8_t *', 'end')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::CopyFrom(ns3::TagBuffer o) [member function]
cls.add_method('CopyFrom',
'void',
[param('ns3::TagBuffer', 'o')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::Read(uint8_t * buffer, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## tag-buffer.h (module 'network'): double ns3::TagBuffer::ReadDouble() [member function]
cls.add_method('ReadDouble',
'double',
[])
## tag-buffer.h (module 'network'): uint16_t ns3::TagBuffer::ReadU16() [member function]
cls.add_method('ReadU16',
'uint16_t',
[])
## tag-buffer.h (module 'network'): uint32_t ns3::TagBuffer::ReadU32() [member function]
cls.add_method('ReadU32',
'uint32_t',
[])
## tag-buffer.h (module 'network'): uint64_t ns3::TagBuffer::ReadU64() [member function]
cls.add_method('ReadU64',
'uint64_t',
[])
## tag-buffer.h (module 'network'): uint8_t ns3::TagBuffer::ReadU8() [member function]
cls.add_method('ReadU8',
'uint8_t',
[])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::TrimAtEnd(uint32_t trim) [member function]
cls.add_method('TrimAtEnd',
'void',
[param('uint32_t', 'trim')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::Write(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Write',
'void',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteDouble(double v) [member function]
cls.add_method('WriteDouble',
'void',
[param('double', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU16(uint16_t v) [member function]
cls.add_method('WriteU16',
'void',
[param('uint16_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU32(uint32_t v) [member function]
cls.add_method('WriteU32',
'void',
[param('uint32_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU64(uint64_t v) [member function]
cls.add_method('WriteU64',
'void',
[param('uint64_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU8(uint8_t v) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'v')])
return
def register_Ns3TimeWithUnit_methods(root_module, cls):
cls.add_output_stream_operator()
## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::TimeWithUnit const & arg0) [constructor]
cls.add_constructor([param('ns3::TimeWithUnit const &', 'arg0')])
## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::Time const time, ns3::Time::Unit const unit) [constructor]
cls.add_constructor([param('ns3::Time const', 'time'), param('ns3::Time::Unit const', 'unit')])
return
def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls):
## traced-value.h (module 'core'): ns3::TracedValue<unsigned int>::TracedValue() [constructor]
cls.add_constructor([])
## traced-value.h (module 'core'): ns3::TracedValue<unsigned int>::TracedValue(ns3::TracedValue<unsigned int> const & o) [constructor]
cls.add_constructor([param('ns3::TracedValue< unsigned int > const &', 'o')])
## traced-value.h (module 'core'): ns3::TracedValue<unsigned int>::TracedValue(unsigned int const & v) [constructor]
cls.add_constructor([param('unsigned int const &', 'v')])
## traced-value.h (module 'core'): ns3::TracedValue<unsigned int>::TracedValue(ns3::TracedValue<unsigned int> const & other) [constructor]
cls.add_constructor([param('ns3::TracedValue< unsigned int > const &', 'other')])
## traced-value.h (module 'core'): ns3::TracedValue<unsigned int>::TracedValue(ns3::TracedValue<unsigned int> const & other) [constructor]
cls.add_constructor([param('ns3::TracedValue< unsigned int > const &', 'other')])
## traced-value.h (module 'core'): void ns3::TracedValue<unsigned int>::Connect(ns3::CallbackBase const & cb, std::string path) [member function]
cls.add_method('Connect',
'void',
[param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')])
## traced-value.h (module 'core'): void ns3::TracedValue<unsigned int>::ConnectWithoutContext(ns3::CallbackBase const & cb) [member function]
cls.add_method('ConnectWithoutContext',
'void',
[param('ns3::CallbackBase const &', 'cb')])
## traced-value.h (module 'core'): void ns3::TracedValue<unsigned int>::Disconnect(ns3::CallbackBase const & cb, std::string path) [member function]
cls.add_method('Disconnect',
'void',
[param('ns3::CallbackBase const &', 'cb'), param('std::string', 'path')])
## traced-value.h (module 'core'): void ns3::TracedValue<unsigned int>::DisconnectWithoutContext(ns3::CallbackBase const & cb) [member function]
cls.add_method('DisconnectWithoutContext',
'void',
[param('ns3::CallbackBase const &', 'cb')])
## traced-value.h (module 'core'): unsigned int ns3::TracedValue<unsigned int>::Get() const [member function]
cls.add_method('Get',
'unsigned int',
[],
is_const=True)
## traced-value.h (module 'core'): void ns3::TracedValue<unsigned int>::Set(unsigned int const & v) [member function]
cls.add_method('Set',
'void',
[param('unsigned int const &', 'v')])
return
def register_Ns3TypeId_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<')
## type-id.h (module 'core'): ns3::TypeId::TypeId(char const * name) [constructor]
cls.add_constructor([param('char const *', 'name')])
## type-id.h (module 'core'): ns3::TypeId::TypeId() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::TypeId(ns3::TypeId const & o) [constructor]
cls.add_constructor([param('ns3::TypeId const &', 'o')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr<const ns3::AttributeAccessor> accessor, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddAttribute',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, uint32_t flags, ns3::AttributeValue const & initialValue, ns3::Ptr<const ns3::AttributeAccessor> accessor, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddAttribute',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('uint32_t', 'flags'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<const ns3::TraceSourceAccessor> accessor) [member function]
cls.add_method('AddTraceSource',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')],
deprecated=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<const ns3::TraceSourceAccessor> accessor, std::string callback, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddTraceSource',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor'), param('std::string', 'callback'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(std::size_t i) const [member function]
cls.add_method('GetAttribute',
'ns3::TypeId::AttributeInformation',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetAttributeFullName(std::size_t i) const [member function]
cls.add_method('GetAttributeFullName',
'std::string',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetAttributeN() const [member function]
cls.add_method('GetAttributeN',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): ns3::Callback<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::TypeId::GetConstructor() const [member function]
cls.add_method('GetConstructor',
'ns3::Callback< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetGroupName() const [member function]
cls.add_method('GetGroupName',
'std::string',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId::hash_t ns3::TypeId::GetHash() const [member function]
cls.add_method('GetHash',
'ns3::TypeId::hash_t',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::GetParent() const [member function]
cls.add_method('GetParent',
'ns3::TypeId',
[],
is_const=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::GetRegistered(uint16_t i) [member function]
cls.add_method('GetRegistered',
'ns3::TypeId',
[param('uint16_t', 'i')],
is_static=True)
## type-id.h (module 'core'): static uint16_t ns3::TypeId::GetRegisteredN() [member function]
cls.add_method('GetRegisteredN',
'uint16_t',
[],
is_static=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetSize() const [member function]
cls.add_method('GetSize',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(std::size_t i) const [member function]
cls.add_method('GetTraceSource',
'ns3::TypeId::TraceSourceInformation',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetTraceSourceN() const [member function]
cls.add_method('GetTraceSourceN',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): uint16_t ns3::TypeId::GetUid() const [member function]
cls.add_method('GetUid',
'uint16_t',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::HasConstructor() const [member function]
cls.add_method('HasConstructor',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::HasParent() const [member function]
cls.add_method('HasParent',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::HideFromDocumentation() [member function]
cls.add_method('HideFromDocumentation',
'ns3::TypeId',
[])
## type-id.h (module 'core'): bool ns3::TypeId::IsChildOf(ns3::TypeId other) const [member function]
cls.add_method('IsChildOf',
'bool',
[param('ns3::TypeId', 'other')],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::LookupAttributeByName(std::string name, ns3::TypeId::AttributeInformation * info) const [member function]
cls.add_method('LookupAttributeByName',
'bool',
[param('std::string', 'name'), param('ns3::TypeId::AttributeInformation *', 'info', transfer_ownership=False)],
is_const=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByHash(ns3::TypeId::hash_t hash) [member function]
cls.add_method('LookupByHash',
'ns3::TypeId',
[param('uint32_t', 'hash')],
is_static=True)
## type-id.h (module 'core'): static bool ns3::TypeId::LookupByHashFailSafe(ns3::TypeId::hash_t hash, ns3::TypeId * tid) [member function]
cls.add_method('LookupByHashFailSafe',
'bool',
[param('uint32_t', 'hash'), param('ns3::TypeId *', 'tid')],
is_static=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByName(std::string name) [member function]
cls.add_method('LookupByName',
'ns3::TypeId',
[param('std::string', 'name')],
is_static=True)
## type-id.h (module 'core'): ns3::Ptr<const ns3::TraceSourceAccessor> ns3::TypeId::LookupTraceSourceByName(std::string name) const [member function]
cls.add_method('LookupTraceSourceByName',
'ns3::Ptr< ns3::TraceSourceAccessor const >',
[param('std::string', 'name')],
is_const=True)
## type-id.h (module 'core'): ns3::Ptr<const ns3::TraceSourceAccessor> ns3::TypeId::LookupTraceSourceByName(std::string name, ns3::TypeId::TraceSourceInformation * info) const [member function]
cls.add_method('LookupTraceSourceByName',
'ns3::Ptr< ns3::TraceSourceAccessor const >',
[param('std::string', 'name'), param('ns3::TypeId::TraceSourceInformation *', 'info')],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::MustHideFromDocumentation() const [member function]
cls.add_method('MustHideFromDocumentation',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::SetAttributeInitialValue(std::size_t i, ns3::Ptr<const ns3::AttributeValue> initialValue) [member function]
cls.add_method('SetAttributeInitialValue',
'bool',
[param('std::size_t', 'i'), param('ns3::Ptr< ns3::AttributeValue const >', 'initialValue')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetGroupName(std::string groupName) [member function]
cls.add_method('SetGroupName',
'ns3::TypeId',
[param('std::string', 'groupName')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetParent(ns3::TypeId tid) [member function]
cls.add_method('SetParent',
'ns3::TypeId',
[param('ns3::TypeId', 'tid')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetParent() [member function]
cls.add_method('SetParent',
'ns3::TypeId',
[],
template_parameters=[u'ns3::QueueBase'])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetParent() [member function]
cls.add_method('SetParent',
'ns3::TypeId',
[],
template_parameters=[u'ns3::Object'])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetSize(std::size_t size) [member function]
cls.add_method('SetSize',
'ns3::TypeId',
[param('std::size_t', 'size')])
## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t uid) [member function]
cls.add_method('SetUid',
'void',
[param('uint16_t', 'uid')])
return
def register_Ns3TypeIdAttributeInformation_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation(ns3::TypeId::AttributeInformation const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeId::AttributeInformation const &', 'arg0')])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::accessor [variable]
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::AttributeAccessor const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::checker [variable]
cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False)
cls.add_instance_attribute('flags', 'uint32_t', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::help [variable]
cls.add_instance_attribute('help', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::initialValue [variable]
cls.add_instance_attribute('initialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::originalInitialValue [variable]
cls.add_instance_attribute('originalInitialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::supportLevel [variable]
cls.add_instance_attribute('supportLevel', 'ns3::TypeId::SupportLevel', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::supportMsg [variable]
cls.add_instance_attribute('supportMsg', 'std::string', is_const=False)
return
def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation(ns3::TypeId::TraceSourceInformation const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable]
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::callback [variable]
cls.add_instance_attribute('callback', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable]
cls.add_instance_attribute('help', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::supportLevel [variable]
cls.add_instance_attribute('supportLevel', 'ns3::TypeId::SupportLevel', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::supportMsg [variable]
cls.add_instance_attribute('supportMsg', 'std::string', is_const=False)
return
def register_Ns3Empty_methods(root_module, cls):
## empty.h (module 'core'): ns3::empty::empty() [constructor]
cls.add_constructor([])
## empty.h (module 'core'): ns3::empty::empty(ns3::empty const & arg0) [constructor]
cls.add_constructor([param('ns3::empty const &', 'arg0')])
return
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::int64x64_t'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('>=')
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
cls.add_unary_numeric_operator('-')
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor]
cls.add_constructor([])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(double const value) [constructor]
cls.add_constructor([param('double const', 'value')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long double const value) [constructor]
cls.add_constructor([param('long double const', 'value')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(int const v) [constructor]
cls.add_constructor([param('int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long int const v) [constructor]
cls.add_constructor([param('long int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long long int const v) [constructor]
cls.add_constructor([param('long long int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(unsigned int const v) [constructor]
cls.add_constructor([param('unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long unsigned int const v) [constructor]
cls.add_constructor([param('long unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long long unsigned int const v) [constructor]
cls.add_constructor([param('long long unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(int64_t const hi, uint64_t const lo) [constructor]
cls.add_constructor([param('int64_t const', 'hi'), param('uint64_t const', 'lo')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(ns3::int64x64_t const & o) [constructor]
cls.add_constructor([param('ns3::int64x64_t const &', 'o')])
## int64x64-128.h (module 'core'): double ns3::int64x64_t::GetDouble() const [member function]
cls.add_method('GetDouble',
'double',
[],
is_const=True)
## int64x64-128.h (module 'core'): int64_t ns3::int64x64_t::GetHigh() const [member function]
cls.add_method('GetHigh',
'int64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): uint64_t ns3::int64x64_t::GetLow() const [member function]
cls.add_method('GetLow',
'uint64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): static ns3::int64x64_t ns3::int64x64_t::Invert(uint64_t const v) [member function]
cls.add_method('Invert',
'ns3::int64x64_t',
[param('uint64_t const', 'v')],
is_static=True)
## int64x64-128.h (module 'core'): void ns3::int64x64_t::MulByInvert(ns3::int64x64_t const & o) [member function]
cls.add_method('MulByInvert',
'void',
[param('ns3::int64x64_t const &', 'o')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::implementation [variable]
cls.add_static_attribute('implementation', 'ns3::int64x64_t::impl_type const', is_const=True)
return
def register_Ns3Chunk_methods(root_module, cls):
## chunk.h (module 'network'): ns3::Chunk::Chunk() [constructor]
cls.add_constructor([])
## chunk.h (module 'network'): ns3::Chunk::Chunk(ns3::Chunk const & arg0) [constructor]
cls.add_constructor([param('ns3::Chunk const &', 'arg0')])
## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_virtual=True)
## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')],
is_virtual=True)
## chunk.h (module 'network'): static ns3::TypeId ns3::Chunk::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## chunk.h (module 'network'): void ns3::Chunk::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3DeviceNameTag_methods(root_module, cls):
## packet-socket.h (module 'network'): ns3::DeviceNameTag::DeviceNameTag(ns3::DeviceNameTag const & arg0) [constructor]
cls.add_constructor([param('ns3::DeviceNameTag const &', 'arg0')])
## packet-socket.h (module 'network'): ns3::DeviceNameTag::DeviceNameTag() [constructor]
cls.add_constructor([])
## packet-socket.h (module 'network'): void ns3::DeviceNameTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## packet-socket.h (module 'network'): std::string ns3::DeviceNameTag::GetDeviceName() const [member function]
cls.add_method('GetDeviceName',
'std::string',
[],
is_const=True)
## packet-socket.h (module 'network'): ns3::TypeId ns3::DeviceNameTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): uint32_t ns3::DeviceNameTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): static ns3::TypeId ns3::DeviceNameTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-socket.h (module 'network'): void ns3::DeviceNameTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): void ns3::DeviceNameTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): void ns3::DeviceNameTag::SetDeviceName(std::string n) [member function]
cls.add_method('SetDeviceName',
'void',
[param('std::string', 'n')])
return
def register_Ns3FlowIdTag_methods(root_module, cls):
## flow-id-tag.h (module 'network'): ns3::FlowIdTag::FlowIdTag(ns3::FlowIdTag const & arg0) [constructor]
cls.add_constructor([param('ns3::FlowIdTag const &', 'arg0')])
## flow-id-tag.h (module 'network'): ns3::FlowIdTag::FlowIdTag() [constructor]
cls.add_constructor([])
## flow-id-tag.h (module 'network'): ns3::FlowIdTag::FlowIdTag(uint32_t flowId) [constructor]
cls.add_constructor([param('uint32_t', 'flowId')])
## flow-id-tag.h (module 'network'): static uint32_t ns3::FlowIdTag::AllocateFlowId() [member function]
cls.add_method('AllocateFlowId',
'uint32_t',
[],
is_static=True)
## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::Deserialize(ns3::TagBuffer buf) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'buf')],
is_virtual=True)
## flow-id-tag.h (module 'network'): uint32_t ns3::FlowIdTag::GetFlowId() const [member function]
cls.add_method('GetFlowId',
'uint32_t',
[],
is_const=True)
## flow-id-tag.h (module 'network'): ns3::TypeId ns3::FlowIdTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## flow-id-tag.h (module 'network'): uint32_t ns3::FlowIdTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## flow-id-tag.h (module 'network'): static ns3::TypeId ns3::FlowIdTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::Serialize(ns3::TagBuffer buf) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'buf')],
is_const=True, is_virtual=True)
## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::SetFlowId(uint32_t flowId) [member function]
cls.add_method('SetFlowId',
'void',
[param('uint32_t', 'flowId')])
return
def register_Ns3Header_methods(root_module, cls):
cls.add_output_stream_operator()
## header.h (module 'network'): ns3::Header::Header() [constructor]
cls.add_constructor([])
## header.h (module 'network'): ns3::Header::Header(ns3::Header const & arg0) [constructor]
cls.add_constructor([param('ns3::Header const &', 'arg0')])
## header.h (module 'network'): uint32_t ns3::Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_virtual=True)
## header.h (module 'network'): uint32_t ns3::Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## header.h (module 'network'): static ns3::TypeId ns3::Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## header.h (module 'network'): void ns3::Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## header.h (module 'network'): void ns3::Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3LlcSnapHeader_methods(root_module, cls):
## llc-snap-header.h (module 'network'): ns3::LlcSnapHeader::LlcSnapHeader(ns3::LlcSnapHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::LlcSnapHeader const &', 'arg0')])
## llc-snap-header.h (module 'network'): ns3::LlcSnapHeader::LlcSnapHeader() [constructor]
cls.add_constructor([])
## llc-snap-header.h (module 'network'): uint32_t ns3::LlcSnapHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## llc-snap-header.h (module 'network'): ns3::TypeId ns3::LlcSnapHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## llc-snap-header.h (module 'network'): uint32_t ns3::LlcSnapHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## llc-snap-header.h (module 'network'): uint16_t ns3::LlcSnapHeader::GetType() [member function]
cls.add_method('GetType',
'uint16_t',
[])
## llc-snap-header.h (module 'network'): static ns3::TypeId ns3::LlcSnapHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## llc-snap-header.h (module 'network'): void ns3::LlcSnapHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## llc-snap-header.h (module 'network'): void ns3::LlcSnapHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## llc-snap-header.h (module 'network'): void ns3::LlcSnapHeader::SetType(uint16_t type) [member function]
cls.add_method('SetType',
'void',
[param('uint16_t', 'type')])
return
def register_Ns3Object_methods(root_module, cls):
## object.h (module 'core'): ns3::Object::Object() [constructor]
cls.add_constructor([])
## object.h (module 'core'): void ns3::Object::AggregateObject(ns3::Ptr<ns3::Object> other) [member function]
cls.add_method('AggregateObject',
'void',
[param('ns3::Ptr< ns3::Object >', 'other')])
## object.h (module 'core'): void ns3::Object::Dispose() [member function]
cls.add_method('Dispose',
'void',
[])
## object.h (module 'core'): ns3::Object::AggregateIterator ns3::Object::GetAggregateIterator() const [member function]
cls.add_method('GetAggregateIterator',
'ns3::Object::AggregateIterator',
[],
is_const=True)
## object.h (module 'core'): ns3::TypeId ns3::Object::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## object.h (module 'core'): static ns3::TypeId ns3::Object::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## object.h (module 'core'): void ns3::Object::Initialize() [member function]
cls.add_method('Initialize',
'void',
[])
## object.h (module 'core'): bool ns3::Object::IsInitialized() const [member function]
cls.add_method('IsInitialized',
'bool',
[],
is_const=True)
## object.h (module 'core'): ns3::Object::Object(ns3::Object const & o) [constructor]
cls.add_constructor([param('ns3::Object const &', 'o')],
visibility='protected')
## object.h (module 'core'): void ns3::Object::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## object.h (module 'core'): void ns3::Object::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
visibility='protected', is_virtual=True)
## object.h (module 'core'): void ns3::Object::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3ObjectAggregateIterator_methods(root_module, cls):
## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator(ns3::Object::AggregateIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::Object::AggregateIterator const &', 'arg0')])
## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator() [constructor]
cls.add_constructor([])
## object.h (module 'core'): bool ns3::Object::AggregateIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## object.h (module 'core'): ns3::Ptr<const ns3::Object> ns3::Object::AggregateIterator::Next() [member function]
cls.add_method('Next',
'ns3::Ptr< ns3::Object const >',
[])
return
def register_Ns3PacketBurst_methods(root_module, cls):
## packet-burst.h (module 'network'): ns3::PacketBurst::PacketBurst(ns3::PacketBurst const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketBurst const &', 'arg0')])
## packet-burst.h (module 'network'): ns3::PacketBurst::PacketBurst() [constructor]
cls.add_constructor([])
## packet-burst.h (module 'network'): void ns3::PacketBurst::AddPacket(ns3::Ptr<ns3::Packet> packet) [member function]
cls.add_method('AddPacket',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet')])
## packet-burst.h (module 'network'): std::list<ns3::Ptr<ns3::Packet>, std::allocator<ns3::Ptr<ns3::Packet> > >::const_iterator ns3::PacketBurst::Begin() const [member function]
cls.add_method('Begin',
'std::list< ns3::Ptr< ns3::Packet > > const_iterator',
[],
is_const=True)
## packet-burst.h (module 'network'): ns3::Ptr<ns3::PacketBurst> ns3::PacketBurst::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::PacketBurst >',
[],
is_const=True)
## packet-burst.h (module 'network'): std::list<ns3::Ptr<ns3::Packet>, std::allocator<ns3::Ptr<ns3::Packet> > >::const_iterator ns3::PacketBurst::End() const [member function]
cls.add_method('End',
'std::list< ns3::Ptr< ns3::Packet > > const_iterator',
[],
is_const=True)
## packet-burst.h (module 'network'): uint32_t ns3::PacketBurst::GetNPackets() const [member function]
cls.add_method('GetNPackets',
'uint32_t',
[],
is_const=True)
## packet-burst.h (module 'network'): std::list<ns3::Ptr<ns3::Packet>, std::allocator<ns3::Ptr<ns3::Packet> > > ns3::PacketBurst::GetPackets() const [member function]
cls.add_method('GetPackets',
'std::list< ns3::Ptr< ns3::Packet > >',
[],
is_const=True)
## packet-burst.h (module 'network'): uint32_t ns3::PacketBurst::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## packet-burst.h (module 'network'): static ns3::TypeId ns3::PacketBurst::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-burst.h (module 'network'): void ns3::PacketBurst::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3PacketSocketTag_methods(root_module, cls):
## packet-socket.h (module 'network'): ns3::PacketSocketTag::PacketSocketTag(ns3::PacketSocketTag const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSocketTag const &', 'arg0')])
## packet-socket.h (module 'network'): ns3::PacketSocketTag::PacketSocketTag() [constructor]
cls.add_constructor([])
## packet-socket.h (module 'network'): void ns3::PacketSocketTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## packet-socket.h (module 'network'): ns3::Address ns3::PacketSocketTag::GetDestAddress() const [member function]
cls.add_method('GetDestAddress',
'ns3::Address',
[],
is_const=True)
## packet-socket.h (module 'network'): ns3::TypeId ns3::PacketSocketTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): ns3::NetDevice::PacketType ns3::PacketSocketTag::GetPacketType() const [member function]
cls.add_method('GetPacketType',
'ns3::NetDevice::PacketType',
[],
is_const=True)
## packet-socket.h (module 'network'): uint32_t ns3::PacketSocketTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): static ns3::TypeId ns3::PacketSocketTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-socket.h (module 'network'): void ns3::PacketSocketTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): void ns3::PacketSocketTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): void ns3::PacketSocketTag::SetDestAddress(ns3::Address a) [member function]
cls.add_method('SetDestAddress',
'void',
[param('ns3::Address', 'a')])
## packet-socket.h (module 'network'): void ns3::PacketSocketTag::SetPacketType(ns3::NetDevice::PacketType t) [member function]
cls.add_method('SetPacketType',
'void',
[param('ns3::NetDevice::PacketType', 't')])
return
def register_Ns3PcapFileWrapper_methods(root_module, cls):
## pcap-file-wrapper.h (module 'network'): static ns3::TypeId ns3::PcapFileWrapper::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper::PcapFileWrapper() [constructor]
cls.add_constructor([])
## pcap-file-wrapper.h (module 'network'): bool ns3::PcapFileWrapper::Fail() const [member function]
cls.add_method('Fail',
'bool',
[],
is_const=True)
## pcap-file-wrapper.h (module 'network'): bool ns3::PcapFileWrapper::Eof() const [member function]
cls.add_method('Eof',
'bool',
[],
is_const=True)
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Clear() [member function]
cls.add_method('Clear',
'void',
[])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Open(std::string const & filename, std::ios_base::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::ios_base::openmode', 'mode')])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Close() [member function]
cls.add_method('Close',
'void',
[])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Init(uint32_t dataLinkType, uint32_t snapLen=std::numeric_limits<unsigned int>::max(), int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function]
cls.add_method('Init',
'void',
[param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='std::numeric_limits<unsigned int>::max()'), param('int32_t', 'tzCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT')])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('Write',
'void',
[param('ns3::Time', 't'), param('ns3::Ptr< ns3::Packet const >', 'p')])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Header const & header, ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('Write',
'void',
[param('ns3::Time', 't'), param('ns3::Header const &', 'header'), param('ns3::Ptr< ns3::Packet const >', 'p')])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Write(ns3::Time t, uint8_t const * buffer, uint32_t length) [member function]
cls.add_method('Write',
'void',
[param('ns3::Time', 't'), param('uint8_t const *', 'buffer'), param('uint32_t', 'length')])
## pcap-file-wrapper.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::PcapFileWrapper::Read(ns3::Time & t) [member function]
cls.add_method('Read',
'ns3::Ptr< ns3::Packet >',
[param('ns3::Time &', 't')])
## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetMagic() [member function]
cls.add_method('GetMagic',
'uint32_t',
[])
## pcap-file-wrapper.h (module 'network'): uint16_t ns3::PcapFileWrapper::GetVersionMajor() [member function]
cls.add_method('GetVersionMajor',
'uint16_t',
[])
## pcap-file-wrapper.h (module 'network'): uint16_t ns3::PcapFileWrapper::GetVersionMinor() [member function]
cls.add_method('GetVersionMinor',
'uint16_t',
[])
## pcap-file-wrapper.h (module 'network'): int32_t ns3::PcapFileWrapper::GetTimeZoneOffset() [member function]
cls.add_method('GetTimeZoneOffset',
'int32_t',
[])
## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetSigFigs() [member function]
cls.add_method('GetSigFigs',
'uint32_t',
[])
## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetSnapLen() [member function]
cls.add_method('GetSnapLen',
'uint32_t',
[])
## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetDataLinkType() [member function]
cls.add_method('GetDataLinkType',
'uint32_t',
[])
return
def register_Ns3QueueBase_methods(root_module, cls):
## queue.h (module 'network'): ns3::QueueBase::QueueBase(ns3::QueueBase const & arg0) [constructor]
cls.add_constructor([param('ns3::QueueBase const &', 'arg0')])
## queue.h (module 'network'): ns3::QueueBase::QueueBase() [constructor]
cls.add_constructor([])
## queue.h (module 'network'): static void ns3::QueueBase::AppendItemTypeIfNotPresent(std::string & typeId, std::string const & itemType) [member function]
cls.add_method('AppendItemTypeIfNotPresent',
'void',
[param('std::string &', 'typeId'), param('std::string const &', 'itemType')],
is_static=True)
## queue.h (module 'network'): ns3::QueueSize ns3::QueueBase::GetCurrentSize() const [member function]
cls.add_method('GetCurrentSize',
'ns3::QueueSize',
[],
is_const=True)
## queue.h (module 'network'): ns3::QueueSize ns3::QueueBase::GetMaxSize() const [member function]
cls.add_method('GetMaxSize',
'ns3::QueueSize',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetNBytes() const [member function]
cls.add_method('GetNBytes',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetNPackets() const [member function]
cls.add_method('GetNPackets',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalDroppedBytes() const [member function]
cls.add_method('GetTotalDroppedBytes',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalDroppedBytesAfterDequeue() const [member function]
cls.add_method('GetTotalDroppedBytesAfterDequeue',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalDroppedBytesBeforeEnqueue() const [member function]
cls.add_method('GetTotalDroppedBytesBeforeEnqueue',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalDroppedPackets() const [member function]
cls.add_method('GetTotalDroppedPackets',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalDroppedPacketsAfterDequeue() const [member function]
cls.add_method('GetTotalDroppedPacketsAfterDequeue',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalDroppedPacketsBeforeEnqueue() const [member function]
cls.add_method('GetTotalDroppedPacketsBeforeEnqueue',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalReceivedBytes() const [member function]
cls.add_method('GetTotalReceivedBytes',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): uint32_t ns3::QueueBase::GetTotalReceivedPackets() const [member function]
cls.add_method('GetTotalReceivedPackets',
'uint32_t',
[],
is_const=True)
## queue.h (module 'network'): static ns3::TypeId ns3::QueueBase::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## queue.h (module 'network'): bool ns3::QueueBase::IsEmpty() const [member function]
cls.add_method('IsEmpty',
'bool',
[],
is_const=True)
## queue.h (module 'network'): void ns3::QueueBase::ResetStatistics() [member function]
cls.add_method('ResetStatistics',
'void',
[])
## queue.h (module 'network'): void ns3::QueueBase::SetMaxSize(ns3::QueueSize size) [member function]
cls.add_method('SetMaxSize',
'void',
[param('ns3::QueueSize', 'size')])
return
def register_Ns3QueueLimits_methods(root_module, cls):
## queue-limits.h (module 'network'): ns3::QueueLimits::QueueLimits() [constructor]
cls.add_constructor([])
## queue-limits.h (module 'network'): ns3::QueueLimits::QueueLimits(ns3::QueueLimits const & arg0) [constructor]
cls.add_constructor([param('ns3::QueueLimits const &', 'arg0')])
## queue-limits.h (module 'network'): int32_t ns3::QueueLimits::Available() const [member function]
cls.add_method('Available',
'int32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## queue-limits.h (module 'network'): void ns3::QueueLimits::Completed(uint32_t count) [member function]
cls.add_method('Completed',
'void',
[param('uint32_t', 'count')],
is_pure_virtual=True, is_virtual=True)
## queue-limits.h (module 'network'): static ns3::TypeId ns3::QueueLimits::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## queue-limits.h (module 'network'): void ns3::QueueLimits::Queued(uint32_t count) [member function]
cls.add_method('Queued',
'void',
[param('uint32_t', 'count')],
is_pure_virtual=True, is_virtual=True)
## queue-limits.h (module 'network'): void ns3::QueueLimits::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3RadiotapHeader_methods(root_module, cls):
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::RadiotapHeader(ns3::RadiotapHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::RadiotapHeader const &', 'arg0')])
## radiotap-header.h (module 'network'): ns3::RadiotapHeader::RadiotapHeader() [constructor]
cls.add_constructor([])
## radiotap-header.h (module 'network'): uint32_t ns3::RadiotapHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## radiotap-header.h (module 'network'): ns3::TypeId ns3::RadiotapHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## radiotap-header.h (module 'network'): uint32_t ns3::RadiotapHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## radiotap-header.h (module 'network'): static ns3::TypeId ns3::RadiotapHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetAmpduStatus(uint32_t referenceNumber, uint16_t flags, uint8_t crc) [member function]
cls.add_method('SetAmpduStatus',
'void',
[param('uint32_t', 'referenceNumber'), param('uint16_t', 'flags'), param('uint8_t', 'crc')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetAntennaNoisePower(double noise) [member function]
cls.add_method('SetAntennaNoisePower',
'void',
[param('double', 'noise')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetAntennaSignalPower(double signal) [member function]
cls.add_method('SetAntennaSignalPower',
'void',
[param('double', 'signal')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetChannelFrequencyAndFlags(uint16_t frequency, uint16_t flags) [member function]
cls.add_method('SetChannelFrequencyAndFlags',
'void',
[param('uint16_t', 'frequency'), param('uint16_t', 'flags')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetFrameFlags(uint8_t flags) [member function]
cls.add_method('SetFrameFlags',
'void',
[param('uint8_t', 'flags')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetHeFields(uint16_t data1, uint16_t data2, uint16_t data3, uint16_t data5) [member function]
cls.add_method('SetHeFields',
'void',
[param('uint16_t', 'data1'), param('uint16_t', 'data2'), param('uint16_t', 'data3'), param('uint16_t', 'data5')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetMcsFields(uint8_t known, uint8_t flags, uint8_t mcs) [member function]
cls.add_method('SetMcsFields',
'void',
[param('uint8_t', 'known'), param('uint8_t', 'flags'), param('uint8_t', 'mcs')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetRate(uint8_t rate) [member function]
cls.add_method('SetRate',
'void',
[param('uint8_t', 'rate')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetTsft(uint64_t tsft) [member function]
cls.add_method('SetTsft',
'void',
[param('uint64_t', 'tsft')])
## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetVhtFields(uint16_t known, uint8_t flags, uint8_t bandwidth, uint8_t * mcs_nss, uint8_t coding, uint8_t group_id, uint16_t partial_aid) [member function]
cls.add_method('SetVhtFields',
'void',
[param('uint16_t', 'known'), param('uint8_t', 'flags'), param('uint8_t', 'bandwidth'), param('uint8_t *', 'mcs_nss'), param('uint8_t', 'coding'), param('uint8_t', 'group_id'), param('uint16_t', 'partial_aid')])
return
def register_Ns3RandomVariableStream_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::RandomVariableStream::RandomVariableStream() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetStream(int64_t stream) [member function]
cls.add_method('SetStream',
'void',
[param('int64_t', 'stream')])
## random-variable-stream.h (module 'core'): int64_t ns3::RandomVariableStream::GetStream() const [member function]
cls.add_method('GetStream',
'int64_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetAntithetic(bool isAntithetic) [member function]
cls.add_method('SetAntithetic',
'void',
[param('bool', 'isAntithetic')])
## random-variable-stream.h (module 'core'): bool ns3::RandomVariableStream::IsAntithetic() const [member function]
cls.add_method('IsAntithetic',
'bool',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::RandomVariableStream::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_pure_virtual=True, is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::RandomVariableStream::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_pure_virtual=True, is_virtual=True)
## random-variable-stream.h (module 'core'): ns3::RngStream * ns3::RandomVariableStream::Peek() const [member function]
cls.add_method('Peek',
'ns3::RngStream *',
[],
is_const=True, visibility='protected')
return
def register_Ns3SequentialRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::SequentialRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable::SequentialRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): ns3::Ptr<ns3::RandomVariableStream> ns3::SequentialRandomVariable::GetIncrement() const [member function]
cls.add_method('GetIncrement',
'ns3::Ptr< ns3::RandomVariableStream >',
[],
is_const=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetConsecutive() const [member function]
cls.add_method('GetConsecutive',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter< ns3::AttributeAccessor > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter< ns3::AttributeChecker > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter< ns3::AttributeValue > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount(ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter< ns3::CallbackImplBase > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount(ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter< ns3::EventImpl > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter< ns3::Hash::Implementation > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3NetDeviceQueue_Ns3Empty_Ns3DefaultDeleter__lt__ns3NetDeviceQueue__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NetDeviceQueue, ns3::empty, ns3::DefaultDeleter<ns3::NetDeviceQueue> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NetDeviceQueue, ns3::empty, ns3::DefaultDeleter<ns3::NetDeviceQueue> >::SimpleRefCount(ns3::SimpleRefCount<ns3::NetDeviceQueue, ns3::empty, ns3::DefaultDeleter<ns3::NetDeviceQueue> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::NetDeviceQueue, ns3::empty, ns3::DefaultDeleter< ns3::NetDeviceQueue > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount(ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter< ns3::NixVector > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount(ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter< ns3::OutputStreamWrapper > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter< ns3::Packet > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3PbbAddressBlock_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbAddressBlock__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter< ns3::PbbAddressBlock > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3PbbMessage_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbMessage__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter< ns3::PbbMessage > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3PbbPacket_Ns3Header_Ns3DefaultDeleter__lt__ns3PbbPacket__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter< ns3::PbbPacket > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3PbbTlv_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbTlv__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter< ns3::PbbTlv > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3QueueItem_Ns3Empty_Ns3DefaultDeleter__lt__ns3QueueItem__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::QueueItem, ns3::empty, ns3::DefaultDeleter<ns3::QueueItem> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::QueueItem, ns3::empty, ns3::DefaultDeleter<ns3::QueueItem> >::SimpleRefCount(ns3::SimpleRefCount<ns3::QueueItem, ns3::empty, ns3::DefaultDeleter<ns3::QueueItem> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::QueueItem, ns3::empty, ns3::DefaultDeleter< ns3::QueueItem > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter< ns3::TraceSourceAccessor > > const &', 'o')])
return
def register_Ns3SllHeader_methods(root_module, cls):
## sll-header.h (module 'network'): ns3::SllHeader::SllHeader(ns3::SllHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::SllHeader const &', 'arg0')])
## sll-header.h (module 'network'): ns3::SllHeader::SllHeader() [constructor]
cls.add_constructor([])
## sll-header.h (module 'network'): uint32_t ns3::SllHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## sll-header.h (module 'network'): uint16_t ns3::SllHeader::GetArpType() const [member function]
cls.add_method('GetArpType',
'uint16_t',
[],
is_const=True)
## sll-header.h (module 'network'): ns3::TypeId ns3::SllHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## sll-header.h (module 'network'): ns3::SllHeader::PacketType ns3::SllHeader::GetPacketType() const [member function]
cls.add_method('GetPacketType',
'ns3::SllHeader::PacketType',
[],
is_const=True)
## sll-header.h (module 'network'): uint32_t ns3::SllHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## sll-header.h (module 'network'): static ns3::TypeId ns3::SllHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## sll-header.h (module 'network'): void ns3::SllHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## sll-header.h (module 'network'): void ns3::SllHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## sll-header.h (module 'network'): void ns3::SllHeader::SetArpType(uint16_t arphdType) [member function]
cls.add_method('SetArpType',
'void',
[param('uint16_t', 'arphdType')])
## sll-header.h (module 'network'): void ns3::SllHeader::SetPacketType(ns3::SllHeader::PacketType type) [member function]
cls.add_method('SetPacketType',
'void',
[param('ns3::SllHeader::PacketType', 'type')])
return
def register_Ns3Socket_methods(root_module, cls):
## socket.h (module 'network'): ns3::Socket::Socket(ns3::Socket const & arg0) [constructor]
cls.add_constructor([param('ns3::Socket const &', 'arg0')])
## socket.h (module 'network'): ns3::Socket::Socket() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): int ns3::Socket::Bind(ns3::Address const & address) [member function]
cls.add_method('Bind',
'int',
[param('ns3::Address const &', 'address')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Bind() [member function]
cls.add_method('Bind',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Bind6() [member function]
cls.add_method('Bind6',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::BindToNetDevice(ns3::Ptr<ns3::NetDevice> netdevice) [member function]
cls.add_method('BindToNetDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'netdevice')],
is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Close() [member function]
cls.add_method('Close',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Connect(ns3::Address const & address) [member function]
cls.add_method('Connect',
'int',
[param('ns3::Address const &', 'address')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): static ns3::Ptr<ns3::Socket> ns3::Socket::CreateSocket(ns3::Ptr<ns3::Node> node, ns3::TypeId tid) [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::TypeId', 'tid')],
is_static=True)
## socket.h (module 'network'): bool ns3::Socket::GetAllowBroadcast() const [member function]
cls.add_method('GetAllowBroadcast',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Socket::GetBoundNetDevice() [member function]
cls.add_method('GetBoundNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[])
## socket.h (module 'network'): ns3::Socket::SocketErrno ns3::Socket::GetErrno() const [member function]
cls.add_method('GetErrno',
'ns3::Socket::SocketErrno',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTos() const [member function]
cls.add_method('GetIpTos',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTtl() const [member function]
cls.add_method('GetIpTtl',
'uint8_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6HopLimit() const [member function]
cls.add_method('GetIpv6HopLimit',
'uint8_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6Tclass() const [member function]
cls.add_method('GetIpv6Tclass',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Node> ns3::Socket::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::GetPeerName(ns3::Address & address) const [member function]
cls.add_method('GetPeerName',
'int',
[param('ns3::Address &', 'address')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetPriority() const [member function]
cls.add_method('GetPriority',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint32_t ns3::Socket::GetRxAvailable() const [member function]
cls.add_method('GetRxAvailable',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::GetSockName(ns3::Address & address) const [member function]
cls.add_method('GetSockName',
'int',
[param('ns3::Address &', 'address')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): ns3::Socket::SocketType ns3::Socket::GetSocketType() const [member function]
cls.add_method('GetSocketType',
'ns3::Socket::SocketType',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::Socket::GetTxAvailable() const [member function]
cls.add_method('GetTxAvailable',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::Socket::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): static uint8_t ns3::Socket::IpTos2Priority(uint8_t ipTos) [member function]
cls.add_method('IpTos2Priority',
'uint8_t',
[param('uint8_t', 'ipTos')],
is_static=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6JoinGroup(ns3::Ipv6Address address, ns3::Socket::Ipv6MulticastFilterMode filterMode, std::vector<ns3::Ipv6Address, std::allocator<ns3::Ipv6Address> > sourceAddresses) [member function]
cls.add_method('Ipv6JoinGroup',
'void',
[param('ns3::Ipv6Address', 'address'), param('ns3::Socket::Ipv6MulticastFilterMode', 'filterMode'), param('std::vector< ns3::Ipv6Address >', 'sourceAddresses')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6JoinGroup(ns3::Ipv6Address address) [member function]
cls.add_method('Ipv6JoinGroup',
'void',
[param('ns3::Ipv6Address', 'address')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6LeaveGroup() [member function]
cls.add_method('Ipv6LeaveGroup',
'void',
[],
is_virtual=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTos() const [member function]
cls.add_method('IsIpRecvTos',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTtl() const [member function]
cls.add_method('IsIpRecvTtl',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvHopLimit() const [member function]
cls.add_method('IsIpv6RecvHopLimit',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvTclass() const [member function]
cls.add_method('IsIpv6RecvTclass',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
cls.add_method('IsRecvPktInfo',
'bool',
[],
is_const=True)
## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
cls.add_method('Listen',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv(uint32_t maxSize, uint32_t flags) [member function]
cls.add_method('Recv',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv() [member function]
cls.add_method('Recv',
'ns3::Ptr< ns3::Packet >',
[])
## socket.h (module 'network'): int ns3::Socket::Recv(uint8_t * buf, uint32_t size, uint32_t flags) [member function]
cls.add_method('Recv',
'int',
[param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')])
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'ns3::Ptr< ns3::Packet >',
[param('ns3::Address &', 'fromAddress')])
## socket.h (module 'network'): int ns3::Socket::RecvFrom(uint8_t * buf, uint32_t size, uint32_t flags, ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'int',
[param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')])
## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function]
cls.add_method('Send',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('Send',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## socket.h (module 'network'): int ns3::Socket::Send(uint8_t const * buf, uint32_t size, uint32_t flags) [member function]
cls.add_method('Send',
'int',
[param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')])
## socket.h (module 'network'): int ns3::Socket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & toAddress) [member function]
cls.add_method('SendTo',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::SendTo(uint8_t const * buf, uint32_t size, uint32_t flags, ns3::Address const & address) [member function]
cls.add_method('SendTo',
'int',
[param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address const &', 'address')])
## socket.h (module 'network'): void ns3::Socket::SetAcceptCallback(ns3::Callback<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionRequest, ns3::Callback<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> newConnectionCreated) [member function]
cls.add_method('SetAcceptCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionRequest'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'newConnectionCreated')])
## socket.h (module 'network'): bool ns3::Socket::SetAllowBroadcast(bool allowBroadcast) [member function]
cls.add_method('SetAllowBroadcast',
'bool',
[param('bool', 'allowBroadcast')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetCloseCallbacks(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> normalClose, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> errorClose) [member function]
cls.add_method('SetCloseCallbacks',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'normalClose'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'errorClose')])
## socket.h (module 'network'): void ns3::Socket::SetConnectCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionSucceeded, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionFailed) [member function]
cls.add_method('SetConnectCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionSucceeded'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionFailed')])
## socket.h (module 'network'): void ns3::Socket::SetDataSentCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> dataSent) [member function]
cls.add_method('SetDataSentCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataSent')])
## socket.h (module 'network'): void ns3::Socket::SetIpRecvTos(bool ipv4RecvTos) [member function]
cls.add_method('SetIpRecvTos',
'void',
[param('bool', 'ipv4RecvTos')])
## socket.h (module 'network'): void ns3::Socket::SetIpRecvTtl(bool ipv4RecvTtl) [member function]
cls.add_method('SetIpRecvTtl',
'void',
[param('bool', 'ipv4RecvTtl')])
## socket.h (module 'network'): void ns3::Socket::SetIpTos(uint8_t ipTos) [member function]
cls.add_method('SetIpTos',
'void',
[param('uint8_t', 'ipTos')])
## socket.h (module 'network'): void ns3::Socket::SetIpTtl(uint8_t ipTtl) [member function]
cls.add_method('SetIpTtl',
'void',
[param('uint8_t', 'ipTtl')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetIpv6HopLimit(uint8_t ipHopLimit) [member function]
cls.add_method('SetIpv6HopLimit',
'void',
[param('uint8_t', 'ipHopLimit')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvHopLimit(bool ipv6RecvHopLimit) [member function]
cls.add_method('SetIpv6RecvHopLimit',
'void',
[param('bool', 'ipv6RecvHopLimit')])
## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvTclass(bool ipv6RecvTclass) [member function]
cls.add_method('SetIpv6RecvTclass',
'void',
[param('bool', 'ipv6RecvTclass')])
## socket.h (module 'network'): void ns3::Socket::SetIpv6Tclass(int ipTclass) [member function]
cls.add_method('SetIpv6Tclass',
'void',
[param('int', 'ipTclass')])
## socket.h (module 'network'): void ns3::Socket::SetPriority(uint8_t priority) [member function]
cls.add_method('SetPriority',
'void',
[param('uint8_t', 'priority')])
## socket.h (module 'network'): void ns3::Socket::SetRecvCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arg0) [member function]
cls.add_method('SetRecvCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arg0')])
## socket.h (module 'network'): void ns3::Socket::SetRecvPktInfo(bool flag) [member function]
cls.add_method('SetRecvPktInfo',
'void',
[param('bool', 'flag')])
## socket.h (module 'network'): void ns3::Socket::SetSendCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> sendCb) [member function]
cls.add_method('SetSendCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'sendCb')])
## socket.h (module 'network'): int ns3::Socket::ShutdownRecv() [member function]
cls.add_method('ShutdownRecv',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::ShutdownSend() [member function]
cls.add_method('ShutdownSend',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## socket.h (module 'network'): bool ns3::Socket::IsManualIpTtl() const [member function]
cls.add_method('IsManualIpTtl',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6HopLimit() const [member function]
cls.add_method('IsManualIpv6HopLimit',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6Tclass() const [member function]
cls.add_method('IsManualIpv6Tclass',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyConnectionFailed() [member function]
cls.add_method('NotifyConnectionFailed',
'void',
[],
visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::NotifyConnectionRequest(ns3::Address const & from) [member function]
cls.add_method('NotifyConnectionRequest',
'bool',
[param('ns3::Address const &', 'from')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyConnectionSucceeded() [member function]
cls.add_method('NotifyConnectionSucceeded',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyDataRecv() [member function]
cls.add_method('NotifyDataRecv',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyDataSent(uint32_t size) [member function]
cls.add_method('NotifyDataSent',
'void',
[param('uint32_t', 'size')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyErrorClose() [member function]
cls.add_method('NotifyErrorClose',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyNewConnectionCreated(ns3::Ptr<ns3::Socket> socket, ns3::Address const & from) [member function]
cls.add_method('NotifyNewConnectionCreated',
'void',
[param('ns3::Ptr< ns3::Socket >', 'socket'), param('ns3::Address const &', 'from')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyNormalClose() [member function]
cls.add_method('NotifyNormalClose',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifySend(uint32_t spaceAvailable) [member function]
cls.add_method('NotifySend',
'void',
[param('uint32_t', 'spaceAvailable')],
visibility='protected')
return
def register_Ns3SocketFactory_methods(root_module, cls):
## socket-factory.h (module 'network'): ns3::SocketFactory::SocketFactory(ns3::SocketFactory const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketFactory const &', 'arg0')])
## socket-factory.h (module 'network'): ns3::SocketFactory::SocketFactory() [constructor]
cls.add_constructor([])
## socket-factory.h (module 'network'): ns3::Ptr<ns3::Socket> ns3::SocketFactory::CreateSocket() [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[],
is_pure_virtual=True, is_virtual=True)
## socket-factory.h (module 'network'): static ns3::TypeId ns3::SocketFactory::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
return
def register_Ns3SocketIpTosTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag(ns3::SocketIpTosTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpTosTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpTosTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTosTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpTosTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpTosTag::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTosTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
return
def register_Ns3SocketIpTtlTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag(ns3::SocketIpTtlTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpTtlTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTtlTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpTtlTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpTtlTag::GetTtl() const [member function]
cls.add_method('GetTtl',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTtlTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::SetTtl(uint8_t ttl) [member function]
cls.add_method('SetTtl',
'void',
[param('uint8_t', 'ttl')])
return
def register_Ns3SocketIpv6HopLimitTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag(ns3::SocketIpv6HopLimitTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpv6HopLimitTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpv6HopLimitTag::GetHopLimit() const [member function]
cls.add_method('GetHopLimit',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6HopLimitTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpv6HopLimitTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6HopLimitTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::SetHopLimit(uint8_t hopLimit) [member function]
cls.add_method('SetHopLimit',
'void',
[param('uint8_t', 'hopLimit')])
return
def register_Ns3SocketIpv6TclassTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag(ns3::SocketIpv6TclassTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpv6TclassTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6TclassTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpv6TclassTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpv6TclassTag::GetTclass() const [member function]
cls.add_method('GetTclass',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6TclassTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::SetTclass(uint8_t tclass) [member function]
cls.add_method('SetTclass',
'void',
[param('uint8_t', 'tclass')])
return
def register_Ns3SocketPriorityTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketPriorityTag::SocketPriorityTag(ns3::SocketPriorityTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketPriorityTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketPriorityTag::SocketPriorityTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketPriorityTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketPriorityTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketPriorityTag::GetPriority() const [member function]
cls.add_method('GetPriority',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint32_t ns3::SocketPriorityTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketPriorityTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::SetPriority(uint8_t priority) [member function]
cls.add_method('SetPriority',
'void',
[param('uint8_t', 'priority')])
return
def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Disable() [member function]
cls.add_method('Disable',
'void',
[])
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Enable() [member function]
cls.add_method('Enable',
'void',
[])
## socket.h (module 'network'): ns3::TypeId ns3::SocketSetDontFragmentTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketSetDontFragmentTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketSetDontFragmentTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): bool ns3::SocketSetDontFragmentTag::IsEnabled() const [member function]
cls.add_method('IsEnabled',
'bool',
[],
is_const=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('>=')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
cls.add_output_stream_operator()
## nstime.h (module 'core'): ns3::Time::Time() [constructor]
cls.add_constructor([])
## nstime.h (module 'core'): ns3::Time::Time(ns3::Time const & o) [constructor]
cls.add_constructor([param('ns3::Time const &', 'o')])
## nstime.h (module 'core'): ns3::Time::Time(double v) [constructor]
cls.add_constructor([param('double', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(int v) [constructor]
cls.add_constructor([param('int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long int v) [constructor]
cls.add_constructor([param('long int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long long int v) [constructor]
cls.add_constructor([param('long long int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(unsigned int v) [constructor]
cls.add_constructor([param('unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long unsigned int v) [constructor]
cls.add_constructor([param('long unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor]
cls.add_constructor([param('long long unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor]
cls.add_constructor([param('ns3::int64x64_t const &', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor]
cls.add_constructor([param('std::string const &', 's')])
## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function]
cls.add_method('As',
'ns3::TimeWithUnit',
[param('ns3::Time::Unit const', 'unit')],
is_const=True)
## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function]
cls.add_method('Compare',
'int',
[param('ns3::Time const &', 'o')],
is_const=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function]
cls.add_method('From',
'ns3::Time',
[param('ns3::int64x64_t const &', 'value')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function]
cls.add_method('From',
'ns3::Time',
[param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function]
cls.add_method('FromDouble',
'ns3::Time',
[param('double', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function]
cls.add_method('FromInteger',
'ns3::Time',
[param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function]
cls.add_method('GetDays',
'double',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetDouble() const [member function]
cls.add_method('GetDouble',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetFemtoSeconds() const [member function]
cls.add_method('GetFemtoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetHours() const [member function]
cls.add_method('GetHours',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetInteger() const [member function]
cls.add_method('GetInteger',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetMicroSeconds() const [member function]
cls.add_method('GetMicroSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetMilliSeconds() const [member function]
cls.add_method('GetMilliSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetMinutes() const [member function]
cls.add_method('GetMinutes',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetNanoSeconds() const [member function]
cls.add_method('GetNanoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetPicoSeconds() const [member function]
cls.add_method('GetPicoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): static ns3::Time::Unit ns3::Time::GetResolution() [member function]
cls.add_method('GetResolution',
'ns3::Time::Unit',
[],
is_static=True)
## nstime.h (module 'core'): double ns3::Time::GetSeconds() const [member function]
cls.add_method('GetSeconds',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetTimeStep() const [member function]
cls.add_method('GetTimeStep',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetYears() const [member function]
cls.add_method('GetYears',
'double',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsNegative() const [member function]
cls.add_method('IsNegative',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsPositive() const [member function]
cls.add_method('IsPositive',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsStrictlyNegative() const [member function]
cls.add_method('IsStrictlyNegative',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsStrictlyPositive() const [member function]
cls.add_method('IsStrictlyPositive',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsZero() const [member function]
cls.add_method('IsZero',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::Max() [member function]
cls.add_method('Max',
'ns3::Time',
[],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::Min() [member function]
cls.add_method('Min',
'ns3::Time',
[],
is_static=True)
## nstime.h (module 'core'): static void ns3::Time::SetResolution(ns3::Time::Unit resolution) [member function]
cls.add_method('SetResolution',
'void',
[param('ns3::Time::Unit', 'resolution')],
is_static=True)
## nstime.h (module 'core'): static bool ns3::Time::StaticInit() [member function]
cls.add_method('StaticInit',
'bool',
[],
is_static=True)
## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function]
cls.add_method('To',
'ns3::int64x64_t',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function]
cls.add_method('ToDouble',
'double',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function]
cls.add_method('ToInteger',
'int64_t',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor() [constructor]
cls.add_constructor([])
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Connect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]
cls.add_method('Connect',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]
cls.add_method('ConnectWithoutContext',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Disconnect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]
cls.add_method('Disconnect',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::DisconnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]
cls.add_method('DisconnectWithoutContext',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3Trailer_methods(root_module, cls):
cls.add_output_stream_operator()
## trailer.h (module 'network'): ns3::Trailer::Trailer() [constructor]
cls.add_constructor([])
## trailer.h (module 'network'): ns3::Trailer::Trailer(ns3::Trailer const & arg0) [constructor]
cls.add_constructor([param('ns3::Trailer const &', 'arg0')])
## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'end')],
is_pure_virtual=True, is_virtual=True)
## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')],
is_virtual=True)
## trailer.h (module 'network'): uint32_t ns3::Trailer::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trailer.h (module 'network'): static ns3::TypeId ns3::Trailer::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## trailer.h (module 'network'): void ns3::Trailer::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trailer.h (module 'network'): void ns3::Trailer::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3TriangularRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::TriangularRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable::TriangularRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue(double mean, double min, double max) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'min'), param('double', 'max')])
## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger(uint32_t mean, uint32_t min, uint32_t max) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'min'), param('uint32_t', 'max')])
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3UniformRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::UniformRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable::UniformRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue(double min, double max) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'min'), param('double', 'max')])
## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger(uint32_t min, uint32_t max) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'min'), param('uint32_t', 'max')])
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3WeibullRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::WeibullRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable::WeibullRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetScale() const [member function]
cls.add_method('GetScale',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetShape() const [member function]
cls.add_method('GetShape',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue(double scale, double shape, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'scale'), param('double', 'shape'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ZetaRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZetaRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable::ZetaRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue(double alpha) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'alpha')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger(uint32_t alpha) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'alpha')])
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ZipfRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZipfRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable::ZipfRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue(uint32_t n, double alpha) [member function]
cls.add_method('GetValue',
'double',
[param('uint32_t', 'n'), param('double', 'alpha')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger(uint32_t n, uint32_t alpha) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'n'), param('uint32_t', 'alpha')])
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3Application_methods(root_module, cls):
## application.h (module 'network'): ns3::Application::Application(ns3::Application const & arg0) [constructor]
cls.add_constructor([param('ns3::Application const &', 'arg0')])
## application.h (module 'network'): ns3::Application::Application() [constructor]
cls.add_constructor([])
## application.h (module 'network'): ns3::Ptr<ns3::Node> ns3::Application::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True)
## application.h (module 'network'): static ns3::TypeId ns3::Application::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## application.h (module 'network'): void ns3::Application::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## application.h (module 'network'): void ns3::Application::SetStartTime(ns3::Time start) [member function]
cls.add_method('SetStartTime',
'void',
[param('ns3::Time', 'start')])
## application.h (module 'network'): void ns3::Application::SetStopTime(ns3::Time stop) [member function]
cls.add_method('SetStopTime',
'void',
[param('ns3::Time', 'stop')])
## application.h (module 'network'): void ns3::Application::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## application.h (module 'network'): void ns3::Application::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
visibility='protected', is_virtual=True)
## application.h (module 'network'): void ns3::Application::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## application.h (module 'network'): void ns3::Application::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3AttributeAccessor_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::AttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function]
cls.add_method('Get',
'bool',
[param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasGetter() const [member function]
cls.add_method('HasGetter',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasSetter() const [member function]
cls.add_method('HasSetter',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function]
cls.add_method('Set',
'bool',
[param('ns3::ObjectBase *', 'object', transfer_ownership=False), param('ns3::AttributeValue const &', 'value')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3AttributeChecker_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker(ns3::AttributeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeChecker const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::AttributeChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::CreateValidValue(ns3::AttributeValue const & value) const [member function]
cls.add_method('CreateValidValue',
'ns3::Ptr< ns3::AttributeValue >',
[param('ns3::AttributeValue const &', 'value')],
is_const=True)
## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3AttributeValue_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue(ns3::AttributeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeValue const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::AttributeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3BooleanChecker_methods(root_module, cls):
## boolean.h (module 'core'): ns3::BooleanChecker::BooleanChecker() [constructor]
cls.add_constructor([])
## boolean.h (module 'core'): ns3::BooleanChecker::BooleanChecker(ns3::BooleanChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::BooleanChecker const &', 'arg0')])
return
def register_Ns3BooleanValue_methods(root_module, cls):
cls.add_output_stream_operator()
## boolean.h (module 'core'): ns3::BooleanValue::BooleanValue(ns3::BooleanValue const & arg0) [constructor]
cls.add_constructor([param('ns3::BooleanValue const &', 'arg0')])
## boolean.h (module 'core'): ns3::BooleanValue::BooleanValue() [constructor]
cls.add_constructor([])
## boolean.h (module 'core'): ns3::BooleanValue::BooleanValue(bool value) [constructor]
cls.add_constructor([param('bool', 'value')])
## boolean.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::BooleanValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## boolean.h (module 'core'): bool ns3::BooleanValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## boolean.h (module 'core'): bool ns3::BooleanValue::Get() const [member function]
cls.add_method('Get',
'bool',
[],
is_const=True)
## boolean.h (module 'core'): std::string ns3::BooleanValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## boolean.h (module 'core'): void ns3::BooleanValue::Set(bool value) [member function]
cls.add_method('Set',
'void',
[param('bool', 'value')])
return
def register_Ns3CallbackChecker_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker(ns3::CallbackChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackChecker const &', 'arg0')])
return
def register_Ns3CallbackImplBase_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase(ns3::CallbackImplBase const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImplBase const &', 'arg0')])
## callback.h (module 'core'): std::string ns3::CallbackImplBase::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImplBase::IsEqual(ns3::Ptr<const ns3::CallbackImplBase> other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ptr< ns3::CallbackImplBase const >', 'other')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::Demangle(std::string const & mangled) [member function]
cls.add_method('Demangle',
'std::string',
[param('std::string const &', 'mangled')],
is_static=True, visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::ObjectBase*'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'void'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'unsigned int'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Ptr<ns3::NetDevice> '])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Ptr<ns3::Packet const> '])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'unsigned short'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Address const&'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::NetDevice::PacketType'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Ptr<ns3::QueueDiscItem const> '])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Ptr<ns3::Socket> '])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'bool'])
return
def register_Ns3CallbackValue_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackValue const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackValue const &', 'arg0')])
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackBase const & base) [constructor]
cls.add_constructor([param('ns3::CallbackBase const &', 'base')])
## callback.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::CallbackValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## callback.h (module 'core'): std::string ns3::CallbackValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackValue::Set(ns3::CallbackBase base) [member function]
cls.add_method('Set',
'void',
[param('ns3::CallbackBase', 'base')])
return
def register_Ns3Channel_methods(root_module, cls):
## channel.h (module 'network'): ns3::Channel::Channel(ns3::Channel const & arg0) [constructor]
cls.add_constructor([param('ns3::Channel const &', 'arg0')])
## channel.h (module 'network'): ns3::Channel::Channel() [constructor]
cls.add_constructor([])
## channel.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Channel::GetDevice(std::size_t i) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('std::size_t', 'i')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## channel.h (module 'network'): uint32_t ns3::Channel::GetId() const [member function]
cls.add_method('GetId',
'uint32_t',
[],
is_const=True)
## channel.h (module 'network'): std::size_t ns3::Channel::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'std::size_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## channel.h (module 'network'): static ns3::TypeId ns3::Channel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
return
def register_Ns3ConstantRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable::ConstantRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetConstant() const [member function]
cls.add_method('GetConstant',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue(double constant) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'constant')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger(uint32_t constant) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'constant')])
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3DataCalculator_methods(root_module, cls):
## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [constructor]
cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')])
## data-calculator.h (module 'stats'): ns3::DataCalculator::DataCalculator() [constructor]
cls.add_constructor([])
## data-calculator.h (module 'stats'): void ns3::DataCalculator::Disable() [member function]
cls.add_method('Disable',
'void',
[])
## data-calculator.h (module 'stats'): void ns3::DataCalculator::Enable() [member function]
cls.add_method('Enable',
'void',
[])
## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetContext() const [member function]
cls.add_method('GetContext',
'std::string',
[],
is_const=True)
## data-calculator.h (module 'stats'): bool ns3::DataCalculator::GetEnabled() const [member function]
cls.add_method('GetEnabled',
'bool',
[],
is_const=True)
## data-calculator.h (module 'stats'): std::string ns3::DataCalculator::GetKey() const [member function]
cls.add_method('GetKey',
'std::string',
[],
is_const=True)
## data-calculator.h (module 'stats'): static ns3::TypeId ns3::DataCalculator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## data-calculator.h (module 'stats'): void ns3::DataCalculator::Output(ns3::DataOutputCallback & callback) const [member function]
cls.add_method('Output',
'void',
[param('ns3::DataOutputCallback &', 'callback')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetContext(std::string const context) [member function]
cls.add_method('SetContext',
'void',
[param('std::string const', 'context')])
## data-calculator.h (module 'stats'): void ns3::DataCalculator::SetKey(std::string const key) [member function]
cls.add_method('SetKey',
'void',
[param('std::string const', 'key')])
## data-calculator.h (module 'stats'): void ns3::DataCalculator::Start(ns3::Time const & startTime) [member function]
cls.add_method('Start',
'void',
[param('ns3::Time const &', 'startTime')],
is_virtual=True)
## data-calculator.h (module 'stats'): void ns3::DataCalculator::Stop(ns3::Time const & stopTime) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'stopTime')],
is_virtual=True)
## data-calculator.h (module 'stats'): void ns3::DataCalculator::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3DataCollectionObject_methods(root_module, cls):
## data-collection-object.h (module 'stats'): ns3::DataCollectionObject::DataCollectionObject(ns3::DataCollectionObject const & arg0) [constructor]
cls.add_constructor([param('ns3::DataCollectionObject const &', 'arg0')])
## data-collection-object.h (module 'stats'): ns3::DataCollectionObject::DataCollectionObject() [constructor]
cls.add_constructor([])
## data-collection-object.h (module 'stats'): void ns3::DataCollectionObject::Disable() [member function]
cls.add_method('Disable',
'void',
[])
## data-collection-object.h (module 'stats'): void ns3::DataCollectionObject::Enable() [member function]
cls.add_method('Enable',
'void',
[])
## data-collection-object.h (module 'stats'): std::string ns3::DataCollectionObject::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True)
## data-collection-object.h (module 'stats'): static ns3::TypeId ns3::DataCollectionObject::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## data-collection-object.h (module 'stats'): bool ns3::DataCollectionObject::IsEnabled() const [member function]
cls.add_method('IsEnabled',
'bool',
[],
is_const=True, is_virtual=True)
## data-collection-object.h (module 'stats'): void ns3::DataCollectionObject::SetName(std::string name) [member function]
cls.add_method('SetName',
'void',
[param('std::string', 'name')])
return
def register_Ns3DataOutputInterface_methods(root_module, cls):
## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [constructor]
cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')])
## data-output-interface.h (module 'stats'): ns3::DataOutputInterface::DataOutputInterface() [constructor]
cls.add_constructor([])
## data-output-interface.h (module 'stats'): std::string ns3::DataOutputInterface::GetFilePrefix() const [member function]
cls.add_method('GetFilePrefix',
'std::string',
[],
is_const=True)
## data-output-interface.h (module 'stats'): static ns3::TypeId ns3::DataOutputInterface::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function]
cls.add_method('Output',
'void',
[param('ns3::DataCollector &', 'dc')],
is_pure_virtual=True, is_virtual=True)
## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::SetFilePrefix(std::string const prefix) [member function]
cls.add_method('SetFilePrefix',
'void',
[param('std::string const', 'prefix')])
## data-output-interface.h (module 'stats'): void ns3::DataOutputInterface::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3DataRateChecker_methods(root_module, cls):
## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker() [constructor]
cls.add_constructor([])
## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker(ns3::DataRateChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::DataRateChecker const &', 'arg0')])
return
def register_Ns3DataRateValue_methods(root_module, cls):
## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue() [constructor]
cls.add_constructor([])
## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue(ns3::DataRate const & value) [constructor]
cls.add_constructor([param('ns3::DataRate const &', 'value')])
## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue(ns3::DataRateValue const & arg0) [constructor]
cls.add_constructor([param('ns3::DataRateValue const &', 'arg0')])
## data-rate.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::DataRateValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## data-rate.h (module 'network'): bool ns3::DataRateValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## data-rate.h (module 'network'): ns3::DataRate ns3::DataRateValue::Get() const [member function]
cls.add_method('Get',
'ns3::DataRate',
[],
is_const=True)
## data-rate.h (module 'network'): std::string ns3::DataRateValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## data-rate.h (module 'network'): void ns3::DataRateValue::Set(ns3::DataRate const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::DataRate const &', 'value')])
return
def register_Ns3DeterministicRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::DeterministicRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable::DeterministicRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::DeterministicRandomVariable::SetValueArray(double * values, std::size_t length) [member function]
cls.add_method('SetValueArray',
'void',
[param('double *', 'values'), param('std::size_t', 'length')])
## random-variable-stream.h (module 'core'): double ns3::DeterministicRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::DeterministicRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3DoubleValue_methods(root_module, cls):
## double.h (module 'core'): ns3::DoubleValue::DoubleValue() [constructor]
cls.add_constructor([])
## double.h (module 'core'): ns3::DoubleValue::DoubleValue(double const & value) [constructor]
cls.add_constructor([param('double const &', 'value')])
## double.h (module 'core'): ns3::DoubleValue::DoubleValue(ns3::DoubleValue const & arg0) [constructor]
cls.add_constructor([param('ns3::DoubleValue const &', 'arg0')])
## double.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::DoubleValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## double.h (module 'core'): bool ns3::DoubleValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## double.h (module 'core'): double ns3::DoubleValue::Get() const [member function]
cls.add_method('Get',
'double',
[],
is_const=True)
## double.h (module 'core'): std::string ns3::DoubleValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## double.h (module 'core'): void ns3::DoubleValue::Set(double const & value) [member function]
cls.add_method('Set',
'void',
[param('double const &', 'value')])
return
def register_Ns3DynamicQueueLimits_methods(root_module, cls):
## dynamic-queue-limits.h (module 'network'): ns3::DynamicQueueLimits::DynamicQueueLimits(ns3::DynamicQueueLimits const & arg0) [constructor]
cls.add_constructor([param('ns3::DynamicQueueLimits const &', 'arg0')])
## dynamic-queue-limits.h (module 'network'): ns3::DynamicQueueLimits::DynamicQueueLimits() [constructor]
cls.add_constructor([])
## dynamic-queue-limits.h (module 'network'): int32_t ns3::DynamicQueueLimits::Available() const [member function]
cls.add_method('Available',
'int32_t',
[],
is_const=True, is_virtual=True)
## dynamic-queue-limits.h (module 'network'): void ns3::DynamicQueueLimits::Completed(uint32_t count) [member function]
cls.add_method('Completed',
'void',
[param('uint32_t', 'count')],
is_virtual=True)
## dynamic-queue-limits.h (module 'network'): static ns3::TypeId ns3::DynamicQueueLimits::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dynamic-queue-limits.h (module 'network'): void ns3::DynamicQueueLimits::Queued(uint32_t count) [member function]
cls.add_method('Queued',
'void',
[param('uint32_t', 'count')],
is_virtual=True)
## dynamic-queue-limits.h (module 'network'): void ns3::DynamicQueueLimits::Reset() [member function]
cls.add_method('Reset',
'void',
[],
is_virtual=True)
return
def register_Ns3EmpiricalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable::EmpiricalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::CDF(double v, double c) [member function]
cls.add_method('CDF',
'void',
[param('double', 'v'), param('double', 'c')])
## random-variable-stream.h (module 'core'): uint32_t ns3::EmpiricalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::EmpiricalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::Interpolate(double c1, double c2, double v1, double v2, double r) [member function]
cls.add_method('Interpolate',
'double',
[param('double', 'c1'), param('double', 'c2'), param('double', 'v1'), param('double', 'v2'), param('double', 'r')],
visibility='private', is_virtual=True)
## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::Validate() [member function]
cls.add_method('Validate',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3EmptyAttributeAccessor_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor::EmptyAttributeAccessor(ns3::EmptyAttributeAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeAccessor const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor::EmptyAttributeAccessor() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function]
cls.add_method('Get',
'bool',
[param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::HasGetter() const [member function]
cls.add_method('HasGetter',
'bool',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::HasSetter() const [member function]
cls.add_method('HasSetter',
'bool',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function]
cls.add_method('Set',
'bool',
[param('ns3::ObjectBase *', 'object'), param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
return
def register_Ns3EmptyAttributeChecker_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeChecker::EmptyAttributeChecker(ns3::EmptyAttributeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeChecker const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeChecker::EmptyAttributeChecker() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_const=True, is_virtual=True)
return
def register_Ns3EmptyAttributeValue_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, visibility='private', is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
visibility='private', is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3EnumChecker_methods(root_module, cls):
## enum.h (module 'core'): ns3::EnumChecker::EnumChecker(ns3::EnumChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::EnumChecker const &', 'arg0')])
## enum.h (module 'core'): ns3::EnumChecker::EnumChecker() [constructor]
cls.add_constructor([])
## enum.h (module 'core'): void ns3::EnumChecker::Add(int value, std::string name) [member function]
cls.add_method('Add',
'void',
[param('int', 'value'), param('std::string', 'name')])
## enum.h (module 'core'): void ns3::EnumChecker::AddDefault(int value, std::string name) [member function]
cls.add_method('AddDefault',
'void',
[param('int', 'value'), param('std::string', 'name')])
## enum.h (module 'core'): bool ns3::EnumChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
## enum.h (module 'core'): bool ns3::EnumChecker::Copy(ns3::AttributeValue const & src, ns3::AttributeValue & dst) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'src'), param('ns3::AttributeValue &', 'dst')],
is_const=True, is_virtual=True)
## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): std::string ns3::EnumChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): std::string ns3::EnumChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): bool ns3::EnumChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_const=True, is_virtual=True)
return
def register_Ns3EnumValue_methods(root_module, cls):
## enum.h (module 'core'): ns3::EnumValue::EnumValue(ns3::EnumValue const & arg0) [constructor]
cls.add_constructor([param('ns3::EnumValue const &', 'arg0')])
## enum.h (module 'core'): ns3::EnumValue::EnumValue() [constructor]
cls.add_constructor([])
## enum.h (module 'core'): ns3::EnumValue::EnumValue(int value) [constructor]
cls.add_constructor([param('int', 'value')])
## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): bool ns3::EnumValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## enum.h (module 'core'): int ns3::EnumValue::Get() const [member function]
cls.add_method('Get',
'int',
[],
is_const=True)
## enum.h (module 'core'): std::string ns3::EnumValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## enum.h (module 'core'): void ns3::EnumValue::Set(int value) [member function]
cls.add_method('Set',
'void',
[param('int', 'value')])
return
def register_Ns3ErlangRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ErlangRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable::ErlangRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetK() const [member function]
cls.add_method('GetK',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetLambda() const [member function]
cls.add_method('GetLambda',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue(uint32_t k, double lambda) [member function]
cls.add_method('GetValue',
'double',
[param('uint32_t', 'k'), param('double', 'lambda')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger(uint32_t k, uint32_t lambda) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'k'), param('uint32_t', 'lambda')])
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ErrorModel_methods(root_module, cls):
## error-model.h (module 'network'): ns3::ErrorModel::ErrorModel(ns3::ErrorModel const & arg0) [constructor]
cls.add_constructor([param('ns3::ErrorModel const &', 'arg0')])
## error-model.h (module 'network'): ns3::ErrorModel::ErrorModel() [constructor]
cls.add_constructor([])
## error-model.h (module 'network'): void ns3::ErrorModel::Disable() [member function]
cls.add_method('Disable',
'void',
[])
## error-model.h (module 'network'): void ns3::ErrorModel::Enable() [member function]
cls.add_method('Enable',
'void',
[])
## error-model.h (module 'network'): static ns3::TypeId ns3::ErrorModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## error-model.h (module 'network'): bool ns3::ErrorModel::IsCorrupt(ns3::Ptr<ns3::Packet> pkt) [member function]
cls.add_method('IsCorrupt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'pkt')])
## error-model.h (module 'network'): bool ns3::ErrorModel::IsEnabled() const [member function]
cls.add_method('IsEnabled',
'bool',
[],
is_const=True)
## error-model.h (module 'network'): void ns3::ErrorModel::Reset() [member function]
cls.add_method('Reset',
'void',
[])
## error-model.h (module 'network'): bool ns3::ErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorrupt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
is_pure_virtual=True, visibility='private', is_virtual=True)
## error-model.h (module 'network'): void ns3::ErrorModel::DoReset() [member function]
cls.add_method('DoReset',
'void',
[],
is_pure_virtual=True, visibility='private', is_virtual=True)
return
def register_Ns3EthernetHeader_methods(root_module, cls):
## ethernet-header.h (module 'network'): ns3::EthernetHeader::EthernetHeader(ns3::EthernetHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::EthernetHeader const &', 'arg0')])
## ethernet-header.h (module 'network'): ns3::EthernetHeader::EthernetHeader(bool hasPreamble) [constructor]
cls.add_constructor([param('bool', 'hasPreamble')])
## ethernet-header.h (module 'network'): ns3::EthernetHeader::EthernetHeader() [constructor]
cls.add_constructor([])
## ethernet-header.h (module 'network'): uint32_t ns3::EthernetHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## ethernet-header.h (module 'network'): ns3::Mac48Address ns3::EthernetHeader::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Mac48Address',
[],
is_const=True)
## ethernet-header.h (module 'network'): uint32_t ns3::EthernetHeader::GetHeaderSize() const [member function]
cls.add_method('GetHeaderSize',
'uint32_t',
[],
is_const=True)
## ethernet-header.h (module 'network'): ns3::TypeId ns3::EthernetHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## ethernet-header.h (module 'network'): uint16_t ns3::EthernetHeader::GetLengthType() const [member function]
cls.add_method('GetLengthType',
'uint16_t',
[],
is_const=True)
## ethernet-header.h (module 'network'): ns3::ethernet_header_t ns3::EthernetHeader::GetPacketType() const [member function]
cls.add_method('GetPacketType',
'ns3::ethernet_header_t',
[],
is_const=True)
## ethernet-header.h (module 'network'): uint64_t ns3::EthernetHeader::GetPreambleSfd() const [member function]
cls.add_method('GetPreambleSfd',
'uint64_t',
[],
is_const=True)
## ethernet-header.h (module 'network'): uint32_t ns3::EthernetHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## ethernet-header.h (module 'network'): ns3::Mac48Address ns3::EthernetHeader::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Mac48Address',
[],
is_const=True)
## ethernet-header.h (module 'network'): static ns3::TypeId ns3::EthernetHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ethernet-header.h (module 'network'): void ns3::EthernetHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## ethernet-header.h (module 'network'): void ns3::EthernetHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetDestination(ns3::Mac48Address destination) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Mac48Address', 'destination')])
## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetLengthType(uint16_t size) [member function]
cls.add_method('SetLengthType',
'void',
[param('uint16_t', 'size')])
## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetPreambleSfd(uint64_t preambleSfd) [member function]
cls.add_method('SetPreambleSfd',
'void',
[param('uint64_t', 'preambleSfd')])
## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetSource(ns3::Mac48Address source) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Mac48Address', 'source')])
return
def register_Ns3EthernetTrailer_methods(root_module, cls):
## ethernet-trailer.h (module 'network'): ns3::EthernetTrailer::EthernetTrailer(ns3::EthernetTrailer const & arg0) [constructor]
cls.add_constructor([param('ns3::EthernetTrailer const &', 'arg0')])
## ethernet-trailer.h (module 'network'): ns3::EthernetTrailer::EthernetTrailer() [constructor]
cls.add_constructor([])
## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::CalcFcs(ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('CalcFcs',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'p')])
## ethernet-trailer.h (module 'network'): bool ns3::EthernetTrailer::CheckFcs(ns3::Ptr<const ns3::Packet> p) const [member function]
cls.add_method('CheckFcs',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p')],
is_const=True)
## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::Deserialize(ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'end')],
is_virtual=True)
## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::EnableFcs(bool enable) [member function]
cls.add_method('EnableFcs',
'void',
[param('bool', 'enable')])
## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::GetFcs() const [member function]
cls.add_method('GetFcs',
'uint32_t',
[],
is_const=True)
## ethernet-trailer.h (module 'network'): ns3::TypeId ns3::EthernetTrailer::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::GetTrailerSize() const [member function]
cls.add_method('GetTrailerSize',
'uint32_t',
[],
is_const=True)
## ethernet-trailer.h (module 'network'): static ns3::TypeId ns3::EthernetTrailer::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::Serialize(ns3::Buffer::Iterator end) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'end')],
is_const=True, is_virtual=True)
## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::SetFcs(uint32_t fcs) [member function]
cls.add_method('SetFcs',
'void',
[param('uint32_t', 'fcs')])
return
def register_Ns3EventImpl_methods(root_module, cls):
## event-impl.h (module 'core'): ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [constructor]
cls.add_constructor([param('ns3::EventImpl const &', 'arg0')])
## event-impl.h (module 'core'): ns3::EventImpl::EventImpl() [constructor]
cls.add_constructor([])
## event-impl.h (module 'core'): void ns3::EventImpl::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-impl.h (module 'core'): void ns3::EventImpl::Invoke() [member function]
cls.add_method('Invoke',
'void',
[])
## event-impl.h (module 'core'): bool ns3::EventImpl::IsCancelled() [member function]
cls.add_method('IsCancelled',
'bool',
[])
## event-impl.h (module 'core'): void ns3::EventImpl::Notify() [member function]
cls.add_method('Notify',
'void',
[],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3ExponentialRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ExponentialRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable::ExponentialRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue(double mean, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger(uint32_t mean, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3GammaRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::GammaRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable::GammaRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetBeta() const [member function]
cls.add_method('GetBeta',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue(double alpha, double beta) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'alpha'), param('double', 'beta')])
## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger(uint32_t alpha, uint32_t beta) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'alpha'), param('uint32_t', 'beta')])
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3IntegerValue_methods(root_module, cls):
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue() [constructor]
cls.add_constructor([])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(int64_t const & value) [constructor]
cls.add_constructor([param('int64_t const &', 'value')])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(ns3::IntegerValue const & arg0) [constructor]
cls.add_constructor([param('ns3::IntegerValue const &', 'arg0')])
## integer.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::IntegerValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## integer.h (module 'core'): bool ns3::IntegerValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## integer.h (module 'core'): int64_t ns3::IntegerValue::Get() const [member function]
cls.add_method('Get',
'int64_t',
[],
is_const=True)
## integer.h (module 'core'): std::string ns3::IntegerValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## integer.h (module 'core'): void ns3::IntegerValue::Set(int64_t const & value) [member function]
cls.add_method('Set',
'void',
[param('int64_t const &', 'value')])
return
def register_Ns3Ipv4AddressChecker_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker(ns3::Ipv4AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4AddressChecker const &', 'arg0')])
return
def register_Ns3Ipv4AddressValue_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4Address const & value) [constructor]
cls.add_constructor([param('ns3::Ipv4Address const &', 'value')])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4AddressValue const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-address.h (module 'network'): std::string ns3::Ipv4AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4AddressValue::Set(ns3::Ipv4Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv4Address const &', 'value')])
return
def register_Ns3Ipv4MaskChecker_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker(ns3::Ipv4MaskChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MaskChecker const &', 'arg0')])
return
def register_Ns3Ipv4MaskValue_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4Mask const & value) [constructor]
cls.add_constructor([param('ns3::Ipv4Mask const &', 'value')])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4MaskValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MaskValue const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4MaskValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4MaskValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Mask ns3::Ipv4MaskValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv4Mask',
[],
is_const=True)
## ipv4-address.h (module 'network'): std::string ns3::Ipv4MaskValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4MaskValue::Set(ns3::Ipv4Mask const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv4Mask const &', 'value')])
return
def register_Ns3Ipv6AddressChecker_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')])
return
def register_Ns3Ipv6AddressValue_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const &', 'value')])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')])
## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv6Address',
[],
is_const=True)
## ipv6-address.h (module 'network'): std::string ns3::Ipv6AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6AddressValue::Set(ns3::Ipv6Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv6Address const &', 'value')])
return
def register_Ns3Ipv6PrefixChecker_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')])
return
def register_Ns3Ipv6PrefixValue_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const &', 'value')])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')])
## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6PrefixValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6PrefixValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix ns3::Ipv6PrefixValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv6Prefix',
[],
is_const=True)
## ipv6-address.h (module 'network'): std::string ns3::Ipv6PrefixValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6PrefixValue::Set(ns3::Ipv6Prefix const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv6Prefix const &', 'value')])
return
def register_Ns3ListErrorModel_methods(root_module, cls):
## error-model.h (module 'network'): ns3::ListErrorModel::ListErrorModel(ns3::ListErrorModel const & arg0) [constructor]
cls.add_constructor([param('ns3::ListErrorModel const &', 'arg0')])
## error-model.h (module 'network'): ns3::ListErrorModel::ListErrorModel() [constructor]
cls.add_constructor([])
## error-model.h (module 'network'): std::list<unsigned int, std::allocator<unsigned int> > ns3::ListErrorModel::GetList() const [member function]
cls.add_method('GetList',
'std::list< unsigned int >',
[],
is_const=True)
## error-model.h (module 'network'): static ns3::TypeId ns3::ListErrorModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## error-model.h (module 'network'): void ns3::ListErrorModel::SetList(std::list<unsigned int, std::allocator<unsigned int> > const & packetlist) [member function]
cls.add_method('SetList',
'void',
[param('std::list< unsigned int > const &', 'packetlist')])
## error-model.h (module 'network'): bool ns3::ListErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorrupt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): void ns3::ListErrorModel::DoReset() [member function]
cls.add_method('DoReset',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3LogNormalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::LogNormalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable::LogNormalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetMu() const [member function]
cls.add_method('GetMu',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetSigma() const [member function]
cls.add_method('GetSigma',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue(double mu, double sigma) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mu'), param('double', 'sigma')])
## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger(uint32_t mu, uint32_t sigma) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mu'), param('uint32_t', 'sigma')])
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3Mac16AddressChecker_methods(root_module, cls):
## mac16-address.h (module 'network'): ns3::Mac16AddressChecker::Mac16AddressChecker() [constructor]
cls.add_constructor([])
## mac16-address.h (module 'network'): ns3::Mac16AddressChecker::Mac16AddressChecker(ns3::Mac16AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac16AddressChecker const &', 'arg0')])
return
def register_Ns3Mac16AddressValue_methods(root_module, cls):
## mac16-address.h (module 'network'): ns3::Mac16AddressValue::Mac16AddressValue() [constructor]
cls.add_constructor([])
## mac16-address.h (module 'network'): ns3::Mac16AddressValue::Mac16AddressValue(ns3::Mac16Address const & value) [constructor]
cls.add_constructor([param('ns3::Mac16Address const &', 'value')])
## mac16-address.h (module 'network'): ns3::Mac16AddressValue::Mac16AddressValue(ns3::Mac16AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac16AddressValue const &', 'arg0')])
## mac16-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Mac16AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## mac16-address.h (module 'network'): bool ns3::Mac16AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## mac16-address.h (module 'network'): ns3::Mac16Address ns3::Mac16AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Mac16Address',
[],
is_const=True)
## mac16-address.h (module 'network'): std::string ns3::Mac16AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## mac16-address.h (module 'network'): void ns3::Mac16AddressValue::Set(ns3::Mac16Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Mac16Address const &', 'value')])
return
def register_Ns3Mac48AddressChecker_methods(root_module, cls):
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker(ns3::Mac48AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48AddressChecker const &', 'arg0')])
return
def register_Ns3Mac48AddressValue_methods(root_module, cls):
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48Address const & value) [constructor]
cls.add_constructor([param('ns3::Mac48Address const &', 'value')])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48AddressValue const &', 'arg0')])
## mac48-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Mac48AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## mac48-address.h (module 'network'): bool ns3::Mac48AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## mac48-address.h (module 'network'): ns3::Mac48Address ns3::Mac48AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Mac48Address',
[],
is_const=True)
## mac48-address.h (module 'network'): std::string ns3::Mac48AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## mac48-address.h (module 'network'): void ns3::Mac48AddressValue::Set(ns3::Mac48Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Mac48Address const &', 'value')])
return
def register_Ns3Mac64AddressChecker_methods(root_module, cls):
## mac64-address.h (module 'network'): ns3::Mac64AddressChecker::Mac64AddressChecker() [constructor]
cls.add_constructor([])
## mac64-address.h (module 'network'): ns3::Mac64AddressChecker::Mac64AddressChecker(ns3::Mac64AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac64AddressChecker const &', 'arg0')])
return
def register_Ns3Mac64AddressValue_methods(root_module, cls):
## mac64-address.h (module 'network'): ns3::Mac64AddressValue::Mac64AddressValue() [constructor]
cls.add_constructor([])
## mac64-address.h (module 'network'): ns3::Mac64AddressValue::Mac64AddressValue(ns3::Mac64Address const & value) [constructor]
cls.add_constructor([param('ns3::Mac64Address const &', 'value')])
## mac64-address.h (module 'network'): ns3::Mac64AddressValue::Mac64AddressValue(ns3::Mac64AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac64AddressValue const &', 'arg0')])
## mac64-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Mac64AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## mac64-address.h (module 'network'): bool ns3::Mac64AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## mac64-address.h (module 'network'): ns3::Mac64Address ns3::Mac64AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Mac64Address',
[],
is_const=True)
## mac64-address.h (module 'network'): std::string ns3::Mac64AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## mac64-address.h (module 'network'): void ns3::Mac64AddressValue::Set(ns3::Mac64Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Mac64Address const &', 'value')])
return
def register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, cls):
## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<unsigned int>::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator<unsigned int> const & arg0) [constructor]
cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< unsigned int > const &', 'arg0')])
## basic-data-calculators.h (module 'stats'): ns3::MinMaxAvgTotalCalculator<unsigned int>::MinMaxAvgTotalCalculator() [constructor]
cls.add_constructor([])
## basic-data-calculators.h (module 'stats'): static ns3::TypeId ns3::MinMaxAvgTotalCalculator<unsigned int>::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::Output(ns3::DataOutputCallback & callback) const [member function]
cls.add_method('Output',
'void',
[param('ns3::DataOutputCallback &', 'callback')],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::Reset() [member function]
cls.add_method('Reset',
'void',
[])
## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::Update(unsigned int const i) [member function]
cls.add_method('Update',
'void',
[param('unsigned int const', 'i')])
## basic-data-calculators.h (module 'stats'): long int ns3::MinMaxAvgTotalCalculator<unsigned int>::getCount() const [member function]
cls.add_method('getCount',
'long int',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<unsigned int>::getMax() const [member function]
cls.add_method('getMax',
'double',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<unsigned int>::getMean() const [member function]
cls.add_method('getMean',
'double',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<unsigned int>::getMin() const [member function]
cls.add_method('getMin',
'double',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<unsigned int>::getSqrSum() const [member function]
cls.add_method('getSqrSum',
'double',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<unsigned int>::getStddev() const [member function]
cls.add_method('getStddev',
'double',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<unsigned int>::getSum() const [member function]
cls.add_method('getSum',
'double',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): double ns3::MinMaxAvgTotalCalculator<unsigned int>::getVariance() const [member function]
cls.add_method('getVariance',
'double',
[],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): void ns3::MinMaxAvgTotalCalculator<unsigned int>::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3NetDevice_methods(root_module, cls):
## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor]
cls.add_constructor([])
## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [constructor]
cls.add_constructor([param('ns3::NetDevice const &', 'arg0')])
## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('AddLinkChangeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Ptr<ns3::Channel> ns3::NetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): uint32_t ns3::NetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): uint16_t ns3::NetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): static ns3::TypeId ns3::NetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('Send',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetAddress(ns3::Address address) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Address', 'address')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetPromiscReceiveCallback(ns3::NetDevice::PromiscReceiveCallback cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
[param('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 >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetReceiveCallback(ns3::NetDevice::ReceiveCallback cb) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('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 >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3NetDeviceQueue_methods(root_module, cls):
## net-device-queue-interface.h (module 'network'): ns3::NetDeviceQueue::NetDeviceQueue() [constructor]
cls.add_constructor([])
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::Start() [member function]
cls.add_method('Start',
'void',
[],
is_virtual=True)
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::Stop() [member function]
cls.add_method('Stop',
'void',
[],
is_virtual=True)
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::Wake() [member function]
cls.add_method('Wake',
'void',
[],
is_virtual=True)
## net-device-queue-interface.h (module 'network'): bool ns3::NetDeviceQueue::IsStopped() const [member function]
cls.add_method('IsStopped',
'bool',
[],
is_const=True)
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::NotifyAggregatedObject(ns3::Ptr<ns3::NetDeviceQueueInterface> ndqi) [member function]
cls.add_method('NotifyAggregatedObject',
'void',
[param('ns3::Ptr< ns3::NetDeviceQueueInterface >', 'ndqi')])
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::SetWakeCallback(ns3::NetDeviceQueue::WakeCallback cb) [member function]
cls.add_method('SetWakeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::NotifyQueuedBytes(uint32_t bytes) [member function]
cls.add_method('NotifyQueuedBytes',
'void',
[param('uint32_t', 'bytes')])
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::NotifyTransmittedBytes(uint32_t bytes) [member function]
cls.add_method('NotifyTransmittedBytes',
'void',
[param('uint32_t', 'bytes')])
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::ResetQueueLimits() [member function]
cls.add_method('ResetQueueLimits',
'void',
[])
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueue::SetQueueLimits(ns3::Ptr<ns3::QueueLimits> ql) [member function]
cls.add_method('SetQueueLimits',
'void',
[param('ns3::Ptr< ns3::QueueLimits >', 'ql')])
## net-device-queue-interface.h (module 'network'): ns3::Ptr<ns3::QueueLimits> ns3::NetDeviceQueue::GetQueueLimits() [member function]
cls.add_method('GetQueueLimits',
'ns3::Ptr< ns3::QueueLimits >',
[])
## net-device-queue-interface.h (module 'network'): ns3::NetDeviceQueue::NetDeviceQueue(ns3::NetDeviceQueue const & arg0) [constructor]
cls.add_constructor([param('ns3::NetDeviceQueue const &', 'arg0')])
return
def register_Ns3NetDeviceQueueInterface_methods(root_module, cls):
## net-device-queue-interface.h (module 'network'): ns3::NetDeviceQueueInterface::NetDeviceQueueInterface(ns3::NetDeviceQueueInterface const & arg0) [constructor]
cls.add_constructor([param('ns3::NetDeviceQueueInterface const &', 'arg0')])
## net-device-queue-interface.h (module 'network'): ns3::NetDeviceQueueInterface::NetDeviceQueueInterface() [constructor]
cls.add_constructor([])
## net-device-queue-interface.h (module 'network'): std::size_t ns3::NetDeviceQueueInterface::GetNTxQueues() const [member function]
cls.add_method('GetNTxQueues',
'std::size_t',
[],
is_const=True)
## net-device-queue-interface.h (module 'network'): ns3::NetDeviceQueueInterface::SelectQueueCallback ns3::NetDeviceQueueInterface::GetSelectQueueCallback() const [member function]
cls.add_method('GetSelectQueueCallback',
'ns3::NetDeviceQueueInterface::SelectQueueCallback',
[],
is_const=True)
## net-device-queue-interface.h (module 'network'): ns3::Ptr<ns3::NetDeviceQueue> ns3::NetDeviceQueueInterface::GetTxQueue(std::size_t i) const [member function]
cls.add_method('GetTxQueue',
'ns3::Ptr< ns3::NetDeviceQueue >',
[param('std::size_t', 'i')],
is_const=True)
## net-device-queue-interface.h (module 'network'): static ns3::TypeId ns3::NetDeviceQueueInterface::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueueInterface::SetNTxQueues(std::size_t numTxQueues) [member function]
cls.add_method('SetNTxQueues',
'void',
[param('std::size_t', 'numTxQueues')])
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueueInterface::SetSelectQueueCallback(ns3::NetDeviceQueueInterface::SelectQueueCallback cb) [member function]
cls.add_method('SetSelectQueueCallback',
'void',
[param('std::function< unsigned long long ( ns3::Ptr< ns3::QueueItem > ) >', 'cb')])
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueueInterface::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## net-device-queue-interface.h (module 'network'): void ns3::NetDeviceQueueInterface::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3NixVector_methods(root_module, cls):
cls.add_output_stream_operator()
## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor]
cls.add_constructor([])
## nix-vector.h (module 'network'): ns3::NixVector::NixVector(ns3::NixVector const & o) [constructor]
cls.add_constructor([param('ns3::NixVector const &', 'o')])
## nix-vector.h (module 'network'): void ns3::NixVector::AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits) [member function]
cls.add_method('AddNeighborIndex',
'void',
[param('uint32_t', 'newBits'), param('uint32_t', 'numberOfBits')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::BitCount(uint32_t numberOfNeighbors) const [member function]
cls.add_method('BitCount',
'uint32_t',
[param('uint32_t', 'numberOfNeighbors')],
is_const=True)
## nix-vector.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::NixVector::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::NixVector >',
[],
is_const=True)
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Deserialize(uint32_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint32_t const *', 'buffer'), param('uint32_t', 'size')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::ExtractNeighborIndex(uint32_t numberOfBits) [member function]
cls.add_method('ExtractNeighborIndex',
'uint32_t',
[param('uint32_t', 'numberOfBits')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetRemainingBits() [member function]
cls.add_method('GetRemainingBits',
'uint32_t',
[])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Serialize(uint32_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint32_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3Node_methods(root_module, cls):
## node.h (module 'network'): ns3::Node::Node(ns3::Node const & arg0) [constructor]
cls.add_constructor([param('ns3::Node const &', 'arg0')])
## node.h (module 'network'): ns3::Node::Node() [constructor]
cls.add_constructor([])
## node.h (module 'network'): ns3::Node::Node(uint32_t systemId) [constructor]
cls.add_constructor([param('uint32_t', 'systemId')])
## node.h (module 'network'): uint32_t ns3::Node::AddApplication(ns3::Ptr<ns3::Application> application) [member function]
cls.add_method('AddApplication',
'uint32_t',
[param('ns3::Ptr< ns3::Application >', 'application')])
## node.h (module 'network'): uint32_t ns3::Node::AddDevice(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('AddDevice',
'uint32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')])
## node.h (module 'network'): static bool ns3::Node::ChecksumEnabled() [member function]
cls.add_method('ChecksumEnabled',
'bool',
[],
is_static=True)
## node.h (module 'network'): ns3::Ptr<ns3::Application> ns3::Node::GetApplication(uint32_t index) const [member function]
cls.add_method('GetApplication',
'ns3::Ptr< ns3::Application >',
[param('uint32_t', 'index')],
is_const=True)
## node.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Node::GetDevice(uint32_t index) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'index')],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetId() const [member function]
cls.add_method('GetId',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): ns3::Time ns3::Node::GetLocalTime() const [member function]
cls.add_method('GetLocalTime',
'ns3::Time',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetNApplications() const [member function]
cls.add_method('GetNApplications',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetSystemId() const [member function]
cls.add_method('GetSystemId',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): static ns3::TypeId ns3::Node::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## node.h (module 'network'): void ns3::Node::RegisterDeviceAdditionListener(ns3::Node::DeviceAdditionListener listener) [member function]
cls.add_method('RegisterDeviceAdditionListener',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')])
## node.h (module 'network'): void ns3::Node::RegisterProtocolHandler(ns3::Node::ProtocolHandler handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device, bool promiscuous=false) [member function]
cls.add_method('RegisterProtocolHandler',
'void',
[param('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 >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'promiscuous', default_value='false')])
## node.h (module 'network'): void ns3::Node::UnregisterDeviceAdditionListener(ns3::Node::DeviceAdditionListener listener) [member function]
cls.add_method('UnregisterDeviceAdditionListener',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')])
## node.h (module 'network'): void ns3::Node::UnregisterProtocolHandler(ns3::Node::ProtocolHandler handler) [member function]
cls.add_method('UnregisterProtocolHandler',
'void',
[param('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 >', 'handler')])
## node.h (module 'network'): void ns3::Node::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## node.h (module 'network'): void ns3::Node::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3NormalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::INFINITE_VALUE [variable]
cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True)
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::NormalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::NormalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetVariance() const [member function]
cls.add_method('GetVariance',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue(double mean, double variance, double bound=ns3::NormalRandomVariable::INFINITE_VALUE) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'variance'), param('double', 'bound', default_value='ns3::NormalRandomVariable::INFINITE_VALUE')])
## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger(uint32_t mean, uint32_t variance, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'variance'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ObjectFactoryChecker_methods(root_module, cls):
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker(ns3::ObjectFactoryChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactoryChecker const &', 'arg0')])
return
def register_Ns3ObjectFactoryValue_methods(root_module, cls):
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactory const & value) [constructor]
cls.add_constructor([param('ns3::ObjectFactory const &', 'value')])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactoryValue const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactoryValue const &', 'arg0')])
## object-factory.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::ObjectFactoryValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## object-factory.h (module 'core'): bool ns3::ObjectFactoryValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## object-factory.h (module 'core'): ns3::ObjectFactory ns3::ObjectFactoryValue::Get() const [member function]
cls.add_method('Get',
'ns3::ObjectFactory',
[],
is_const=True)
## object-factory.h (module 'core'): std::string ns3::ObjectFactoryValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## object-factory.h (module 'core'): void ns3::ObjectFactoryValue::Set(ns3::ObjectFactory const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::ObjectFactory const &', 'value')])
return
def register_Ns3OutputStreamWrapper_methods(root_module, cls):
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(ns3::OutputStreamWrapper const & arg0) [constructor]
cls.add_constructor([param('ns3::OutputStreamWrapper const &', 'arg0')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::ios_base::openmode filemode) [constructor]
cls.add_constructor([param('std::string', 'filename'), param('std::ios_base::openmode', 'filemode')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::ostream * os) [constructor]
cls.add_constructor([param('std::ostream *', 'os')])
## output-stream-wrapper.h (module 'network'): std::ostream * ns3::OutputStreamWrapper::GetStream() [member function]
cls.add_method('GetStream',
'std::ostream *',
[])
return
def register_Ns3Packet_methods(root_module, cls):
cls.add_output_stream_operator()
## packet.h (module 'network'): ns3::Packet::Packet() [constructor]
cls.add_constructor([])
## packet.h (module 'network'): ns3::Packet::Packet(ns3::Packet const & o) [constructor]
cls.add_constructor([param('ns3::Packet const &', 'o')])
## packet.h (module 'network'): ns3::Packet::Packet(uint32_t size) [constructor]
cls.add_constructor([param('uint32_t', 'size')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size, bool magic) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size'), param('bool', 'magic')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## packet.h (module 'network'): void ns3::Packet::AddByteTag(ns3::Tag const & tag) const [member function]
cls.add_method('AddByteTag',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::AddHeader(ns3::Header const & header) [member function]
cls.add_method('AddHeader',
'void',
[param('ns3::Header const &', 'header')])
## packet.h (module 'network'): void ns3::Packet::AddPacketTag(ns3::Tag const & tag) const [member function]
cls.add_method('AddPacketTag',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::AddPaddingAtEnd(uint32_t size) [member function]
cls.add_method('AddPaddingAtEnd',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddTrailer(ns3::Trailer const & trailer) [member function]
cls.add_method('AddTrailer',
'void',
[param('ns3::Trailer const &', 'trailer')])
## packet.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::Packet::BeginItem() const [member function]
cls.add_method('BeginItem',
'ns3::PacketMetadata::ItemIterator',
[],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::Packet >',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::CopyData(uint8_t * buffer, uint32_t size) const [member function]
cls.add_method('CopyData',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::CopyData(std::ostream * os, uint32_t size) const [member function]
cls.add_method('CopyData',
'void',
[param('std::ostream *', 'os'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::CreateFragment(uint32_t start, uint32_t length) const [member function]
cls.add_method('CreateFragment',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'start'), param('uint32_t', 'length')],
is_const=True)
## packet.h (module 'network'): static void ns3::Packet::EnableChecking() [member function]
cls.add_method('EnableChecking',
'void',
[],
is_static=True)
## packet.h (module 'network'): static void ns3::Packet::EnablePrinting() [member function]
cls.add_method('EnablePrinting',
'void',
[],
is_static=True)
## packet.h (module 'network'): bool ns3::Packet::FindFirstMatchingByteTag(ns3::Tag & tag) const [member function]
cls.add_method('FindFirstMatchingByteTag',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::ByteTagIterator ns3::Packet::GetByteTagIterator() const [member function]
cls.add_method('GetByteTagIterator',
'ns3::ByteTagIterator',
[],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::Packet::GetNixVector() const [member function]
cls.add_method('GetNixVector',
'ns3::Ptr< ns3::NixVector >',
[],
is_const=True)
## packet.h (module 'network'): ns3::PacketTagIterator ns3::Packet::GetPacketTagIterator() const [member function]
cls.add_method('GetPacketTagIterator',
'ns3::PacketTagIterator',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint64_t ns3::Packet::GetUid() const [member function]
cls.add_method('GetUid',
'uint64_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function]
cls.add_method('PeekHeader',
'uint32_t',
[param('ns3::Header &', 'header')],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header, uint32_t size) const [member function]
cls.add_method('PeekHeader',
'uint32_t',
[param('ns3::Header &', 'header'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): bool ns3::Packet::PeekPacketTag(ns3::Tag & tag) const [member function]
cls.add_method('PeekPacketTag',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekTrailer(ns3::Trailer & trailer) [member function]
cls.add_method('PeekTrailer',
'uint32_t',
[param('ns3::Trailer &', 'trailer')])
## packet.h (module 'network'): void ns3::Packet::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::PrintByteTags(std::ostream & os) const [member function]
cls.add_method('PrintByteTags',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::PrintPacketTags(std::ostream & os) const [member function]
cls.add_method('PrintPacketTags',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::RemoveAllByteTags() [member function]
cls.add_method('RemoveAllByteTags',
'void',
[])
## packet.h (module 'network'): void ns3::Packet::RemoveAllPacketTags() [member function]
cls.add_method('RemoveAllPacketTags',
'void',
[])
## packet.h (module 'network'): void ns3::Packet::RemoveAtEnd(uint32_t size) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::RemoveAtStart(uint32_t size) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header) [member function]
cls.add_method('RemoveHeader',
'uint32_t',
[param('ns3::Header &', 'header')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header, uint32_t size) [member function]
cls.add_method('RemoveHeader',
'uint32_t',
[param('ns3::Header &', 'header'), param('uint32_t', 'size')])
## packet.h (module 'network'): bool ns3::Packet::RemovePacketTag(ns3::Tag & tag) [member function]
cls.add_method('RemovePacketTag',
'bool',
[param('ns3::Tag &', 'tag')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveTrailer(ns3::Trailer & trailer) [member function]
cls.add_method('RemoveTrailer',
'uint32_t',
[param('ns3::Trailer &', 'trailer')])
## packet.h (module 'network'): bool ns3::Packet::ReplacePacketTag(ns3::Tag & tag) [member function]
cls.add_method('ReplacePacketTag',
'bool',
[param('ns3::Tag &', 'tag')])
## packet.h (module 'network'): uint32_t ns3::Packet::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> nixVector) [member function]
cls.add_method('SetNixVector',
'void',
[param('ns3::Ptr< ns3::NixVector >', 'nixVector')])
## packet.h (module 'network'): std::string ns3::Packet::ToString() const [member function]
cls.add_method('ToString',
'std::string',
[],
is_const=True)
return
def register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, cls):
## packet-data-calculators.h (module 'network'): ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator(ns3::PacketSizeMinMaxAvgTotalCalculator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSizeMinMaxAvgTotalCalculator const &', 'arg0')])
## packet-data-calculators.h (module 'network'): ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator() [constructor]
cls.add_constructor([])
## packet-data-calculators.h (module 'network'): void ns3::PacketSizeMinMaxAvgTotalCalculator::FrameUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address realto) [member function]
cls.add_method('FrameUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'realto')])
## packet-data-calculators.h (module 'network'): static ns3::TypeId ns3::PacketSizeMinMaxAvgTotalCalculator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-data-calculators.h (module 'network'): void ns3::PacketSizeMinMaxAvgTotalCalculator::PacketUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('PacketUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet')])
## packet-data-calculators.h (module 'network'): void ns3::PacketSizeMinMaxAvgTotalCalculator::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3PacketSocket_methods(root_module, cls):
## packet-socket.h (module 'network'): ns3::PacketSocket::PacketSocket(ns3::PacketSocket const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSocket const &', 'arg0')])
## packet-socket.h (module 'network'): ns3::PacketSocket::PacketSocket() [constructor]
cls.add_constructor([])
## packet-socket.h (module 'network'): int ns3::PacketSocket::Bind() [member function]
cls.add_method('Bind',
'int',
[],
is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::Bind(ns3::Address const & address) [member function]
cls.add_method('Bind',
'int',
[param('ns3::Address const &', 'address')],
is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::Bind6() [member function]
cls.add_method('Bind6',
'int',
[],
is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::Close() [member function]
cls.add_method('Close',
'int',
[],
is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::Connect(ns3::Address const & address) [member function]
cls.add_method('Connect',
'int',
[param('ns3::Address const &', 'address')],
is_virtual=True)
## packet-socket.h (module 'network'): bool ns3::PacketSocket::GetAllowBroadcast() const [member function]
cls.add_method('GetAllowBroadcast',
'bool',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): ns3::Socket::SocketErrno ns3::PacketSocket::GetErrno() const [member function]
cls.add_method('GetErrno',
'ns3::Socket::SocketErrno',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): ns3::Ptr<ns3::Node> ns3::PacketSocket::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::GetPeerName(ns3::Address & address) const [member function]
cls.add_method('GetPeerName',
'int',
[param('ns3::Address &', 'address')],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): uint32_t ns3::PacketSocket::GetRxAvailable() const [member function]
cls.add_method('GetRxAvailable',
'uint32_t',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::GetSockName(ns3::Address & address) const [member function]
cls.add_method('GetSockName',
'int',
[param('ns3::Address &', 'address')],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): ns3::Socket::SocketType ns3::PacketSocket::GetSocketType() const [member function]
cls.add_method('GetSocketType',
'ns3::Socket::SocketType',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): uint32_t ns3::PacketSocket::GetTxAvailable() const [member function]
cls.add_method('GetTxAvailable',
'uint32_t',
[],
is_const=True, is_virtual=True)
## packet-socket.h (module 'network'): static ns3::TypeId ns3::PacketSocket::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::Listen() [member function]
cls.add_method('Listen',
'int',
[],
is_virtual=True)
## packet-socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::PacketSocket::Recv(uint32_t maxSize, uint32_t flags) [member function]
cls.add_method('Recv',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags')],
is_virtual=True)
## packet-socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::PacketSocket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')],
is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function]
cls.add_method('Send',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')],
is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & toAddress) [member function]
cls.add_method('SendTo',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')],
is_virtual=True)
## packet-socket.h (module 'network'): bool ns3::PacketSocket::SetAllowBroadcast(bool allowBroadcast) [member function]
cls.add_method('SetAllowBroadcast',
'bool',
[param('bool', 'allowBroadcast')],
is_virtual=True)
## packet-socket.h (module 'network'): void ns3::PacketSocket::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## packet-socket.h (module 'network'): int ns3::PacketSocket::ShutdownRecv() [member function]
cls.add_method('ShutdownRecv',
'int',
[],
is_virtual=True)
## packet-socket.h (module 'network'): int ns3::PacketSocket::ShutdownSend() [member function]
cls.add_method('ShutdownSend',
'int',
[],
is_virtual=True)
## packet-socket.h (module 'network'): void ns3::PacketSocket::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3PacketSocketClient_methods(root_module, cls):
## packet-socket-client.h (module 'network'): ns3::PacketSocketClient::PacketSocketClient(ns3::PacketSocketClient const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSocketClient const &', 'arg0')])
## packet-socket-client.h (module 'network'): ns3::PacketSocketClient::PacketSocketClient() [constructor]
cls.add_constructor([])
## packet-socket-client.h (module 'network'): uint8_t ns3::PacketSocketClient::GetPriority() const [member function]
cls.add_method('GetPriority',
'uint8_t',
[],
is_const=True)
## packet-socket-client.h (module 'network'): static ns3::TypeId ns3::PacketSocketClient::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::SetRemote(ns3::PacketSocketAddress addr) [member function]
cls.add_method('SetRemote',
'void',
[param('ns3::PacketSocketAddress', 'addr')])
## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## packet-socket-client.h (module 'network'): void ns3::PacketSocketClient::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3PacketSocketFactory_methods(root_module, cls):
## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory::PacketSocketFactory(ns3::PacketSocketFactory const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSocketFactory const &', 'arg0')])
## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory::PacketSocketFactory() [constructor]
cls.add_constructor([])
## packet-socket-factory.h (module 'network'): ns3::Ptr<ns3::Socket> ns3::PacketSocketFactory::CreateSocket() [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[],
is_virtual=True)
## packet-socket-factory.h (module 'network'): static ns3::TypeId ns3::PacketSocketFactory::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
return
def register_Ns3PacketSocketServer_methods(root_module, cls):
## packet-socket-server.h (module 'network'): ns3::PacketSocketServer::PacketSocketServer(ns3::PacketSocketServer const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketSocketServer const &', 'arg0')])
## packet-socket-server.h (module 'network'): ns3::PacketSocketServer::PacketSocketServer() [constructor]
cls.add_constructor([])
## packet-socket-server.h (module 'network'): static ns3::TypeId ns3::PacketSocketServer::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::SetLocal(ns3::PacketSocketAddress addr) [member function]
cls.add_method('SetLocal',
'void',
[param('ns3::PacketSocketAddress', 'addr')])
## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::StartApplication() [member function]
cls.add_method('StartApplication',
'void',
[],
visibility='private', is_virtual=True)
## packet-socket-server.h (module 'network'): void ns3::PacketSocketServer::StopApplication() [member function]
cls.add_method('StopApplication',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable::ParetoRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
deprecated=True, is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetScale() const [member function]
cls.add_method('GetScale',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetShape() const [member function]
cls.add_method('GetShape',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue(double scale, double shape, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'scale'), param('double', 'shape'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3PbbAddressBlock_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## packetbb.h (module 'network'): ns3::PbbAddressBlock::PbbAddressBlock(ns3::PbbAddressBlock const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbAddressBlock const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::PbbAddressBlock() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlock::AddressBack() const [member function]
cls.add_method('AddressBack',
'ns3::Address',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::AddressIterator ns3::PbbAddressBlock::AddressBegin() [member function]
cls.add_method('AddressBegin',
'ns3::PbbAddressBlock::AddressIterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::ConstAddressIterator ns3::PbbAddressBlock::AddressBegin() const [member function]
cls.add_method('AddressBegin',
'ns3::PbbAddressBlock::ConstAddressIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressClear() [member function]
cls.add_method('AddressClear',
'void',
[])
## packetbb.h (module 'network'): bool ns3::PbbAddressBlock::AddressEmpty() const [member function]
cls.add_method('AddressEmpty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::AddressIterator ns3::PbbAddressBlock::AddressEnd() [member function]
cls.add_method('AddressEnd',
'ns3::PbbAddressBlock::AddressIterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::ConstAddressIterator ns3::PbbAddressBlock::AddressEnd() const [member function]
cls.add_method('AddressEnd',
'ns3::PbbAddressBlock::ConstAddressIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::AddressIterator ns3::PbbAddressBlock::AddressErase(ns3::PbbAddressBlock::AddressIterator position) [member function]
cls.add_method('AddressErase',
'ns3::PbbAddressBlock::AddressIterator',
[param('std::list< ns3::Address > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::AddressIterator ns3::PbbAddressBlock::AddressErase(ns3::PbbAddressBlock::AddressIterator first, ns3::PbbAddressBlock::AddressIterator last) [member function]
cls.add_method('AddressErase',
'ns3::PbbAddressBlock::AddressIterator',
[param('std::list< ns3::Address > iterator', 'first'), param('std::list< ns3::Address > iterator', 'last')])
## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlock::AddressFront() const [member function]
cls.add_method('AddressFront',
'ns3::Address',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::AddressIterator ns3::PbbAddressBlock::AddressInsert(ns3::PbbAddressBlock::AddressIterator position, ns3::Address const value) [member function]
cls.add_method('AddressInsert',
'ns3::PbbAddressBlock::AddressIterator',
[param('std::list< ns3::Address > iterator', 'position'), param('ns3::Address const', 'value')])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPopBack() [member function]
cls.add_method('AddressPopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPopFront() [member function]
cls.add_method('AddressPopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPushBack(ns3::Address address) [member function]
cls.add_method('AddressPushBack',
'void',
[param('ns3::Address', 'address')])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPushFront(ns3::Address address) [member function]
cls.add_method('AddressPushFront',
'void',
[param('ns3::Address', 'address')])
## packetbb.h (module 'network'): int ns3::PbbAddressBlock::AddressSize() const [member function]
cls.add_method('AddressSize',
'int',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Deserialize(ns3::Buffer::Iterator & start) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')])
## packetbb.h (module 'network'): uint32_t ns3::PbbAddressBlock::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlock::PrefixBack() const [member function]
cls.add_method('PrefixBack',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::PrefixIterator ns3::PbbAddressBlock::PrefixBegin() [member function]
cls.add_method('PrefixBegin',
'ns3::PbbAddressBlock::PrefixIterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::ConstPrefixIterator ns3::PbbAddressBlock::PrefixBegin() const [member function]
cls.add_method('PrefixBegin',
'ns3::PbbAddressBlock::ConstPrefixIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixClear() [member function]
cls.add_method('PrefixClear',
'void',
[])
## packetbb.h (module 'network'): bool ns3::PbbAddressBlock::PrefixEmpty() const [member function]
cls.add_method('PrefixEmpty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::PrefixIterator ns3::PbbAddressBlock::PrefixEnd() [member function]
cls.add_method('PrefixEnd',
'ns3::PbbAddressBlock::PrefixIterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::ConstPrefixIterator ns3::PbbAddressBlock::PrefixEnd() const [member function]
cls.add_method('PrefixEnd',
'ns3::PbbAddressBlock::ConstPrefixIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::PrefixIterator ns3::PbbAddressBlock::PrefixErase(ns3::PbbAddressBlock::PrefixIterator position) [member function]
cls.add_method('PrefixErase',
'ns3::PbbAddressBlock::PrefixIterator',
[param('std::list< unsigned char > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::PrefixIterator ns3::PbbAddressBlock::PrefixErase(ns3::PbbAddressBlock::PrefixIterator first, ns3::PbbAddressBlock::PrefixIterator last) [member function]
cls.add_method('PrefixErase',
'ns3::PbbAddressBlock::PrefixIterator',
[param('std::list< unsigned char > iterator', 'first'), param('std::list< unsigned char > iterator', 'last')])
## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlock::PrefixFront() const [member function]
cls.add_method('PrefixFront',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::PrefixIterator ns3::PbbAddressBlock::PrefixInsert(ns3::PbbAddressBlock::PrefixIterator position, uint8_t const value) [member function]
cls.add_method('PrefixInsert',
'ns3::PbbAddressBlock::PrefixIterator',
[param('std::list< unsigned char > iterator', 'position'), param('uint8_t const', 'value')])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPopBack() [member function]
cls.add_method('PrefixPopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPopFront() [member function]
cls.add_method('PrefixPopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPushBack(uint8_t prefix) [member function]
cls.add_method('PrefixPushBack',
'void',
[param('uint8_t', 'prefix')])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPushFront(uint8_t prefix) [member function]
cls.add_method('PrefixPushFront',
'void',
[param('uint8_t', 'prefix')])
## packetbb.h (module 'network'): int ns3::PbbAddressBlock::PrefixSize() const [member function]
cls.add_method('PrefixSize',
'int',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Print(std::ostream & os, int level) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os'), param('int', 'level')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Serialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True)
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressBlock::TlvBack() [member function]
cls.add_method('TlvBack',
'ns3::Ptr< ns3::PbbAddressTlv >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> const ns3::PbbAddressBlock::TlvBack() const [member function]
cls.add_method('TlvBack',
'ns3::Ptr< ns3::PbbAddressTlv > const',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::TlvIterator ns3::PbbAddressBlock::TlvBegin() [member function]
cls.add_method('TlvBegin',
'ns3::PbbAddressBlock::TlvIterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::ConstTlvIterator ns3::PbbAddressBlock::TlvBegin() const [member function]
cls.add_method('TlvBegin',
'ns3::PbbAddressBlock::ConstTlvIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvClear() [member function]
cls.add_method('TlvClear',
'void',
[])
## packetbb.h (module 'network'): bool ns3::PbbAddressBlock::TlvEmpty() const [member function]
cls.add_method('TlvEmpty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::TlvIterator ns3::PbbAddressBlock::TlvEnd() [member function]
cls.add_method('TlvEnd',
'ns3::PbbAddressBlock::TlvIterator',
[])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::ConstTlvIterator ns3::PbbAddressBlock::TlvEnd() const [member function]
cls.add_method('TlvEnd',
'ns3::PbbAddressBlock::ConstTlvIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::TlvIterator ns3::PbbAddressBlock::TlvErase(ns3::PbbAddressBlock::TlvIterator position) [member function]
cls.add_method('TlvErase',
'ns3::PbbAddressBlock::TlvIterator',
[param('ns3::PbbAddressTlvBlock::Iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbAddressBlock::TlvIterator ns3::PbbAddressBlock::TlvErase(ns3::PbbAddressBlock::TlvIterator first, ns3::PbbAddressBlock::TlvIterator last) [member function]
cls.add_method('TlvErase',
'ns3::PbbAddressBlock::TlvIterator',
[param('ns3::PbbAddressTlvBlock::Iterator', 'first'), param('ns3::PbbAddressTlvBlock::Iterator', 'last')])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressBlock::TlvFront() [member function]
cls.add_method('TlvFront',
'ns3::Ptr< ns3::PbbAddressTlv >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> const ns3::PbbAddressBlock::TlvFront() const [member function]
cls.add_method('TlvFront',
'ns3::Ptr< ns3::PbbAddressTlv > const',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbAddressBlock::TlvIterator ns3::PbbAddressBlock::TlvInsert(ns3::PbbAddressBlock::TlvIterator position, ns3::Ptr<ns3::PbbTlv> const value) [member function]
cls.add_method('TlvInsert',
'ns3::PbbAddressBlock::TlvIterator',
[param('ns3::PbbAddressTlvBlock::Iterator', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'value')])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPopBack() [member function]
cls.add_method('TlvPopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPopFront() [member function]
cls.add_method('TlvPopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPushBack(ns3::Ptr<ns3::PbbAddressTlv> address) [member function]
cls.add_method('TlvPushBack',
'void',
[param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')])
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPushFront(ns3::Ptr<ns3::PbbAddressTlv> address) [member function]
cls.add_method('TlvPushFront',
'void',
[param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')])
## packetbb.h (module 'network'): int ns3::PbbAddressBlock::TlvSize() const [member function]
cls.add_method('TlvSize',
'int',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlock::DeserializeAddress(uint8_t * buffer) const [member function]
cls.add_method('DeserializeAddress',
'ns3::Address',
[param('uint8_t *', 'buffer')],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlock::GetAddressLength() const [member function]
cls.add_method('GetAddressLength',
'uint8_t',
[],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrintAddress(std::ostream & os, ns3::PbbAddressBlock::ConstAddressIterator iter) const [member function]
cls.add_method('PrintAddress',
'void',
[param('std::ostream &', 'os'), param('std::list< ns3::Address > const_iterator', 'iter')],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlock::SerializeAddress(uint8_t * buffer, ns3::PbbAddressBlock::ConstAddressIterator iter) const [member function]
cls.add_method('SerializeAddress',
'void',
[param('uint8_t *', 'buffer'), param('std::list< ns3::Address > const_iterator', 'iter')],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
return
def register_Ns3PbbAddressBlockIpv4_methods(root_module, cls):
## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4(ns3::PbbAddressBlockIpv4 const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbAddressBlockIpv4 const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlockIpv4::DeserializeAddress(uint8_t * buffer) const [member function]
cls.add_method('DeserializeAddress',
'ns3::Address',
[param('uint8_t *', 'buffer')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlockIpv4::GetAddressLength() const [member function]
cls.add_method('GetAddressLength',
'uint8_t',
[],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv4::PrintAddress(std::ostream & os, ns3::PbbAddressBlock::ConstAddressIterator iter) const [member function]
cls.add_method('PrintAddress',
'void',
[param('std::ostream &', 'os'), param('std::list< ns3::Address > const_iterator', 'iter')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv4::SerializeAddress(uint8_t * buffer, ns3::PbbAddressBlock::ConstAddressIterator iter) const [member function]
cls.add_method('SerializeAddress',
'void',
[param('uint8_t *', 'buffer'), param('std::list< ns3::Address > const_iterator', 'iter')],
is_const=True, visibility='protected', is_virtual=True)
return
def register_Ns3PbbAddressBlockIpv6_methods(root_module, cls):
## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6(ns3::PbbAddressBlockIpv6 const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbAddressBlockIpv6 const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlockIpv6::DeserializeAddress(uint8_t * buffer) const [member function]
cls.add_method('DeserializeAddress',
'ns3::Address',
[param('uint8_t *', 'buffer')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlockIpv6::GetAddressLength() const [member function]
cls.add_method('GetAddressLength',
'uint8_t',
[],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv6::PrintAddress(std::ostream & os, ns3::PbbAddressBlock::ConstAddressIterator iter) const [member function]
cls.add_method('PrintAddress',
'void',
[param('std::ostream &', 'os'), param('std::list< ns3::Address > const_iterator', 'iter')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv6::SerializeAddress(uint8_t * buffer, ns3::PbbAddressBlock::ConstAddressIterator iter) const [member function]
cls.add_method('SerializeAddress',
'void',
[param('uint8_t *', 'buffer'), param('std::list< ns3::Address > const_iterator', 'iter')],
is_const=True, visibility='protected', is_virtual=True)
return
def register_Ns3PbbMessage_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## packetbb.h (module 'network'): ns3::PbbMessage::PbbMessage(ns3::PbbMessage const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbMessage const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbMessage::PbbMessage() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessage::AddressBlockBack() [member function]
cls.add_method('AddressBlockBack',
'ns3::Ptr< ns3::PbbAddressBlock >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> const ns3::PbbMessage::AddressBlockBack() const [member function]
cls.add_method('AddressBlockBack',
'ns3::Ptr< ns3::PbbAddressBlock > const',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbMessage::AddressBlockIterator ns3::PbbMessage::AddressBlockBegin() [member function]
cls.add_method('AddressBlockBegin',
'ns3::PbbMessage::AddressBlockIterator',
[])
## packetbb.h (module 'network'): ns3::PbbMessage::ConstAddressBlockIterator ns3::PbbMessage::AddressBlockBegin() const [member function]
cls.add_method('AddressBlockBegin',
'ns3::PbbMessage::ConstAddressBlockIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockClear() [member function]
cls.add_method('AddressBlockClear',
'void',
[])
## packetbb.h (module 'network'): bool ns3::PbbMessage::AddressBlockEmpty() const [member function]
cls.add_method('AddressBlockEmpty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbMessage::AddressBlockIterator ns3::PbbMessage::AddressBlockEnd() [member function]
cls.add_method('AddressBlockEnd',
'ns3::PbbMessage::AddressBlockIterator',
[])
## packetbb.h (module 'network'): ns3::PbbMessage::ConstAddressBlockIterator ns3::PbbMessage::AddressBlockEnd() const [member function]
cls.add_method('AddressBlockEnd',
'ns3::PbbMessage::ConstAddressBlockIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbMessage::AddressBlockIterator ns3::PbbMessage::AddressBlockErase(ns3::PbbMessage::AddressBlockIterator position) [member function]
cls.add_method('AddressBlockErase',
'ns3::PbbMessage::AddressBlockIterator',
[param('std::list< ns3::Ptr< ns3::PbbAddressBlock > > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbMessage::AddressBlockIterator ns3::PbbMessage::AddressBlockErase(ns3::PbbMessage::AddressBlockIterator first, ns3::PbbMessage::AddressBlockIterator last) [member function]
cls.add_method('AddressBlockErase',
'ns3::PbbMessage::AddressBlockIterator',
[param('std::list< ns3::Ptr< ns3::PbbAddressBlock > > iterator', 'first'), param('std::list< ns3::Ptr< ns3::PbbAddressBlock > > iterator', 'last')])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessage::AddressBlockFront() [member function]
cls.add_method('AddressBlockFront',
'ns3::Ptr< ns3::PbbAddressBlock >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> const ns3::PbbMessage::AddressBlockFront() const [member function]
cls.add_method('AddressBlockFront',
'ns3::Ptr< ns3::PbbAddressBlock > const',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPopBack() [member function]
cls.add_method('AddressBlockPopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPopFront() [member function]
cls.add_method('AddressBlockPopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPushBack(ns3::Ptr<ns3::PbbAddressBlock> block) [member function]
cls.add_method('AddressBlockPushBack',
'void',
[param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')])
## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPushFront(ns3::Ptr<ns3::PbbAddressBlock> block) [member function]
cls.add_method('AddressBlockPushFront',
'void',
[param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')])
## packetbb.h (module 'network'): int ns3::PbbMessage::AddressBlockSize() const [member function]
cls.add_method('AddressBlockSize',
'int',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::Deserialize(ns3::Buffer::Iterator & start) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')])
## packetbb.h (module 'network'): static ns3::Ptr<ns3::PbbMessage> ns3::PbbMessage::DeserializeMessage(ns3::Buffer::Iterator & start) [member function]
cls.add_method('DeserializeMessage',
'ns3::Ptr< ns3::PbbMessage >',
[param('ns3::Buffer::Iterator &', 'start')],
is_static=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbMessage::GetHopCount() const [member function]
cls.add_method('GetHopCount',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbMessage::GetHopLimit() const [member function]
cls.add_method('GetHopLimit',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::Address ns3::PbbMessage::GetOriginatorAddress() const [member function]
cls.add_method('GetOriginatorAddress',
'ns3::Address',
[],
is_const=True)
## packetbb.h (module 'network'): uint16_t ns3::PbbMessage::GetSequenceNumber() const [member function]
cls.add_method('GetSequenceNumber',
'uint16_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint32_t ns3::PbbMessage::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbMessage::GetType() const [member function]
cls.add_method('GetType',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbMessage::HasHopCount() const [member function]
cls.add_method('HasHopCount',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbMessage::HasHopLimit() const [member function]
cls.add_method('HasHopLimit',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbMessage::HasOriginatorAddress() const [member function]
cls.add_method('HasOriginatorAddress',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbMessage::HasSequenceNumber() const [member function]
cls.add_method('HasSequenceNumber',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::Print(std::ostream & os, int level) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os'), param('int', 'level')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::Serialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::SetHopCount(uint8_t hopcount) [member function]
cls.add_method('SetHopCount',
'void',
[param('uint8_t', 'hopcount')])
## packetbb.h (module 'network'): void ns3::PbbMessage::SetHopLimit(uint8_t hoplimit) [member function]
cls.add_method('SetHopLimit',
'void',
[param('uint8_t', 'hoplimit')])
## packetbb.h (module 'network'): void ns3::PbbMessage::SetOriginatorAddress(ns3::Address address) [member function]
cls.add_method('SetOriginatorAddress',
'void',
[param('ns3::Address', 'address')])
## packetbb.h (module 'network'): void ns3::PbbMessage::SetSequenceNumber(uint16_t seqnum) [member function]
cls.add_method('SetSequenceNumber',
'void',
[param('uint16_t', 'seqnum')])
## packetbb.h (module 'network'): void ns3::PbbMessage::SetType(uint8_t type) [member function]
cls.add_method('SetType',
'void',
[param('uint8_t', 'type')])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbMessage::TlvBack() [member function]
cls.add_method('TlvBack',
'ns3::Ptr< ns3::PbbTlv >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbMessage::TlvBack() const [member function]
cls.add_method('TlvBack',
'ns3::Ptr< ns3::PbbTlv > const',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbMessage::TlvIterator ns3::PbbMessage::TlvBegin() [member function]
cls.add_method('TlvBegin',
'ns3::PbbMessage::TlvIterator',
[])
## packetbb.h (module 'network'): ns3::PbbMessage::ConstTlvIterator ns3::PbbMessage::TlvBegin() const [member function]
cls.add_method('TlvBegin',
'ns3::PbbMessage::ConstTlvIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::TlvClear() [member function]
cls.add_method('TlvClear',
'void',
[])
## packetbb.h (module 'network'): bool ns3::PbbMessage::TlvEmpty() const [member function]
cls.add_method('TlvEmpty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbMessage::TlvIterator ns3::PbbMessage::TlvEnd() [member function]
cls.add_method('TlvEnd',
'ns3::PbbMessage::TlvIterator',
[])
## packetbb.h (module 'network'): ns3::PbbMessage::ConstTlvIterator ns3::PbbMessage::TlvEnd() const [member function]
cls.add_method('TlvEnd',
'ns3::PbbMessage::ConstTlvIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbMessage::TlvIterator ns3::PbbMessage::TlvErase(ns3::PbbMessage::TlvIterator position) [member function]
cls.add_method('TlvErase',
'ns3::PbbMessage::TlvIterator',
[param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbMessage::TlvIterator ns3::PbbMessage::TlvErase(ns3::PbbMessage::TlvIterator first, ns3::PbbMessage::TlvIterator last) [member function]
cls.add_method('TlvErase',
'ns3::PbbMessage::TlvIterator',
[param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'first'), param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'last')])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbMessage::TlvFront() [member function]
cls.add_method('TlvFront',
'ns3::Ptr< ns3::PbbTlv >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbMessage::TlvFront() const [member function]
cls.add_method('TlvFront',
'ns3::Ptr< ns3::PbbTlv > const',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPopBack() [member function]
cls.add_method('TlvPopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPopFront() [member function]
cls.add_method('TlvPopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPushBack(ns3::Ptr<ns3::PbbTlv> tlv) [member function]
cls.add_method('TlvPushBack',
'void',
[param('ns3::Ptr< ns3::PbbTlv >', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPushFront(ns3::Ptr<ns3::PbbTlv> tlv) [member function]
cls.add_method('TlvPushFront',
'void',
[param('ns3::Ptr< ns3::PbbTlv >', 'tlv')])
## packetbb.h (module 'network'): int ns3::PbbMessage::TlvSize() const [member function]
cls.add_method('TlvSize',
'int',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessage::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('AddressBlockDeserialize',
'ns3::Ptr< ns3::PbbAddressBlock >',
[param('ns3::Buffer::Iterator &', 'start')],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): ns3::Address ns3::PbbMessage::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('DeserializeOriginatorAddress',
'ns3::Address',
[param('ns3::Buffer::Iterator &', 'start')],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): ns3::PbbAddressLength ns3::PbbMessage::GetAddressLength() const [member function]
cls.add_method('GetAddressLength',
'ns3::PbbAddressLength',
[],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::PrintOriginatorAddress(std::ostream & os) const [member function]
cls.add_method('PrintOriginatorAddress',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbMessage::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('SerializeOriginatorAddress',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True)
return
def register_Ns3PbbMessageIpv4_methods(root_module, cls):
## packetbb.h (module 'network'): ns3::PbbMessageIpv4::PbbMessageIpv4(ns3::PbbMessageIpv4 const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbMessageIpv4 const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbMessageIpv4::PbbMessageIpv4() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessageIpv4::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('AddressBlockDeserialize',
'ns3::Ptr< ns3::PbbAddressBlock >',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): ns3::Address ns3::PbbMessageIpv4::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('DeserializeOriginatorAddress',
'ns3::Address',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): ns3::PbbAddressLength ns3::PbbMessageIpv4::GetAddressLength() const [member function]
cls.add_method('GetAddressLength',
'ns3::PbbAddressLength',
[],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbMessageIpv4::PrintOriginatorAddress(std::ostream & os) const [member function]
cls.add_method('PrintOriginatorAddress',
'void',
[param('std::ostream &', 'os')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbMessageIpv4::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('SerializeOriginatorAddress',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True, visibility='protected', is_virtual=True)
return
def register_Ns3PbbMessageIpv6_methods(root_module, cls):
## packetbb.h (module 'network'): ns3::PbbMessageIpv6::PbbMessageIpv6(ns3::PbbMessageIpv6 const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbMessageIpv6 const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbMessageIpv6::PbbMessageIpv6() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessageIpv6::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('AddressBlockDeserialize',
'ns3::Ptr< ns3::PbbAddressBlock >',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): ns3::Address ns3::PbbMessageIpv6::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('DeserializeOriginatorAddress',
'ns3::Address',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): ns3::PbbAddressLength ns3::PbbMessageIpv6::GetAddressLength() const [member function]
cls.add_method('GetAddressLength',
'ns3::PbbAddressLength',
[],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbMessageIpv6::PrintOriginatorAddress(std::ostream & os) const [member function]
cls.add_method('PrintOriginatorAddress',
'void',
[param('std::ostream &', 'os')],
is_const=True, visibility='protected', is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbMessageIpv6::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('SerializeOriginatorAddress',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True, visibility='protected', is_virtual=True)
return
def register_Ns3PbbPacket_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## packetbb.h (module 'network'): ns3::PbbPacket::PbbPacket(ns3::PbbPacket const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbPacket const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbPacket::PbbPacket() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): uint32_t ns3::PbbPacket::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## packetbb.h (module 'network'): ns3::PbbPacket::TlvIterator ns3::PbbPacket::Erase(ns3::PbbPacket::TlvIterator position) [member function]
cls.add_method('Erase',
'ns3::PbbPacket::TlvIterator',
[param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbPacket::TlvIterator ns3::PbbPacket::Erase(ns3::PbbPacket::TlvIterator first, ns3::PbbPacket::TlvIterator last) [member function]
cls.add_method('Erase',
'ns3::PbbPacket::TlvIterator',
[param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'first'), param('std::list< ns3::Ptr< ns3::PbbTlv > > iterator', 'last')])
## packetbb.h (module 'network'): ns3::PbbPacket::MessageIterator ns3::PbbPacket::Erase(ns3::PbbPacket::MessageIterator position) [member function]
cls.add_method('Erase',
'ns3::PbbPacket::MessageIterator',
[param('std::list< ns3::Ptr< ns3::PbbMessage > > iterator', 'position')])
## packetbb.h (module 'network'): ns3::PbbPacket::MessageIterator ns3::PbbPacket::Erase(ns3::PbbPacket::MessageIterator first, ns3::PbbPacket::MessageIterator last) [member function]
cls.add_method('Erase',
'ns3::PbbPacket::MessageIterator',
[param('std::list< ns3::Ptr< ns3::PbbMessage > > iterator', 'first'), param('std::list< ns3::Ptr< ns3::PbbMessage > > iterator', 'last')])
## packetbb.h (module 'network'): ns3::TypeId ns3::PbbPacket::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## packetbb.h (module 'network'): uint16_t ns3::PbbPacket::GetSequenceNumber() const [member function]
cls.add_method('GetSequenceNumber',
'uint16_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint32_t ns3::PbbPacket::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## packetbb.h (module 'network'): static ns3::TypeId ns3::PbbPacket::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbPacket::GetVersion() const [member function]
cls.add_method('GetVersion',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbPacket::HasSequenceNumber() const [member function]
cls.add_method('HasSequenceNumber',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> ns3::PbbPacket::MessageBack() [member function]
cls.add_method('MessageBack',
'ns3::Ptr< ns3::PbbMessage >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> const ns3::PbbPacket::MessageBack() const [member function]
cls.add_method('MessageBack',
'ns3::Ptr< ns3::PbbMessage > const',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbPacket::MessageIterator ns3::PbbPacket::MessageBegin() [member function]
cls.add_method('MessageBegin',
'ns3::PbbPacket::MessageIterator',
[])
## packetbb.h (module 'network'): ns3::PbbPacket::ConstMessageIterator ns3::PbbPacket::MessageBegin() const [member function]
cls.add_method('MessageBegin',
'ns3::PbbPacket::ConstMessageIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbPacket::MessageClear() [member function]
cls.add_method('MessageClear',
'void',
[])
## packetbb.h (module 'network'): bool ns3::PbbPacket::MessageEmpty() const [member function]
cls.add_method('MessageEmpty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbPacket::MessageIterator ns3::PbbPacket::MessageEnd() [member function]
cls.add_method('MessageEnd',
'ns3::PbbPacket::MessageIterator',
[])
## packetbb.h (module 'network'): ns3::PbbPacket::ConstMessageIterator ns3::PbbPacket::MessageEnd() const [member function]
cls.add_method('MessageEnd',
'ns3::PbbPacket::ConstMessageIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> ns3::PbbPacket::MessageFront() [member function]
cls.add_method('MessageFront',
'ns3::Ptr< ns3::PbbMessage >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> const ns3::PbbPacket::MessageFront() const [member function]
cls.add_method('MessageFront',
'ns3::Ptr< ns3::PbbMessage > const',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePopBack() [member function]
cls.add_method('MessagePopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePopFront() [member function]
cls.add_method('MessagePopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePushBack(ns3::Ptr<ns3::PbbMessage> message) [member function]
cls.add_method('MessagePushBack',
'void',
[param('ns3::Ptr< ns3::PbbMessage >', 'message')])
## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePushFront(ns3::Ptr<ns3::PbbMessage> message) [member function]
cls.add_method('MessagePushFront',
'void',
[param('ns3::Ptr< ns3::PbbMessage >', 'message')])
## packetbb.h (module 'network'): int ns3::PbbPacket::MessageSize() const [member function]
cls.add_method('MessageSize',
'int',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbPacket::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbPacket::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## packetbb.h (module 'network'): void ns3::PbbPacket::SetSequenceNumber(uint16_t number) [member function]
cls.add_method('SetSequenceNumber',
'void',
[param('uint16_t', 'number')])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbPacket::TlvBack() [member function]
cls.add_method('TlvBack',
'ns3::Ptr< ns3::PbbTlv >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbPacket::TlvBack() const [member function]
cls.add_method('TlvBack',
'ns3::Ptr< ns3::PbbTlv > const',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbPacket::TlvIterator ns3::PbbPacket::TlvBegin() [member function]
cls.add_method('TlvBegin',
'ns3::PbbPacket::TlvIterator',
[])
## packetbb.h (module 'network'): ns3::PbbPacket::ConstTlvIterator ns3::PbbPacket::TlvBegin() const [member function]
cls.add_method('TlvBegin',
'ns3::PbbPacket::ConstTlvIterator',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbPacket::TlvClear() [member function]
cls.add_method('TlvClear',
'void',
[])
## packetbb.h (module 'network'): bool ns3::PbbPacket::TlvEmpty() const [member function]
cls.add_method('TlvEmpty',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::PbbPacket::TlvIterator ns3::PbbPacket::TlvEnd() [member function]
cls.add_method('TlvEnd',
'ns3::PbbPacket::TlvIterator',
[])
## packetbb.h (module 'network'): ns3::PbbPacket::ConstTlvIterator ns3::PbbPacket::TlvEnd() const [member function]
cls.add_method('TlvEnd',
'ns3::PbbPacket::ConstTlvIterator',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbPacket::TlvFront() [member function]
cls.add_method('TlvFront',
'ns3::Ptr< ns3::PbbTlv >',
[])
## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbPacket::TlvFront() const [member function]
cls.add_method('TlvFront',
'ns3::Ptr< ns3::PbbTlv > const',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPopBack() [member function]
cls.add_method('TlvPopBack',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPopFront() [member function]
cls.add_method('TlvPopFront',
'void',
[])
## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPushBack(ns3::Ptr<ns3::PbbTlv> tlv) [member function]
cls.add_method('TlvPushBack',
'void',
[param('ns3::Ptr< ns3::PbbTlv >', 'tlv')])
## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPushFront(ns3::Ptr<ns3::PbbTlv> tlv) [member function]
cls.add_method('TlvPushFront',
'void',
[param('ns3::Ptr< ns3::PbbTlv >', 'tlv')])
## packetbb.h (module 'network'): int ns3::PbbPacket::TlvSize() const [member function]
cls.add_method('TlvSize',
'int',
[],
is_const=True)
return
def register_Ns3PbbTlv_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## packetbb.h (module 'network'): ns3::PbbTlv::PbbTlv(ns3::PbbTlv const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbTlv const &', 'arg0')])
## packetbb.h (module 'network'): ns3::PbbTlv::PbbTlv() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): void ns3::PbbTlv::Deserialize(ns3::Buffer::Iterator & start) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')])
## packetbb.h (module 'network'): uint32_t ns3::PbbTlv::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetType() const [member function]
cls.add_method('GetType',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetTypeExt() const [member function]
cls.add_method('GetTypeExt',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): ns3::Buffer ns3::PbbTlv::GetValue() const [member function]
cls.add_method('GetValue',
'ns3::Buffer',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbTlv::HasTypeExt() const [member function]
cls.add_method('HasTypeExt',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbTlv::HasValue() const [member function]
cls.add_method('HasValue',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbTlv::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbTlv::Print(std::ostream & os, int level) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os'), param('int', 'level')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbTlv::Serialize(ns3::Buffer::Iterator & start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator &', 'start')],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbTlv::SetType(uint8_t type) [member function]
cls.add_method('SetType',
'void',
[param('uint8_t', 'type')])
## packetbb.h (module 'network'): void ns3::PbbTlv::SetTypeExt(uint8_t type) [member function]
cls.add_method('SetTypeExt',
'void',
[param('uint8_t', 'type')])
## packetbb.h (module 'network'): void ns3::PbbTlv::SetValue(ns3::Buffer start) [member function]
cls.add_method('SetValue',
'void',
[param('ns3::Buffer', 'start')])
## packetbb.h (module 'network'): void ns3::PbbTlv::SetValue(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('SetValue',
'void',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetIndexStart() const [member function]
cls.add_method('GetIndexStart',
'uint8_t',
[],
is_const=True, visibility='protected')
## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetIndexStop() const [member function]
cls.add_method('GetIndexStop',
'uint8_t',
[],
is_const=True, visibility='protected')
## packetbb.h (module 'network'): bool ns3::PbbTlv::HasIndexStart() const [member function]
cls.add_method('HasIndexStart',
'bool',
[],
is_const=True, visibility='protected')
## packetbb.h (module 'network'): bool ns3::PbbTlv::HasIndexStop() const [member function]
cls.add_method('HasIndexStop',
'bool',
[],
is_const=True, visibility='protected')
## packetbb.h (module 'network'): bool ns3::PbbTlv::IsMultivalue() const [member function]
cls.add_method('IsMultivalue',
'bool',
[],
is_const=True, visibility='protected')
## packetbb.h (module 'network'): void ns3::PbbTlv::SetIndexStart(uint8_t index) [member function]
cls.add_method('SetIndexStart',
'void',
[param('uint8_t', 'index')],
visibility='protected')
## packetbb.h (module 'network'): void ns3::PbbTlv::SetIndexStop(uint8_t index) [member function]
cls.add_method('SetIndexStop',
'void',
[param('uint8_t', 'index')],
visibility='protected')
## packetbb.h (module 'network'): void ns3::PbbTlv::SetMultivalue(bool isMultivalue) [member function]
cls.add_method('SetMultivalue',
'void',
[param('bool', 'isMultivalue')],
visibility='protected')
return
def register_Ns3Probe_methods(root_module, cls):
## probe.h (module 'stats'): ns3::Probe::Probe(ns3::Probe const & arg0) [constructor]
cls.add_constructor([param('ns3::Probe const &', 'arg0')])
## probe.h (module 'stats'): ns3::Probe::Probe() [constructor]
cls.add_constructor([])
## probe.h (module 'stats'): bool ns3::Probe::ConnectByObject(std::string traceSource, ns3::Ptr<ns3::Object> obj) [member function]
cls.add_method('ConnectByObject',
'bool',
[param('std::string', 'traceSource'), param('ns3::Ptr< ns3::Object >', 'obj')],
is_pure_virtual=True, is_virtual=True)
## probe.h (module 'stats'): void ns3::Probe::ConnectByPath(std::string path) [member function]
cls.add_method('ConnectByPath',
'void',
[param('std::string', 'path')],
is_pure_virtual=True, is_virtual=True)
## probe.h (module 'stats'): static ns3::TypeId ns3::Probe::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## probe.h (module 'stats'): bool ns3::Probe::IsEnabled() const [member function]
cls.add_method('IsEnabled',
'bool',
[],
is_const=True, is_virtual=True)
return
def register_Ns3Queue__Ns3Packet_methods(root_module, cls):
## queue.h (module 'network'): static ns3::TypeId ns3::Queue<ns3::Packet>::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## queue.h (module 'network'): ns3::Queue<ns3::Packet>::Queue() [constructor]
cls.add_constructor([])
## queue.h (module 'network'): bool ns3::Queue<ns3::Packet>::Enqueue(ns3::Ptr<ns3::Packet> item) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'item')],
is_pure_virtual=True, is_virtual=True)
## queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Queue<ns3::Packet>::Dequeue() [member function]
cls.add_method('Dequeue',
'ns3::Ptr< ns3::Packet >',
[],
is_pure_virtual=True, is_virtual=True)
## queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Queue<ns3::Packet>::Remove() [member function]
cls.add_method('Remove',
'ns3::Ptr< ns3::Packet >',
[],
is_pure_virtual=True, is_virtual=True)
## queue.h (module 'network'): ns3::Ptr<const ns3::Packet> ns3::Queue<ns3::Packet>::Peek() const [member function]
cls.add_method('Peek',
'ns3::Ptr< ns3::Packet const >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## queue.h (module 'network'): void ns3::Queue<ns3::Packet>::Flush() [member function]
cls.add_method('Flush',
'void',
[])
## queue.h (module 'network'): ns3::Queue<ns3::Packet>::Queue(ns3::Queue<ns3::Packet> const & arg0) [constructor]
cls.add_constructor([param('ns3::Queue< ns3::Packet > const &', 'arg0')])
## queue.h (module 'network'): ns3::Queue<ns3::Packet>::ConstIterator ns3::Queue<ns3::Packet>::Head() const [member function]
cls.add_method('Head',
'ns3::Queue< ns3::Packet > ConstIterator',
[],
is_const=True, visibility='protected')
## queue.h (module 'network'): ns3::Queue<ns3::Packet>::ConstIterator ns3::Queue<ns3::Packet>::Tail() const [member function]
cls.add_method('Tail',
'ns3::Queue< ns3::Packet > ConstIterator',
[],
is_const=True, visibility='protected')
## queue.h (module 'network'): bool ns3::Queue<ns3::Packet>::DoEnqueue(ns3::Queue<ns3::Packet>::ConstIterator pos, ns3::Ptr<ns3::Packet> item) [member function]
cls.add_method('DoEnqueue',
'bool',
[param('std::list< ns3::Ptr< ns3::Packet > > const_iterator', 'pos'), param('ns3::Ptr< ns3::Packet >', 'item')],
visibility='protected')
## queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Queue<ns3::Packet>::DoDequeue(ns3::Queue<ns3::Packet>::ConstIterator pos) [member function]
cls.add_method('DoDequeue',
'ns3::Ptr< ns3::Packet >',
[param('std::list< ns3::Ptr< ns3::Packet > > const_iterator', 'pos')],
visibility='protected')
## queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Queue<ns3::Packet>::DoRemove(ns3::Queue<ns3::Packet>::ConstIterator pos) [member function]
cls.add_method('DoRemove',
'ns3::Ptr< ns3::Packet >',
[param('std::list< ns3::Ptr< ns3::Packet > > const_iterator', 'pos')],
visibility='protected')
## queue.h (module 'network'): ns3::Ptr<const ns3::Packet> ns3::Queue<ns3::Packet>::DoPeek(ns3::Queue<ns3::Packet>::ConstIterator pos) const [member function]
cls.add_method('DoPeek',
'ns3::Ptr< ns3::Packet const >',
[param('std::list< ns3::Ptr< ns3::Packet > > const_iterator', 'pos')],
is_const=True, visibility='protected')
## queue.h (module 'network'): void ns3::Queue<ns3::Packet>::DropBeforeEnqueue(ns3::Ptr<ns3::Packet> item) [member function]
cls.add_method('DropBeforeEnqueue',
'void',
[param('ns3::Ptr< ns3::Packet >', 'item')],
visibility='protected')
## queue.h (module 'network'): void ns3::Queue<ns3::Packet>::DropAfterDequeue(ns3::Ptr<ns3::Packet> item) [member function]
cls.add_method('DropAfterDequeue',
'void',
[param('ns3::Ptr< ns3::Packet >', 'item')],
visibility='protected')
return
def register_Ns3Queue__Ns3QueueDiscItem_methods(root_module, cls):
## queue.h (module 'network'): static ns3::TypeId ns3::Queue<ns3::QueueDiscItem>::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## queue.h (module 'network'): ns3::Queue<ns3::QueueDiscItem>::Queue() [constructor]
cls.add_constructor([])
## queue.h (module 'network'): bool ns3::Queue<ns3::QueueDiscItem>::Enqueue(ns3::Ptr<ns3::QueueDiscItem> item) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::Ptr< ns3::QueueDiscItem >', 'item')],
is_pure_virtual=True, is_virtual=True)
## queue.h (module 'network'): ns3::Ptr<ns3::QueueDiscItem> ns3::Queue<ns3::QueueDiscItem>::Dequeue() [member function]
cls.add_method('Dequeue',
'ns3::Ptr< ns3::QueueDiscItem >',
[],
is_pure_virtual=True, is_virtual=True)
## queue.h (module 'network'): ns3::Ptr<ns3::QueueDiscItem> ns3::Queue<ns3::QueueDiscItem>::Remove() [member function]
cls.add_method('Remove',
'ns3::Ptr< ns3::QueueDiscItem >',
[],
is_pure_virtual=True, is_virtual=True)
## queue.h (module 'network'): ns3::Ptr<const ns3::QueueDiscItem> ns3::Queue<ns3::QueueDiscItem>::Peek() const [member function]
cls.add_method('Peek',
'ns3::Ptr< ns3::QueueDiscItem const >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## queue.h (module 'network'): void ns3::Queue<ns3::QueueDiscItem>::Flush() [member function]
cls.add_method('Flush',
'void',
[])
## queue.h (module 'network'): ns3::Queue<ns3::QueueDiscItem>::Queue(ns3::Queue<ns3::QueueDiscItem> const & arg0) [constructor]
cls.add_constructor([param('ns3::Queue< ns3::QueueDiscItem > const &', 'arg0')])
## queue.h (module 'network'): ns3::Queue<ns3::QueueDiscItem>::ConstIterator ns3::Queue<ns3::QueueDiscItem>::Head() const [member function]
cls.add_method('Head',
'ns3::Queue< ns3::QueueDiscItem > ConstIterator',
[],
is_const=True, visibility='protected')
## queue.h (module 'network'): ns3::Queue<ns3::QueueDiscItem>::ConstIterator ns3::Queue<ns3::QueueDiscItem>::Tail() const [member function]
cls.add_method('Tail',
'ns3::Queue< ns3::QueueDiscItem > ConstIterator',
[],
is_const=True, visibility='protected')
## queue.h (module 'network'): bool ns3::Queue<ns3::QueueDiscItem>::DoEnqueue(ns3::Queue<ns3::QueueDiscItem>::ConstIterator pos, ns3::Ptr<ns3::QueueDiscItem> item) [member function]
cls.add_method('DoEnqueue',
'bool',
[param('std::list< ns3::Ptr< ns3::QueueDiscItem > > const_iterator', 'pos'), param('ns3::Ptr< ns3::QueueDiscItem >', 'item')],
visibility='protected')
## queue.h (module 'network'): ns3::Ptr<ns3::QueueDiscItem> ns3::Queue<ns3::QueueDiscItem>::DoDequeue(ns3::Queue<ns3::QueueDiscItem>::ConstIterator pos) [member function]
cls.add_method('DoDequeue',
'ns3::Ptr< ns3::QueueDiscItem >',
[param('std::list< ns3::Ptr< ns3::QueueDiscItem > > const_iterator', 'pos')],
visibility='protected')
## queue.h (module 'network'): ns3::Ptr<ns3::QueueDiscItem> ns3::Queue<ns3::QueueDiscItem>::DoRemove(ns3::Queue<ns3::QueueDiscItem>::ConstIterator pos) [member function]
cls.add_method('DoRemove',
'ns3::Ptr< ns3::QueueDiscItem >',
[param('std::list< ns3::Ptr< ns3::QueueDiscItem > > const_iterator', 'pos')],
visibility='protected')
## queue.h (module 'network'): ns3::Ptr<const ns3::QueueDiscItem> ns3::Queue<ns3::QueueDiscItem>::DoPeek(ns3::Queue<ns3::QueueDiscItem>::ConstIterator pos) const [member function]
cls.add_method('DoPeek',
'ns3::Ptr< ns3::QueueDiscItem const >',
[param('std::list< ns3::Ptr< ns3::QueueDiscItem > > const_iterator', 'pos')],
is_const=True, visibility='protected')
## queue.h (module 'network'): void ns3::Queue<ns3::QueueDiscItem>::DropBeforeEnqueue(ns3::Ptr<ns3::QueueDiscItem> item) [member function]
cls.add_method('DropBeforeEnqueue',
'void',
[param('ns3::Ptr< ns3::QueueDiscItem >', 'item')],
visibility='protected')
## queue.h (module 'network'): void ns3::Queue<ns3::QueueDiscItem>::DropAfterDequeue(ns3::Ptr<ns3::QueueDiscItem> item) [member function]
cls.add_method('DropAfterDequeue',
'void',
[param('ns3::Ptr< ns3::QueueDiscItem >', 'item')],
visibility='protected')
return
def register_Ns3QueueItem_methods(root_module, cls):
cls.add_output_stream_operator()
## queue-item.h (module 'network'): ns3::QueueItem::QueueItem(ns3::Ptr<ns3::Packet> p) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Packet >', 'p')])
## queue-item.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::QueueItem::GetPacket() const [member function]
cls.add_method('GetPacket',
'ns3::Ptr< ns3::Packet >',
[],
is_const=True)
## queue-item.h (module 'network'): uint32_t ns3::QueueItem::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## queue-item.h (module 'network'): bool ns3::QueueItem::GetUint8Value(ns3::QueueItem::Uint8Values field, uint8_t & value) const [member function]
cls.add_method('GetUint8Value',
'bool',
[param('ns3::QueueItem::Uint8Values', 'field'), param('uint8_t &', 'value')],
is_const=True, is_virtual=True)
## queue-item.h (module 'network'): void ns3::QueueItem::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
return
def register_Ns3QueueSizeChecker_methods(root_module, cls):
## queue-size.h (module 'network'): ns3::QueueSizeChecker::QueueSizeChecker() [constructor]
cls.add_constructor([])
## queue-size.h (module 'network'): ns3::QueueSizeChecker::QueueSizeChecker(ns3::QueueSizeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::QueueSizeChecker const &', 'arg0')])
return
def register_Ns3QueueSizeValue_methods(root_module, cls):
## queue-size.h (module 'network'): ns3::QueueSizeValue::QueueSizeValue() [constructor]
cls.add_constructor([])
## queue-size.h (module 'network'): ns3::QueueSizeValue::QueueSizeValue(ns3::QueueSize const & value) [constructor]
cls.add_constructor([param('ns3::QueueSize const &', 'value')])
## queue-size.h (module 'network'): ns3::QueueSizeValue::QueueSizeValue(ns3::QueueSizeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::QueueSizeValue const &', 'arg0')])
## queue-size.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::QueueSizeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## queue-size.h (module 'network'): bool ns3::QueueSizeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## queue-size.h (module 'network'): ns3::QueueSize ns3::QueueSizeValue::Get() const [member function]
cls.add_method('Get',
'ns3::QueueSize',
[],
is_const=True)
## queue-size.h (module 'network'): std::string ns3::QueueSizeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## queue-size.h (module 'network'): void ns3::QueueSizeValue::Set(ns3::QueueSize const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::QueueSize const &', 'value')])
return
def register_Ns3RateErrorModel_methods(root_module, cls):
## error-model.h (module 'network'): ns3::RateErrorModel::RateErrorModel(ns3::RateErrorModel const & arg0) [constructor]
cls.add_constructor([param('ns3::RateErrorModel const &', 'arg0')])
## error-model.h (module 'network'): ns3::RateErrorModel::RateErrorModel() [constructor]
cls.add_constructor([])
## error-model.h (module 'network'): int64_t ns3::RateErrorModel::AssignStreams(int64_t stream) [member function]
cls.add_method('AssignStreams',
'int64_t',
[param('int64_t', 'stream')])
## error-model.h (module 'network'): double ns3::RateErrorModel::GetRate() const [member function]
cls.add_method('GetRate',
'double',
[],
is_const=True)
## error-model.h (module 'network'): static ns3::TypeId ns3::RateErrorModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## error-model.h (module 'network'): ns3::RateErrorModel::ErrorUnit ns3::RateErrorModel::GetUnit() const [member function]
cls.add_method('GetUnit',
'ns3::RateErrorModel::ErrorUnit',
[],
is_const=True)
## error-model.h (module 'network'): void ns3::RateErrorModel::SetRandomVariable(ns3::Ptr<ns3::RandomVariableStream> arg0) [member function]
cls.add_method('SetRandomVariable',
'void',
[param('ns3::Ptr< ns3::RandomVariableStream >', 'arg0')])
## error-model.h (module 'network'): void ns3::RateErrorModel::SetRate(double rate) [member function]
cls.add_method('SetRate',
'void',
[param('double', 'rate')])
## error-model.h (module 'network'): void ns3::RateErrorModel::SetUnit(ns3::RateErrorModel::ErrorUnit error_unit) [member function]
cls.add_method('SetUnit',
'void',
[param('ns3::RateErrorModel::ErrorUnit', 'error_unit')])
## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorrupt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorruptBit(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorruptBit',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorruptByte(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorruptByte',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorruptPkt(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorruptPkt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): void ns3::RateErrorModel::DoReset() [member function]
cls.add_method('DoReset',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3ReceiveListErrorModel_methods(root_module, cls):
## error-model.h (module 'network'): ns3::ReceiveListErrorModel::ReceiveListErrorModel(ns3::ReceiveListErrorModel const & arg0) [constructor]
cls.add_constructor([param('ns3::ReceiveListErrorModel const &', 'arg0')])
## error-model.h (module 'network'): ns3::ReceiveListErrorModel::ReceiveListErrorModel() [constructor]
cls.add_constructor([])
## error-model.h (module 'network'): std::list<unsigned int, std::allocator<unsigned int> > ns3::ReceiveListErrorModel::GetList() const [member function]
cls.add_method('GetList',
'std::list< unsigned int >',
[],
is_const=True)
## error-model.h (module 'network'): static ns3::TypeId ns3::ReceiveListErrorModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## error-model.h (module 'network'): void ns3::ReceiveListErrorModel::SetList(std::list<unsigned int, std::allocator<unsigned int> > const & packetlist) [member function]
cls.add_method('SetList',
'void',
[param('std::list< unsigned int > const &', 'packetlist')])
## error-model.h (module 'network'): bool ns3::ReceiveListErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorrupt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): void ns3::ReceiveListErrorModel::DoReset() [member function]
cls.add_method('DoReset',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3SimpleChannel_methods(root_module, cls):
## simple-channel.h (module 'network'): ns3::SimpleChannel::SimpleChannel(ns3::SimpleChannel const & arg0) [constructor]
cls.add_constructor([param('ns3::SimpleChannel const &', 'arg0')])
## simple-channel.h (module 'network'): ns3::SimpleChannel::SimpleChannel() [constructor]
cls.add_constructor([])
## simple-channel.h (module 'network'): void ns3::SimpleChannel::Add(ns3::Ptr<ns3::SimpleNetDevice> device) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::SimpleNetDevice >', 'device')],
is_virtual=True)
## simple-channel.h (module 'network'): void ns3::SimpleChannel::BlackList(ns3::Ptr<ns3::SimpleNetDevice> from, ns3::Ptr<ns3::SimpleNetDevice> to) [member function]
cls.add_method('BlackList',
'void',
[param('ns3::Ptr< ns3::SimpleNetDevice >', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'to')],
is_virtual=True)
## simple-channel.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::SimpleChannel::GetDevice(std::size_t i) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('std::size_t', 'i')],
is_const=True, is_virtual=True)
## simple-channel.h (module 'network'): std::size_t ns3::SimpleChannel::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'std::size_t',
[],
is_const=True, is_virtual=True)
## simple-channel.h (module 'network'): static ns3::TypeId ns3::SimpleChannel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## simple-channel.h (module 'network'): void ns3::SimpleChannel::Send(ns3::Ptr<ns3::Packet> p, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from, ns3::Ptr<ns3::SimpleNetDevice> sender) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'sender')],
is_virtual=True)
## simple-channel.h (module 'network'): void ns3::SimpleChannel::UnBlackList(ns3::Ptr<ns3::SimpleNetDevice> from, ns3::Ptr<ns3::SimpleNetDevice> to) [member function]
cls.add_method('UnBlackList',
'void',
[param('ns3::Ptr< ns3::SimpleNetDevice >', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'to')],
is_virtual=True)
return
def register_Ns3SimpleNetDevice_methods(root_module, cls):
## simple-net-device.h (module 'network'): ns3::SimpleNetDevice::SimpleNetDevice(ns3::SimpleNetDevice const & arg0) [constructor]
cls.add_constructor([param('ns3::SimpleNetDevice const &', 'arg0')])
## simple-net-device.h (module 'network'): ns3::SimpleNetDevice::SimpleNetDevice() [constructor]
cls.add_constructor([])
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('AddLinkChangeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_virtual=True)
## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): ns3::Ptr<ns3::Channel> ns3::SimpleNetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): uint32_t ns3::SimpleNetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): uint16_t ns3::SimpleNetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): ns3::Ptr<ns3::Node> ns3::SimpleNetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): ns3::Ptr<ns3::Queue<ns3::Packet> > ns3::SimpleNetDevice::GetQueue() const [member function]
cls.add_method('GetQueue',
'ns3::Ptr< ns3::Queue< ns3::Packet > >',
[],
is_const=True)
## simple-net-device.h (module 'network'): static ns3::TypeId ns3::SimpleNetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'bool',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::Receive(ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from) [member function]
cls.add_method('Receive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')])
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('Send',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetAddress(ns3::Address address) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Address', 'address')],
is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetChannel(ns3::Ptr<ns3::SimpleChannel> channel) [member function]
cls.add_method('SetChannel',
'void',
[param('ns3::Ptr< ns3::SimpleChannel >', 'channel')])
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_virtual=True)
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetPromiscReceiveCallback(ns3::NetDevice::PromiscReceiveCallback cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
[param('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 >', 'cb')],
is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetQueue(ns3::Ptr<ns3::Queue<ns3::Packet> > queue) [member function]
cls.add_method('SetQueue',
'void',
[param('ns3::Ptr< ns3::Queue< ns3::Packet > >', 'queue')])
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetReceiveCallback(ns3::NetDevice::ReceiveCallback cb) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('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 >', 'cb')],
is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetReceiveErrorModel(ns3::Ptr<ns3::ErrorModel> em) [member function]
cls.add_method('SetReceiveErrorModel',
'void',
[param('ns3::Ptr< ns3::ErrorModel >', 'em')])
## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_virtual=True)
## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3TimeValue_methods(root_module, cls):
## nstime.h (module 'core'): ns3::TimeValue::TimeValue() [constructor]
cls.add_constructor([])
## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::Time const & value) [constructor]
cls.add_constructor([param('ns3::Time const &', 'value')])
## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::TimeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::TimeValue const &', 'arg0')])
## nstime.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TimeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## nstime.h (module 'core'): bool ns3::TimeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## nstime.h (module 'core'): ns3::Time ns3::TimeValue::Get() const [member function]
cls.add_method('Get',
'ns3::Time',
[],
is_const=True)
## nstime.h (module 'core'): std::string ns3::TimeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## nstime.h (module 'core'): void ns3::TimeValue::Set(ns3::Time const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Time const &', 'value')])
return
def register_Ns3TypeIdChecker_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker(ns3::TypeIdChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeIdChecker const &', 'arg0')])
return
def register_Ns3TypeIdValue_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeId const & value) [constructor]
cls.add_constructor([param('ns3::TypeId const &', 'value')])
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeIdValue const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeIdValue const &', 'arg0')])
## type-id.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TypeIdValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## type-id.h (module 'core'): bool ns3::TypeIdValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeIdValue::Get() const [member function]
cls.add_method('Get',
'ns3::TypeId',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeIdValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## type-id.h (module 'core'): void ns3::TypeIdValue::Set(ns3::TypeId const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::TypeId const &', 'value')])
return
def register_Ns3UintegerValue_methods(root_module, cls):
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue() [constructor]
cls.add_constructor([])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(uint64_t const & value) [constructor]
cls.add_constructor([param('uint64_t const &', 'value')])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(ns3::UintegerValue const & arg0) [constructor]
cls.add_constructor([param('ns3::UintegerValue const &', 'arg0')])
## uinteger.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::UintegerValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## uinteger.h (module 'core'): bool ns3::UintegerValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## uinteger.h (module 'core'): uint64_t ns3::UintegerValue::Get() const [member function]
cls.add_method('Get',
'uint64_t',
[],
is_const=True)
## uinteger.h (module 'core'): std::string ns3::UintegerValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## uinteger.h (module 'core'): void ns3::UintegerValue::Set(uint64_t const & value) [member function]
cls.add_method('Set',
'void',
[param('uint64_t const &', 'value')])
return
def register_Ns3AddressChecker_methods(root_module, cls):
## address.h (module 'network'): ns3::AddressChecker::AddressChecker() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::AddressChecker::AddressChecker(ns3::AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::AddressChecker const &', 'arg0')])
return
def register_Ns3AddressValue_methods(root_module, cls):
## address.h (module 'network'): ns3::AddressValue::AddressValue() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::Address const & value) [constructor]
cls.add_constructor([param('ns3::Address const &', 'value')])
## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::AddressValue const &', 'arg0')])
## address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## address.h (module 'network'): bool ns3::AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## address.h (module 'network'): ns3::Address ns3::AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Address',
[],
is_const=True)
## address.h (module 'network'): std::string ns3::AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## address.h (module 'network'): void ns3::AddressValue::Set(ns3::Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Address const &', 'value')])
return
def register_Ns3BinaryErrorModel_methods(root_module, cls):
## error-model.h (module 'network'): ns3::BinaryErrorModel::BinaryErrorModel(ns3::BinaryErrorModel const & arg0) [constructor]
cls.add_constructor([param('ns3::BinaryErrorModel const &', 'arg0')])
## error-model.h (module 'network'): ns3::BinaryErrorModel::BinaryErrorModel() [constructor]
cls.add_constructor([])
## error-model.h (module 'network'): static ns3::TypeId ns3::BinaryErrorModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## error-model.h (module 'network'): bool ns3::BinaryErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorrupt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): void ns3::BinaryErrorModel::DoReset() [member function]
cls.add_method('DoReset',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3BurstErrorModel_methods(root_module, cls):
## error-model.h (module 'network'): ns3::BurstErrorModel::BurstErrorModel(ns3::BurstErrorModel const & arg0) [constructor]
cls.add_constructor([param('ns3::BurstErrorModel const &', 'arg0')])
## error-model.h (module 'network'): ns3::BurstErrorModel::BurstErrorModel() [constructor]
cls.add_constructor([])
## error-model.h (module 'network'): int64_t ns3::BurstErrorModel::AssignStreams(int64_t stream) [member function]
cls.add_method('AssignStreams',
'int64_t',
[param('int64_t', 'stream')])
## error-model.h (module 'network'): double ns3::BurstErrorModel::GetBurstRate() const [member function]
cls.add_method('GetBurstRate',
'double',
[],
is_const=True)
## error-model.h (module 'network'): static ns3::TypeId ns3::BurstErrorModel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## error-model.h (module 'network'): void ns3::BurstErrorModel::SetBurstRate(double rate) [member function]
cls.add_method('SetBurstRate',
'void',
[param('double', 'rate')])
## error-model.h (module 'network'): void ns3::BurstErrorModel::SetRandomBurstSize(ns3::Ptr<ns3::RandomVariableStream> burstSz) [member function]
cls.add_method('SetRandomBurstSize',
'void',
[param('ns3::Ptr< ns3::RandomVariableStream >', 'burstSz')])
## error-model.h (module 'network'): void ns3::BurstErrorModel::SetRandomVariable(ns3::Ptr<ns3::RandomVariableStream> ranVar) [member function]
cls.add_method('SetRandomVariable',
'void',
[param('ns3::Ptr< ns3::RandomVariableStream >', 'ranVar')])
## error-model.h (module 'network'): bool ns3::BurstErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoCorrupt',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='private', is_virtual=True)
## error-model.h (module 'network'): void ns3::BurstErrorModel::DoReset() [member function]
cls.add_method('DoReset',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<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>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<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>::CallbackImpl(ns3::CallbackImpl<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> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< 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 > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<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>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<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>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImpl<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>::operator()(ns3::Ptr<ns3::NetDevice> arg0, ns3::Ptr<const ns3::Packet> arg1, short unsigned int arg2, ns3::Address const & arg3, ns3::Address const & arg4, ns3::NetDevice::PacketType arg5) [member operator]
cls.add_method('operator()',
'bool',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0'), param('ns3::Ptr< ns3::Packet const >', 'arg1'), param('short unsigned int', 'arg2'), param('ns3::Address const &', 'arg3'), param('ns3::Address const &', 'arg4'), param('ns3::NetDevice::PacketType', 'arg5')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<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>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<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>::CallbackImpl(ns3::CallbackImpl<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> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< 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 > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<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>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<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>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImpl<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>::operator()(ns3::Ptr<ns3::NetDevice> arg0, ns3::Ptr<const ns3::Packet> arg1, short unsigned int arg2, ns3::Address const & arg3) [member operator]
cls.add_method('operator()',
'bool',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0'), param('ns3::Ptr< ns3::Packet const >', 'arg1'), param('short unsigned int', 'arg2'), param('ns3::Address const &', 'arg3')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, ns3::Address const & arg1) [member operator]
cls.add_method('operator()',
'bool',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('ns3::Address const &', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Ns3ObjectBase___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): ns3::ObjectBase * ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() [member operator]
cls.add_method('operator()',
'ns3::ObjectBase *',
[],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Packet const >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<const ns3::Packet> arg0, ns3::Address const & arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'arg0'), param('ns3::Address const &', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<const ns3::Packet> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'arg0')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3QueueDiscItem__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::QueueDiscItem const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<const ns3::QueueDiscItem>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<const ns3::QueueDiscItem> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::QueueDiscItem const >', 'arg0')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<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>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<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>::CallbackImpl(ns3::CallbackImpl<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> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< 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 > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<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>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<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>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<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>::operator()(ns3::Ptr<ns3::NetDevice> arg0, ns3::Ptr<const ns3::Packet> arg1, short unsigned int arg2, ns3::Address const & arg3, ns3::Address const & arg4, ns3::NetDevice::PacketType arg5) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0'), param('ns3::Ptr< ns3::Packet const >', 'arg1'), param('short unsigned int', 'arg2'), param('ns3::Address const &', 'arg3'), param('ns3::Address const &', 'arg4'), param('ns3::NetDevice::PacketType', 'arg5')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::NetDevice> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, ns3::Address const & arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('ns3::Address const &', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, unsigned int arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('unsigned int', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() [member operator]
cls.add_method('operator()',
'void',
[],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Unsigned_int_Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, unsigned int, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(unsigned int arg0, unsigned int arg1) [member operator]
cls.add_method('operator()',
'void',
[param('unsigned int', 'arg0'), param('unsigned int', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CounterCalculator__Unsigned_int_methods(root_module, cls):
## basic-data-calculators.h (module 'stats'): ns3::CounterCalculator<unsigned int>::CounterCalculator(ns3::CounterCalculator<unsigned int> const & arg0) [constructor]
cls.add_constructor([param('ns3::CounterCalculator< unsigned int > const &', 'arg0')])
## basic-data-calculators.h (module 'stats'): ns3::CounterCalculator<unsigned int>::CounterCalculator() [constructor]
cls.add_constructor([])
## basic-data-calculators.h (module 'stats'): unsigned int ns3::CounterCalculator<unsigned int>::GetCount() const [member function]
cls.add_method('GetCount',
'unsigned int',
[],
is_const=True)
## basic-data-calculators.h (module 'stats'): static ns3::TypeId ns3::CounterCalculator<unsigned int>::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## basic-data-calculators.h (module 'stats'): void ns3::CounterCalculator<unsigned int>::Output(ns3::DataOutputCallback & callback) const [member function]
cls.add_method('Output',
'void',
[param('ns3::DataOutputCallback &', 'callback')],
is_const=True, is_virtual=True)
## basic-data-calculators.h (module 'stats'): void ns3::CounterCalculator<unsigned int>::Update() [member function]
cls.add_method('Update',
'void',
[])
## basic-data-calculators.h (module 'stats'): void ns3::CounterCalculator<unsigned int>::Update(unsigned int const i) [member function]
cls.add_method('Update',
'void',
[param('unsigned int const', 'i')])
## basic-data-calculators.h (module 'stats'): void ns3::CounterCalculator<unsigned int>::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3DropTailQueue__Ns3Packet_methods(root_module, cls):
## drop-tail-queue.h (module 'network'): static ns3::TypeId ns3::DropTailQueue<ns3::Packet>::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## drop-tail-queue.h (module 'network'): ns3::DropTailQueue<ns3::Packet>::DropTailQueue() [constructor]
cls.add_constructor([])
## drop-tail-queue.h (module 'network'): bool ns3::DropTailQueue<ns3::Packet>::Enqueue(ns3::Ptr<ns3::Packet> item) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'item')],
is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::DropTailQueue<ns3::Packet>::Dequeue() [member function]
cls.add_method('Dequeue',
'ns3::Ptr< ns3::Packet >',
[],
is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::DropTailQueue<ns3::Packet>::Remove() [member function]
cls.add_method('Remove',
'ns3::Ptr< ns3::Packet >',
[],
is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::Ptr<const ns3::Packet> ns3::DropTailQueue<ns3::Packet>::Peek() const [member function]
cls.add_method('Peek',
'ns3::Ptr< ns3::Packet const >',
[],
is_const=True, is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::DropTailQueue<ns3::Packet>::DropTailQueue(ns3::DropTailQueue<ns3::Packet> const & arg0) [constructor]
cls.add_constructor([param('ns3::DropTailQueue< ns3::Packet > const &', 'arg0')])
return
def register_Ns3DropTailQueue__Ns3QueueDiscItem_methods(root_module, cls):
## drop-tail-queue.h (module 'network'): static ns3::TypeId ns3::DropTailQueue<ns3::QueueDiscItem>::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## drop-tail-queue.h (module 'network'): ns3::DropTailQueue<ns3::QueueDiscItem>::DropTailQueue() [constructor]
cls.add_constructor([])
## drop-tail-queue.h (module 'network'): bool ns3::DropTailQueue<ns3::QueueDiscItem>::Enqueue(ns3::Ptr<ns3::QueueDiscItem> item) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::Ptr< ns3::QueueDiscItem >', 'item')],
is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::Ptr<ns3::QueueDiscItem> ns3::DropTailQueue<ns3::QueueDiscItem>::Dequeue() [member function]
cls.add_method('Dequeue',
'ns3::Ptr< ns3::QueueDiscItem >',
[],
is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::Ptr<ns3::QueueDiscItem> ns3::DropTailQueue<ns3::QueueDiscItem>::Remove() [member function]
cls.add_method('Remove',
'ns3::Ptr< ns3::QueueDiscItem >',
[],
is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::Ptr<const ns3::QueueDiscItem> ns3::DropTailQueue<ns3::QueueDiscItem>::Peek() const [member function]
cls.add_method('Peek',
'ns3::Ptr< ns3::QueueDiscItem const >',
[],
is_const=True, is_virtual=True)
## drop-tail-queue.h (module 'network'): ns3::DropTailQueue<ns3::QueueDiscItem>::DropTailQueue(ns3::DropTailQueue<ns3::QueueDiscItem> const & arg0) [constructor]
cls.add_constructor([param('ns3::DropTailQueue< ns3::QueueDiscItem > const &', 'arg0')])
return
def register_Ns3ErrorChannel_methods(root_module, cls):
## error-channel.h (module 'network'): ns3::ErrorChannel::ErrorChannel(ns3::ErrorChannel const & arg0) [constructor]
cls.add_constructor([param('ns3::ErrorChannel const &', 'arg0')])
## error-channel.h (module 'network'): ns3::ErrorChannel::ErrorChannel() [constructor]
cls.add_constructor([])
## error-channel.h (module 'network'): void ns3::ErrorChannel::Add(ns3::Ptr<ns3::SimpleNetDevice> device) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::SimpleNetDevice >', 'device')],
is_virtual=True)
## error-channel.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::ErrorChannel::GetDevice(std::size_t i) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('std::size_t', 'i')],
is_const=True, is_virtual=True)
## error-channel.h (module 'network'): std::size_t ns3::ErrorChannel::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'std::size_t',
[],
is_const=True, is_virtual=True)
## error-channel.h (module 'network'): static ns3::TypeId ns3::ErrorChannel::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## error-channel.h (module 'network'): void ns3::ErrorChannel::Send(ns3::Ptr<ns3::Packet> p, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from, ns3::Ptr<ns3::SimpleNetDevice> sender) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'sender')],
is_virtual=True)
## error-channel.h (module 'network'): void ns3::ErrorChannel::SetDuplicateMode(bool mode) [member function]
cls.add_method('SetDuplicateMode',
'void',
[param('bool', 'mode')])
## error-channel.h (module 'network'): void ns3::ErrorChannel::SetDuplicateTime(ns3::Time delay) [member function]
cls.add_method('SetDuplicateTime',
'void',
[param('ns3::Time', 'delay')])
## error-channel.h (module 'network'): void ns3::ErrorChannel::SetJumpingMode(bool mode) [member function]
cls.add_method('SetJumpingMode',
'void',
[param('bool', 'mode')])
## error-channel.h (module 'network'): void ns3::ErrorChannel::SetJumpingTime(ns3::Time delay) [member function]
cls.add_method('SetJumpingTime',
'void',
[param('ns3::Time', 'delay')])
return
def register_Ns3PacketCounterCalculator_methods(root_module, cls):
## packet-data-calculators.h (module 'network'): ns3::PacketCounterCalculator::PacketCounterCalculator(ns3::PacketCounterCalculator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketCounterCalculator const &', 'arg0')])
## packet-data-calculators.h (module 'network'): ns3::PacketCounterCalculator::PacketCounterCalculator() [constructor]
cls.add_constructor([])
## packet-data-calculators.h (module 'network'): void ns3::PacketCounterCalculator::FrameUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet, ns3::Mac48Address realto) [member function]
cls.add_method('FrameUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Mac48Address', 'realto')])
## packet-data-calculators.h (module 'network'): static ns3::TypeId ns3::PacketCounterCalculator::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-data-calculators.h (module 'network'): void ns3::PacketCounterCalculator::PacketUpdate(std::string path, ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('PacketUpdate',
'void',
[param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet')])
## packet-data-calculators.h (module 'network'): void ns3::PacketCounterCalculator::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3PacketProbe_methods(root_module, cls):
## packet-probe.h (module 'network'): ns3::PacketProbe::PacketProbe(ns3::PacketProbe const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketProbe const &', 'arg0')])
## packet-probe.h (module 'network'): ns3::PacketProbe::PacketProbe() [constructor]
cls.add_constructor([])
## packet-probe.h (module 'network'): bool ns3::PacketProbe::ConnectByObject(std::string traceSource, ns3::Ptr<ns3::Object> obj) [member function]
cls.add_method('ConnectByObject',
'bool',
[param('std::string', 'traceSource'), param('ns3::Ptr< ns3::Object >', 'obj')],
is_virtual=True)
## packet-probe.h (module 'network'): void ns3::PacketProbe::ConnectByPath(std::string path) [member function]
cls.add_method('ConnectByPath',
'void',
[param('std::string', 'path')],
is_virtual=True)
## packet-probe.h (module 'network'): static ns3::TypeId ns3::PacketProbe::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## packet-probe.h (module 'network'): void ns3::PacketProbe::SetValue(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('SetValue',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## packet-probe.h (module 'network'): static void ns3::PacketProbe::SetValueByPath(std::string path, ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('SetValueByPath',
'void',
[param('std::string', 'path'), param('ns3::Ptr< ns3::Packet const >', 'packet')],
is_static=True)
return
def register_Ns3PbbAddressTlv_methods(root_module, cls):
## packetbb.h (module 'network'): ns3::PbbAddressTlv::PbbAddressTlv() [constructor]
cls.add_constructor([])
## packetbb.h (module 'network'): ns3::PbbAddressTlv::PbbAddressTlv(ns3::PbbAddressTlv const & arg0) [constructor]
cls.add_constructor([param('ns3::PbbAddressTlv const &', 'arg0')])
## packetbb.h (module 'network'): uint8_t ns3::PbbAddressTlv::GetIndexStart() const [member function]
cls.add_method('GetIndexStart',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): uint8_t ns3::PbbAddressTlv::GetIndexStop() const [member function]
cls.add_method('GetIndexStop',
'uint8_t',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbAddressTlv::HasIndexStart() const [member function]
cls.add_method('HasIndexStart',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbAddressTlv::HasIndexStop() const [member function]
cls.add_method('HasIndexStop',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): bool ns3::PbbAddressTlv::IsMultivalue() const [member function]
cls.add_method('IsMultivalue',
'bool',
[],
is_const=True)
## packetbb.h (module 'network'): void ns3::PbbAddressTlv::SetIndexStart(uint8_t index) [member function]
cls.add_method('SetIndexStart',
'void',
[param('uint8_t', 'index')])
## packetbb.h (module 'network'): void ns3::PbbAddressTlv::SetIndexStop(uint8_t index) [member function]
cls.add_method('SetIndexStop',
'void',
[param('uint8_t', 'index')])
## packetbb.h (module 'network'): void ns3::PbbAddressTlv::SetMultivalue(bool isMultivalue) [member function]
cls.add_method('SetMultivalue',
'void',
[param('bool', 'isMultivalue')])
return
def register_Ns3QueueDiscItem_methods(root_module, cls):
## queue-item.h (module 'network'): ns3::QueueDiscItem::QueueDiscItem(ns3::Ptr<ns3::Packet> p, ns3::Address const & addr, uint16_t protocol) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Address const &', 'addr'), param('uint16_t', 'protocol')])
## queue-item.h (module 'network'): ns3::Address ns3::QueueDiscItem::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_const=True)
## queue-item.h (module 'network'): uint16_t ns3::QueueDiscItem::GetProtocol() const [member function]
cls.add_method('GetProtocol',
'uint16_t',
[],
is_const=True)
## queue-item.h (module 'network'): uint8_t ns3::QueueDiscItem::GetTxQueueIndex() const [member function]
cls.add_method('GetTxQueueIndex',
'uint8_t',
[],
is_const=True)
## queue-item.h (module 'network'): void ns3::QueueDiscItem::SetTxQueueIndex(uint8_t txq) [member function]
cls.add_method('SetTxQueueIndex',
'void',
[param('uint8_t', 'txq')])
## queue-item.h (module 'network'): ns3::Time ns3::QueueDiscItem::GetTimeStamp() const [member function]
cls.add_method('GetTimeStamp',
'ns3::Time',
[],
is_const=True)
## queue-item.h (module 'network'): void ns3::QueueDiscItem::SetTimeStamp(ns3::Time t) [member function]
cls.add_method('SetTimeStamp',
'void',
[param('ns3::Time', 't')])
## queue-item.h (module 'network'): void ns3::QueueDiscItem::AddHeader() [member function]
cls.add_method('AddHeader',
'void',
[],
is_pure_virtual=True, is_virtual=True)
## queue-item.h (module 'network'): void ns3::QueueDiscItem::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## queue-item.h (module 'network'): bool ns3::QueueDiscItem::Mark() [member function]
cls.add_method('Mark',
'bool',
[],
is_pure_virtual=True, is_virtual=True)
## queue-item.h (module 'network'): uint32_t ns3::QueueDiscItem::Hash(uint32_t perturbation=0) const [member function]
cls.add_method('Hash',
'uint32_t',
[param('uint32_t', 'perturbation', default_value='0')],
is_const=True, is_virtual=True)
return
def register_Ns3HashImplementation_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation(ns3::Hash::Implementation const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Implementation const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation() [constructor]
cls.add_constructor([])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Implementation::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_pure_virtual=True, is_virtual=True)
## hash-function.h (module 'core'): uint64_t ns3::Hash::Implementation::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Implementation::clear() [member function]
cls.add_method('clear',
'void',
[],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3HashFunctionFnv1a_methods(root_module, cls):
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a(ns3::Hash::Function::Fnv1a const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Fnv1a const &', 'arg0')])
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a() [constructor]
cls.add_constructor([])
## hash-fnv.h (module 'core'): uint32_t ns3::Hash::Function::Fnv1a::GetHash32(char const * buffer, size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('size_t const', 'size')],
is_virtual=True)
## hash-fnv.h (module 'core'): uint64_t ns3::Hash::Function::Fnv1a::GetHash64(char const * buffer, size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('size_t const', 'size')],
is_virtual=True)
## hash-fnv.h (module 'core'): void ns3::Hash::Function::Fnv1a::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionHash32_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Function::Hash32 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Hash32 const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Hash32Function_ptr hp) [constructor]
cls.add_constructor([param('ns3::Hash::Hash32Function_ptr', 'hp')])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash32::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Function::Hash32::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionHash64_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Function::Hash64 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Hash64 const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Hash64Function_ptr hp) [constructor]
cls.add_constructor([param('ns3::Hash::Hash64Function_ptr', 'hp')])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash64::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): uint64_t ns3::Hash::Function::Hash64::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Function::Hash64::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionMurmur3_methods(root_module, cls):
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3(ns3::Hash::Function::Murmur3 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Murmur3 const &', 'arg0')])
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3() [constructor]
cls.add_constructor([])
## hash-murmur3.h (module 'core'): uint32_t ns3::Hash::Function::Murmur3::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-murmur3.h (module 'core'): uint64_t ns3::Hash::Function::Murmur3::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-murmur3.h (module 'core'): void ns3::Hash::Function::Murmur3::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_functions(root_module):
module = root_module
## crc32.h (module 'network'): uint32_t ns3::CRC32Calculate(uint8_t const * data, int length) [free function]
module.add_function('CRC32Calculate',
'uint32_t',
[param('uint8_t const *', 'data'), param('int', 'length')])
## address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeAddressChecker() [free function]
module.add_function('MakeAddressChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## data-rate.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeDataRateChecker() [free function]
module.add_function('MakeDataRateChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## ipv4-address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeIpv4AddressChecker() [free function]
module.add_function('MakeIpv4AddressChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## ipv4-address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeIpv4MaskChecker() [free function]
module.add_function('MakeIpv4MaskChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## ipv6-address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeIpv6AddressChecker() [free function]
module.add_function('MakeIpv6AddressChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## ipv6-address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeIpv6PrefixChecker() [free function]
module.add_function('MakeIpv6PrefixChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## mac16-address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeMac16AddressChecker() [free function]
module.add_function('MakeMac16AddressChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## mac48-address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeMac48AddressChecker() [free function]
module.add_function('MakeMac48AddressChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## mac64-address.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeMac64AddressChecker() [free function]
module.add_function('MakeMac64AddressChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## queue-size.h (module 'network'): ns3::Ptr<const ns3::AttributeChecker> ns3::MakeQueueSizeChecker() [free function]
module.add_function('MakeQueueSizeChecker',
'ns3::Ptr< ns3::AttributeChecker const >',
[])
## address-utils.h (module 'network'): void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Address & ad, uint32_t len) [free function]
module.add_function('ReadFrom',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address &', 'ad'), param('uint32_t', 'len')])
## address-utils.h (module 'network'): void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv4Address & ad) [free function]
module.add_function('ReadFrom',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address &', 'ad')])
## address-utils.h (module 'network'): void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv6Address & ad) [free function]
module.add_function('ReadFrom',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address &', 'ad')])
## address-utils.h (module 'network'): void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac16Address & ad) [free function]
module.add_function('ReadFrom',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac16Address &', 'ad')])
## address-utils.h (module 'network'): void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac48Address & ad) [free function]
module.add_function('ReadFrom',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address &', 'ad')])
## address-utils.h (module 'network'): void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac64Address & ad) [free function]
module.add_function('ReadFrom',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac64Address &', 'ad')])
## address-utils.h (module 'network'): void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Address const & ad) [free function]
module.add_function('WriteTo',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address const &', 'ad')])
## address-utils.h (module 'network'): void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Ipv4Address ad) [free function]
module.add_function('WriteTo',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address', 'ad')])
## address-utils.h (module 'network'): void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Ipv6Address ad) [free function]
module.add_function('WriteTo',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address', 'ad')])
## address-utils.h (module 'network'): void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Mac16Address ad) [free function]
module.add_function('WriteTo',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac16Address', 'ad')])
## address-utils.h (module 'network'): void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Mac48Address ad) [free function]
module.add_function('WriteTo',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address', 'ad')])
## address-utils.h (module 'network'): void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Mac64Address ad) [free function]
module.add_function('WriteTo',
'void',
[param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac64Address', 'ad')])
register_functions_ns3_FatalImpl(module.add_cpp_namespace('FatalImpl'), root_module)
register_functions_ns3_Hash(module.add_cpp_namespace('Hash'), root_module)
register_functions_ns3_TracedValueCallback(module.add_cpp_namespace('TracedValueCallback'), root_module)
register_functions_ns3_addressUtils(module.add_cpp_namespace('addressUtils'), root_module)
register_functions_ns3_internal(module.add_cpp_namespace('internal'), root_module)
register_functions_ns3_tests(module.add_cpp_namespace('tests'), root_module)
return
def register_functions_ns3_FatalImpl(module, root_module):
return
def register_functions_ns3_Hash(module, root_module):
register_functions_ns3_Hash_Function(module.add_cpp_namespace('Function'), root_module)
return
def register_functions_ns3_Hash_Function(module, root_module):
return
def register_functions_ns3_TracedValueCallback(module, root_module):
return
def register_functions_ns3_addressUtils(module, root_module):
## address-utils.h (module 'network'): bool ns3::addressUtils::IsMulticast(ns3::Address const & ad) [free function]
module.add_function('IsMulticast',
'bool',
[param('ns3::Address const &', 'ad')])
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_tests(module, root_module):
return
def main():
out = FileCodeSink(sys.stdout)
root_module = module_init()
register_types(root_module)
register_methods(root_module)
register_functions(root_module)
root_module.generate(out)
if __name__ == '__main__':
main()
| gpl-2.0 | 7,644,027,052,523,548,000 | 64.658655 | 594 | 0.610563 | false |
arjunjain/xssalert | XSSAlert/uipy/xss_rc.py | 1 | 164742 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt (Qt v4.7.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x05\x44\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x04\x67\x41\x4d\x41\x00\x00\xaf\xc8\x37\x05\x8a\xe9\
\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\
\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\
\x79\x71\xc9\x65\x3c\x00\x00\x04\xd6\x49\x44\x41\x54\x78\xda\x62\
\xfc\xff\xff\x3f\xc3\x40\x02\x80\x00\x62\x62\x18\x60\x00\x10\x40\
\x03\xee\x00\x80\x00\x62\x41\x17\x58\xb7\xfe\xc8\xff\xdf\xbf\xff\
\x30\xfc\xfe\xf5\x97\x81\x91\x91\x81\xe1\xcf\x9f\xbf\x40\x0c\xe4\
\xff\x46\xd0\xa8\xec\x3f\x60\x35\x08\x1a\x55\x0c\xc4\x7f\xf5\xe6\
\x23\xc3\xfb\x77\x9f\x19\x2e\x9c\x9f\xc9\x88\x6e\x1f\x40\x00\xa1\
\x38\x60\xfd\xfa\xa3\xff\x6d\xed\xf5\x81\x9a\xff\x31\xfc\xfd\xf7\
\x8f\x41\x46\x42\x10\x2c\x7e\xf9\xe6\x13\x14\x4d\xba\xea\x32\x24\
\xf9\x72\xfb\xc1\xcb\x0c\x7f\x7e\xfd\x66\x70\x72\x2e\xf9\xbf\x6f\
\x6f\x0f\x8a\x23\x00\x02\x08\xc5\x01\xbf\x81\xbe\xfa\xf1\xf3\x37\
\xc3\xd7\x6f\x3f\x19\xfe\xfc\x45\x38\xc0\xd4\xbf\x91\x41\x52\x54\
\x80\x81\x83\x83\x95\x81\x83\x9d\x95\xe1\xfc\x96\x46\x92\x1c\x70\
\xe7\xe1\x2b\x86\xbf\x7f\xff\x32\x38\xb9\x9a\x30\x48\x4a\x86\xfe\
\x7f\xfe\x7c\x35\xdc\x11\x00\x01\x84\xea\x00\x60\x70\xfd\x05\x5a\
\xfc\xfb\x0f\x84\x86\x01\x6e\x2e\x76\x06\x23\x1d\x79\x06\x41\x3e\
\x2e\x06\x01\x7e\x2e\x92\xe3\xf9\x0f\xd4\xbc\x5f\xbf\x7e\x31\xb0\
\xb0\xa0\x26\x3b\x80\x00\x62\x41\x57\x08\xf2\x39\x18\x03\xd9\x30\
\xc0\xc6\xca\xc2\x20\x29\x26\xc0\x20\x00\x72\x00\x1f\x79\x0e\x00\
\x99\xf9\xe1\xc3\x27\x86\x7f\xff\xfe\xa1\xc8\x01\x04\x10\x5a\x08\
\xfc\x01\xc7\x3d\x38\x24\x90\x14\x4a\x88\xf2\x03\x1d\xc0\x0f\x75\
\x00\x37\xc9\x0e\x00\x85\xe8\xa7\x8f\x9f\x19\xbe\x7f\xfb\x01\x74\
\x00\x6a\xb9\x03\x10\x40\x18\x21\xf0\xf7\x0f\x28\x04\x50\xa3\x20\
\xd0\xcd\x98\x41\x5f\x53\x8e\x81\x07\x18\x15\x3c\xdc\x1c\x24\x3b\
\x00\xe4\xf3\x6f\x9f\xbf\x32\xfc\x04\x26\x44\xf4\x82\x0f\x20\x80\
\x30\x12\x21\xc8\x72\x58\x90\xc1\x40\x5d\x9e\x1f\x59\x79\x1c\x14\
\xdc\xaf\x5e\x7d\x60\xf8\xf2\xe9\x0b\xd8\xec\xdf\x40\x07\xa0\x47\
\x01\x40\x00\xa1\x86\x00\x38\x11\xfe\x07\x2a\xfe\x07\x0e\x81\xdb\
\x0f\x5e\x82\x83\xec\x1f\xd0\xd5\xff\xa1\x34\xc8\x00\x90\x27\x20\
\xe2\xff\xc0\x3e\xfa\x07\x97\xfb\x0f\xe7\xff\xfe\xfd\x9b\xe1\xcd\
\xeb\x0f\x0c\x5f\xbf\xfe\x00\x26\xbe\x3f\xe0\x72\xe3\x17\x96\x10\
\x00\x08\x20\xcc\x5c\xf0\x0f\x92\x00\x41\xf4\xf5\x3b\xcf\x51\xf8\
\x7f\xa1\x09\x14\x99\x86\xb0\x21\x0e\x07\xd1\xa0\x74\xf4\xf9\xd3\
\x57\x86\xaf\x5f\xbe\x22\x0a\x30\x50\x81\x04\x72\xc0\xef\xdf\x18\
\x69\x00\x20\x80\x30\xa3\x00\x1c\xfc\x7f\xe1\x85\x11\x2e\x8b\xfe\
\xa2\x39\x04\x14\xbf\x5f\xbf\x7c\x63\xf8\xf6\xf5\x1b\xb4\x24\x84\
\x94\xa6\x10\x33\xa1\xfc\xdf\x98\x21\x00\x10\x40\x98\x51\x00\xca\
\x05\xe0\x28\xf8\x8b\xd5\xc7\x7f\x90\x1c\xf3\xf3\xe7\x2f\x30\x06\
\xa5\xee\x9f\xc0\x02\x0c\x6e\x31\x88\xfe\x8d\xb0\x1c\xe6\xb1\xdf\
\xc0\xa8\x40\x77\x00\x40\x00\xb1\xa0\x67\x17\x58\x19\x00\xb2\x44\
\x58\x90\x07\x1c\xe7\x7f\xff\xfd\x87\xd3\xbf\x80\x16\xfd\xf8\x01\
\xb4\xf4\xfb\x0f\x06\x56\x46\x56\x06\x76\x66\x46\x06\x2e\x56\x66\
\x88\x25\xbf\xff\x22\xd5\x0b\x50\x4b\x81\xf4\x83\x27\xaf\xc0\xd1\
\xf0\x0b\x4b\x08\x00\x04\x10\x66\x39\x00\xf5\x1d\x28\x0a\x5c\xac\
\xb5\xe0\x72\x20\xf1\x6f\xc0\x22\x1a\xe4\x63\x48\x05\x05\x51\x03\
\x71\xec\x5f\x24\xb1\xbf\x18\xf2\x3d\xb3\xd6\x43\x1d\x86\x99\x0b\
\x00\x02\x88\x05\x5b\x91\x89\x5e\x10\x81\x82\xf7\x1b\x30\x98\x91\
\x0d\x85\xe1\xbf\x7f\xff\x42\x8b\xf0\xbf\x58\xe5\x91\x6b\x4a\x50\
\x28\xa0\x87\x00\x40\x00\x61\xe4\x82\x3f\x48\xf1\x0c\x52\x0c\xc9\
\x46\xbf\xb1\x1a\x8c\xea\x10\xdc\xf2\x60\x07\xfc\x85\x44\x0b\xba\
\x03\x00\x02\x08\x7b\x14\x40\x35\x7e\xf9\xf2\x9d\xe1\xf4\xe9\xc7\
\x90\x1c\xf1\xf7\x2f\x3c\x61\xa2\xd2\x08\xcb\xb1\xc9\xc9\xcb\x0b\
\x01\xd3\xc1\x6f\x60\x09\x0b\x49\x0f\xe8\x0e\x00\x08\x20\x8c\x44\
\x08\xab\x0d\xbf\x01\x7d\xfe\xe3\xc7\x6f\x06\x39\x39\x7e\xb4\x78\
\xfe\x87\x16\xe7\xff\x30\xd2\x00\xb2\x27\x60\x39\xe2\x2f\x8e\x10\
\x00\x08\x20\xb4\x6c\xf8\x07\x1c\xfc\xdf\xbf\xff\x64\xf8\xf6\xfd\
\x07\x58\xc3\x87\x0f\xdf\x90\x7c\x88\x6a\x21\x2e\x3e\x8c\x0d\xc2\
\xbc\xbc\xec\x40\xfe\x6f\x78\xcb\x0a\xdd\x01\x00\x01\x84\x11\x02\
\xa0\x60\xfa\xf2\xe5\x1b\xbc\x39\xf5\xe1\xc3\x77\x94\x60\x45\x0e\
\x6a\xe4\xa8\x41\x15\x47\xb0\x39\x38\x98\xa1\xb5\x2c\x76\x07\x00\
\x04\x10\x46\x22\x04\x17\x2a\xc0\x86\x03\x28\xd8\x40\x65\xb8\xac\
\x2c\x1f\xd6\xac\x85\x9e\x13\x70\x25\x4a\x48\xc2\xfe\xc3\xf0\x0f\
\xe4\x50\x2c\x0e\x00\x08\x20\x54\x07\xfc\x02\x15\x32\x3f\x81\x85\
\xcd\x1f\x78\x61\x72\xf1\xe2\x73\xb0\x05\xff\xfe\x21\x07\xed\x3f\
\xb4\x50\x41\x84\x04\xb8\xc0\x42\x12\x93\x96\xe6\x07\x27\x40\x50\
\x1a\x00\x61\x06\x06\x54\x07\x00\x04\x10\x8a\x03\x40\xe5\xf9\x6f\
\xb0\xcf\x7f\x43\x2a\x10\x20\x96\x96\xe6\xc5\xc8\xe3\xc8\x3e\x46\
\x4e\x70\xc8\xc1\x8f\x28\x23\xfe\x80\xd3\x00\xac\x80\x43\x0f\x01\
\x80\x00\xc2\xc8\x86\xe0\x22\x13\x9c\xef\x21\x69\x80\x8d\x8d\x09\
\xc8\xfe\x0f\x6c\xa2\xc3\x30\x23\x10\x33\x41\x7d\x02\x11\x63\x60\
\x60\x04\x63\x90\x1c\x8c\xfd\xff\x3f\x04\x43\xa2\x00\x18\x32\x7f\
\x60\x51\xc0\x8c\xe2\x00\x80\x00\x42\x71\xc0\xaf\xef\xbf\x18\xbe\
\xbc\x7d\xcf\xf0\xe9\xf9\x2b\x70\x62\xbc\x7b\xf7\x0e\x46\x1e\xff\
\xf3\xe7\x1f\x96\xc4\xf6\x0f\x6b\x79\x00\x8b\x86\xaf\xaf\x5e\x80\
\xab\xe1\x3f\x3f\x7f\x02\x1d\x80\xda\xa6\x04\x08\x20\x46\xf4\x20\
\x31\x30\x48\xfd\xff\xf1\xe3\x17\x70\x02\x14\x10\xe0\x82\x37\xcd\
\x40\xea\x20\x98\x01\x1e\x8c\xa8\x7c\x04\x1b\x5d\xec\xe5\xcb\x37\
\x50\xf5\xa0\xe2\xfe\x00\x4a\xbf\x00\x20\x80\x18\x07\xba\x73\x0a\
\x10\x40\x03\xde\x37\x04\x08\xa0\x01\x77\x00\x40\x80\x01\x00\x80\
\x70\xef\x0c\xb7\x02\x84\x52\x00\x00\x00\x00\x49\x45\x4e\x44\xae\
\x42\x60\x82\
\x00\x00\x02\xb8\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8d\x89\x1d\x0d\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xda\x0a\x01\
\x0c\x33\x23\xd2\x6b\x07\x0b\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x02\x13\
\x49\x44\x41\x54\x38\xcb\xad\xd4\x4b\x88\x8e\x61\x14\x07\xf0\xdf\
\xf7\xcd\x30\x2e\x63\x30\x6e\x8d\xcb\x88\x44\x43\x36\xb3\x91\x88\
\x0d\x66\x43\x94\x0d\x1b\x97\xa4\xac\xac\x94\x85\xb1\x54\x64\x61\
\x87\x85\x48\x16\xb2\x10\x0b\x65\x63\x45\x16\x6a\x12\x65\xe3\x12\
\x59\xd8\xb8\x34\x91\x51\x93\x99\x39\x16\xdf\x79\xcd\xd3\x4b\x56\
\x4e\xbd\xf5\x9e\xff\x39\xcf\x79\xce\xf9\x9f\xf3\x9c\x06\xc2\x7f\
\x94\xa6\xff\x2c\x4d\xd8\x85\x93\xa9\x34\x30\x88\x35\x85\xd3\x72\
\xdc\xc1\x45\x2c\x2d\xf0\x36\x5c\xc5\x4d\x6c\x28\xf0\xd8\x4b\x04\
\xb1\x9e\xe8\xcb\xff\x39\x2d\x2a\x02\xf1\x22\xb1\x20\x4e\x16\xf8\
\xdd\x02\x7f\x4a\x34\x92\xbe\x90\xe0\x21\xe2\x3a\xf1\x88\x68\x4b\
\xbc\x2b\x6d\x3b\x89\x0d\xc4\xee\xc4\x9b\xc4\x4f\xe2\x3c\xb1\x82\
\x18\x9c\x3c\xd3\x72\xb8\x44\x3c\x20\xc6\x89\x53\x45\x16\x7d\xc4\
\x04\xb1\xba\xc0\x10\xf3\xd2\xf7\x60\x0d\xff\x1d\x70\x6d\x66\x32\
\x41\xf4\x17\x0e\x8b\x13\x7f\x98\xd4\x54\xf8\xf4\xf4\x7d\x43\x1c\
\xff\x5b\xc0\x99\x69\x1c\xfe\xf3\xc6\xf8\x9e\x41\xc7\x89\x3d\x05\
\xfe\xb2\xe0\xf0\x4a\x3d\x60\x37\x31\x92\xbc\x74\xd5\x02\x0e\x10\
\xef\xf2\xe0\xad\x02\x5f\x45\x3c\x4f\xfc\xf5\x64\x23\x5b\xc6\x03\
\x19\x2c\x88\x7d\x7f\xc9\x72\x26\x71\x9b\x18\xaa\xe1\x1d\xc4\xd9\
\xac\xac\xa7\xd5\xac\x96\x9c\xc0\x39\xbc\xc5\x40\xce\x23\xcc\xc5\
\x12\x8c\xe0\x7e\xf1\xac\x66\x60\x25\x46\x73\x46\xdb\x0b\x5b\x2c\
\xcb\xcc\x76\x10\x87\x89\x8f\xc4\x94\xcc\xa0\x97\xf8\x4c\x9c\xc9\
\xb2\x6e\x24\x3e\x8b\xf8\x42\x5c\x20\x1e\xa7\xad\xab\x2a\xf9\x74\
\x12\xbf\x20\x03\x45\x8e\x0b\x62\x7e\x41\xfc\x58\xce\x23\x62\x2a\
\x31\x5a\xd8\x2e\x97\x4d\xe9\x27\xb6\x16\xbc\x6c\xca\x61\xad\xf4\
\x1e\xe2\x18\xb1\xab\xc6\x5f\x27\x71\x84\xd8\x5f\x1f\x9b\x65\x49\
\x6e\xd9\xf1\x46\xad\xcb\x1b\x0b\x7d\x6f\x71\x61\x3b\x71\x34\x83\
\xb6\x55\x4d\xd9\x8c\xad\xc5\xe3\x5e\x99\x0f\xbf\x92\x6e\x0c\x15\
\xfa\x92\xfc\x60\x0c\x1f\xf0\x04\xe3\xd5\xb6\xf9\x84\x85\xe5\xb6\
\xa8\xad\xa4\x5e\xac\x2b\xf4\x45\xe8\x28\xf4\xaf\xf8\x56\xad\xaf\
\x06\xb6\x63\xcb\x3f\x76\xdc\x2b\x3c\x2b\xf4\x8f\x99\x4d\x25\x8d\
\x62\xcc\x9a\x9d\xb8\x86\x7b\xc5\xb6\x9d\x8d\x6d\xc5\x81\xce\xda\
\x7e\x7c\x8f\xe1\x42\xff\x91\xa5\x43\xa3\xda\x61\x4d\x4c\x64\xb9\
\xd3\x31\xad\x38\xd4\x99\xf8\x48\xea\x53\x33\xc3\x2a\xcb\xf6\xfc\
\x0f\xfc\x02\x21\x8d\x4f\x86\x4e\x72\xfa\xd9\x00\x00\x00\x00\x49\
\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x06\x9b\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x75\x00\x00\x00\x39\x08\x06\x00\x00\x00\x08\x9e\x64\xab\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\
\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\
\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xda\x0a\x01\
\x0b\x1a\x35\x67\xb6\x3b\x34\x00\x00\x00\x19\x74\x45\x58\x74\x43\
\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\
\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x05\xf6\
\x49\x44\x41\x54\x78\xda\xed\x9c\x69\x6c\x55\x45\x14\xc7\x7f\xaf\
\x2d\x45\x96\xd6\xb2\xa4\x86\x45\xa9\x88\xb2\x7c\x92\x08\x0a\x89\
\x52\x54\xc0\x0f\x4a\xc4\x48\x44\x44\x21\x44\x1b\x95\x10\xe2\x42\
\x15\x11\x8d\x44\x22\xc4\x0f\x6e\x68\x14\x48\xa1\x31\x5a\x91\x84\
\x45\x0c\x06\x02\x08\x26\x28\x1a\x89\x2b\x24\x20\x86\x55\xa1\x88\
\x42\xc1\xb4\x80\xa5\x1c\x3f\x74\x9a\xd4\xe7\x7b\x33\x77\x99\xfb\
\xde\x9b\xf6\x9e\xe4\xe4\xe5\xbd\x3b\x33\xe7\x7f\x96\x7b\xe7\xcc\
\x99\x3b\x2f\x01\x08\x31\xb5\x29\xca\x8b\x4d\x10\x3b\x35\xa6\xd8\
\xa9\x31\xc5\x4e\x8d\x29\x76\x6a\x4c\xa9\xa9\xa0\xbd\x28\xda\x0f\
\x18\x0a\x94\x02\x25\x40\x07\xe0\x3c\xd0\x00\x9c\x00\x8e\x01\x87\
\x80\xda\x36\x82\x47\x74\xfc\x1c\x88\x68\xf8\x2d\x43\xff\x64\xee\
\x03\x72\x5a\x33\x5e\x1d\x48\x5f\x9f\x63\xa6\xe3\xfe\x20\xaf\x82\
\x1c\x37\xe8\xd0\x9a\x4f\x83\x7c\x05\xb2\x18\x64\x0a\xc8\x15\x96\
\xb0\x64\x18\x8f\xbe\x41\x3e\xc8\xd7\x1a\xa1\x97\x40\x46\xfb\x50\
\xec\x33\x83\x12\xd3\x2c\x18\x2f\x1f\x64\x2e\xc8\x05\x1f\xc6\x4b\
\xc7\xf3\xdc\xc4\x63\x6e\x34\x10\xa4\x41\x23\xe8\x20\x48\x57\x0f\
\xe3\x3c\x6c\x00\xbc\xce\x82\x01\x13\x20\x1f\x58\x30\x9e\x2d\xa7\
\x66\x09\x8f\x37\x70\x4f\x18\x84\x2d\x35\xf4\xbf\x0a\xe4\x8c\xa6\
\xff\x49\x4b\x8f\xba\x79\x16\x0d\x68\xc3\xa9\xd9\xc0\xe3\x39\x51\
\x7a\x13\x98\x00\x94\xa7\xb9\x5e\x01\xac\x06\x36\xa5\xb8\x96\x00\
\xaa\x80\x62\xcd\xf8\x33\x54\x82\x10\x86\x7a\x01\x73\x0c\x6d\x9a\
\x80\x9f\x81\x83\x40\x3d\x50\x04\xf4\x04\x86\x00\xdd\x2c\x27\x43\
\xd9\xc4\xe3\x39\xea\xae\x06\xf9\x5b\x13\x45\xbf\x81\x94\xa4\xe8\
\xf7\xb8\x21\xfa\x56\x5a\x4a\x44\x66\x1b\xe4\x2c\x03\x29\xd5\xf4\
\x1f\x00\x32\x03\x64\x2b\xc8\x45\x0b\x77\x6a\x16\xf1\xf8\x03\xfa\
\xa8\x01\xe8\xfb\x3e\x03\xe1\x38\x48\x77\x4b\x4e\xdd\xa2\x91\xb3\
\xc3\xe7\x58\x7d\x41\x16\xaa\x80\x74\x10\x8f\x7f\xb0\x1b\x0d\x8e\
\xbd\xbb\x55\x92\xb0\xdd\xd0\xf6\x2e\x8b\x4b\x86\x23\x1a\x39\xf3\
\x2d\xca\x71\x00\x8f\xff\x4e\xa6\xb5\x66\x2d\x48\x0f\x90\x59\x06\
\x87\x2e\xb7\xac\xcc\x39\xc3\xa3\x2e\xd3\x4e\xcd\x22\x9e\x60\x1d\
\xa7\x1a\x1c\xb6\x05\xa4\x5e\x73\xfd\x08\x48\xb1\x65\x65\x74\xcb\
\xae\x06\x90\x91\x19\x76\x6a\x16\xf1\x04\xef\xbc\x2e\x60\x5a\x7e\
\x09\x64\x4c\x04\xca\x1c\x32\xc8\xbd\x08\xb2\x1a\xe4\x7e\x90\x5e\
\x19\x70\x6a\x16\xf1\x04\xef\x5c\xaa\xd6\x97\x7e\x9d\xfa\x4e\x44\
\x46\x5c\xe5\x13\xc7\x51\x90\x35\x20\x73\x40\x46\x34\xaf\xef\xda\
\x0a\x9e\x70\xc0\x27\xfa\x04\xfe\x2b\x48\x97\x88\x9c\x3a\x29\xe4\
\xc2\xfe\x0c\x48\x35\xc8\x28\xf7\xf1\x84\x07\xff\x91\x47\x90\x4d\
\x20\x37\x47\xf8\xb8\xcb\x07\xd9\x6d\xa9\x72\xb3\x05\x64\xb0\xbb\
\x78\xc2\x1b\xb3\x87\x21\x29\x68\xe1\xaa\x0c\xcc\x63\x83\x41\x4e\
\x59\x32\xe4\x59\x90\x71\x6e\xe2\x09\x6f\xc8\x0a\x8f\xa0\x8e\x81\
\x74\xcb\x80\x63\x07\x82\xec\xb1\x64\xc8\x3a\x90\x6b\xdc\xc3\x13\
\x0e\x70\x99\x8a\x20\xaf\xa0\x6a\x32\xb4\x9c\x28\x00\x99\xa9\xe6\
\xf0\xb0\x86\xfc\xd0\x3d\x3c\xe1\xb6\x95\x3e\x0f\x00\xea\xde\x0c\
\xae\x15\x13\x20\xe5\x20\x8b\x40\xbe\x6d\x55\x43\xf5\xc3\x8d\x20\
\x45\x6e\xe1\x09\x0e\x70\x56\xc0\x48\xfb\xc3\x50\xc8\x8e\x92\xbb\
\x82\x8c\x05\x79\x49\x95\x30\x1b\x3d\x62\x1e\xeb\x16\x9e\x60\x60\
\xae\x35\x54\x8c\xea\x0d\xa0\xd6\x64\xc9\xa9\xc9\xdc\x53\xd5\x61\
\xff\x31\xe0\x7d\xc4\x2d\x3c\xfe\x05\xe7\x81\x7c\x69\x10\x3a\x0e\
\x64\x83\xa1\xcd\x94\x1c\x71\x2c\x20\xcf\x18\xb0\x3e\xe5\x16\x1e\
\xfb\x02\xdf\x53\xed\x7a\x81\xfc\xa5\x69\x77\x0a\xa4\x77\x8e\x38\
\xb5\x8f\x41\xa7\x0a\xb7\xf0\xf8\x13\x36\x04\xe4\xbc\x46\xd8\x81\
\xa4\xf7\x95\x26\x1b\xc0\x6d\xb0\x68\x88\x67\x55\x79\x2d\x48\xdf\
\x22\x03\xce\x7b\xdc\xc2\xe3\x2f\x2d\xdf\x65\x28\xd4\x97\x07\xa8\
\x81\xda\x9a\xaf\x5a\xf6\x79\x37\x82\xdc\xa1\xa6\x09\xaf\x7d\x4d\
\x2f\xc5\x95\xb9\x85\xc7\xbb\xa0\x17\x0d\x82\xde\xd0\x54\x9c\x6a\
\x0d\x95\x92\x7e\x16\x9d\xda\xfa\xf5\x9a\x45\x20\xb7\x69\xea\xcd\
\x85\x20\x8f\x19\x2a\x62\xfb\xdd\xc3\xe3\x0d\xe0\x50\x43\x46\xb6\
\x0f\xa4\x93\xa6\xff\x78\x43\x40\x6c\x55\x6b\x38\x9b\x4e\x4d\x5e\
\xdb\xfd\x04\xb2\x59\xd5\xaa\x6b\x40\xb6\x79\x2c\x9c\x3c\xe9\x1e\
\x1e\x33\xb8\x42\x05\x40\xb7\x2f\xe8\x65\xc3\x77\x85\x01\xec\xcc\
\x08\x9d\x1a\x94\xf7\x83\x74\x74\x0f\x8f\x19\xdc\x42\x83\xa0\x45\
\x1e\x95\x2c\x06\x39\x6c\x58\xdb\x0e\xc8\x21\xa7\xd6\xba\x8b\x47\
\xdf\xe0\x26\x43\x29\x6b\xb7\xcf\x48\xbe\x5d\x25\x54\xba\xb7\xec\
\xf2\x02\x1a\xb1\x12\xe4\x77\x4b\x06\xdc\x64\x61\x9e\xcf\x22\x9e\
\xf4\x17\x2f\x03\xd9\x6b\x98\x17\x6e\x08\xa0\xec\x62\x83\x02\x95\
\x21\x6b\xab\xc3\xd5\xc1\xae\xf5\x20\x27\x7c\x6e\x6d\xd5\x58\x2e\
\x09\x66\x03\x4f\x82\x76\xf0\x47\x1e\xa5\x40\x99\xe2\xee\x40\x17\
\xa0\xb3\x3a\x3a\x78\x16\xf8\x53\xbd\x25\xbf\x3f\x43\xc6\x88\x1a\
\x4f\xbb\x70\x6a\x7c\x92\x3c\xa6\xd8\xa9\x31\x39\xec\xd4\x65\xea\
\x39\xfd\xba\x65\x00\x02\x2c\x88\x40\x31\x5d\x26\x31\xc1\xe2\xd8\
\x97\x80\x93\x34\x9f\xf8\x1b\x18\x21\xe6\xff\xa4\xb6\x06\xf2\x74\
\x94\xb1\x13\x70\x1f\x70\x0e\x78\x00\xa8\x04\x2e\x3a\x10\xb1\xd5\
\xc0\x92\x14\xbf\xef\xb3\x38\x76\x02\xe8\x0f\xcc\x07\xbe\x00\x06\
\x01\x75\x01\xc7\x1c\x99\xf4\x7d\xa7\x46\x87\xd0\x01\xd2\xb2\xd3\
\x32\x2b\x82\x43\x4d\x02\xb2\x20\x82\xad\xab\xa8\xc6\x4d\x37\xf6\
\x8d\xea\xf7\xe9\x39\xa0\x83\xa7\xc7\xef\x34\x60\x2f\xf0\x36\xcd\
\xff\x1a\x32\x2d\x9e\xb6\xfe\x47\xdf\xa9\xcf\x2b\x5d\x98\x53\x7b\
\x03\x63\x80\x8f\xd5\xfc\xb1\x0a\x18\x8f\xfd\x53\xd7\x51\x50\x42\
\xcd\x2f\xc9\x1c\x05\x95\xa9\xcf\x13\x2e\x38\xf5\x41\x20\x1f\x58\
\xa9\xbe\xaf\x04\x3a\x02\x93\x1c\x70\xea\x5c\xa0\x31\x05\x97\x58\
\x0c\x98\x0e\xc0\x75\x6a\xde\x6b\x00\x3e\xc9\x11\xdd\xb5\xcf\xe7\
\x3d\x20\x3f\x26\xfd\x76\x00\x64\xa7\x03\x73\x6a\x15\xc8\xb0\x14\
\x9c\x6f\x61\xec\x54\xe7\x5e\x46\xe5\x48\x5e\xa0\xbd\x53\x87\xd1\
\xfc\x87\x12\x9f\xaa\xe8\x6e\xe1\xf5\xc0\x08\x15\xa1\xb9\x4c\xc7\
\x81\x5d\x29\xb8\xc9\xc2\xd8\xcb\x81\xe1\xc0\x2d\xc0\x0b\xaa\xcc\
\x37\x3d\x47\xf4\x2e\x30\x25\x48\x00\xcf\x2b\x4e\xa6\xa9\xc0\xbc\
\x76\x9a\x18\xb5\x04\x0c\xc0\x0e\x15\x28\xaf\x00\x6b\x55\xd0\xe7\
\xe4\x9c\x5a\x08\x4c\x06\xbe\x01\x6e\x4d\xc1\x3f\x00\x0f\xa9\xb9\
\x25\x26\x78\x0d\x38\x0a\xbc\x9c\x03\x36\x49\x7b\xa7\xde\x09\xf4\
\x00\x9e\x06\xb6\xa7\xb8\xbe\x04\x78\x17\x18\x0d\x6c\x0b\x09\x62\
\x10\x30\x31\xc5\xef\x9b\x81\x33\x21\xc6\xed\xa3\xa6\x89\x64\x3a\
\xac\xee\x34\x9b\x74\x41\x39\x74\xa9\xaa\x58\xad\xcd\xc5\x44\x69\
\x9d\xda\xcf\xeb\x9c\xe6\xfa\xe5\xea\xe5\xa8\xea\x08\x92\x8e\x16\
\xbe\x3e\xa2\x71\x67\x47\x94\xc0\x14\x80\xfc\x02\xf2\xbd\x85\xf7\
\xad\xc2\x24\x4a\xf1\xd6\x5b\x1b\xa4\x78\x97\x26\x76\x6a\x4c\xb1\
\x53\x63\xca\x0a\xfd\x0b\x89\x93\x29\xff\x5f\xf6\xf7\xb5\x00\x00\
\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x7d\x89\
\x47\
\x49\x46\x38\x39\x61\xc8\x00\xc8\x00\xf7\xff\x00\xf4\xf4\xf4\xf6\
\xf6\xf6\x0b\x0b\x0b\xf5\xf5\xf5\xf7\xf7\xf7\x0c\x0c\x0c\xf8\xf8\
\xf8\xf3\xf3\xf3\x0d\x0d\x0d\x0a\x0a\x0a\xf2\xf2\xf2\x0e\x0e\x0e\
\x0f\x0f\x0f\x09\x09\x09\xf1\xf1\xf1\xf9\xf9\xf9\x10\x10\x10\x2b\
\x2b\x2b\xd6\xd6\xd6\x2a\x2a\x2a\xd7\xd7\xd7\xd5\xd5\xd5\x08\x08\
\x08\x2e\x2e\x2e\x2d\x2d\x2d\xd9\xd9\xd9\xd4\xd4\xd4\x28\x28\x28\
\xf0\xf0\xf0\xad\xad\xad\xd8\xd8\xd8\x29\x29\x29\x11\x11\x11\x54\
\x54\x54\xfa\xfa\xfa\xda\xda\xda\xd2\xd2\xd2\x55\x55\x55\x2c\x2c\
\x2c\x2f\x2f\x2f\xac\xac\xac\xd3\xd3\xd3\xd1\xd1\xd1\x53\x53\x53\
\x83\x83\x83\x30\x30\x30\x52\x52\x52\xab\xab\xab\xb0\xb0\xb0\xb2\
\xb2\xb2\xae\xae\xae\x56\x56\x56\xaa\xaa\xaa\x51\x51\x51\x57\x57\
\x57\x80\x80\x80\xa9\xa9\xa9\xb3\xb3\xb3\x31\x31\x31\x59\x59\x59\
\x86\x86\x86\x50\x50\x50\xd0\xd0\xd0\x58\x58\x58\x81\x81\x81\x32\
\x32\x32\xaf\xaf\xaf\xb1\xb1\xb1\xdb\xdb\xdb\x82\x82\x82\xfb\xfb\
\xfb\x84\x84\x84\x85\x85\x85\x12\x12\x12\x7e\x7e\x7e\x27\x27\x27\
\x4f\x4f\x4f\xef\xef\xef\x7f\x7f\x7f\x5a\x5a\x5a\xdc\xdc\xdc\x7d\
\x7d\x7d\x07\x07\x07\x7b\x7b\x7b\x7c\x7c\x7c\x33\x33\x33\xa8\xa8\
\xa8\x26\x26\x26\xa7\xa7\xa7\xb4\xb4\xb4\x4e\x4e\x4e\x87\x87\x87\
\x5c\x5c\x5c\xee\xee\xee\x88\x88\x88\xb5\xb5\xb5\xcf\xcf\xcf\x5b\
\x5b\x5b\x25\x25\x25\xdd\xdd\xdd\x89\x89\x89\xa6\xa6\xa6\x13\x13\
\x13\xde\xde\xde\xce\xce\xce\x06\x06\x06\xed\xed\xed\xfc\xfc\xfc\
\x7a\x7a\x7a\x4d\x4d\x4d\xb6\xb6\xb6\x79\x79\x79\x5d\x5d\x5d\x34\
\x34\x34\x5e\x5e\x5e\x4c\x4c\x4c\xb7\xb7\xb7\xa4\xa4\xa4\x35\x35\
\x35\xcc\xcc\xcc\x8a\x8a\x8a\xdf\xdf\xdf\x78\x78\x78\xcd\xcd\xcd\
\x8b\x8b\x8b\xcb\xcb\xcb\x14\x14\x14\xa5\xa5\xa5\x8c\x8c\x8c\xec\
\xec\xec\x23\x23\x23\x5f\x5f\x5f\xb8\xb8\xb8\x76\x76\x76\x24\x24\
\x24\x05\x05\x05\xe0\xe0\xe0\xa3\xa3\xa3\x4a\x4a\x4a\x36\x36\x36\
\xb9\xb9\xb9\x8d\x8d\x8d\xa2\xa2\xa2\x4b\x4b\x4b\xfd\xfd\xfd\x60\
\x60\x60\x77\x77\x77\xa1\xa1\xa1\xeb\xeb\xeb\x22\x22\x22\xba\xba\
\xba\x75\x75\x75\xca\xca\xca\x61\x61\x61\xc9\xc9\xc9\x04\x04\x04\
\x49\x49\x49\x8e\x8e\x8e\x37\x37\x37\xa0\xa0\xa0\xfe\xfe\xfe\xe1\
\xe1\xe1\x74\x74\x74\x15\x15\x15\x48\x48\x48\xbb\xbb\xbb\x8f\x8f\
\x8f\xe2\xe2\xe2\x21\x21\x21\x73\x73\x73\x62\x62\x62\xea\xea\xea\
\x90\x90\x90\x9e\x9e\x9e\x38\x38\x38\x20\x20\x20\x63\x63\x63\x9f\
\x9f\x9f\x72\x72\x72\xe3\xe3\xe3\xc8\xc8\xc8\x1f\x1f\x1f\x46\x46\
\x46\xe9\xe9\xe9\x47\x47\x47\xbc\xbc\xbc\x03\x03\x03\x91\x91\x91\
\x71\x71\x71\x9d\x9d\x9d\x16\x16\x16\xe8\xe8\xe8\x45\x45\x45\xbd\
\xbd\xbd\x39\x39\x39\xe4\xe4\xe4\x70\x70\x70\xc7\xc7\xc7\xe5\xe5\
\xe5\xe6\xe6\xe6\x93\x93\x93\x44\x44\x44\x6f\x6f\x6f\x9c\x9c\x9c\
\x64\x64\x64\x94\x94\x94\x1e\x1e\x1e\xe7\xe7\xe7\xc5\xc5\xc5\x9b\
\x9b\x9b\xbe\xbe\xbe\x92\x92\x92\xc6\xc6\xc6\x3a\x3a\x3a\x65\x65\
\x65\x1d\x1d\x1d\x95\x95\x95\x43\x43\x43\x17\x17\x17\x99\x99\x99\
\x98\x98\x98\x66\x66\x66\x42\x42\x42\x96\x96\x96\x6e\x6e\x6e\x9a\
\x9a\x9a\xbf\xbf\xbf\x97\x97\x97\x02\x02\x02\x1c\x1c\x1c\x3c\x3c\
\x3c\x3b\x3b\x3b\xc4\xc4\xc4\xc0\xc0\xc0\x6d\x6d\x6d\x3d\x3d\x3d\
\xc1\xc1\xc1\x40\x40\x40\x67\x67\x67\x1b\x1b\x1b\x41\x41\x41\x68\
\x68\x68\x3e\x3e\x3e\x18\x18\x18\x3f\x3f\x3f\xc2\xc2\xc2\x6c\x6c\
\x6c\x69\x69\x69\x6a\x6a\x6a\xc3\xc3\xc3\x6b\x6b\x6b\x01\x01\x01\
\x1a\x1a\x1a\x19\x19\x19\xff\xff\xff\xff\xff\xff\x21\xff\x0b\x4e\
\x45\x54\x53\x43\x41\x50\x45\x32\x2e\x30\x03\x01\x00\x00\x00\x21\
\xf9\x04\x05\x0a\x00\xff\x00\x2c\x00\x00\x00\x00\xc8\x00\xc8\x00\
\x00\x08\xff\x00\xfd\x09\x1c\x48\xb0\xa0\xc1\x83\x08\x13\x2a\x5c\
\xc8\xb0\xa1\xc3\x87\x10\x23\x4a\x9c\x48\xb1\xa2\xc5\x8b\x18\x33\
\x6a\xdc\xc8\xb1\xa3\xc7\x8f\x20\x43\x8a\x1c\x49\xb2\xa4\xc9\x93\
\x28\x53\xaa\x5c\xc9\xb2\xa5\xcb\x97\x30\x63\xca\x9c\x49\xb3\xa6\
\xcd\x9b\x38\x73\xea\xdc\xc9\xb3\xa7\xcf\x9f\x40\x83\x0a\x1d\x4a\
\xb4\xa8\xd1\xa3\x48\x93\x2a\x5d\xca\xb4\xa9\xd3\x87\x0d\x2c\x48\
\x95\x22\x25\x8d\xd5\xa7\x58\x3d\x36\xd8\x2a\xd5\x02\x55\xab\x69\
\x0e\x1d\xca\x4a\xf6\x62\x82\xad\x51\xa7\x56\xb5\x2a\x76\x6c\xd9\
\xb7\x10\x13\x9c\xe5\xaa\x16\x6c\xdb\x4d\x70\xf3\x32\x94\x8b\xb6\
\xeb\x57\xb6\x62\xf1\xea\x1d\x6c\x50\x00\x5f\xba\x5e\xd7\x86\x0d\
\x2c\x98\xb0\x63\xc3\x73\xd3\x26\xb6\xcb\xd8\xb1\x65\xc8\x7d\xeb\
\x02\x3e\xb4\xa9\xb1\x65\xbd\x90\xe7\xfa\x55\x7c\xd7\xf3\x67\xb8\
\xa1\x11\xff\x5d\xcc\xd9\xf4\xe9\xb2\xa9\x25\xaf\x66\xec\xfa\x75\
\xd6\xd8\xa3\x29\x77\xae\x6d\xfb\xa9\x00\xcc\xb2\x49\xb7\xe6\xdd\
\xbb\xe9\xef\xc3\xb9\x01\xef\x2e\xfe\xf6\xb8\x68\xcd\x8b\x97\x33\
\x27\xeb\x5c\xb5\x70\xe9\xd3\xb1\x56\x0f\xbe\xb9\xb3\xae\xec\xb7\
\x81\x27\xff\x2f\xfd\x1d\xbc\x6f\xf1\x9a\xc9\x9b\x2f\x29\x22\xe5\
\xf6\xf1\x8c\xcb\xaf\xef\xd8\xc5\x1f\x8d\x3f\xb7\x7c\xf8\x5b\x75\
\x72\x7b\xda\xbf\xea\xcd\xc7\x11\x3a\x56\xc8\xa1\xc8\x2b\xf0\x64\
\x82\xc6\x37\xfd\xbd\x37\x59\x74\xde\x09\xb8\x11\x3a\x86\x64\x53\
\x09\x2a\xa8\xbc\xf2\xca\x07\xe6\xfc\x11\x40\x49\x05\x38\x08\xe0\
\x70\xf2\x49\x68\x11\x3a\x62\x08\x52\xc9\x8a\x18\x6a\x58\x4b\x2d\
\x64\x00\x40\x52\x88\xe8\x8d\xb8\x5b\x89\x26\x4e\x04\xcd\x15\x82\
\xf4\xc8\x62\x8b\xaf\xd4\x52\x85\x15\x33\x8a\xb8\x56\x7c\x38\xe6\
\x08\x11\x34\x4b\x18\x62\x48\x8f\x2a\x5e\x08\x64\x2d\x18\xf0\xc1\
\x5f\x48\x34\x22\xf7\x20\x92\x4a\xea\xb8\x84\x18\x62\x38\x09\xe5\
\x8f\x1a\x06\x59\x4b\x2b\x22\x65\xf9\x9c\x8d\x9b\xe8\x92\x64\x97\
\x0c\x6d\x70\x05\x98\x61\x3e\xe9\xa3\x94\x2e\xd6\x62\x4e\x2c\x4d\
\x80\xa4\x26\x5d\x6c\xba\x09\x67\x44\x57\x14\x4a\xa7\x98\x51\xe2\
\x69\x66\x2d\x80\xac\xf1\xd1\x9f\xff\x1d\xd9\x9a\xa0\x83\x3a\xd4\
\xc9\x12\x4b\x18\x0a\x26\xa2\x2b\x2a\xfa\xa2\x2b\x38\x3c\x1a\xa2\
\x96\x81\xbe\x59\xe9\x41\x21\x60\x9a\xe9\x9c\x9b\xda\xd9\xe9\x94\
\xb5\x54\xff\xb2\x45\x20\x1d\x15\x90\x25\xa0\x92\x7a\x67\xea\xa9\
\x05\xc1\xb2\x81\xaa\x9a\xd6\x79\xa7\xa7\xb5\x5c\x31\x49\xad\xb7\
\x46\xaa\x5c\x9b\xbb\xf2\x3a\x90\x0d\x1b\xfc\x8a\x69\xb0\x9c\x12\
\x5b\xcb\x22\xc8\x50\xb2\x91\xad\xc7\xe1\xca\x96\xae\xcd\x3a\xeb\
\x0f\x21\x1f\x44\x0b\x2c\xab\xc2\x46\x09\xab\x33\xce\x4c\xb3\x11\
\x02\xc9\xd6\x85\x24\x39\xe2\x2e\xf4\x41\xb9\xe6\xae\x7a\xa8\xab\
\xc4\x3a\x73\x4e\x19\xed\x61\x04\x6f\x75\xf2\x4e\xaa\x0b\xbd\xf5\
\x26\x44\x03\x30\xf8\x4a\x5b\x28\xab\xd5\xae\xeb\x0c\x0f\x0e\x08\
\xfc\x67\xc1\xba\x22\x9c\x30\x42\xe1\xdc\x1b\xad\xc3\x9a\x46\x9c\
\xa1\x99\xce\x5c\xf0\x87\xc5\xa3\x9e\x85\x31\xb3\x1a\x6f\x6c\x10\
\x25\xe3\xd0\xd3\xf0\xb4\x21\xf3\xdb\xe2\x8b\xec\x9e\xc0\xc7\x2d\
\x16\xc1\x9b\xb2\xb2\xf3\xba\xac\x90\x15\x41\x78\x0c\x32\xc4\x36\
\xe7\xc9\xee\x35\xdc\xf4\xcc\x2d\x5f\x2b\xbb\xd9\xb2\xd0\x05\xa9\
\xd1\x88\x09\x46\xd3\x8c\xb4\xba\x23\xe3\x7c\x4d\x35\x93\x1c\x40\
\x11\x02\x03\x1b\x06\x34\x67\x52\x4f\x4d\x75\x41\x1d\x64\x93\x35\
\xcd\x9b\xde\xb9\xee\x35\xd7\xe0\xf1\xc0\x44\x64\xdf\x8a\x71\xda\
\x6b\x27\xff\x04\x4a\x33\x13\xbc\xad\x6f\x98\x72\x77\xbd\x74\x1c\
\x44\x4a\xb4\x40\xd9\x2a\x7b\xa5\x1c\xdf\x7d\x23\xd4\xc4\x24\xc9\
\x18\x0d\x72\xdc\x5c\x93\xec\xcc\x35\x62\x6c\x71\xe5\x43\x8b\xc7\
\x7b\x64\xc6\x6a\x47\x4e\x90\x23\x11\xdc\x8b\x2f\xdc\x84\x67\xee\
\xf5\x35\xaf\x7c\x12\x51\xe8\xa3\x72\x35\x3a\xcb\xfb\x98\x9e\x10\
\x25\xa6\xd8\x11\xf8\xea\x83\x27\x4d\x32\xdd\x9e\x8c\xa3\x06\xe8\
\x3e\x9b\x1d\xd5\xed\x52\xe7\xae\x7b\x42\x28\xc8\xf3\x7b\xbe\x21\
\xcb\xed\xe2\xd2\xe5\x94\xb3\x0b\xf2\x03\x8b\xc6\x3c\x39\xe4\x38\
\xff\xfc\x41\x01\xb0\x32\xc1\xf4\x97\xb7\xce\xe2\xf5\x9b\x97\x23\
\x4c\x19\xa0\x34\xb4\x40\xe8\xca\x3b\x1e\x96\x77\xe0\x8b\x3f\xbe\
\x41\x03\xe0\x60\x0b\xfa\xac\x73\xd5\xcd\x6a\xb1\xb9\x6b\x94\xe3\
\x1d\x48\xe8\xd3\x42\x18\x40\x3f\xa8\x8d\x2e\x6d\xfa\xdb\x9f\x41\
\x7a\x71\xbe\xc0\x51\x0f\x62\x3e\x1a\x60\xfb\xca\xf1\x81\x44\x30\
\x84\x81\xdd\x53\xd9\x03\x0f\xb6\x8f\x08\x4a\x90\x20\xab\xc0\x86\
\xf4\x00\x58\x3d\x15\xdd\x0c\x7b\xef\x68\x01\x20\x78\x96\x10\x10\
\xea\x6d\x84\xe1\x33\xe1\x09\x09\x82\x03\x57\x9c\x2f\x6b\x2d\xbc\
\xd0\xf5\xff\xe8\x76\x40\x7e\x60\x43\x21\x20\xec\xde\xf2\xbe\x75\
\xb0\x1c\xee\x30\x21\x1c\xe8\x44\x04\x7e\x08\x3c\x0c\xae\x2f\x48\
\x1b\x7c\x87\x30\x26\x31\x00\x84\x40\xc0\x86\x66\x73\x5c\x60\x9a\
\x58\xc2\x27\x26\x04\x12\x1d\xb0\xc5\x14\x2d\xe8\xb0\xb8\xad\xcf\
\x6b\x45\xec\x07\x0f\x3e\x74\x10\x30\x8a\x30\x3a\x24\xd4\xa1\x19\
\x09\xc2\x8d\x08\xac\xb1\x8a\x6e\x14\x22\x01\xdb\xf7\x0e\x7e\xb4\
\xe0\x64\x75\x6c\xe0\x12\x27\xe5\xc4\x3d\x26\xa4\x0b\xbd\xc8\xc6\
\x1f\xcb\x35\xad\x40\x66\x88\x80\x06\x7c\x47\x21\x97\x90\x10\x45\
\x8a\x11\x7f\x7a\x74\x24\x41\xca\xa0\x83\x49\xb6\x91\x70\x78\xc2\
\x64\x1c\xf3\x91\x10\x25\x7e\x52\x6a\xa2\x64\x48\x20\x3a\x51\x05\
\x3f\xfe\xd0\x5c\x56\xbc\xa4\x2a\x0b\x69\x87\x85\x84\xb1\x2a\x68\
\x8b\xe5\x43\x64\xe0\x0d\x5b\xb2\x31\x53\x6e\xbc\x24\x21\xf9\xa1\
\x03\x61\x8a\x44\x04\xc8\x30\x81\x09\xfe\x88\xcb\x64\x62\x31\x93\
\x13\x70\xa6\x48\x0e\x80\x05\x4e\x4c\x73\x8a\x1e\x43\x26\x2a\x95\
\x69\xc0\x10\x68\x73\x24\x9f\xc0\x80\x34\xc1\x49\x49\x43\x3d\x49\
\x90\xce\x28\xc7\x2f\xce\x29\x12\x4a\x34\x63\x1d\xeb\xbc\xa5\xbe\
\xde\x89\xff\x0a\x4c\xd2\x93\x24\x1d\x58\x87\x3a\x6d\xd9\xce\x39\
\x19\x42\x90\x68\xfa\xe7\x36\x59\x71\x01\x75\x4e\xd3\x82\x95\x74\
\x61\x2c\x14\x4a\x12\x11\xa0\x80\x13\x18\x18\xe8\xf4\x90\x29\x08\
\xd9\x51\xb4\x24\xe1\xb8\x40\x43\x1f\x0a\x51\x63\x7d\xd4\x24\x81\
\x08\x07\x30\x1a\xaa\x51\x73\x6c\xc0\x11\x27\x45\x09\x16\x62\x10\
\x89\x2a\x60\xe0\x09\xb6\xc8\x82\x07\x63\x7a\x92\xe3\x21\xe2\x0e\
\x78\xb0\xc4\x31\xe8\xc8\x53\x94\x40\x42\x20\x44\x2d\xaa\x52\x97\
\xca\xd4\xa6\x3a\xf5\xa9\x32\x01\x86\x54\xa5\x9a\x8c\xaa\x5a\xd5\
\xaa\xd9\xc8\xaa\x56\xb3\xe1\x8d\xae\x7a\xd5\x1b\xf0\x08\x2b\x3c\
\xda\x41\xd6\x76\xd0\xe3\xac\xf4\x90\x87\x5a\xd7\xb1\x0e\x73\x98\
\x23\x28\x06\x88\x6b\x5c\x09\x40\xd7\xba\x06\xe0\xae\x78\x0d\xc0\
\x00\xf6\xca\x57\xbe\x02\xe0\xaf\x80\x0d\xac\x60\x0f\x40\x58\xc2\
\x9e\xc4\x16\x88\x9d\xaa\x62\x15\x7b\xd5\xc6\x6e\x35\xab\x5f\xed\
\xaa\x58\xc7\x5a\x56\xb4\xae\x95\xad\x3d\x91\x6b\x5d\xe9\x9a\x57\
\xbc\xf6\xb5\xaf\x82\x0d\x2d\x60\x0b\x4b\xda\xd2\x1a\x76\x24\x88\
\x4d\xad\x6a\x53\xbb\xd8\xd6\x36\xb6\xaa\x8f\xe5\xea\x57\x27\x5b\
\xd9\xb3\xff\xaa\x75\x27\x9b\x25\x40\x67\xf5\xfa\xd9\x01\x88\x76\
\xb0\xa6\x0d\x6e\x61\x15\x40\xdc\xe2\x8a\x04\x17\xc8\x4d\xae\x72\
\x57\xcb\x5c\x5b\xb4\x76\xaa\xaf\x4d\xc6\x63\x67\x1b\xd6\xda\xe6\
\x84\xb3\x79\xed\xed\x6f\x47\x2b\xdc\xd2\x16\xf7\xbb\xe0\x05\x6f\
\x48\x48\x41\xde\xf2\x2a\xf7\xbc\xe7\x6d\xae\x6a\x9f\x0b\x0c\xc7\
\x6a\x95\xba\xf0\xc8\xc9\x5d\x3f\xbb\xdd\xee\x92\x36\xbc\xf8\xcd\
\x6f\x71\x1d\x50\xb1\x8f\x94\xf7\xbf\x00\x0e\x30\x79\xd1\x8b\x5e\
\xf5\x3a\x77\xb1\xee\x95\xed\x4d\xf6\xfa\x5b\xfb\xea\xf7\xc1\xc4\
\xe5\xaf\x84\x27\x4c\x61\xfe\x7e\x84\x13\x18\xce\xb0\x86\x33\x2c\
\xe0\x0e\x03\x98\xc0\xc8\x6d\xae\x6b\x93\x71\x93\xbf\x76\x17\xc2\
\xe0\xad\xb0\x8a\x57\xcc\xe2\x8f\x28\xe2\xc5\x30\xde\xb0\x8c\x67\
\x3c\x63\x0f\x07\x98\xc0\xaa\xbd\xc9\x01\x50\xcc\xe2\x1e\xb3\x98\
\x03\x40\x0e\xb2\x90\x87\xcc\x01\x17\xc3\xf8\xc8\x48\x4e\xb2\x92\
\x93\x4c\xe3\x26\x77\xf8\x26\x3e\x56\x31\x91\xa7\x4c\xe5\x2a\x57\
\xf9\x23\x8f\xc8\xb2\x96\xb7\xcc\xe5\x2e\x7b\x59\xcb\x4b\x0e\x73\
\x98\x6f\x62\xe5\x32\x9b\x99\xca\x4d\x48\xb3\x9a\xd7\xcc\x66\x05\
\x76\x64\xff\x0e\x70\x8e\xb3\x9c\xe7\x4c\xe7\x3a\xdb\xf9\xce\x78\
\x86\xf3\x4d\xda\xcc\xe7\x3e\xfb\xf9\xcf\x80\x6e\xf3\x47\xf2\x4c\
\x68\x3b\xb7\xe1\xd0\x88\x4e\xb4\xa2\x17\xad\xe8\x9b\x74\xe1\xd1\
\x90\x8e\xb4\xa4\x27\x4d\xe9\x4a\x5b\x7a\xd2\x82\xf6\x08\xa3\x37\
\xcd\x69\x45\x6b\xe1\xd3\xa0\x0e\xb5\xa8\x41\xcd\x84\x52\x9b\xfa\
\xd4\x37\x09\x84\x1a\x56\xcd\xea\x56\xbb\xfa\xd5\x97\x8e\xb5\xac\
\x1f\xfd\x91\x36\x8c\xfa\xd6\xb8\xbe\xf5\xa9\x77\xcd\xeb\x1e\xf8\
\xfa\xd7\x3d\xa8\x81\xb0\x87\x7d\x13\x4a\x18\x9b\x12\x81\x48\xb6\
\xb2\x97\x9d\xec\x57\x3b\xfb\xd9\xd0\x56\xc3\xa5\x41\x92\x6b\x5e\
\x5b\xdb\xda\xc0\xce\x76\xb0\x87\xcd\x6d\x17\x78\xfb\xdb\x2b\x58\
\x41\x4e\x56\x41\xee\x55\x1c\xfb\xdc\xc6\x66\xb6\xba\x99\x1d\xed\
\x76\xbb\x3a\x24\xd7\xc6\xb6\xb6\xb5\xcd\xed\x7a\xd7\xe0\xdb\xf8\
\x0e\xb7\xbe\x43\xc0\xef\x10\x94\x20\x27\xb7\x08\x78\xc0\xcb\x4d\
\x70\x74\x1b\x7c\xdd\x08\x57\x77\xbb\x45\xc2\x84\x79\x3b\xdc\xde\
\xf6\xc6\x77\xbe\xf5\x1d\xee\x7e\xf3\xbb\x04\x18\x9f\x81\xc6\x77\
\xf2\x8b\x8e\xff\x42\xe0\x20\x27\xb8\xc8\x0d\x4e\xf2\x84\x9b\x9c\
\x56\x23\xff\x01\x36\xc4\x21\x2e\x71\x89\x53\xbc\xe2\x16\xf7\x37\
\xc6\x4b\xa0\xf1\x19\xd8\xe0\xe6\x3f\xe8\xc9\x33\x76\xfe\x0c\x8f\
\x77\x1c\xe4\x02\x17\xb9\xd0\x49\x4e\xf4\x84\x9f\x84\xe5\x2d\x9f\
\xf8\xcb\x63\x7e\xf1\x99\xd3\x5c\xe3\x37\xb7\xc1\x0f\xa6\xbe\x83\
\xa0\x1c\xe3\x18\x3c\xdf\xb9\xcf\x7f\x0e\xf4\x81\x0b\x7d\xe4\x44\
\x47\x37\x54\xc7\x4e\xf6\xb2\x9b\x3d\x2f\xf1\x3b\x3b\x47\x1c\x75\
\x8a\x3b\x10\xc0\x51\x01\x63\x89\x02\x8c\xe0\x8f\x2e\xc6\x72\x0c\
\xc7\xe0\x46\x2b\xee\xe1\x85\x17\x1c\x03\x0a\x2c\x09\x44\x13\x88\
\x90\x07\x4a\xcc\x42\x04\x6a\x70\x94\x19\xc7\x00\x8e\x46\xc4\xe3\
\x1e\xf8\xd0\x87\x3d\xde\xb0\x8b\x0c\xa4\xfd\x24\x88\x18\x01\x05\
\x3c\x90\x81\x0c\x8c\x60\x18\x50\x28\xf2\x13\xcf\x00\x8e\xc7\x47\
\xde\x1e\xea\x00\x87\x32\x88\x31\x85\x14\xa0\xe4\x0c\x1a\xa8\x80\
\x04\x28\xb0\x79\xcf\x8f\x20\x0f\x5d\x50\xfc\xfe\xce\xa0\x0c\xc8\
\x9f\x3e\xf5\xca\xe0\x85\x2c\x52\xf1\x8d\x63\x98\x04\x0a\x2a\x48\
\x41\xec\x65\x5f\x7b\xdb\x1f\x6f\xf7\xbd\xff\xbd\xea\x89\x21\xfc\
\x54\x5c\xa2\x10\x5e\xf0\x81\xee\x41\x42\x04\x30\xf8\x40\x05\x24\
\x50\x3e\xff\xf3\x9b\x9f\x07\x07\x5c\x3e\x72\xbc\x8f\xbc\xe4\x81\
\x4f\x7d\x59\x88\xe2\xfa\x7a\xa0\xfc\x30\x44\xe2\x81\x3b\xa0\xc1\
\xfb\xe0\x17\xbf\x04\x66\xef\x01\xce\x8f\x80\x12\x47\x85\x7e\xc4\
\x20\x7d\xd3\x37\x7c\xef\x57\x08\xf1\x37\x05\x51\x10\x0e\x21\x71\
\x06\x98\xd0\x07\x7b\x70\x7f\xdf\x17\x7e\xcb\x37\x7b\xb5\x17\x7a\
\x02\xa8\x0f\xeb\x37\x7d\xd5\x77\x80\xf1\xc7\x06\x54\x10\x05\x4e\
\x40\x00\x20\x51\x0c\x9a\xf0\x80\x11\x88\x7f\x14\x18\x7b\xfb\xb7\
\x79\x1e\x00\x05\x94\xb0\x7d\x09\x73\x06\xc4\xb0\x7e\xec\xd7\x81\
\xf0\xf7\x06\x20\x28\x82\x37\x80\x05\x1f\x31\x00\xd4\x40\x0b\x27\
\x08\x81\x12\x08\x7e\x14\x58\x01\xe3\xc7\x79\xf5\xe1\x32\x67\xc0\
\x0b\xf6\x80\x7a\xaa\xb7\x7a\x38\x88\x80\x3a\x18\x82\x4a\x70\x03\
\x40\xc0\x07\x1f\x61\x0c\xd0\x50\x0c\x42\x88\x09\x77\x90\x82\xdf\
\x97\x7f\x15\xc8\x7f\x63\xd0\x04\x01\x28\x2e\x4d\x88\x7a\x37\x38\
\x85\x1f\xa8\x80\x57\x08\x04\x2c\xe0\x2e\x1e\x71\x0c\xe8\x40\x0d\
\x5e\xa8\x09\x7d\x10\x86\x45\x48\x86\x2c\x68\x81\x1e\x40\x09\xe7\
\x57\x29\x67\x20\x0b\x50\xc8\x81\xc3\x97\x0a\x1e\xa8\x83\x53\x40\
\x05\x4a\xff\xe0\x04\x40\x50\x04\x47\xb0\x3d\x1e\x31\x0b\xd0\x00\
\x0d\x78\x38\x84\x7c\xe8\x7d\x13\x98\x02\xe2\x37\x7e\x18\xc8\x2b\
\x85\xa8\x0e\xc0\x27\x85\x06\x78\x7d\x92\xf0\x86\x8e\xe8\x04\x37\
\x50\x04\x2c\x80\x04\x23\xb0\x10\xcb\xd0\x0a\x9f\xe0\x08\x75\x80\
\x05\x38\xf0\x02\x1d\xb0\x10\x94\xd0\x07\xe8\x80\x89\x5f\xb8\x87\
\x62\xd8\x89\x9f\xd8\x82\x19\xb0\x0a\x74\x37\x28\x79\x20\x0b\xa9\
\x37\x7d\xed\xa7\x88\xa8\xa8\x8a\x3c\x28\x87\x47\xc0\x03\x0a\xb1\
\x0d\xd1\xd0\x0b\xb4\x98\x08\x75\x50\x06\x38\x40\x03\x28\x20\x03\
\x30\xe0\x37\xd4\x90\x0f\x77\x98\x87\x0f\xb8\x89\x2a\xb8\x82\x48\
\xc8\x7f\x4b\xd8\x25\x79\x90\x0a\xcd\x28\x85\x53\x98\x8a\x8c\x68\
\x85\x58\x28\x89\x48\x80\x02\x09\x31\x0e\xd8\xd8\x0b\xb1\x30\x09\
\xdc\x58\x06\x56\x00\x8e\xe2\x18\x03\x09\x31\x06\xd0\x90\x0f\x98\
\x88\x8e\xc2\x78\x7f\xeb\xa8\x7c\x65\x08\x05\x89\xa7\x24\xf1\x58\
\x8a\xed\x77\x8a\x85\x60\x8f\x6c\xd0\x88\x51\xf0\x88\xad\xc8\x02\
\x47\xc0\x8f\x08\xf1\x0d\xdc\xf0\x8f\x01\x39\x90\x05\x19\x8e\x42\
\x30\x04\x39\x90\x10\xcf\xa0\x09\xbf\x88\x87\xc1\xa8\x8e\x63\x18\
\x7e\xc5\xff\x38\x7b\xda\x62\x22\xf1\x08\x0e\xce\x58\x7d\xd0\xb8\
\x91\xd2\x08\x92\xd4\x48\x92\x25\xc9\x0d\xe1\x90\x8d\x29\xd9\x8d\
\x2b\xd9\x01\x2d\x89\x90\x08\x01\x09\x79\x60\x8e\x0d\x59\x93\x29\
\x88\x7f\xf9\x27\x91\xed\x48\x04\x6e\xb6\x1e\x3d\xa9\x0c\xf4\x98\
\x88\x07\xc8\x91\x1e\x49\x94\xae\x68\x94\x07\x81\x0d\xe3\x80\x94\
\xb3\xb8\x94\x04\x49\x03\xba\x28\x04\x30\x10\x03\x2f\x89\x10\x6b\
\x70\x0c\x77\x50\x95\x27\x98\x8e\x57\x79\x93\xec\x28\x7b\x12\xb0\
\x0a\x32\xc8\x1c\x79\x20\x0a\x51\x48\x7d\x1d\x38\x96\xf1\x77\x8f\
\xd3\xe8\x8a\x2f\xb0\x10\x6a\xb9\x0d\xe1\xd0\x96\x02\xc9\x94\x70\
\xd9\x01\x07\x59\x97\x09\x31\x0b\x33\xe9\x90\x0f\xd9\x87\x24\xf0\
\x97\x15\xe0\x01\xef\x38\x1d\x85\xf9\x93\xb2\x60\x80\x8a\xf9\x06\
\x8c\x09\x92\x8e\xc9\x10\x26\x89\x8d\xb3\xf8\x09\x95\x49\x90\xb9\
\x88\x99\x30\xe0\x92\x0b\xf1\x00\xa1\xa0\x09\x7a\xf9\x80\x9f\xc9\
\x89\x46\xe8\x89\x1a\xb0\x7c\xff\x97\x8c\xc5\x51\x98\x60\x49\x0c\
\x19\xa9\x88\xab\xd9\x9a\xac\x18\x89\x34\xd0\x10\xb1\x99\x8d\xb4\
\x58\x9b\x56\x90\x8b\x2c\x39\x04\x50\xb9\x10\x31\x49\x0d\x34\xa9\
\x89\x7c\xff\x28\x81\x13\x88\x93\xc5\xd9\x8e\x28\xd7\x1b\xca\x19\
\x96\xa9\x00\x8d\xd1\xc8\x9a\x1d\x69\x85\xd1\x59\x04\xd3\xd9\x10\
\x6b\x99\x94\xda\x48\x9b\x2a\xa9\x9d\x32\xf0\x94\x0d\x61\x04\x88\
\x50\x95\x35\x39\x9e\xc2\x99\x95\xe7\x59\x01\x44\xd0\x05\x69\xf8\
\x19\xca\xc9\x9c\xbc\x00\x94\xef\xf7\x9e\xd0\x99\x8f\xf5\x69\x9f\
\x48\x69\x9d\xfa\xc9\x94\xdf\x88\x02\x4e\x39\x97\x0f\xf1\x0b\x7b\
\x10\x9e\xe2\x19\x81\xe4\xa9\x02\xc3\xa9\x95\x15\x70\x0b\x0b\x4a\
\x18\x79\x70\x09\xab\xd7\x9c\xee\x29\x94\xd2\xf8\x91\xd1\x59\xa1\
\xf6\x29\x99\xcb\x00\x90\xb5\x38\x90\xb8\x08\x8e\xb8\x39\x04\x10\
\x71\x0a\xbf\x99\x8e\x04\xea\x03\x7e\x49\x9c\xb1\x97\x01\x5d\x39\
\x18\x2d\xfa\xa2\xc2\x27\x96\x97\x10\x8d\xaa\x28\x9f\x58\x68\xa3\
\x0d\x71\x92\x93\xa9\xa3\x8e\xc0\xa3\x1b\xfa\xa3\x10\x21\x02\xc3\
\x10\xa2\xe8\x48\xa4\x24\x5a\xa0\xa1\x89\xa4\xa3\x79\x0b\xc8\x99\
\x17\x2d\xea\xa0\x4f\xea\x9c\xd7\x27\xa3\xf7\x48\xa5\x40\x60\xa5\
\x57\x2a\x9b\xad\x10\x0b\x3b\xda\x8d\x3d\xaa\x8b\xfd\x09\xa4\x11\
\xf1\x0c\xc5\x30\xa8\x5f\x48\xa6\x68\x50\xa2\x27\x5a\x9c\xb1\xf7\
\x7c\x6c\xff\x7a\x09\x6e\x9a\x9a\x70\x5a\x08\x72\xda\x91\x65\xc9\
\x8a\x37\x10\x2a\x12\x71\xa1\x6d\xb9\xa7\x65\xd0\xa7\x98\x29\x97\
\x12\x21\x02\x88\x40\x0b\x5e\x18\x8c\x7b\x58\xa4\x7e\x69\x9e\x1a\
\x30\x02\x15\xf9\x16\x6d\x0a\xa3\xa2\x70\x80\x93\x3a\x05\x95\xca\
\x8a\x98\x2a\x11\x92\x69\x9d\x7a\xba\xa5\x7c\xfa\x8d\x2f\xc0\x92\
\xe3\x38\x11\xb7\x70\x07\x79\x38\x84\xc2\x58\xa6\x66\xaa\xaa\x15\
\xf0\x39\x59\x91\x07\x85\x80\x98\x90\x1a\xa9\xb3\x5a\x96\x20\x79\
\xab\xb8\x8a\x9f\x79\x3a\x09\xbc\xda\xa9\x05\xf9\xab\x1d\x4a\x11\
\xa0\x10\x0a\x22\x0a\x9c\x61\x88\xac\x46\x6a\xa2\x67\x2a\x91\x4a\
\x4a\x16\xce\x0a\xad\x50\x1a\xa7\xa9\xf8\x81\xf1\x19\x05\x34\x7a\
\xa9\x16\x81\xa3\xda\x18\x90\xdb\x8a\x05\xdd\xca\xa1\xe2\x58\x11\
\x6b\xf0\x0c\x68\x30\xa6\x7d\x70\xac\x87\x0a\x06\xc9\x8a\xa6\x6a\
\xfa\x14\xed\xfa\xa0\xd1\x1a\xa1\x92\x1a\xaf\x3a\x38\xaf\xf5\x9a\
\x38\x15\x21\x9b\xf9\xa9\xad\x3c\x9a\x9d\xde\xda\x9f\x17\x61\x0c\
\xa5\xba\x97\x05\x5b\xae\x07\x9b\xb0\xc4\x29\x01\xa5\xa9\x14\x88\
\xf0\xac\x0e\xfb\xae\x11\xab\x07\xf2\xda\x88\xf2\xe9\x04\x16\x5b\
\x11\x49\xff\x99\xa3\xd7\xb9\xaf\x1c\xeb\xaf\x42\x70\x11\xbc\xd9\
\x07\xb4\x50\xa8\x23\xbb\x07\xe6\x9a\xaa\xc4\x79\x8c\x6b\x7a\x14\
\x2b\xdb\xb2\xed\x19\xab\x51\xfa\xb2\x31\x4b\x05\x33\x5b\xb3\x36\
\x1b\x0d\x39\xaa\xa7\x1a\xcb\xa7\xd9\x79\x99\x1e\x8b\x11\xbf\x00\
\xb4\x9a\x20\xb2\x77\x40\xb2\x10\x79\xae\xe8\xaa\xaa\x00\xa8\x14\
\x85\xc0\xb4\x70\x0a\xaf\x30\x3b\xb1\x32\xfb\x91\x8f\x48\xb5\x55\
\xbb\xa9\x59\xcb\xad\xbe\xfa\xa9\x19\xb1\x06\xa1\x50\xac\x98\x40\
\xa6\x45\x6b\xa2\x27\x9a\x02\x23\xb0\xa2\x45\xc1\xb6\x4e\xeb\xb6\
\x8b\x49\xa9\x21\x48\xa3\x74\x5b\xb5\xf9\x4a\x9b\x3a\xeb\xab\xfe\
\xaa\x11\x90\xf0\x0b\x68\x20\x84\xc6\x3a\xb6\x44\x5b\xb2\x66\x3b\
\xb8\x71\x67\x14\xa5\xf0\xa6\x6d\x0b\xb5\xf0\x49\xab\x8d\x3b\xb7\
\x1c\x91\xa5\x79\x2a\xb9\x1b\x4b\xb9\x98\xc9\x11\xc3\x10\xb4\x61\
\x4b\xae\x64\x8b\xb0\x9f\x1b\x9a\xe1\x07\x78\x48\x61\x0a\x0f\x0b\
\xb1\x72\xca\x88\x1e\xe9\xb8\x1d\x61\xb5\x91\x7b\xb7\xfc\x0a\xbb\
\x32\xc0\x11\x60\x9a\xb9\x22\x7b\xaa\x9d\x5b\xb6\x66\xab\xbb\xae\
\x87\x14\xdb\xd0\x9e\xa5\x1b\xbc\x8c\x6b\x85\x4a\xf0\xb8\x17\x61\
\xbc\xad\xff\x8b\xbc\x5b\xdb\xb1\x1e\xf1\x0b\x98\x50\xbb\xb6\x1b\
\xbd\xb8\x3b\xbd\xa1\x99\x14\xac\x90\xbd\xda\x8b\xba\xdc\xeb\xbd\
\xdf\x8b\xb3\x58\x3b\xb9\x70\x59\xb9\x1d\x21\x02\xbd\x89\xbe\x23\
\x7b\xbb\x9c\x38\x86\xe0\x97\x14\x7d\x90\xb8\x11\x2b\xb1\x70\x2b\
\xb5\x72\x4b\xbf\xf5\x7b\xbc\xb6\x58\x07\x7f\x90\xbc\xf9\x1b\xbb\
\x1f\x71\x0b\x68\xe0\xbf\xd0\x5b\xb4\x63\x48\x43\x48\x01\xbc\x92\
\x80\xc0\x6c\x10\x9f\xa9\xcb\xc0\x0d\x1c\xbe\x0f\x1c\xc1\xe3\xeb\
\xad\x21\x31\x0b\x9a\xfb\xb7\xff\xab\xbe\x01\xac\x02\x4b\x51\x0f\
\x48\x70\xc0\x6f\x9b\xc0\x23\x2c\x12\x38\x4b\x8b\x7b\x0a\xc1\x9d\
\x8a\x03\xb0\x1b\x12\x46\x70\x0c\x60\x80\xc1\x9c\x8b\xac\xde\x37\
\x06\x4c\xc1\x08\x1b\x09\xc2\x8c\x4b\xaf\x4a\xe0\x83\x3a\xec\xc0\
\xdc\xe8\xc3\x12\xac\xc2\x22\xf1\x0c\x42\xfb\xc2\xc8\xca\xbb\x4b\
\xd1\x04\x6e\x00\x04\x37\x1c\xc2\xf2\xfb\x91\x52\x3c\xc5\x26\x5c\
\xc5\x7f\x80\xb7\x13\x3c\x12\x22\xd0\x76\xcf\x3b\xb6\x64\xeb\xc5\
\x4d\x91\x0f\x51\x00\x9f\xdb\x6b\xc6\x25\x61\xbf\xae\x5b\x07\x56\
\x3c\xbe\x1c\x5a\x12\xab\x70\xc1\x2e\x7c\xaa\xe5\x4a\x04\x59\x71\
\x00\x31\xff\x00\xb7\x71\x1b\x05\x67\x3c\x12\x7c\x9c\xb5\x7f\x1c\
\xc4\x24\x01\x09\xa7\x60\xc4\x63\x1b\x8b\x64\xb1\x06\xd4\xf0\x02\
\x48\xd0\x88\x9d\x10\x05\x98\xf0\xc8\x90\x4c\xc5\x7e\xbc\xc6\x57\
\x1c\xc8\x25\x01\x09\xb7\x30\x02\x60\x00\x86\x2a\xd0\x07\xab\xa0\
\xc9\x65\x11\x3f\xcf\x20\x0e\x7f\x30\x02\xfa\x81\x12\x91\xcc\xab\
\x93\x9c\xbf\x68\x59\x12\x00\x70\x0a\x63\x70\x00\xcc\xaa\x17\x06\
\x90\xb4\x25\xd1\x0b\xa6\xfc\xcb\x2f\xf0\xab\x2b\xa1\xcc\xfb\xa3\
\x8d\x69\x7c\xca\x6c\xfc\xcc\xc1\xac\x76\x0a\x41\xcd\xf7\xab\xc6\
\x6c\x9c\xbf\xda\xec\x10\xf9\xda\xcd\xd6\x2c\xc1\xe0\x1c\xce\x0c\
\x11\xb9\x7d\x3c\xc9\x94\x8b\xce\xe9\xdc\xba\xeb\x8c\xca\xd9\xd9\
\xce\xee\xbc\xcd\xf0\x2c\xc9\xf2\x0c\xc4\xe7\x5c\xcf\x08\xa1\xce\
\xf8\x8c\xb7\xf4\xcc\xcf\x07\x71\xbc\xff\xcc\xaf\x29\x2c\xd0\x08\
\xd1\x0a\xe1\x5b\xd0\x56\x70\xd0\x08\x6d\x10\x0a\x8d\xb5\x0c\xed\
\xd0\x0f\x4d\x10\x11\x4d\x9b\x13\xfd\x8d\x70\x59\xd1\x05\x71\xd1\
\xda\xea\xcb\xa8\x6c\xce\x8f\xc9\xd1\x03\x91\xa7\xf7\x0b\xd2\x9d\
\x2a\xd2\x24\x5d\xd2\xb1\x70\xd2\xde\x8c\x05\x2a\xbd\xd2\xfe\x70\
\xcf\x8e\x4d\x80\xd2\x30\x3d\xcf\x1b\x2d\xd3\xfe\xa0\xa7\x92\x6b\
\xd3\xc9\xfb\x8d\x3a\x2d\x10\x3c\xfd\xd1\x2f\xfd\xd3\x76\x4a\xd2\
\x9f\xd0\xd3\x45\x3d\xcf\x41\x4d\x10\x4a\x5d\xce\xc9\xdb\xd4\x06\
\x51\xd3\x45\x2d\xd5\x56\x7d\xd5\x58\x9d\xd5\x5a\xbd\xd5\x5c\xdd\
\xd5\x5e\xfd\xd5\x60\x1d\xd6\x62\x3d\xd6\x64\x5d\xd6\x1f\x11\x10\
\x00\x21\xf9\x04\x05\x0a\x00\xff\x00\x2c\x10\x00\x0f\x00\xa9\x00\
\xa9\x00\x00\x08\xff\x00\xfd\x09\x1c\x48\xb0\xa0\xc1\x83\x08\x13\
\x2a\x5c\xc8\x50\xe0\x85\x0b\x18\x30\x98\x30\x11\x21\xc2\x84\x86\
\x18\x33\x6a\xdc\xc8\xb1\xa3\xc7\x8f\x05\x5b\x9c\x78\x18\x71\x62\
\xc5\x09\x13\x3e\x80\x5c\xc9\xb2\xa5\xcb\x97\x08\x5b\x88\x1c\x59\
\x92\xa2\xc5\x94\x1b\x60\xea\xdc\xc9\xb3\xe7\x40\x1d\x32\x4f\xd0\
\x94\x68\x13\xe5\x87\x0d\x39\x7d\x2a\x5d\xca\xb4\x21\xd0\x99\x24\
\x4d\x5a\xfc\x70\x34\x69\xd3\xab\x58\x97\x06\x79\x2a\x34\x6a\x51\
\xaa\x48\x97\x64\x1d\x4b\xf6\xe5\xd6\xa0\x23\x21\x4a\x4d\x59\x55\
\x6c\xd9\xb7\x70\x37\x6e\x05\xda\x55\x2d\x45\xa3\x6d\xe3\xea\xdd\
\x9b\x70\x2e\x54\xbb\x37\xc1\x6e\x70\xcb\xb7\x30\x5f\xbf\x75\x89\
\x06\x3e\xba\x84\xb0\xe1\xc7\x6f\x11\xa7\x55\x8c\x77\xb0\x63\xc8\
\x98\xb1\x4a\xf6\xba\xd8\x72\xe6\xcf\x9a\x75\xd0\x9d\x6c\xb2\x72\
\x63\xd0\xa8\xb5\x9e\x15\xc9\xd9\x68\xd8\xcb\xa9\x63\xbb\x0c\xb2\
\x9a\xf4\x5d\x9c\x83\xaf\xc8\xde\x6d\xb6\x76\x6b\xdc\x4b\x74\xf3\
\x1e\x0e\xb2\x8a\x6f\xc0\xae\x73\x13\x5f\xde\xd1\x38\xd7\xdf\x6d\
\x85\x33\x9f\xde\xd0\x39\x5d\xe8\x61\xa5\x53\x67\x6a\x60\xac\x75\
\xd6\xc8\x71\x36\xff\xd6\x3e\xf6\x01\xe8\x63\xfe\xb8\x21\x43\x94\
\xce\x5f\x28\xac\xdf\x6d\x4f\x65\x1c\x3c\xeb\xad\xf4\x1d\x14\x04\
\xf3\xf7\x0c\x73\x8e\x71\xb0\xec\xd0\xc3\x0c\xb0\x04\x73\x04\x7c\
\x88\xb5\x06\xd6\x78\x58\xf5\xb1\x8b\x1c\x17\x40\xd0\x4e\x1b\x1a\
\x44\xb1\xc6\x63\x39\xb8\xf0\x43\x0d\x3d\x74\xc8\x44\x0f\x21\x4c\
\xa3\x40\x53\xc6\x9d\x25\x1f\x5b\xb9\x91\xe7\x53\x1f\xef\xb4\x00\
\x01\x04\x0c\xc4\x58\xc9\x12\xdc\x18\x51\x58\x16\x2b\xb8\xe0\x42\
\x0d\x1c\xf6\xc0\x04\x13\x5a\x68\xc1\x06\x07\x4c\x95\x38\x1a\x72\
\x0b\x5e\xa1\x22\x4f\x2c\xbe\x08\x63\x8c\x0c\x2c\x20\xa5\x28\xbf\
\xec\xf5\x45\x08\x2b\xe4\xb8\x63\x8f\x3f\x6a\x51\x03\x36\x45\x3a\
\x07\x15\x65\x49\x2e\xa9\x13\x8b\x20\x38\x09\xa5\x94\x0b\x20\xe0\
\xcb\x34\x7a\xb9\x51\x42\x08\x58\x6a\xc9\xa3\x87\x40\xf6\x40\xc5\
\x7b\x3e\x55\x21\x66\x57\x12\x9d\x14\x9d\x18\x4b\xa1\xa9\x66\x8c\
\x6c\x22\xa0\x68\x2d\x51\x0c\xf3\x96\x1b\x33\x94\x30\x67\x9d\x3a\
\xde\xe9\x23\x90\x6d\x00\xa2\x94\x9f\x26\xd2\xf4\x55\x76\x84\xae\
\xf8\x4e\x9a\x2f\xae\x29\xa5\xa2\x08\x14\xa0\x2a\x0b\x4d\x94\x65\
\xc3\x0c\x91\x4e\xff\x9a\x65\xa5\x5c\x06\xb9\x02\x20\x55\xf2\x14\
\xc7\x9f\x9e\x0a\x0a\xaa\xa8\xa4\x3e\x19\xe5\xa9\x8a\xaa\xaa\xea\
\x12\x00\xb8\xfa\x6a\xac\x74\xce\xba\xe5\xa5\x41\xb6\x41\x85\x8d\
\x3b\xed\xea\x5b\xa0\x53\x59\x76\x45\xa8\x3b\xa1\x49\xaa\xa9\x6d\
\x16\x6b\xac\x00\x02\x48\x40\xd6\x11\x3f\xd8\xb0\xac\xa4\xcd\xda\
\x89\x67\x90\x2e\x80\x59\x6d\x7c\x6a\xf9\x3a\x1e\xb7\x30\x79\x5b\
\x2a\xa2\xc4\xa6\x3a\x2e\xb9\x41\x90\xc5\xcc\x0f\xe9\xae\x2b\xab\
\xbb\xd0\xb6\xd1\x86\x1e\xb3\xe8\x64\xad\x68\xac\x61\x2b\x9e\x92\
\xf8\xba\xd4\x47\x39\x20\x04\xcb\x6f\xb8\xfe\xaa\x4a\xae\x00\x09\
\x24\x40\x96\x3e\x3b\x10\xac\x2e\xac\xec\x52\x6a\x69\x97\x6d\x68\
\xd1\x89\xc3\x46\x46\xfc\x69\x70\xdb\x9e\x89\xb1\xc6\xc3\x72\x6c\
\x6c\x01\x1f\x87\x2c\xf2\x58\xdd\xec\x50\x72\xc1\x28\x1f\xfc\xac\
\x8f\xd1\xf6\x50\xc4\x29\x2f\xed\xfa\x67\xbd\xd9\x06\x27\x46\xc5\
\x2b\x5d\x9c\xf1\xa1\xc3\xa2\xba\x73\xcf\x3e\x93\x85\xc3\x13\x42\
\x9b\x6c\x70\xbb\x47\x03\xa9\x45\x1b\x73\x00\xf1\x92\x1d\x0f\xcb\
\x1c\x58\x6e\x62\x18\xf2\x92\xd5\x57\x0b\xdb\xef\xbf\xe4\xfa\x9c\
\x40\x33\x65\x3d\xff\x01\xf6\xd0\x27\x33\x8b\x25\xad\x09\xb7\xe1\
\xc2\x34\xdd\xb1\xc4\xf6\xd3\x81\xba\x26\xb5\xdc\x2d\x5d\x9c\x44\
\xdd\xa6\x6a\xed\x31\xd7\x21\x37\xf0\x56\x2f\x91\xfc\x2d\x76\xd1\
\xcd\x12\xce\x32\xda\x92\x50\xa2\x78\xdb\xbd\x3a\xbe\x2d\xe4\x55\
\x97\x33\xf9\xb7\x1b\x8b\xcb\x33\xe6\x09\x34\x60\x03\x5c\xa6\xf8\
\x1d\x36\xd1\x82\x23\xcc\xf2\x1c\x5a\xc0\xb9\xd2\xe2\x26\xd6\xab\
\x7a\xdc\x2c\x49\x5e\xf7\x93\x89\x76\xfc\x31\xc8\x99\xdb\x1e\xd7\
\x30\x8d\xc8\xf1\x37\xe0\xa0\x0f\xbe\xa3\x87\xd1\xce\xd1\xc6\x14\
\x79\x80\x44\xfc\x75\x8d\x0f\xca\xba\x47\xca\xe3\xdc\x3c\xde\xd0\
\xd7\x2e\xfd\x5e\xd1\xc0\xa1\x3b\xf6\xcc\x3a\x5b\xab\xc2\x73\x3c\
\x82\x84\xf8\xa8\x1b\xcf\x18\xc5\xe7\xe3\x48\x1f\xae\x91\x84\xd7\
\xed\x6b\x7d\x97\x6b\x9f\xfb\x6e\xc7\x97\x67\x20\x81\x0b\xf3\x33\
\x19\xe8\xec\xc7\x3d\xfc\xf5\xa0\x11\x6a\xf0\xc8\x22\xec\xe0\x27\
\xf2\xdd\xe5\x7f\x71\x13\xc4\x47\x06\x58\x40\xca\xe5\x4c\x76\xb4\
\x6b\xc0\xfb\x0c\xf3\x89\xce\x79\x8e\x68\xec\x9a\xd5\x9d\x7e\x97\
\x3f\x36\x04\xa0\x23\x1b\x7c\x58\xea\x40\x68\x08\x11\x76\x84\x84\
\x06\x64\x1e\xb1\xff\xf0\xa6\x37\x15\x32\xf0\x31\x90\xe0\x43\x18\
\x22\x08\xc3\x39\xc9\x90\x43\x66\x43\xdb\x23\xb4\x80\x0c\x1c\x8e\
\x6f\x87\x70\xeb\xe1\x0f\x09\x18\xc4\xca\x39\x2f\x6f\xd1\x5b\x21\
\x64\x56\x81\x8d\x4c\x2c\x71\x77\x27\x8b\x61\x8e\x66\xd8\xbd\x47\
\x3c\xa2\x10\x88\xd8\x48\x0e\xc5\xe4\xbf\x2c\xfa\x50\x23\x03\x34\
\x43\x09\xf7\x95\xb5\x2f\xb6\x4f\x85\x62\xcc\xcc\x37\xc2\xb0\x44\
\xb0\x7d\x4e\x8d\xdb\x43\x1a\xfe\x1e\xa1\x08\x4d\x69\xc4\x13\xe3\
\x6b\x41\x1d\x1f\x77\x47\x8c\xe4\xb1\x84\xb0\x1b\x62\x02\x7d\x06\
\xc8\x19\xc4\x66\x18\x5b\x80\x43\x21\xc3\x96\x46\x27\xae\xb1\x82\
\xf9\x7b\x04\x13\x58\x60\x8c\x8c\x78\x62\x11\xa8\x2b\x1f\xdc\x04\
\x51\x49\x86\xf4\xc1\x19\x7a\xec\x62\x1f\x89\x18\x46\x4f\xee\x26\
\x16\x83\x18\x65\xc9\x4a\xa9\xb2\x84\xe5\x4f\x11\x9c\x50\x82\x2b\
\x37\xf8\xb4\x0f\x0e\x26\x84\x95\xc8\xc8\x1d\x70\xa9\x47\x13\x6a\
\x72\x76\x7f\x54\xa1\x2f\x77\xa3\x00\x2f\x70\x81\x90\x2f\x7c\x15\
\x22\xa1\xd8\x46\x45\x30\x61\x17\x90\x68\xc8\x2b\xd9\x56\x3c\x67\
\xae\x4e\x10\xd1\x6c\xc8\x34\xcd\x90\xcb\x4c\x86\xeb\x5f\x9c\x54\
\xa1\x05\xb6\xc9\xff\x1b\x07\x2c\x43\x15\xe0\x44\x63\xfd\x2a\xa5\
\xc8\x39\x1c\x93\x13\xa2\xe8\xcf\x42\x5c\x31\xc7\xeb\x7c\x90\x92\
\xf1\x5c\xc8\x34\xfd\x50\xcf\x34\xf1\x0b\x85\xd9\x6c\xc0\x3e\xa9\
\x33\x8d\x6f\x9e\x11\x7b\x31\x24\x28\xa6\x0e\xaa\x88\x46\x30\xc4\
\x15\x90\xdc\x95\x43\xa7\x42\x49\x54\x30\xe4\x0e\xb5\xa0\x68\x35\
\x2d\xba\xcb\xcb\xe5\x53\xa3\xfc\x5c\xce\x2c\x00\x11\x09\x70\x1a\
\x32\x5d\x28\x1b\x1c\x1b\xa5\x88\xcc\x47\xbc\x21\x7c\x09\x41\x29\
\x2c\x8d\xc3\x9a\xbb\xcc\xb2\x12\x2e\x55\x08\x4c\x65\xda\xc5\x6b\
\x82\xd1\x7d\x38\xdd\xce\x40\x7a\x21\x87\x6f\xea\x4e\x82\x91\x12\
\x2a\x2a\x19\x49\x0a\x5c\xdc\x40\x21\xc2\x78\xa5\xb5\x9a\x6a\x91\
\xa7\x46\x15\x21\x53\xa5\xe8\x1e\x99\x27\x2e\xcc\xe9\x73\xa3\x5a\
\x15\x08\x25\xb6\xc0\x05\x8f\x7a\x6e\x5d\x62\x1d\x29\x23\x39\x41\
\x8a\x36\xf0\x81\x48\x07\x49\x2b\x33\x83\xc0\xd6\x09\xe4\xa6\x87\
\x50\x4d\xc8\x1d\x5e\x31\x0a\xb9\x4e\xee\x80\x75\x05\x23\x20\x2d\
\x80\xd7\xbc\x0a\x04\x12\x9f\x80\x85\x5f\x49\x19\xd4\x53\x0a\x16\
\x99\xa4\xb0\x45\x2a\x46\x74\x10\x86\x72\x70\x2b\x23\x71\xea\x12\
\xa0\x29\x59\xca\xff\x52\xf5\x6a\x17\xdd\x24\x56\x39\x9b\x53\xcf\
\xfa\xc3\x14\x70\xe8\xeb\x47\x81\x1a\x56\xd3\x9e\xed\x98\x65\xe5\
\x84\x29\x10\x82\x52\x76\xea\x20\xb6\x11\x60\x4c\x08\xdf\x5a\x90\
\x0a\x50\xb6\xb2\x33\x15\xa2\xbf\xb8\xb6\xd9\xce\xfa\x76\x20\xbf\
\x40\x86\x2a\x84\xfb\x55\xc0\x1a\xb7\x0d\x83\x2d\x2b\x2e\x12\x92\
\x52\xd8\x5e\x80\x22\x47\x59\x5d\x44\x0d\x92\x0c\x5f\x60\x77\x8f\
\xb9\x9d\x5d\x3e\x39\xeb\xdd\xef\x12\x24\x7e\xc1\x0d\x28\x0c\x03\
\xab\x85\x83\xe2\xc2\x16\x32\x48\xc8\x52\x9f\xfb\xde\xe8\x6e\x60\
\x5b\xb5\x2c\x88\x7d\x6f\x5b\xaa\x53\xd9\x34\x7a\xfc\xed\xad\x7f\
\x05\x72\x0c\x2f\x0c\x22\xc0\x67\x94\xa0\x13\xb7\x77\xdc\x47\x10\
\x16\x17\x8a\x58\x48\x15\x18\x0c\xdf\x07\x2f\x24\x1d\x13\xae\x66\
\x85\xdb\x74\xe1\xee\x4a\x41\xc3\x1b\x1e\x88\x23\x60\x11\x5c\xaf\
\x82\x74\x70\x05\x45\x6d\x8a\x77\x32\x8e\xfb\xe2\xd6\xc2\xfa\x75\
\x1f\x7f\x6f\x9c\x63\x85\x18\x00\x10\x72\x80\x43\x80\xff\x5a\x5c\
\x72\xa2\x57\x11\xa4\xe0\x04\x4f\x3e\x41\xe1\xac\xd5\x58\xa3\x9c\
\x65\x72\x93\x15\xd2\x84\x65\x30\x23\xca\xa3\x05\xaa\x13\xc9\x99\
\x3f\x4e\x1c\x11\xff\x26\xe3\x10\x83\x8c\x11\xb5\x5d\xe8\xdd\x55\
\x0a\x62\x1e\xf3\x42\xbe\x31\x08\x34\xfb\x58\xcd\x21\xd8\x1e\x13\
\xd0\xa6\x88\x31\xf0\x04\x0d\x76\xb8\x2c\x9d\xbf\x1c\x66\x29\x94\
\x40\xcf\x0d\x31\x46\x23\x54\x21\x07\x34\x87\x58\x9c\x81\xe6\xd0\
\xd9\x1e\xe1\x93\x0f\x7c\x8b\xc6\xfa\xbd\x33\x9e\x1f\x0d\x69\x8c\
\x38\x42\x15\x7d\x9e\xf2\x30\x23\x75\x4a\x2d\x38\x92\x27\x39\x48\
\x06\x08\xa2\xb4\x5d\x0c\x5b\x00\xcf\x69\x20\x75\xa9\x1b\xd2\x04\
\x3e\x44\x22\xd5\x7f\x16\xe7\x1a\x4d\xaa\x14\x34\xb8\x02\xd4\x76\
\x06\x33\xae\x75\xbd\xeb\x86\x18\x60\x12\xdd\x18\x04\xb0\x97\xa8\
\xe6\x15\x2c\x77\x29\x0f\x78\xc1\x06\x3c\x96\xb9\x46\x4b\x21\xd7\
\xcd\xe6\xc8\x34\x32\xf1\x6b\x4b\x83\xed\x55\xc2\x6b\x4a\x0a\x6c\
\x61\xe7\x46\xa7\x21\x0d\x21\x08\x37\x47\x8e\x81\x8c\x6e\x94\x3b\
\xc0\x72\xd8\x01\xdf\xb2\x92\x83\x79\x34\xc0\x0c\xee\x86\xb7\xbc\
\x3d\xd2\x0b\x2c\x28\x23\x13\x83\xc0\x07\x2c\xca\xf0\x0d\xb2\xac\
\x21\x17\xcc\x28\x81\x14\x5a\x60\x87\x34\xfc\x21\xde\x03\xef\x48\
\x95\x3c\xc0\x0e\x1e\x74\xe0\x0c\xac\x7d\x4b\x1e\x90\x30\x8e\x26\
\xfc\x21\xe3\x2b\xff\x49\xa7\x3f\x0e\x50\x98\x1b\xa2\xfc\xe5\x30\
\x8f\xb9\xcc\x67\x4e\xf3\x9a\xdb\x5c\x36\x6c\xc8\xb9\xce\xd9\xf0\
\x86\x9e\xfb\xbc\xe7\x7a\x08\xba\xd0\xf5\x20\x89\xa2\x17\xbd\x10\
\x48\x47\xfa\x25\x96\x7e\x09\x51\x38\x3d\x15\x50\x97\x85\x2c\x78\
\xc1\x0b\x62\xdc\xfc\x23\x53\xc8\xba\xd6\xa7\xb0\xf3\xae\xff\xfc\
\xe7\x43\x27\xba\xd1\x25\x91\x74\xa5\x2f\xdd\xe9\xa2\x88\xba\xd4\
\x79\x71\xf5\x8d\x50\xe1\xed\x54\xd8\xba\xdc\xb5\xde\x75\x9d\x7f\
\x1d\xe8\x43\x1f\x7b\xd9\x99\x8e\xf6\xa8\xb7\x1d\x23\x70\x0f\xbc\
\xe0\xe1\x3e\xf7\xad\xd7\x3d\xe7\x5f\x0f\xbb\xde\xcd\xde\x74\x51\
\xfc\x9d\x21\x51\x88\xbc\xe4\x27\x1f\x85\xc1\x5b\x3e\xee\x85\xe7\
\xba\xd7\xc1\x2e\x74\xa3\x27\xfd\xf1\x0a\x51\x82\xe8\x47\x4f\x7a\
\xca\x9b\x5e\xf2\x97\x0f\x7c\xe1\x37\x8f\xf7\xa0\x4b\x02\xf4\x08\
\x71\x82\xec\x9d\x40\xfa\xda\xdb\xde\xf6\xa7\x9f\x7c\xea\xe7\xbe\
\xf3\x9e\xc3\xfe\x20\xb3\x0f\xbe\xf0\x87\x3f\xfc\xdb\x1b\x5f\x09\
\xb9\xb7\x7c\xd6\x7f\x6f\x90\x1b\x38\xff\xf9\xd0\x8f\xbe\xf4\x6f\
\x40\xfc\xea\x13\xff\xf8\xa2\x8f\x3c\xf3\x0b\x02\x84\xee\x7b\xff\
\xfb\xe0\x07\xc2\xff\xf4\xc7\x4f\xfe\xf2\x3f\x3f\xf8\xdb\x27\x48\
\xf8\xd7\xcf\xfe\xf6\xbb\xff\xfd\xe1\x4f\xff\x40\x8a\x40\xff\xfa\
\xdb\xff\xfe\xf8\xcf\x7f\xfd\x59\xc0\xff\xfe\xfb\xff\xff\x00\xf8\
\x7f\xf2\x27\x10\x01\x58\x80\x06\x58\x80\x47\x90\x80\x0a\xb8\x80\
\x0c\x88\x04\x0e\xf8\x80\x0f\xc8\x03\x03\xe8\x0f\x00\xc8\x80\x16\
\x78\x81\x0d\x08\x81\x1a\x18\x81\x3c\xd0\x81\x1e\xd8\x81\x5b\x10\
\x82\x21\xe8\x05\x13\xe8\x0f\x18\x78\x04\x1b\x98\x82\x1a\xf8\x81\
\x2c\xe8\x81\x22\xf8\x82\x5e\x10\x83\x31\x48\x06\x34\x48\x06\x25\
\xe8\x0f\x2a\xb8\x82\x2d\xb8\x83\x3c\xf0\x82\x3e\x28\x83\x32\x58\
\x83\x35\x88\x07\x44\xc8\x07\x46\x78\x83\xfe\xc0\x83\x3c\xe8\x83\
\x3f\x08\x84\x41\x28\x84\x34\x48\x84\x45\x68\x84\x7c\x00\x08\x56\
\x48\x6c\x48\xf8\x81\x4c\xc8\x84\x4e\x08\x84\x50\x38\x84\x52\x88\
\x07\x54\x58\x85\x56\x08\x08\x8d\x70\x86\x9d\xf0\x32\x48\x48\x10\
\x30\xd8\x85\x5e\xf8\x85\x51\x18\x86\x62\x48\x85\x65\x78\x85\x68\
\x98\x86\xa6\x70\x6d\x6b\xb8\x87\x7c\xd8\x87\x7e\xf8\x87\x80\x18\
\x88\xa9\x71\x21\xb3\xa0\x02\x04\x70\x21\x22\x10\x17\xa0\x50\x82\
\x67\xf0\x0c\x30\xff\x90\x05\xb1\x40\x03\xc1\xf0\x0c\x71\x54\x16\
\x90\x00\x09\x6b\xb0\x06\xa0\x90\x4e\x8b\xf8\x7b\x79\x10\x0b\x2f\
\x10\x0b\x9f\x30\x09\x8e\x90\x08\x56\x10\x03\x63\xa0\x72\x58\x61\
\x04\xac\x68\x04\x99\xa8\x89\x90\xd0\x89\x8f\x97\x07\x9f\x20\x8a\
\xa3\x58\x8a\x75\x50\x06\x58\x40\x03\x23\x90\x15\x22\xf0\x00\x0f\
\x20\x02\x22\xc0\x8a\xaf\x18\x8b\x8f\x87\x08\x93\x20\x8a\xa4\x98\
\x08\x75\xf0\x07\xba\x68\x05\x34\x40\x07\xab\x70\x15\x06\x40\x00\
\x06\x60\x00\xc0\x38\x8c\xc4\x98\x89\xb2\x68\x73\xc8\x38\x8a\xcb\
\xd8\x8c\xba\x88\x03\x34\xf0\x02\x28\x90\x03\x23\x70\x21\x4a\x61\
\x00\x01\x10\x00\xd6\x88\x8d\xc1\xa8\x8d\xaf\xd8\x8d\x33\x87\x08\
\x8e\x70\x8b\xcc\xe8\x8c\x58\x60\x05\xe4\x68\x8e\x32\x20\x04\x8c\
\x70\x1f\x3e\x11\x00\x00\x30\x00\x03\xe0\x8e\xd6\x98\x8d\xda\xe8\
\x8a\x6b\xa0\x8a\x32\x67\x8f\xa4\x88\x8b\xfa\xc8\x8f\xe5\x88\x02\
\xff\x38\x04\x39\x20\x0d\x03\xa9\x00\x07\x50\x90\x07\x49\x00\xef\
\xa8\x90\xad\xa8\x89\xf5\x98\x08\xe1\x28\x8e\xfb\xd8\x8f\x1d\xf0\
\x8f\x30\x10\x03\x39\xf0\x05\x89\xb3\x13\x1c\xe0\x00\x1c\xe9\x91\
\x08\x79\x8d\x22\xff\x49\x8c\x0e\x99\x71\x88\x90\x08\x8e\x20\x91\
\xba\x98\x92\xe5\xb8\x92\x42\xd0\x92\x39\x90\x05\x6e\x80\x0e\x3c\
\xb1\x06\x33\xa9\x00\x35\x69\x90\x37\x09\x8f\xc2\xb8\x90\xf4\x18\
\x6e\xa1\xe0\x93\xcc\x88\x92\x14\x69\x8e\x44\x09\x03\x18\x89\x94\
\x74\x50\x0a\x3c\x11\x00\x4d\xd0\x94\x4f\xf9\x91\x21\x99\x93\x24\
\x39\x70\xa1\x50\x07\x89\x90\x8f\x13\xd9\x8f\x28\xd0\x95\x5f\xf9\
\x05\x74\x40\x08\x1a\xb9\x13\x01\xd0\x05\x65\x49\x93\x07\xd0\x91\
\x50\x19\x95\x0a\xa9\x8d\x3b\x09\x69\xa7\xe0\x96\xf9\x58\x06\xcf\
\x28\x97\x74\x19\x03\x59\xf0\x05\x6e\x40\x08\x8c\x90\x97\x3a\x41\
\x96\x4d\xd0\x97\x1c\x09\x98\x07\x29\x98\x39\x59\x98\x4d\x76\x0a\
\x7f\x90\x95\xfa\x28\x94\x5c\xc9\x92\x43\xe0\x92\x90\x49\x07\x8c\
\x60\x09\x0d\xa3\x10\x60\xa0\x02\x24\xa0\x01\x12\x40\x01\x19\x40\
\x04\x50\xb0\x10\x06\xd0\x04\x7c\xc9\x01\x4d\xf9\x97\x36\xc9\x99\
\xf1\x38\x8c\x9e\xe9\x5f\xa0\x09\x97\x8b\xc9\x98\xa6\xe9\x92\x60\
\x29\x99\x62\x29\x59\x7b\xf0\x9a\xb1\x39\x9b\xb5\x09\x05\x67\x80\
\x54\x08\xa1\x06\x6a\xb0\x9b\x0e\xe0\x97\x9a\xd9\x8e\x20\x79\x8d\
\x52\x29\x8c\x46\xff\x30\x9c\x9e\x05\x9a\x75\x20\x8e\xc7\x59\x91\
\x8d\x79\x94\x90\x29\x99\x96\x80\x09\x09\x81\x09\x77\x80\x06\xaf\
\x99\x02\xb2\x49\x9b\x23\x00\x05\x63\x90\x07\x95\x78\x10\x00\xd0\
\x05\x00\x8a\x99\x99\xf9\x9b\xdf\x89\x93\x22\x49\x9e\xdb\x61\x9e\
\x7f\x30\x9a\x14\xa9\x9e\xc9\xc9\x9e\x6e\xa0\x9a\xef\x99\x10\x9a\
\xd0\x07\xf3\xe9\x03\x2a\x60\x9f\xd2\x99\x9f\x63\x70\x06\x88\xc0\
\x27\x07\x41\x00\xba\x59\x96\x66\xd9\x91\x04\x5a\xa0\xc0\x18\x9c\
\x08\xca\x1c\xa7\x50\x06\xe8\x89\x05\x42\xe9\xa0\x45\x79\x9a\x10\
\x7a\x97\x8c\xa0\x09\x0a\x81\x09\x7d\xb0\x07\x68\x80\xa1\x1a\x8a\
\x9f\x44\xd0\xa1\x1f\x9a\x10\xa0\x30\x00\xd9\x49\xa2\x34\x59\x93\
\x27\x9a\x96\xd9\x38\x9e\xdf\xd5\xa2\x2f\x6a\x05\x5b\x59\x9a\x33\
\x4a\xa3\xcb\x79\xa3\x0a\xa1\x09\xf2\xc9\xa3\x3e\x7a\x9f\x19\x30\
\x02\x41\x5a\x9d\x88\xc0\x34\x08\x01\x0a\x04\xc0\x01\xda\x99\xa4\
\x26\x1a\x98\x20\xf9\x8e\xf0\x18\x8f\xea\xa8\x55\x2d\xba\xa0\x41\
\xc9\x8f\xfd\x48\xa5\x30\xe0\x95\xca\x99\x9a\x58\x9a\xa5\x5b\x0a\
\x06\x5d\x3a\x9b\x1e\x00\xa6\xd4\xc9\x9f\x20\x8a\x10\x7b\x79\x99\
\x33\xa9\xa6\x00\xff\xf0\x9b\x51\xf9\xa6\xc2\xb8\xa2\xb1\x31\xa7\
\x8a\x09\xa3\x76\x5a\x8e\x54\x3a\xa3\x7b\x1a\xa1\x84\x50\x0c\x0c\
\x51\xa1\xf3\x09\xa8\x24\xf0\xa3\x83\x6a\x9b\xfb\x39\xa4\x0a\x01\
\x09\x03\xc0\x01\x48\xca\x9d\x8d\x1a\x98\x8f\x9a\xa2\xc1\x28\xa9\
\xa0\x71\x0a\x58\xe0\x8c\x75\x8a\x03\x72\x39\x97\xff\xa8\xa9\x35\
\xda\xa9\x0d\xa1\xa3\xa1\xea\x03\xa3\x7a\x9f\xa5\xaa\x9f\x1e\x7a\
\xa8\x09\x21\xa2\x48\xea\x94\xbe\xe9\xa8\x6d\x0a\x9e\x29\x2a\x02\
\xb4\x8a\x19\xb6\x8a\xab\xfb\xd8\xa0\xe6\xc8\xab\x42\xe0\xab\x8f\
\x19\xa1\x74\xe0\xa9\xc1\xba\xa3\xf4\x09\x9b\xa4\x4a\xa8\x1d\xca\
\x9f\x0d\x51\xa4\x8a\x5a\xa2\x6b\xba\x99\x08\xe9\xa6\xd3\x5a\xad\
\x86\x61\xab\x95\x9a\xad\xe4\x58\x91\xdc\xea\xad\xdf\x1a\xae\x19\
\xb1\xa5\xe5\x5a\xac\x82\x3a\x9d\xe9\xda\x9f\x0c\x41\x00\x0e\xd0\
\x97\x6a\xfa\xae\xed\x18\xaf\xd2\x9a\xa2\x71\x3a\xa9\x58\x70\xaf\
\x97\xaa\xaf\x44\xa9\xa9\x9b\xea\xaf\x19\x61\xa1\x5c\x6a\xae\x15\
\x30\xb0\x1c\x2a\xa6\x1a\x41\x96\xbc\xb9\x9d\xce\xca\xb0\xde\x59\
\xa0\x90\x4a\xaf\x71\x61\xaf\xcf\x58\xb1\xdb\x7a\xb1\x7a\x9a\xb1\
\xe2\xba\xb1\x77\xff\xd0\xb1\xa3\xfa\xb1\x14\xe0\x01\x5f\x1a\xa6\
\xea\x9a\x11\xa0\x10\x00\x0e\x50\xb2\x0b\xfb\xaa\x6c\xaa\xb2\x6f\
\x1a\xb1\x99\x71\x0a\x56\x50\xa7\x97\xfa\x02\x31\xdb\xab\x5e\x69\
\xa5\x90\xe9\x06\xd4\x20\x40\xc3\xea\xb1\x20\x6b\xaa\x1e\xca\x11\
\x22\x4a\xb4\x27\x6b\xb4\x9b\xd9\xa6\xf2\x0a\x8c\x4a\xfb\x18\x4c\
\xeb\xb4\xba\x8a\xa9\x28\xc0\xab\xa6\x69\xa5\xdf\x7a\xb5\x1c\x71\
\xb3\xf4\x89\xa1\x39\xbb\xb5\xc8\x6a\x9d\x40\x3b\x00\x43\x6b\xb2\
\x61\xeb\x91\xf0\x1a\xad\x06\x2a\x02\x67\xcb\x17\x69\x6b\xa9\x6b\
\xcb\xb6\x6e\x5b\xa5\xca\x19\xb7\x1e\x41\xb7\x80\x0a\x9b\x1a\xa0\
\xb3\x3c\x8b\xae\xd5\xe9\x11\x06\xa0\x00\x8b\x7a\xb2\xef\x1a\xb8\
\x48\x6b\xb6\x90\x31\x0b\x56\x60\xa9\x30\x1b\xb5\x6f\xeb\x92\x10\
\x2a\xb7\x1d\x01\xb9\x76\x3b\xb9\x78\x9b\xae\x1f\x11\x00\x60\x9b\
\x99\x9d\xdb\xb0\x82\x8b\x93\xd4\x6a\x18\xa2\x4b\xba\x89\x0b\xb5\
\x73\xb9\x92\x2c\x39\xb3\x10\x0a\x0d\x20\xc1\xba\x19\xea\xba\x3b\
\xdb\xb3\x79\xfb\x11\x66\xaa\xb9\x7e\xfb\x97\xb5\x9b\xb2\x6e\x0a\
\x8f\x6b\x19\x17\xbb\x8b\xaf\xf9\xea\xbb\x1d\x00\xbc\x45\x29\xbc\
\x8f\xf9\x05\xc4\xff\x5b\xbc\x38\x6b\x9f\x94\xab\xbc\x1d\x7a\x06\
\x2b\x71\xa6\x9b\x3b\xa0\x62\x6b\xbb\xb7\x0b\x8c\x2c\xcb\x13\xb3\
\x80\x03\xbc\x9b\xbd\x5c\xc9\xbd\x79\x7a\x9a\x8d\x0b\xbe\x2c\xc1\
\xa3\x91\x5b\xac\xe5\x4b\xa8\xc8\x9a\x72\x42\xeb\xb7\xec\x0b\xb8\
\xee\x8b\xb4\x84\x5b\x95\x57\x31\xbf\xd8\x4b\x03\x10\x1c\xb3\xf8\
\xeb\xbd\x8f\x19\xbe\x2b\xe1\xbf\x76\x4b\xbe\x20\x6b\xb9\x2d\x61\
\x00\xdb\x99\xa4\x07\x6c\x90\x9e\xfb\xb9\x85\xdb\x14\xf4\x2b\xa5\
\xbd\x2b\xc1\x32\x10\xbc\x43\x40\xa3\xec\x69\xc1\x17\x5c\xb7\xe6\
\x8a\xbc\x95\xcb\xc1\x2c\x11\xb4\xeb\x1b\xc2\xb0\x4a\xb6\xe0\x69\
\x00\x89\x58\x16\x0f\xac\xb8\xdb\xbb\xc2\xdd\xdb\xc2\xa8\x5b\xc1\
\x2f\x81\xc1\x33\x4c\xb9\x95\xcb\xb5\x2f\x91\xb9\x06\xfc\xac\x08\
\x9c\xc0\x3d\xcc\xc0\x4b\xa1\x09\x28\x6c\xbf\x6d\x3b\xc4\x2c\xec\
\xc2\x48\x9c\xc4\x32\x0c\xc0\xb3\x99\xbc\x36\xec\x12\x08\xfb\xbc\
\x52\x2c\xc2\x0d\x1b\xaf\x21\x49\x16\x31\x50\xba\x5b\xcc\xbd\x8c\
\xdb\xb8\x30\xdc\x12\x68\x10\xc6\x1a\x4c\x01\x64\x6c\xaa\x86\xf6\
\x12\xcd\x8b\xc6\x26\x3a\xc5\xd2\xfb\x8e\x64\x41\x08\x29\x1c\xc7\
\x44\x3c\xc7\x47\xff\x99\x05\x75\x6c\xc7\x78\x8c\xbc\x7b\xac\x9f\
\x7d\x0c\x13\x50\xec\x94\xb4\xdb\xa8\x82\xcc\xc6\x31\x89\x15\x39\
\x00\xc1\x42\x2c\xc7\x53\x1b\x03\x74\x7c\x68\x80\x9a\xc1\x90\xdc\
\xc4\x50\xa0\x9f\x3b\x11\xb4\x51\x9c\xc6\xb0\xca\xc6\x64\x51\x01\
\x11\xac\xc2\x52\x2b\xbc\x47\xd9\xc8\x2e\x21\xc3\x4b\x2c\x01\x5b\
\x6b\xaa\x3d\x61\x00\x07\x00\xc2\xd0\x8b\xc9\x6a\xec\xbe\xd4\x32\
\x16\x9f\x9c\xc8\xf9\x2b\xca\x39\x70\x94\x4a\xd9\x13\xba\x2c\xc6\
\xbd\xac\xca\x3d\x71\xc6\x96\x3c\xcc\xed\x6b\xbb\x6f\x01\x06\x30\
\x80\xc8\xb5\x6c\xc4\xcd\x9c\x05\xcf\x0c\xcd\xff\x2b\xcd\x7b\xec\
\xcb\x3d\x01\x0a\xc0\x2c\xcc\xae\x0c\xaf\x9b\x3c\x16\x98\xf0\xbb\
\xca\x1c\xca\xca\x39\xce\xe4\x6c\xb7\xe6\x5c\xc3\xe8\xec\x13\x1e\
\xcc\xce\x81\xac\xc6\xef\x3c\x16\x0e\x40\x0b\x30\x30\xcf\x46\x5c\
\xcf\x4c\x81\xc7\x1a\xbc\xc1\xfb\x9c\xce\x04\x60\xc9\x9c\x4b\xcc\
\x03\x10\xd0\x65\xe1\x03\xdd\x5a\xc4\xfa\xdb\xcc\xf6\xec\x13\x60\
\xf0\xbf\x29\xb0\xd0\x64\x2c\xc0\x4d\xf1\x00\x10\x0d\xbd\x81\x4c\
\xd1\x65\x01\x00\xc5\x80\xd1\xcc\x9c\x03\x1b\xcd\xd1\x3e\x90\xc1\
\x20\xad\xcf\xa9\xff\xdc\x14\x66\xea\xcf\x8d\x4a\x00\x8f\xb1\x06\
\x29\x80\x0e\x59\x70\x9a\x84\x90\x03\x12\xf0\xd2\x30\x2d\xd3\xae\
\x3b\xb0\xca\x7b\x9b\x36\x6d\x00\x03\x70\x00\x35\x79\x00\x22\xa0\
\xd3\x90\xb1\x88\x94\x00\x06\xec\x10\x0a\x44\x30\x16\xa5\x6c\xae\
\x33\x9d\x01\x3d\x6b\x9b\x63\xb1\x06\x04\x10\x00\x6b\xf0\xc3\xa8\
\xf1\x00\x25\xac\x14\x91\x3b\xc3\x47\x9d\xbc\x5f\xad\xd4\x63\x61\
\xc5\x36\xb7\xd6\xc5\xda\xd6\x3c\xfb\xd6\x82\xe8\x12\x74\x6d\x9f\
\x76\xed\xd5\x60\x0a\xd6\x79\xcd\x12\x7b\xad\x01\x76\x4d\xd3\x81\
\x2d\xd8\xf8\xcc\xd7\x1f\x2b\xa8\x86\x7d\xd8\x20\x11\xd3\xb0\x59\
\xd7\x8b\xbd\xb3\x8d\xed\xd8\x1e\x01\xd9\x24\x20\xd9\xbc\x4c\xd9\
\x5f\x4a\xa8\x96\xfd\x11\x98\xad\xd9\x8c\xdd\xd9\x44\x90\xd5\x9f\
\xdd\x11\xa1\xad\xd8\x9b\xed\x01\xfa\x6c\xda\xa7\xbd\x11\x18\x1a\
\xd9\xaa\x3d\xda\x23\xf0\xd7\xaf\xcd\x11\xb1\x3d\xaa\xb3\xcd\xd9\
\x5f\x7d\xdb\xb0\xad\x02\x5c\x4d\xd8\x93\xcd\xda\x7e\x5d\xda\xbe\
\xad\x11\xb9\xfd\xd1\xc2\xbd\xd9\x6e\x6d\xdb\xc7\x8d\x11\xc9\x4d\
\xbe\x93\xdd\xdc\x60\xfa\xdc\xd0\x0d\xdc\xba\x3d\xb9\xd3\x7d\xd7\
\xb5\xed\xda\xd6\x3b\xad\x10\x89\x2d\xdd\xcc\xcd\xdd\xd5\xfd\xdd\
\x0c\x21\xdb\xe2\x3d\xc6\xe4\x6d\xde\x0d\x81\xde\xda\x3d\xde\x7e\
\xdd\x8b\xec\xcd\x10\x99\xad\xdc\x15\xb0\xdd\x7e\x3d\xdf\x18\x91\
\xdd\xf7\x3d\xde\x3c\xab\xdf\x1a\x91\xde\x7a\xec\x01\x63\x16\x10\
\x00\x21\xf9\x04\x05\x0a\x00\xff\x00\x2c\x10\x00\x0f\x00\xa9\x00\
\xa9\x00\x00\x08\xff\x00\xfd\x09\x1c\x48\xb0\xa0\xc1\x83\x08\x13\
\x2a\x5c\xc8\x50\xe0\x0f\x1b\x33\x66\x94\x08\x11\x62\xc5\x8a\x86\
\x18\x33\x6a\xdc\xc8\xb1\xa3\xc7\x8f\x05\x77\xfc\x78\x18\x71\x62\
\xc5\x15\x2e\x6a\x80\x5c\xc9\xb2\xa5\xcb\x97\x08\x9f\x88\x24\x29\
\x91\x22\xca\x94\x2a\x61\xea\xdc\xc9\xb3\xa7\xc0\x30\x32\x47\x42\
\xac\x59\xd1\x45\xca\x1e\x3d\x7c\x2a\x5d\xca\x14\x23\xd0\x1d\x22\
\x6d\x40\x34\x79\xb3\x06\xd2\xa6\x58\xb3\x36\x0d\xf3\x34\xea\x54\
\x9b\x46\xad\xf6\x60\xa2\xb5\xac\xd9\x97\x5c\x65\x7a\x25\x5a\x15\
\x29\xd9\xb3\x70\xe3\x6e\xe4\xd2\xf5\xe1\xd7\xa2\x47\xc7\xca\xdd\
\xcb\x37\x21\x5d\xb5\x76\xd9\x86\x75\xdb\xb7\xb0\xe1\xbf\x50\x03\
\x53\x1d\xcc\xe4\xad\xe1\xc7\x71\xff\x06\x95\x2a\xf8\x68\x63\xc8\
\x98\xcf\x4a\x5e\xbb\xb8\x86\xd5\xcb\x99\x43\x63\xdd\xac\x18\xac\
\xe7\xb1\x5a\x44\xab\x5e\x4a\xf7\x69\xe9\xa2\xa7\x99\xa4\x5e\x4d\
\x7b\x67\xeb\xa0\x24\x3b\x7f\x9e\x5d\xbb\x77\x4b\x2e\x88\x85\x0a\
\x16\x2b\xdb\xb7\xf1\x95\xc0\x5d\xe7\x36\xed\x96\xf7\xf1\xe7\x1a\
\x93\xe3\xbe\x8b\x92\xb8\x73\xe8\xd8\x17\xc2\x09\xbe\x1c\x76\xf3\
\xec\x59\x0d\x94\xff\xdd\xae\xfc\xab\x45\xcb\xc5\xe1\x0e\x10\x7d\
\xcb\x1f\x0a\x1c\xc3\x34\xf9\x1b\x96\x95\x3c\x60\xf3\xd5\x51\x5f\
\x5f\x0a\xc5\x9f\x9e\x46\xab\xc4\xe2\x4f\x06\x98\xb1\xd3\x01\x1f\
\x48\x50\xc1\x02\x1e\xc5\xb4\x52\x1f\x62\x51\xd5\x74\xde\x6e\xfb\
\xf9\x34\x84\x2c\x8f\x78\xa2\x83\x39\xed\x04\x23\x87\x11\x8f\xb1\
\x73\xc3\x11\x4a\x44\x11\x05\x15\x54\x44\x01\x04\x16\x07\x34\x65\
\xdf\x64\x12\xe6\x27\x5b\x1b\x58\x0d\x11\x87\x27\x41\xe8\xa0\x43\
\x0b\x2d\xe8\x10\x44\x21\x0f\x14\xc6\x0e\x10\x4e\x38\xa1\x44\x89\
\x27\x52\x31\x05\x1b\xdc\x38\xc0\x14\x79\xae\x99\xc7\x98\x16\x34\
\x32\x65\x63\x10\x39\xee\xc8\xe3\x09\x27\x5c\x60\xc3\x08\x7c\xd5\
\x53\xc4\x0d\x37\x14\x79\xa4\x89\x4a\x4e\xa1\x04\x0e\x4f\x4a\x17\
\xe1\x44\x6d\xcd\x68\x65\x1c\x58\xea\xa8\x25\x97\x17\xe4\xa9\xcc\
\x5e\xf9\xb0\x00\x04\x10\x64\x9a\x89\x64\x9a\x51\x6c\x43\x9f\x4f\
\xdb\x05\x27\xa5\x65\x54\x2e\x75\x65\x96\x77\x76\x99\x27\x06\x27\
\x70\xa1\x01\x5c\xe8\x1c\x51\x44\x11\x7f\x06\x6a\x64\x89\x28\x4e\
\xb1\xa4\x23\x4a\xc9\x61\xdf\x9b\xb0\xed\x56\x65\x4f\x31\xc4\x51\
\x45\x9d\x91\xe6\xff\x79\x01\x06\x18\x98\x60\x42\x26\x87\x96\x85\
\x04\x0b\x2c\x6c\xda\x69\x99\x46\xa2\xa9\x24\x1b\x37\x24\x42\x49\
\x4f\xa6\x2a\x2a\x61\x5e\x72\xb2\xea\x2a\xac\x5b\x4a\x3a\x6b\xad\
\x26\x44\x70\x41\x20\x67\x1d\x71\x04\xaf\xbe\x02\x0a\xec\xa0\xc3\
\xb2\xb1\x0d\x88\x3b\x25\x1b\xe5\xb2\x14\xae\xaa\x53\xab\xaf\x66\
\x19\xad\xac\xb4\xda\x1a\xc1\xbc\xd2\x98\x95\x08\x12\xda\x72\xcb\
\xa9\xb7\x9f\xa2\x29\x2a\x1b\x4e\xb0\x59\xee\xa9\xcb\xc9\x48\xa5\
\xba\x2f\xb1\x0b\x6d\x0b\x78\x4e\x4a\xed\xbc\x11\x4c\xd0\x82\x59\
\xac\x20\x81\xef\xb6\xbd\xee\x1b\xe8\x99\x27\xfe\xfb\xc6\x38\xc7\
\xe8\x64\x2e\x8c\x70\x32\xda\xc6\x1c\x3b\xc5\x60\x47\x15\xaf\xea\
\xf8\xae\xc3\xf2\xce\x3b\xc1\x04\x1f\x98\xd5\x0c\x0f\x16\xe7\x9b\
\xf1\xaf\xfd\x76\xbc\x24\x1b\x75\x88\x4c\xb0\x94\xaa\xa2\x0c\x93\
\xca\x2c\x43\xcb\xa5\xa4\xf1\x56\x2b\x33\xcd\x35\x97\xb5\x0b\x0f\
\x38\x5f\xac\x2f\xcf\x67\x86\xca\x06\x1b\x51\x44\x63\xcc\x4b\x83\
\x0c\x8d\x2e\x6a\x27\xc3\x94\xc3\xca\xed\xba\xcc\x30\xd3\x0f\x47\
\x3c\xf3\x07\x70\x9b\x95\xcb\x16\x54\x57\x8d\x71\xb7\x1b\x83\x1a\
\xee\x1b\xd1\x80\xff\x9d\x2c\xc9\xde\xcd\x68\x74\x4b\x67\x27\xed\
\xee\xda\x30\x3b\x3d\x33\xd4\x1f\x80\x73\xd6\x16\x90\x53\x9d\xf3\
\xd5\x80\x0a\x9a\xe4\x92\x6f\x38\x81\x85\x78\x2c\x0d\x62\x2e\xaa\
\x06\x97\x4d\xb8\x1d\xcf\x1e\xde\x70\xd3\x4f\x43\xbd\xc1\x06\x70\
\x7d\xd1\x49\xe4\x76\x6f\x8b\xb7\x99\xfe\x62\xfe\x06\x36\xd8\xae\
\xe4\xb9\x7d\x05\x9b\xfc\xc8\xe8\xae\xb6\x1c\xeb\xb4\x31\x2f\x0e\
\xf7\xea\xed\xc4\x85\x82\x17\xb0\xe7\x2c\xbb\xc6\xb4\x77\xbc\xf5\
\x1b\x53\x94\xd1\xf9\xc8\xbd\x5b\x45\xe5\x1c\xbf\xaf\x94\xc3\x22\
\xc1\x9b\xce\x76\xf1\x6f\x7f\x80\xbc\x5c\xb7\xd0\xd0\x48\xf3\x56\
\xcf\x1e\xac\xf4\x6c\x50\x3f\xce\x2c\x20\xed\x8e\x18\xd1\x3d\x6c\
\xdf\xfd\x47\xdf\x87\x9f\xe3\xcb\xa8\x73\x1b\xdc\xcc\xb7\x81\xe4\
\xf1\x25\x06\x78\x60\x9f\xce\x38\xe5\x29\xbd\xd9\x4e\x0f\x0e\xfa\
\x48\x24\xc2\x16\x9c\x65\x91\x8d\x7b\x20\xe9\x5f\xe9\x5c\x76\xba\
\xb6\x95\x8f\x80\xf2\x28\x0c\x25\xca\x40\x06\x05\xde\x8d\x5f\x59\
\x1b\xd6\x1b\xf4\xa0\x04\x47\x74\xc1\x23\x13\x94\x43\x05\x4b\x76\
\xc1\xfd\x71\xe4\x7b\xa4\x4b\xdb\x8e\x3a\x48\xbe\xe3\xad\x2e\x84\
\x8f\xa1\x43\x23\xff\x98\x47\x37\xe7\x71\x0b\x85\xa0\xf2\x98\x1e\
\x24\xf1\x8d\x00\x74\x24\x86\x33\x2c\xca\x05\x15\xe1\x11\x1c\x86\
\x8f\x83\xe3\x53\x9c\xea\x7e\x88\x19\x50\xe0\xc0\x0b\x44\x94\xdc\
\x02\x91\x08\xbf\x15\x56\xef\x89\xbb\x73\x8d\x84\x54\xf5\x08\x2a\
\xde\xd0\x13\x39\x14\xde\x96\x12\xf7\x34\x1f\x6e\x00\x88\x98\x51\
\x03\x0c\x86\xd8\xbc\x31\x6e\xcc\x5f\xf1\x5b\xa1\x1e\x9a\x91\x2b\
\x8c\x64\xc2\x7e\x41\x59\x23\x6a\xb8\xe7\x46\x8d\xe4\x00\x8e\x71\
\xd8\xe0\x1c\x89\x97\x3a\x1f\x2e\x01\x8f\xa1\x19\x02\x19\xc2\x68\
\xb7\x23\xfe\x51\x7a\x2b\x94\x84\x24\x26\xb1\x91\x4c\x44\xe2\x6f\
\x22\x51\x24\x13\x4e\xd6\xc6\x8d\x3c\xd2\x0e\x39\xac\xd3\x24\xe3\
\x55\x49\x02\x5e\x92\x36\xb7\xc0\x02\x1f\xc0\x48\xb7\x4e\xf6\x0a\
\x85\x97\x8b\xdf\x12\xa7\xb0\x8c\x67\x64\xc4\x94\x14\x0c\x43\x2a\
\x27\x62\x19\x56\x72\xc2\x91\xae\x58\x44\x1c\xff\xc7\x30\x98\xd5\
\x91\x80\x1b\xb8\x65\x6f\xdc\x30\x44\xe6\x49\x0e\x5f\x9e\x2c\x53\
\x12\xa7\xb7\xc4\x42\x70\xe3\x98\x13\x24\x4f\x54\x98\xa9\xbd\x93\
\x29\xe2\x99\x18\xc9\x42\x34\xa7\x89\x45\x4a\x0a\x10\x9b\xda\xec\
\x0d\x00\xb0\xb0\xff\xc9\x30\x4e\xee\x97\x7f\x54\x61\x39\xa7\x50\
\x07\x48\x34\x44\x15\x50\x54\xe6\x43\xd8\x99\xbf\x36\xb4\x11\x9e\
\x0c\x91\xa7\x34\x23\x29\x47\x3c\xd1\xf2\x9e\xab\x5b\xc2\x12\xd6\
\xf1\x9c\x03\x64\xc1\x14\x9b\x8c\xdc\x3f\x19\x48\x3b\x81\x4a\xa2\
\x10\x97\x98\x46\x7b\x16\xa2\x8a\x43\xca\x50\xa1\x36\x60\xe7\x8c\
\x1e\xda\x90\x2c\x08\xc3\x13\x13\xad\x68\x97\x2e\x5a\xbe\x8c\x6e\
\x34\x3b\x32\x20\x43\x48\x7b\x09\x4e\x80\xf6\xcb\xa4\x85\x18\x25\
\x43\x60\x61\x4a\x53\x01\x65\xa1\x21\x48\x89\x6c\x18\x49\x0a\x86\
\x7c\xe1\xa6\x39\x95\xa5\x45\x6b\x75\x4d\x9f\x72\x34\x3b\xbf\x50\
\x5f\x3f\x89\x7a\x42\x71\x02\x72\x85\x28\xd5\x03\x36\x4e\xa1\x10\
\xa6\x9e\x12\x0e\x4f\x8d\x69\x54\x6b\x30\xd5\x47\x70\xa2\xaa\x0a\
\xb9\x2a\x4e\xe9\x89\x38\x9e\x6e\x71\x09\x57\xf8\x2a\x78\xfc\xf1\
\x85\x46\x8c\x55\x8c\x9e\x0c\x16\x52\x2f\x21\x8a\x73\x26\x04\x16\
\x08\xa5\xe0\x13\xa0\xea\x82\xb1\xb8\xf3\xae\x79\xad\x86\x2b\xf6\
\xfa\xac\x3b\xd9\xf3\x6d\x3e\x0d\xec\x60\x07\xd2\x05\x2c\xe0\x41\
\xa8\xfe\x2c\xab\x62\x31\x57\x4e\x51\xe8\x21\x16\x4e\x3a\x08\x33\
\x22\xbb\x9d\xc9\xff\xca\xb5\xb2\xab\x9c\xc3\x3b\x71\x91\x90\x2f\
\x68\x96\xb3\x2d\x9b\x23\x4f\x2d\x09\x58\xc1\x8e\xd6\x1f\x90\x20\
\x04\x2b\x50\x2b\xd2\x7c\x91\x74\x9c\x68\x65\x6c\x2a\x4c\xa1\x00\
\x84\xb4\xd4\x73\x5c\xb0\x6d\x09\x50\x62\xd9\x36\xe2\xf5\x20\x6e\
\x38\xc7\x66\xb3\xca\xc1\xcf\x12\x57\xb4\xc7\x2d\x08\x0a\xf0\x70\
\x5a\x5e\xe2\xcc\xb9\x95\x1b\x67\x39\x2f\x91\x8a\x42\x90\xea\x20\
\x4c\xc5\xae\x4c\x62\xca\x5d\x2a\xd9\xf5\xbb\x05\x61\xc7\x39\x84\
\x31\xde\x2b\x56\x93\x96\x3d\xcd\xe6\x15\xae\x60\x8e\xf4\x1a\x44\
\x0d\x42\x30\x45\x7b\xbd\x39\xb9\xe7\x9e\x48\x98\x27\x15\x45\x2a\
\x44\x91\x10\x84\xbe\x74\x07\xfc\xad\xac\x16\xb8\x07\x51\x83\x00\
\x83\xc0\xc0\xfd\x1f\xd3\xaa\xd5\x53\x8d\x2e\xb8\xc1\x0e\x3e\x48\
\x16\x00\x71\xda\x90\x76\xd2\xc2\xac\x45\xa9\x28\x64\xc1\x88\x84\
\x9c\x92\x2e\x20\xde\xae\x88\x75\xab\x90\x6a\x60\x35\x96\x3b\x9c\
\x14\x8b\x69\x16\x5a\x06\xc7\x18\x21\x94\xc0\x01\x8d\x99\x8b\x58\
\x92\x82\xf2\xa4\xf4\x95\x84\x76\x94\xc9\x5f\xed\x2d\xa4\x0c\x28\
\x46\x72\x35\x67\xb5\x64\x5b\x2e\x58\x0c\x30\x7e\x32\x42\x18\xc1\
\x0a\x3e\xb4\xb7\xff\xb9\x00\x95\xaf\x24\x18\x5b\x08\x9e\xb0\x61\
\xbc\x2b\x53\xb1\x92\x05\x98\xd1\x33\xa7\x59\xcd\x07\x79\x00\x0d\
\x00\xe1\xe6\xc3\x82\x93\x81\x49\x8c\x6e\x9d\x77\xc2\x82\x79\x76\
\xd6\xa2\x2c\x3e\x9e\x8b\xaf\x80\x66\x40\x2f\xc4\x01\x5f\x98\x46\
\xa1\x6d\x7c\x68\x40\x81\x2a\x7e\x27\xbd\x81\x9d\x85\x21\xe6\x9d\
\x46\xda\x7c\x80\xa5\x74\xa5\x2d\xcd\x90\x18\x10\xba\xd0\x14\x96\
\x1d\x91\x4a\x84\x39\x49\x84\x82\x27\x74\x30\x47\x67\x0f\x1c\xe9\
\x3e\xab\xfa\xcf\xac\x4e\xc8\x2a\x50\x60\x0a\x42\xbf\xf9\xbd\xbf\
\x0c\xd6\x92\xf4\xe0\x13\x61\x04\xd7\xd4\x11\x33\xb3\x18\xc4\x60\
\x08\x60\x07\x5b\x21\x96\x60\x85\xb1\x85\x5a\x44\xd9\x89\x53\x49\
\xf7\xe5\x09\x36\xd6\x91\x64\xae\x32\xd9\xc5\xd3\x36\x44\x35\xae\
\x9d\x11\x07\xbc\xa0\x11\x80\xd8\xb6\x37\xbd\x6d\xa4\x3f\x2c\xe5\
\x0b\xae\x80\xf6\xb9\xcf\x6c\x08\x75\xb3\x5b\x23\x0f\x60\x44\x33\
\xe0\x0d\xeb\x22\xf6\xea\x06\x56\x60\xca\x00\xf0\x10\x04\x0c\xf0\
\x19\xb0\xe9\x16\xc4\xba\xff\xbd\x11\x18\x74\x82\xe0\xc7\xde\xd5\
\x0b\xb2\x52\x0a\x61\x30\x59\xc1\xd4\x36\x84\x20\x84\x41\x71\x8e\
\x50\x02\x06\xcd\xff\xb8\xf8\xb6\xf9\xc0\x83\x0e\x48\x6d\x02\x0a\
\xa6\xb4\xc8\x47\x5e\x72\x8f\xd0\x21\x18\xe1\xe8\x04\x20\xb0\xc1\
\x0a\x4b\xc0\xc0\x2c\x22\x58\x86\x2d\xd6\x21\x86\x08\x60\x40\x10\
\x51\x20\x79\xcd\x3b\xa2\x06\x7f\x20\xc2\x07\x38\x60\xc7\x30\x00\
\x20\x97\x3e\xc8\x41\x19\xc3\x88\xc2\xd2\x57\x62\x50\x7f\xac\xa7\
\x2f\x4d\xd8\xba\xd8\xc7\x4e\xf6\xb2\x9b\xfd\xec\x68\x4f\x7b\x6f\
\xb0\xc0\xf6\xb6\xb7\xbd\x0c\x70\x8f\x3b\xdc\xff\x40\xf7\xba\xd7\
\xe1\xee\x78\x4f\x84\xde\x13\xe1\x88\xbe\x3b\x62\x12\x80\xff\x84\
\xe0\x63\x11\x8b\x56\x44\xd0\x37\xda\x48\xbc\x2f\x16\xef\x8b\x51\
\x38\xfe\xf1\x7e\x88\xbc\xe4\xcd\x40\xf9\xca\x53\x3e\x09\x98\xcf\
\xbc\xe6\x33\x0f\x82\xce\x7b\x1e\x04\x08\xb1\x82\xe8\x47\x2f\x7a\
\xb7\x9b\x1e\x0b\x72\x97\x7b\xdd\xe9\x8e\xf7\xbb\xef\x9d\xef\x7d\
\x07\xfc\x24\x06\x4f\xf8\xda\x28\x7e\xf1\x8f\x77\xbc\xe4\x27\x6f\
\xf9\xcb\x6f\xfe\xf7\x9f\x0f\xbe\xf0\x41\x4f\x10\x1c\x18\xff\xf8\
\x38\x20\xbd\xf2\xad\x70\xfa\xb7\xa7\xbe\x0c\xab\x6f\x7d\x1d\xf6\
\xee\x77\xd9\x0b\x7e\x35\xb8\xcf\xfd\xee\xfd\xd0\x7b\x33\xfc\x7e\
\xf3\xc3\x1f\x3e\xff\x04\xc6\x4f\xfe\xf2\x0f\x84\x06\xe8\x47\xbe\
\xfa\xd7\xbf\xfc\xd2\x37\xff\xf9\xd1\xcf\xbb\xde\xab\x2f\x1a\xc8\
\xef\xbe\xf7\xdf\xc7\x7c\xf8\x83\x5f\xfe\xfe\xfb\xbf\xff\x02\x81\
\x7e\x02\x38\x80\x04\xb8\x7e\x06\xd8\x7e\xef\xa7\x7a\x76\xe7\x7a\
\x89\x20\x1a\x91\x87\x7f\xdf\xb7\x7f\x9d\xf7\x7f\x14\x48\x7e\x0c\
\x70\x81\x18\x98\x81\x0c\xe0\x0f\x2f\xd0\x81\x1e\xf8\x81\x1d\x48\
\x80\x22\x38\x80\x06\x88\x7c\xcb\x67\x7a\x0a\xf8\x07\x41\x83\x19\
\xbe\x07\x7e\xe1\x57\x81\xfe\xa7\x81\x32\x38\x83\x32\x88\x02\x36\
\x88\x02\x20\x98\x83\x3a\x08\x82\x23\x48\x82\x25\xa8\x7c\x6e\x67\
\x3d\x98\xa1\x7f\xc2\x07\x83\xe3\x47\x83\x48\x88\x84\x0b\xb0\x84\
\x4c\xd8\x84\x37\xf8\x84\x50\x18\x85\x51\xb8\x83\x54\xd8\x83\x34\
\xc0\x7e\x99\x51\x81\x49\xa8\x84\x4d\xd8\x85\x5e\xf8\x85\x5e\xd8\
\x01\x62\x38\x86\x64\x58\x86\x66\xd8\x01\x52\x98\x86\x52\x48\x85\
\x1e\x48\x03\x99\x91\x84\x60\x18\x87\x72\x38\x87\x5e\x88\x00\x76\
\x28\x03\x78\x98\x87\x67\xb8\x87\x7c\xd8\x87\x7e\x28\x86\x4f\x98\
\x19\x74\xb8\x00\x76\x58\x88\x86\x78\x88\x88\x98\x88\x8a\xb8\x88\
\x79\xd8\x88\x8e\xff\xf8\x88\x90\x18\x89\x92\x38\x89\x8e\x98\x19\
\x8b\x78\x89\x98\x98\x89\x9a\x68\x87\x42\xd0\x89\x9e\xf8\x89\xa0\
\x18\x8a\xa2\x38\x8a\xa3\x08\x03\xa6\x78\x8a\xa8\x78\x8a\x99\x51\
\x00\xac\xd8\x8a\xae\xf8\x8a\xb0\x18\x8b\xb2\x38\x8b\xb4\xc8\x8a\
\x9e\x98\x8a\xb8\x98\x8b\xba\xa8\x8b\x43\xd0\x8b\xbe\xf8\x8b\xc0\
\x18\x03\xc2\x28\x8c\x99\x91\x00\x02\x70\x8c\xc8\x98\x8c\xca\xb8\
\x8c\xcb\x58\x8b\xce\x08\x8b\xbb\x88\x8a\xc0\x38\x8d\xd4\x18\x8c\
\xc3\x78\x8d\xc3\x98\x03\xda\xb8\x8d\x39\x90\x05\xde\x98\x19\x0d\
\x10\x8e\x09\x30\x8e\xe4\x58\x8e\xe4\xc8\x8c\xe8\x98\x8e\xea\xd8\
\x8c\xfe\x50\x8d\xee\x38\x04\xd8\x18\x8f\xd7\xc8\x8d\xf4\xd8\x8d\
\xde\x78\x8f\x5f\x90\x8f\xf9\xe8\x06\xa2\x61\x01\x16\x10\x8e\x00\
\x19\x90\x0d\x60\x8e\x04\x49\x90\xeb\x78\x90\xc8\x28\x10\xbd\x28\
\x8f\x0c\x99\x8d\xf5\x58\x8f\xf7\x18\x91\xfa\x38\x91\x6e\x50\x91\
\x6e\x40\x07\x18\x49\x07\xa2\x21\x05\xfe\xd8\x91\x1d\x29\x90\x20\
\x29\x8e\x05\x39\x92\x06\xa9\x8e\x03\x21\x8f\x0f\x99\x92\x11\xb9\
\x92\x13\xa9\x8f\x16\x59\x91\x19\x89\x91\x84\x30\x93\x84\xd0\x63\
\xaa\x21\x05\x38\xff\x99\x93\x1e\xb9\x93\xff\x18\x92\x21\x49\x92\
\x40\x49\x8e\x05\x91\x92\xdb\xb8\x92\x2c\xd9\x92\x2e\xf9\x92\x17\
\x19\x93\x34\x59\x93\x8c\xc0\x08\x96\x10\x95\xb5\x91\x06\x54\x99\
\x06\x39\x79\x95\x3c\xc9\x93\x3e\xb9\x95\x41\x89\x10\x46\x79\x94\
\x48\xb9\x8f\x4a\x19\x93\x19\xd9\x94\x4f\xf9\x94\x51\x69\x09\xa5\
\x50\x0a\xc7\x71\x08\x55\x59\x95\x57\x89\x95\x59\xb9\x93\x5b\x59\
\x97\x6a\x77\x97\x78\x99\x97\x7a\xb9\x97\x7c\xd9\x97\xff\x06\x0a\
\xfe\xd0\x04\xc7\x20\x02\x80\xb9\x06\x7e\x09\x19\x6a\xa0\x00\x1a\
\x20\x01\x9a\xa0\x02\x50\xa0\x00\x2f\x74\x98\x85\xa1\x06\x98\x40\
\x02\x9a\x80\x09\x7d\x70\x07\x7b\xe0\x03\x12\xd0\x74\x92\xb9\x17\
\x5d\x80\x09\x97\xd9\x07\x99\xb9\x07\x68\x00\x06\x3e\x90\x02\xb9\
\xf3\x99\x67\xd1\x05\x7d\x80\x09\x98\xa9\x99\x68\x70\x9a\x3e\xa0\
\x02\x24\x00\x05\x54\xc7\x9a\x65\xe1\x9a\xb1\x29\x9b\xa8\x69\x9b\
\x29\xa0\x01\x15\x90\x01\x6a\x00\x98\xba\xd9\x14\x5d\x70\x07\xa4\
\xa9\x99\xa6\xf9\x9b\x24\x10\x9c\x15\x20\x01\x14\x30\x06\x5f\x77\
\x9c\x4a\x91\x9c\x99\xe9\x9b\xce\x09\x9d\xd2\xe9\x01\x23\x70\x6b\
\xd6\xe9\x13\x5d\xff\xb0\x07\xa5\xd9\x9c\x3e\x50\x9b\xcf\x29\x9c\
\xdd\x99\x01\x44\x00\x05\x86\x19\x9e\x3b\xd1\x04\x7b\x70\x07\xb2\
\x49\x9b\x2a\x00\x9c\xea\x49\x01\x1e\x90\x01\x23\x00\x05\x63\x10\
\x32\xf0\x09\x13\xf2\xc9\x9c\xa7\xe9\x9c\xe9\x19\x9d\xfa\xc9\x9f\
\xed\x79\x06\xe0\x19\xa0\x2d\xd1\x04\x68\x50\x9f\xa8\x89\x9e\x29\
\xc0\x9d\x09\x3a\x02\xed\x39\x06\x67\x40\x3f\x0e\xca\x12\x10\xba\
\x07\xa6\x49\x9b\x14\xaa\x01\xf9\xb9\x9f\x18\xea\x9f\x67\x90\x07\
\x1c\xda\xa1\x1f\xf1\xa1\xb3\x09\x06\xbf\x89\x9f\x25\xaa\xa0\x28\
\x9a\x07\x88\x90\x9b\x09\xc1\x01\x0e\xa0\x00\x00\x30\x00\x01\x40\
\x00\x06\x10\x24\x2c\xda\x04\x60\x10\xa2\x13\x6a\x9b\xe9\x39\xa3\
\x23\xd0\x9f\xfe\x69\xa3\x0d\x7a\x10\x5d\xd0\x04\x3a\x7a\x00\x3d\
\xfa\xa3\x41\x2a\x02\xe4\x02\x9f\x44\xfa\xa2\x47\x4a\x02\x07\x8a\
\xa0\xfb\x49\xa3\x1a\x6a\xa3\x2b\x75\x10\x6a\x10\xa5\x1c\xa0\x00\
\x54\xea\xa3\x40\xfa\x00\x58\xfa\x9e\xd6\xc9\x01\x60\xc0\xa5\xb5\
\x89\xa4\xd0\x09\xa6\x19\x20\xa6\x29\x8a\x08\x65\x6a\x10\x81\x70\
\xa6\x4d\xb0\xa3\x6b\x6a\xa5\x6e\x6a\x04\x6b\x00\xa7\xac\x29\xa7\
\x2f\x7a\x9e\xf7\xff\xf9\x9c\x77\xda\x9d\x26\x9a\xa1\x7b\xfa\x0b\
\x0a\xf1\xa7\x5d\xa0\xa3\x6a\x5a\xa5\x6d\x8a\xa5\x86\x7a\x9c\x1c\
\xe0\x03\x05\xca\xa8\xc0\xf9\xa8\xfa\x19\xa9\x50\x50\xa3\x94\x9a\
\x10\x94\x00\xa8\x98\x3a\xa8\x9b\xfa\xa6\x5d\x27\x99\x9f\x1a\xaa\
\xe8\xe9\xa8\xc2\x09\xa6\x91\x2a\xa9\x79\x90\xaa\x09\x61\xa9\x52\
\x2a\xa8\x9a\x1a\xa4\x85\xba\x06\xb1\xea\x97\xb3\x7a\xa4\x76\x4a\
\xaa\x17\x7a\xa2\x63\x6a\x4c\x0b\xe1\xab\xad\x1a\xac\x57\x6a\xa8\
\x88\xca\x97\x9f\x0a\xa3\xa2\xea\xa5\xc1\x79\xab\xd2\xb9\xac\x19\
\xaa\xa1\xce\xfa\xac\xac\x0a\xac\x6c\x6a\x00\xd3\xda\xa9\xc6\xea\
\x03\xd8\x5a\xa7\xda\x4a\xa2\x15\x80\xa0\x09\x4a\xa3\x28\x1a\xae\
\x0b\xa1\x06\xe3\x9a\xa9\x6c\xba\xa9\x46\x80\xae\xd6\xaa\x02\x13\
\xca\xae\x15\xea\xae\xf0\x1a\xa6\x27\x3a\xaf\x19\xc1\xaa\xd1\x9a\
\xaf\x57\xfa\xa6\x7d\xc9\x01\xfe\x9a\xad\xb6\xca\xad\x14\x10\xaf\
\x18\x2a\xa9\x00\x8a\x11\xe3\x4a\xae\x3f\xfa\xaa\xfc\x9a\x97\x0e\
\x8b\xac\xda\xba\xad\xef\xda\xad\x04\x4b\x04\xdf\x7a\xb1\x18\x8b\
\xa6\x3b\x8a\xaf\x01\x40\xa8\x85\x9a\xa5\x78\xe9\xb0\xe7\xc9\xae\
\x11\x3b\xb2\x13\xff\x4b\xb0\x05\xfb\x9f\x1c\x71\xaf\x2c\xeb\xb2\
\x9c\xaa\x97\x32\x5b\xa7\xc9\x2a\xb0\x24\x6b\xa2\x39\x8b\xb2\x19\
\xd1\x05\x2a\xab\xa6\x83\xea\xb3\xfb\xea\xb1\x2a\x00\xb1\x35\x3b\
\xb0\x46\xdb\x9e\xfe\x89\xb4\x49\xdb\x04\xbf\xca\xb4\x55\x6a\xa5\
\x0b\x0b\xb3\x68\xc7\x01\x24\x20\xb5\x22\x6b\xb3\xa5\x9a\xa7\x15\
\x7b\xb5\x1f\x81\xa6\xad\xda\xb4\x40\xfa\xb5\x77\x29\xb6\x10\x1b\
\xb0\xb7\x4a\xb5\x68\x6b\xb2\xa7\x8a\xb5\x1a\xc1\xb6\x82\xea\xb6\
\xe6\xea\xa6\x58\xaa\x76\x72\x7b\x9f\x43\x5b\xb7\x45\x8b\xb6\x05\
\xab\xb7\x7b\xfb\xab\x7d\xdb\xb5\x6f\x0b\xb8\x60\x4b\x76\x0e\x30\
\xb6\x84\x1b\xb2\x02\x6b\xb7\xfc\x99\xb8\x2c\xa1\xb2\xc0\xea\xb8\
\x7f\x5b\xa8\x68\x37\xb9\x34\x3b\xb5\x98\xbb\xa4\x78\xab\xb8\x1b\
\xa1\xb5\x3a\xda\xb9\x3e\xea\xb5\x0f\x00\xb8\x68\x47\xb9\x48\x3a\
\xb5\x12\x70\xb8\x99\x8b\xb7\x5f\xf3\xa0\x5b\x9b\xa9\x8e\xdb\xa6\
\xb0\x7b\x76\x95\x6b\xb9\xdc\x6a\xbb\xa6\xdb\x9e\xb9\xab\xbb\x98\
\xca\xbb\xad\x4b\x00\xbe\x2b\x02\x22\x70\x76\xc3\xd0\xa8\x8e\x5a\
\xb6\xb5\x7b\xb3\x38\x8b\xbb\x02\xca\x01\xc9\x4b\xa5\xbd\xfb\xb7\
\xce\x7b\x76\x1e\xff\x90\xac\xd4\xdb\xad\x67\x7b\xbb\x50\x70\xbc\
\x2e\x21\xa5\xdb\x0b\x00\xdd\xbb\xb0\x67\x47\x04\xc2\x3b\xbc\x13\
\x5b\xbe\xc5\x8b\xbe\xe9\xab\xbd\x2b\xcb\xbd\xcb\xfb\xb8\x6e\x7a\
\x76\x19\x10\xb1\xf2\x6b\xbd\x88\x6b\xb2\xf6\x7b\xbf\x0e\x90\xbf\
\xec\xbb\xbf\x9f\xfb\xbc\x66\x77\x0b\x74\x3b\xbc\xc4\x5b\xb1\x05\
\x6c\xc0\x08\xdc\xa3\x0a\x2b\xac\x0c\x6c\x76\xdb\x0a\xc1\x02\x7c\
\xbb\x44\x30\xc1\x14\xcc\xb5\x16\xbc\xb1\x0b\x8c\x76\xcf\x40\x01\
\x1c\x4c\xbf\xa6\x0b\xc2\x2e\x81\xbf\x8d\x3b\xc2\xcc\x5b\xc2\x68\
\x67\x0c\x23\x5b\xbd\x2a\x8c\xa1\x85\xc4\x13\x2e\x2c\xc2\x03\x70\
\xc1\xaf\x9b\xc1\x66\x67\x00\xc3\x90\x01\x36\xec\x01\x61\x7a\xbb\
\x39\xac\xc3\xdb\xab\xbf\xcb\xfb\xb9\x42\x9a\x76\xb7\xe0\x01\x1d\
\x8c\xc4\x4d\x81\xbf\x0a\xc0\xc3\x0a\x2c\xac\x77\xf9\x00\xc3\x50\
\xbe\x54\x5c\xc5\x07\x7c\xc5\x07\xc0\xc4\x2d\x1b\xc3\x5a\x7c\x97\
\xa0\xb0\x0a\xb3\x40\x04\x79\x3a\x06\x23\xa0\x06\x49\xec\x13\xab\
\x2b\xc6\x64\x4c\xc2\x67\x9c\x97\x01\xf0\x0b\xb3\xe0\x00\x61\xa7\
\x15\x73\x8c\xc5\x65\xcc\xbf\x7d\xb9\x06\xc6\xe9\xc7\x61\x0c\xc8\
\x76\xfc\xba\x2c\xbe\xba\x13\x7f\x3c\xc6\x09\x9c\xc5\x8a\xbc\xc8\
\x30\xd1\xc8\x75\x6c\xc6\x91\x2c\xc9\x2d\x7c\xc8\x8e\x3c\xc2\x89\
\xfc\xc4\x98\xcc\x12\xc9\x8b\xc8\x66\x1c\xa4\x9f\xec\x12\x87\x2c\
\xca\x6f\x4b\xca\xa5\xcc\x12\x9a\xcc\xbd\x9c\x3c\xca\x9e\xbc\xca\
\x1e\xd1\xca\xec\xfb\xca\xa9\x1c\xcb\xb2\xcc\x11\xb4\xfc\xc8\x81\
\xfc\xb8\xb9\x0c\x12\xbb\x6c\xcb\xbe\xfc\xcb\xb3\x9c\xbf\xae\xdc\
\xc3\xbd\xfc\xb7\xc4\x5c\xcc\x74\x5c\xcb\xc8\xbc\xb1\xc3\xbc\xcc\
\x1b\x11\xcc\xcf\xcc\xbc\xa9\x2c\xcd\xba\x6c\xcc\xce\xbc\xbf\xd7\
\x8c\xcd\x1a\xb1\xb2\x22\x2c\xcc\xe6\xca\x39\xde\x8c\x11\xe0\xbc\
\xc9\x9c\x6c\xc7\xe4\x5c\xce\x0d\x71\xc5\xe1\xfc\xcc\x76\xcc\xce\
\x1a\xe1\xce\xe8\x0c\xcf\x66\x2c\xcf\xf3\xfc\xce\xad\x4b\xc2\xf8\
\xbc\x11\x63\x7c\xcc\xfb\xcc\xbc\xfd\xdc\x11\x00\xdd\xb2\x4e\x04\
\x68\x01\x01\x00\x21\xf9\x04\x05\x0a\x00\xff\x00\x2c\x10\x00\x0f\
\x00\xa9\x00\xa9\x00\x00\x08\xff\x00\xfd\x09\x1c\x48\xb0\xa0\xc1\
\x83\x08\x13\x2a\x5c\xc8\x50\xa0\x92\x28\x51\xa8\x4c\x99\xc2\xe6\
\xcd\x9b\x86\x18\x33\x6a\xdc\xc8\xb1\xa3\xc7\x8f\x05\x6f\x38\x79\
\x18\x71\x62\xc5\x37\x7a\x24\x81\x5c\xc9\xb2\xa5\xcb\x97\x08\x6f\
\x88\x54\xf2\x50\x22\x45\x8b\x29\x55\xc2\xdc\xc9\xb3\xa7\x4f\x81\
\x40\x64\x8e\xac\x69\x12\xa7\xa4\x42\x85\x7e\x2a\x5d\xca\x14\x63\
\xd0\x99\x44\x6f\xa2\x3c\x9a\xb4\xa9\xd5\xab\x4c\x8b\x3c\x1d\x5a\
\x52\x6a\x4a\xa4\x97\xb0\x8a\x1d\xfb\x52\xab\x50\x9a\x5d\x4f\x7e\
\x2d\x14\x96\xac\xdb\xb7\x1b\xb5\x06\xe5\x6a\x53\x2d\xd5\xb6\x70\
\xf3\xea\x3d\x28\x17\x6a\x5a\x94\x6b\xf1\xee\x1d\xac\xb7\x2f\xdd\
\xa2\x7a\xbe\x5e\x12\x4c\xb8\x31\xd9\x22\x66\x0f\xdf\x4c\x7c\x74\
\xb1\xe3\xcb\x8f\x23\x8f\xfc\x4b\x99\x2d\x63\xcc\xa0\x95\xb2\xd0\
\x1c\xb5\x62\xe7\x4b\xa2\x42\xab\x5e\x3a\x7a\x6b\xe9\xa9\x95\x53\
\xaf\x9e\xcd\xb3\xf5\x59\xce\x92\x62\xd3\xde\xfd\xd2\xf6\x4c\xdc\
\x60\x65\xf3\x1e\xfe\xd1\xf7\xe6\xba\x53\x83\x13\x5f\xde\xd1\xf8\
\xeb\xc0\xc2\x99\x4b\x67\xd8\x7a\xee\xf3\xbb\xd1\xa7\x2f\x35\x22\
\xb6\xfa\x6f\xe4\x8a\x51\xbf\xff\x05\x10\xda\x81\x3f\x4c\xc5\xd4\
\x10\xf1\xa7\xe6\x2a\x0b\xdb\xc7\x11\xc7\x4e\x85\x75\x84\x3f\x16\
\xc8\x6e\x39\xf2\x47\xe1\x32\x05\x4d\x31\xa0\x90\x08\x0e\x30\x8c\
\x90\x8e\x7b\xf0\x5d\xc7\x96\x28\xf4\x59\x35\x84\x13\xd6\x3c\x11\
\x02\x17\x72\xe4\xa2\x8c\x08\x8d\x51\x50\x06\x0a\x75\xd4\x91\x48\
\x22\x8e\xd4\x81\x05\x34\x04\x34\x75\x44\x82\xc0\xa1\xd6\x20\x53\
\x43\xd8\xf0\x44\x09\x21\x84\xb0\xc2\x0a\x25\x94\xe0\x84\x01\x83\
\x79\x80\x45\x19\x7f\xfc\xd1\xe1\x87\x8e\x38\x32\x49\x29\x01\x30\
\x75\x62\x64\x51\x19\xb5\xe0\x8a\x4a\xc5\x60\x43\x8d\x31\xce\xe8\
\x82\x0b\x35\xd4\x80\x8f\x07\x7a\x79\x60\xc5\x8e\x3c\xfa\xe8\x21\
\x88\x93\xfc\x41\x8d\x91\x28\xda\xa4\xa4\x8a\x4c\x39\x39\x03\x94\
\x32\x4e\x49\x65\x95\x6c\xe4\x95\x01\x0e\x5b\x72\xd9\xe3\x8f\x60\
\xd6\x51\x4a\x7b\x3f\x1d\x69\x5d\x49\x76\x2d\xb9\x94\x9a\x6c\x4a\
\xf9\x66\x0f\x3d\xb8\x60\x8f\x0a\x6e\x8d\x40\x03\x9d\x75\x96\xd1\
\xe5\x8f\x41\x4e\x32\x49\x3d\x4a\xf9\xf9\x9d\x57\xf3\x35\x69\xc3\
\x9a\x30\xca\xb8\xc2\x94\x55\x22\xca\x04\x13\x5a\x28\x73\x0a\x59\
\x2f\x3c\x0a\x29\x16\x76\xe2\xff\x59\x69\x19\xf9\x98\xd7\x93\xa6\
\xf1\xa9\x05\x56\x2a\x4c\xee\x14\xc3\x0f\xa0\x46\x39\xea\xa1\x3d\
\x9c\xaa\x85\x16\x35\xac\xc2\x2a\x0d\xae\x5a\x11\x29\x8f\xb2\x0a\
\xf9\x49\x2e\x6b\xdc\xfa\xde\x53\x44\x99\x36\x9f\x2c\x3e\xfd\x3a\
\xc3\x9a\xc2\x92\x5a\x83\xa9\xa8\x6a\xd1\x46\x1b\xa5\x8c\x05\xcd\
\x0b\xad\x36\xfb\xac\x97\x40\x5a\x2a\x66\x4f\x48\x68\x9a\x6d\x72\
\x2a\x72\xcb\x53\x0e\xc0\x82\x2b\xaa\xb8\xe4\x1e\x7b\xee\x1c\x2e\
\x8c\xf5\x05\x0a\xec\x32\x8b\xc3\xab\x3b\xde\xf9\xa5\x90\x96\x5a\
\xd2\xc4\x4e\xf5\x26\x28\x91\xb6\x4b\xea\x0b\x13\xbf\xdf\x42\x69\
\x68\xa9\xc5\x96\x3b\xf0\x1c\x8f\x8c\xc5\x08\x0a\x08\xb7\xbb\xb0\
\xb3\xb0\x4e\xea\x61\xa5\x93\x38\x92\x0f\xc5\xb8\x2a\x71\x31\xbe\
\x0c\x6a\xec\x12\xbf\x9f\x16\x0a\x70\xc8\x02\xb7\x31\x07\xc9\x25\
\x8b\x45\x07\xca\x29\x2b\xfc\xaa\xa4\x0e\x83\x28\xed\x1f\xd2\xf0\
\xd9\x52\xc5\x48\x46\x31\xd9\xb6\x1b\xff\xd0\x73\xa8\xc3\x82\x6c\
\xac\xb9\x42\x13\xad\xc8\x58\x12\x74\xd0\x01\xca\x09\xbb\x6b\xa7\
\x8f\x40\x4a\xfb\x89\x34\x2f\x51\xfd\xe7\xd5\x19\xbf\x94\xc3\x0e\
\x9f\xfa\xdb\xf5\xb8\x40\x83\xff\x3d\xf4\x23\x8f\x28\x52\x95\x58\
\x32\x98\x8d\xb6\xca\x4b\x4f\x1a\xef\x24\x9f\xfc\x01\x0d\x77\x2c\
\xc9\xfd\x1b\xdd\x2a\xf2\xe2\x52\x16\x78\x77\x1c\xae\xd7\x22\x87\
\x0d\xb8\x22\x63\x93\xe5\x43\x0e\x86\x27\xad\x36\xd3\x6c\x83\xc9\
\x78\x2c\x84\x28\xc0\x12\x0f\x48\xa0\x48\x79\x2a\xb2\x58\xce\x12\
\xe6\x36\x6c\xfd\x2f\xe7\x7e\xff\x1d\xb8\x22\x36\xbc\xd5\x47\xe1\
\x67\x9b\xbe\xf2\x96\x4c\xcb\xca\xf8\x27\x8e\x40\xf3\x7a\xc5\x73\
\x63\x9c\xb3\xed\x20\x61\xae\x75\xb0\x1f\x07\x3c\x32\xe0\xbf\x07\
\xff\x96\x03\x98\x90\x5e\x7c\xda\x2b\xb7\x0c\xed\xcb\xd2\xc6\x92\
\x88\x25\x81\x80\x04\xfb\x89\xd1\x27\x37\xfd\x4a\xd6\xeb\x9e\x3d\
\xd0\xdb\xff\x0e\xfc\x5e\x60\xc0\x50\x3a\xc2\x4a\x7b\x17\xa5\x2c\
\xf5\x89\x58\xb4\x02\x6e\x1f\x79\x1f\x0b\xe2\xa7\x87\x8c\x51\xaf\
\x23\x59\x08\xc3\xf5\xf4\x46\x2a\x53\x05\xcd\x77\xa0\xe3\x84\xf7\
\xf4\xa2\x80\x62\x08\x81\x78\x87\x6b\x96\xf9\xe0\x05\xb1\x02\xd6\
\x81\x1d\xe4\xe9\xc8\x16\xa8\x36\x39\xd3\x64\x8c\x18\x1f\x89\xe0\
\x04\xb9\x56\xc1\x62\x5d\x50\x6c\x8a\xd0\xa0\x63\x48\x90\x03\x10\
\x26\xad\x7c\xb1\x8a\xd7\x27\xff\x0a\xd8\x0a\x46\xe0\x88\x23\x5b\
\xe0\x81\x9f\x36\x33\x99\x25\xf1\x02\x86\x10\x94\xe0\xf5\x68\x48\
\x25\x0b\xf6\xee\x73\x39\xdc\x60\x63\x30\x21\x03\x1f\x26\x0c\x88\
\x8a\x03\x53\x01\x63\xe1\x08\x74\xa8\x50\x89\xad\x61\xa2\x0b\x51\
\x53\x3b\x28\x6e\x24\x82\x3b\x98\x22\x8c\xba\x66\xc5\xfc\x65\x50\
\x8b\x8d\x01\x00\x1a\x7a\x58\x3a\xf2\x45\xea\x4e\x4e\x5b\x5d\x2b\
\x62\x41\x87\xf6\x69\x24\x89\xb1\x33\xcb\x43\x6e\x52\x19\xda\x3d\
\x91\x23\x5f\xe0\x42\x1c\xed\x37\x2a\xbe\x75\xee\x6f\x19\xe4\xc4\
\x0c\x56\x03\x86\x0f\xf6\x51\x65\x7f\x64\x5b\x09\x0d\xd8\x0a\x76\
\x6c\xc4\x0b\xef\x53\xa4\xd5\x2a\xd2\xc8\xda\x29\x63\x23\x91\x9c\
\xa4\xe6\xa4\x64\xc9\x0b\x62\x91\x13\x9a\x9c\x8d\x02\x68\x31\x84\
\x2e\x1a\xce\x8f\x2d\x23\xe1\xf2\x0c\x98\x88\x60\x74\x21\x23\x5e\
\x58\xe1\x11\x54\xc9\x48\xb6\xd0\x8e\x18\xaf\xcc\x48\x2c\x7f\x30\
\xc5\xdd\x8d\xeb\x92\xb7\xcc\xe5\x6e\x48\x90\x05\x5f\x9e\x0d\x98\
\x0d\x1b\x20\x11\x7b\xb1\x0c\x4b\x20\x53\x99\x0b\xbc\xc1\x22\x59\
\x59\x08\x06\x3d\x31\x9a\x0d\x71\x03\x1c\x9e\x20\x4b\x1a\x96\x4a\
\x64\x18\xcc\xa1\x36\x77\xf3\xff\x00\x5a\x7c\xd0\x8b\x0a\xfb\xe3\
\xc3\x04\xd9\x0b\x47\xd4\x03\x14\x0d\x49\x26\x1a\x83\xb2\xce\x37\
\x1c\xc5\x9d\xc4\x00\x07\x46\xe4\x49\x4f\x39\xb6\xe9\x9e\x02\xc3\
\x20\x2e\x49\xb1\x49\xe2\x10\x40\x05\x59\xf0\xe4\xf8\x02\x1a\xcc\
\x81\x8e\x73\x19\x6e\xe0\x00\x43\xc8\x90\x44\xf8\xa9\x73\x95\x29\
\x61\xe3\x13\x25\xca\x10\x8a\xca\x12\x5c\x95\xbc\x66\x46\x49\x96\
\x49\x8e\x4e\x67\x0f\x42\xf8\xe7\x48\x1f\x25\x50\x31\x7e\xa2\x15\
\xe4\x6c\xc5\x81\x16\x42\x06\x54\x26\x52\x24\x30\x95\x84\x4c\x95\
\x41\x53\x85\xd0\x41\x0e\x61\xa8\x68\xcf\xda\x54\x45\x7c\xf2\x54\
\x9f\x3e\x9d\x0e\xf8\x72\x20\x54\xb4\x91\x34\x9c\x62\x34\x20\x39\
\x3f\x41\x08\x65\x25\xa4\xa9\x2b\x1c\x0d\x54\x29\x12\xd3\x67\x2a\
\x43\x1d\x0b\xb9\x6a\x56\xeb\xc9\x55\x9d\x9a\x0b\x93\x60\x2d\x81\
\x76\x06\xc2\x43\xa1\x7e\x93\xa4\xc9\x4b\x2b\x52\x97\x11\x0e\x73\
\x26\x04\x0f\xc9\xac\x57\x11\xe6\xca\x86\x06\x5e\xc2\xae\x78\x4d\
\x08\x21\x06\xc1\x05\xad\xe2\xb4\x82\xf8\xbc\x25\x29\x48\x21\xd8\
\xc1\x0a\x04\x00\xb4\x80\x41\x50\x41\xf8\x45\xe4\x41\x2b\xad\xe4\
\x8c\xc6\xdb\x06\x80\x10\x3c\xff\xb0\x54\xb2\x94\xb5\x6c\x2a\x66\
\x9a\xd9\x83\x6c\x96\x0b\x7b\x05\xd6\x1c\x2b\x69\xc3\xbf\x7e\x6e\
\xa3\xa4\x35\x2d\x41\x40\xa1\x81\x2f\xac\xf6\x97\xad\xa2\x53\x38\
\x3d\x44\xd0\x65\x44\x63\x1b\x39\x28\xd2\x41\x9a\xaa\x44\xad\x38\
\x01\xa6\xce\xe4\x05\x55\x35\x1b\x09\xe0\x7a\x76\x8e\x5d\xf5\xdb\
\x71\x39\x41\x0a\x5c\x94\x56\xb9\x04\xb9\x03\x0c\x54\xeb\xcb\x1f\
\x22\x4f\x94\x04\x8d\x46\x38\x7a\xb1\x54\x83\x70\x17\x7e\xdf\xa5\
\x6b\x3b\x77\x7b\x57\x84\xd4\x23\x12\x70\xe8\x2c\x5f\x89\x8b\xaa\
\x81\xfd\x8e\xbd\xed\x7d\x2f\x7c\x07\xa2\xc7\x2f\xd0\xb7\x70\x66\
\x95\xee\x6b\xd3\xd7\x0a\xeb\x86\x23\x1a\x09\x71\xea\x02\x03\x8c\
\x92\x76\xca\x02\x9a\x09\x71\x87\x1c\xcc\x5b\x4d\x06\xab\x37\x83\
\xa3\xc5\x45\x08\x26\x8c\x10\x15\xc4\x40\xb5\x9e\xcc\xf0\x7d\x5f\
\xc6\xb8\xc5\x86\x63\x1b\x60\x48\x48\x5c\x81\x40\xe2\x06\x8a\xe2\
\xc4\x0a\x91\x03\x1c\x82\xfb\x59\x9d\x7a\x0e\xac\xb8\x90\x31\x8d\
\x11\xa2\x00\x4d\xe4\x00\xc7\xac\x25\x2a\x5a\x1d\x31\x4e\xfd\xb6\
\x62\x21\x23\xb6\x5a\x89\x7b\x65\x90\x17\x24\x38\x0c\x93\x44\xaf\
\x93\x31\xb9\xd1\x28\xcf\x78\xff\xca\x09\xd1\x80\x1b\xe6\x2b\x52\
\x00\x6a\x98\x6d\x82\xb4\xee\x97\x79\xe2\x05\x16\x7f\xea\xa2\x36\
\x14\xda\x71\x63\x6c\x8b\x37\xc3\x19\x21\x46\xc0\xc4\x10\x86\x70\
\xe1\xc3\xde\xb9\x0e\xd2\x5a\x6c\x2f\x7a\x62\x0a\x05\x6f\x35\xbd\
\x82\x86\x71\x94\x6d\xb1\x82\x43\x2f\x84\x00\x24\xa0\x03\xa3\x9f\
\x6b\xe7\xfb\x8a\x11\xa9\x56\xe8\x89\x17\xe0\x10\x47\x70\x61\x9a\
\xa7\x6d\xb6\x05\xa7\x3d\xdd\x10\x1f\xc4\x60\xd1\xf4\x75\xb4\xa9\
\x85\x64\x40\x4a\xf4\x84\x10\x72\xd0\xda\x1c\xd7\x1c\x38\x08\xe3\
\x42\xd6\x9d\xa6\x35\x43\x14\x70\x87\x2f\xdc\x3a\xd7\xa5\xde\xd1\
\xcb\x0a\xf8\x13\x2e\x3c\xa9\x4d\x81\x86\x75\x7b\x8f\x0d\x8c\x82\
\x29\x1b\x23\x72\x7e\x36\xa9\x5f\xa0\x61\xea\x62\xca\x27\xdb\x90\
\x03\xb6\x1b\xac\xed\x63\xdb\x02\x18\x35\xf8\x76\x46\x08\x70\x87\
\x1c\xdc\x7a\xd4\x18\x26\xf7\x96\x7c\xe4\x3c\xa5\x7c\xe1\x09\x2e\
\xc8\x76\xb1\xdb\xfb\xee\x64\xc4\x5b\xde\x19\x31\x42\x05\x18\x61\
\x6f\x7c\x1f\x76\x4b\x63\x5a\x0a\x00\x4c\xb1\x82\x06\x0f\x7c\xd3\
\xc0\x30\x38\xc2\x39\x02\x86\x2c\x34\x1c\xda\xad\xd2\xc4\x55\x08\
\x61\x83\x76\x17\x5c\xe3\x1b\xff\xdf\xc8\x01\xc0\xc0\xf0\x8f\x0b\
\x61\x08\x28\xb8\x83\x58\x90\x31\x07\xd0\x11\x3c\xe3\xd9\x60\x42\
\xca\x3d\xa2\x01\x0f\x88\x23\x0b\x31\x28\xc5\x17\x2a\x80\x86\xb1\
\x3c\x20\x1a\x61\x28\x81\x2d\x02\x97\x0c\x25\xe8\x7c\xe7\x1d\x21\
\x4f\x20\x66\xa1\x89\x11\x34\xe1\x01\x70\xa1\x46\x3c\x44\x81\x08\
\x25\x40\x7d\x25\x08\xf5\x07\xd6\xf7\x22\xb5\xaf\x9b\xfd\xec\x68\
\x4f\xbb\xda\xd7\xce\xf6\xb6\xaf\xa6\x0f\x70\x87\x3b\x26\xe6\x4e\
\x77\xba\x6b\xe2\xee\x78\xbf\x3b\x2d\xf6\xce\xf7\x62\xf8\xdd\xef\
\xd4\x08\x3c\x35\xa0\x41\x78\x68\xa0\xe3\xf0\xf9\xc8\xc7\xb9\x79\
\x63\x87\xc6\xc7\xe1\xf1\x55\x88\x7c\x15\x82\x40\xf9\x20\xe8\xe0\
\xf2\x97\x6f\x81\xe6\x37\x7f\x82\xce\x7b\xde\xf3\x17\x08\xbd\xe8\
\x47\x8f\x81\xd2\x23\xe4\x0e\xa8\x8f\xbb\xea\x55\x5f\xf7\xd6\xe7\
\x1d\xef\x7c\xdf\xfb\xdf\x01\x2f\xf8\xc2\x23\x7e\x66\xb3\xb1\xc3\
\xe3\xe3\x20\xf9\xca\x5b\x1e\xf3\x3a\xd8\x3c\xe7\x3f\xdf\xf9\xd1\
\x1b\xff\x02\xa5\x4f\xbe\xf2\x93\x5f\x10\xd4\x3b\xff\xf9\xce\x5f\
\xbd\xf4\x5b\x3f\xf7\xd7\xeb\xbd\xef\x7f\x17\xfc\xe0\x09\x6f\x46\
\xd5\xf0\x3e\xf2\xbe\x07\xbe\xff\xf0\x5b\x40\xfc\x13\x1c\x5f\xf4\
\xcb\x4f\x7f\xf2\x4d\xc0\xfe\xf6\x9b\x60\x20\x7b\x88\xbf\xfc\xa1\
\x4f\x7f\xe8\x4b\x3f\xee\xd4\xc7\xc4\xeb\x63\x3f\xfb\xda\x87\x66\
\xf2\x94\x27\x7e\xc3\xf7\x79\xe7\xa7\x7e\xcb\xe7\x7e\x08\x98\x80\
\x11\xb0\x80\x02\x21\x7f\x0e\xf8\x80\x0f\x58\x7f\xf5\x77\x7f\x7d\
\xe0\x7a\x79\xc7\x7f\xc5\x10\x1a\x99\x37\x80\xc5\x77\x7c\x06\x58\
\x7a\x09\x18\x82\x0b\x38\x82\x24\x58\x82\xfe\x80\x06\x28\x98\x82\
\x2a\xa8\x82\x10\xd8\x82\xf1\x27\x81\xcf\x37\x7d\x75\x77\x81\x98\
\x41\x7e\x04\x48\x7a\xea\x17\x82\xee\x57\x82\x3c\xd8\x83\x11\x30\
\x01\x40\x18\x84\x40\x08\x06\x44\x08\x06\x2b\x78\x84\x48\x78\x84\
\x2e\xe8\x80\x30\x28\x83\x98\x81\x7e\xe9\xa7\x83\x26\xe0\x83\x3d\
\x28\x84\x56\x78\x85\x58\x38\x01\x45\xb8\x85\x5c\xd8\x85\x5d\x98\
\x84\x60\x88\x06\x4b\x48\x7f\x98\x81\x01\x0a\x48\x85\x3f\x98\x85\
\x6a\x98\x85\x1f\xd0\x86\x6e\xf8\x86\x6e\xe8\x03\x72\x38\x87\x74\
\x58\x87\x73\xe8\x85\x78\x98\x87\x44\x18\x86\x28\xb8\x07\x98\x31\
\x82\x6b\x88\x85\x70\x38\x88\x84\x58\x88\x86\xd8\x86\x76\x98\x88\
\x8a\xb8\x88\x8c\xd8\x88\x5d\xff\x88\x19\x87\x18\x89\x1b\x30\x89\
\x94\x58\x89\x96\x78\x89\x98\x98\x89\x2a\xb0\x89\x9c\xd8\x89\x9e\
\xf8\x89\xa0\x18\x8a\xa2\x38\x8a\x9b\x88\x19\x99\x78\x8a\xa8\x98\
\x8a\xaa\x88\x89\x9f\x48\x02\xae\xf8\x8a\xb0\x18\x8b\xb2\x38\x8b\
\xb4\x58\x8b\xb0\x98\x02\x29\x80\x19\x57\xb0\x8b\xbc\xd8\x8b\xbe\
\xb8\x8b\x4b\x10\x8c\xc2\x38\x8c\xc4\x58\x8c\xc6\x78\x8c\xc3\x68\
\x8b\xca\x18\x8b\xb8\xd8\x8c\xce\xf8\x8c\xd0\x98\x02\x1a\x30\x8d\
\xd4\x58\x8d\x98\x61\x08\x62\x90\x8d\xda\xb8\x8d\xdc\xf8\x8b\xde\
\xf8\x8d\xe0\x18\x8e\x57\x10\x8d\xe4\x58\x8e\xcf\x58\x8d\xe8\x98\
\x8e\xd3\x58\x01\xec\xd8\x8e\xec\x28\x01\xf0\x88\x19\x82\x30\x8f\
\xf4\x68\x08\xf6\x78\x8f\xf8\xc8\x8d\xfa\xb8\x8f\xdb\x28\x8e\xdf\
\xe8\x0f\xe5\xa8\x8e\x02\x29\x90\xee\x58\x90\xef\x08\x8f\x08\x09\
\x8f\x14\xb0\x90\xfd\x01\x1a\xa8\x50\x09\x10\x19\x91\xf4\x38\x91\
\xf3\x88\x8f\x16\x99\x8f\xfc\x98\x91\xfc\x28\x10\x03\xd9\x91\x06\
\xf9\x91\x15\x90\x90\x22\x29\x01\x0c\xc9\x90\x1e\x70\x92\x1e\x90\
\x01\x19\x10\x1a\xaf\xd0\x92\xa8\xf0\x92\x2f\x19\x91\x32\x49\x91\
\x34\x29\x08\x17\x79\x93\x18\xff\x99\x91\x03\x81\x8e\x20\xd9\x93\
\x23\x29\x92\x25\x59\x92\x28\x79\x92\x2a\x59\x94\x23\x60\x1f\xaa\
\x51\x0b\x4a\xd9\x92\x4c\x09\x93\x30\x29\x93\x50\x59\x93\x35\x89\
\x93\x38\x59\x10\x3d\x79\x90\x3f\x99\x90\x41\x29\x94\x43\x99\x92\
\x45\x99\x01\x47\x79\x94\x44\x30\x96\xb4\xe1\x0c\x66\xa9\x94\x4b\
\xc9\x94\x2e\xe9\x94\x31\x09\x95\x51\x29\x95\x53\x79\x8f\x08\x91\
\x95\x23\xb9\x95\x5c\xd9\x95\x5f\xa9\x92\x61\x29\x96\x63\x49\x04\
\x50\x40\x1c\xd7\x70\x0d\x66\x79\x96\x68\x59\x0b\x6a\xb9\x96\x6c\
\xd9\x96\x6e\x39\x93\x52\xe9\x76\x8e\xf9\x98\x90\x19\x99\x92\x39\
\x99\x94\x89\x70\x08\xf5\x00\x03\x10\x76\x61\x37\x16\x08\x85\x02\
\xc6\xe0\x0f\x74\x50\x2d\x95\xe9\x0f\x04\x20\x02\x81\xd0\x05\xbf\
\x10\x08\x0a\x20\x02\x63\x27\x16\x90\x00\x08\xbd\x50\x0e\x55\xc0\
\x06\xa4\x30\x06\x45\xe0\x6b\x93\xf9\x00\xcf\x10\x08\xcf\xf0\x0b\
\xb7\x70\x0b\xab\xa0\x06\x1c\xd0\x9a\x56\x01\x09\x73\xb0\x04\x10\
\x00\x02\x20\x90\x04\xa3\xc0\x04\xfc\xb0\x0c\xb9\xf9\x0b\xbd\xe9\
\x9b\xab\xb0\x0a\x94\x10\x08\x6a\x70\x75\x57\x61\x9c\x08\xb0\x00\
\x0c\xc0\x00\xc9\xb9\x9c\x49\xff\x80\x01\x8d\x80\x9b\x8e\xf9\x00\
\xbf\x90\x9e\xbf\x69\x9d\x81\x80\x9d\x5d\xd0\x04\x07\x20\x9a\x4b\
\x01\x09\x8a\x50\x00\x05\xd0\x9d\xde\x09\x01\xe1\x99\x04\x49\xc0\
\x07\x8f\xf9\x00\xb7\xe0\x9b\xc0\xc9\x9e\xee\xd9\x04\x1c\xc0\x01\
\x07\x80\x21\x4a\x01\x09\x9c\x90\x00\x02\x20\x00\xf7\xb9\x00\xde\
\x09\x9e\xca\x99\x04\x2d\xe0\x08\x90\xb3\x76\x00\x4a\x9d\xd6\x79\
\x9d\x6a\xa0\x06\xef\x79\xa0\x0e\xa0\x00\x03\x00\x09\x3f\x01\x0a\
\xa4\x60\x01\x0d\xe0\xa0\x10\x8a\x00\xdd\xf9\x9d\xfa\x59\xa1\x40\
\x60\x2b\x69\x07\xa0\xeb\x49\xa0\x20\x1a\xa2\x1c\x30\xa2\x07\x00\
\x00\x25\xe2\x13\xd6\x20\x05\x16\xa0\xa2\x2c\x7a\x9f\xf8\x09\xa3\
\xc9\x29\x08\x93\xa0\x76\x0f\xb0\x0a\x03\x4a\x09\xd7\xe9\x9e\x3a\
\xca\xa3\x00\x30\x00\x99\xe9\x13\x87\x90\x06\x42\x4a\xa4\x0f\x6a\
\x9f\x47\x0a\x9e\xc9\x29\x06\x48\x70\x0b\x67\xd7\xa4\x4f\xea\xa1\
\x39\x6a\xa0\x0e\x40\xa5\x55\x1a\x00\xc4\xf9\x12\x15\x90\xa5\x5a\
\x3a\xa4\x2b\xda\xa5\x46\x2a\xa1\x48\x0a\x02\xc8\x60\x76\x4d\x5a\
\x9d\x50\xda\x9e\x1f\xfa\x9e\x6a\xca\xa6\x03\x10\x00\x04\x70\x44\
\x3b\x61\x0a\x9b\x20\xa7\x5b\xff\xba\xa2\x0e\xea\xa5\x5f\xaa\x9f\
\x3a\xb0\x0c\x07\xb0\x73\x7d\xda\xa1\x80\x0a\xa2\x4d\x30\xa8\x0a\
\x70\x00\x3d\x5a\xa8\x86\xfa\xa6\x2e\x81\x0d\x9b\xb0\xa8\x5a\xda\
\xa8\x09\xf0\xa8\x77\x3a\xa1\x60\x8a\x04\x88\xfa\x6d\x0f\x40\x09\
\x98\x8a\x9d\x69\xca\xa9\x9e\xda\xa6\x86\x6a\x00\x0a\xba\x13\x80\
\x20\x00\x8b\x9a\xa5\x52\x80\xaa\x45\xea\xa2\x91\xfa\x01\x75\x80\
\x70\xb1\x3a\xab\x81\x2a\xa8\x3b\xca\xa3\x9f\x5a\xa8\x87\x6a\x00\
\x26\xca\x13\x42\x70\x05\xba\xf0\xab\xa7\xaa\xa2\x8e\x6a\xa7\x2e\
\x8a\xa7\xdf\xc9\x0f\x37\xe0\x56\x9e\x16\xab\x50\x1a\xa5\xcb\xba\
\xa9\xcd\xda\xa9\x3d\xda\xa6\x04\x70\xa8\xa2\xea\x12\x6b\x00\x02\
\xd7\x6a\xaa\xd9\xda\x00\xdb\x0a\xa1\xab\x3a\xa1\xa3\xb0\x0d\xb4\
\x46\xae\xe6\x7a\xae\x22\x3a\xa2\x9d\x0a\x00\xb8\xea\xae\x19\xca\
\x13\x97\xc0\x00\xf3\xca\xa8\x42\x6a\xaf\xa9\xca\xad\xdd\x3a\xa1\
\x18\xb0\x0b\x86\x44\x63\xfe\x9a\xa9\x5d\xc0\xac\xe9\x3a\xb0\x05\
\x6b\x00\x06\x70\xb0\x3d\x11\x9b\xd7\x7a\x08\x8c\x4a\xa7\xf7\x0a\
\xa9\x5f\xca\x00\x64\x30\x65\x0f\x10\x08\x51\x4a\xab\x19\x8b\xae\
\x1b\xbb\xae\x56\x6a\xa8\x87\xff\x0a\xb2\x3d\x11\x00\x53\xb0\xb0\
\x25\xab\xad\x0f\x8b\xaf\xf9\xca\x00\x18\xb0\x1f\xf0\xd5\xb2\x2f\
\x7b\xae\x06\x3a\xb3\x04\x5b\xb3\xed\xaa\xab\x56\x71\x00\xdc\x20\
\x06\xa5\xca\xb0\x26\xfb\xb3\xf8\x1a\xb1\x13\xea\x04\x65\x27\x1d\
\xa6\xf9\xaf\xb5\x1a\xb0\x0a\xa0\xae\x55\x0a\xaa\x87\xba\xab\x56\
\xc1\x07\x23\x4b\xb5\x3e\xcb\xa2\x57\x1b\xb1\x0c\x70\x0d\x7b\x36\
\x1d\xa6\xd9\x9e\x30\x1b\xb3\x49\xbb\xa6\x61\x7b\xab\x05\x5b\x9a\
\x63\xf1\x0c\x37\xf0\x0e\xd8\x9a\xad\x6b\xfb\xa0\x6d\x8b\x9f\x0b\
\xb0\x04\x5b\xf0\x0b\x5c\x4b\xb7\x75\xab\xb1\x78\x2b\xb6\x63\x6b\
\xb3\x66\x2b\x16\xe1\x30\x0a\x81\x1b\xac\x55\xfb\xb3\xf6\x19\xb4\
\xa6\xc0\x1c\x22\xa0\x06\x99\x5a\xab\x77\x2b\xb0\x7a\x5b\xb3\x86\
\x3a\xb9\x62\xd1\x05\x6f\x30\xb5\x6a\xeb\xb0\x9a\x8b\xb2\x12\x7a\
\x01\xad\xa0\x5d\xbb\xf1\xb9\xa1\x6b\xb7\xa3\x9b\xb7\x34\x4b\xb6\
\xa8\x3b\x16\x90\xd0\x0a\x86\x40\xb2\x69\x30\xbc\x98\xbb\xb6\x45\
\x0a\xbb\x12\x0a\x04\xb4\x45\x1b\xb6\xdb\xb8\x32\x3b\xb3\xbb\x1b\
\x00\xa7\x4b\x18\x48\x70\xb9\xc5\xeb\xba\x6c\x8b\xbc\x62\x40\xb4\
\xab\x61\xbb\x1f\x9a\xa3\x1a\xff\x0b\xbd\x4b\xcb\xbb\x8d\xb1\x0a\
\x64\x50\x09\xc2\x7b\xaa\x8d\xea\xa8\xd9\x6b\xa4\xdd\x7a\x0d\x37\
\xa0\xb8\xa1\xe1\xbd\xcb\x1a\xbe\x8f\xab\xb7\x91\x1b\x00\xbd\xab\
\x17\xdf\x90\x00\xe9\x5b\xbc\xc6\x4b\xb8\x9b\x4b\xac\x12\xfa\x0d\
\xf3\x0b\xba\xdf\x9b\xb1\xf6\x4b\xba\xa5\x0b\xaa\xfb\xab\x17\xb7\
\xa0\x07\x0b\x20\xa7\x82\x1b\xc0\x76\xea\xbe\x0b\x80\x01\xd8\x30\
\x31\x8e\xf1\xb9\x09\x8c\xbb\x07\x0a\xbd\xd1\xab\xbf\xab\xd1\x0b\
\xb5\x40\xc1\x00\x8c\xbd\x02\x8c\xb2\xdd\x89\x04\xd3\x3a\x18\x1e\
\x5c\xbf\x9b\x9a\xb4\x1b\x0b\xb9\xa6\xfb\xae\x8e\xf1\x00\x54\x90\
\xbe\x15\xac\xc2\x17\x4c\xac\x08\x30\x01\xdc\xab\x17\x31\x0c\xbe\
\x33\x1c\xc2\x8f\x6b\xc3\x35\x8b\xc3\x97\xc1\x01\xcd\x20\x06\x0c\
\xbb\xa5\x16\xfc\xc3\x2e\x6a\x06\x4a\x20\xae\x6f\x21\x02\x5d\xf0\
\xc1\x82\x4a\xc3\x49\x8c\xbf\x4b\x4c\x1c\x8d\xf0\xbf\x29\xcc\xbe\
\x84\x0b\xb4\xc4\xea\x0b\x20\x06\x17\x5a\xcc\xc5\x47\xdc\xac\x02\
\x0b\xb9\x91\xcb\xc4\xa1\x71\x0c\x51\x30\x0f\xc3\xab\xbe\x43\x3a\
\xc5\x68\xec\xa2\x4b\x00\x08\x64\x4a\x16\x6d\x6c\xc4\xcf\xbb\xa6\
\x71\x0c\xc6\x85\x4a\xc7\xab\xff\x11\x0d\xfd\x90\xc7\xc1\x2a\xc5\
\xd8\xdb\xbe\xee\x8b\x00\x9d\x40\xa3\x58\xb1\xc5\x84\xec\xc5\x5f\
\xbc\xae\x63\x3b\x00\x8a\xbc\x1a\x1c\xf0\x06\x28\x5c\xc6\x66\x7c\
\xc1\x46\x8a\x01\x95\x3a\x16\x32\x5c\xc8\x9b\xbc\xbb\x9e\x6c\x5a\
\x06\x10\x0e\x62\xe0\xc8\x52\xac\xad\xa5\x0c\xb4\x46\x1a\x0a\x63\
\x31\x00\x99\x8c\xc4\xad\x3c\xbe\xaf\x0c\x5f\x3c\x10\xc5\x7b\x6c\
\xcb\xa9\x2a\xc9\xf7\x49\x0f\x63\xe1\x00\x0a\xfc\xc6\x70\x1c\xb6\
\xea\xca\xc9\x56\xfa\xc9\xc3\xf1\x0b\x47\xf0\x0a\xc4\x0b\xc0\xc6\
\x6c\xb5\x68\x3c\x16\x07\x00\xc2\x01\x7b\xc8\x88\x4c\xcd\xcb\xf1\
\x0d\x10\x90\xcd\xb5\x6c\xaf\xb7\x0c\xb4\x63\xa1\x00\x33\xac\xc9\
\xe2\x2c\xcd\x03\xf0\xaa\x34\x16\xc1\x09\x80\xce\x7b\xac\xce\xeb\
\x6c\x9f\x63\x61\x00\xce\x6c\xc8\xd0\xec\xa9\xf2\x4c\xcf\x70\xd6\
\x0b\x95\x80\xcf\x26\xeb\xc3\x0f\x0a\x08\x64\xc1\xca\xf1\x4c\xb0\
\x63\x4b\xd0\x70\x06\x09\x4e\x40\xcb\x90\xac\xce\xc7\x4c\xb8\x6e\
\x41\x00\x0a\x10\xce\x01\x8d\xbf\x55\x2a\xd1\x87\xa6\x06\xac\x30\
\xcb\x8f\x7c\xd1\x2a\x3c\x07\x6f\x41\x00\xcf\xfc\xd1\xd2\x2c\xd2\
\xb4\xb6\x0b\xe8\x8c\xd2\x8e\xa1\xfa\x08\x2f\xec\xbb\x1c\x1d\xc7\
\xd1\x0c\xd1\xf3\xfc\x75\xcf\x40\x05\xa3\xa0\xbe\x34\x6d\xd3\x7a\
\x61\x00\x07\xe0\xd2\x3c\x0d\xd3\xf2\xd6\x0a\xe5\xa0\xc7\xf9\xdc\
\x00\x44\xad\x17\xa0\x60\x00\xba\xfb\xd2\x69\x07\x00\x54\x80\xd0\
\x43\x1a\xd5\x83\xf1\x00\x04\x00\x00\x3d\x1a\x00\x00\x60\x04\x4a\
\xbd\x71\x00\x10\x0e\x25\xf0\x0a\x52\x90\x04\x62\x60\x01\xdb\xa0\
\x08\x37\x4d\x18\x90\x20\x02\x04\xb0\x06\x38\xab\x76\x7d\x20\x09\
\x99\x00\x0d\xfc\x1a\xd7\x8e\xb1\x99\x90\x59\xb1\xa3\x39\xd8\x84\
\x5d\xd8\x86\x7d\xd8\x88\x9d\xd8\x8a\xbd\xd8\x8c\xdd\xd8\x8e\xfd\
\xd8\x90\x1d\xd9\x92\x3d\xd9\x94\x5d\xd9\x96\x7d\xd9\x98\x9d\xd9\
\x9a\xbd\xd9\x9c\xdd\xd9\x06\x11\x10\x00\x21\xf9\x04\x05\x0a\x00\
\xff\x00\x2c\x10\x00\x0f\x00\xa9\x00\xa9\x00\x00\x08\xff\x00\xfd\
\x09\x1c\x48\xb0\xa0\xc1\x83\x08\x13\x2a\x5c\xc8\x50\x20\x0c\x21\
\x42\x64\x74\xe8\x80\xe2\xc5\x8b\x86\x18\x33\x6a\xdc\xc8\xb1\xa3\
\xc7\x8f\x05\x87\xc0\x78\x18\x71\x62\xc5\x17\x34\x70\x80\x5c\xc9\
\xb2\xa5\xcb\x97\x08\x63\x0c\x11\x09\x51\x22\x45\x8b\x29\x55\xc2\
\xdc\xc9\xb3\xa7\x4f\x81\x39\x64\xd2\x2c\x79\x13\x25\x0e\x1c\x56\
\x7e\x2a\x5d\xca\x14\x63\xd0\x99\x24\x6d\x9e\xcc\x99\xb4\xa9\xd5\
\xab\x4c\x73\x3c\x1d\x2a\x15\xe7\x51\x2b\x58\xb0\x8a\x1d\xfb\x52\
\xab\xd0\xa8\x26\xbd\x22\x0d\x4b\xb6\xad\xdb\x8d\x59\xb6\xa2\x2d\
\x9a\xd2\x0a\xd8\xb7\x78\xf3\x26\x8c\x1b\x43\xe6\xdc\x8a\x34\xea\
\xde\xd5\x4b\x98\x30\x5f\xbf\x35\xd3\x06\x46\x3a\xb8\xb0\x63\xb7\
\x87\xb9\x2a\xae\x8b\x85\xed\xe3\xcb\x62\x23\x8f\x24\x0a\x98\xb2\
\x65\xcc\xa0\x99\x6a\x7e\xd8\x75\x31\xd8\xcf\xa1\x53\xf7\x8c\xfb\
\x74\x73\xe9\xaf\x58\xca\xa8\x9e\xbd\xda\xac\x48\xd2\x8a\x61\xcb\
\xa6\xcd\xdb\x65\x16\xbe\xb7\x39\x1b\x5d\xbb\xbb\xb7\xf1\x8f\xbf\
\x5b\xe3\xbe\x49\x35\xf6\xf1\xe7\x1d\x93\xfb\xc5\x8d\x02\xb0\x6e\
\xe8\xd8\x33\x7e\x01\x4e\x53\x62\x75\xa3\x76\x9d\x67\xff\xb7\x0a\
\x49\xec\x76\xb9\x25\xbf\x0b\x16\x4f\x96\x40\xe8\x07\xfe\x7e\x1d\
\x23\xc0\xc1\x9f\x7b\xab\xe7\xcf\xa6\xb7\x7e\xba\x78\xd3\x61\xfe\
\xd0\xf0\x45\x17\xd2\xf8\x73\xca\x65\x5d\x3c\x33\x02\x05\x2a\x54\
\x30\x42\x13\x07\xe2\xa7\xd9\x7e\xe0\xc5\xe6\xdf\x52\x9a\x58\xf1\
\x0d\x20\x3c\x98\xb2\x0b\x18\xcb\xac\xe1\x58\x17\x29\x50\x40\x02\
\x09\x2a\xa8\xe0\x03\x09\x29\x1c\x23\x22\x53\xf9\x21\xe6\x1d\x7f\
\x16\x5a\xa5\x09\x1e\x9d\x6c\xc1\x03\x0f\x48\x20\xb1\x85\x17\x58\
\x88\x40\x58\x13\x1a\xa4\x90\xc2\x89\x28\xaa\xe8\x03\x18\x88\xbc\
\xa8\xd4\x79\xad\xa5\xe7\x15\x58\x65\xfc\xd1\xd4\x8d\x5e\xe8\xc8\
\x23\x12\x47\x1c\xc1\x02\x0b\xdc\x84\x92\x17\x91\x1a\x14\x79\x64\
\x92\x4a\xaa\x70\x0c\x8c\xd2\x75\x47\x17\x71\x56\x62\x88\x47\x96\
\x5a\x72\xe9\x25\x0b\x45\xb0\xe0\x08\x5e\x1c\x54\x50\x41\x99\x66\
\x9e\x98\xa2\x92\x3e\x20\x72\x9f\x4f\xdb\x01\x47\xdd\x94\xb1\xc5\
\xf9\x13\x96\x5b\xd4\xd9\xe5\x97\x45\x14\x01\xc4\x11\xdb\x8c\xd1\
\x16\x07\x12\x48\xe0\x27\xa0\x46\x0a\xaa\x24\x18\x60\xcc\xf2\x64\
\x7e\x6e\x4e\x05\xa7\x52\x9a\xf0\x41\xe7\x8e\x3d\xde\xff\x59\x29\
\x10\x40\xdc\x70\x43\x34\xbf\x90\x45\x41\xa7\x9e\xfe\x59\x66\xa8\
\x49\xfa\xb0\x64\x0a\xb3\xc0\xd7\x93\x1b\xa8\x2e\x5a\x61\x95\x8f\
\xba\x9a\x25\xac\x5c\x52\x6a\x69\xad\x37\x38\x71\x44\x13\xba\x52\
\xb0\x6b\xaf\xa0\x9e\x99\xa2\xb0\xa4\xe6\x01\xca\xb1\xc9\x4a\xd9\
\x1c\xb3\x3d\x61\xe2\x6c\x9d\x76\xe2\x39\xad\xad\x4e\x38\xa1\xc4\
\x1d\x63\x1d\xe3\x81\xb6\xdb\x7e\xfa\xab\xb7\xa3\x92\x60\x0c\xb9\
\x8a\x9a\x4b\x1c\xba\x3b\xa9\xeb\xc5\xb3\x5b\x4e\x3a\x2b\xb5\xf1\
\x2a\xa1\xc4\x11\x63\x9d\xe1\xc1\xbd\xda\x76\xaa\x6f\xa0\xc1\x2e\
\x09\xc6\x19\x06\xec\x84\x6c\xc0\xde\x2d\xfb\x47\x1d\x3c\xa9\x4b\
\xc6\xab\xb1\xca\x4a\x2b\xbc\xf2\x2a\x11\x45\x14\x63\x21\x32\x31\
\xc5\xf9\xfa\x0a\xec\xb7\x1a\xfb\x00\x20\x4c\x1f\x47\x19\x32\x65\
\x55\x92\x0c\x93\xc9\xaf\xf2\x38\x29\x9e\x2b\x57\xdb\xf2\xcb\x54\
\x8c\x95\x47\x06\x19\x4c\x8c\xaf\xc5\x36\xf3\x0b\x2e\x18\x2a\x84\
\x72\x28\x4b\x3d\xcb\xc8\x1c\x9c\x42\xbb\x84\x09\x20\x27\x23\xdc\
\x2e\xd2\x0c\x2f\x1d\x05\x15\x4d\x8b\xd5\x04\xd4\x51\xd3\x4c\xf5\
\xbe\xa2\x5e\x8d\x06\x22\x2f\xd1\xf1\xb1\xd7\x34\x06\xff\xfd\x52\
\x1f\x64\x1f\x2c\xa9\xca\x69\x3b\xcc\x34\x15\xad\x90\x35\x02\xdc\
\x52\x57\xcc\x2d\xc6\x38\x83\x81\x06\x09\xc3\x94\xc7\x92\xde\xf9\
\x2d\x0a\xf4\xc8\x2e\x01\x4e\xc6\xc9\x83\x53\x9a\x74\xc3\x2e\xaf\
\x4d\xc5\x14\x6d\x05\x32\x06\xe3\x8d\xcf\x0d\xb9\x8a\xa4\xa2\x81\
\xc6\x18\xc6\x82\x84\x39\x70\x02\x53\xf9\x47\x22\x2d\x79\x0e\xba\
\x8e\xb1\x8a\x5e\xf8\xe1\xa7\x93\xe1\xd6\x2a\x23\x2c\x1e\x37\xc5\
\xae\xdf\x0c\xbb\xe4\x60\xec\x6c\x7b\xd7\x22\xfd\x4c\x5c\x1d\xbc\
\xaf\x04\x38\x1e\xbf\x27\x2c\x3c\xcb\xa5\xb3\x3d\xc5\x14\x5e\xbc\
\x65\xc4\x2d\x50\x28\x3f\xb3\xe3\xfa\xde\x6c\xf7\xc6\x5b\x73\x74\
\x7b\x6b\xd6\x5b\x11\x74\xf6\x1f\xf5\xd1\x08\xf7\x82\x7b\xef\xee\
\xf0\xa6\x1b\x5f\xf9\xf2\x12\x88\xf4\x41\x6d\x7d\x35\xa3\x5b\xe4\
\x64\xb7\x07\x31\x7d\x64\x7e\x7e\xa9\xdf\xfd\x40\xa2\x3f\xee\x81\
\x0e\x56\xb2\xb2\x14\xbc\x0c\x17\x40\xf2\x11\xe6\x7c\xc9\x63\x1d\
\xfb\xaa\x96\x31\xc9\xa1\x41\x05\xb3\x10\x52\x47\x08\x41\x87\x64\
\x59\xaf\x51\xd8\xcb\xdf\xfe\x3e\x67\x36\x85\x69\xb0\x5a\x1c\x14\
\x9f\x07\x1d\xa3\x06\x03\x1e\x90\x79\x8f\xb3\x5a\xec\xff\xf6\xb0\
\x87\x33\x58\x6e\x23\x2c\x74\x83\xa2\x7e\xa6\xbb\x3a\xec\xa9\x23\
\xfa\xe3\x03\xff\x42\x37\xab\x0d\x86\xef\x74\x6c\x18\xe0\x63\x90\
\x17\xc2\xb8\x8d\xf0\x57\x75\x1b\x62\xf4\x56\x88\xb9\x28\x31\x47\
\x77\x89\x78\xe2\x46\xee\xd0\x09\x29\x76\xaf\x5d\x55\xc4\x61\xf8\
\xc6\x97\x45\xd0\x18\x81\x12\xe9\x53\x1f\x10\xdb\x27\x28\x70\x31\
\x10\x0d\x50\x88\x1f\x43\x92\xb8\x1d\xc4\xdc\xe4\x7a\x69\xe4\x08\
\x1b\xdd\xd8\x3f\x38\x6a\x90\x74\x1d\xac\x63\x6a\x02\x41\x84\x2e\
\xb6\x2e\x88\x7d\x5c\x12\x1a\x88\xb8\x87\x08\x65\x84\x11\xb7\x33\
\x64\x45\x10\xa9\x46\x8c\x2c\xd2\x82\xcf\x0a\x5e\x15\x21\xa9\x43\
\x49\xa6\xe6\x7c\x63\xb0\xe4\x1e\x6d\x96\x49\xc9\xed\xe1\x0e\x85\
\xea\x18\x46\x18\x41\x88\x9e\xd1\xe4\x90\x60\x19\x59\x22\x26\xa1\
\x91\x3d\x98\x02\x10\x8c\x04\x5e\xb4\x56\x29\xaf\xc3\xd1\x51\x8b\
\xb3\x51\xc3\x19\xba\xe8\xc5\xb9\x85\xea\x5b\x43\xbc\x43\x1f\xce\
\xf0\x49\x16\x9e\xe7\x97\xa3\xb4\xdf\xc8\x1c\x41\x4c\x8c\x18\x13\
\x99\x53\xc4\xe0\xff\x94\x76\xc5\x29\xb0\xc1\x95\xb4\x59\xc3\x2d\
\x2a\x29\xcb\x04\x5e\x13\x76\x0c\xc4\xa5\x27\x17\xc2\xff\x4b\xbd\
\xc5\x05\x9c\x2f\x40\x4a\x95\xd2\x58\x4e\x86\x9c\x33\x99\xc0\xf3\
\x12\x33\xe7\xe8\x4e\x78\xf2\x66\x0d\xd2\xa4\xe7\x0f\x2b\xf6\xa9\
\x7b\x6a\xf2\x96\xda\x84\x82\x2e\x15\x62\x89\x24\xf2\xe5\x21\x14\
\xa9\xcb\x40\x1d\xf1\x89\x86\xec\x81\x15\x8d\x40\xe7\x05\x97\xf9\
\xc8\x66\xae\x8d\x8e\x6f\x80\xe6\x71\x28\x29\x51\x2f\xee\xaa\xa2\
\x47\x1a\xd5\x26\xb5\xd9\x07\x07\x72\x14\x94\xc8\x0a\x0a\x48\x51\
\x90\x92\xd8\x60\x6f\x12\x25\x5d\xc8\x49\x53\x9a\x4c\xa3\x89\x8e\
\x9d\x91\x8c\xe9\x78\x8c\xb0\x8a\x31\xd4\xb4\x75\x15\xed\x63\x36\
\xfb\xb0\x87\x31\x04\xe0\xa7\xbd\xfc\x82\x50\x85\x10\x52\x1c\x18\
\x75\x98\x49\x4d\x08\x18\x76\xc1\xd4\x74\x46\x0b\x69\x50\x15\xdf\
\x3b\xa5\x3a\x1e\x81\x74\xc1\xaa\xf5\xbc\xe9\x9f\xbc\x75\xd1\x3b\
\x68\x13\x13\xdc\x4c\x48\x29\xfa\x59\xc8\xa1\x16\xb5\x0c\x4e\x9c\
\x44\x2c\x14\xb2\xd6\x4e\xa4\xd4\xad\x2a\x93\x63\x00\xe7\xca\x83\
\xba\x0e\x44\x9e\x50\x20\x82\x44\xb1\xba\x57\xad\xee\xb4\x0f\x98\
\x40\x43\x28\x8c\x80\x90\x52\x74\xb4\x85\x59\x88\x81\x61\xcd\x3a\
\x4e\xc5\xaa\x75\x17\x8e\x55\x69\x42\x15\x5a\xab\xa5\xff\x9d\xce\
\x9d\x6f\x78\x43\x65\x2d\x4b\x90\x2e\xe4\x41\xb3\x96\xa4\x68\x67\
\xb1\xf9\x59\x4c\x68\x62\x04\xa4\x3d\x88\x25\x40\x59\xc8\x21\x90\
\x95\xa8\xc1\x4c\x63\x5a\x0d\x02\x86\x69\x98\xa2\xad\x2b\xa5\x2d\
\x0e\x99\x06\x53\xdd\xf2\xd6\x20\x78\x04\xae\xfa\x84\x5b\x24\x14\
\xf9\xf1\x96\xc6\xed\x29\x42\x96\xeb\x4f\x99\x3c\x97\x06\xe2\x44\
\x2b\x42\x24\x80\x0c\x53\x38\xb6\xa9\xcb\xac\xed\x1c\xe7\xaa\x87\
\xdd\x7e\x97\x20\x46\x08\x44\x1e\x32\x1b\xdc\x9b\x82\x11\x9f\xb7\
\x04\xad\x26\x34\x91\x10\x5e\x2a\x31\x07\xce\xed\x00\x4a\xec\x77\
\xd4\x84\x6c\x83\x15\xb1\xe5\x43\x76\xe1\xda\x4c\xb9\xe6\xb6\xbf\
\xff\x45\xc8\x5d\x33\x5b\xc9\x89\x7a\xea\xc0\x7d\x05\x2d\x2d\x6e\
\x91\x90\x5e\xfe\x93\xac\x13\x46\x6c\x29\x0d\xc2\x0a\xfb\xa2\x33\
\x95\xda\xed\x30\x16\x3f\x8c\x84\x10\x23\x84\xaa\x63\x20\x71\x08\
\xa5\x76\xe2\xf2\x22\x58\xc1\x7b\x58\x88\x58\x23\x1c\xe3\x85\x50\
\x03\xc3\x8d\x60\xa4\x53\x1f\xe9\xb2\xdb\xb2\xe1\x0d\x7a\xd0\x43\
\x8f\x7d\x9c\x90\x26\x20\x02\x0a\x04\x5e\x1c\x91\x69\x09\xbb\x04\
\x63\x82\x5e\x3c\x81\xc1\x75\x01\xc1\xbf\x29\xeb\xf7\xff\xa5\xfc\
\x95\xc4\x96\xb9\x8c\x10\x50\x50\x22\xc8\x61\xae\xe6\x70\x53\xdc\
\x87\x9e\x7c\xa1\x13\xc8\xbc\x60\x8e\xab\x8c\x5b\x2c\xcb\x99\xce\
\x0b\x59\x43\x17\x10\x11\x64\xe0\x1e\xd0\xc0\x39\xbd\x68\x1f\x52\
\xd0\x13\x18\xb0\x42\x8a\xcf\x1a\x34\x9c\xb1\xac\x87\x43\x23\x9a\
\x21\x6a\x18\x03\x9e\x4b\x1c\x35\x48\x9b\x57\x72\x77\xf8\x2a\x4f\
\xd0\x30\x0d\xee\x01\x8f\xc3\x93\x35\xb4\xa7\x3f\xbd\x90\x3b\x32\
\x1a\xcc\x9b\x35\x75\x99\x7f\x62\x8a\x93\xf1\x08\xd6\x3b\x36\x74\
\x21\x58\x40\xeb\x8c\x78\x59\xd4\x42\x2e\xf5\x89\x23\x6d\x2a\x9f\
\x30\x62\x17\x46\xd3\x20\xa1\xaf\xdc\x69\x49\x0c\xbb\xd8\x19\x59\
\x03\x25\xce\x70\x86\x51\x8b\xd9\xd4\xff\x52\x0a\xe0\x8e\x20\xed\
\x4d\x77\xba\x10\x97\x20\x36\xb6\x33\x02\x8a\x26\x84\xa2\xdb\xb8\
\xfe\xf6\x89\xd7\xb4\x14\x02\x0c\x61\x0b\x40\xe8\x30\x6e\xcf\x7d\
\x89\x22\xac\x9b\x23\x02\xee\x76\xa3\xd5\x27\x81\x5c\x59\xa5\x0f\
\x78\xa8\x32\xb5\xad\x7d\x89\x7e\xff\x9b\x23\x46\x50\xc3\x29\xf2\
\x00\x6f\xcd\x42\x21\x03\x2c\xc6\x4a\x0c\x9c\x30\x3e\x61\x5f\x42\
\x14\x40\x78\xb8\x47\x9a\xe0\x00\x63\xe4\x61\x0c\x13\xff\xef\x02\
\x25\xc6\x22\x82\x2f\xf0\x61\x0b\x7a\x58\x9b\x28\x3e\x11\x72\x91\
\x77\x84\xb4\x06\x00\xc0\x2a\x1c\xf0\x00\x27\x91\x85\x04\xc8\xd8\
\xc6\x31\x16\x6b\xf3\x96\x1c\x91\x4f\x45\x4f\xba\xd2\x97\xce\xf4\
\xa6\x3b\xfd\xe9\x50\xe7\x0d\x07\xa6\x4e\xf5\xaa\x73\xa0\x09\x58\
\xcf\xba\xd6\x9b\xd0\x85\xae\x7b\xdd\xeb\x6a\x08\x7b\xd8\x03\x41\
\x76\xb2\x53\xe2\xec\x94\x58\xc5\x2a\x8e\x63\x0d\x66\x30\x03\x16\
\x70\x57\x85\xdc\x33\x41\xf7\x48\xd8\x3d\x12\x83\xc8\x7b\xde\xe5\
\xc0\xf7\xbe\xc3\xe1\xef\x80\x87\x03\x17\x06\x4f\x78\xc2\x87\xe1\
\xf0\x61\x40\x88\x03\x16\xef\x00\xab\x3b\xde\xea\x5b\xdf\xfa\xd7\
\xc1\x2e\xf6\xb1\x97\x1d\xed\x6b\x9f\xcd\xdb\xe3\x3e\xf7\xba\xdb\
\x5d\xef\x7b\xef\xbb\x1c\x02\xff\xf7\xc2\x9b\x1e\xf1\xa8\x47\xfc\
\x13\x56\x5f\x10\xc6\xbb\xfe\xf5\x8b\x7f\xfc\xe3\x23\x9f\xf5\xc9\
\x77\xa1\xf2\x6a\x28\x7b\x20\x56\x9e\x1a\x58\x74\x3e\x13\x77\x07\
\xbd\xe8\x47\x1f\x78\xd3\x1b\x3e\xf5\xa8\x5f\xbd\xf2\x97\xaf\xfc\
\x81\x28\xe0\xf9\xb0\x8f\x7e\xf4\x65\x5f\x75\xda\x73\x7d\xf2\x95\
\x27\x7b\x68\xe8\x0e\x7c\xbc\xeb\x5d\xf4\xa4\x37\x3e\xff\x17\x90\
\x7f\x78\xe6\x9b\x7f\x07\xe8\x4f\xbf\xfa\x77\x20\x90\xe7\xbb\xff\
\xfd\xf0\x97\xbe\xfc\x1b\x4f\x7d\xda\x63\x3f\x34\xde\x1f\x84\xdf\
\x01\x6f\x7c\xf2\x9b\x7f\xf9\xeb\x17\x80\xea\xf7\x03\x04\x58\x80\
\xfe\x00\x7f\x08\x98\x80\x0a\xa8\x00\xf3\xe7\x7a\xf5\x27\x79\x98\
\xc1\x77\xc5\x77\x7c\xc9\xf7\x7f\x02\x18\x80\x05\x98\x81\x1a\xb8\
\x81\x3f\x60\x03\x07\xf0\x81\x20\x18\x82\x20\xb8\x80\x24\x88\x80\
\x0d\x48\x7f\x56\x87\x19\x14\x58\x7e\xcc\x77\x81\xe8\xc7\x81\x30\
\xd8\x81\x36\x30\x83\x34\x58\x83\x36\xe8\x81\x22\x98\x83\x3a\xb8\
\x83\x21\x58\x82\x0a\x18\x7d\x98\x01\x80\x18\x18\x83\x04\x78\x83\
\x46\x78\x84\x33\x90\x84\x4a\xb8\x84\x4a\x08\x00\x4e\xf8\x84\x4f\
\xc8\x83\x52\x38\x85\x52\xa8\x80\x98\xb1\x81\x47\x78\x83\x4c\xb8\
\x85\x5c\xd8\x85\x5d\x58\x02\x60\x08\x85\x62\x38\x86\x64\x58\x86\
\x66\x58\x86\x52\x88\x19\x5e\xb8\x84\x60\xd8\x86\x6e\xf8\x86\x70\
\x18\x87\x72\x38\x87\x67\x58\x87\x76\x78\x87\x75\x88\x19\x21\xb0\
\x87\x7c\xd8\x87\x7e\xf8\x87\x80\x18\x88\x82\x38\x88\x7b\x38\x00\
\x86\x78\x88\x88\x98\x88\x8a\xb8\x88\x8c\xd8\x88\x8e\xff\x68\x88\
\x98\xe1\x02\x92\xe8\x02\x2b\x50\x89\x96\x78\x89\x98\x98\x89\x9a\
\xb8\x89\x9c\x58\x89\x7f\xf8\x88\xa0\xa8\x88\x01\x30\x8a\xa4\x58\
\x8a\xa6\x78\x8a\xa7\x28\x48\x7a\xd1\x03\x35\xd0\x8a\xae\xf8\x8a\
\xad\x38\x89\xb2\x38\x8b\xb4\x28\x8b\x9d\x78\x8b\x2b\x30\x00\xa8\
\xb8\x8b\xbc\xd8\x8b\xa9\x48\x00\xc0\x18\x8c\xc2\x18\x8c\x06\xb0\
\x51\x8e\xa1\x05\x4c\x90\x8c\xca\xd8\x03\xcc\xd8\x8c\xcd\x08\x8b\
\xd0\x08\x8d\xb5\x38\x8d\xd4\xe8\x0f\xbe\x78\x8d\xa4\x38\x8c\xda\
\xb8\x8d\xc5\xd8\x8d\xde\x68\x00\xb5\x73\x19\x6d\x30\x8e\x6d\xa0\
\x05\xe6\x68\x8e\xca\x98\x8e\xc9\xe8\x8c\xec\xc8\x8c\xd1\xf8\x8e\
\xef\x38\x89\x02\xe1\x8b\xdb\x58\x8f\xf6\xf8\x8d\xf8\x08\x8e\x0f\
\xb0\x8f\xfc\x18\x8e\x8f\xf1\x08\x00\x39\x07\x02\x49\x8e\xe4\x78\
\x8e\xe7\xa8\x8e\x08\xd9\x8e\x0a\xe9\x8e\xf0\x58\x03\x03\x61\x8f\
\x10\x39\x8c\xf9\x38\x91\xfd\x58\x91\x22\x70\x91\x17\xa9\x1a\x8a\
\xb0\x91\x8a\x00\x90\x01\x29\x90\x73\x40\x90\x05\x69\x90\x07\x89\
\x90\x09\xb9\x90\xce\x58\x10\x11\x09\x8c\x13\xd9\x92\xfa\x58\x91\
\xfc\x88\x91\x32\x69\x04\x34\x49\x1b\xa4\xc0\x09\x38\xff\xc9\x91\
\x1d\xe9\x91\x8f\x00\x92\x03\x29\x92\xe3\x48\x92\x06\x69\x92\x44\
\xd9\x03\x08\x41\x00\x2e\xe9\x92\x30\x09\x93\x32\x39\x93\x34\xf9\
\x94\xc7\x81\x0b\xa4\x30\x95\x38\xc9\x09\x3a\xb9\x93\x1e\xe9\x93\
\x3f\x09\x94\xe5\x28\x94\x43\xa9\x8c\x51\x17\x96\x62\x39\x96\x64\
\x59\x96\x66\x79\x96\x68\xc9\x13\xe5\xc1\x0a\x14\xe0\x0f\xbd\x90\
\x5c\x69\x59\x18\x46\xa0\x0c\x4e\x20\x0c\xf4\xa0\x0a\xb6\xb0\x07\
\xf8\x80\x37\x71\x99\x17\x46\xe0\x0d\xae\x60\x07\x8b\xe0\x09\xae\
\x20\x0c\x9c\x50\x0d\x35\xd7\x97\x6e\x61\x04\xf0\x10\x04\x55\x10\
\x07\x82\x49\x98\x85\xb9\x0e\xa9\xc0\x97\x8a\x29\x16\x46\xb0\x0e\
\x2d\xa0\x03\x8e\x09\x99\x91\x59\x98\xc2\x40\x0c\x97\x89\x99\xe6\
\x80\x01\x17\x70\x02\x9b\xd9\x99\x91\x49\x98\xf2\x80\x04\xfe\x38\
\x9a\x3e\x01\x09\xae\x10\x01\x26\x60\x9a\xa8\xc9\x99\x8f\x69\x07\
\x9f\xe9\x0a\xee\x90\x71\xb0\xf9\x13\xb8\xb0\x01\x13\x40\x9b\xb6\
\x99\x9a\x55\x90\x9b\x8b\x30\x98\xe7\x00\x31\xbf\xf9\x13\x57\xb0\
\x04\xc2\x49\x9c\xa7\x99\x9a\xaa\x19\x99\xd5\x80\x0f\x50\xd0\x9c\
\x3c\x91\x0b\x62\xf0\x9c\x1f\x30\x9c\xb5\x39\x9d\x3a\xff\x80\x9b\
\x71\x00\x99\xc9\xe9\x09\x85\xa0\x9d\x3b\x11\x0f\x86\xd0\x9d\x1b\
\xf0\x9d\xd2\x89\x9a\xc6\x99\x9b\x82\xb9\x0e\x4e\x10\x08\xea\xe9\
\x12\xea\x20\x08\xdd\x09\x9d\xf0\x19\x9e\x27\x70\x9b\x41\xd0\x99\
\xe6\xb9\x08\xf8\x30\x00\xf9\xc9\x12\xcc\x50\x09\xed\xf9\x9c\xef\
\x09\x9e\xa6\x29\x9e\x03\xfa\x98\x9e\x59\x0d\xfe\x95\xa0\x16\xd0\
\x00\x09\x20\x00\x05\x80\x00\x0c\x00\x01\x20\xb0\x10\x64\xb0\x04\
\x82\xd0\xa0\xfe\x09\xa1\x17\x20\x9e\xb8\x49\x9f\x9e\xd0\x0d\x81\
\xa5\x9d\x69\x20\x05\x19\xba\xa1\x1d\xfa\xa1\x20\x90\x04\x7e\x90\
\x10\x0f\x50\x09\x95\x50\xa2\xfd\xf9\xa0\xd2\x39\x9d\xf3\x59\x9e\
\xba\x89\x3a\xda\x79\x08\x31\x3a\xa3\x1c\x8a\x00\x0b\x00\xa2\x49\
\x60\x06\xa3\x90\x10\x5a\x80\x0a\x0c\xda\x9d\x0e\xfa\x9f\x18\x50\
\x9c\xd4\x79\x9c\x90\x59\x0d\xa2\xe0\x53\x97\xb9\x09\x48\x2a\xa3\
\x1a\xba\xa4\x4d\x7a\xa3\x66\xe0\x07\x51\x8a\x10\x97\x60\x08\x3e\
\x7a\xa5\x58\xaa\xa5\xe3\xe9\x98\x14\x6a\x07\xf6\xf0\x9b\x87\x30\
\xa6\x4a\xda\xa1\x0b\xc0\x00\x68\xaa\xa6\x5d\x16\x02\x3d\x6a\xa2\
\xef\x19\xa7\xa7\x79\x9b\x2b\x5a\x9e\xd5\xc0\x9c\x8a\xff\x29\xa6\
\x69\x90\xa4\x65\xca\xa7\x1f\xfa\xa4\x6a\xea\x0b\x09\x41\x09\xc4\
\x40\xa2\x84\xfa\x9d\x10\x6a\x9b\x88\x3a\xa1\x14\xca\x0c\xcd\x16\
\x97\x8e\x2a\x05\x64\x4a\xa3\x4c\x6a\xa3\x38\x3a\x0a\x96\xaa\x10\
\xb0\xf0\xa6\x57\x3a\x01\x9d\x7a\xa8\x2d\xb0\xa5\x8f\xb9\x08\x4e\
\xd0\xa8\x7a\xba\xa7\xa9\xea\xa4\x69\xba\xa6\x09\x41\x01\x3f\x20\
\x06\x26\x7a\xa2\xb3\x1a\xa0\xb5\x3a\xa7\x5c\xea\x09\xd8\x19\x97\
\x79\x9a\xa4\xbc\xda\xa7\xbe\x0a\xa8\x0c\x91\x0a\x86\x50\xac\x0f\
\x3a\xab\x42\x3a\xa7\x74\x1a\x07\xa2\x99\x96\xcf\x4a\xa6\x91\xda\
\xab\x7f\x0a\xac\x0a\x71\x0a\x21\xd0\x9e\x3f\x9a\xad\xc4\x19\xa1\
\xf2\xc9\xad\xc7\x29\x0c\x4e\x50\x1f\x67\x89\xa4\x90\x9a\x00\xa8\
\x2a\xad\xe5\x8a\x11\x46\x50\x08\x1b\x20\x06\xeb\xca\xa9\xed\x9a\
\xa2\xc8\x0a\xaf\xc7\xc9\x0c\x5d\x50\xaf\x31\x7a\xaa\xf9\xaa\xaa\
\x94\xaa\x11\x72\xd0\xa0\x70\x3a\x9c\x03\x4b\xab\x9b\xc9\x99\x8e\
\xb9\x08\xea\x56\x96\x63\x7a\xaa\x02\x60\xa6\x36\xfa\xa7\x1a\x01\
\x05\xaa\xb0\x04\xfd\xe9\x9f\xf0\x59\xb1\xc8\x7a\xb1\x13\x6a\x07\
\xcc\x40\x04\x1c\xbb\xb0\x4a\x0a\xb2\x10\x30\xad\x1c\xff\xa1\x0c\
\x00\xfb\x9c\x28\x4b\xb1\x26\x10\x9e\x16\x6b\xb0\x92\x50\x96\x8f\
\x2a\xa3\x33\x2b\xa9\xaa\x9a\xa6\x1c\x41\x04\x21\x90\xb3\xd0\x59\
\xa8\x3c\xeb\xb3\x2b\x3b\x9e\x18\xeb\x0a\x97\x10\x6e\x61\x39\xb4\
\x16\x50\xb4\xa9\x7a\xb4\x39\xda\x11\xfe\x7a\x05\x0e\xca\xae\xb4\
\x09\xb5\xf2\xc9\xb2\x8e\xe9\x0e\x70\x09\x75\x58\xab\xb5\x7d\x7a\
\xb4\x66\xe0\x11\x03\x60\x03\x56\xda\xb4\x02\x3b\xb6\x59\x4a\xb0\
\xef\x8a\xb1\x9e\xb0\xb1\x6a\x6b\xaa\x19\x5a\xa6\x66\xaa\xaf\x49\
\xf0\xa4\x1f\x71\x0c\xe0\xf0\x01\x3a\xbb\x01\x62\xdb\xb3\x77\xfb\
\xb3\x18\x1b\x04\xaa\xf0\xa2\x4e\x27\xb3\x0d\x00\xb8\x7c\x2a\xb8\
\x84\x0b\x12\xee\x70\xb2\x4e\xfb\xb4\x8d\x1b\xb5\xca\xda\x36\x4f\
\x47\xb9\x96\xcb\xa4\xfa\x8a\xa6\x2b\x21\xac\x1b\x90\xb8\x1f\x50\
\xb7\x8c\xeb\xae\x79\xcb\x99\x8b\xa0\x0e\x9a\x32\xb9\x44\x5b\xb9\
\x1b\x1a\xb8\x1f\xea\xab\x2d\x71\x09\xab\x4b\xb7\xae\x5b\x9b\xb0\
\x5b\xab\x66\xab\x0c\x06\xc7\x74\xd0\x8a\xbb\x1f\x7b\xb9\xbb\x8b\
\xba\x2c\x71\x0c\x25\x00\xb6\xc0\x2b\xab\x11\x60\xb7\xc3\x9b\xac\
\x9c\xe9\x09\xf8\xd9\x74\x7e\x3b\xa3\xb9\xcb\xbc\x35\xff\x7b\xa3\
\x49\xe0\x12\x07\x90\x0a\x13\xb0\x04\xd3\xeb\xb9\xb0\x1b\xbb\x3e\
\xe0\x74\xdd\xab\xa1\xdf\x8b\x00\xbd\xea\xa4\xe3\xfb\x12\x99\x90\
\xb8\x9d\x5b\xbd\xaf\x8b\xb7\x79\x6b\x0e\xee\x7b\xbb\xf8\xba\xbc\
\xf2\xdb\xb6\xf4\x0b\x13\x19\x30\x08\x1f\x80\xbe\x8a\xdb\xba\xd4\
\x6b\xbd\xfc\x8b\xbd\xff\x9b\xb5\xf0\x2b\xc0\x5b\x0b\xa2\x37\xca\
\x13\xc4\x80\xbf\x9c\xaa\xbe\x29\x6a\xb1\x2d\x10\xc1\xb8\x1b\xbf\
\x15\x0c\x02\x17\xbc\x13\x44\x10\xbd\xe9\xcb\xc1\x78\x5b\xab\xee\
\x2b\xc1\x13\x5c\x00\x1d\x3a\xc2\x25\xcc\x13\x92\x70\xbe\x0b\xbc\
\xc1\xfa\x2b\xbc\x1d\x1c\xa0\x77\xca\xbd\x2e\x1c\xc0\x30\x3c\xc0\
\x0c\xd0\xbc\xf5\xcb\x13\x46\x10\x06\x0a\xdc\xb9\x2a\x7c\x9a\x4f\
\x77\xbb\x2f\x1c\xc3\x04\xec\xa4\x3f\x71\x0a\xf8\x10\x01\xe9\x5b\
\xbd\x0e\x7c\x01\xf4\xd0\xc4\x3f\x4c\xa3\x50\x3c\xc4\xe1\x5b\xc4\
\x3e\xa1\x0f\x49\xcc\xc0\x14\x6b\xbd\xf4\x90\xb6\x4b\xe7\xc4\xdf\
\x0b\xc5\xd2\x6a\xc1\x4b\xe1\x01\x3f\xb0\x01\x57\x9c\xc3\xf2\xa0\
\xc6\x6b\xfc\xc3\xcb\xeb\xc6\xcd\x1b\xa2\x4c\xf1\x06\x1f\xa0\xb8\
\xf9\x5b\xbd\xe6\x80\xc7\x79\xfc\xb7\x6d\x3c\xc0\x6f\xf4\x4c\xc2\
\x4d\xa1\x06\x3b\x00\xbc\x02\x7b\x0e\x86\xbc\x74\x59\xeb\xbd\x7b\
\xac\xc8\x60\xcc\xc8\x8d\x7c\x09\xf2\x10\x01\xc2\x89\x01\x1f\x70\
\x09\xd5\x30\xc9\x94\x8c\xc8\x89\x6c\xba\x99\xec\xc7\x57\x21\x04\
\x33\x60\x0b\x56\x70\x09\xfe\x40\xca\xa5\x1c\xc2\x97\x8c\xca\xcd\
\x4b\x16\x79\x70\x96\x5d\x5c\xcb\x0b\x10\xc5\xaa\x9c\xa0\x2f\xb1\
\xcb\x1c\xca\xc7\xb7\x0c\xcc\x30\x21\xcc\x41\x6c\xcb\xe1\x6b\xcc\
\xc7\x6c\xca\xbc\xec\xcb\xcc\x1c\xcc\xce\x3c\xcc\x98\x5c\xcc\xd1\
\xcc\x12\xc8\x4c\xcc\xcb\x7c\xcd\xd8\x3c\xcd\xc9\xdc\xcb\x60\x0c\
\xa2\xdc\x8c\xcd\x95\x3b\xc1\xd4\x6c\xcb\xbb\x3b\xce\x2b\xf1\xb7\
\xe6\xfc\xcd\x6d\x9b\xce\xea\xfc\x11\xa6\x7c\xca\xbd\x1c\xc5\xf1\
\x2c\xcf\x21\x4c\xcf\xe0\x0c\xcf\xf7\xcc\x11\xf3\x5c\xcb\xca\x0c\
\x01\xfd\xdc\x11\xff\x7c\xce\x01\x3d\xd0\xfe\x9c\xcf\x00\xbd\xcf\
\x35\x8b\xd0\x1b\x31\xcd\x06\xcd\xd0\x02\xed\xd0\x1a\x41\xcb\x0b\
\x4d\xc0\x14\xbd\x11\x16\x1d\xd1\x18\x9d\xd1\x15\x1d\xc0\x17\x3d\
\xc4\x1e\xcd\x11\x20\xcd\xd1\x0c\x30\xd2\x1e\xf1\xb1\x11\x8d\x68\
\x01\x01\x00\x21\xf9\x04\x05\x0a\x00\xff\x00\x2c\x10\x00\x0f\x00\
\xa9\x00\xa9\x00\x00\x08\xff\x00\xfd\x09\x1c\x48\xb0\xa0\xc1\x83\
\x08\x13\x2a\x5c\xc8\x50\xa0\x07\x0f\x14\x28\x48\x90\x50\xa1\x82\
\x86\x86\x18\x33\x6a\xdc\xc8\xb1\xa3\xc7\x8f\x05\x33\x64\x78\x18\
\x71\x62\x45\x0d\x29\x52\x80\x5c\xc9\xb2\xa5\xcb\x97\x08\x47\x88\
\x24\x29\x91\xa2\x06\x94\x29\x48\xc0\xdc\xc9\xb3\xa7\xcf\x81\x23\
\x64\x8e\x84\x58\xd3\x22\x4e\x12\x3a\x7f\x2a\x5d\xca\xb4\x21\x11\
\xa1\x34\x4d\xde\x4c\x49\x42\x45\xd3\xab\x58\x9b\x12\x79\x3a\x93\
\xa8\xd4\xa3\x2a\xac\x66\x1d\x4b\xd6\xe5\xd6\xa0\x43\x4b\xda\x04\
\x2b\xb6\xac\xdb\xb7\x1a\xcf\xca\x8c\x7a\x92\x2d\xdc\xbb\x78\x13\
\xca\x9d\x59\xb2\x6e\xce\xaa\x6d\xf3\x0a\xc6\xbb\x77\x64\x5f\xa3\
\x7f\xc3\x0e\x5e\x7c\xb7\xb0\x57\xbf\x48\x15\x33\x9e\x4c\x16\xca\
\x53\xa8\x87\xa7\x46\x0e\x4c\xb9\xf3\x52\xcb\x68\x0d\x4b\x84\x5c\
\xd5\x87\xe7\xd3\x9f\x2f\xf3\x1d\x8d\x38\xb2\x69\xd4\xb0\x79\x82\
\xc6\xcc\x5a\x73\xe9\xd8\xb8\x5f\x5a\xe6\x2a\x9a\x62\xeb\xb0\xaf\
\x73\x0b\xff\xb8\x9b\xb6\x6f\xb6\xc1\x87\x2b\xd7\x58\x7c\xf5\x71\
\xaa\xc0\x97\x4b\xcf\xd8\xbc\xf7\x49\xe8\x2a\x92\x4f\xdf\x7e\x10\
\xca\xec\xb4\xcf\x73\x46\xff\x77\x6b\xc4\x33\x28\x7f\x0f\x1e\x80\
\x2a\x7f\xfe\xaa\x77\xd5\x24\xc3\x97\xd6\xbe\xd4\x81\x3f\x15\x14\
\x02\x40\xf1\xd7\x64\xf2\x9a\x07\x01\x00\xa0\x00\x00\x03\x18\x41\
\x00\x56\xef\xa1\x15\xdf\x75\xae\xd1\xf7\xd3\x2c\x3e\xd4\xc3\x48\
\x0e\xa5\x04\x63\x4c\x31\x90\x2c\xb6\xc6\x01\x03\x1c\xa0\xc0\x87\
\x0e\x28\x70\x80\x01\xed\x7d\xf6\xdd\x82\x16\x25\xe6\x83\x83\x3d\
\xcd\xe2\x86\x25\x59\xe4\x20\x63\x0c\x5f\xb8\x01\x46\x86\x79\xad\
\x01\x00\x00\x07\xf4\xf8\xa1\x02\x0e\x04\x19\x40\x89\x3f\x8d\x71\
\x22\x44\xcf\xb9\x06\x46\x53\x2e\x7e\x91\x45\x8c\x39\xc4\x10\xc3\
\x10\x43\xc0\x80\x4e\x7f\x77\xe9\xb8\x23\x8f\x3e\x82\x18\xa2\x01\
\x4c\x19\x09\x1f\x92\x0c\x96\xb6\xe4\x52\x4d\x3e\x39\xe3\x94\x55\
\xc2\x00\x43\x1f\x59\x0e\x30\xc0\x96\x5c\x7a\xe8\xa5\x02\x43\x2a\
\x25\x26\x57\x28\xa2\x04\x98\x0f\x67\x3e\xe8\x86\x93\x50\x4a\x49\
\xa5\x9b\x42\x08\x31\x04\x3a\x81\xb8\x05\x49\x00\x72\xce\xb9\x65\
\x8f\x76\x02\x19\x24\x98\x45\x36\xd7\xa7\x78\xd9\x05\xda\x22\x1d\
\x84\xae\x79\x28\x0c\x89\xca\x20\x43\x07\xd0\x28\x50\x56\x00\xac\
\x46\x3a\x69\x97\x96\x7e\xff\x49\x24\x4c\x46\x82\x06\x1e\x83\xc0\
\x79\xba\xd3\x2c\xa0\x3a\x29\x6a\x9b\xa5\x9e\xda\x01\x0c\x01\xac\
\xca\x2a\xa4\x72\xbe\x5a\x69\x90\x0e\x70\x50\x6c\x4f\xb5\xf2\x46\
\x66\x8a\xf3\xe9\xfa\x12\xaf\x5f\x84\x6a\x28\xb0\x42\x98\xda\x41\
\x07\x28\xa0\x30\x0b\x59\x06\x1e\x8b\xac\xa4\x75\xfe\xc8\xac\x02\
\x98\xee\x14\x2d\x66\x49\x66\x07\xe8\xa7\xd9\xaa\x19\xe5\xa8\xc1\
\x7e\x1b\xee\x0b\x31\x90\xf5\x00\x01\x04\x98\xeb\xea\x8e\x94\xaa\
\x1b\xa4\xb3\xb3\xb2\x34\x86\x98\xf0\xfe\x06\x28\x1a\x3c\xf1\x3a\
\xa8\xbd\x6c\x22\xda\xad\xb0\xfb\xbe\xf0\x82\xbf\x00\x07\x7c\xec\
\xc0\xe9\x7a\xc9\x81\x03\xed\xba\xb4\xb0\xad\x86\xad\x25\xde\xc3\
\xbb\xd2\x31\x71\xa1\x53\x5a\xec\x2d\xb8\x28\x68\xfc\x02\x0d\x64\
\x89\xd0\xb1\xc7\xad\x26\x4b\x70\x97\xcc\x72\x80\x67\xc2\x1f\x9d\
\xc1\xf0\x5c\xa3\x69\xd6\x29\xc4\xd7\x12\x32\xa8\xaf\x51\xc6\x4c\
\xea\xc5\xfa\xd6\x7c\x33\x0d\x38\x8f\x05\x89\x01\x3b\x0b\xec\x73\
\xc8\x41\x3b\xfb\x92\xd1\x27\x26\x0d\x1d\xcb\x2e\xcd\xe2\x74\xbd\
\xa2\xca\x8c\xb1\xd5\x58\xe3\x50\x4c\x59\x06\x70\xdd\xb1\xd7\xe8\
\x16\x1c\xab\xd0\x25\x83\xff\x44\x36\x7c\x66\x2b\xc9\x34\x4b\xc3\
\x38\xfd\x72\xd4\x87\xe6\x4b\xb3\xc6\x71\xe3\xe0\xd6\x7f\x76\x03\
\x8c\xf7\xab\x06\x73\x60\xf9\x00\x44\x6f\xf4\x37\x9f\x81\xe7\x3a\
\x38\x48\x85\xbb\x71\xf8\xb6\x53\xcf\x9c\x71\xe3\x74\xbc\xb5\x46\
\xdd\x91\x4f\xfe\x73\xe5\x96\xf7\xdd\x11\xd9\xb6\x92\xe9\xa7\xbc\
\x68\x7c\xee\x51\xe1\x2e\x87\x7a\x6f\x95\x8a\x9f\x4e\x03\x0e\x38\
\xa4\xfe\x16\x28\x90\x47\xce\x33\xc8\xb0\x1e\x6c\x79\x00\x38\x7a\
\x64\x34\xc3\x29\x53\xbb\xf4\x1e\x2b\xf1\xfe\x74\xa1\x89\x53\xbd\
\xf8\xd5\xc4\x1b\x9f\x25\xeb\x5d\xf7\x2c\xa9\xde\x61\x37\x71\xe0\
\x47\x79\xfc\x8d\xb4\x4d\x2b\x83\x81\x06\xf6\x1f\x0d\xc3\x88\xcb\
\x13\xcf\x88\xaf\xe9\x70\x0f\x5f\xfc\x60\x46\x20\xdf\xdd\xcc\xf7\
\x33\x3b\x39\xaf\x09\x0e\x20\x40\xe6\x18\xd2\x3e\xea\xd9\x2e\x7e\
\xf3\xfb\x88\x31\xee\x27\x3a\xa8\x55\x8c\x54\xa6\x63\x9c\xff\xac\
\x20\x3e\xc1\x40\xe2\x01\x75\x2b\xdf\xb9\x0a\x28\x32\x0e\x34\xa1\
\x09\x03\xf0\x48\x03\x6b\xd7\xb9\x87\xd1\x8f\x23\x13\xa4\x43\xef\
\xd4\x64\x28\x44\x79\x4b\x78\xc4\xe3\x20\x65\x56\x27\xc0\xe5\xf9\
\x0c\x7d\xcd\x32\x61\x02\xff\x3b\xb2\x42\xce\xc1\xcf\x4c\x11\x84\
\x21\x23\x08\xd1\x3b\x5f\xd5\x10\x83\xa7\xc2\x21\x0e\x74\xd8\x99\
\xe4\xb5\x8e\x80\x5c\x82\xdd\x09\x07\x10\x3d\x8c\x14\xf1\x7d\xd6\
\x7b\xd8\x1d\x60\x68\x09\x26\x6e\x0f\x71\x36\x8c\x62\xff\x72\xd8\
\xc1\x1d\xb2\xee\x8a\x23\xcc\xa2\xa5\x2c\x77\xc2\x2e\xac\x2f\x23\
\x88\xc8\x83\x03\x5b\x38\xbf\x31\x6a\xc4\x18\x65\xc4\x9f\x05\x81\
\x75\xc3\x35\x4e\xd1\x0d\xb0\x41\x1e\x08\x43\x28\x39\x2c\x02\x2d\
\x88\x27\x44\x18\x1e\x57\x08\xc6\xdb\xc9\x6f\x0f\x7e\xc4\x08\x20\
\x99\x38\x43\xfd\xa5\xf1\x7b\x1b\xb4\x02\x22\x71\x03\x09\x11\xf4\
\xf0\x63\x79\x33\x20\x24\xbb\xd0\x85\x14\x62\x24\x8f\x7f\xab\x1e\
\x4a\xae\x97\x49\x86\x18\xa3\x14\x4b\x9c\x61\x8c\xa4\x46\xb5\x7d\
\x35\xce\x0a\xa2\x1c\x8e\x15\xcb\xf7\xb5\x47\xd2\xb1\x0b\x1c\xb8\
\xe3\x42\x60\xc9\xb0\x07\x5e\x0f\x4e\x0d\x39\x06\x2e\xcd\xc8\x36\
\x5e\x16\x12\x7c\x53\xc4\xc2\x28\x87\x53\xca\x37\x0e\xb0\x98\xaa\
\x34\x61\x13\xba\xa0\x06\x00\x2c\x70\x20\xcc\xb4\x55\xd2\x90\x78\
\x07\x68\x2e\x44\x9a\xb9\xec\x64\xc5\x7a\x59\xb3\x5f\x6a\x73\x3a\
\xff\x59\xe4\x15\xc1\x39\xff\x47\x13\xb2\xb2\x0b\xcf\x52\x48\x28\
\x10\xe1\xbe\x0c\xac\xb3\x53\x98\x74\x67\x42\x8e\x91\x0b\x4b\xe4\
\x32\x7f\xf3\xbc\xa1\x06\xa7\x68\x85\x7b\x6e\x67\x0d\x22\xd0\xe7\
\x37\xf3\x56\xc2\x71\x76\xa1\x09\x00\xe8\xa2\x41\x06\xaa\x47\x75\
\xda\xa4\x34\x7d\x54\xe8\x41\x18\xea\x50\x6a\xee\x32\x66\xdd\xd2\
\x17\xe3\x72\x58\xd1\x2f\x70\x47\x20\x1f\xd4\x68\x23\x7f\x18\xce\
\x3a\xaa\x41\x0d\xae\x44\x08\x49\xcf\x60\x52\x8b\xa0\x14\x93\x98\
\x50\xc8\x33\x1a\xfa\xd0\x41\x62\x50\xa6\x37\xcb\x21\x16\xb0\x90\
\x85\x9b\x0e\x24\x9f\xa7\x44\xd6\xeb\xe6\xe8\x51\x35\x34\x21\x4f\
\x07\x39\x05\x33\xb9\x32\x1a\xf1\x5c\xb2\x0f\x49\x45\xc8\x33\x82\
\x51\x8a\x96\xca\x13\x78\x18\x9b\x69\x36\xa9\x6a\x55\x82\x94\x32\
\x3d\x02\xec\xd9\x56\x57\xf9\xd3\x40\x1c\x20\x73\xa1\xa0\xe4\x48\
\x28\x62\x56\x34\xb4\x33\x21\xbf\x60\xab\x5b\x21\x0a\x57\x99\xc6\
\x0d\x98\x58\x28\x43\x55\xeb\x6a\xd7\xf4\xe8\x54\xaf\x72\xe4\x6b\
\x20\x00\x2a\x54\x82\x1a\x69\x2e\x84\x25\x01\xa0\x12\x8a\x10\x4a\
\x48\x83\xa9\x2e\xbd\xd7\x53\xc1\x05\x3e\xc8\x4a\x96\xb2\x06\xb9\
\xeb\x65\xb5\x9a\xc5\x83\xff\xf9\x34\x10\x8d\x42\x48\x1e\x3f\x3b\
\xd8\x0a\xe4\x64\xb4\xb5\x2c\x08\x34\x72\xd1\x56\x0a\x3a\xb1\xb1\
\xac\xdd\xe0\x54\x5f\x0b\xdb\xd8\x66\x14\xaf\x76\xfb\xd8\xeb\x6c\
\x4b\x4e\x35\x04\xe2\x01\x09\x29\x29\x11\x7a\x9b\x82\xec\x24\x11\
\x21\x8a\xcd\xe5\x71\x9f\xea\x4b\xa9\x96\x81\xb9\xcd\x35\x08\x46\
\x2d\xcb\x48\x8f\x9d\x0f\x44\xc7\xb4\xae\x1a\x16\x62\x19\xee\x66\
\x67\x21\xa7\x20\x6e\x53\x55\x1b\xd3\xf2\xba\x16\xbd\xe9\x8d\xad\
\x11\xd8\xbb\x4f\x82\xc1\xd7\xa7\x5d\xe8\x89\x04\x8a\xdb\xc9\xc6\
\xc2\x6d\xae\x65\xf8\xc3\x64\x03\x8c\x10\x8c\x3e\x37\xaf\x90\x32\
\x30\x90\xfc\xf9\xd3\x9e\x78\xa0\xa5\x10\x25\xef\x4c\x2b\x7a\xde\
\x3f\xe4\x80\xc2\x0b\x81\x84\x11\x9e\xbb\xc8\x9d\x1a\x98\xba\xf6\
\xe1\x49\x05\x72\xc1\x44\x27\x8a\x58\xb9\x11\x36\x31\x8a\x19\x52\
\x4a\x11\x5c\x38\xba\x19\xe6\xd1\x86\x4d\x28\x52\x97\x1c\x43\x1a\
\x2e\xdb\xe5\x10\xfa\x1b\x55\xd7\xfe\xa1\x0e\x27\xde\x31\x8f\x7d\
\xfc\x63\x17\x0b\xb9\x59\x58\xea\x49\x29\x06\x75\x2f\x26\x0f\x8f\
\xc4\x11\xae\x43\xbf\xa4\xdc\x10\x15\xfb\x18\xba\x2e\xf6\x11\xc9\
\x7e\x32\x02\x69\xa8\x36\xff\x8a\x4d\x8e\xec\x93\xc5\x4c\xe6\x8c\
\x98\xf9\xcc\x2d\x6e\x15\x97\x64\xb7\x2b\x4b\x54\x09\xce\x5f\x96\
\x73\x1d\x12\x31\xe6\x3a\x63\x04\x12\x6b\x58\x71\x95\xf5\x8c\xdd\
\xa5\x18\x41\x03\x59\x00\x34\x0e\x22\x1b\x66\x42\x1b\x7a\x23\xeb\
\x51\x34\x9a\x59\x55\x9e\xab\xa8\x0d\x05\x81\xae\xb4\xa5\x2f\x8d\
\x69\x23\x98\xfa\xcc\x06\xf8\xd7\x1a\xc6\xa2\x01\x14\x10\x4f\xd0\
\x89\x70\x04\x0c\x48\xdd\x11\x50\x20\x6f\xc5\x2b\x46\x34\x59\x20\
\x51\x01\x46\x64\xe1\x0f\x2f\x40\x81\x23\x8a\x31\x6b\x5a\x7f\x04\
\x14\x90\xb0\xf5\x5d\x8c\x21\x8d\x7c\x38\x60\x6e\xc6\xa6\x6c\x40\
\xa3\x4d\xed\x6a\x5b\xfb\xda\xd8\xce\xb6\xb6\xb7\xcd\x6d\xdc\x20\
\x63\x1a\xd3\xd8\x85\xb8\x59\x41\x6e\x53\x98\xdb\x14\x9d\x48\x77\
\x23\xd6\xbd\x6e\x40\xb8\xfb\xdd\x7c\x88\xb7\xbc\xf9\x80\x87\x7a\
\xdb\xbb\xde\x64\xc8\x77\xbe\xbb\xdd\x11\x70\x8f\xbb\xdc\xe6\x4e\
\xb7\xba\xd9\xfd\x6e\x77\xcf\x3b\xde\xf7\xbe\xb7\xbe\x17\xbe\x70\
\x2f\x38\x9c\xdf\x19\xd9\x05\xb9\x59\x71\x6e\x81\x13\xbc\xe0\x07\
\x4f\x38\xbe\x19\xce\x70\x87\x7b\xfc\xe3\x0e\xdf\x02\xc4\x19\x42\
\x71\x74\x0f\xbc\x11\x18\xff\x9f\xb7\xc6\x39\xae\x6f\x90\x7f\x7c\
\x0b\x30\x8f\xb9\xcc\x63\x3e\x72\x85\x74\xe2\xe2\x80\x50\xb9\xc2\
\x59\xee\xf2\x90\xcf\xfc\xe7\x30\xe7\x81\xd0\x87\x3e\xf4\x9a\x23\
\xc4\xe0\xf2\xde\x79\xc3\x5d\x0e\x74\x99\x13\xfd\xe9\x50\x7f\x3a\
\x12\xa6\x6e\x74\x83\x6c\x7c\xe9\x1e\x6f\xfa\x16\xa2\xce\x75\x1e\
\x4c\xfd\xeb\x60\x0f\x7b\xd8\xab\x5e\x90\xac\xff\xbc\xeb\x42\x17\
\xbb\xda\xc1\x7e\x84\xb6\xbb\xfd\xed\x70\x7f\x3b\xd9\x09\x22\xf5\
\xb5\x4f\x3d\xee\x78\xcf\x7b\xdc\x59\xc0\xf7\xbe\xfb\xdd\xef\x73\
\x1f\x48\xde\xff\x4e\xf8\xc2\x1b\xfe\xf0\x88\x07\x7c\xe0\xfd\x51\
\x84\xc6\x3b\xfe\xf1\x90\x8f\xbc\xe4\x27\x4f\xf9\xca\x37\x7e\xf1\
\xfe\xb8\x81\xe6\x37\xcf\xf9\xcd\x03\xe1\xf3\xa0\x0f\xbd\xe8\x47\
\x4f\xfa\xd2\x97\x1e\xf3\x4a\x48\xbd\xea\x9d\xc0\xfa\xd6\xbb\xde\
\xf5\x9d\x8f\xbd\xec\x67\x3f\x7b\xd0\x63\x9e\x0a\xb8\xc7\x7d\x14\
\x76\xcf\x7b\xd5\xfb\xfe\xf7\xaf\x0f\xbe\xf0\x5b\x4f\x7b\xce\x63\
\xde\x1f\x6c\x60\xc3\x14\x96\xbf\xfc\xdc\x3b\x9f\x0a\xbc\x8f\x7e\
\x14\x7e\x4f\x7d\xe0\x0f\x5f\xf8\xc7\xf7\x87\x1e\xf4\xf0\x86\xee\
\xbf\x21\xf9\xc9\x67\x3e\xff\xf3\x9f\xef\x7c\xe9\x9b\xbf\xfa\xe8\
\xf7\x7d\xf6\xfd\x21\x89\xf6\x6f\x7f\xfb\xde\xef\x3e\xf8\xc3\x2f\
\xfe\xe6\x93\xbf\xfc\xe6\x3f\xbf\xfa\xd7\xef\x8f\x4b\x14\xe2\xff\
\xed\xe7\x7e\xef\x17\x7f\xf2\x37\x7f\xf5\x27\x7e\xf7\x47\x7e\xe6\
\xc7\x7f\x04\x21\x0a\x97\xf0\x80\xff\x57\x08\x01\x28\x09\xef\x07\
\x7f\x04\x38\x7f\xe0\x77\x80\x08\x78\x7f\x0c\xd8\x81\x1e\xf8\x81\
\x20\x18\x82\x2c\x71\x4e\x22\xc8\x13\x22\xe0\x0f\x60\x40\x03\x0e\
\x70\x82\xd3\x96\x15\x19\xd2\x0b\x19\xe0\x0f\x56\xd0\x69\x55\x47\
\x0b\x15\x30\x03\x83\x70\x08\xae\x20\x0b\x1a\x90\x0f\x65\x61\x04\
\x48\xc0\x0a\xd6\x70\x0f\x4e\x40\x0c\x60\x80\x04\xa1\x60\x74\xb4\
\xc0\x00\xde\x70\x08\x87\x90\x06\x69\x20\x05\xef\x90\x0d\xc1\x50\
\x64\x4a\x61\x04\xf7\xa0\x0a\x91\x90\x09\xaa\x00\x0b\xd6\x40\x0c\
\xee\x80\x0c\x35\xb7\x84\x9b\xe0\x84\x50\x28\x05\x52\x60\x01\x0d\
\x30\x0f\x85\xc6\x14\x46\xd0\x0d\x5c\x20\x07\x83\xb0\x85\x5d\xc8\
\x0c\xcc\x70\x0f\x78\x90\x84\xdd\xb6\x84\x66\x18\x85\x69\xa8\x86\
\x0d\x90\x00\xc0\xa0\x12\x6e\xa8\x0a\x4f\x10\x06\x5c\x00\x07\x72\
\x48\x87\xb0\xc0\x0c\xd6\xff\x20\x72\xdc\x46\x0b\x10\xd0\x87\x68\
\x68\x01\x6a\x98\x00\x09\x20\x00\x05\xf0\x01\x2f\xd0\x68\x3e\x61\
\x04\x91\x60\x03\x3f\xb0\x03\x88\xa8\x88\x73\xc8\x85\x5d\x78\x0f\
\xdf\xe0\x89\xd7\x26\x89\x4f\xe8\x87\x96\xd8\x00\x81\x98\x89\x05\
\x80\x00\x0b\xe0\x09\xba\x03\x13\x90\xc0\x05\x21\x50\x02\xa2\xb8\
\x03\x87\x18\x87\x8b\xc8\x85\xb0\x00\x0b\x40\x70\x0b\xd8\x26\x89\
\x50\x08\x8b\x80\x98\x89\x9a\x68\x8b\x0b\x00\x02\xc9\xf0\x13\xaa\
\x50\x03\x2e\xd0\x8b\xbf\x18\x8c\xa6\xb8\x85\x5c\xd8\x0d\xcd\xd0\
\x8a\x10\x70\x86\x95\xd8\x8c\x02\xf0\x8c\x0b\xb0\x00\x0c\x00\x01\
\x20\x90\x65\x3b\xa1\x05\x3d\x50\x03\x2b\xd0\x8b\x33\x30\x8a\xda\
\x28\x87\xa7\xa8\x0a\xdd\xc0\x02\x63\x40\x6d\xb4\x00\x02\xe2\x18\
\x8b\xb3\x58\x8e\xb5\x78\x8e\xe9\x08\x02\x49\xf0\x03\x3d\x61\x09\
\x6d\xc0\x04\xef\x18\x8f\x25\x30\x8f\xc0\x58\x8a\xdb\x98\x09\x5c\
\xc8\x07\xd1\xd6\x8f\x7e\xf8\x87\xb2\x88\x89\x02\x89\x00\xb6\x58\
\x90\x49\x60\x06\x82\xd0\x13\xa9\x30\x07\x0b\xd9\x03\x2e\xe0\x90\
\x33\x60\x03\x11\x59\x8a\x8b\xb8\x85\xee\xc0\x0a\xb9\x65\x68\x18\
\x39\x8e\xcd\xe8\x8c\xb5\xff\xf8\x91\xea\x98\x04\x21\xd9\x02\x3d\
\x51\x08\x8f\x30\x07\x5a\xc0\x90\x29\x29\x8f\xd9\xe8\x92\xc3\x98\
\x09\x45\x10\x54\x52\xd6\x8f\x68\xf8\x87\x37\xd9\x91\x3a\xb9\x93\
\x66\xe0\x07\x26\xd0\x13\xca\xf0\x08\x8f\xd0\x06\x43\x69\x8d\x2a\
\x79\x94\x89\xb8\x8d\x91\x60\x0d\xd8\x50\x67\x4e\x39\x8e\xb2\x18\
\x88\x02\x99\x93\xe8\x08\x01\x54\xe9\x07\xa3\xd0\x46\x06\x71\x05\
\x1b\xf0\x01\x11\x80\x01\x17\xd0\x02\x41\x10\x07\x0b\xc1\x07\x6d\
\xa0\x08\x26\xe9\x8e\x5e\x69\x94\xf4\x88\x88\x89\x68\x8f\x91\x00\
\x0b\x4e\x70\x06\x3b\x46\x0b\x49\x60\x93\x1b\x89\x93\x6c\xc9\x00\
\x20\x69\x06\x55\x39\x0a\x0a\x21\x08\x62\x40\x97\x76\x89\x97\x7a\
\x59\x05\x76\xe0\x09\x09\xf1\x00\x9c\xa0\x08\x41\x79\x92\x83\xf9\
\x90\x47\x89\x94\x73\x18\x09\x80\x80\x62\x8e\x09\x99\x01\xa9\x89\
\x93\x09\x92\x21\x09\x97\x91\x90\x10\x95\xa0\x99\x74\x39\x01\x77\
\x99\x97\x41\x00\x9a\x9e\xe0\x0a\x09\x91\x09\x8a\x60\x9a\x5c\xc9\
\x90\xa9\xb9\x92\x85\x29\x91\xf6\x68\x0d\x5e\x70\x0a\xe9\xa5\x09\
\x8f\x69\x89\x80\x38\x9b\x05\x50\x9b\xea\x68\x90\x97\x99\x9b\x08\
\x81\x0a\x95\x60\x08\x62\xff\xb0\x04\x1b\xe0\x9b\x9e\xa9\x03\xa0\
\xb9\x08\xae\x20\x0c\x09\x31\x05\x73\x00\x98\xc9\xf9\x8e\x45\xa9\
\x9a\xf4\x18\x8c\x87\xb9\x88\x45\xd0\x5c\xd4\x09\x95\x69\xc9\x91\
\xb4\xe9\x91\xe8\x98\x8e\x54\x59\x95\x83\xa0\x10\xa8\x20\x08\xe2\
\x49\x9e\xe6\x99\x97\xe8\x19\x07\xea\xc9\x9e\x08\xd1\x05\xd6\x60\
\x9a\x81\xa9\x9c\xf3\xc9\x9c\x3b\x10\x91\x5c\x70\x9f\x83\x00\x0b\
\xd3\x40\x59\xfb\x69\x9d\x91\x29\x99\x00\xda\x96\x3b\x79\x9b\x05\
\x9a\x10\xaf\xb0\x9b\x86\x70\x05\x0a\xfa\x9b\x2d\xd0\xa0\x8b\xe0\
\x09\xc2\x50\x0d\x88\xf5\x06\x5a\x70\x9a\x16\x7a\xa1\xbf\xd8\x92\
\x61\x69\x8f\x51\x30\x2e\xdc\x41\x9d\x22\x3a\xa2\x6b\x59\xa2\x02\
\x6a\x90\x28\xba\x10\xe0\xc9\x9b\x2f\x7a\x9e\x7b\x19\x9a\xae\x60\
\xa3\x0a\xa1\x0c\xf0\x39\x94\xf2\xb9\x02\x5f\xf9\x03\xcd\xf9\xa3\
\x72\x10\x09\x9d\x30\xa4\x49\x50\xa4\xb3\xf9\x9f\xd0\x48\x99\xdb\
\xb9\xa4\x4c\xba\x9b\x9b\xb9\x04\x1f\xb0\xa0\x27\xa0\x03\x51\x3a\
\x9c\x10\x9a\x10\x1a\x70\x0f\x6d\x50\xa1\x59\x1a\x02\x84\x59\x9f\
\x86\xa9\x88\x72\xa0\x0a\x37\xb0\x1f\xcb\xa1\x09\x66\x40\xa6\xfe\
\x69\xa6\x04\x59\x90\xdc\xff\x69\x06\x29\xca\xa4\x08\xda\xa6\x6f\
\xfa\x9b\x71\x1a\x9c\x76\xf0\xa0\x0d\x31\x05\x79\x1a\x9f\x83\xd9\
\xa7\xc0\x68\x9f\x70\x00\xa8\x48\x50\xa8\x87\x0a\x90\x65\x9a\x9d\
\x48\xca\xa8\x3c\xe9\xa8\x18\xc1\xa2\x9b\x59\x97\x70\x2a\xa7\xe9\
\x49\xa3\x0d\x81\x08\xd6\x30\x07\x7a\xda\xa9\xaa\x99\x8d\x87\xe8\
\x9c\xaa\xd0\x09\x1c\x20\x1c\x86\x6a\xaa\x98\xe8\x8c\x8a\x1a\xa0\
\x6e\xa9\xa4\xac\xda\xaa\x91\x4a\x9e\x93\x8a\x97\x95\x5a\x05\x0e\
\x3a\x9c\x18\x61\x04\x4a\xd0\x03\xc9\x69\xa1\xf1\x68\x94\x3d\xda\
\xab\x1b\x0a\xa8\x51\x90\x60\xb1\x31\xac\xd7\x59\xac\xe5\x78\xac\
\x68\x9a\xa6\x66\x20\x07\x1a\xc1\xa2\x2e\x0a\xab\x94\xfa\x99\x71\
\x20\xa5\x1a\xa1\x0e\xb9\xaa\xab\x2b\xd9\xad\x61\xf0\xa7\x70\x90\
\x09\xbb\x30\xae\xa5\xda\x9f\x89\x8a\xaa\x67\x9a\xa4\x4a\xca\xae\
\xed\xea\xa4\xf0\x0a\xad\xf2\x4a\xaf\x19\x91\x01\xc4\xc0\x04\x9c\
\x8a\xaf\x36\xd0\xad\xa0\x0a\x07\x91\x40\x05\x44\x70\x1a\xc3\x9a\
\x96\xb3\x28\x99\x6c\x89\xac\x69\x9a\x04\x08\xab\x11\x91\xfa\xae\
\xcf\x7a\x01\x27\x10\xa3\xd2\x7a\xa9\xa2\xb9\x11\x6f\xd0\x06\x9c\
\xea\x02\x45\xc9\xad\xa3\xff\xf8\xa9\xfb\xfa\xad\x72\xe0\x05\x9e\
\xd1\xb1\x46\xba\x96\x21\x4b\x99\xaa\x4a\xb2\x1d\x71\xb2\xce\x3a\
\x01\x26\xc0\xb0\x72\x3a\xaf\x33\xca\x11\x1e\x10\x0f\x5a\x30\x94\
\x3b\xea\x90\xbb\xca\xa5\x38\xfb\xa7\x99\xb0\x05\xc6\x30\x19\x3e\
\xfb\xb1\xe7\x9a\x9d\x21\x2b\xb2\x20\x60\x90\x25\xbb\x11\x46\x5b\
\x97\x11\x90\xb4\x2a\x1b\xa3\x96\xda\xb4\x1d\xe1\x04\x3d\x20\xb5\
\xf2\x39\x9f\x55\xeb\xa7\xfc\xaa\x04\x34\x98\x17\x86\xea\xb1\xe6\
\x0a\xb4\x25\x2a\xb6\x06\x09\x07\x1f\x71\xb6\x76\xa9\xb6\x2b\x2b\
\xab\xd3\xea\x11\x00\x80\x0f\xf1\x39\xb7\x54\x9b\xaf\x56\xeb\xa3\
\x89\x98\x09\xac\x30\x18\x7b\x2b\xb0\xc6\x0a\xb6\x7f\x9b\xae\x63\
\x9b\x04\x82\x3b\xb8\x9b\x49\x97\xe5\x99\xb6\x4a\x1b\x9c\xf3\xfa\
\xb2\x1d\x31\x0c\x6f\x50\x03\x58\x5a\x03\x5e\xf9\xb8\xcc\x79\xb3\
\x4f\xe0\xad\x89\xc8\x06\x8c\x79\x17\x97\xfb\xb3\xb4\x19\xb6\x9c\
\x1b\xb8\x2b\x21\x9e\x28\xeb\x9b\x86\xcb\xb6\x2d\xbb\x08\x2b\x21\
\x0a\x51\xab\x9c\xaf\xdb\x8b\x0f\x19\xbb\x19\x3a\xbb\x39\x1b\x87\
\x16\x09\x17\x9a\xe0\x07\x98\x9b\xb9\x04\x7b\x8e\x80\x0b\x02\x9f\
\x0b\x12\xc0\x7b\xb4\xa4\xff\xbb\xb6\x88\x7b\xa9\x2b\xa1\x01\xfa\
\xd0\x03\x4c\xa0\xbc\x29\x09\xbb\xa2\x28\xbb\xb4\x9b\x09\x40\xb0\
\x8f\x65\x51\xbd\x98\x7b\xae\xbb\xbb\xb9\x02\xba\x9d\xdd\xeb\xbd\
\x6d\x0a\xaf\xc3\x3b\xbe\xc6\xcb\x12\x4a\x50\x03\xe9\xfb\x8e\xcb\
\x5b\x02\xcd\xdb\xbe\xcf\x4b\xbb\x5c\x50\x04\xcf\x50\x16\xd6\xab\
\xbb\xf7\x9b\xaa\x06\xbb\xbf\xfc\x1b\xbc\xe1\x7b\xb8\xa6\x4b\xbe\
\x2c\x61\x0c\x50\xcb\x90\x8e\xcb\xbe\x16\xbb\xaf\x88\x98\x09\x33\
\x99\x15\xf5\xfb\xb5\x04\x5b\xb0\x15\xfc\x12\xdf\xeb\xbf\xa5\x5b\
\x05\xa0\x69\x07\x2e\xa1\x00\x4a\xe0\x02\x20\x6c\x8d\xeb\xcb\xbc\
\x33\x00\xb9\xee\x9b\xb3\x2c\xa2\x14\x5e\xf0\xb1\xc6\x3a\xc1\x2c\
\x9c\xac\xdc\x0b\x13\x62\xd0\xbf\x93\xfa\xbf\xe3\x0b\x13\xbc\x80\
\xa5\x21\xcc\xc3\x3e\xbc\xc0\xfb\xca\x0c\x64\x71\x0e\xc5\x5a\xc4\
\x9a\x4b\xc1\x48\x6c\xc1\x2c\x11\xba\xe0\x6b\xb8\x1a\xdc\xb2\x30\
\x41\x01\xc4\x80\xc3\x06\x4c\xb3\xdb\x8a\xc0\x3d\x5c\xb1\x91\x0b\
\xbd\x61\x40\x16\x5a\xd0\xb7\x7e\x8b\xbf\x6e\xa9\x8e\x60\x1c\xc6\
\x2e\x3a\xc6\xd0\x5a\xc6\xf3\xca\x13\x53\x80\xbe\x6b\x5c\xb3\x6e\
\x5c\xc5\x38\x4b\x16\xeb\xff\x30\xb0\x5d\x0c\x8d\x22\xab\xc7\x3d\
\xd1\xbf\x30\x7c\x01\xe2\xbb\xc1\x3c\x91\x01\xf7\x40\xc8\xae\xcb\
\xc6\x7c\x7a\xc8\x70\xec\xbe\x64\x51\x07\xf6\x0b\xb6\x39\xe9\xc8\
\xe9\x0a\xc9\x91\xfc\xae\x93\x5c\xc9\x66\xdc\x13\x37\xb0\x02\x3d\
\xb0\xc6\x5a\xda\xc9\x09\xac\xc0\x3b\xe0\x04\x65\xa1\xc2\x2b\xac\
\xbd\x42\x9b\xac\x7b\xec\x12\x92\xdc\xc4\x78\xc9\xca\x81\xdc\x13\
\x46\x00\x0e\x39\xbc\xbc\x54\xfc\xc9\x3b\xe0\x16\xc8\xb0\x04\xa4\
\xec\x91\xa6\xcc\xb9\xbf\x0c\xcc\x28\x2b\xcc\x94\x5c\xc6\xd2\xfa\
\x13\x88\xa0\x07\x2e\x10\xcb\x3a\x3c\xcb\xcb\x2c\x8a\xb0\xf0\x16\
\x2c\xd0\xc8\xbc\x7c\xca\xd5\xec\x12\x57\x70\xcd\xc2\x3b\xcc\xda\
\xcc\x97\x4a\xa1\x07\xea\xbb\xc3\xcb\xac\x0a\x79\x3b\x16\xb3\x40\
\x05\xce\x20\xcd\xe9\x9c\xbf\xeb\xcc\xce\xc1\xfb\xce\xd9\xcc\xb6\
\xa6\xbb\x14\x15\x60\x0f\xe0\x1c\xce\x6d\xfc\x90\x99\x90\xcf\x65\
\xd1\x0c\xbe\x30\xcd\x00\xdd\x14\x7d\x0c\xab\x04\x5d\xc9\x07\xcd\
\x14\x45\xf0\xcd\x9b\x6c\xcf\x25\x30\x08\x10\x5d\x16\xb7\x20\x0a\
\xff\x9c\xc7\x01\xfd\x12\x17\xfd\xa6\x19\x7d\xb8\x88\xdb\x14\x94\
\xa0\xd0\x85\x3c\xcb\x72\xff\x30\xd2\x6e\x21\x02\xdc\xe0\x0e\xa8\
\x40\x99\x3a\x00\x01\xad\x90\xd2\x2a\xbd\x04\x47\xfb\xce\x4a\xfb\
\xd2\x30\xed\x04\x72\xb0\x02\xf0\x58\x02\x2e\x00\x04\x70\x60\xd3\
\x6f\x91\x21\x29\x40\x06\x4f\x50\x0a\x8e\x93\x15\xaa\xcc\xd2\xa4\
\x5b\xd4\x1b\x8d\x15\x42\xa0\x0f\xb0\x60\x05\x40\xe0\x0f\x50\x9d\
\x17\xec\x42\x16\x59\xed\x9b\x5b\x2d\xbe\xb2\x5a\x05\x65\x21\xbf\
\x23\x97\xd6\x11\xb0\xd6\x2b\x4b\xbc\x6e\x5d\x82\x2d\x21\xd7\x74\
\xdd\x02\x76\x8d\xd7\x79\x4d\x9e\xf0\xba\xd7\x06\x7d\xd7\x7e\x0d\
\x12\x42\x5d\x97\x93\x2a\xd8\x72\x1a\x9c\x85\xbd\x12\x87\xfd\x01\
\x89\x9d\xb4\x7f\x3c\xd8\x8d\x6d\xd8\xce\x1a\xd9\x18\x30\xd9\x8b\
\x4d\xd8\x95\xcd\x11\x8f\x8d\xd9\x9a\x2d\xab\x9d\xed\x11\x80\x0d\
\xd9\x6a\x2d\xd9\x2a\xeb\xd2\x8c\x3d\xda\x9e\xbd\x01\x88\x7d\xda\
\x99\x9d\xda\x31\x2a\xda\xac\xbd\x11\xa5\x3d\x01\xb0\x1d\xda\xab\
\x5d\xdb\x19\x71\xdb\xb9\x2d\xdb\x3a\xb0\xd8\xbc\xad\x11\xbe\x3d\
\xd7\xa8\x7d\x02\xaa\x1d\x04\xc3\xdd\xdb\xae\xad\xd5\x74\x5d\xd7\
\xc2\xbd\xdc\x0d\x51\xdc\xcf\xcd\xd7\xd1\x2d\xdd\x0b\x71\xd9\xb8\
\x6d\xdc\xb1\x8d\xdc\xd6\x32\x1d\x04\xca\x8d\xdd\x0c\xf1\xda\xbf\
\xbd\xb6\x6c\x2b\xde\x0d\x41\xde\xdc\x0d\xcf\xd6\xad\x03\xe8\xdd\
\x10\xa6\x5d\xde\xd0\xfd\xde\x18\xa1\xd5\x26\x80\xda\xe6\x4d\xdf\
\x1a\x21\xbc\xf8\x7d\x02\x14\x16\x10\x00\x21\xf9\x04\x05\x0a\x00\
\xff\x00\x2c\x10\x00\x0f\x00\xa9\x00\xa9\x00\x00\x08\xff\x00\xfd\
\x09\x1c\x48\xb0\xa0\xc1\x83\x08\x13\x2a\x5c\xc8\x50\xe0\x83\x07\
\x06\x22\x12\x98\x18\xa0\xa1\xc5\x8b\x18\x33\x6a\xdc\xc8\xb1\x63\
\x41\x11\x0f\x21\x4a\xa4\x18\xa0\xa2\xc7\x93\x28\x53\xaa\x5c\x79\
\x50\x04\xc8\x87\x11\x0d\x4c\x24\x50\x32\xc0\x00\x96\x38\x73\xea\
\xdc\x39\xd0\xe5\x4b\x91\x32\x49\xda\xbc\xc9\xb3\xa8\xd1\xa3\x0d\
\x8d\xf8\x84\x39\x92\xe6\x50\xa2\x48\xa3\x4a\x35\x6a\x44\xa9\x4b\
\xa6\x41\x9d\x0e\xd8\x0a\x60\xaa\xd7\xaf\x2b\xab\x2e\x05\x3a\xb3\
\xe4\xd6\x01\x5d\xc1\xaa\x5d\x9b\x51\xec\x55\xb2\x24\xcf\xa6\x65\
\x4b\xb7\xee\x41\xb7\x2f\x63\x96\x7d\x3a\xd7\xae\xdf\xba\x78\xb1\
\xee\xe5\xda\xf7\xaf\x61\xb0\x81\x99\x0e\x46\x5b\xf8\xb0\xe3\xa8\
\x89\x45\x0a\x25\xfc\xb8\xb2\xd4\xc8\x23\x6b\x52\xb6\xcc\xb9\x28\
\xe6\xa0\x9a\x19\x77\x1e\xad\xf3\xf3\x64\xd1\xa4\x53\xab\xac\x6a\
\x35\x64\x66\xb3\xa8\x55\xcb\xee\xc8\xfa\xad\x64\xa7\x43\x01\x34\
\x9e\xcd\x3b\xa9\x5b\xd7\xa0\xf9\xee\xee\x4d\x1c\x61\xed\x9f\xaf\
\xe5\x0e\x2f\xce\x7c\xe0\x9a\xdf\x8a\xb5\x32\x5e\x7e\x14\x54\x73\
\x9e\xcf\xad\xe6\x0d\x4e\xf8\xc0\x54\x23\xfe\xba\x38\xff\x58\xe3\
\x5d\xc4\xf5\x9c\xd9\xc7\x26\x67\xec\x3d\xea\x80\x2e\xcf\x4e\x9d\
\x99\x65\x2c\xc0\xaa\xf3\x38\xd3\xbf\x5d\xaf\xbb\xfd\xd1\x01\xa1\
\x9c\x92\xc7\x19\x04\x8e\x91\x47\x1e\x81\x58\x87\x5f\x4a\xfa\x6d\
\x17\x17\x7b\x48\x01\x78\xe0\x80\x67\x8c\x61\x21\x14\x50\x3c\x63\
\xde\x82\x27\x35\x18\x1d\x6c\xfd\xfd\x17\xca\x84\x05\x5e\x08\x05\
\x11\x50\x50\xc2\x61\x87\xc7\x7d\x98\x1b\x00\xfe\xed\x04\x20\x22\
\x07\x96\x38\x06\x86\x44\xe4\x98\xa1\x01\x2b\x72\x94\x5d\x6b\xb7\
\x81\x08\x63\x51\x33\xd6\x58\xa1\x89\x39\x12\x31\xc2\x08\x19\x3c\
\x03\x5e\x8f\x19\xad\xa1\x9f\x8b\x5c\x1d\x10\x23\x4e\x45\x52\x78\
\x24\x8e\x39\x2e\x99\x41\x06\x44\xac\x01\x65\x94\x53\x06\x69\x53\
\x7f\x57\xae\x94\x25\x81\x5b\x9e\xd8\x25\x93\x5f\x7a\x40\xdd\x98\
\x06\x49\x09\x5d\x72\x68\xea\x34\x23\x8d\x14\x22\xf9\xe6\x97\x19\
\x78\xe0\x01\x14\x74\x5e\x64\x27\x90\x78\xc2\x98\x26\x4a\x03\x9c\
\x82\x08\x9f\x25\x62\xe8\xa6\x97\x71\x7a\x40\x01\x05\x85\x5a\x74\
\xe8\x7e\xa0\x75\xb7\xa8\x47\x8d\x3e\x6a\xa4\x89\x93\xc2\x19\xa8\
\xa5\x97\x66\xda\xd0\xa6\x0e\xd2\xd4\x9d\x02\x2c\x85\xff\x0a\x69\
\x9b\xa5\x02\x2a\xe8\xa5\x14\x48\xa0\x2a\x43\xac\x7e\xf8\xea\x4a\
\x01\x38\x3a\x2b\xa9\x7f\x56\x8a\xab\x04\xbf\xec\xba\x90\x94\xcf\
\x71\x4a\xd1\xaf\x29\x05\x1b\x8a\xa8\x36\x72\x49\xe9\xa9\x97\x4a\
\xa0\xad\xb2\x0b\x41\xb2\xa9\xaf\x68\x59\x09\x2b\x4a\xd2\x8a\xda\
\xe7\x8d\xb5\x9e\x8a\xaa\xb6\x12\x9c\xc1\xad\x42\xde\xa6\xa7\x18\
\x88\xe2\x92\x7b\xca\xb4\xc3\xa2\x5b\xac\xa0\xeb\x6a\xeb\xee\xbb\
\x09\xc5\xfb\x9b\x44\xf4\x1e\x30\x6e\x47\x01\xcc\x82\xef\xa8\xfa\
\x2a\x09\x27\xbf\xd9\xfa\x0b\x30\xbc\xbd\x12\x7c\x26\x8c\x0a\x1c\
\xbc\x51\xc2\xa1\x4c\xcb\xb0\xb5\x0f\xa3\x9a\xab\x04\x15\xfc\x3b\
\x31\x42\x02\xb7\x66\x31\x7b\x19\x23\xac\xf0\xc2\x91\xa6\x7b\x6b\
\xc4\x25\x9f\x0c\xaf\xb7\x03\xcb\x64\x56\x7f\x0a\x38\xc0\x51\xc2\
\xf7\x9a\xdb\xe6\xbe\xfd\x92\x6c\xb2\xcd\x07\x41\x22\xf0\x55\x2b\
\xf3\xec\xb3\x46\x40\x2f\x3c\xa0\x9f\x94\xce\xcc\x6e\xcd\x48\x07\
\xbc\x34\x48\x4d\x8b\xfb\x34\x46\x01\x0c\x73\xaf\xc7\x7d\x82\x6c\
\xec\xc8\x15\x60\x9d\x35\xca\x5b\x4b\xb6\xb3\xd7\x19\x85\x3d\x36\
\xb5\x15\x9a\x8d\x2d\xda\x6a\xaf\x7d\x10\x28\x6d\x77\xff\x9d\xf1\
\xd7\x0d\xc9\x1d\x34\x8d\x91\x12\x4d\x73\xde\x7a\x1b\xc4\xf7\xb7\
\x04\x57\xd9\x33\xe0\x0b\x09\x0e\xf3\x96\x86\xe3\x7d\x74\xe2\x8a\
\x2b\x2d\x6f\xe3\xe1\xf6\xcc\x81\x45\x04\x0c\x33\xcb\xdc\x35\x5e\
\xb8\xef\xe1\x88\x63\x5e\x10\xdf\x38\x2b\xe5\x36\xcb\x0e\x7c\xce\
\x10\x01\xc6\x8c\x1e\x74\xe9\x37\x9e\x8e\xb7\x06\x97\xab\xbe\xfa\
\xe2\x62\xc1\xe4\xaa\xd3\xb2\x2b\x44\xbb\xed\x30\x23\xe9\xa5\xd5\
\x24\x57\xc0\xbb\xef\x0a\x81\xb2\x78\xb3\xc2\x9f\xe9\x75\xf1\x08\
\xd1\x2e\xfa\xe0\x65\x9f\xb8\x7c\xbf\x69\x3f\x0f\x7d\x42\xd2\x2f\
\x5d\x7d\xe7\x0e\xc4\xae\xd0\x03\xc7\x6c\xdf\x31\xe1\x75\x7b\xcf\
\x24\xf3\xe1\xf7\x3e\xfe\xea\xe6\x43\x34\xbc\xc1\xb1\x37\x91\x10\
\xfb\xdb\xbb\x5d\x81\x70\xf4\xbd\xdd\x69\x60\x0c\xf7\x5b\x08\xeb\
\xa8\xa7\x3f\xeb\x79\xee\x7f\xc7\x30\x86\xfb\x20\xa5\xaf\x02\x6a\
\x2b\x7c\x07\x4c\xa0\x02\x81\xc7\xb4\xfd\x3d\xb0\x25\xcf\x90\xe0\
\xe8\x92\x47\x40\x63\x5d\xd0\x79\x19\xd4\xa0\x02\x71\xd6\x41\x07\
\x42\x8e\x20\xab\x10\xe1\x29\x04\x68\xba\x87\xd1\x4c\x03\x1a\x48\
\x01\x02\x55\xc8\x90\xd6\x71\x6d\x7f\x2f\x24\x48\x04\xff\x27\x38\
\xb5\xdc\xd9\x30\x57\x18\xd4\x21\x0f\x0d\xe5\x3a\x9d\x0d\xe0\x53\
\x03\x09\x80\x0c\x3d\x36\x40\x25\xc5\x29\x5b\x49\x24\xd4\x12\x8b\
\xe2\x80\x09\x12\xce\x88\x57\x3c\x61\x0e\x53\xa0\xc5\x2d\xf2\xa4\
\x8b\x23\xfc\xa2\xf7\xc2\x48\x32\x1c\xa6\x80\x04\x65\x34\xe3\x4e\
\x38\x60\x0c\x1a\xae\x31\x50\x48\x44\xe1\x1b\xe3\x28\x47\x9d\x48\
\x91\x8a\x60\xbc\x55\xf3\xc6\x48\x02\x22\xf4\xf1\x28\xc6\x50\xa3\
\x15\x05\xa9\x47\x12\x14\xf2\x90\x47\x51\x80\x31\xea\xb6\x48\x2c\
\xba\x91\x04\x2a\x30\x24\x24\x45\xb4\x46\x4b\x5d\x30\x87\x8e\x54\
\xc1\x08\x36\x89\x14\x50\x34\x61\x0c\xf3\xcb\x23\x28\x55\x20\x4a\
\x52\x4a\x65\x00\x88\xf0\xa4\xf3\x52\xf0\x46\x15\xf8\x60\x94\xf7\
\x4b\xd6\x5f\x9a\x90\x01\x09\x50\x60\x95\xb6\xcc\x80\x2b\xbf\xd2\
\x04\x44\x8c\x21\x05\x97\xf2\xc1\x2f\x84\xc9\xc3\x5b\x1c\x66\x00\
\xb3\x38\xc6\x03\x74\x69\x46\x48\x1c\x46\x4c\xc3\xcc\xa6\x36\xb7\
\xc9\xcd\x6e\x7a\x73\x34\x05\x08\xa7\x00\xc6\x49\xce\x72\x96\x33\
\x01\xe8\x4c\xa7\x3a\x13\xd0\x80\x76\xba\xb3\x9d\x16\x88\x67\x3c\
\xa5\x40\x4f\x7a\xa6\x61\x36\xf9\xa8\x47\x3d\xd8\xc1\xff\xcf\x74\
\xf8\x33\x1d\xe2\x08\xa8\x38\xa4\x41\x50\x69\x04\xe3\xa0\x08\xcd\
\x85\x42\x17\x9a\x8b\x52\x38\xf4\xa1\x0f\xb5\x84\x44\x27\x6a\x09\
\x84\x84\xf3\xa2\x18\xbd\xa8\x39\x37\x4a\xce\x75\xaa\xf3\x9d\xee\
\x94\xe7\x3c\xeb\x49\x1a\x7d\xf6\xd3\x9f\x02\x1d\x68\x41\x11\x7a\
\x50\x86\x2e\x14\xa2\x10\xa5\xa8\x4c\x25\xca\x88\x9a\xd6\xb4\x20\
\x08\xc8\xa8\x4e\x77\x2a\x4e\x8e\x9e\xd3\xa3\xec\x04\xa9\x48\x2d\
\x20\x85\xce\xb0\xe3\x9f\x29\x5d\x29\x4b\x5d\x0a\xd3\x88\xce\x94\
\xa6\x36\x8d\xaa\x54\x19\x41\x88\x81\x20\xe0\xaa\x58\xcd\x2a\x56\
\x79\xca\x55\x9f\x8e\x13\xa8\x20\x6d\x40\x3c\x2d\x03\xd0\x80\x2a\
\xb5\xa5\x0c\x6d\xea\x53\xa1\x3a\x55\x9b\x12\xe2\xad\x70\x8d\x2b\
\x5c\x05\xa2\xd5\xba\xda\x55\xab\x5c\xcd\xa8\x57\xc1\xda\x00\xcb\
\x10\x34\xa1\x69\x8d\xe9\x4c\xdb\xea\x56\xb9\x1a\xf6\xad\x74\x48\
\xac\x62\x15\xeb\x8f\x05\x38\xf6\xb1\x90\x75\xec\x5d\x27\x8b\xd7\
\xbc\x16\x80\xa3\xea\x7c\x4c\x30\x5e\x2a\x58\x8a\x12\xf6\xb0\x71\
\x5d\xac\x68\x47\x2b\x5a\x37\x98\x36\xb2\xa8\x4d\xad\x6a\x17\x40\
\x59\xbb\xe6\x95\x9c\x8f\x71\xa8\x67\xa7\x0a\x5a\x42\xff\x90\xf6\
\xb6\x74\x30\xad\x6e\x77\xcb\x5b\xde\x32\xe0\xb7\xc0\x0d\xee\x6a\
\x87\x4b\x5c\xd6\xb6\x36\xa7\xe1\x7c\x4c\x61\xe5\x8a\xdb\xc4\xf6\
\xf6\xb9\xd0\x35\xed\x17\xa6\x4b\xdd\xea\x52\x37\xb8\xd8\xcd\xae\
\x76\xb7\x8b\xdd\xe2\xae\x16\x01\x8f\x29\x6d\x74\x79\x6b\xdd\xf2\
\x9a\xf7\xbc\xe7\xcd\x82\x7a\xb9\xcb\xde\xf6\xba\xf7\xbd\xbf\x7d\
\x0c\x7a\xab\xab\xde\xfa\xda\xf7\xbe\xf8\xcd\xaf\x7e\xf7\x0b\x81\
\xfe\xfa\xf7\xbf\x00\x0e\xb0\x80\x07\x4c\xe0\x02\xf7\xf7\x31\x39\
\x48\xb0\x82\x17\xcc\xe0\x06\x3b\xf8\xc1\x10\x8e\x70\x82\x0d\x4c\
\xe1\x01\x83\xe0\xc2\x18\xce\xb0\x86\x37\xac\xe1\xc7\x0c\xe1\xc3\
\x43\x88\x81\x88\x47\x4c\xe2\x12\x9b\xf8\xc4\x28\x4e\xb1\x88\x1b\
\xcc\xe1\x16\xbb\xf8\xc5\x1c\x4e\x82\x8c\x67\x4c\xe3\x1a\x27\xe1\
\x31\x42\x80\x81\x8e\x77\xcc\x63\x1d\x83\xf8\xc7\x40\x0e\xf2\x8f\
\x55\x4c\xe4\x18\xc0\xb8\xc5\x36\x4e\xb2\x92\x69\x6c\x86\x26\x3b\
\xf9\xc9\x66\xf0\x83\x1f\x1e\xd3\x01\x19\x58\xf9\xca\x42\xc8\xb2\
\x96\xb5\xdc\xe3\x2e\x77\x59\xc8\x60\x0e\xb3\x3f\x96\x4c\x66\x32\
\x43\xf9\xcc\x4f\x96\xb2\x9a\xd5\x3c\x8a\x36\x5b\x06\xff\x05\x70\
\x46\x41\x07\xe6\x3c\xe7\x2b\xdb\xd9\xca\x5b\xce\x73\x96\xbd\xcc\
\x67\x3e\x83\x58\x20\x65\x66\x32\x9a\x07\xed\xe4\x35\x1b\xda\x0f\
\x6d\x4e\x74\x9b\x7d\xc1\x68\x5f\x58\x86\x06\x90\x7e\x81\xa4\xe3\
\x1c\x67\x3a\xd3\xf9\xce\x98\xd6\xb3\xa6\xf7\xdc\x67\x18\x0c\x24\
\x09\x84\x0e\x75\xa1\x0f\x7d\x68\x45\x27\xba\xd1\x8d\xd6\x86\xaa\
\xb5\xd1\x19\x1c\xb8\x1a\x07\x90\x8e\xb4\xa4\x5f\x40\xe9\x4a\x5b\
\xfa\xd2\x98\xce\xf4\xa6\xb7\x5c\x10\x51\x47\x99\xd4\xa4\x36\xb5\
\xa2\x51\x9d\xea\x55\x6b\x63\x1e\xc8\x26\x0d\x16\xb0\x60\x05\x2b\
\xbc\x1a\xd6\xb1\xa6\xc1\xac\x27\x5d\x6b\x38\xdf\xda\xd2\xb9\xce\
\xb6\x10\x10\x02\xec\x6e\x0b\x7b\xd8\xc4\x66\xb4\xb1\x55\x8d\xec\
\x72\xf7\x63\x36\x65\x58\x36\xb3\x9b\xfd\x6c\x68\xc7\x7a\xda\xd4\
\xae\xb6\x9c\xaf\x8d\xed\x2b\x7f\xf3\xde\xf8\xce\xb7\xbe\x55\x68\
\xcd\x7d\xef\x84\x00\xfe\xc8\xc2\x11\x7e\x01\x70\xec\x4d\xc5\x3a\
\xec\x38\x86\x3f\x68\x81\x4d\x1e\xe2\x20\x18\xe7\x80\x87\x18\x5a\
\xd0\x83\x5c\xfc\x01\x2c\x6b\x80\x01\x21\xc6\xb1\x8c\x0e\x38\x22\
\x0f\x39\x50\x91\x06\x69\x20\x88\x20\x88\x41\x0c\x57\xff\x58\xc2\
\x06\x22\xe0\x8a\x56\x3c\x29\x2a\x6b\x58\xc6\x37\x90\xd1\x0c\x6c\
\x7c\x63\x1c\x89\xd8\x46\x29\x46\x6e\x08\x43\xa0\x3c\xe5\x1b\xf8\
\xc0\x04\x22\x80\x81\x5d\x48\x65\x0d\xdb\xe8\x04\x2b\x76\x31\x0d\
\x9a\xdb\x9c\xe3\x5f\x10\xb9\xef\x68\xe0\xf3\x2b\x00\xfd\x03\x42\
\x8f\x80\x09\x30\x70\x8e\x60\x20\x65\x0d\xd8\x00\x44\x23\x3a\x61\
\x8a\xa5\x23\xc3\xe9\x37\xcf\x02\xf4\x68\x70\xf2\x94\xab\x3c\xeb\
\x44\xbf\xc0\x09\x5a\x60\x07\x3e\x40\x45\x27\x6b\x40\x06\x19\xf0\
\xc0\x87\xb1\x97\x9d\xe9\x4e\xc7\x46\x34\x72\xf1\xf2\xb5\xb1\xdd\
\xea\x2a\x0f\xfa\xd0\xb7\x2e\xf7\x16\xe8\x20\x08\xe7\xa0\x03\x4f\
\x40\xc1\x0a\x1e\x6c\x61\xef\x7c\x10\xfb\xdf\x9b\x8e\x76\x21\x18\
\xfc\x64\x34\x40\xfc\xdb\x27\xb0\x78\x0c\x34\xfe\xf1\x55\xb0\x83\
\x37\x78\xd2\x0c\x16\x1c\xc1\xf2\x98\x17\x3b\xd9\x97\xde\xf4\x66\
\x34\x83\x1b\x15\xcd\x5a\xe8\x81\xae\xf8\xd2\x9f\x3e\x08\xa9\x5f\
\x84\x27\x14\xae\x93\x1b\x00\xc1\xf5\x96\xf7\x02\xdf\x65\xbf\xf9\
\xb3\xdf\x1e\x06\xd4\x04\xd8\x0b\xdc\x1e\x74\xb8\x33\x7e\xee\xa8\
\x8f\x83\xf0\x5d\xa1\x05\x9d\xdc\x41\x09\x37\x28\x02\xff\xf2\xb7\
\xa0\xfc\xcc\xfb\x9d\x15\xb4\xa7\x79\x33\xbe\x70\xb2\x17\x2c\x21\
\xf1\x42\x2f\xbd\xe9\xb1\x0f\xfc\x38\xd8\xc1\x13\xae\x10\xc6\x3a\
\x74\xd2\x8b\x28\x38\x21\xfc\x2c\x80\x04\xc9\x47\x06\xe6\x77\x7e\
\x80\x87\x0c\xe1\x40\x08\x50\x04\x25\xee\xf7\x76\xf1\xa7\x75\x18\
\x30\x7f\x8e\x57\x7f\x76\xb0\x08\xf9\x57\x0d\xed\xa0\x13\xad\x40\
\x05\x4a\xe0\x04\x40\x20\x7e\x02\x48\x7e\xb1\x67\x80\x80\xd7\x0c\
\x42\xc0\x23\xbb\x82\x02\xf0\x67\x7d\xa6\xf7\x7b\x55\x60\x7f\xc2\
\x27\x0c\xd5\x70\x0e\x19\x98\x13\xdb\x40\x05\x51\x00\x7e\x1f\x78\
\x04\x21\xe8\x05\x23\x38\x7b\xe9\xc7\x0d\x3b\xa7\x2a\x2a\x58\x7d\
\xa4\xa7\x75\x8c\xe7\x82\x30\x88\x7f\x33\x68\x0e\xad\xb0\x10\x2e\
\x10\x02\x33\xf0\x03\x4f\xc0\x05\x72\x10\x09\xb0\xb0\x10\x2f\xe0\
\x04\x38\xf8\x7f\x3b\xd8\x83\x3f\x68\x0a\x7f\xc7\x74\xd8\xd0\x01\
\xce\x44\x27\x28\xb0\x01\x46\xb8\x78\xd7\x47\x7f\x2f\x58\x81\xf8\
\x27\x83\xe6\xb0\x7f\x09\xc1\x04\x35\x10\x85\x53\x58\x85\x57\xa8\
\x0a\xcc\xd0\x0d\x09\x21\x02\x53\x30\x05\x1c\xe8\x85\xae\x07\x86\
\xcb\xd7\x08\xe7\x47\x7b\xeb\x87\x86\x6b\x18\x01\x10\xff\x38\x7f\
\x6e\xb8\x84\x17\x78\x0e\xe6\x50\x02\x09\xd1\x06\x76\xb8\x02\x25\
\x90\x87\x56\x18\x09\x7c\xd8\x0d\xf1\x90\x10\xa6\x40\x05\x53\x90\
\x83\xff\x27\x7e\x3c\x38\x80\x87\x98\x88\xbb\xb0\x0b\xe3\x10\x03\
\x81\xd0\x23\x69\x88\x75\x47\xf8\x88\x72\x17\x89\x76\x50\x81\x93\
\x58\x89\x09\x31\x07\x5a\x90\x89\x25\x60\x03\x54\xd8\x89\xaa\x00\
\x0b\xd6\xe0\x0e\xf7\x90\x10\x9f\xa0\x04\x38\xa8\x83\xa8\x68\x88\
\x99\xc7\x7c\x63\x38\x0d\xdb\xc6\x21\xb3\xf8\x80\x26\xb0\x75\x90\
\x38\x81\x2f\x28\x89\x72\x18\x02\x0a\xe1\x8b\x3d\x50\x03\x9a\x28\
\x8c\x7a\x18\x09\x99\x60\x8c\xee\x10\x8a\x08\xe1\x00\xc8\x20\x88\
\xfe\x67\x7c\xcf\xa8\x8a\x7c\x60\x7e\x9d\x00\x84\xae\x58\x55\xf8\
\x81\x02\x13\xf0\x80\x48\xd8\x82\x73\xc7\x8d\x6f\xb8\x7d\x32\x78\
\x0e\x2b\xa0\x10\x8f\xd0\x06\x5a\xd0\x03\x2e\x50\x8e\x3b\xa0\x87\
\x83\x90\x8e\xd6\x00\x8a\xf8\x90\x10\x6a\xf0\x09\x37\x30\x88\xf2\
\x58\x88\xf4\x58\x80\xf8\xb8\x0b\x2f\x10\x8b\xcd\xc1\x8f\xfe\x98\
\x8d\x00\xd9\x02\x02\xe9\x8d\x33\x78\x90\xe1\x88\x89\x0c\x19\x02\
\xc1\xf8\x90\x56\x18\x91\xb0\xd0\x87\xf1\x90\x8c\x0a\xff\x71\x83\
\xa6\xb8\x91\xa9\x28\x82\x78\xb0\x8a\x64\xf7\x77\xc8\xe0\x06\xcd\
\xd1\x01\xfd\x58\x8b\xda\x78\x01\x8d\x97\x92\x70\x38\x89\x2c\x19\
\x8e\xbf\x78\x87\x30\x69\x03\x32\x29\x07\x11\xf9\x89\xc8\xb8\x10\
\x67\xf0\x0d\x37\xb0\x93\xe2\xc7\x91\x3e\xb9\x7c\xb2\x07\x84\xdf\
\xd0\x01\xd1\x27\x1b\x46\x89\x94\x49\xb9\x94\xa8\x37\x90\x04\x59\
\x0d\x2e\xd0\x10\xbe\x68\x87\x51\x18\x93\x55\x08\x07\x57\xc9\x0c\
\xc7\xc8\x8e\x0b\x31\x09\x4e\xd0\x81\x3c\xd9\x93\x3e\x18\x7b\x63\
\x59\x76\x4b\xe7\x69\xbc\x91\x96\x43\xf7\x8f\x27\x39\x81\x14\xd8\
\x94\x32\x18\x97\x0d\xa1\x90\xe3\xb8\x02\x52\x48\x95\x77\x39\x08\
\x9e\xa8\x8e\x7c\xa9\x10\xcf\xd0\x0c\x3b\xf9\x81\x85\x08\x86\x84\
\x89\x88\x41\xc9\x0a\xdf\xe0\x06\x77\x37\x1a\x1d\x10\x01\x6a\x19\
\x81\xb7\x88\x92\x8f\xf7\x98\x6f\x29\x99\x93\xc9\x04\x95\x79\x99\
\x32\x89\x97\x9b\x39\x91\x9d\xa9\x10\x6b\x50\x07\x45\x00\x98\xa2\
\xc9\x83\xa4\xc9\x77\x1e\x29\x86\xe8\x47\x03\x0b\x68\x18\xad\xb9\
\x98\xb6\x18\x9b\x8e\xd9\x8d\x90\x29\x0c\x35\x80\x11\xbf\xc8\x90\
\x96\x39\x03\x98\xc9\x05\xbc\x59\x8c\x7d\xe8\x0e\x18\xff\xc1\x0d\
\xa1\x39\x8f\x03\x88\x79\x1e\x39\x7b\xcd\x20\x79\xac\xe9\x9a\x8e\
\x68\x92\x00\x19\x90\xb3\x49\x9d\xc2\x17\x87\xd7\x89\x9d\xb8\xd9\
\x90\x9b\xd8\x9d\x70\x70\x85\xe9\x18\x9e\x18\x71\x0a\xd1\xc0\x02\
\xff\xc7\x93\x02\x78\x9e\xc8\x09\x08\x85\x69\x0a\xc8\x40\x03\xcf\
\xc0\x19\xcf\xf9\x9e\x6b\x79\x02\xf2\x19\x04\xf5\x07\x83\x04\x79\
\x9f\xf8\x79\x87\x9a\xc8\x9d\xbb\xe9\x9f\x35\x79\x8c\x1a\xe1\x97\
\x5e\x58\x04\xe6\x29\x82\xe8\xa9\xa0\xa6\xa9\x9c\x43\x60\x19\xad\
\xe9\x88\x8c\xa9\x94\x14\x2a\x9b\x16\x4a\x9f\x04\xd9\x03\x1b\xb1\
\x90\x52\xb9\x89\x3f\xf0\xa1\xe8\xc8\x87\x13\xa9\x11\xa7\x80\x0d\
\x37\x50\xa2\x2c\xc0\x91\x08\x2a\x96\xa6\x49\x76\xcd\x30\x04\x6a\
\xe0\x18\x2f\x2a\xa1\xb0\x29\x9d\xf3\xf9\x86\x4d\xe9\x0a\x38\xba\
\x11\xb8\xb9\xa3\x53\xe8\xa3\x99\x50\x8c\x41\xba\x11\x7f\x50\x04\
\x46\x8a\xa4\x28\xfa\x93\xd1\xb8\xa4\x62\xf8\x02\x0d\x67\x17\x51\
\x0a\x9f\xf1\x49\xa3\xc0\x67\xa5\xdb\x87\xa5\x1d\xb1\xa5\x96\xc9\
\xa3\x1f\x7a\x95\xc6\xe8\x87\x1b\x41\x00\xe3\x50\xa0\xa2\x69\xa6\
\x83\x89\xa6\x2a\x3a\x76\x4c\x4a\x94\x7e\xf1\xa6\x6b\xff\x49\xa5\
\x35\x4a\xa7\x9e\x80\x7f\x59\xca\x11\xf9\x99\xa7\x5d\x7a\x97\x56\
\xf9\xa5\x35\xe9\xa7\x1b\xb1\x0a\x93\x70\x04\x37\x10\x98\x07\x4a\
\x7e\x3e\x88\xa6\x69\x7a\x7e\x56\x70\x96\x60\xd1\x01\x26\x20\xa5\
\x2d\xe8\xa8\x73\x6a\x7f\x15\xb8\x7d\x93\x4a\xa9\x1c\x3a\x95\x3d\
\xfa\x04\x61\xd0\x9f\x9a\x09\x9e\xd6\x70\x12\xad\xe0\x85\xc5\x99\
\x8a\xc9\x57\xaa\x09\x2a\x76\x88\xca\x0a\x31\x40\x17\xac\xea\xaa\
\x32\x3a\xa3\xd3\x69\xa3\xf8\xc7\x04\x28\x31\x8e\x0d\x89\xab\x0f\
\xb9\xab\x56\xb9\x99\x7a\x79\x12\x67\xc0\x0d\x45\x20\x8f\xa8\x48\
\xac\xa4\xba\x77\xc7\xba\xa4\xcd\x80\x02\x0f\xba\xaa\xad\x9a\x8d\
\x13\x0a\xad\x55\x1a\x07\x18\x3a\xad\x29\x61\xad\x79\x2a\x8c\xd9\
\xca\xab\xe8\x18\xa2\x29\x31\xa6\xe2\xea\x7a\xe4\xea\x05\x85\x5a\
\x8f\x87\x7a\x8f\xa6\xd0\x01\x5d\x00\x16\xed\xaa\x8d\x71\xea\x78\
\xf1\x2a\xab\xf5\x49\xad\xf5\xca\xa1\xfb\x99\xab\xda\xaa\x99\x9a\
\xfa\xab\x28\x41\x09\xe3\x10\xaa\x83\x6a\x9c\x3c\x50\xac\x64\x90\
\xa2\xc8\x3a\x76\xcd\x10\x44\x47\xc1\x98\x0d\xab\x03\x0f\x9b\x8b\
\x11\xbb\x12\xf6\x5a\xb1\xf9\xba\xad\x9a\xca\x0c\x2a\xff\x31\x00\
\x7f\xc0\x03\x40\xf0\xb1\x48\x30\xaa\x02\x3b\xb2\x86\x5a\xb0\x79\
\xf0\x15\xdd\x00\xa7\xcf\x2a\x9b\x2d\x3b\xab\x9e\x20\xb1\x2a\xa1\
\x9d\x30\xc9\x9d\x16\x3b\x93\x3f\x5a\x93\x2c\xb1\x0c\xc6\xc7\xb3\
\x3e\x5b\xa8\xe7\xda\x08\xe3\xf0\x15\x8b\xd0\xa8\xf0\x9a\xb4\x8b\
\x20\x7c\x4c\xab\x12\xb7\x2a\xb3\xba\x2a\xb5\x35\xcb\x12\xa1\x10\
\x0d\x47\xf0\x81\x5f\x09\xb2\x22\x6b\xae\x04\x8b\xac\x5f\x41\x0f\
\x53\x4a\xa5\x55\x4a\xa7\xc2\xd7\x7d\x38\x71\xb6\x50\x9b\xad\x56\
\xe8\x9f\xe0\x99\x13\x89\x50\x04\x70\x0b\xb0\x3d\x1b\xb2\xe5\x4a\
\xb7\x69\xfa\x15\x9e\xf0\xaa\x61\xfb\xa8\x7c\xeb\x09\x7e\xfb\xb7\
\xd7\x8a\xb6\x61\xe0\x9d\x99\x5a\xb8\x38\x31\x0b\xdc\xb0\xb3\x26\
\xaa\xb8\x59\x0b\xb4\xc7\xfa\x15\x45\xa0\x94\x7a\x2b\xb6\x96\xbb\
\x13\x80\x8b\xaf\x69\xab\xaf\xe9\x98\x85\x3a\x51\x06\x48\x90\xb8\
\x47\x00\xb2\x5b\xd0\xb8\xa6\x4a\x03\x60\x71\x8b\xf2\xc9\xb2\x8f\
\x2a\xaf\x2e\xbb\x08\x97\x9b\x13\xaf\x1b\xb5\xb2\x5b\x8c\x3b\xb1\
\x06\xd1\x20\xba\x47\x9a\xbb\x8b\xbb\xbb\x3f\x4b\xb7\x6a\x21\x0b\
\x55\x10\xbc\x62\x6b\xbc\x45\xe1\x02\x99\x1b\xb8\xb1\xff\x4b\xb3\
\xcc\xbb\x13\xbf\x30\x09\x3a\x1b\xb7\xe4\xca\xbb\xdf\xb0\x16\xb0\
\x80\xb4\xdb\x7b\xbc\x3a\xd1\x90\x96\x0a\xbb\x9b\xbb\xbc\xb4\xcb\
\x13\x93\x90\xb8\x8a\xcb\xb8\xe5\x8a\x0d\x6d\xea\x15\x29\x30\x08\
\x55\x20\xbc\xb1\x0a\xb1\xdc\x6b\x14\x99\xab\xb9\x9c\x8b\xb1\xe3\
\xcb\x13\x88\xb0\x0d\x47\x30\xba\xfb\x6b\x79\xe4\xe7\xbf\x75\x21\
\x0a\x16\x5a\xc0\xc5\x0b\xbf\x3b\xf1\xbd\xe0\x5b\xbf\xe2\x7b\xbf\
\x45\x61\x05\x48\x20\xc1\x72\xbb\x05\xc8\xf0\xbf\x6a\x01\x05\x4f\
\xa0\xc1\x2e\xdb\x06\x51\xf1\xbd\x36\x40\xbf\x0b\x3c\xb5\x48\xc1\
\x01\xcf\x6b\xc2\x8b\x3b\x0d\x2a\xbc\x16\x04\xf0\x06\x35\xb0\x08\
\xf2\x7a\x0e\x76\x70\x03\x30\x1c\xc3\xf3\xfb\x03\xca\x1b\xc2\x51\
\xc1\x01\x58\x50\x79\x45\x80\x04\x64\x70\x04\x38\xb0\x0b\x3d\xcc\
\x16\xe0\x11\x0c\xfa\xf0\x08\xb1\xc0\x07\x5e\x21\xc3\x4a\x2c\xb8\
\xb2\xfb\xa5\x5e\x01\x0d\xe1\xd0\x0c\xf5\x60\x05\xfe\x70\xc5\x7e\
\xb1\x0a\x73\x12\xbf\x49\xbc\x03\x62\xbc\xad\x3f\x0a\x16\xc4\x97\
\x40\x2b\x10\xc7\x73\x3c\x08\x0c\xec\x6f\x1b\x91\xc7\x4f\x8b\xaf\
\x73\x2c\xbe\x7e\xac\x11\x96\x19\xc8\x3d\x3a\xc8\x7d\xaf\x5c\xc8\
\x18\x91\xa7\x32\xab\xc8\x75\xcc\xc8\x17\xe1\xc8\x81\x0b\xc9\x64\
\x2c\xc9\x16\x41\xc9\x82\x1c\xbe\x84\x8c\xc9\x0d\xa1\xc9\x89\x1c\
\xbb\x63\xec\xc9\x9f\xfc\xb4\x95\x2c\xca\x34\x9b\x09\xa4\xcc\x10\
\x96\x7a\xca\xf5\xab\xaf\xe8\xb8\xca\x0b\xd1\xca\x9b\xfc\xca\x74\
\xac\xca\xb2\x9c\x10\x21\x60\xca\xb5\xec\x9d\xbc\x8a\xb1\xb9\xac\
\xcb\x81\xdc\xcb\x0b\x0c\xcc\xc1\x7c\x10\xbb\xbc\x9f\xc4\xfc\xcb\
\xb1\x7c\xcc\x06\x01\x93\xca\x1c\xca\x9b\x5b\xcc\xcd\xec\xcc\x04\
\x01\xcd\xdc\xb9\xcc\x72\x40\xb3\xd6\x6c\x10\x25\x10\xcd\x0f\x99\
\xb6\x9c\xbb\xad\xdd\xec\xcd\xe0\xfc\x04\xe2\xdc\x9f\xe4\x5c\xce\
\x05\x51\xb1\xb9\x9a\xce\xdb\x3c\x08\xec\x7c\x10\x50\xfb\xce\xd3\
\xac\xce\xf3\x9c\x10\x61\x8c\xce\xf7\x3c\x26\x01\x01\x00\x21\xf9\
\x04\x05\x0a\x00\xff\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\
\x08\x04\x00\xff\x05\x04\x00\x3b\
\x00\x00\x06\x61\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x06\x28\x49\x44\x41\x54\x58\x85\xb5\x97\xdf\x6f\x54\xc7\
\x15\xc7\x3f\x33\x3b\x7b\xf7\xfa\x7a\x0d\x66\x6d\x63\xaf\x1d\x9c\
\x18\xc5\x98\x46\x2a\x24\xa1\x84\x52\x70\xdd\x14\x12\x64\x90\x50\
\x79\x68\x24\x4b\x95\x12\x50\xd5\x2a\x52\xa3\x52\x45\x95\xda\x3f\
\xa2\x95\x2a\xa5\x12\xa2\xea\x0b\x8d\x44\x95\x97\x24\x0a\x20\xd2\
\x2a\x0a\x7d\x68\x70\x78\x70\x6d\x6a\xb5\xc1\x05\x6c\x60\x0d\x36\
\xd8\xde\x65\xd7\xbb\x7b\xf7\xde\x3b\x33\x7d\x70\xfc\x0b\x0c\xfe\
\x51\xf7\x48\x57\xba\xbb\x67\x66\x3e\xdf\x39\x67\x7e\x9c\x2b\x58\
\xc6\x4e\x9f\xfe\xb8\x29\x9d\x4e\xf5\x7b\x9e\xeb\x2e\xd7\x76\xa1\
\xdd\xbe\x3d\x3a\x70\xfc\xf8\x0f\xbe\x07\xd8\xa7\xb5\x53\xcb\x0d\
\x14\x45\xe1\xd6\x9d\x3b\xdb\x1b\xb7\x6c\x69\x7c\x6a\x3b\x6b\xc1\
\x62\xb1\x16\xa4\x10\x7c\xfe\xb9\xdd\x05\xd4\x02\xd9\xff\x49\xc0\
\x4a\x4c\x1b\x8b\x31\x16\x6d\x2d\xda\x58\x1c\x15\x5b\x71\x5f\xb9\
\x5c\x83\x28\x0a\xb1\xf6\xc9\x51\x7c\x14\x6e\x0c\x58\x6b\xd1\x5a\
\xaf\x8f\x80\x20\x08\x30\xc6\xac\x10\x6e\xd1\xc6\x60\xe1\xff\x2f\
\x60\x69\xf8\xcc\x6f\xac\x45\xeb\x68\xbd\x04\x54\x1e\x13\xf0\x34\
\xf8\xec\x7b\x14\xad\x93\x80\x30\x0c\xb0\x76\x5e\xc0\x72\xf0\x20\
\xd4\xab\x8a\xc0\xb2\xbb\x60\x36\x02\xf6\x11\xf8\x2c\xd8\x3c\x02\
\x37\x5a\x63\xed\x3a\x45\xa0\xbb\xbb\x3b\x9e\xc9\x0c\x75\x1b\x63\
\x31\x76\x65\x70\xad\xcd\xac\x00\xb5\x77\xef\xde\xef\xac\x29\x02\
\x87\x0f\x1f\x7e\x0e\xd8\xa9\xb5\x7e\xf3\xe5\x97\x77\x1c\x33\xc6\
\x60\x0d\x2b\x82\x9b\x68\x26\x02\x52\x8a\x44\x67\x67\xe7\x27\x89\
\x44\xe2\xb7\x9e\xe7\x9d\x07\x7a\x2f\x5c\xb8\x50\x7e\xa2\x80\x23\
\x47\x8e\x74\x68\xad\x7f\xb7\x7b\xf7\xde\xd7\x76\xef\xfe\xb6\x6c\
\x6e\x7e\x06\xcf\xf3\xb8\x74\xe9\xaf\x58\x6b\x30\xac\x0c\x3e\x93\
\x02\xf0\x7d\x9f\x37\xde\xe8\x11\x6f\xbd\xf5\xf6\xbb\xb9\x5c\xee\
\xdd\xe1\xe1\xeb\xb4\xb7\x77\xdc\xbb\x7a\xb5\xff\x23\xcf\xf3\x7e\
\x7d\xfe\xfc\xf9\x87\x73\x02\xba\xbb\xbb\x7f\xdc\xd3\xf3\xe6\x1f\
\xf6\xed\xeb\x44\xca\xf9\xac\x48\x29\xc8\xe5\x72\x18\x63\xf0\x03\
\x43\xa1\x1c\x51\xaa\x68\x4a\x81\xa6\x5c\xd1\xe4\x4b\x11\x12\x43\
\x5c\x42\x5c\x58\xe2\xd2\xa2\xa4\x25\x15\x69\xb4\xd6\xe4\xf3\x39\
\x1a\x1a\x9a\xa9\xae\xf6\x68\x69\x69\x66\xff\xfe\xef\xa6\xcb\x65\
\xff\xed\xf7\xdf\xff\xe3\x89\x4c\x26\xb3\x63\x60\x60\x60\x48\x1d\
\x3d\x7a\xb4\xa6\xad\xed\xf9\xdf\x77\x75\xbd\xfa\x58\x2a\x1c\x47\
\x91\x15\x9b\xb9\x1b\xd5\x31\x79\x3d\x47\x22\x2e\x49\x28\x49\x22\
\x2e\x48\x55\x2b\x9a\x6b\x1d\x22\x63\x09\x42\x43\x10\x59\x2a\x91\
\xa1\x14\x59\xfa\x6f\x97\xd9\xb8\xbd\x8b\x89\x7b\x97\xd9\xb4\xa9\
\x80\x94\x02\x29\x25\x42\x08\xa4\x14\xf4\xf4\x1c\x4f\xf4\xf6\x7e\
\x71\x0a\x38\xa0\x8c\x31\xaf\x9f\x38\xf1\x13\x27\x16\x13\x4b\xac\
\x06\x43\xaa\xb5\x83\xf6\xb6\xd4\x92\x0b\x28\x64\xe6\xaa\x33\x0a\
\xa4\x85\x84\xb5\xc4\x2d\x54\x59\xa8\x69\x80\x4b\x83\x21\xed\xcf\
\x5b\xa2\xc8\x70\x2f\x77\x9f\x1b\xe1\x5d\xf6\x37\x7c\x13\x80\xae\
\xae\x83\x9d\x03\x03\x03\x4d\xca\x5a\xfb\x5a\x7d\x7d\x1d\xb1\xd8\
\xe3\x1b\x22\x9f\xcf\x62\x36\xb5\x30\x94\x5f\xec\x8b\x8c\x25\x1f\
\x42\x21\x80\x7c\x60\xd1\x73\x57\xc5\xe2\x49\xdc\x2a\x6d\xe0\x58\
\xb2\x0a\xdf\x0f\x88\xb9\x92\xec\xbd\x02\x4e\xcb\xcc\xb2\xdb\xb7\
\xaf\x4b\x7d\xf8\xe1\x07\x07\x94\x94\xf2\x99\x78\x3c\x8e\x58\xd0\
\xd7\x18\x8b\xef\x57\x98\x9a\x9a\xa4\xec\xbd\xc0\x8d\xc2\x8c\xd3\
\x8f\xe0\x46\xde\x92\x99\x16\x0b\x2e\xf9\xa5\x22\x37\x63\x65\xbd\
\x19\xd7\x8d\xa3\xb5\xa1\xad\x2e\x4d\x5b\x5d\x7a\xce\x97\x4a\x6d\
\xc2\x71\x9c\x56\x95\x4a\xa5\x1a\x95\x9a\x9f\x61\x18\x46\x94\x4a\
\x15\xac\xb5\xdc\x1c\x2f\x52\x48\x79\xe4\x1e\xc2\x3f\xa7\xe0\xab\
\x2c\x68\xfb\x64\xe0\xa3\x16\xb7\x4d\x04\x41\x19\xc7\x71\x1e\xf3\
\xc5\x62\x1e\xf1\x78\xbc\x5e\x81\xac\x0b\x82\x10\xd7\x4d\x10\x86\
\x11\x41\x10\x32\x2b\xe8\xef\x63\x2e\xd3\x09\xc1\x85\x61\xb8\x5f\
\x5a\x31\x77\xce\x44\x94\x62\x7a\x7a\x98\x54\xaa\x61\xb1\xb0\x78\
\x8c\x9b\x37\xc7\x50\x4a\xa5\x54\x10\x04\xf2\xcb\x2f\xbf\xc2\x75\
\x1d\x3a\x3a\x5a\xa8\xa9\xf1\x30\xc6\x22\x84\xe0\x76\x61\x23\xbd\
\x7d\x70\xbf\xb8\x7a\x38\x80\xc5\x63\xe0\x76\x91\x43\x4d\x69\x62\
\x31\x49\x10\x44\x8c\x8f\xe7\x18\x1d\x9d\x20\x93\x19\x41\x08\x11\
\x57\x4a\xc5\x1f\x02\xf8\x7e\xc0\xc0\xc0\x30\x00\xc9\x64\x15\x0d\
\x0d\xb5\xfc\xe8\x5b\x49\x9e\x1b\xce\x30\x9a\xd5\x8c\xe5\x2d\x53\
\xe5\x18\x85\xd0\xa1\xa4\x1d\xca\xc6\xa1\x62\x5d\x62\x68\x12\xa2\
\x42\x55\x2c\xa0\x5a\x05\x6c\x70\x02\xea\x3d\x4b\x7a\xa3\xa4\xa5\
\x56\xf2\x42\x5b\x33\x23\x23\xe3\x4c\x4c\xe4\x89\xa2\xf9\x1a\x41\
\x29\x85\xd6\x7a\x4a\x95\xcb\xc5\xb1\x58\x4c\xee\x10\x0b\x56\xa1\
\xef\x07\xdc\xb9\x73\x9f\x6a\xe0\x50\x03\x88\xcd\xe0\x79\x2e\x9e\
\x97\x20\x16\x2b\x13\x8b\x49\x5c\xd7\x41\x29\x01\x48\x2a\x95\x90\
\x20\x88\xd0\x5f\x9f\x88\xd3\xd3\x3e\xbe\x1f\x00\x30\x7e\x8b\x05\
\xd0\xf9\x52\x2d\x0c\x7d\xa2\x28\x9a\x50\xc6\xe8\x71\x63\x42\xaa\
\xab\x93\x73\xce\x42\xe1\x21\x7d\x7d\xbd\x6b\x8b\xfb\x12\x56\x55\
\xe5\xf1\xca\x2b\x9d\x8b\xfe\xab\x54\xca\x84\x61\xf8\x40\x01\xe3\
\x61\x58\xc6\x75\xe7\x0f\x9b\x07\x0f\xf2\x7c\xf6\xd9\xb9\x75\x13\
\xd0\xd0\xd0\xc8\xfe\xfd\xaf\x2e\x3a\xe6\x2b\x95\x22\x95\x4a\x65\
\x4c\x09\x21\x86\x2a\x95\x12\xae\x3b\xbf\x55\x84\x80\xda\xda\x5a\
\x5c\xd7\xe5\xe4\xc9\x93\x2c\x4c\xcf\x6a\x6c\x74\x74\x94\x33\x67\
\xce\xb0\x61\xc3\x06\x84\xd0\xb8\x0b\x3e\x2d\x8a\xc5\x82\xce\x64\
\x32\x43\xca\x71\x9c\xbf\x8c\x8e\x8e\xf0\xd2\x4b\xbb\xe6\x9c\xf5\
\xf5\x29\x0e\x1e\x7c\x9d\x74\xba\x85\x74\x3a\xbd\xd4\xd8\xcb\x9a\
\xb5\xb0\x65\xcb\x16\xae\x5d\x1b\xa6\xb1\xb1\x9e\x64\xd2\x25\x91\
\x98\x11\xa0\x75\xc4\xc8\xc8\xf5\x5b\x93\x93\x93\x77\xd4\xd9\xb3\
\x67\x6f\xb9\x6e\xd5\x7f\x8e\x1d\xfb\x61\xfb\xec\x81\xb1\x6d\xdb\
\x76\x6a\x6b\x1b\x49\xa7\x53\xa4\xd3\x75\x6b\x82\x6b\x6d\x90\x52\
\x70\xe0\x40\x37\xcd\xcd\x8d\x28\x25\x99\xad\xee\x07\x07\xaf\x72\
\xf7\xee\xdd\xbf\x01\xd3\x12\x20\x9b\x9d\xfa\xc5\xc5\x8b\x9f\x44\
\x53\x53\x93\x73\x83\x64\xb3\xf9\x35\xc2\xed\xd7\xbb\x41\x13\x86\
\x11\xdb\xb6\xb5\x32\x32\x72\x07\x10\xe4\x72\x59\x06\x07\xaf\xf2\
\xe9\xa7\xe7\xff\x75\xe5\xca\x95\xdf\x00\x7a\x2e\xb9\xc9\x64\xd2\
\xdd\xb3\x67\xcf\x4f\x95\x52\x5b\x9b\x9a\x5a\x3a\xde\x79\xe7\x97\
\x87\x76\xed\xda\xbe\x06\xb8\x59\xf0\x68\xaa\xab\xab\x38\x75\xea\
\x4f\xa5\x73\xe7\xfe\xfc\x91\xef\xfb\x23\xfd\xfd\xfd\x17\xb3\xd9\
\xec\xbf\x81\x49\x9e\xf4\xdd\xf8\xde\x7b\x1f\xfc\x2a\x9f\x2f\xda\
\xd5\x98\x31\xc6\x86\x61\x64\x7d\x3f\xb0\xc5\xa2\x6f\xf3\xf9\xa2\
\xcd\x66\x0b\xb6\x58\xf4\xed\xe5\xcb\xff\xb0\x5d\x5d\xdd\xdf\x5f\
\x8a\xb5\x64\x51\xfa\xec\xb3\x4d\x3f\xab\xa9\xf1\x56\x39\x7b\xe6\
\x0a\x0e\xa5\x24\x8e\xa3\x48\x24\x1c\xa4\x14\xbc\xf8\xe2\x37\x68\
\x6d\xdd\xfa\xf3\xa5\xfa\x3d\x56\x94\x9e\x3e\xfd\x71\x52\x08\xd9\
\xd8\xd7\x77\x6d\xd5\x02\xb4\x8e\x88\xa2\x88\x28\x0a\x17\xbc\xcf\
\x3c\x35\x35\xd5\xdb\x81\x2a\x60\x51\x61\xfa\x5f\x15\x59\xfb\x56\
\x1b\x1f\x81\x0d\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\
\x00\x00\x07\xa0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x12\x00\x00\
\x0b\x12\x01\xd2\xdd\x7e\xfc\x00\x00\x00\x07\x74\x49\x4d\x45\x07\
\xd3\x08\x1c\x13\x19\x0c\xfe\x17\x9f\xdd\x00\x00\x07\x2d\x49\x44\
\x41\x54\x78\xda\xc5\x97\x7f\x6c\x55\x67\x19\xc7\x3f\xe7\xdc\xdb\
\xdb\xde\xb6\xb7\x40\xa1\x80\x48\x87\x65\x8b\xc2\x0a\xad\x74\x73\
\xb0\x61\x1d\xc3\x65\x03\x2d\x6e\x66\x31\x04\xd0\x88\x26\x1a\xb3\
\xd6\x68\x62\x98\x46\x67\x4c\xa7\x38\x05\x9c\x5b\x06\x99\x3f\xc3\
\x1f\xca\xfc\xc3\x2c\x66\x9b\x19\xe2\xc6\xac\x94\xe2\xa0\x63\xd8\
\x0a\xf2\x63\xfc\x6c\x7b\x29\xed\x2d\xed\xfd\x7d\x7e\xbc\xbf\xfc\
\xe3\xdc\x5b\xa8\xa3\x22\x3a\xe5\x4d\xde\x9c\xf7\x9c\x93\xf3\x3e\
\xdf\xe7\xfb\x7c\x9f\xe7\x3c\xaf\x65\x8c\xe1\x66\x0e\x9b\x9b\x3c\
\xc2\x00\x96\x65\xbd\x2b\x9b\x3d\xbe\xf9\xe5\xba\x10\x25\x3b\x1d\
\xdf\xeb\xda\xd2\xfe\xd0\x77\x01\x1f\xd0\xff\x17\x06\xda\x7f\xb8\
\xa7\xbd\xa2\xbc\xe2\x6c\xcb\xc7\x1a\xee\xad\xac\xac\xf8\xe6\x9a\
\x47\x1e\x5b\x09\x44\x01\xeb\xba\x0c\xfc\x57\x86\xb7\xfc\x61\x09\
\x58\x3b\xeb\xe6\xcd\x68\xfc\xc4\xaa\xc5\x94\x46\xc2\x94\x46\x42\
\x24\x46\x92\x4f\x03\x2b\x0b\x2c\x88\x49\x37\xf8\x4f\x45\xf8\xe4\
\x8f\xf7\x4e\xdd\xfc\xa3\x57\xdb\xb7\x6d\xef\x30\x67\xce\x8d\x19\
\x21\x8c\xb9\x7c\xd9\x33\xc3\xc3\x79\x63\x8c\x31\xcf\xed\x3c\x68\
\xd6\x7d\xee\xe9\xad\x40\xf5\xbf\x62\xda\x32\xc6\x50\xb1\xb6\xb3\
\xc3\x28\x65\x1b\x6d\x2c\x8c\x09\x40\x99\x2b\xe0\x8c\x36\x68\x6f\
\xe4\xfb\xea\xb5\xf5\x7b\x01\xf1\xe4\x53\x7f\x5c\x61\xb0\x77\x2e\
\x78\xff\xec\x79\x6b\x56\xd5\xe3\x7b\x1a\x21\x14\x4a\x19\x94\x52\
\xd8\xb6\x45\x69\x59\x09\x4f\x6c\xd9\x93\xdd\xf7\xfa\xf3\x2d\x07\
\xf7\xef\xea\x06\x1c\xc0\x5c\x33\x04\xf7\x2e\xaa\xbe\xf7\xa5\x6f\
\xd7\x93\x04\xa4\x02\x57\x81\x27\xc1\x2f\xac\xf7\x1c\x4c\xb3\xed\
\x17\x7f\x7d\x25\xbc\xfa\xd7\xed\x5f\x5b\x39\xbd\x66\xda\xb4\xd8\
\xa3\x0f\xae\x5c\xc8\x2d\x73\xa7\xe0\xba\x1a\xad\x27\xee\x2b\xa5\
\xa6\xdc\xb6\xb9\x7f\xc5\x82\xca\xc4\xc8\xea\xa7\x0e\xee\xdf\xd5\
\x52\x08\x83\xb8\x26\x00\x63\x20\x0d\x0c\xe4\x41\xea\x60\x0a\x19\
\x5c\x7d\x05\x4b\x1a\xaa\xd8\xb4\xbe\x8e\xfc\x69\xf5\x9d\xe5\xcb\
\xdf\xc7\x87\x97\xd6\x61\x0c\x48\x39\x79\x88\xc6\xc6\x72\x3c\x70\
\xdf\x7c\x0e\xbd\xd5\xdf\xb4\xa8\xe5\x27\x5b\x8f\x9e\x3c\xb3\x8d\
\xb7\xb7\x1e\x05\xd4\xd5\x4c\x84\x29\x22\x98\x64\x68\x01\x17\xdf\
\x3c\xce\xec\x6c\x9a\x96\x8d\x4b\x99\x55\x53\x8e\x31\xa0\xf5\xf5\
\x75\x32\x32\xe2\xf2\xe9\x4f\x35\x71\xf2\xdc\xe8\x86\x93\x43\x3a\
\x25\xe0\x71\x20\x03\xc8\x09\x00\xb4\x01\x75\x0d\x0c\xe9\xc1\x0c\
\x7d\x87\x7a\xb9\xbb\x69\x1e\x77\x2e\x59\x78\xc3\x42\xf5\x7d\xc9\
\x9c\xd9\x31\x1e\x7a\xf0\x03\xa4\x92\xc3\x75\x2f\x77\x33\xad\xa0\
\x85\x89\x00\x8c\x36\x13\x00\x48\x1f\xce\xec\x3f\x4a\x54\xfb\x6c\
\x5c\xbb\x94\x58\xe5\x8d\x65\xeb\xb1\x0b\x59\x7e\xdf\x3d\x02\xda\
\x60\x85\x2c\x22\xe1\x10\x7d\x62\xf6\xea\x92\x65\x3f\x7f\x42\xe8\
\xe8\x45\x08\x8b\xc0\x6b\xd1\x13\x30\x50\x88\xfb\x38\xf2\x9c\xc4\
\x4f\xa5\xd8\xf8\xd9\xe5\x37\xec\xf5\xd1\x0b\x39\x1e\xfe\x5e\x0f\
\x1f\x5c\x30\x83\xdb\xde\x3b\x25\xd0\x89\x67\x68\x5c\xb6\x88\x5b\
\x17\x79\x1b\x94\x21\x69\x8c\x31\x7b\xff\xd2\x17\xcb\x5d\x1a\xfc\
\x55\x18\x40\x99\x89\x0c\x94\x4f\x0b\x13\xa9\xae\xa6\xfb\xc8\x00\
\x1f\x5a\x32\xf7\xdf\x36\x9e\xca\x09\xbe\xfc\xdc\x09\x9a\x9b\xe6\
\xf0\xe8\xba\x7a\x4e\x0e\x05\x22\x06\x88\x94\xc0\xd0\xb0\xcf\xd0\
\x58\xde\x73\x32\xee\xa5\x5c\xfe\xcc\x62\xb2\x27\x4e\x4c\xaa\x81\
\x3d\xe7\x4b\xd9\xf2\xd2\x59\xe6\xd5\x26\x31\x06\x8c\x0a\xea\x83\
\xd1\xba\x10\x32\x83\xd1\x66\xfc\xb9\xd6\x86\xbe\xa1\x3c\x8d\x0b\
\x6a\x68\xdd\x50\xcf\x0b\x47\x60\x34\x17\xec\x0d\x60\xdb\x10\x0e\
\x45\x38\x70\xe8\xe2\xac\x81\x3f\xf7\x6a\x2a\x84\xcd\x99\xad\x5d\
\x85\x10\x68\xa4\xba\x62\x7c\x70\x04\x5e\xdc\x17\x67\xd7\xa6\x46\
\x2a\x4b\x0c\xb1\x58\x29\x52\x81\xc4\x20\x34\x48\x65\x90\x12\x84\
\x32\x28\x0d\x42\x81\x94\x86\x68\x69\x09\x53\xa7\x97\xf1\x62\x0f\
\x64\xdc\x2b\xc6\x2d\x2b\x60\xe0\xd4\x1b\x17\x18\x3c\x70\x42\x13\
\xd6\x53\xf1\x47\x0e\x00\xfe\xb8\x06\xae\x66\xa0\xeb\xc8\x30\x8b\
\xeb\x62\xb4\xdc\x35\x85\xb3\xe7\xd3\x4c\xad\x2e\xa1\xa2\x2a\x4c\
\x06\x48\x0b\xc8\xe4\x21\xed\x04\x33\x97\x87\x8c\x03\x29\x01\x99\
\x31\xc8\xc4\x03\xe3\xa2\xe0\x90\x72\x05\xc9\xf8\x18\xc7\xf6\x9f\
\x62\x74\x38\xed\x90\xf5\x87\x98\x2a\xdf\x43\xf6\x5c\x17\xe0\x14\
\x00\x04\x9e\x14\x2b\xf6\x0b\xaf\xf6\xd1\xbe\x7e\x3e\x2e\x10\xad\
\xa9\xe2\xec\x85\x04\xb7\xdd\x5e\x83\x67\xc0\x17\xe0\x0a\x48\xa6\
\x21\x9e\x30\x8c\x65\x34\xfd\x83\x1e\xc9\xb4\x26\x95\x51\x64\xb2\
\x12\x37\xef\x23\x5c\x0f\x99\xc9\x31\x1a\x1f\x65\x74\x2c\x8f\x72\
\x44\x0a\x57\x24\x08\x99\x30\xb6\x29\x25\x75\xb0\x1b\xc8\x17\x44\
\x08\xb2\xc0\xc0\xdb\x7d\x92\xc1\x44\x9e\x96\x65\xd5\x78\x1a\x74\
\x04\xa8\x9a\xc2\xb1\xb3\x19\xaa\x67\xc5\x38\x1d\x87\xfe\x21\x4d\
\x32\xad\x48\xa6\x15\xa9\x8c\x22\x99\x51\xa4\x52\x92\xd1\xb4\x22\
\x97\xf5\x90\x8e\x8f\xcc\xe5\x19\x19\xbc\x8c\x92\x1a\x65\x97\x81\
\xf0\x83\x0a\x58\x4a\x05\x32\x7f\x9a\xd1\x8e\x3e\x20\x6f\x8f\x33\
\x50\x00\xb0\xbb\x33\x4e\xcb\xd2\x1a\xca\x23\x20\x0c\x78\x80\x28\
\x8f\x70\x6a\x18\xba\x4f\x18\x86\xc7\xc0\x13\x06\x5f\x04\x5a\x10\
\xca\x20\x04\xf8\x32\x58\x1b\x03\xe9\xb4\xc3\xa5\x44\x16\x1d\x89\
\x62\x55\x54\xe2\x7c\xf1\x33\xe3\xe1\x9d\x53\xa3\x2b\xf1\x2f\xf7\
\x10\x6c\xed\xda\xc5\x2c\x28\xd6\x81\x7d\x87\x87\x58\xb3\x74\x26\
\x1e\x90\xf1\xa1\x6f\x14\xe2\x49\xd0\x91\x18\x43\x89\x1c\xbe\x08\
\x0c\x4a\x05\xbe\x04\x21\x02\x31\x4a\x6d\x91\x77\x14\xf1\x78\x9a\
\xac\x67\x08\x57\xc6\xb0\xc2\x61\x92\x6b\x1f\xa1\xac\xb5\x06\xe7\
\xb1\xd6\x6a\x80\x8b\x69\x15\x25\xd9\xf5\x0a\x90\xbf\x4a\x84\x06\
\xa9\xa1\xef\x82\x24\x9f\xf3\xf9\xf8\xdd\xd3\x19\xc8\xc2\x40\x16\
\x72\x7e\xf0\xd3\x31\x36\x48\x2b\xc4\x68\xca\xc5\xb2\x23\xf8\xd2\
\x20\xa5\x09\x32\x40\xc1\x60\x22\xc7\x50\xc2\xc3\x8a\x96\x93\xbc\
\xff\x23\x00\x4c\xfb\xed\xef\x0a\x7e\xdf\x09\xec\x86\x52\x53\xe1\
\x7c\x69\x13\xc0\x2f\xa3\x6d\xcc\x1d\x07\xa0\x0a\x75\xe0\x37\xbb\
\xcf\xf3\xf0\xb2\x99\x24\x3c\xc8\x7a\x10\xb5\x82\x14\xb2\x6d\x08\
\x85\xc0\x54\x95\x12\x1f\xc8\x10\x2d\x0f\x11\x41\x12\xb1\x14\x11\
\x23\xc8\x8d\x66\x88\x86\x60\xf6\x8c\x32\x8e\xdf\x71\x0f\x65\xad\
\x0a\xb7\x37\xc4\x18\x9f\x84\x66\x80\x26\x68\xde\x8d\xc3\x57\xe7\
\xd0\x0c\x65\x0d\x0a\x87\xda\x81\x68\x5b\xbf\x1d\x30\x50\xc8\xe7\
\x8e\xee\x41\x9e\xdf\xd4\xc8\xc2\x18\x10\xbb\x92\x96\x4a\x81\x10\
\x0a\x29\x15\x72\x61\x09\x42\x78\xc1\x5a\x4a\xa4\xd4\x08\x11\x29\
\xac\x25\xc7\xc4\x9f\xa8\xdf\x71\x1f\x65\xad\x2b\xa0\xa1\x11\xb8\
\x1d\x98\x49\x59\xc3\x4f\xa1\xe1\xef\x40\x0f\xee\x8e\x0e\xa2\x6d\
\xfd\x31\x02\x62\x03\x0d\xbc\x76\x28\x4d\x08\xc3\xaa\xa6\xaa\x77\
\x76\xae\x36\x84\x42\x16\xb6\x5d\x9c\x36\xb6\x6d\x63\x59\x36\xb6\
\x6d\xfd\xd3\x3b\x8b\xbf\xdd\xf5\x3a\xee\x8e\x0e\xdc\xde\x67\x80\
\x99\xc0\x1d\xc0\x4c\xdc\xde\x67\x8a\xc6\xe7\x17\x9b\x93\x02\x00\
\x43\xe7\x9b\x83\x7c\xfe\x81\x6b\xd7\xfd\x20\x0c\x45\xc3\xa1\x71\
\x83\xa1\x90\x8d\x65\x15\x0d\x87\xb0\x6d\x9b\x50\x28\x00\x75\x9d\
\x91\x2f\x02\x18\xaf\x84\x47\x7a\x2f\xf1\xb3\x2f\xdc\x33\xe9\x17\
\x96\x15\x78\xaa\xf5\x3b\x99\xd0\xda\x10\x0a\x99\xf1\x77\xf5\x6f\
\x14\x42\x40\x23\x30\x0c\x1c\x06\x86\x29\x6b\xf8\x0a\x34\xf4\xe0\
\xd0\x71\x29\xda\xd6\x6f\x8d\x03\x38\x7d\xf6\x32\xb7\xde\x12\x63\
\xc1\x9c\x92\xc9\x0f\x10\x76\xa1\x64\x6b\x81\xe7\xfb\xb8\xae\x87\
\xe7\xb9\xb8\xae\x87\xeb\xfa\x38\xae\x8b\xeb\x79\x34\x1f\x5f\x57\
\x10\x61\x07\x74\x76\x10\x88\xee\x5b\xb8\xbd\x9b\xa1\x93\xe0\xbe\
\x55\xe1\x50\x6b\xa2\x6d\xfd\x56\xb8\xc8\xf1\x58\x5a\xf0\xd1\xaf\
\x1f\x06\x13\xa4\x65\xd0\x1d\x07\xed\x9a\x2e\xfc\xf9\xb4\x56\x68\
\xa9\x91\x4a\xa1\x95\x46\x2b\x85\x2c\x5c\xfb\x13\x1e\x99\x84\x00\
\xbd\x15\x87\x4d\x00\x44\x9f\xfd\x01\x0e\xdf\x80\x86\xb7\xa0\x13\
\xa2\x6d\xfd\xcd\xce\xf6\xda\x4e\xb7\x33\x44\x91\x01\xcb\x18\x83\
\x65\x59\x55\x40\x2d\x30\xe5\xdd\x3e\xfb\x39\xdb\x6b\xbb\xca\x5a\
\x6b\x70\x77\x24\x88\xb6\xf5\xd7\x03\x71\x82\x1e\xd8\x5c\x0d\xa0\
\xa4\x70\x8c\x2a\xf9\x5f\x1c\x40\x9d\xed\xb5\x23\xd1\xb6\xfe\xe9\
\x05\xe1\x4d\xe8\x09\xad\x9b\x7d\x3c\xff\x07\x19\xbf\x1f\xed\x82\
\xbb\x44\xa7\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
"
qt_resource_name = "\
\x00\x06\
\x07\x03\x7d\xc3\
\x00\x69\
\x00\x6d\x00\x61\x00\x67\x00\x65\x00\x73\
\x00\x0c\
\x05\x68\x0e\x67\
\x00\x66\
\x00\x69\x00\x6c\x00\x65\x00\x73\x00\x61\x00\x76\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x0a\x61\x5a\xa7\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0c\
\x03\x62\x67\x07\
\x00\x78\
\x00\x73\x00\x73\x00\x61\x00\x6c\x00\x65\x00\x72\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0b\
\x00\xb0\xe2\x96\
\x00\x6c\
\x00\x6f\x00\x61\x00\x64\x00\x69\x00\x6e\x00\x67\x00\x2e\x00\x67\x00\x69\x00\x66\
\x00\x0d\
\x06\x52\xd9\xe7\
\x00\x66\
\x00\x69\x00\x6c\x00\x65\x00\x70\x00\x72\x00\x69\x00\x6e\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x0b\
\x04\x14\x52\xc7\
\x00\x66\
\x00\x69\x00\x6c\x00\x65\x00\x6e\x00\x65\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct = "\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\x03\
\x00\x00\x00\x64\x00\x00\x00\x00\x00\x01\x00\x00\x0e\xa3\
\x00\x00\x00\x46\x00\x00\x00\x00\x00\x01\x00\x00\x08\x04\
\x00\x00\x00\xa0\x00\x00\x00\x00\x00\x01\x00\x00\x92\x95\
\x00\x00\x00\x12\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x8c\x30\
\x00\x00\x00\x30\x00\x00\x00\x00\x00\x01\x00\x00\x05\x48\
"
def qInitResources():
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
| gpl-3.0 | 2,299,225,665,377,881,900 | 63.757075 | 97 | 0.726973 | false |
wxgeo/geophar | wxgeometrie/sympy/printing/rcode.py | 3 | 14687 | """
R code printer
The RCodePrinter converts single sympy expressions into single R expressions,
using the functions defined in math.h where possible.
"""
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import string_types, range
from sympy.codegen.ast import Assignment
from sympy.printing.codeprinter import CodePrinter
from sympy.printing.precedence import precedence, PRECEDENCE
from sympy.sets.fancysets import Range
# dictionary mapping sympy function to (argument_conditions, C_function).
# Used in RCodePrinter._print_Function(self)
known_functions = {
#"Abs": [(lambda x: not x.is_integer, "fabs")],
"Abs": "abs",
"sin": "sin",
"cos": "cos",
"tan": "tan",
"asin": "asin",
"acos": "acos",
"atan": "atan",
"atan2": "atan2",
"exp": "exp",
"log": "log",
"erf": "erf",
"sinh": "sinh",
"cosh": "cosh",
"tanh": "tanh",
"asinh": "asinh",
"acosh": "acosh",
"atanh": "atanh",
"floor": "floor",
"ceiling": "ceiling",
"sign": "sign",
"Max": "max",
"Min": "min",
"factorial": "factorial",
"gamma": "gamma",
"digamma": "digamma",
"trigamma": "trigamma",
"beta": "beta",
}
# These are the core reserved words in the R language. Taken from:
# https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Reserved-words
reserved_words = ['if',
'else',
'repeat',
'while',
'function',
'for',
'in',
'next',
'break',
'TRUE',
'FALSE',
'NULL',
'Inf',
'NaN',
'NA',
'NA_integer_',
'NA_real_',
'NA_complex_',
'NA_character_',
'volatile']
class RCodePrinter(CodePrinter):
"""A printer to convert python expressions to strings of R code"""
printmethod = "_rcode"
language = "R"
_default_settings = {
'order': None,
'full_prec': 'auto',
'precision': 15,
'user_functions': {},
'human': True,
'contract': True,
'dereference': set(),
'error_on_reserved': False,
'reserved_word_suffix': '_',
}
_operators = {
'and': '&',
'or': '|',
'not': '!',
}
_relationals = {
}
def __init__(self, settings={}):
CodePrinter.__init__(self, settings)
self.known_functions = dict(known_functions)
userfuncs = settings.get('user_functions', {})
self.known_functions.update(userfuncs)
self._dereference = set(settings.get('dereference', []))
self.reserved_words = set(reserved_words)
def _rate_index_position(self, p):
return p*5
def _get_statement(self, codestring):
return "%s;" % codestring
def _get_comment(self, text):
return "// {0}".format(text)
def _declare_number_const(self, name, value):
return "{0} = {1};".format(name, value)
def _format_code(self, lines):
return self.indent_code(lines)
def _traverse_matrix_indices(self, mat):
rows, cols = mat.shape
return ((i, j) for i in range(rows) for j in range(cols))
def _get_loop_opening_ending(self, indices):
"""Returns a tuple (open_lines, close_lines) containing lists of codelines
"""
open_lines = []
close_lines = []
loopstart = "for (%(var)s in %(start)s:%(end)s){"
for i in indices:
# R arrays start at 1 and end at dimension
open_lines.append(loopstart % {
'var': self._print(i.label),
'start': self._print(i.lower+1),
'end': self._print(i.upper + 1)})
close_lines.append("}")
return open_lines, close_lines
def _print_Pow(self, expr):
if "Pow" in self.known_functions:
return self._print_Function(expr)
PREC = precedence(expr)
if expr.exp == -1:
return '1.0/%s' % (self.parenthesize(expr.base, PREC))
elif expr.exp == 0.5:
return 'sqrt(%s)' % self._print(expr.base)
else:
return '%s^%s' % (self.parenthesize(expr.base, PREC),
self.parenthesize(expr.exp, PREC))
def _print_Rational(self, expr):
p, q = int(expr.p), int(expr.q)
return '%d.0/%d.0' % (p, q)
def _print_Indexed(self, expr):
inds = [ self._print(i) for i in expr.indices ]
return "%s[%s]" % (self._print(expr.base.label), ", ".join(inds))
def _print_Idx(self, expr):
return self._print(expr.label)
def _print_Exp1(self, expr):
return "exp(1)"
def _print_Pi(self, expr):
return 'pi'
def _print_Infinity(self, expr):
return 'Inf'
def _print_NegativeInfinity(self, expr):
return '-Inf'
def _print_Assignment(self, expr):
from sympy.functions.elementary.piecewise import Piecewise
from sympy.matrices.expressions.matexpr import MatrixSymbol
from sympy.tensor.indexed import IndexedBase
lhs = expr.lhs
rhs = expr.rhs
# We special case assignments that take multiple lines
#if isinstance(expr.rhs, Piecewise):
# # Here we modify Piecewise so each expression is now
# # an Assignment, and then continue on the print.
# expressions = []
# conditions = []
# for (e, c) in rhs.args:
# expressions.append(Assignment(lhs, e))
# conditions.append(c)
# temp = Piecewise(*zip(expressions, conditions))
# return self._print(temp)
#elif isinstance(lhs, MatrixSymbol):
if isinstance(lhs, MatrixSymbol):
# Here we form an Assignment for each element in the array,
# printing each one.
lines = []
for (i, j) in self._traverse_matrix_indices(lhs):
temp = Assignment(lhs[i, j], rhs[i, j])
code0 = self._print(temp)
lines.append(code0)
return "\n".join(lines)
elif self._settings["contract"] and (lhs.has(IndexedBase) or
rhs.has(IndexedBase)):
# Here we check if there is looping to be done, and if so
# print the required loops.
return self._doprint_loops(rhs, lhs)
else:
lhs_code = self._print(lhs)
rhs_code = self._print(rhs)
return self._get_statement("%s = %s" % (lhs_code, rhs_code))
def _print_Piecewise(self, expr):
# This method is called only for inline if constructs
# Top level piecewise is handled in doprint()
if expr.args[-1].cond == True:
last_line = "%s" % self._print(expr.args[-1].expr)
else:
last_line = "ifelse(%s,%s,NA)" % (self._print(expr.args[-1].cond), self._print(expr.args[-1].expr))
code=last_line
for e, c in reversed(expr.args[:-1]):
code= "ifelse(%s,%s," % (self._print(c), self._print(e))+code+")"
return(code)
def _print_ITE(self, expr):
from sympy.functions import Piecewise
_piecewise = Piecewise((expr.args[1], expr.args[0]), (expr.args[2], True))
return self._print(_piecewise)
def _print_MatrixElement(self, expr):
return "{0}[{1}]".format(self.parenthesize(expr.parent, PRECEDENCE["Atom"],
strict=True), expr.j + expr.i*expr.parent.shape[1])
def _print_Symbol(self, expr):
name = super(RCodePrinter, self)._print_Symbol(expr)
if expr in self._dereference:
return '(*{0})'.format(name)
else:
return name
def _print_Relational(self, expr):
lhs_code = self._print(expr.lhs)
rhs_code = self._print(expr.rhs)
op = expr.rel_op
return ("{0} {1} {2}").format(lhs_code, op, rhs_code)
def _print_sinc(self, expr):
from sympy.functions.elementary.trigonometric import sin
from sympy.core.relational import Ne
from sympy.functions import Piecewise
_piecewise = Piecewise(
(sin(expr.args[0]) / expr.args[0], Ne(expr.args[0], 0)), (1, True))
return self._print(_piecewise)
def _print_AugmentedAssignment(self, expr):
lhs_code = self._print(expr.lhs)
op = expr.rel_op
rhs_code = self._print(expr.rhs)
return "{0} {1} {2};".format(lhs_code, op, rhs_code)
def _print_For(self, expr):
target = self._print(expr.target)
if isinstance(expr.iterable, Range):
start, stop, step = expr.iterable.args
else:
raise NotImplementedError("Only iterable currently supported is Range")
body = self._print(expr.body)
return ('for ({target} = {start}; {target} < {stop}; {target} += '
'{step}) {{\n{body}\n}}').format(target=target, start=start,
stop=stop, step=step, body=body)
def indent_code(self, code):
"""Accepts a string of code or a list of code lines"""
if isinstance(code, string_types):
code_lines = self.indent_code(code.splitlines(True))
return ''.join(code_lines)
tab = " "
inc_token = ('{', '(', '{\n', '(\n')
dec_token = ('}', ')')
code = [ line.lstrip(' \t') for line in code ]
increase = [ int(any(map(line.endswith, inc_token))) for line in code ]
decrease = [ int(any(map(line.startswith, dec_token)))
for line in code ]
pretty = []
level = 0
for n, line in enumerate(code):
if line == '' or line == '\n':
pretty.append(line)
continue
level -= decrease[n]
pretty.append("%s%s" % (tab*level, line))
level += increase[n]
return pretty
def rcode(expr, assign_to=None, **settings):
"""Converts an expr to a string of r code
Parameters
==========
expr : Expr
A sympy expression to be converted.
assign_to : optional
When given, the argument is used as the name of the variable to which
the expression is assigned. Can be a string, ``Symbol``,
``MatrixSymbol``, or ``Indexed`` type. This is helpful in case of
line-wrapping, or for expressions that generate multi-line statements.
precision : integer, optional
The precision for numbers such as pi [default=15].
user_functions : dict, optional
A dictionary where the keys are string representations of either
``FunctionClass`` or ``UndefinedFunction`` instances and the values
are their desired R string representations. Alternatively, the
dictionary value can be a list of tuples i.e. [(argument_test,
rfunction_string)] or [(argument_test, rfunction_formater)]. See below
for examples.
human : bool, optional
If True, the result is a single string that may contain some constant
declarations for the number symbols. If False, the same information is
returned in a tuple of (symbols_to_declare, not_supported_functions,
code_text). [default=True].
contract: bool, optional
If True, ``Indexed`` instances are assumed to obey tensor contraction
rules and the corresponding nested loops over indices are generated.
Setting contract=False will not generate loops, instead the user is
responsible to provide values for the indices in the code.
[default=True].
Examples
========
>>> from sympy import rcode, symbols, Rational, sin, ceiling, Abs, Function
>>> x, tau = symbols("x, tau")
>>> rcode((2*tau)**Rational(7, 2))
'8*sqrt(2)*tau^(7.0/2.0)'
>>> rcode(sin(x), assign_to="s")
's = sin(x);'
Simple custom printing can be defined for certain types by passing a
dictionary of {"type" : "function"} to the ``user_functions`` kwarg.
Alternatively, the dictionary value can be a list of tuples i.e.
[(argument_test, cfunction_string)].
>>> custom_functions = {
... "ceiling": "CEIL",
... "Abs": [(lambda x: not x.is_integer, "fabs"),
... (lambda x: x.is_integer, "ABS")],
... "func": "f"
... }
>>> func = Function('func')
>>> rcode(func(Abs(x) + ceiling(x)), user_functions=custom_functions)
'f(fabs(x) + CEIL(x))'
or if the R-function takes a subset of the original arguments:
>>> rcode(2**x + 3**x, user_functions={'Pow': [
... (lambda b, e: b == 2, lambda b, e: 'exp2(%s)' % e),
... (lambda b, e: b != 2, 'pow')]})
'exp2(x) + pow(3, x)'
``Piecewise`` expressions are converted into conditionals. If an
``assign_to`` variable is provided an if statement is created, otherwise
the ternary operator is used. Note that if the ``Piecewise`` lacks a
default term, represented by ``(expr, True)`` then an error will be thrown.
This is to prevent generating an expression that may not evaluate to
anything.
>>> from sympy import Piecewise
>>> expr = Piecewise((x + 1, x > 0), (x, True))
>>> print(rcode(expr, assign_to=tau))
tau = ifelse(x > 0,x + 1,x);
Support for loops is provided through ``Indexed`` types. With
``contract=True`` these expressions will be turned into loops, whereas
``contract=False`` will just print the assignment expression that should be
looped over:
>>> from sympy import Eq, IndexedBase, Idx
>>> len_y = 5
>>> y = IndexedBase('y', shape=(len_y,))
>>> t = IndexedBase('t', shape=(len_y,))
>>> Dy = IndexedBase('Dy', shape=(len_y-1,))
>>> i = Idx('i', len_y-1)
>>> e=Eq(Dy[i], (y[i+1]-y[i])/(t[i+1]-t[i]))
>>> rcode(e.rhs, assign_to=e.lhs, contract=False)
'Dy[i] = (y[i + 1] - y[i])/(t[i + 1] - t[i]);'
Matrices are also supported, but a ``MatrixSymbol`` of the same dimensions
must be provided to ``assign_to``. Note that any expression that can be
generated normally can also exist inside a Matrix:
>>> from sympy import Matrix, MatrixSymbol
>>> mat = Matrix([x**2, Piecewise((x + 1, x > 0), (x, True)), sin(x)])
>>> A = MatrixSymbol('A', 3, 1)
>>> print(rcode(mat, A))
A[0] = x^2;
A[1] = ifelse(x > 0,x + 1,x);
A[2] = sin(x);
"""
return RCodePrinter(settings).doprint(expr, assign_to)
def print_rcode(expr, **settings):
"""Prints R representation of the given expression."""
print(rcode(expr, **settings))
| gpl-2.0 | 3,434,515,022,985,625,000 | 34.052506 | 111 | 0.564717 | false |
jpburstrom/sampleman | mainwindowui.py | 1 | 18965 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'sampleman.ui'
#
# Created: Sun Mar 7 13:00:58 2010
# by: PyQt4 UI code generator 4.7
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(579, 671)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
MainWindow.setSizePolicy(sizePolicy)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtGui.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.lineEdit = QtGui.QLineEdit(self.centralwidget)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout.addWidget(self.lineEdit, 0, 0, 1, 1)
self.fileView = QtGui.QListView(self.centralwidget)
self.fileView.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.fileView.setDragEnabled(False)
self.fileView.setDragDropMode(QtGui.QAbstractItemView.DragOnly)
self.fileView.setDefaultDropAction(QtCore.Qt.CopyAction)
self.fileView.setAlternatingRowColors(True)
self.fileView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.fileView.setSelectionBehavior(QtGui.QAbstractItemView.SelectItems)
self.fileView.setLayoutMode(QtGui.QListView.Batched)
self.fileView.setBatchSize(30)
self.fileView.setObjectName("fileView")
self.gridLayout.addWidget(self.fileView, 1, 0, 1, 1)
self.sliderFrame = QtGui.QFrame(self.centralwidget)
self.sliderFrame.setFrameShape(QtGui.QFrame.NoFrame)
self.sliderFrame.setFrameShadow(QtGui.QFrame.Plain)
self.sliderFrame.setObjectName("sliderFrame")
self.verticalLayout_2 = QtGui.QVBoxLayout(self.sliderFrame)
self.verticalLayout_2.setMargin(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.fileInfoLabel = QtGui.QLabel(self.sliderFrame)
self.fileInfoLabel.setWordWrap(True)
self.fileInfoLabel.setObjectName("fileInfoLabel")
self.verticalLayout_2.addWidget(self.fileInfoLabel)
self.seekSlider_2 = phonon.Phonon.SeekSlider(self.sliderFrame)
self.seekSlider_2.setObjectName("seekSlider_2")
self.verticalLayout_2.addWidget(self.seekSlider_2)
self.volumeSlider_2 = phonon.Phonon.VolumeSlider(self.sliderFrame)
self.volumeSlider_2.setObjectName("volumeSlider_2")
self.verticalLayout_2.addWidget(self.volumeSlider_2)
self.gridLayout.addWidget(self.sliderFrame, 3, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 579, 22))
self.menubar.setObjectName("menubar")
self.menuFile = QtGui.QMenu(self.menubar)
self.menuFile.setObjectName("menuFile")
self.menuOpen_with = QtGui.QMenu(self.menuFile)
self.menuOpen_with.setObjectName("menuOpen_with")
self.menuOpen_copy_with = QtGui.QMenu(self.menuFile)
self.menuOpen_copy_with.setObjectName("menuOpen_copy_with")
self.menuExport_as = QtGui.QMenu(self.menuFile)
self.menuExport_as.setObjectName("menuExport_as")
self.menuLibrary = QtGui.QMenu(self.menubar)
self.menuLibrary.setObjectName("menuLibrary")
self.menuRescan_folders = QtGui.QMenu(self.menuLibrary)
self.menuRescan_folders.setObjectName("menuRescan_folders")
self.menuView = QtGui.QMenu(self.menubar)
self.menuView.setObjectName("menuView")
self.menuEdit = QtGui.QMenu(self.menubar)
self.menuEdit.setObjectName("menuEdit")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.dockWidget_2 = QtGui.QDockWidget(MainWindow)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.dockWidget_2.sizePolicy().hasHeightForWidth())
self.dockWidget_2.setSizePolicy(sizePolicy)
self.dockWidget_2.setMinimumSize(QtCore.QSize(150, 242))
self.dockWidget_2.setMaximumSize(QtCore.QSize(150, 385))
self.dockWidget_2.setFeatures(QtGui.QDockWidget.DockWidgetClosable|QtGui.QDockWidget.DockWidgetMovable)
self.dockWidget_2.setObjectName("dockWidget_2")
self.dockWidgetContents_2 = QtGui.QWidget()
self.dockWidgetContents_2.setObjectName("dockWidgetContents_2")
self.verticalLayout = QtGui.QVBoxLayout(self.dockWidgetContents_2)
self.verticalLayout.setObjectName("verticalLayout")
self.tagView = QtGui.QListView(self.dockWidgetContents_2)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(60)
sizePolicy.setVerticalStretch(100)
sizePolicy.setHeightForWidth(self.tagView.sizePolicy().hasHeightForWidth())
self.tagView.setSizePolicy(sizePolicy)
self.tagView.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.tagView.setDragDropMode(QtGui.QAbstractItemView.DragDrop)
self.tagView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.tagView.setObjectName("tagView")
self.verticalLayout.addWidget(self.tagView)
self.dockWidget_2.setWidget(self.dockWidgetContents_2)
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget_2)
self.dockWidget = QtGui.QDockWidget(MainWindow)
self.dockWidget.setFeatures(QtGui.QDockWidget.DockWidgetClosable|QtGui.QDockWidget.DockWidgetMovable)
self.dockWidget.setObjectName("dockWidget")
self.dockWidgetContents = QtGui.QWidget()
self.dockWidgetContents.setObjectName("dockWidgetContents")
self.gridLayout_2 = QtGui.QGridLayout(self.dockWidgetContents)
self.gridLayout_2.setObjectName("gridLayout_2")
self.stack = QtGui.QListView(self.dockWidgetContents)
self.stack.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.stack.setDragEnabled(False)
self.stack.setDragDropMode(QtGui.QAbstractItemView.DragOnly)
self.stack.setDefaultDropAction(QtCore.Qt.CopyAction)
self.stack.setAlternatingRowColors(True)
self.stack.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
self.stack.setSelectionBehavior(QtGui.QAbstractItemView.SelectItems)
self.stack.setLayoutMode(QtGui.QListView.Batched)
self.stack.setBatchSize(30)
self.stack.setObjectName("stack")
self.gridLayout_2.addWidget(self.stack, 0, 0, 1, 3)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1)
self.pushButton = QtGui.QPushButton(self.dockWidgetContents)
self.pushButton.setObjectName("pushButton")
self.gridLayout_2.addWidget(self.pushButton, 1, 2, 1, 1)
self.pushButton_2 = QtGui.QPushButton(self.dockWidgetContents)
self.pushButton_2.setObjectName("pushButton_2")
self.gridLayout_2.addWidget(self.pushButton_2, 1, 1, 1, 1)
self.dockWidget.setWidget(self.dockWidgetContents)
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(8), self.dockWidget)
self.dockWidget_3 = QtGui.QDockWidget(MainWindow)
self.dockWidget_3.setFeatures(QtGui.QDockWidget.DockWidgetClosable|QtGui.QDockWidget.DockWidgetMovable)
self.dockWidget_3.setObjectName("dockWidget_3")
self.dockWidgetContents_3 = QtGui.QWidget()
self.dockWidgetContents_3.setObjectName("dockWidgetContents_3")
self.verticalLayout_3 = QtGui.QVBoxLayout(self.dockWidgetContents_3)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.comboBox = QtGui.QComboBox(self.dockWidgetContents_3)
self.comboBox.setObjectName("comboBox")
self.verticalLayout_3.addWidget(self.comboBox)
self.dockWidget_3.setWidget(self.dockWidgetContents_3)
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget_3)
self.actionQuit = QtGui.QAction(MainWindow)
self.actionQuit.setObjectName("actionQuit")
self.actionTest = QtGui.QAction(MainWindow)
self.actionTest.setObjectName("actionTest")
self.actionAll_folders = QtGui.QAction(MainWindow)
self.actionAll_folders.setObjectName("actionAll_folders")
self.actionEdit_all = QtGui.QAction(MainWindow)
self.actionEdit_all.setObjectName("actionEdit_all")
self.actionEdit_one_by_one = QtGui.QAction(MainWindow)
self.actionEdit_one_by_one.setObjectName("actionEdit_one_by_one")
self.actionPlay = QtGui.QAction(MainWindow)
self.actionPlay.setCheckable(True)
self.actionPlay.setObjectName("actionPlay")
self.actionShow_file_info = QtGui.QAction(MainWindow)
self.actionShow_file_info.setCheckable(True)
self.actionShow_file_info.setChecked(True)
self.actionShow_file_info.setObjectName("actionShow_file_info")
self.actionLocation = QtGui.QAction(MainWindow)
self.actionLocation.setCheckable(True)
self.actionLocation.setChecked(True)
self.actionLocation.setObjectName("actionLocation")
self.actionShow_volume = QtGui.QAction(MainWindow)
self.actionShow_volume.setCheckable(True)
self.actionShow_volume.setChecked(True)
self.actionShow_volume.setObjectName("actionShow_volume")
self.actionShow_tags = QtGui.QAction(MainWindow)
self.actionShow_tags.setCheckable(True)
self.actionShow_tags.setChecked(True)
self.actionShow_tags.setObjectName("actionShow_tags")
self.actionShow_stack = QtGui.QAction(MainWindow)
self.actionShow_stack.setCheckable(True)
self.actionShow_stack.setChecked(True)
self.actionShow_stack.setObjectName("actionShow_stack")
self.actionStack = QtGui.QAction(MainWindow)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/ft/icons/_blank.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionStack.setIcon(icon)
self.actionStack.setObjectName("actionStack")
self.actionProject = QtGui.QAction(MainWindow)
self.actionProject.setCheckable(True)
self.actionProject.setChecked(True)
self.actionProject.setObjectName("actionProject")
self.actionPreferences = QtGui.QAction(MainWindow)
self.actionPreferences.setObjectName("actionPreferences")
self.actionQuit_2 = QtGui.QAction(MainWindow)
self.actionQuit_2.setObjectName("actionQuit_2")
self.menuFile.addAction(self.actionStack)
self.menuFile.addAction(self.menuOpen_with.menuAction())
self.menuFile.addAction(self.menuOpen_copy_with.menuAction())
self.menuFile.addAction(self.menuExport_as.menuAction())
self.menuFile.addAction(self.actionPlay)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionQuit_2)
self.menuRescan_folders.addAction(self.actionAll_folders)
self.menuRescan_folders.addSeparator()
self.menuLibrary.addAction(self.menuRescan_folders.menuAction())
self.menuView.addAction(self.actionShow_file_info)
self.menuView.addAction(self.actionLocation)
self.menuView.addAction(self.actionShow_volume)
self.menuView.addAction(self.actionShow_tags)
self.menuView.addAction(self.actionShow_stack)
self.menuView.addAction(self.actionProject)
self.menuEdit.addAction(self.actionEdit_all)
self.menuEdit.addAction(self.actionEdit_one_by_one)
self.menuEdit.addSeparator()
self.menuEdit.addAction(self.actionPreferences)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuEdit.menuAction())
self.menubar.addAction(self.menuLibrary.menuAction())
self.menubar.addAction(self.menuView.menuAction())
self.retranslateUi(MainWindow)
QtCore.QObject.connect(self.actionShow_file_info, QtCore.SIGNAL("toggled(bool)"), self.fileInfoLabel.setVisible)
QtCore.QObject.connect(self.actionLocation, QtCore.SIGNAL("toggled(bool)"), self.seekSlider_2.setVisible)
QtCore.QObject.connect(self.actionShow_tags, QtCore.SIGNAL("toggled(bool)"), self.dockWidget_2.setVisible)
QtCore.QObject.connect(self.actionShow_volume, QtCore.SIGNAL("toggled(bool)"), self.volumeSlider_2.setVisible)
QtCore.QObject.connect(self.actionShow_stack, QtCore.SIGNAL("toggled(bool)"), self.dockWidget.setVisible)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Sampleman", None, QtGui.QApplication.UnicodeUTF8))
self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8))
self.menuOpen_with.setTitle(QtGui.QApplication.translate("MainWindow", "Open with", None, QtGui.QApplication.UnicodeUTF8))
self.menuOpen_copy_with.setTitle(QtGui.QApplication.translate("MainWindow", "Open copy with", None, QtGui.QApplication.UnicodeUTF8))
self.menuExport_as.setTitle(QtGui.QApplication.translate("MainWindow", "Export as", None, QtGui.QApplication.UnicodeUTF8))
self.menuLibrary.setTitle(QtGui.QApplication.translate("MainWindow", "Repos", None, QtGui.QApplication.UnicodeUTF8))
self.menuRescan_folders.setTitle(QtGui.QApplication.translate("MainWindow", "Rescan repos", None, QtGui.QApplication.UnicodeUTF8))
self.menuView.setTitle(QtGui.QApplication.translate("MainWindow", "View", None, QtGui.QApplication.UnicodeUTF8))
self.menuEdit.setTitle(QtGui.QApplication.translate("MainWindow", "Edit", None, QtGui.QApplication.UnicodeUTF8))
self.dockWidget_2.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Tags", None, QtGui.QApplication.UnicodeUTF8))
self.dockWidget.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Stack", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("MainWindow", "Clear", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_2.setText(QtGui.QApplication.translate("MainWindow", "Delete", None, QtGui.QApplication.UnicodeUTF8))
self.dockWidget_3.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Project", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
self.actionTest.setText(QtGui.QApplication.translate("MainWindow", "Test", None, QtGui.QApplication.UnicodeUTF8))
self.actionAll_folders.setText(QtGui.QApplication.translate("MainWindow", "All folders", None, QtGui.QApplication.UnicodeUTF8))
self.actionAll_folders.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Alt+R", None, QtGui.QApplication.UnicodeUTF8))
self.actionEdit_all.setText(QtGui.QApplication.translate("MainWindow", "Edit all", None, QtGui.QApplication.UnicodeUTF8))
self.actionEdit_all.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+E", None, QtGui.QApplication.UnicodeUTF8))
self.actionEdit_one_by_one.setText(QtGui.QApplication.translate("MainWindow", "Edit one by one", None, QtGui.QApplication.UnicodeUTF8))
self.actionEdit_one_by_one.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Shift+E", None, QtGui.QApplication.UnicodeUTF8))
self.actionPlay.setText(QtGui.QApplication.translate("MainWindow", "Play", None, QtGui.QApplication.UnicodeUTF8))
self.actionPlay.setShortcut(QtGui.QApplication.translate("MainWindow", "Space", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_file_info.setText(QtGui.QApplication.translate("MainWindow", "File Info", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_file_info.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+I", None, QtGui.QApplication.UnicodeUTF8))
self.actionLocation.setText(QtGui.QApplication.translate("MainWindow", "Location", None, QtGui.QApplication.UnicodeUTF8))
self.actionLocation.setToolTip(QtGui.QApplication.translate("MainWindow", "Location", None, QtGui.QApplication.UnicodeUTF8))
self.actionLocation.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+L", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_volume.setText(QtGui.QApplication.translate("MainWindow", "Volume", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_volume.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+V", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_tags.setText(QtGui.QApplication.translate("MainWindow", "Tags", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_tags.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+T", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_stack.setText(QtGui.QApplication.translate("MainWindow", "Stack", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_stack.setToolTip(QtGui.QApplication.translate("MainWindow", "Show Stack", None, QtGui.QApplication.UnicodeUTF8))
self.actionShow_stack.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+B", None, QtGui.QApplication.UnicodeUTF8))
self.actionStack.setText(QtGui.QApplication.translate("MainWindow", "Stack", None, QtGui.QApplication.UnicodeUTF8))
self.actionStack.setToolTip(QtGui.QApplication.translate("MainWindow", "Stack selected files", None, QtGui.QApplication.UnicodeUTF8))
self.actionStack.setShortcut(QtGui.QApplication.translate("MainWindow", "S", None, QtGui.QApplication.UnicodeUTF8))
self.actionProject.setText(QtGui.QApplication.translate("MainWindow", "Project", None, QtGui.QApplication.UnicodeUTF8))
self.actionProject.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+P", None, QtGui.QApplication.UnicodeUTF8))
self.actionPreferences.setText(QtGui.QApplication.translate("MainWindow", "Preferences", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit_2.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8))
from PyQt4 import phonon
import sampleman_rc
| gpl-3.0 | 3,103,841,371,846,845,400 | 67.963636 | 144 | 0.739784 | false |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/theano/tensor/nlinalg.py | 1 | 23539 | from __future__ import absolute_import, print_function, division
import logging
import numpy
from six.moves import xrange
import theano
from theano.tensor import as_tensor_variable
from theano.gof import Op, Apply
from theano.gradient import DisconnectedType
from theano.tensor import basic as tensor
logger = logging.getLogger(__name__)
class MatrixPinv(Op):
"""Computes the pseudo-inverse of a matrix :math:`A`.
The pseudo-inverse of a matrix :math:`A`, denoted :math:`A^+`, is
defined as: "the matrix that 'solves' [the least-squares problem]
:math:`Ax = b`," i.e., if :math:`\\bar{x}` is said solution, then
:math:`A^+` is that matrix such that :math:`\\bar{x} = A^+b`.
Note that :math:`Ax=AA^+b`, so :math:`AA^+` is close to the identity matrix.
This method is not faster than `matrix_inverse`. Its strength comes from
that it works for non-square matrices.
If you have a square matrix though, `matrix_inverse` can be both more
exact and faster to compute. Also this op does not get optimized into a
solve op.
"""
__props__ = ()
def __init__(self):
pass
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2
return Apply(self, [x], [x.type()])
def perform(self, node, inputs, outputs):
(x,) = inputs
(z,) = outputs
z[0] = numpy.linalg.pinv(x).astype(x.dtype)
pinv = MatrixPinv()
class MatrixInverse(Op):
"""Computes the inverse of a matrix :math:`A`.
Given a square matrix :math:`A`, ``matrix_inverse`` returns a square
matrix :math:`A_{inv}` such that the dot product :math:`A \cdot A_{inv}`
and :math:`A_{inv} \cdot A` equals the identity matrix :math:`I`.
Notes
-----
When possible, the call to this op will be optimized to the call
of ``solve``.
"""
__props__ = ()
def __init__(self):
pass
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2
return Apply(self, [x], [x.type()])
def perform(self, node, inputs, outputs):
(x,) = inputs
(z,) = outputs
z[0] = numpy.linalg.inv(x).astype(x.dtype)
def grad(self, inputs, g_outputs):
r"""The gradient function should return
.. math:: V\frac{\partial X^{-1}}{\partial X},
where :math:`V` corresponds to ``g_outputs`` and :math:`X` to
``inputs``. Using the `matrix cookbook
<http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=3274>`_,
one can deduce that the relation corresponds to
.. math:: (X^{-1} \cdot V^{T} \cdot X^{-1})^T.
"""
x, = inputs
xi = self(x)
gz, = g_outputs
# TT.dot(gz.T,xi)
return [-matrix_dot(xi, gz.T, xi).T]
def R_op(self, inputs, eval_points):
r"""The gradient function should return
.. math:: \frac{\partial X^{-1}}{\partial X}V,
where :math:`V` corresponds to ``g_outputs`` and :math:`X` to
``inputs``. Using the `matrix cookbook
<http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=3274>`_,
one can deduce that the relation corresponds to
.. math:: X^{-1} \cdot V \cdot X^{-1}.
"""
x, = inputs
xi = self(x)
ev, = eval_points
if ev is None:
return [None]
return [-matrix_dot(xi, ev, xi)]
def infer_shape(self, node, shapes):
return shapes
matrix_inverse = MatrixInverse()
def matrix_dot(*args):
""" Shorthand for product between several dots.
Given :math:`N` matrices :math:`A_0, A_1, .., A_N`, ``matrix_dot`` will
generate the matrix product between all in the given order, namely
:math:`A_0 \cdot A_1 \cdot A_2 \cdot .. \cdot A_N`.
"""
rval = args[0]
for a in args[1:]:
rval = theano.tensor.dot(rval, a)
return rval
class AllocDiag(Op):
"""
Allocates a square matrix with the given vector as its diagonal.
"""
__props__ = ()
def make_node(self, _x):
x = as_tensor_variable(_x)
if x.type.ndim != 1:
raise TypeError('AllocDiag only works on vectors', _x)
return Apply(self, [x], [theano.tensor.matrix(dtype=x.type.dtype)])
def grad(self, inputs, g_outputs):
return [extract_diag(g_outputs[0])]
def perform(self, node, inputs, outputs):
(x,) = inputs
(z,) = outputs
if x.ndim != 1:
raise TypeError(x)
z[0] = numpy.diag(x)
def infer_shape(self, node, shapes):
x_s, = shapes
return [(x_s[0], x_s[0])]
alloc_diag = AllocDiag()
class ExtractDiag(Op):
"""Return the diagonal of a matrix.
Notes
-----
Works on the GPU.
"""
__props__ = ("view",)
def __init__(self, view=False):
self.view = view
if self.view:
self.view_map = {0: [0]}
def make_node(self, _x):
if not isinstance(_x, theano.Variable):
x = as_tensor_variable(_x)
else:
x = _x
if x.type.ndim != 2:
raise TypeError('ExtractDiag only works on matrices', _x)
y = x.type.clone(broadcastable=(False,))()
return Apply(self, [x], [y])
def perform(self, node, ins, outs):
""" For some reason numpy.diag(x) is really slow, so we
implemented our own. """
x, = ins
z, = outs
# zero-dimensional matrices ...
if x.shape[0] == 0 or x.shape[1] == 0:
z[0] = node.outputs[0].type.value_zeros((0,))
return
if x.shape[0] < x.shape[1]:
rval = x[:, 0]
else:
rval = x[0]
rval.strides = (x.strides[0] + x.strides[1],)
if self.view:
z[0] = rval
else:
z[0] = rval.copy()
def __str__(self):
return 'ExtractDiag{view=%s}' % self.view
def grad(self, inputs, g_outputs):
x = theano.tensor.zeros_like(inputs[0])
xdiag = alloc_diag(g_outputs[0])
return [theano.tensor.set_subtensor(
x[:xdiag.shape[0], :xdiag.shape[1]],
xdiag)]
def infer_shape(self, node, shapes):
x_s, = shapes
shp = theano.tensor.min(node.inputs[0].shape)
return [(shp,)]
extract_diag = ExtractDiag()
# TODO: optimization to insert ExtractDiag with view=True
def diag(x):
"""
Numpy-compatibility method
If `x` is a matrix, return its diagonal.
If `x` is a vector return a matrix with it as its diagonal.
* This method does not support the `k` argument that numpy supports.
"""
xx = as_tensor_variable(x)
if xx.type.ndim == 1:
return alloc_diag(xx)
elif xx.type.ndim == 2:
return extract_diag(xx)
else:
raise TypeError('diag requires vector or matrix argument', x)
def trace(X):
"""
Returns the sum of diagonal elements of matrix X.
Notes
-----
Works on GPU since 0.6rc4.
"""
return extract_diag(X).sum()
class Det(Op):
"""
Matrix determinant. Input should be a square matrix.
"""
__props__ = ()
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2
o = theano.tensor.scalar(dtype=x.dtype)
return Apply(self, [x], [o])
def perform(self, node, inputs, outputs):
(x,) = inputs
(z,) = outputs
try:
z[0] = numpy.asarray(numpy.linalg.det(x), dtype=x.dtype)
except Exception:
print('Failed to compute determinant', x)
raise
def grad(self, inputs, g_outputs):
gz, = g_outputs
x, = inputs
return [gz * self(x) * matrix_inverse(x).T]
def infer_shape(self, node, shapes):
return [()]
def __str__(self):
return "Det"
det = Det()
class Eig(Op):
"""
Compute the eigenvalues and right eigenvectors of a square array.
"""
_numop = staticmethod(numpy.linalg.eig)
__props__ = ()
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2
w = theano.tensor.vector(dtype=x.dtype)
v = theano.tensor.matrix(dtype=x.dtype)
return Apply(self, [x], [w, v])
def perform(self, node, inputs, outputs):
(x,) = inputs
(w, v) = outputs
w[0], v[0] = [z.astype(x.dtype) for z in self._numop(x)]
def infer_shape(self, node, shapes):
n = shapes[0][0]
return [(n,), (n, n)]
eig = Eig()
class Eigh(Eig):
"""
Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix.
"""
_numop = staticmethod(numpy.linalg.eigh)
__props__ = ('UPLO',)
def __init__(self, UPLO='L'):
assert UPLO in ['L', 'U']
self.UPLO = UPLO
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2
# Numpy's linalg.eigh may return either double or single
# presision eigenvalues depending on installed version of
# LAPACK. Rather than trying to reproduce the (rather
# involved) logic, we just probe linalg.eigh with a trivial
# input.
w_dtype = self._numop([[numpy.dtype(x.dtype).type()]])[0].dtype.name
w = theano.tensor.vector(dtype=w_dtype)
v = theano.tensor.matrix(dtype=x.dtype)
return Apply(self, [x], [w, v])
def perform(self, node, inputs, outputs):
(x,) = inputs
(w, v) = outputs
w[0], v[0] = self._numop(x, self.UPLO)
def grad(self, inputs, g_outputs):
r"""The gradient function should return
.. math:: \sum_n\left(W_n\frac{\partial\,w_n}
{\partial a_{ij}} +
\sum_k V_{nk}\frac{\partial\,v_{nk}}
{\partial a_{ij}}\right),
where [:math:`W`, :math:`V`] corresponds to ``g_outputs``,
:math:`a` to ``inputs``, and :math:`(w, v)=\mbox{eig}(a)`.
Analytic formulae for eigensystem gradients are well-known in
perturbation theory:
.. math:: \frac{\partial\,w_n}
{\partial a_{ij}} = v_{in}\,v_{jn}
.. math:: \frac{\partial\,v_{kn}}
{\partial a_{ij}} =
\sum_{m\ne n}\frac{v_{km}v_{jn}}{w_n-w_m}
"""
x, = inputs
w, v = self(x)
# Replace gradients wrt disconnected variables with
# zeros. This is a work-around for issue #1063.
gw, gv = _zero_disconnected([w, v], g_outputs)
return [EighGrad(self.UPLO)(x, w, v, gw, gv)]
def _zero_disconnected(outputs, grads):
l = []
for o, g in zip(outputs, grads):
if isinstance(g.type, DisconnectedType):
l.append(o.zeros_like())
else:
l.append(g)
return l
class EighGrad(Op):
"""
Gradient of an eigensystem of a Hermitian matrix.
"""
__props__ = ('UPLO',)
def __init__(self, UPLO='L'):
assert UPLO in ['L', 'U']
self.UPLO = UPLO
if UPLO == 'L':
self.tri0 = numpy.tril
self.tri1 = lambda a: numpy.triu(a, 1)
else:
self.tri0 = numpy.triu
self.tri1 = lambda a: numpy.tril(a, -1)
def make_node(self, x, w, v, gw, gv):
x, w, v, gw, gv = map(as_tensor_variable, (x, w, v, gw, gv))
assert x.ndim == 2
assert w.ndim == 1
assert v.ndim == 2
assert gw.ndim == 1
assert gv.ndim == 2
out_dtype = theano.scalar.upcast(x.dtype, w.dtype, v.dtype,
gw.dtype, gv.dtype)
out = theano.tensor.matrix(dtype=out_dtype)
return Apply(self, [x, w, v, gw, gv], [out])
def perform(self, node, inputs, outputs):
"""
Implements the "reverse-mode" gradient for the eigensystem of
a square matrix.
"""
x, w, v, W, V = inputs
N = x.shape[0]
outer = numpy.outer
def G(n):
return sum(v[:, m] * V.T[n].dot(v[:, m]) / (w[n] - w[m])
for m in xrange(N) if m != n)
g = sum(outer(v[:, n], v[:, n] * W[n] + G(n))
for n in xrange(N))
# Numpy's eigh(a, 'L') (eigh(a, 'U')) is a function of tril(a)
# (triu(a)) only. This means that partial derivative of
# eigh(a, 'L') (eigh(a, 'U')) with respect to a[i,j] is zero
# for i < j (i > j). At the same time, non-zero components of
# the gradient must account for the fact that variation of the
# opposite triangle contributes to variation of two elements
# of Hermitian (symmetric) matrix. The following line
# implements the necessary logic.
out = self.tri0(g) + self.tri1(g).T
# Make sure we return the right dtype even if NumPy performed
# upcasting in self.tri0.
outputs[0][0] = numpy.asarray(out, dtype=node.outputs[0].dtype)
def infer_shape(self, node, shapes):
return [shapes[0]]
def eigh(a, UPLO='L'):
return Eigh(UPLO)(a)
class QRFull(Op):
"""
Full QR Decomposition.
Computes the QR decomposition of a matrix.
Factor the matrix a as qr, where q is orthonormal
and r is upper-triangular.
"""
_numop = staticmethod(numpy.linalg.qr)
__props__ = ('mode',)
def __init__(self, mode):
self.mode = mode
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2, "The input of qr function should be a matrix."
q = theano.tensor.matrix(dtype=x.dtype)
if self.mode != 'raw':
r = theano.tensor.matrix(dtype=x.dtype)
else:
r = theano.tensor.vector(dtype=x.dtype)
return Apply(self, [x], [q, r])
def perform(self, node, inputs, outputs):
(x,) = inputs
(q, r) = outputs
assert x.ndim == 2, "The input of qr function should be a matrix."
q[0], r[0] = self._numop(x, self.mode)
class QRIncomplete(Op):
"""
Incomplete QR Decomposition.
Computes the QR decomposition of a matrix.
Factor the matrix a as qr and return a single matrix.
"""
_numop = staticmethod(numpy.linalg.qr)
__props__ = ('mode',)
def __init__(self, mode):
self.mode = mode
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2, "The input of qr function should be a matrix."
q = theano.tensor.matrix(dtype=x.dtype)
return Apply(self, [x], [q])
def perform(self, node, inputs, outputs):
(x,) = inputs
(q,) = outputs
assert x.ndim == 2, "The input of qr function should be a matrix."
q[0] = self._numop(x,
self.mode)
def qr(a, mode="reduced"):
"""
Computes the QR decomposition of a matrix.
Factor the matrix a as qr, where q
is orthonormal and r is upper-triangular.
Parameters
----------
a : array_like, shape (M, N)
Matrix to be factored.
mode : {'reduced', 'complete', 'r', 'raw'}, optional
If K = min(M, N), then
'reduced'
returns q, r with dimensions (M, K), (K, N)
'complete'
returns q, r with dimensions (M, M), (M, N)
'r'
returns r only with dimensions (K, N)
'raw'
returns h, tau with dimensions (N, M), (K,)
Note that array h returned in 'raw' mode is
transposed for calling Fortran.
Default mode is 'reduced'
Returns
-------
q : matrix of float or complex, optional
A matrix with orthonormal columns. When mode = 'complete' the
result is an orthogonal/unitary matrix depending on whether or
not a is real/complex. The determinant may be either +/- 1 in
that case.
r : matrix of float or complex, optional
The upper-triangular matrix.
"""
x = [[2, 1], [3, 4]]
if isinstance(numpy.linalg.qr(x, mode), tuple):
return QRFull(mode)(a)
else:
return QRIncomplete(mode)(a)
class SVD(Op):
"""
Parameters
----------
full_matrices : bool, optional
If True (default), u and v have the shapes (M, M) and (N, N),
respectively.
Otherwise, the shapes are (M, K) and (K, N), respectively,
where K = min(M, N).
compute_uv : bool, optional
Whether or not to compute u and v in addition to s.
True by default.
"""
# See doc in the docstring of the function just after this class.
_numop = staticmethod(numpy.linalg.svd)
__props__ = ('full_matrices', 'compute_uv')
def __init__(self, full_matrices=True, compute_uv=True):
self.full_matrices = full_matrices
self.compute_uv = compute_uv
def make_node(self, x):
x = as_tensor_variable(x)
assert x.ndim == 2, "The input of svd function should be a matrix."
w = theano.tensor.matrix(dtype=x.dtype)
u = theano.tensor.vector(dtype=x.dtype)
v = theano.tensor.matrix(dtype=x.dtype)
return Apply(self, [x], [w, u, v])
def perform(self, node, inputs, outputs):
(x,) = inputs
(w, u, v) = outputs
assert x.ndim == 2, "The input of svd function should be a matrix."
w[0], u[0], v[0] = self._numop(x,
self.full_matrices,
self.compute_uv)
def svd(a, full_matrices=1, compute_uv=1):
"""
This function performs the SVD on CPU.
Parameters
----------
full_matrices : bool, optional
If True (default), u and v have the shapes (M, M) and (N, N),
respectively.
Otherwise, the shapes are (M, K) and (K, N), respectively,
where K = min(M, N).
compute_uv : bool, optional
Whether or not to compute u and v in addition to s.
True by default.
Returns
-------
U, V, D : matrices
"""
return SVD(full_matrices, compute_uv)(a)
class lstsq(Op):
__props__ = ()
def make_node(self, x, y, rcond):
x = theano.tensor.as_tensor_variable(x)
y = theano.tensor.as_tensor_variable(y)
rcond = theano.tensor.as_tensor_variable(rcond)
return theano.Apply(self, [x, y, rcond],
[theano.tensor.matrix(), theano.tensor.dvector(),
theano.tensor.lscalar(), theano.tensor.dvector()])
def perform(self, node, inputs, outputs):
zz = numpy.linalg.lstsq(inputs[0], inputs[1], inputs[2])
outputs[0][0] = zz[0]
outputs[1][0] = zz[1]
outputs[2][0] = numpy.array(zz[2])
outputs[3][0] = zz[3]
def matrix_power(M, n):
"""
Raise a square matrix to the (integer) power n.
Parameters
----------
M : Tensor variable
n : Python int
"""
result = 1
for i in xrange(n):
result = theano.dot(result, M)
return result
def norm(x, ord):
x = as_tensor_variable(x)
ndim = x.ndim
if ndim == 0:
raise ValueError("'axis' entry is out of bounds.")
elif ndim == 1:
if ord is None:
return tensor.sum(x**2)**0.5
elif ord == 'inf':
return tensor.max(abs(x))
elif ord == '-inf':
return tensor.min(abs(x))
elif ord == 0:
return x[x.nonzero()].shape[0]
else:
try:
z = tensor.sum(abs(x**ord))**(1. / ord)
except TypeError:
raise ValueError("Invalid norm order for vectors.")
return z
elif ndim == 2:
if ord is None or ord == 'fro':
return tensor.sum(abs(x**2))**(0.5)
elif ord == 'inf':
return tensor.max(tensor.sum(abs(x), 1))
elif ord == '-inf':
return tensor.min(tensor.sum(abs(x), 1))
elif ord == 1:
return tensor.max(tensor.sum(abs(x), 0))
elif ord == -1:
return tensor.min(tensor.sum(abs(x), 0))
else:
raise ValueError(0)
elif ndim > 2:
raise NotImplementedError("We don't support norm witn ndim > 2")
class TensorInv(Op):
"""
Class wrapper for tensorinv() function;
Theano utilization of numpy.linalg.tensorinv;
"""
_numop = staticmethod(numpy.linalg.tensorinv)
__props__ = ('ind',)
def __init__(self, ind=2):
self.ind = ind
def make_node(self, a):
a = as_tensor_variable(a)
out = a.type()
return Apply(self, [a], [out])
def perform(self, node, inputs, outputs):
(a,) = inputs
(x,) = outputs
x[0] = self._numop(a, self.ind)
def infer_shape(self, node, shapes):
sp = shapes[0][self.ind:] + shapes[0][:self.ind]
return [sp]
def tensorinv(a, ind=2):
"""
Does not run on GPU;
Theano utilization of numpy.linalg.tensorinv;
Compute the 'inverse' of an N-dimensional array.
The result is an inverse for `a` relative to the tensordot operation
``tensordot(a, b, ind)``, i. e., up to floating-point accuracy,
``tensordot(tensorinv(a), a, ind)`` is the "identity" tensor for the
tensordot operation.
Parameters
----------
a : array_like
Tensor to 'invert'. Its shape must be 'square', i. e.,
``prod(a.shape[:ind]) == prod(a.shape[ind:])``.
ind : int, optional
Number of first indices that are involved in the inverse sum.
Must be a positive integer, default is 2.
Returns
-------
b : ndarray
`a`'s tensordot inverse, shape ``a.shape[ind:] + a.shape[:ind]``.
Raises
------
LinAlgError
If `a` is singular or not 'square' (in the above sense).
"""
return TensorInv(ind)(a)
class TensorSolve(Op):
"""
Theano utilization of numpy.linalg.tensorsolve
Class wrapper for tensorsolve function.
"""
_numop = staticmethod(numpy.linalg.tensorsolve)
__props__ = ('axes', )
def __init__(self, axes=None):
self.axes = axes
def make_node(self, a, b):
a = as_tensor_variable(a)
b = as_tensor_variable(b)
out_dtype = theano.scalar.upcast(a.dtype, b.dtype)
x = theano.tensor.matrix(dtype=out_dtype)
return Apply(self, [a, b], [x])
def perform(self, node, inputs, outputs):
(a, b,) = inputs
(x,) = outputs
x[0] = self._numop(a, b, self.axes)
def tensorsolve(a, b, axes=None):
"""
Theano utilization of numpy.linalg.tensorsolve. Does not run on GPU!
Solve the tensor equation ``a x = b`` for x.
It is assumed that all indices of `x` are summed over in the product,
together with the rightmost indices of `a`, as is done in, for example,
``tensordot(a, x, axes=len(b.shape))``.
Parameters
----------
a : array_like
Coefficient tensor, of shape ``b.shape + Q``. `Q`, a tuple, equals
the shape of that sub-tensor of `a` consisting of the appropriate
number of its rightmost indices, and must be such that
``prod(Q) == prod(b.shape)`` (in which sense `a` is said to be
'square').
b : array_like
Right-hand tensor, which can be of any shape.
axes : tuple of ints, optional
Axes in `a` to reorder to the right, before inversion.
If None (default), no reordering is done.
Returns
-------
x : ndarray, shape Q
Raises
------
LinAlgError
If `a` is singular or not 'square' (in the above sense).
"""
return TensorSolve(axes)(a, b)
| agpl-3.0 | 5,579,638,122,380,263,000 | 27.190419 | 80 | 0.550363 | false |
robertnishihara/ray | rllib/agents/marwil/tests/test_marwil.py | 1 | 2166 | import os
from pathlib import Path
import unittest
import ray
import ray.rllib.agents.marwil as marwil
from ray.rllib.utils.framework import try_import_tf
from ray.rllib.utils.test_utils import check_compute_single_action, \
framework_iterator
tf1, tf, tfv = try_import_tf()
class TestMARWIL(unittest.TestCase):
@classmethod
def setUpClass(cls):
ray.init()
@classmethod
def tearDownClass(cls):
ray.shutdown()
def test_marwil_compilation_and_learning_from_offline_file(self):
"""Test whether a MARWILTrainer can be built with all frameworks.
And learns from a historic-data file.
"""
rllib_dir = Path(__file__).parent.parent.parent.parent
print("rllib dir={}".format(rllib_dir))
data_file = os.path.join(rllib_dir, "tests/data/cartpole/large.json")
print("data_file={} exists={}".format(data_file,
os.path.isfile(data_file)))
config = marwil.DEFAULT_CONFIG.copy()
config["num_workers"] = 0 # Run locally.
config["evaluation_num_workers"] = 1
config["evaluation_interval"] = 1
# Evaluate on actual environment.
config["evaluation_config"] = {"input": "sampler"}
# Learn from offline data.
config["input"] = [data_file]
num_iterations = 300
# Test for all frameworks.
for _ in framework_iterator(config):
trainer = marwil.MARWILTrainer(config=config, env="CartPole-v0")
for i in range(num_iterations):
eval_results = trainer.train()["evaluation"]
print("iter={} R={}".format(
i, eval_results["episode_reward_mean"]))
# Learn until some reward is reached on an actual live env.
if eval_results["episode_reward_mean"] > 60.0:
print("learnt!")
break
check_compute_single_action(
trainer, include_prev_action_reward=True)
trainer.stop()
if __name__ == "__main__":
import pytest
import sys
sys.exit(pytest.main(["-v", __file__]))
| apache-2.0 | -2,218,978,931,659,107,600 | 32.323077 | 77 | 0.589566 | false |
8l/beri | cheritest/trunk/tests/mt/test_mt_rdhwr.py | 2 | 1520 | #-
# Copyright (c) 2014 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. BERI licenses this
# file to you under the BERI Hardware-Software License, Version 1.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at:
#
# http://www.beri-open-systems.org/legal/license-1-0.txt
#
# Unless required by applicable law or agreed to in writing, Work distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
# @BERI_LICENSE_HEADER_END@
#
from beritest_tools import BaseBERITestCase
from nose.plugins.attrib import attr
class test_mt_rdhwr(BaseBERITestCase):
@attr('mt')
@attr('rdhwr')
@attr('userlocal')
def test_rdhwr_1(self):
'''Test that the user-local register has a per-thread value'''
self.assertRegisterEqual(self.MIPS.a0, 0, "The user local register did not have a per-thread value")
| apache-2.0 | 403,633,174,428,342,000 | 39 | 108 | 0.747368 | false |
cylc/cylc | cylc/flow/cycling/loader.py | 1 | 4880 | # THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
Tasks spawn a sequence of POINTS (P) separated by INTERVALS (I).
Each task may have multiple sequences, e.g. 12-hourly and 6-hourly.
"""
from . import integer
from . import iso8601
from metomi.isodatetime.data import Calendar
ISO8601_CYCLING_TYPE = 'iso8601'
INTEGER_CYCLING_TYPE = 'integer'
IS_OFFSET_ABSOLUTE_IMPLS = {
INTEGER_CYCLING_TYPE: integer.is_offset_absolute,
ISO8601_CYCLING_TYPE: iso8601.is_offset_absolute,
}
POINTS = {INTEGER_CYCLING_TYPE: integer.IntegerPoint,
ISO8601_CYCLING_TYPE: iso8601.ISO8601Point}
DUMP_FORMAT_GETTERS = {INTEGER_CYCLING_TYPE: integer.get_dump_format,
ISO8601_CYCLING_TYPE: iso8601.get_dump_format}
POINT_RELATIVE_GETTERS = {
INTEGER_CYCLING_TYPE: integer.get_point_relative,
ISO8601_CYCLING_TYPE: iso8601.get_point_relative
}
INTERVALS = {INTEGER_CYCLING_TYPE: integer.IntegerInterval,
ISO8601_CYCLING_TYPE: iso8601.ISO8601Interval}
SEQUENCES = {INTEGER_CYCLING_TYPE: integer.IntegerSequence,
ISO8601_CYCLING_TYPE: iso8601.ISO8601Sequence}
INIT_FUNCTIONS = {INTEGER_CYCLING_TYPE: integer.init_from_cfg,
ISO8601_CYCLING_TYPE: iso8601.init_from_cfg}
class DefaultCycler:
"""Store the default TYPE for Cyclers."""
TYPE = None
def get_point(*args, **kwargs):
"""Return a cylc.flow.cycling.PointBase-derived object from a string."""
if args[0] is None:
return None
cycling_type = kwargs.pop("cycling_type", DefaultCycler.TYPE)
return get_point_cls(cycling_type=cycling_type)(*args, **kwargs)
def get_point_cls(cycling_type=None):
"""Return the cylc.flow.cycling.PointBase-derived class we're using."""
if cycling_type is None:
cycling_type = DefaultCycler.TYPE
return POINTS[cycling_type]
def get_dump_format(cycling_type=None):
"""Return cycle point dump format, or None."""
return DUMP_FORMAT_GETTERS[cycling_type]()
def get_point_relative(*args, **kwargs):
"""Return a point from an offset expression and a base point."""
cycling_type = kwargs.pop("cycling_type", DefaultCycler.TYPE)
return POINT_RELATIVE_GETTERS[cycling_type](*args, **kwargs)
def get_interval(*args, **kwargs):
"""Return a cylc.flow.cycling.IntervalBase-derived object from a string."""
if args[0] is None:
return None
cycling_type = kwargs.pop("cycling_type", DefaultCycler.TYPE)
return get_interval_cls(cycling_type=cycling_type)(*args, **kwargs)
def get_interval_cls(cycling_type=None):
"""Return the cylc.flow.cycling.IntervalBase-derived class we're using."""
if cycling_type is None:
cycling_type = DefaultCycler.TYPE
return INTERVALS[cycling_type]
def get_sequence(*args, **kwargs):
"""Return a cylc.flow.cycling.SequenceBase-derived object from a string."""
if args[0] is None:
return None
cycling_type = kwargs.pop("cycling_type", DefaultCycler.TYPE)
return get_sequence_cls(cycling_type=cycling_type)(*args, **kwargs)
def get_sequence_cls(cycling_type=None):
"""Return the cylc.flow.cycling.SequenceBase-derived class we're using."""
if cycling_type is None:
cycling_type = DefaultCycler.TYPE
return SEQUENCES[cycling_type]
def init_cyclers(cfg):
"""Initialise cycling specifics using the suite configuration (cfg)."""
DefaultCycler.TYPE = cfg['scheduling']['cycling mode']
if DefaultCycler.TYPE in Calendar.MODES:
DefaultCycler.TYPE = ISO8601_CYCLING_TYPE
INIT_FUNCTIONS[DefaultCycler.TYPE](cfg)
def is_offset_absolute(offset_string, **kwargs):
"""Return True if offset_string is a point rather than an interval."""
cycling_type = kwargs.pop("cycling_type", DefaultCycler.TYPE)
return IS_OFFSET_ABSOLUTE_IMPLS[cycling_type](offset_string)
def standardise_point_string(point_string, cycling_type=None):
"""Return a standardised version of point_string."""
if point_string is None:
return None
point = get_point(point_string, cycling_type=cycling_type)
if point is not None:
point.standardise()
point_string = str(point)
return point_string
| gpl-3.0 | 2,625,730,440,720,114,000 | 33.366197 | 79 | 0.71168 | false |
tjmonsi/cmsc129-2016-repo | submissions/exercise3/pitargue/lexical_analyzer.py | 1 | 8280 | import string
class DFA:
keywords = [
'var',
'input',
'output',
'break',
'continue',
'if',
'elsif',
'else',
'switch',
'case',
'default',
'while',
'do',
'for',
'foreach',
'in',
'function',
'return',
'true',
'false'
]
def __init__(self, transition_functions, start_state, accept_states):
self.transition_functions = transition_functions
self.accept_states = accept_states
self.start_state = start_state
self.state_count = 0 + len(accept_states)
self.token = ''
def create_keyword(self, keyword, name):
current_state = self.start_state
for i in range(len(keyword)):
if (current_state, keyword[i]) in self.transition_functions.keys():
current_state = self.transition_functions[(current_state, keyword[i])]
else:
self.state_count += 1
self.transition_functions[(current_state, keyword[i])] = current_state = self.state_count
self.accept_states[self.state_count] = name.upper() + '_KEYWORD'
# create a list of lexemes (a tuple containing the lexeme name and the token) based from the given input
def tokenize(self, input):
result = []
current_state = self.start_state
for i in range(len(input)):
if (current_state, input[i]) in self.transition_functions.keys():
temp = self.transition_functions[(current_state, input[i])]
self.token = self.token + input[i]
current_state = temp
if i+1 < len(input):
if current_state in self.accept_states.keys() and (current_state, input[i+1]) not in self.transition_functions.keys():
#result.append((self.accept_states[current_state], self.token))
res = self.accept_states[current_state]
if res == 'IDENTIFIER':
if self.token in self.keywords:
result.append((self.token.upper() + '_KEYWORD', self.token))
else:
result.append((res, self.token))
else:
result.append((self.accept_states[current_state], self.token))
self.token = ''
current_state = self.start_state
elif current_state in self.accept_states.keys():
#result.append((self.accept_states[current_state], self.token))
res = self.accept_states[current_state]
if res == 'IDENTIFIER':
if self.token in self.keywords:
result.append((self.token.upper() + '_KEYWORD', self.token))
else:
result.append((res, self.token))
else:
result.append((self.accept_states[current_state], self.token))
self.token = ''
current_state = self.start_state
else:
result.append(('UNKNOWN_TOKEN', self.token))
self.token = ''
return result
def create_DFA():
dfa = DFA({}, 0, {})
# add dfa for keywords
#dfa.create_keyword('def', 'identifier')
#dfa.create_keyword('input', 'input')
#dfa.create_keyword('output', 'output')
#dfa.create_keyword('break', 'break')
#dfa.create_keyword('continue', 'continue')
#dfa.create_keyword('if', 'if')
#dfa.create_keyword('elsif', 'else_if')
#dfa.create_keyword('else', 'else')
#dfa.create_keyword('switch', 'switch')
#dfa.create_keyword('case', 'case')
#dfa.create_keyword('default', 'default')
#dfa.create_keyword('while', 'while')
#dfa.create_keyword('do', 'do')
#dfa.create_keyword('for', 'for')
#dfa.create_keyword('foreach', 'foreach')
#dfa.create_keyword('in', 'in')
#dfa.create_keyword('function', 'function')
#dfa.create_keyword('return', 'return')
#dfa.create_keyword('true', 'true')
#dfa.create_keyword('false', 'false')
# add dfa for symbols
dfa.create_keyword('(', 'open_parenthesis')
dfa.create_keyword(')', 'close_parenthesis')
dfa.create_keyword('[', 'open_bracket')
dfa.create_keyword(']', 'close_bracket')
dfa.create_keyword('{', 'open_curly_brace')
dfa.create_keyword('}', 'close_curly_brace')
dfa.create_keyword(';', 'semicolon')
dfa.create_keyword(',', 'comma')
dfa.create_keyword('?', 'question_mark')
dfa.create_keyword(':', 'colon')
dfa.create_keyword('+', 'plus')
dfa.create_keyword('-', 'minus')
dfa.create_keyword('*', 'multiply')
dfa.create_keyword('/', 'divide')
dfa.create_keyword('%', 'modulo')
dfa.create_keyword('=', 'equal_sign')
dfa.create_keyword('&&', 'and')
dfa.create_keyword('||', 'or')
dfa.create_keyword('!', 'not')
dfa.create_keyword('==', 'equals')
dfa.create_keyword('!=', 'not_equals')
dfa.create_keyword('>', 'greater_than')
dfa.create_keyword('<', 'less_than')
dfa.create_keyword('>=', 'greater_than_or_equals')
dfa.create_keyword('<=', 'less_than_or_equals')
dfa.create_keyword('++', 'increment')
dfa.create_keyword('--', 'decrement')
# add dfa for number literals
current_state = dfa.start_state
dfa.state_count += 1
for c in string.digits:
dfa.transition_functions[(current_state, c)] = dfa.state_count
dfa.transition_functions[(dfa.start_state, c)] = dfa.state_count
dfa.transition_functions[(dfa.state_count, c)] = dfa.state_count
dfa.accept_states[dfa.state_count] = 'INTEGER_LITERAL'
current_state = dfa.state_count
dfa.state_count += 1
dfa.transition_functions[(current_state, '.')] = dfa.state_count
dfa.transition_functions[(dfa.start_state, '.')] = dfa.state_count
current_state = dfa.state_count
dfa.state_count += 1
for c in string.digits:
dfa.transition_functions[(current_state, c)] = dfa.state_count
dfa.transition_functions[(dfa.state_count, c)] = dfa.state_count
dfa.accept_states[dfa.state_count] = 'FLOAT_LITERAL'
# add dfa for string literals
current_state = dfa.start_state
dfa.state_count += 1
dfa.transition_functions[(current_state, '"')] = dfa.state_count
current_state = dfa.state_count
dfa.state_count += 1
for c in string.printable:
dfa.transition_functions[(current_state, c)] = dfa.state_count
dfa.transition_functions[(dfa.state_count, c)] = dfa.state_count
current_state = dfa.state_count
dfa.state_count += 1
dfa.transition_functions[(current_state, '"')] = dfa.state_count
dfa.accept_states[dfa.state_count] = 'STRING_LITERAL';
# add dfa for single line comment
current_state = dfa.start_state
dfa.state_count += 1
dfa.transition_functions[(current_state, '@')] = dfa.state_count
current_state = dfa.state_count
dfa.state_count += 1
for c in string.printable:
dfa.transition_functions[(current_state, c)] = dfa.state_count
dfa.transition_functions[(dfa.state_count, c)] = dfa.state_count
current_state = dfa.state_count
dfa.state_count += 1
dfa.transition_functions[(current_state, '\n')] = dfa.state_count
dfa.accept_states[dfa.state_count] = 'SINGLE-LINE COMMENT'
# add dfa for identifiers
current_state = dfa.start_state
dfa.state_count += 1
for c in string.ascii_letters:
dfa.transition_functions[(current_state, c)] = dfa.state_count
#current_state = dfa.state_count
#dfa.state_count += 1
for c in string.ascii_letters:
#dfa.transition_functions[(current_state, c)] = dfa.state_count
dfa.transition_functions[(dfa.state_count, c)] = dfa.state_count
for c in string.digits:
#dfa.transition_functions[(current_state, c)] = dfa.state_count
dfa.transition_functions[(dfa.state_count, c)] = dfa.state_count
#dfa.transition_functions[(current_state, '_')] = dfa.state_count
dfa.transition_functions[(dfa.state_count, '_')] = dfa.state_count
dfa.accept_states[dfa.state_count] = 'IDENTIFIER'
return dfa
| mit | 3,629,047,361,692,439,600 | 39.990099 | 134 | 0.586957 | false |
aipescience/django-daiquiri | daiquiri/core/adapter/download/base.py | 1 | 4910 | import logging
import csv
import subprocess
import re
from django.conf import settings
from daiquiri.core.generators import generate_csv, generate_votable, generate_fits
from daiquiri.core.utils import get_doi_url
logger = logging.getLogger(__name__)
class BaseDownloadAdapter(object):
def __init__(self, database_key, database_config):
self.database_key = database_key
self.database_config = database_config
def generate(self, format_key, columns, sources=[], schema_name=None, table_name=None, nrows=None,
query_status=None, query=None, query_language=None):
# create the final list of arguments subprocess.Popen
if format_key == 'sql':
# create the final list of arguments subprocess.Popen
self.set_args(schema_name, table_name)
return self.generate_dump()
else:
# create the final list of arguments subprocess.Popen
self.set_args(schema_name, table_name, data_only=True)
# prepend strings with settings.FILES_BASE_PATH if they refer to files
prepend = self.get_prepend(columns)
if format_key == 'csv':
return generate_csv(self.generate_rows(prepend=prepend), columns)
elif format_key == 'votable':
return generate_votable(self.generate_rows(prepend=prepend), columns,
table=self.get_table_name(schema_name, table_name),
infos=self.get_infos(query_status, query, query_language, sources),
links=self.get_links(sources),
empty=(nrows==0))
elif format_key == 'fits':
return generate_fits(self.generate_rows(prepend=prepend), columns, nrows,
table_name=self.get_table_name(schema_name, table_name))
else:
raise Exception('Not supported.')
def generate_dump(self):
# log the arguments
logger.debug('execute "%s"' % ' '.join(self.args))
# excecute the subprocess
try:
process = subprocess.Popen(self.args, stdout=subprocess.PIPE)
for line in process.stdout:
if not line.startswith((b'\n', b'\r\n', b'--', b'SET', b'/*!')):
yield line.decode()
except subprocess.CalledProcessError as e:
logger.error('Command PIPE returned non-zero exit status: %s' % e)
def generate_rows(self, prepend=None):
# log the arguments
logger.debug('execute "%s"' % ' '.join(self.args))
# excecute the subprocess
try:
process = subprocess.Popen(self.args, stdout=subprocess.PIPE)
for line in process.stdout:
insert_pattern = re.compile('^INSERT INTO .*? VALUES \((.*?)\);')
insert_result = insert_pattern.match(line.decode())
if insert_result:
line = insert_result.group(1)
reader = csv.reader([line], quotechar="'", skipinitialspace=True)
row = next(reader)
if prepend:
yield [(prepend[i] + cell if (i in prepend and cell != 'NULL') else cell) for i, cell in enumerate(row)]
else:
yield row
except subprocess.CalledProcessError as e:
logger.error('Command PIPE returned non-zero exit status: %s' % e)
def get_prepend(self, columns):
if not settings.FILES_BASE_URL:
return {}
# prepend strings with settings.FILES_BASE_PATH if they refer to files
prepend = {}
for i, column in enumerate(columns):
column_ucd = column.get('ucd')
if column_ucd and 'meta.ref' in column_ucd and \
('meta.file' in column_ucd or
'meta.note' in column_ucd or
'meta.image' in column_ucd):
prepend[i] = settings.FILES_BASE_URL
return prepend
def get_table_name(self, schema_name, table_name):
return '%(schema_name)s.%(table_name)s' % {
'schema_name': schema_name,
'table_name': table_name
}
def get_infos(self, query_status, query, query_language, sources):
infos = [
('QUERY_STATUS', query_status),
('QUERY', query),
('QUERY_LANGUAGE', query_language)
]
for source in sources:
infos.append(('SOURCE', '%(schema_name)s.%(table_name)s' % source))
return infos
def get_links(self, sources):
return [(
'%(schema_name)s.%(table_name)s' % source,
'doc',
get_doi_url(source['doi']) if source['doi'] else source['url']
) for source in sources]
| apache-2.0 | 6,772,274,127,375,952,000 | 36.480916 | 128 | 0.555804 | false |
hiro2016/ergodox_gui_configurator | GUIComponents/KeyPresstInterceptorComponent.py | 1 | 9286 | import platform
from threading import Timer
from PyQt5 import QtCore
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QTextEdit, QLabel, QSizePolicy, QLineEdit, QApplication, QWidget
import sys
from NoneGUIComponents import keypress_observer
from NoneGUIComponents.dict_keys import *
from NoneGUIComponents.key_conf_dict_parser import KeyConfDictParser
class KeyPressInterceptorComponent(QVBoxLayout, QObject):
"""""
A GUI component:
label, QTextEdit(Captures the last user key stroke when selected).
label, label(shows the guesstimate of the hid usage id)
label, QTextEdit(shows the keyname;editiable)
The last item is editable because it's it's part of display string
for QPushButtons in CentralWidget.
Upon a key press this script finds:
the key's common name if available
Upon a key press this script guess:
the keycode hid usage id the key sends
To manage two information sources, pyxhook and QTextEdit,
each running in its own thread and updating gui independently,
using flag:
boolean literalUpdated
and
Timer to check if QTextEdit field needs to be cleared.
Ugly but truly solving the issue is not worth the effort as of now.
Note:
method call chains:
QTextEdit event -> eventFilter -> connect_keypress_observer ->
pyxhook connection established.
QTextEdit event -> eventFilter -> disconnect_keypress_observer ->
disconnect pyxhook connection.
pyxhook keypress event -> inner function onKeyPress ->
signalKeyPressed-> on_key_pressed
pyxhook keypress event -> inner function onKeyPress ->
fieldUpdateTimer -> inner function checkIfModifierKeyPressed
"""""
# Here to call QTextEdit method from non-qt thread.
# connected to on_key_pressed
signalKeyPressed = pyqtSignal(str, str)
# sets literal_input_te to "" from any thread.
signalClearTextEdit = pyqtSignal()
# referenced and set by by fieldUpdateTimer param function
# checkIfModifierKeyPressed.
# set by __init_gui::filter
# Used to check if QLineEdit needs to be updated/cleared
literalUpdated = False
# Used Like PostDelayed or Future.
# Decide whether to clear the literal_input_et after
# both Qt and keypress_observer callback are completed.
fieldUpdateTimer = None
def __init__(self, prv_config:dict={}):
super().__init__()
self.__init_gui(prv_config)
self.is_keypress_observer_connected = False
# Enable user input scanning only when the top mont QTextEdit is
# selected.
self.literal_input_te.installEventFilter(self)
# clears text edit where user select to capture scancode
# this is necessary to make sure the te contains nothing
# after the user presses a modifier key.
te = self.literal_input_te
self.signalClearTextEdit.connect(lambda f=te: f.clear())
self.setFocus()
# initializing attributes
self.keypress_observer = None
def setFocus(self, reason=QtCore.Qt.NoFocusReason):
self.literal_input_te.setFocus(reason)
# Only connected when QTextEdit is selected.
def connect_keypress_observer(self):
if self.is_keypress_observer_connected == True:
return
self.signalKeyPressed.connect(self.on_key_pressed)
# qwidget cannot be accessed by an external thread, so doing it via signal.
def onKeyPress(hid_usage_id:str, keyname:str, trigger = self.signalKeyPressed ):
trigger.emit(hid_usage_id,keyname)
# Check if the key pressed is a modifier. If so, clear literal_input_te.
def checkIfModifierKeyPressed():
if not self.literalUpdated:
self.signalClearTextEdit.emit()
self.literalUpdated = False
self.fieldUpdateTimer = None
self.fieldUpdateTimer = Timer(0.05, checkIfModifierKeyPressed)
self.fieldUpdateTimer.start()
self.keypress_observer = keypress_observer.KeyPressObserver(onKeyPress)
self.is_keypress_observer_connected = True
def disconnect_keypress_observer(self):
# this maybe called after closeEvent
# OR before connect called
try:
self.signalKeyPressed.disconnect()
except TypeError as e:
print(e)
msg = "disconnect() failed between 'signalKeyPressed' and all its connections"
if msg not in str(e):
raise e
if self.keypress_observer is not None:
if self.is_keypress_observer_connected:
self.keypress_observer.destroy()
self.keypress_observer = None
self.is_keypress_observer_connected = False
def __init_gui(self,d):
p = KeyConfDictParser(d)
# self.font = QFont()
# self.font.setPointSize(13)
bl = self
# bl = self.vertical_box_layout = QVBoxLayout()
hl1 = QHBoxLayout()
hl1.setContentsMargins(0,5,5, 5)
hl1.setSpacing(5)
# literal row
l_literal = QLabel("input literal")
self.literal_input_te = input_literal = QLineEdit()
# input_literal.setMaximumHeight(font_height)
# input_literal.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
def filter():
length = len(input_literal.text())
self.literalUpdated = True
if length == 2:
c = input_literal.cursor()
# c = input_literal.textCursor()
# c.movePosition(QTextCursor.Left,QTextCursor.MoveAnchor)
# c.deletePreviousChar()
# c.movePosition(QTextCursor.Right,QTextCursor.MoveAnchor)
ct = input_literal.text()
input_literal.clear()
input_literal.setText(ct[1])
input_literal.textChanged.connect(filter
# stackoverflow
# lambda: te.setText(te.toPlainText()[-1])
)
hl1.addWidget(l_literal)
hl1.addWidget(input_literal)
# hid usage id row
hl2 = QHBoxLayout()
hl2.setContentsMargins(0,5,5, 5)
hl2.setSpacing(5)
l_hid_usage_id = QLabel("HID usage id:")
hl2.addWidget(l_hid_usage_id)
self.hid_usage_id_display = QLabel()# contents will be set upon user input
self.hid_usage_id_display.setText(p.hid_usage_id)
hl2.addWidget(self.hid_usage_id_display)
# key name row
hl3 = QHBoxLayout()
hl3.setContentsMargins(0,5,5, 5)
hl3.setSpacing(5)
l_key_name = QLabel("Key's name")
hl3.addWidget(l_key_name)
self.key_name = QLineEdit()# contents will be set upon user input
self.key_name.setText(p.keyname)
# self.key_name.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
# self.key_name.setMaximumHeight(font_height)
hl3.addWidget(self.key_name)
bl.addLayout(hl1)
bl.addLayout(hl2)
bl.addLayout(hl3)
# self.setSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding)
# self.setLayout(bl)
bl.setAlignment(QtCore.Qt.AlignTop)
# self.setGeometry(3,3,300,300)
# print(self.geometry().height())
# self.setStyleSheet("background-color:red;")
def on_key_pressed(self, hid_usage_id:str, common_keyname:str):
self.hid_usage_id_display.setText(hid_usage_id)
self.key_name.setText(str(common_keyname))
def closeEvent(self, QCloseEvent):
self.disconnect_keypress_observer()
super().closeEvent(QCloseEvent)
def eventFilter(self, source, event):
if(source is not self.literal_input_te):
return super().eventFilter(source, event)
# sometimes FocusIn is called twice.
if event.type() == QtCore.QEvent.FocusOut:
if self.is_keypress_observer_connected:
self.disconnect_keypress_observer()
elif event.type() == QtCore.QEvent.FocusIn:
if not self.is_keypress_observer_connected:
self.connect_keypress_observer()
return super().eventFilter(source, event)
def getData(self) -> dict:
data = {
key_hid_usage_id :self.hid_usage_id_display.text(),
key_key_name:self.key_name.text()
}
return data
def setEnabled(self,state):
self.key_name.setEnabled(state)
self.literal_input_te.setEnabled(state)
if state:
self.setFocus()
self.connect_keypress_observer()
else:
self.disconnect_keypress_observer()
if __name__ == "__main__":
app = QApplication(sys.argv)
# t = ScancodeViewer()
# t = KeyCodeViewer()
w = QWidget()
t = KeyPressInterceptorComponent()
w.setLayout(t)
w.show ()
r = app.exec_()
sys.exit(r)
print(t.getData())
| gpl-2.0 | -1,803,215,776,816,161,300 | 35.703557 | 118 | 0.620719 | false |
vprusso/youtube_tutorials | web_scraping_and_automation/selenium/craigstlist_scraper.py | 1 | 2952 | # YouTube Video (Part 1): https://www.youtube.com/watch?v=4o2Eas2WqAQ&t=0s&list=PL5tcWHG-UPH1aSWALagYP2r3RMmuslcrr
# YouTube Video (Part 2): https://www.youtube.com/watch?v=x5o0XFozYnE&t=716s&list=PL5tcWHG-UPH1aSWALagYP2r3RMmuslcrr
# YouTube Video (Part 3): https://www.youtube.com/watch?v=_y43iqSJgnc&t=1s&list=PL5tcWHG-UPH1aSWALagYP2r3RMmuslcrr
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from bs4 import BeautifulSoup
import urllib.request
class CraiglistScraper(object):
def __init__(self, location, postal, max_price, radius):
self.location = location
self.postal = postal
self.max_price = max_price
self.radius = radius
self.url = f"https://{location}.craigslist.org/search/sss?search_distance={radius}&postal={postal}&max_price={max_price}"
self.driver = webdriver.Firefox()
self.delay = 3
def load_craigslist_url(self):
self.driver.get(self.url)
try:
wait = WebDriverWait(self.driver, self.delay)
wait.until(EC.presence_of_element_located((By.ID, "searchform")))
print("Page is ready")
except TimeoutException:
print("Loading took too much time")
def extract_post_information(self):
all_posts = self.driver.find_elements_by_class_name("result-row")
dates = []
titles = []
prices = []
for post in all_posts:
title = post.text.split("$")
if title[0] == '':
title = title[1]
else:
title = title[0]
title = title.split("\n")
price = title[0]
title = title[-1]
title = title.split(" ")
month = title[0]
day = title[1]
title = ' '.join(title[2:])
date = month + " " + day
#print("PRICE: " + price)
#print("TITLE: " + title)
#print("DATE: " + date)
titles.append(title)
prices.append(price)
dates.append(date)
return titles, prices, dates
def extract_post_urls(self):
url_list = []
html_page = urllib.request.urlopen(self.url)
soup = BeautifulSoup(html_page, "lxml")
for link in soup.findAll("a", {"class": "result-title hdrlnk"}):
print(link["href"])
url_list.append(link["href"])
return url_list
def quit(self):
self.driver.close()
location = "sfbay"
postal = "94201"
max_price = "500"
radius = "5"
scraper = CraiglistScraper(location, postal, max_price, radius)
scraper.load_craigslist_url()
titles, prices, dates = scraper.extract_post_information()
print(titles)
#scraper.extract_post_urls()
#scraper.quit()
| gpl-3.0 | 6,487,594,359,226,624,000 | 30.073684 | 129 | 0.609417 | false |
cisco-oss-eng/Cloud99 | cloud99/loaders/__init__.py | 1 | 2556 | # Copyright 2016 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import abc
import pykka
from cloud99.logging_setup import LOGGER
class TaskStatus(object):
INIT = "init"
STOPPED = "stopped"
ABORTED = "aborted"
FINISHED = "finished"
class BaseLoader(pykka.ThreadingActor):
def __init__(self, observer, openrc, inventory, **params):
# args kept to match signature
super(BaseLoader, self).__init__()
self.observer = observer
self.task_status = TaskStatus.INIT
self.runner_thread = None
self.checker_thread = None
self.times = 0
def on_receive(self, message):
msg = message.get('msg')
params = message.get("params")
if msg == 'validate_config':
self.validate_config()
if msg == 'start':
self.execute(params)
if msg == "stop_task":
self.abort()
if msg == 'stop':
self.stop()
def abort(self):
self.task_status = TaskStatus.ABORTED
self.wait_for_threads()
self.observer.tell({'msg': 'loader_finished', "times": self.times})
def stop(self):
self.task_status = TaskStatus.STOPPED
self.wait_for_threads()
super(BaseLoader, self).stop()
def wait_for_threads(self):
if self.runner_thread:
self.runner_thread.join()
if self.checker_thread:
self.checker_thread.join()
self.reset()
def reset(self):
self.runner_thread = None
self.checker_thread = None
self.task_status = TaskStatus.INIT
def on_failure(self, exception_type, exception_value, traceback):
LOGGER.error(exception_type, exception_value, traceback)
@abc.abstractmethod
def validate_config(self):
""""""
@abc.abstractmethod
def execute(self, params=None):
""" """
@abc.abstractmethod
def load(self, **params):
""""""
@abc.abstractmethod
def check(self, **params):
""" """
| apache-2.0 | 4,718,103,721,506,559,000 | 28.045455 | 75 | 0.625978 | false |
olimastro/DeepMonster | deepmonster/lasagne/nn.py | 1 | 16191 | """
neural network stuff, intended to be used with Lasagne
All this code, except otherwise mentionned,
was written by openai taken from improvedgan repo on github
"""
import numpy as np
import theano as th
import theano.tensor as T
from theano.tensor.nnet.abstract_conv import (bilinear_upsampling, )
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
import lasagne
from lasagne.layers import dnn, ElemwiseSumLayer, NonlinearityLayer
from lasagne.init import Normal, Constant
from deepmonster.adlf.utils import parse_tuple
# T.nnet.relu has some stability issues, this is better
def relu(x):
return T.maximum(x, 0)
def lrelu(x, a=0.2):
return T.maximum(x, a*x)
# kyle's relu
def divrelu(x):
return (x + abs(x)) / 2.
# kyle's tanh
def hard_tanh(x):
return T.clip(x, -1., 1.)
def centered_softplus(x):
return T.nnet.softplus(x) - np.cast[th.config.floatX](np.log(2.))
def log_sum_exp(x, axis=1):
m = T.max(x, axis=axis, keepdims=True)
return m+T.log(T.sum(T.exp(x-m), axis=axis) + 1e-9)
def adam_updates(params, cost, lr=0.001, mom1=0.9, mom2=0.999):
updates = []
grads = T.grad(cost, params)
t = th.shared(np.cast[th.config.floatX](1.))
for p, g in zip(params, grads):
v = th.shared(np.cast[th.config.floatX](p.get_value() * 0.))
mg = th.shared(np.cast[th.config.floatX](p.get_value() * 0.))
v_t = mom1*v + (1. - mom1)*g
mg_t = mom2*mg + (1. - mom2)*T.square(g)
v_hat = v_t / (1. - mom1 ** t)
mg_hat = mg_t / (1. - mom2 ** t)
g_t = v_hat / T.sqrt(mg_hat + 1e-8)
p_t = p - lr * g_t
updates.append((v, v_t))
updates.append((mg, mg_t))
updates.append((p, p_t))
updates.append((t, t+1))
return updates
class WeightNormLayer(lasagne.layers.Layer):
def __init__(self, incoming, b=lasagne.init.Constant(0.), g=lasagne.init.Constant(1.),
W=lasagne.init.Normal(0.05), train_g=False, init_stdv=1., nonlinearity=relu, **kwargs):
super(WeightNormLayer, self).__init__(incoming, **kwargs)
self.nonlinearity = nonlinearity
self.init_stdv = init_stdv
k = self.input_shape[1]
if b is not None:
self.b = self.add_param(b, (k,), name="b", regularizable=False)
if g is not None:
self.g = self.add_param(g, (k,), name="g", regularizable=False, trainable=train_g)
if len(self.input_shape)==4:
self.axes_to_sum = (0,2,3)
self.dimshuffle_args = ['x',0,'x','x']
else:
self.axes_to_sum = 0
self.dimshuffle_args = ['x',0]
# scale weights in layer below
incoming.W_param = incoming.W
#incoming.W_param.set_value(W.sample(incoming.W_param.get_value().shape))
if incoming.W_param.ndim==4:
if isinstance(incoming, Deconv2DLayer):
W_axes_to_sum = (0,2,3)
W_dimshuffle_args = ['x',0,'x','x']
else:
W_axes_to_sum = (1,2,3)
W_dimshuffle_args = [0,'x','x','x']
else:
W_axes_to_sum = 0
W_dimshuffle_args = ['x',0]
if g is not None:
incoming.W = incoming.W_param * (self.g/T.sqrt(1e-6 + T.sum(T.square(incoming.W_param),axis=W_axes_to_sum))).dimshuffle(*W_dimshuffle_args)
else:
incoming.W = incoming.W_param / T.sqrt(1e-6 + T.sum(T.square(incoming.W_param),axis=W_axes_to_sum,keepdims=True))
def get_output_for(self, input, init=False, **kwargs):
if init:
m = T.mean(input, self.axes_to_sum)
input -= m.dimshuffle(*self.dimshuffle_args)
inv_stdv = self.init_stdv/T.sqrt(T.mean(T.square(input), self.axes_to_sum))
input *= inv_stdv.dimshuffle(*self.dimshuffle_args)
self.init_updates = [(self.b, -m*inv_stdv), (self.g, self.g*inv_stdv)]
elif hasattr(self,'b'):
input += self.b.dimshuffle(*self.dimshuffle_args)
return self.nonlinearity(input)
def weight_norm(layer, **kwargs):
nonlinearity = getattr(layer, 'nonlinearity', None)
if nonlinearity is not None:
layer.nonlinearity = lasagne.nonlinearities.identity
if hasattr(layer, 'b'):
del layer.params[layer.b]
layer.b = None
return WeightNormLayer(layer, nonlinearity=nonlinearity, **kwargs)
class Deconv2DLayer(lasagne.layers.Layer):
def __init__(self, incoming, target_shape, filter_size, stride=(2, 2), pad='half',
W=lasagne.init.Normal(0.05), b=lasagne.init.Constant(0.), nonlinearity=relu, **kwargs):
super(Deconv2DLayer, self).__init__(incoming, **kwargs)
self.target_shape = target_shape
self.nonlinearity = (lasagne.nonlinearities.identity if nonlinearity is None else nonlinearity)
self.filter_size = lasagne.layers.dnn.as_tuple(filter_size, 2)
self.stride = lasagne.layers.dnn.as_tuple(stride, 2)
self.pad = pad
self.W_shape = (incoming.output_shape[1], target_shape[1], filter_size[0], filter_size[1])
self.W = self.add_param(W, self.W_shape, name="W")
if b is not None:
self.b = self.add_param(b, (target_shape[1],), name="b")
else:
self.b = None
def get_output_for(self, input, **kwargs):
op = T.nnet.abstract_conv.AbstractConv2d_gradInputs(
imshp=self.target_shape, kshp=self.W_shape, subsample=self.stride, border_mode=self.pad)
activation = op(self.W, input, self.target_shape[2:])
if self.b is not None:
activation += self.b.dimshuffle('x', 0, 'x', 'x')
return self.nonlinearity(activation)
def get_output_shape_for(self, input_shape):
return self.target_shape
# minibatch discrimination layer
class MinibatchLayer(lasagne.layers.Layer):
def __init__(self, incoming, num_kernels, dim_per_kernel=5, theta=lasagne.init.Normal(0.05),
log_weight_scale=lasagne.init.Constant(0.), b=lasagne.init.Constant(-1.), **kwargs):
super(MinibatchLayer, self).__init__(incoming, **kwargs)
self.num_kernels = num_kernels
num_inputs = int(np.prod(self.input_shape[1:]))
self.theta = self.add_param(theta, (num_inputs, num_kernels, dim_per_kernel), name="theta")
self.log_weight_scale = self.add_param(log_weight_scale, (num_kernels, dim_per_kernel), name="log_weight_scale")
self.W = self.theta * (T.exp(self.log_weight_scale)/T.sqrt(T.sum(T.square(self.theta),axis=0))).dimshuffle('x',0,1)
self.b = self.add_param(b, (num_kernels,), name="b")
def get_output_shape_for(self, input_shape):
return (input_shape[0], np.prod(input_shape[1:])+self.num_kernels)
def get_output_for(self, input, init=False, **kwargs):
if input.ndim > 2:
# if the input has more than two dimensions, flatten it into a
# batch of feature vectors.
input = input.flatten(2)
activation = T.tensordot(input, self.W, [[1], [0]])
abs_dif = (T.sum(abs(activation.dimshuffle(0,1,2,'x') - activation.dimshuffle('x',1,2,0)),axis=2)
+ 1e6 * T.eye(input.shape[0]).dimshuffle(0,'x',1))
if init:
mean_min_abs_dif = 0.5 * T.mean(T.min(abs_dif, axis=2),axis=0)
abs_dif /= mean_min_abs_dif.dimshuffle('x',0,'x')
self.init_updates = [(self.log_weight_scale, self.log_weight_scale-T.log(mean_min_abs_dif).dimshuffle(0,'x'))]
f = T.sum(T.exp(-abs_dif),axis=2)
if init:
mf = T.mean(f,axis=0)
f -= mf.dimshuffle('x',0)
self.init_updates.append((self.b, -mf))
else:
f += self.b.dimshuffle('x',0)
return T.concatenate([input, f], axis=1)
class BatchNormLayer(lasagne.layers.Layer):
def __init__(self, incoming, b=lasagne.init.Constant(0.), g=lasagne.init.Constant(1.), nonlinearity=relu, **kwargs):
super(BatchNormLayer, self).__init__(incoming, **kwargs)
self.nonlinearity = nonlinearity
k = self.input_shape[1]
if b is not None:
self.b = self.add_param(b, (k,), name="b", regularizable=False)
if g is not None:
self.g = self.add_param(g, (k,), name="g", regularizable=False)
self.avg_batch_mean = self.add_param(lasagne.init.Constant(0.), (k,), name="avg_batch_mean", regularizable=False, trainable=False)
self.avg_batch_var = self.add_param(lasagne.init.Constant(1.), (k,), name="avg_batch_var", regularizable=False, trainable=False)
if len(self.input_shape)==4:
self.axes_to_sum = (0,2,3)
self.dimshuffle_args = ['x',0,'x','x']
else:
self.axes_to_sum = 0
self.dimshuffle_args = ['x',0]
def get_output_for(self, input, deterministic=False, set_bn_updates=True, **kwargs):
if deterministic:
norm_features = (input-self.avg_batch_mean.dimshuffle(*self.dimshuffle_args)) / T.sqrt(1e-6 + self.avg_batch_var).dimshuffle(*self.dimshuffle_args)
else:
batch_mean = T.mean(input,axis=self.axes_to_sum).flatten()
centered_input = input-batch_mean.dimshuffle(*self.dimshuffle_args)
batch_var = T.mean(T.square(centered_input),axis=self.axes_to_sum).flatten()
batch_stdv = T.sqrt(1e-6 + batch_var)
norm_features = centered_input / batch_stdv.dimshuffle(*self.dimshuffle_args)
# BN updates
if set_bn_updates:
new_m = 0.9*self.avg_batch_mean + 0.1*batch_mean
new_v = 0.9*self.avg_batch_var + T.cast((0.1*input.shape[0])/(input.shape[0]-1),th.config.floatX)*batch_var
self.bn_updates = [(self.avg_batch_mean, new_m), (self.avg_batch_var, new_v)]
if hasattr(self, 'g'):
activation = norm_features*self.g.dimshuffle(*self.dimshuffle_args)
else:
activation = norm_features
if hasattr(self, 'b'):
activation += self.b.dimshuffle(*self.dimshuffle_args)
return self.nonlinearity(activation)
def batch_norm(layer, b=lasagne.init.Constant(0.), g=lasagne.init.Constant(1.), **kwargs):
"""
adapted from https://gist.github.com/f0k/f1a6bd3c8585c400c190
"""
nonlinearity = getattr(layer, 'nonlinearity', None)
if nonlinearity is not None:
layer.nonlinearity = lasagne.nonlinearities.identity
else:
nonlinearity = lasagne.nonlinearities.identity
if hasattr(layer, 'b'):
del layer.params[layer.b]
layer.b = None
return BatchNormLayer(layer, b, g, nonlinearity=nonlinearity, **kwargs)
class GaussianNoiseLayer(lasagne.layers.Layer):
def __init__(self, incoming, sigma=0.1, **kwargs):
super(GaussianNoiseLayer, self).__init__(incoming, **kwargs)
self._srng = RandomStreams(lasagne.random.get_rng().randint(1, 2147462579))
self.sigma = sigma
def get_output_for(self, input, deterministic=False, use_last_noise=False, **kwargs):
if deterministic or self.sigma == 0:
return input
else:
if not use_last_noise:
self.noise = self._srng.normal(input.shape, avg=0.0, std=self.sigma)
return input + self.noise
# /////////// older code used for MNIST ////////////
# weight normalization
def l2normalize(layer, train_scale=True):
W_param = layer.W
s = W_param.get_value().shape
if len(s)==4:
axes_to_sum = (1,2,3)
dimshuffle_args = [0,'x','x','x']
k = s[0]
else:
axes_to_sum = 0
dimshuffle_args = ['x',0]
k = s[1]
layer.W_scale = layer.add_param(lasagne.init.Constant(1.),
(k,), name="W_scale", trainable=train_scale, regularizable=False)
layer.W = W_param * (layer.W_scale/T.sqrt(1e-6 + T.sum(T.square(W_param),axis=axes_to_sum))).dimshuffle(*dimshuffle_args)
return layer
# fully connected layer with weight normalization
class DenseLayer(lasagne.layers.Layer):
def __init__(self, incoming, num_units, theta=lasagne.init.Normal(0.1), b=lasagne.init.Constant(0.),
weight_scale=lasagne.init.Constant(1.), train_scale=False, nonlinearity=relu, **kwargs):
super(DenseLayer, self).__init__(incoming, **kwargs)
self.nonlinearity = (lasagne.nonlinearities.identity if nonlinearity is None else nonlinearity)
self.num_units = num_units
num_inputs = int(np.prod(self.input_shape[1:]))
self.theta = self.add_param(theta, (num_inputs, num_units), name="theta")
self.weight_scale = self.add_param(weight_scale, (num_units,), name="weight_scale", trainable=train_scale)
self.W = self.theta * (self.weight_scale/T.sqrt(T.sum(T.square(self.theta),axis=0))).dimshuffle('x',0)
self.b = self.add_param(b, (num_units,), name="b")
def get_output_shape_for(self, input_shape):
return (input_shape[0], self.num_units)
def get_output_for(self, input, init=False, deterministic=False, **kwargs):
if input.ndim > 2:
# if the input has more than two dimensions, flatten it into a
# batch of feature vectors.
input = input.flatten(2)
activation = T.dot(input, self.W)
if init:
ma = T.mean(activation, axis=0)
activation -= ma.dimshuffle('x',0)
stdv = T.sqrt(T.mean(T.square(activation),axis=0))
activation /= stdv.dimshuffle('x',0)
self.init_updates = [(self.weight_scale, self.weight_scale/stdv), (self.b, -ma/stdv)]
else:
activation += self.b.dimshuffle('x', 0)
return self.nonlinearity(activation)
# comes from Ishamel code base
def conv_layer(input_, filter_size, num_filters, stride, pad, nonlinearity=relu, W=Normal(0.02), **kwargs):
return layers.conv.Conv2DDNNLayer(input_,
num_filters=num_filters,
stride=parse_tuple(stride),
filter_size=parse_tuple(filter_size),
pad=pad,
W=W, nonlinearity=nonlinearity, **kwargs)
class BilinearUpsampling(lasagne.layers.Layer):
def __init__(self, input_, ratio, use_1D_kernel=True, **kwargs):
super(BilinearUpsampling, self).__init__(input_, **kwargs)
self.ratio = ratio
self.use_1D_kernel = use_1D_kernel
def get_output_shape_for(self, input_shape):
dims = input_shape[2:]
output_dims = tuple(c * self.ratio for c in dims)
return input_shape[:2] + output_dims
def get_output_for(self, input_, **kwargs):
return bilinear_upsampling(input_, ratio=self.ratio,
batch_size=self.input_shape[0],
num_input_channels=self.input_shape[1],
use_1D_kernel=self.use_1D_kernel)
def resnet_block(input_, filter_size, num_filters,
activation=relu, downsample=False,
no_output_act=True,
use_shortcut=False,
use_wn=False,
W_init=Normal(0.02),
**kwargs):
"""
Resnet block layer.
"""
normalization = weight_norm if use_wn else batch_norm
block = []
_stride = 2 if downsample else 1
# conv -> BN -> Relu
block.append(normalization(conv_layer(input_, filter_size, num_filters,
_stride, 'same', nonlinearity=activation,
W=W_init
)))
# Conv -> BN
block.append(normalization(conv_layer(block[-1], filter_size, num_filters, 1, 'same', nonlinearity=None,
W=W_init)))
if downsample or use_shortcut:
shortcut = conv_layer(input_, 1, num_filters, _stride, 'valid', nonlinearity=None)
block.append(ElemwiseSumLayer([shortcut, block[-1]]))
else:
block.append(ElemwiseSumLayer([input_, block[-1]]))
if not no_output_act:
block.append(NonlinearityLayer(block[-1], nonlinearity=activation))
return block[-1]
| mit | -6,252,026,180,454,746,000 | 41.94695 | 159 | 0.59601 | false |
Ghostkeeper/Luna | plugins/storage/localstorage/__init__.py | 1 | 1457 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license differs from the license provided with this software, the license provided with this software should be applied.
"""
A persistent storage plug-in that writes and reads to local file storage.
These operations are done on the local hard drive.
"""
import localstorage.local_storage #The storage implementation.
def metadata():
"""
Provides the metadata for the local storage plug-in.
:returns: Dictionary of metadata.
"""
return {
"name": "Local Storage",
"description": "Enables reading and writing files on the local hard disk.",
"version": 2,
"dependencies": {
"storagetype": {
"version_min": 3,
"version_max": 3
},
},
"storage": {
"can_read": localstorage.local_storage.can_read,
"can_write": localstorage.local_storage.can_write,
"delete": localstorage.local_storage.delete,
"exists": localstorage.local_storage.exists,
"is_directory": localstorage.local_storage.is_directory,
"iterate_directory": localstorage.local_storage.iterate_directory,
"move": localstorage.local_storage.move,
"read": localstorage.local_storage.read,
"write": localstorage.local_storage.write
}
} | cc0-1.0 | 6,680,805,290,784,910,000 | 33.714286 | 227 | 0.727522 | false |
rodrigopolo/cheatsheets | upload_video.py | 1 | 7001 | #!/usr/bin/env python
# Modified to always use the installation path to store and read the client_secrets.json and pyu-oauth2.json file
import httplib
import httplib2
import os
import random
import sys
import time
from apiclient.discovery import build
from apiclient.errors import HttpError
from apiclient.http import MediaFileUpload
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import argparser, run_flow
# Explicitly tell the underlying HTTP transport library not to retry, since
# we are handling retry logic ourselves.
httplib2.RETRIES = 1
# Maximum number of times to retry before giving up.
MAX_RETRIES = 10
# Always retry when these exceptions are raised.
RETRIABLE_EXCEPTIONS = (httplib2.HttpLib2Error, IOError, httplib.NotConnected,
httplib.IncompleteRead, httplib.ImproperConnectionState,
httplib.CannotSendRequest, httplib.CannotSendHeader,
httplib.ResponseNotReady, httplib.BadStatusLine)
# Always retry when an apiclient.errors.HttpError with one of these status
# codes is raised.
RETRIABLE_STATUS_CODES = [500, 502, 503, 504]
# The CLIENT_SECRETS_FILE variable specifies the name of a file that contains
# the OAuth 2.0 information for this application, including its client_id and
# client_secret. You can acquire an OAuth 2.0 client ID and client secret from
# the {{ Google Cloud Console }} at
# {{ https://cloud.google.com/console }}.
# Please ensure that you have enabled the YouTube Data API for your project.
# For more information about using OAuth2 to access the YouTube Data API, see:
# https://developers.google.com/youtube/v3/guides/authentication
# For more information about the client_secrets.json file format, see:
# https://developers.google.com/api-client-library/python/guide/aaa_client_secrets
# CLIENT_SECRETS_FILE = "client_secrets.json" <-- removed
CLIENT_SECRETS_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), "client_secrets.json")
USER_KEYS = os.path.join(os.path.dirname(os.path.realpath(__file__)), "pyu-oauth2.json")
# This OAuth 2.0 access scope allows an application to upload files to the
# authenticated user's YouTube channel, but doesn't allow other types of access.
YOUTUBE_UPLOAD_SCOPE = "https://www.googleapis.com/auth/youtube.upload"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
# This variable defines a message to display if the CLIENT_SECRETS_FILE is
# missing.
MISSING_CLIENT_SECRETS_MESSAGE = """
WARNING: Please configure OAuth 2.0
To make this sample run you will need to populate the client_secrets.json file
found at:
%s
with information from the {{ Cloud Console }}
{{ https://cloud.google.com/console }}
For more information about the client_secrets.json file format, please visit:
https://developers.google.com/api-client-library/python/guide/aaa_client_secrets
""" % os.path.abspath(os.path.join(os.path.dirname(__file__),
CLIENT_SECRETS_FILE))
VALID_PRIVACY_STATUSES = ("public", "private", "unlisted")
def get_authenticated_service(args):
flow = flow_from_clientsecrets(CLIENT_SECRETS_FILE,
scope=YOUTUBE_UPLOAD_SCOPE,
message=MISSING_CLIENT_SECRETS_MESSAGE)
storage = Storage(USER_KEYS)
credentials = storage.get()
if credentials is None or credentials.invalid:
credentials = run_flow(flow, storage, args)
return build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION,
http=credentials.authorize(httplib2.Http()))
def initialize_upload(youtube, options):
tags = None
if options.keywords:
tags = options.keywords.split(",")
body=dict(
snippet=dict(
title=options.title,
description=options.description,
tags=tags,
categoryId=options.category
),
status=dict(
privacyStatus=options.privacyStatus
)
)
# Call the API's videos.insert method to create and upload the video.
insert_request = youtube.videos().insert(
part=",".join(body.keys()),
body=body,
# The chunksize parameter specifies the size of each chunk of data, in
# bytes, that will be uploaded at a time. Set a higher value for
# reliable connections as fewer chunks lead to faster uploads. Set a lower
# value for better recovery on less reliable connections.
#
# Setting "chunksize" equal to -1 in the code below means that the entire
# file will be uploaded in a single HTTP request. (If the upload fails,
# it will still be retried where it left off.) This is usually a best
# practice, but if you're using Python older than 2.6 or if you're
# running on App Engine, you should set the chunksize to something like
# 1024 * 1024 (1 megabyte).
media_body=MediaFileUpload(options.file, chunksize=-1, resumable=True)
)
resumable_upload(insert_request)
# This method implements an exponential backoff strategy to resume a
# failed upload.
def resumable_upload(insert_request):
response = None
error = None
retry = 0
while response is None:
try:
print "Uploading file..."
status, response = insert_request.next_chunk()
if response is not None:
if 'id' in response:
print "Video id '%s' was successfully uploaded." % response['id']
else:
exit("The upload failed with an unexpected response: %s" % response)
except HttpError, e:
if e.resp.status in RETRIABLE_STATUS_CODES:
error = "A retriable HTTP error %d occurred:\n%s" % (e.resp.status,
e.content)
else:
raise
except RETRIABLE_EXCEPTIONS, e:
error = "A retriable error occurred: %s" % e
if error is not None:
print error
retry += 1
if retry > MAX_RETRIES:
exit("No longer attempting to retry.")
max_sleep = 2 ** retry
sleep_seconds = random.random() * max_sleep
print "Sleeping %f seconds and then retrying..." % sleep_seconds
time.sleep(sleep_seconds)
if __name__ == '__main__':
argparser.add_argument("--file", required=True, help="Video file to upload")
argparser.add_argument("--title", help="Video title", default="Test Title")
argparser.add_argument("--description", help="Video description",
default="Test Description")
argparser.add_argument("--category", default="22",
help="Numeric video category. " +
"See https://developers.google.com/youtube/v3/docs/videoCategories/list")
argparser.add_argument("--keywords", help="Video keywords, comma separated",
default="")
argparser.add_argument("--privacyStatus", choices=VALID_PRIVACY_STATUSES,
default=VALID_PRIVACY_STATUSES[0], help="Video privacy status.")
args = argparser.parse_args()
if not os.path.exists(args.file):
exit("Please specify a valid file using the --file= parameter.")
youtube = get_authenticated_service(args)
try:
initialize_upload(youtube, args)
except HttpError, e:
print "An HTTP error %d occurred:\n%s" % (e.resp.status, e.content)
| mit | -5,672,397,897,091,849,000 | 37.048913 | 113 | 0.713755 | false |
WSULib/combine | tests/test_models/test_validation_scenario.py | 1 | 2903 | from django.test import TestCase
from core.models import ValidationScenario
from tests.utils import TestConfiguration
SCHEMATRON_PAYLOAD = '''<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:internet="http://internet.com">
<ns prefix="internet" uri="http://internet.com"/>
<!-- Required top level Elements for all records record -->
<pattern>
<title>Required Elements for Each MODS record</title>
<rule context="root">
<assert test="titleInfo">There must be a title element</assert>
</rule>
</pattern>
</schema>'''
class ValidationScenarioTestCase(TestCase):
@classmethod
def setUpTestData(cls):
cls.schematron_attributes = {
'name': 'Test Schematron Validation',
'payload': SCHEMATRON_PAYLOAD,
'validation_type': 'sch',
'default_run': False
}
cls.schematron_validation_scenario = ValidationScenario(**cls.schematron_attributes)
cls.schematron_validation_scenario.save()
cls.config = TestConfiguration()
def test_str(self):
self.assertEqual('ValidationScenario: Test Schematron Validation, validation type: sch, default run: False',
format(ValidationScenarioTestCase.schematron_validation_scenario))
def test_as_dict(self):
as_dict = ValidationScenarioTestCase.schematron_validation_scenario.as_dict()
for k, v in ValidationScenarioTestCase.schematron_attributes.items():
self.assertEqual(as_dict[k], v)
def test_validate_record_schematron(self):
record = ValidationScenarioTestCase.config.record
validation = ValidationScenarioTestCase.schematron_validation_scenario.validate_record(record)
parsed = validation['parsed']
self.assertEqual(parsed['passed'], [])
self.assertEqual(parsed['fail_count'], 1)
self.assertEqual(parsed['failed'], ['There must be a title element'])
def test_validate_record_python(self):
python_validation = '''from lxml import etree
def test_has_foo(row, test_message="There must be a foo"):
doc_xml = etree.fromstring(row.document.encode('utf-8'))
foo_elem_query = doc_xml.xpath('foo', namespaces=row.nsmap)
return len(foo_elem_query) > 0
'''
python_validation_scenario = ValidationScenario(
name='Test Python Validation',
payload=python_validation,
validation_type='python'
)
validation = python_validation_scenario.validate_record(ValidationScenarioTestCase.config.record)
parsed = validation['parsed']
self.assertEqual(parsed['fail_count'], 0)
self.assertEqual(parsed['passed'], ['There must be a foo'])
def test_validate_record_es_query(self):
# TODO: write a test :|
pass
def test_validate_record_xsd(self):
# TODO: write a test :|
pass
| mit | -102,594,079,670,103,680 | 40.471429 | 116 | 0.672408 | false |
foreni-packages/hachoir-parser | setup.py | 1 | 2770 | #!/usr/bin/env python
from imp import load_source
from os import path
from sys import argv
# Procedure to release a new version:
# - edit hachoir_parser/version.py: __version__ = "XXX"
# - edit setup.py: install_options["install_requires"] = "hachoir-core>=XXX"
# - edit INSTALL: update Dependencies
# - run: ./tests/run_testcase.py ~/testcase
# - edit ChangeLog (set release date)
# - run: hg commit
# - run: hg tag hachoir-parser-XXX
# - run: hg push
# - run: ./README.py
# - run: python2.5 ./setup.py --setuptools register sdist bdist_egg upload
# - run: python2.4 ./setup.py --setuptools bdist_egg upload
# - run: python2.6 ./setup.py --setuptools bdist_egg upload
# - run: rm README
# - check http://pypi.python.org/pypi/hachoir-parser
# - update the website
# * http://bitbucket.org/haypo/hachoir/wiki/Install/source
# * http://bitbucket.org/haypo/hachoir/wiki/Home
# - edit hachoir_parser/version.py: set version to N+1
# - edit ChangeLog: add a new "hachoir-parser N+1" section with text XXX
CLASSIFIERS = [
'Intended Audience :: Developers',
'Development Status :: 5 - Production/Stable',
'Environment :: Console :: Curses',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: OS Independent',
'Natural Language :: English',
'Programming Language :: Python']
MODULES = (
"archive", "audio", "container", "common", "file_system", "game",
"image", "misc", "network", "program", "video")
def main():
if "--setuptools" in argv:
argv.remove("--setuptools")
from setuptools import setup
use_setuptools = True
else:
from distutils.core import setup
use_setuptools = False
hachoir_parser = load_source("version", path.join("hachoir_parser", "version.py"))
PACKAGES = {"hachoir_parser": "hachoir_parser"}
for name in MODULES:
PACKAGES["hachoir_parser." + name] = "hachoir_parser/" + name
readme = open('README')
long_description = readme.read()
readme.close()
install_options = {
"name": hachoir_parser.PACKAGE,
"version": hachoir_parser.__version__,
"url": hachoir_parser.WEBSITE,
"download_url": hachoir_parser.WEBSITE,
"author": "Hachoir team (see AUTHORS file)",
"description": "Package of Hachoir parsers used to open binary files",
"long_description": long_description,
"classifiers": CLASSIFIERS,
"license": hachoir_parser.LICENSE,
"packages": PACKAGES.keys(),
"package_dir": PACKAGES,
}
if use_setuptools:
install_options["install_requires"] = "hachoir-core>=1.3"
install_options["zip_safe"] = True
setup(**install_options)
if __name__ == "__main__":
main()
| gpl-2.0 | -9,108,310,611,562,844,000 | 34.512821 | 86 | 0.641516 | false |
django-leonardo/django-leonardo | leonardo/conf/default.py | 1 | 3507 |
from leonardo.base import default
EMAIL = {
'HOST': 'mail.domain.com',
'PORT': '25',
'USER': 'username',
'PASSWORD': 'pwd',
'SECURITY': True,
}
RAVEN_CONFIG = {}
ALLOWED_HOSTS = ['*']
USE_TZ = True
DEBUG = True
ADMINS = (
('admin', '[email protected]'),
)
# month
LEONARDO_CACHE_TIMEOUT = 60 * 60 * 24 * 31
DEFAULT_CHARSET = 'utf-8'
MANAGERS = ADMINS
SITE_ID = 1
SITE_NAME = 'Leonardo'
TIME_ZONE = 'Europe/Prague'
LANGUAGE_CODE = 'en'
LANGUAGES = (
('en', 'EN'),
('cs', 'CS'),
)
USE_I18N = True
DBTEMPLATES_MEDIA_PREFIX = '/static-/'
DBTEMPLATES_AUTO_POPULATE_CONTENT = True
DBTEMPLATES_ADD_DEFAULT_SITE = True
FILER_ENABLE_PERMISSIONS = True # noqa
MIDDLEWARE_CLASSES = default.middlewares
ROOT_URLCONF = 'leonardo.urls'
LEONARDO_BOOTSTRAP_URL = 'http://github.com/django-leonardo/django-leonardo/raw/master/contrib/bootstrap/demo.yaml'
MARKITUP_FILTER = ('markitup.renderers.render_rest', {'safe_mode': True})
INSTALLED_APPS = default.apps
# For easy_thumbnails to support retina displays (recent MacBooks, iOS)
THUMBNAIL_FORMAT = "PNG"
FEINCMS_USE_PAGE_ADMIN = False
LEONARDO_USE_PAGE_ADMIN = True
FEINCMS_DEFAULT_PAGE_MODEL = 'web.Page'
CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'
CONSTANCE_CONFIG = {}
CONSTANCE_ADDITIONAL_FIELDS = {}
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
# enable auto loading packages
LEONARDO_MODULE_AUTO_INCLUDE = True
# enable system module
LEONARDO_SYSTEM_MODULE = True
##########################
STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
'compressor.finders.CompressorFinder',
)
LOGIN_URL = '/auth/login/'
LOGIN_REDIRECT_URL = '/'
LOGOUT_URL = "/"
LOGOUT_ON_GET = True
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'root': {
'level': 'DEBUG',
'handlers': ['console'],
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'formatters': {
'verbose': {
'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt': "%d/%b/%Y %H:%M:%S"
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
},
'loggers': {
'django.request': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
'leonardo': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
}
}
CRISPY_TEMPLATE_PACK = 'bootstrap3'
SECRET_KEY = None
APPS = []
PAGE_EXTENSIONS = []
MIGRATION_MODULES = {}
# use default leonardo auth urls
LEONARDO_AUTH = True
FEINCMS_TIDY_HTML = False
APPLICATION_CHOICES = []
ADD_JS_FILES = []
ADD_CSS_FILES = []
ADD_SCSS_FILES = []
ADD_JS_SPEC_FILES = []
ADD_ANGULAR_MODULES = []
ADD_PAGE_ACTIONS = []
ADD_WIDGET_ACTIONS = []
ADD_MIGRATION_MODULES = {}
ADD_JS_COMPRESS_FILES = []
CONSTANCE_CONFIG_GROUPS = {}
ABSOLUTE_URL_OVERRIDES = {}
SELECT2_CACHE_PREFIX = 'SELECT2'
MODULE_URLS = {}
WIDGETS = {}
LEONARDO_INSTALL_DEPENDENCIES = True
| bsd-3-clause | -4,509,059,239,852,881,400 | 16.892857 | 115 | 0.60365 | false |
sunfounder/SunFounder_SensorKit_for_RPi2 | Python/08_vibration_switch.py | 1 | 1101 | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import time
VibratePin = 11
Gpin = 13
Rpin = 12
tmp = 0
def setup():
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(Gpin, GPIO.OUT) # Set Green Led Pin mode to output
GPIO.setup(Rpin, GPIO.OUT) # Set Red Led Pin mode to output
GPIO.setup(VibratePin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Set BtnPin's mode is input, and pull up to high level(3.3V)
def Led(x):
if x == 0:
GPIO.output(Rpin, 1)
GPIO.output(Gpin, 0)
if x == 1:
GPIO.output(Rpin, 0)
GPIO.output(Gpin, 1)
def loop():
state = 0
while True:
if GPIO.input(VibratePin)==0:
state = state + 1
if state > 1:
state = 0
Led(state)
time.sleep(1)
def destroy():
GPIO.output(Gpin, GPIO.HIGH) # Green led off
GPIO.output(Rpin, GPIO.HIGH) # Red led off
GPIO.cleanup() # Release resource
if __name__ == '__main__': # Program start from here
setup()
try:
loop()
except KeyboardInterrupt: # When 'Ctrl+C' is pressed, the child program destroy() will be executed.
destroy()
| gpl-2.0 | 1,834,895,438,698,754,000 | 22.934783 | 123 | 0.633061 | false |
brigittebigi/proceed | proceed/src/wxgui/cutils/viewsutils.py | 1 | 4360 | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ __ __ ___
# / | \ | \ | \ / Automatic
# \__ |__/ |__/ |___| \__ Annotation
# \ | | | | \ of
# ___/ | | | | ___/ Speech
# =============================
#
# http://sldr.org/sldr000800/preview/
#
# ---------------------------------------------------------------------------
# developed at:
#
# Laboratoire Parole et Langage
#
# Copyright (C) 2011-2018 Brigitte Bigi
#
# Use of this software is governed by the GPL, v3
# This banner notice must not be removed
# ---------------------------------------------------------------------------
#
# SPPAS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SPPAS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SPPAS. If not, see <http://www.gnu.org/licenses/>.
#
# ----------------------------------------------------------------------------
# File: viewsutils.py
# ----------------------------------------------------------------------------
__docformat__ = """epytext"""
__authors__ = """Brigitte Bigi"""
__copyright__ = """Copyright (C) 2011-2015 Brigitte Bigi"""
# ----------------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------------
import wx
from wxgui.sp_consts import FRAME_TITLE
from wxgui.sp_consts import HEADER_FONTSIZE
from wxgui.sp_icons import APP_ICON
from wxgui.cutils.imageutils import spBitmap
# ----------------------------------------------------------------------------
class spFrame( wx.Frame ):
"""
Simple Frame.
"""
def __init__(self, parent, title, preferences, btype=None, size=(640,480)):
"""
Create a new sppasFrame.
"""
# Create the frame and set properties
wx.Frame.__init__(self, parent, -1, FRAME_TITLE, size=size)
_icon = wx.EmptyIcon()
_icon.CopyFromBitmap( spBitmap(APP_ICON) )
self.SetIcon(_icon)
# Create the main panel and the main sizer
self.panel = wx.Panel(self)
self.sizer = wx.BoxSizer(wx.VERTICAL)
# Create the SPPAS specific header at the top of the panel
spHeaderPanel(btype, title, parent.preferences).Draw(self.panel, self.sizer)
self.panel.SetSizer(self.sizer)
self.Centre()
# ----------------------------------------------------------------------------
class spHeaderPanel():
"""
Create a panel with a specific header containing a bitmap and a 'nice'
colored title.
"""
def __init__(self, bmptype, label, preferences):
if preferences:
self.bmp = spBitmap(bmptype, 32, theme=preferences.get_theme())
else:
self.bmp = spBitmap(bmptype, 32, theme=None)
self.label = label
self.preferences = preferences
def Draw(self, panel, sizer):
titlesizer = wx.BoxSizer(wx.HORIZONTAL)
icon = wx.StaticBitmap(panel, bitmap=self.bmp)
titlesizer.Add(icon, flag=wx.TOP|wx.RIGHT|wx.ALIGN_RIGHT, border=5)
text1 = wx.StaticText(panel, label=self.label)
text1.SetFont( wx.Font(HEADER_FONTSIZE, wx.SWISS, wx.NORMAL, wx.BOLD) )
if self.preferences:
text1.SetForegroundColour(self.preferences.GetValue('M_FG_COLOUR'))
titlesizer.Add(text1, flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=5)
sizer.Add(titlesizer, 0, flag=wx.EXPAND, border=5)
line1 = wx.StaticLine(panel)
sizer.Add(line1, flag=wx.EXPAND|wx.BOTTOM, border=10)
# ----------------------------------------------------------------------------
| gpl-3.0 | -7,760,454,296,008,524,000 | 34.638655 | 84 | 0.481422 | false |
WoLpH/nosedjango | nosedjango/plugins/base_plugin.py | 1 | 2333 | import math
import random
import string
from nose.plugins.base import Plugin as NosePlugin
class Plugin(NosePlugin):
django_plugin = True
_unique_token = None
def get_unique_token(self):
"""
Get a unique token for usage in differentiating test runs that need to
run in parallel.
"""
if self._unique_token == None:
self._unique_token = self._random_token()
return self._unique_token
def _random_token(self, bits=128):
"""
Generates a random token, using the url-safe base64 alphabet.
The "bits" argument specifies the bits of randomness to use.
"""
alphabet = string.ascii_letters + string.digits + '-_'
# alphabet length is 64, so each letter provides lg(64) = 6 bits
num_letters = int(math.ceil(bits / 6.0))
return ''.join(random.choice(alphabet) for i in range(num_letters))
class IPluginInterface(object):
"""
IPluginInteface describes the NoseDjango plugin API. Do not subclass or use
this class directly. This interface describes an API **in addition** to
the API described with ``nose.plugins.base.IPluginInterface``.
"""
def __new__(cls, *arg, **kw):
raise TypeError("IPluginInterface class is for documentation only")
def beforeConnectionSetup(self, settings):
pass
def beforeTestSetup(self, settings, setup_test_environment, connection):
pass
def afterTestSetup(self, settings):
pass
def beforeTestDb(self, settings, connection, management):
pass
def afterTestDb(self, settings, connection):
pass
def beforeTransactionManagement(self, settings, test):
pass
def afterTransactionManagement(self, settings, test):
pass
def beforeFixtureLoad(self, settings, test):
pass
def afterFixtureLoad(self, settings, test):
pass
def beforeUrlConfLoad(self, settings, test):
pass
def afterUrlConfLoad(self, settings, test):
pass
def beforeDestroyTestDb(self, settings, connection):
pass
def afterDestroyTestDb(self, settings, connection):
pass
def beforeTeardownTestEnv(self, settings, teardown_test_environment):
pass
def afterTeardownTestEnv(self, settings):
pass
| lgpl-3.0 | 492,857,908,761,186,400 | 27.108434 | 79 | 0.655379 | false |
stormi/tsunami | src/primaires/scripting/actions/ecrire_memoire.py | 1 | 3274 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY teleporterCT, INteleporterCT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
"""Fichier contenant l'action ecrire_memoire."""
from primaires.scripting.action import Action
class ClasseAction(Action):
"""Ecrit dans la mémoire du scripting.
Une mémoire peut être spécifiée pour une salle, un personnage (joueur
ou PNJ) ou un objet. La valeur de la mémoire peut être de n'importe quel
type, sa clé doit être une chaîne.
"""
@classmethod
def init_types(cls):
cls.ajouter_types(cls.ecrire_salle, "Salle", "str", "object")
cls.ajouter_types(cls.ecrire_perso, "Personnage", "str", "object")
cls.ajouter_types(cls.ecrire_objet, "Objet", "str", "object")
@staticmethod
def ecrire_salle(salle, cle, valeur):
"""Ecrit une mémoire de salle."""
if salle in importeur.scripting.memoires:
importeur.scripting.memoires[salle][cle] = valeur
else:
importeur.scripting.memoires[salle] = {cle: valeur}
@staticmethod
def ecrire_perso(personnage, cle, valeur):
"""Ecrit une mémoire de personnage (joueur ou PNJ)."""
personnage = hasattr(personnage, "prototype") and \
personnage.prototype or personnage
if personnage in importeur.scripting.memoires:
importeur.scripting.memoires[personnage][cle] = valeur
else:
importeur.scripting.memoires[personnage] = {cle: valeur}
@staticmethod
def ecrire_objet(objet, cle, valeur):
"""Ecrit une mémoire d'objet."""
if objet in importeur.scripting.memoires:
importeur.scripting.memoires[objet][cle] = valeur
else:
importeur.scripting.memoires[objet] = {cle: valeur}
| bsd-3-clause | -2,439,123,936,880,081,000 | 43.067568 | 81 | 0.707145 | false |
PEAT-AI/Crampy | distance_analysis.py | 1 | 1722 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# distance_analysis.py
#
# Copyright 2015 linaro <linaro@raspberry>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
#
'''imported modules'''
from multiprocessing import Process
from random import randint
import time
from random import choice
'''own modules'''
from dist_sensors import sensors as sens
from inverse_kinematics import move_a_bit
'''globals'''
minn = 30
maxx = 180
medium = 100
choice_list = [minn,maxx,medium]
crampys_range = range(50,150,50)
#u = Process(target=sens.permap, args=())
#u.start()
while True:
move_a_bit.arm(choice(choice_list) + 60,choice(choice_list),choice(choice_list),choice(choice_list),choice(choice_list) -30,choice(choice_list))
time.sleep(0.8)
count = minn
#joints = [a,
while True:
if count <= maxx:
for i in crampys_range:
print "angle =", i
move_a_bit.arm(i,i,i,i,i,i)
time.sleep(0.5)
count = i
else:
while count >= 50:
move_a_bit.arm(count,count,count,count,count,count)
time.sleep(0.5)
count -= 10
| gpl-3.0 | -3,940,220,425,778,474,500 | 25.090909 | 145 | 0.706736 | false |
MobileCloudNetworking/dssaas | dss-side-scripts/icn_repo_push.py | 1 | 2702 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Mohammad Valipoor"
__copyright__ = "Copyright 2014, SoftTelecom"
import logging
import time
from subprocess import call
import os
def config_logger(log_level=logging.DEBUG):
logging.basicConfig(format='%(levelname)s %(asctime)s: %(message)s',
datefmt='%m/%d/%Y %I:%M:%S %p',
log_level=log_level)
logger = logging.getLogger(__name__)
logger.setLevel(log_level)
hdlr = logging.FileHandler('icn_repo_push_log.txt')
formatter = logging.Formatter(fmt='%(levelname)s %(asctime)s: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
return logger
LOG = config_logger()
class IcnContentManager:
def generate_contentlist(self, repo_path):
contentlist = []
for file in os.listdir(repo_path):
if file.endswith(".webm"):
contentlist.append(file)
return contentlist
def insert_file_to_icn(self, filename, prefix, repo_path):
ret_code = -1
if filename != "" and prefix != "":
LOG.debug("Running command: " + '/home/ubuntu/ccnx-0.8.2/bin/ccnputfile ' + 'ccnx:' + prefix + '/' + filename + ' ' + repo_path + '/' + filename)
#ret_code = call(['/home/centos/ccnx-0.8.2/bin/ccnputfile', 'ccnx:' + prefix + '/' + filename, repo_path + '/' + filename])
ret_code = os.system('/home/ubuntu/ccnx-0.8.2/bin/ccnputfile ccnx:' + prefix + '/' + filename + ' ' + repo_path + '/' + filename)
#ret_code = 0
return ret_code
if __name__ == "__main__":
repo_path = './files'
LOG.debug("URL to poll set to: " + repo_path)
icn_prefix = '/dss'
LOG.debug("ICN prefix set to: " + icn_prefix)
cntManager = IcnContentManager()
oldCntList =[]
while 1:
cntList = cntManager.generate_contentlist(repo_path)
print str(cntList)
if cntList != oldCntList:
i = 0
while i < len(cntList):
if cntList[i] not in oldCntList:
LOG.debug("Inserting file " + cntList[i])
ret_code = cntManager.insert_file_to_icn(cntList[i], icn_prefix, repo_path)
if ret_code == 0:
i += 1
else:
LOG.debug("File " + cntList[i] + " has been already inserted.")
i += 1
LOG.debug("Contentlist process complete. Next insertion in 30 seconds ...")
oldCntList = cntList
else:
LOG.debug("No change in content list detected. Next insertion in 30 seconds ...")
time.sleep(30) | apache-2.0 | 6,706,557,584,521,625,000 | 35.527027 | 157 | 0.559585 | false |
madre/analytics_nvd3 | analytics/wsgi.py | 1 | 1428 | """
WSGI config for analytics project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "analytics.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "analytics.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
| apache-2.0 | -2,057,368,234,855,849,000 | 43.625 | 79 | 0.794118 | false |
Abi1ity/uniclust2.0 | SQLAlchemy-0.9.9/test/engine/test_pool.py | 1 | 49999 | import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing import fixtures
import random
from sqlalchemy.testing.mock import Mock, call
join_timeout = 10
def MockDBAPI():
def cursor():
return Mock()
def connect(*arg, **kw):
return Mock(cursor=Mock(side_effect=cursor))
def shutdown(value):
if value:
db.connect = Mock(side_effect=Exception("connect failed"))
else:
db.connect = Mock(side_effect=connect)
db = Mock(
connect=Mock(side_effect=connect),
shutdown=shutdown, _shutdown=False)
return db
class PoolTestBase(fixtures.TestBase):
def setup(self):
pool.clear_managers()
@classmethod
def teardown_class(cls):
pool.clear_managers()
def _queuepool_fixture(self, **kw):
dbapi, pool = self._queuepool_dbapi_fixture(**kw)
return pool
def _queuepool_dbapi_fixture(self, **kw):
dbapi = MockDBAPI()
return dbapi, pool.QueuePool(creator=lambda: dbapi.connect('foo.db'),
**kw)
class PoolTest(PoolTestBase):
def test_manager(self):
manager = pool.manage(MockDBAPI(), use_threadlocal=True)
c1 = manager.connect('foo.db')
c2 = manager.connect('foo.db')
c3 = manager.connect('bar.db')
c4 = manager.connect("foo.db", bar="bat")
c5 = manager.connect("foo.db", bar="hoho")
c6 = manager.connect("foo.db", bar="bat")
assert c1.cursor() is not None
assert c1 is c2
assert c1 is not c3
assert c4 is c6
assert c4 is not c5
def test_manager_with_key(self):
dbapi = MockDBAPI()
manager = pool.manage(dbapi, use_threadlocal=True)
c1 = manager.connect('foo.db', sa_pool_key="a")
c2 = manager.connect('foo.db', sa_pool_key="b")
c3 = manager.connect('bar.db', sa_pool_key="a")
assert c1.cursor() is not None
assert c1 is not c2
assert c1 is c3
eq_(dbapi.connect.mock_calls,
[
call("foo.db"),
call("foo.db"),
]
)
def test_bad_args(self):
manager = pool.manage(MockDBAPI())
manager.connect(None)
def test_non_thread_local_manager(self):
manager = pool.manage(MockDBAPI(), use_threadlocal=False)
connection = manager.connect('foo.db')
connection2 = manager.connect('foo.db')
self.assert_(connection.cursor() is not None)
self.assert_(connection is not connection2)
@testing.fails_on('+pyodbc',
"pyodbc cursor doesn't implement tuple __eq__")
@testing.fails_on("+pg8000", "returns [1], not (1,)")
def test_cursor_iterable(self):
conn = testing.db.raw_connection()
cursor = conn.cursor()
cursor.execute(str(select([1], bind=testing.db)))
expected = [(1, )]
for row in cursor:
eq_(row, expected.pop(0))
def test_no_connect_on_recreate(self):
def creator():
raise Exception("no creates allowed")
for cls in (pool.SingletonThreadPool, pool.StaticPool,
pool.QueuePool, pool.NullPool, pool.AssertionPool):
p = cls(creator=creator)
p.dispose()
p2 = p.recreate()
assert p2.__class__ is cls
mock_dbapi = MockDBAPI()
p = cls(creator=mock_dbapi.connect)
conn = p.connect()
conn.close()
mock_dbapi.connect.side_effect = Exception("error!")
p.dispose()
p.recreate()
def test_threadlocal_del(self):
self._do_testthreadlocal(useclose=False)
def test_threadlocal_close(self):
self._do_testthreadlocal(useclose=True)
def _do_testthreadlocal(self, useclose=False):
dbapi = MockDBAPI()
for p in pool.QueuePool(creator=dbapi.connect,
pool_size=3, max_overflow=-1,
use_threadlocal=True), \
pool.SingletonThreadPool(creator=dbapi.connect,
use_threadlocal=True):
c1 = p.connect()
c2 = p.connect()
self.assert_(c1 is c2)
c3 = p.unique_connection()
self.assert_(c3 is not c1)
if useclose:
c2.close()
else:
c2 = None
c2 = p.connect()
self.assert_(c1 is c2)
self.assert_(c3 is not c1)
if useclose:
c2.close()
else:
c2 = None
lazy_gc()
if useclose:
c1 = p.connect()
c2 = p.connect()
c3 = p.connect()
c3.close()
c2.close()
self.assert_(c1.connection is not None)
c1.close()
c1 = c2 = c3 = None
# extra tests with QueuePool to ensure connections get
# __del__()ed when dereferenced
if isinstance(p, pool.QueuePool):
lazy_gc()
self.assert_(p.checkedout() == 0)
c1 = p.connect()
c2 = p.connect()
if useclose:
c2.close()
c1.close()
else:
c2 = None
c1 = None
lazy_gc()
self.assert_(p.checkedout() == 0)
def test_info(self):
p = self._queuepool_fixture(pool_size=1, max_overflow=0)
c = p.connect()
self.assert_(not c.info)
self.assert_(c.info is c._connection_record.info)
c.info['foo'] = 'bar'
c.close()
del c
c = p.connect()
self.assert_('foo' in c.info)
c.invalidate()
c = p.connect()
self.assert_('foo' not in c.info)
c.info['foo2'] = 'bar2'
c.detach()
self.assert_('foo2' in c.info)
c2 = p.connect()
is_not_(c.connection, c2.connection)
assert not c2.info
assert 'foo2' in c.info
class PoolDialectTest(PoolTestBase):
def _dialect(self):
canary = []
class PoolDialect(object):
def do_rollback(self, dbapi_connection):
canary.append('R')
dbapi_connection.rollback()
def do_commit(self, dbapi_connection):
canary.append('C')
dbapi_connection.commit()
def do_close(self, dbapi_connection):
canary.append('CL')
dbapi_connection.close()
return PoolDialect(), canary
def _do_test(self, pool_cls, assertion):
mock_dbapi = MockDBAPI()
dialect, canary = self._dialect()
p = pool_cls(creator=mock_dbapi.connect)
p._dialect = dialect
conn = p.connect()
conn.close()
p.dispose()
p.recreate()
conn = p.connect()
conn.close()
eq_(canary, assertion)
def test_queue_pool(self):
self._do_test(pool.QueuePool, ['R', 'CL', 'R'])
def test_assertion_pool(self):
self._do_test(pool.AssertionPool, ['R', 'CL', 'R'])
def test_singleton_pool(self):
self._do_test(pool.SingletonThreadPool, ['R', 'CL', 'R'])
def test_null_pool(self):
self._do_test(pool.NullPool, ['R', 'CL', 'R', 'CL'])
def test_static_pool(self):
self._do_test(pool.StaticPool, ['R', 'R'])
class PoolEventsTest(PoolTestBase):
def _first_connect_event_fixture(self):
p = self._queuepool_fixture()
canary = []
def first_connect(*arg, **kw):
canary.append('first_connect')
event.listen(p, 'first_connect', first_connect)
return p, canary
def _connect_event_fixture(self):
p = self._queuepool_fixture()
canary = []
def connect(*arg, **kw):
canary.append('connect')
event.listen(p, 'connect', connect)
return p, canary
def _checkout_event_fixture(self):
p = self._queuepool_fixture()
canary = []
def checkout(*arg, **kw):
canary.append('checkout')
event.listen(p, 'checkout', checkout)
return p, canary
def _checkin_event_fixture(self):
p = self._queuepool_fixture()
canary = []
def checkin(*arg, **kw):
canary.append('checkin')
event.listen(p, 'checkin', checkin)
return p, canary
def _reset_event_fixture(self):
p = self._queuepool_fixture()
canary = []
def reset(*arg, **kw):
canary.append('reset')
event.listen(p, 'reset', reset)
return p, canary
def _invalidate_event_fixture(self):
p = self._queuepool_fixture()
canary = Mock()
event.listen(p, 'invalidate', canary)
return p, canary
def test_first_connect_event(self):
p, canary = self._first_connect_event_fixture()
c1 = p.connect()
eq_(canary, ['first_connect'])
def test_first_connect_event_fires_once(self):
p, canary = self._first_connect_event_fixture()
c1 = p.connect()
c2 = p.connect()
eq_(canary, ['first_connect'])
def test_first_connect_on_previously_recreated(self):
p, canary = self._first_connect_event_fixture()
p2 = p.recreate()
c1 = p.connect()
c2 = p2.connect()
eq_(canary, ['first_connect', 'first_connect'])
def test_first_connect_on_subsequently_recreated(self):
p, canary = self._first_connect_event_fixture()
c1 = p.connect()
p2 = p.recreate()
c2 = p2.connect()
eq_(canary, ['first_connect', 'first_connect'])
def test_connect_event(self):
p, canary = self._connect_event_fixture()
c1 = p.connect()
eq_(canary, ['connect'])
def test_connect_event_fires_subsequent(self):
p, canary = self._connect_event_fixture()
c1 = p.connect()
c2 = p.connect()
eq_(canary, ['connect', 'connect'])
def test_connect_on_previously_recreated(self):
p, canary = self._connect_event_fixture()
p2 = p.recreate()
c1 = p.connect()
c2 = p2.connect()
eq_(canary, ['connect', 'connect'])
def test_connect_on_subsequently_recreated(self):
p, canary = self._connect_event_fixture()
c1 = p.connect()
p2 = p.recreate()
c2 = p2.connect()
eq_(canary, ['connect', 'connect'])
def test_checkout_event(self):
p, canary = self._checkout_event_fixture()
c1 = p.connect()
eq_(canary, ['checkout'])
def test_checkout_event_fires_subsequent(self):
p, canary = self._checkout_event_fixture()
c1 = p.connect()
c2 = p.connect()
eq_(canary, ['checkout', 'checkout'])
def test_checkout_event_on_subsequently_recreated(self):
p, canary = self._checkout_event_fixture()
c1 = p.connect()
p2 = p.recreate()
c2 = p2.connect()
eq_(canary, ['checkout', 'checkout'])
def test_checkin_event(self):
p, canary = self._checkin_event_fixture()
c1 = p.connect()
eq_(canary, [])
c1.close()
eq_(canary, ['checkin'])
def test_reset_event(self):
p, canary = self._reset_event_fixture()
c1 = p.connect()
eq_(canary, [])
c1.close()
eq_(canary, ['reset'])
def test_invalidate_event_no_exception(self):
p, canary = self._invalidate_event_fixture()
c1 = p.connect()
c1.close()
assert not canary.called
c1 = p.connect()
dbapi_con = c1.connection
c1.invalidate()
assert canary.call_args_list[0][0][0] is dbapi_con
assert canary.call_args_list[0][0][2] is None
def test_invalidate_event_exception(self):
p, canary = self._invalidate_event_fixture()
c1 = p.connect()
c1.close()
assert not canary.called
c1 = p.connect()
dbapi_con = c1.connection
exc = Exception("hi")
c1.invalidate(exc)
assert canary.call_args_list[0][0][0] is dbapi_con
assert canary.call_args_list[0][0][2] is exc
def test_checkin_event_gc(self):
p, canary = self._checkin_event_fixture()
c1 = p.connect()
eq_(canary, [])
del c1
lazy_gc()
eq_(canary, ['checkin'])
def test_checkin_event_on_subsequently_recreated(self):
p, canary = self._checkin_event_fixture()
c1 = p.connect()
p2 = p.recreate()
c2 = p2.connect()
eq_(canary, [])
c1.close()
eq_(canary, ['checkin'])
c2.close()
eq_(canary, ['checkin', 'checkin'])
def test_listen_targets_scope(self):
canary = []
def listen_one(*args):
canary.append("listen_one")
def listen_two(*args):
canary.append("listen_two")
def listen_three(*args):
canary.append("listen_three")
def listen_four(*args):
canary.append("listen_four")
engine = testing_engine(testing.db.url)
event.listen(pool.Pool, 'connect', listen_one)
event.listen(engine.pool, 'connect', listen_two)
event.listen(engine, 'connect', listen_three)
event.listen(engine.__class__, 'connect', listen_four)
engine.execute(select([1])).close()
eq_(
canary,
["listen_one", "listen_four", "listen_two", "listen_three"]
)
def test_listen_targets_per_subclass(self):
"""test that listen() called on a subclass remains specific to that subclass."""
canary = []
def listen_one(*args):
canary.append("listen_one")
def listen_two(*args):
canary.append("listen_two")
def listen_three(*args):
canary.append("listen_three")
event.listen(pool.Pool, 'connect', listen_one)
event.listen(pool.QueuePool, 'connect', listen_two)
event.listen(pool.SingletonThreadPool, 'connect', listen_three)
p1 = pool.QueuePool(creator=MockDBAPI().connect)
p2 = pool.SingletonThreadPool(creator=MockDBAPI().connect)
assert listen_one in p1.dispatch.connect
assert listen_two in p1.dispatch.connect
assert listen_three not in p1.dispatch.connect
assert listen_one in p2.dispatch.connect
assert listen_two not in p2.dispatch.connect
assert listen_three in p2.dispatch.connect
p1.connect()
eq_(canary, ["listen_one", "listen_two"])
p2.connect()
eq_(canary, ["listen_one", "listen_two", "listen_one", "listen_three"])
def teardown(self):
# TODO: need to get remove() functionality
# going
pool.Pool.dispatch._clear()
class PoolFirstConnectSyncTest(PoolTestBase):
# test [ticket:2964]
def test_sync(self):
pool = self._queuepool_fixture(pool_size=3, max_overflow=0)
evt = Mock()
@event.listens_for(pool, 'first_connect')
def slow_first_connect(dbapi_con, rec):
time.sleep(1)
evt.first_connect()
@event.listens_for(pool, 'connect')
def on_connect(dbapi_con, rec):
evt.connect()
def checkout():
for j in range(2):
c1 = pool.connect()
time.sleep(.02)
c1.close()
time.sleep(.02)
threads = []
for i in range(5):
th = threading.Thread(target=checkout)
th.start()
threads.append(th)
for th in threads:
th.join(join_timeout)
eq_(evt.mock_calls,
[call.first_connect(), call.connect(), call.connect(), call.connect()]
)
class DeprecatedPoolListenerTest(PoolTestBase):
@testing.requires.predictable_gc
@testing.uses_deprecated(r".*Use event.listen")
def test_listeners(self):
class InstrumentingListener(object):
def __init__(self):
if hasattr(self, 'connect'):
self.connect = self.inst_connect
if hasattr(self, 'first_connect'):
self.first_connect = self.inst_first_connect
if hasattr(self, 'checkout'):
self.checkout = self.inst_checkout
if hasattr(self, 'checkin'):
self.checkin = self.inst_checkin
self.clear()
def clear(self):
self.connected = []
self.first_connected = []
self.checked_out = []
self.checked_in = []
def assert_total(innerself, conn, fconn, cout, cin):
eq_(len(innerself.connected), conn)
eq_(len(innerself.first_connected), fconn)
eq_(len(innerself.checked_out), cout)
eq_(len(innerself.checked_in), cin)
def assert_in(innerself, item, in_conn, in_fconn,
in_cout, in_cin):
self.assert_((item in innerself.connected) == in_conn)
self.assert_((item in innerself.first_connected) == in_fconn)
self.assert_((item in innerself.checked_out) == in_cout)
self.assert_((item in innerself.checked_in) == in_cin)
def inst_connect(self, con, record):
print("connect(%s, %s)" % (con, record))
assert con is not None
assert record is not None
self.connected.append(con)
def inst_first_connect(self, con, record):
print("first_connect(%s, %s)" % (con, record))
assert con is not None
assert record is not None
self.first_connected.append(con)
def inst_checkout(self, con, record, proxy):
print("checkout(%s, %s, %s)" % (con, record, proxy))
assert con is not None
assert record is not None
assert proxy is not None
self.checked_out.append(con)
def inst_checkin(self, con, record):
print("checkin(%s, %s)" % (con, record))
# con can be None if invalidated
assert record is not None
self.checked_in.append(con)
class ListenAll(tsa.interfaces.PoolListener, InstrumentingListener):
pass
class ListenConnect(InstrumentingListener):
def connect(self, con, record):
pass
class ListenFirstConnect(InstrumentingListener):
def first_connect(self, con, record):
pass
class ListenCheckOut(InstrumentingListener):
def checkout(self, con, record, proxy, num):
pass
class ListenCheckIn(InstrumentingListener):
def checkin(self, con, record):
pass
def assert_listeners(p, total, conn, fconn, cout, cin):
for instance in (p, p.recreate()):
self.assert_(len(instance.dispatch.connect) == conn)
self.assert_(len(instance.dispatch.first_connect) == fconn)
self.assert_(len(instance.dispatch.checkout) == cout)
self.assert_(len(instance.dispatch.checkin) == cin)
p = self._queuepool_fixture()
assert_listeners(p, 0, 0, 0, 0, 0)
p.add_listener(ListenAll())
assert_listeners(p, 1, 1, 1, 1, 1)
p.add_listener(ListenConnect())
assert_listeners(p, 2, 2, 1, 1, 1)
p.add_listener(ListenFirstConnect())
assert_listeners(p, 3, 2, 2, 1, 1)
p.add_listener(ListenCheckOut())
assert_listeners(p, 4, 2, 2, 2, 1)
p.add_listener(ListenCheckIn())
assert_listeners(p, 5, 2, 2, 2, 2)
del p
snoop = ListenAll()
p = self._queuepool_fixture(listeners=[snoop])
assert_listeners(p, 1, 1, 1, 1, 1)
c = p.connect()
snoop.assert_total(1, 1, 1, 0)
cc = c.connection
snoop.assert_in(cc, True, True, True, False)
c.close()
snoop.assert_in(cc, True, True, True, True)
del c, cc
snoop.clear()
# this one depends on immediate gc
c = p.connect()
cc = c.connection
snoop.assert_in(cc, False, False, True, False)
snoop.assert_total(0, 0, 1, 0)
del c, cc
lazy_gc()
snoop.assert_total(0, 0, 1, 1)
p.dispose()
snoop.clear()
c = p.connect()
c.close()
c = p.connect()
snoop.assert_total(1, 0, 2, 1)
c.close()
snoop.assert_total(1, 0, 2, 2)
# invalidation
p.dispose()
snoop.clear()
c = p.connect()
snoop.assert_total(1, 0, 1, 0)
c.invalidate()
snoop.assert_total(1, 0, 1, 1)
c.close()
snoop.assert_total(1, 0, 1, 1)
del c
lazy_gc()
snoop.assert_total(1, 0, 1, 1)
c = p.connect()
snoop.assert_total(2, 0, 2, 1)
c.close()
del c
lazy_gc()
snoop.assert_total(2, 0, 2, 2)
# detached
p.dispose()
snoop.clear()
c = p.connect()
snoop.assert_total(1, 0, 1, 0)
c.detach()
snoop.assert_total(1, 0, 1, 0)
c.close()
del c
snoop.assert_total(1, 0, 1, 0)
c = p.connect()
snoop.assert_total(2, 0, 2, 0)
c.close()
del c
snoop.assert_total(2, 0, 2, 1)
# recreated
p = p.recreate()
snoop.clear()
c = p.connect()
snoop.assert_total(1, 1, 1, 0)
c.close()
snoop.assert_total(1, 1, 1, 1)
c = p.connect()
snoop.assert_total(1, 1, 2, 1)
c.close()
snoop.assert_total(1, 1, 2, 2)
@testing.uses_deprecated(r".*Use event.listen")
def test_listeners_callables(self):
def connect(dbapi_con, con_record):
counts[0] += 1
def checkout(dbapi_con, con_record, con_proxy):
counts[1] += 1
def checkin(dbapi_con, con_record):
counts[2] += 1
i_all = dict(connect=connect, checkout=checkout, checkin=checkin)
i_connect = dict(connect=connect)
i_checkout = dict(checkout=checkout)
i_checkin = dict(checkin=checkin)
for cls in (pool.QueuePool, pool.StaticPool):
counts = [0, 0, 0]
def assert_listeners(p, total, conn, cout, cin):
for instance in (p, p.recreate()):
eq_(len(instance.dispatch.connect), conn)
eq_(len(instance.dispatch.checkout), cout)
eq_(len(instance.dispatch.checkin), cin)
p = self._queuepool_fixture()
assert_listeners(p, 0, 0, 0, 0)
p.add_listener(i_all)
assert_listeners(p, 1, 1, 1, 1)
p.add_listener(i_connect)
assert_listeners(p, 2, 1, 1, 1)
p.add_listener(i_checkout)
assert_listeners(p, 3, 1, 1, 1)
p.add_listener(i_checkin)
assert_listeners(p, 4, 1, 1, 1)
del p
p = self._queuepool_fixture(listeners=[i_all])
assert_listeners(p, 1, 1, 1, 1)
c = p.connect()
assert counts == [1, 1, 0]
c.close()
assert counts == [1, 1, 1]
c = p.connect()
assert counts == [1, 2, 1]
p.add_listener(i_checkin)
c.close()
assert counts == [1, 2, 2]
class QueuePoolTest(PoolTestBase):
def test_queuepool_del(self):
self._do_testqueuepool(useclose=False)
def test_queuepool_close(self):
self._do_testqueuepool(useclose=True)
def _do_testqueuepool(self, useclose=False):
p = self._queuepool_fixture(pool_size=3,
max_overflow=-1)
def status(pool):
tup = pool.size(), pool.checkedin(), pool.overflow(), \
pool.checkedout()
print('Pool size: %d Connections in pool: %d Current '\
'Overflow: %d Current Checked out connections: %d' % tup)
return tup
c1 = p.connect()
self.assert_(status(p) == (3, 0, -2, 1))
c2 = p.connect()
self.assert_(status(p) == (3, 0, -1, 2))
c3 = p.connect()
self.assert_(status(p) == (3, 0, 0, 3))
c4 = p.connect()
self.assert_(status(p) == (3, 0, 1, 4))
c5 = p.connect()
self.assert_(status(p) == (3, 0, 2, 5))
c6 = p.connect()
self.assert_(status(p) == (3, 0, 3, 6))
if useclose:
c4.close()
c3.close()
c2.close()
else:
c4 = c3 = c2 = None
lazy_gc()
self.assert_(status(p) == (3, 3, 3, 3))
if useclose:
c1.close()
c5.close()
c6.close()
else:
c1 = c5 = c6 = None
lazy_gc()
self.assert_(status(p) == (3, 3, 0, 0))
c1 = p.connect()
c2 = p.connect()
self.assert_(status(p) == (3, 1, 0, 2), status(p))
if useclose:
c2.close()
else:
c2 = None
lazy_gc()
self.assert_(status(p) == (3, 2, 0, 1))
c1.close()
lazy_gc()
assert not pool._refs
def test_timeout(self):
p = self._queuepool_fixture(pool_size=3,
max_overflow=0,
timeout=2)
c1 = p.connect()
c2 = p.connect()
c3 = p.connect()
now = time.time()
try:
c4 = p.connect()
assert False
except tsa.exc.TimeoutError:
assert int(time.time() - now) == 2
@testing.requires.threading_with_mock
def test_timeout_race(self):
# test a race condition where the initial connecting threads all race
# to queue.Empty, then block on the mutex. each thread consumes a
# connection as they go in. when the limit is reached, the remaining
# threads go in, and get TimeoutError; even though they never got to
# wait for the timeout on queue.get(). the fix involves checking the
# timeout again within the mutex, and if so, unlocking and throwing
# them back to the start of do_get()
dbapi = MockDBAPI()
p = pool.QueuePool(
creator=lambda: dbapi.connect(delay=.05),
pool_size=2,
max_overflow=1, use_threadlocal=False, timeout=3)
timeouts = []
def checkout():
for x in range(1):
now = time.time()
try:
c1 = p.connect()
except tsa.exc.TimeoutError:
timeouts.append(time.time() - now)
continue
time.sleep(4)
c1.close()
threads = []
for i in range(10):
th = threading.Thread(target=checkout)
th.start()
threads.append(th)
for th in threads:
th.join(join_timeout)
assert len(timeouts) > 0
for t in timeouts:
assert t >= 3, "Not all timeouts were >= 3 seconds %r" % timeouts
# normally, the timeout should under 4 seconds,
# but on a loaded down buildbot it can go up.
assert t < 14, "Not all timeouts were < 14 seconds %r" % timeouts
def _test_overflow(self, thread_count, max_overflow):
gc_collect()
dbapi = MockDBAPI()
mutex = threading.Lock()
def creator():
time.sleep(.05)
with mutex:
return dbapi.connect()
p = pool.QueuePool(creator=creator,
pool_size=3, timeout=2,
max_overflow=max_overflow)
peaks = []
def whammy():
for i in range(10):
try:
con = p.connect()
time.sleep(.005)
peaks.append(p.overflow())
con.close()
del con
except tsa.exc.TimeoutError:
pass
threads = []
for i in range(thread_count):
th = threading.Thread(target=whammy)
th.start()
threads.append(th)
for th in threads:
th.join(join_timeout)
self.assert_(max(peaks) <= max_overflow)
lazy_gc()
assert not pool._refs
def test_overflow_reset_on_failed_connect(self):
dbapi = Mock()
def failing_dbapi():
time.sleep(2)
raise Exception("connection failed")
creator = dbapi.connect
def create():
return creator()
p = pool.QueuePool(creator=create, pool_size=2, max_overflow=3)
c1 = p.connect()
c2 = p.connect()
c3 = p.connect()
eq_(p._overflow, 1)
creator = failing_dbapi
assert_raises(Exception, p.connect)
eq_(p._overflow, 1)
@testing.requires.threading_with_mock
def test_hanging_connect_within_overflow(self):
"""test that a single connect() call which is hanging
does not block other connections from proceeding."""
dbapi = Mock()
mutex = threading.Lock()
def hanging_dbapi():
time.sleep(2)
with mutex:
return dbapi.connect()
def fast_dbapi():
with mutex:
return dbapi.connect()
creator = threading.local()
def create():
return creator.mock_connector()
def run_test(name, pool, should_hang):
if should_hang:
creator.mock_connector = hanging_dbapi
else:
creator.mock_connector = fast_dbapi
conn = pool.connect()
conn.operation(name)
time.sleep(1)
conn.close()
p = pool.QueuePool(creator=create, pool_size=2, max_overflow=3)
threads = [
threading.Thread(
target=run_test, args=("success_one", p, False)),
threading.Thread(
target=run_test, args=("success_two", p, False)),
threading.Thread(
target=run_test, args=("overflow_one", p, True)),
threading.Thread(
target=run_test, args=("overflow_two", p, False)),
threading.Thread(
target=run_test, args=("overflow_three", p, False))
]
for t in threads:
t.start()
time.sleep(.2)
for t in threads:
t.join(timeout=join_timeout)
eq_(
dbapi.connect().operation.mock_calls,
[call("success_one"), call("success_two"),
call("overflow_two"), call("overflow_three"),
call("overflow_one")]
)
@testing.requires.threading_with_mock
def test_waiters_handled(self):
"""test that threads waiting for connections are
handled when the pool is replaced.
"""
mutex = threading.Lock()
dbapi = MockDBAPI()
def creator():
mutex.acquire()
try:
return dbapi.connect()
finally:
mutex.release()
success = []
for timeout in (None, 30):
for max_overflow in (0, -1, 3):
p = pool.QueuePool(creator=creator,
pool_size=2, timeout=timeout,
max_overflow=max_overflow)
def waiter(p, timeout, max_overflow):
success_key = (timeout, max_overflow)
conn = p.connect()
success.append(success_key)
time.sleep(.1)
conn.close()
c1 = p.connect()
c2 = p.connect()
threads = []
for i in range(2):
t = threading.Thread(target=waiter,
args=(p, timeout, max_overflow))
t.daemon = True
t.start()
threads.append(t)
# this sleep makes sure that the
# two waiter threads hit upon wait()
# inside the queue, before we invalidate the other
# two conns
time.sleep(.2)
p._invalidate(c2)
for t in threads:
t.join(join_timeout)
eq_(len(success), 12, "successes: %s" % success)
@testing.requires.threading_with_mock
def test_notify_waiters(self):
dbapi = MockDBAPI()
canary = []
def creator():
canary.append(1)
return dbapi.connect()
p1 = pool.QueuePool(creator=creator,
pool_size=1, timeout=None,
max_overflow=0)
def waiter(p):
conn = p.connect()
canary.append(2)
time.sleep(.5)
conn.close()
c1 = p1.connect()
threads = []
for i in range(5):
t = threading.Thread(target=waiter, args=(p1, ))
t.start()
threads.append(t)
time.sleep(.5)
eq_(canary, [1])
# this also calls invalidate()
# on c1
p1._invalidate(c1)
for t in threads:
t.join(join_timeout)
eq_(canary, [1, 1, 2, 2, 2, 2, 2])
def test_dispose_closes_pooled(self):
dbapi = MockDBAPI()
p = pool.QueuePool(creator=dbapi.connect,
pool_size=2, timeout=None,
max_overflow=0)
c1 = p.connect()
c2 = p.connect()
c1_con = c1.connection
c2_con = c2.connection
c1.close()
eq_(c1_con.close.call_count, 0)
eq_(c2_con.close.call_count, 0)
p.dispose()
eq_(c1_con.close.call_count, 1)
eq_(c2_con.close.call_count, 0)
# currently, if a ConnectionFairy is closed
# after the pool has been disposed, there's no
# flag that states it should be invalidated
# immediately - it just gets returned to the
# pool normally...
c2.close()
eq_(c1_con.close.call_count, 1)
eq_(c2_con.close.call_count, 0)
# ...and that's the one we'll get back next.
c3 = p.connect()
assert c3.connection is c2_con
@testing.requires.threading_with_mock
def test_no_overflow(self):
self._test_overflow(40, 0)
@testing.requires.threading_with_mock
def test_max_overflow(self):
self._test_overflow(40, 5)
def test_mixed_close(self):
pool._refs.clear()
p = self._queuepool_fixture(pool_size=3, max_overflow=-1, use_threadlocal=True)
c1 = p.connect()
c2 = p.connect()
assert c1 is c2
c1.close()
c2 = None
assert p.checkedout() == 1
c1 = None
lazy_gc()
assert p.checkedout() == 0
lazy_gc()
assert not pool._refs
def test_overflow_no_gc_tlocal(self):
self._test_overflow_no_gc(True)
def test_overflow_no_gc(self):
self._test_overflow_no_gc(False)
def _test_overflow_no_gc(self, threadlocal):
p = self._queuepool_fixture(pool_size=2,
max_overflow=2)
# disable weakref collection of the
# underlying connections
strong_refs = set()
def _conn():
c = p.connect()
strong_refs.add(c.connection)
return c
for j in range(5):
# open 4 conns at a time. each time this
# will yield two pooled connections + two
# overflow connections.
conns = [_conn() for i in range(4)]
for c in conns:
c.close()
# doing that for a total of 5 times yields
# ten overflow connections closed plus the
# two pooled connections unclosed.
eq_(
set([c.close.call_count for c in strong_refs]),
set([1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0])
)
@testing.requires.predictable_gc
def test_weakref_kaboom(self):
p = self._queuepool_fixture(pool_size=3,
max_overflow=-1, use_threadlocal=True)
c1 = p.connect()
c2 = p.connect()
c1.close()
c2 = None
del c1
del c2
gc_collect()
assert p.checkedout() == 0
c3 = p.connect()
assert c3 is not None
def test_trick_the_counter(self):
"""this is a "flaw" in the connection pool; since threadlocal
uses a single ConnectionFairy per thread with an open/close
counter, you can fool the counter into giving you a
ConnectionFairy with an ambiguous counter. i.e. its not true
reference counting."""
p = self._queuepool_fixture(pool_size=3,
max_overflow=-1, use_threadlocal=True)
c1 = p.connect()
c2 = p.connect()
assert c1 is c2
c1.close()
c2 = p.connect()
c2.close()
self.assert_(p.checkedout() != 0)
c2.close()
self.assert_(p.checkedout() == 0)
def test_recycle(self):
p = self._queuepool_fixture(pool_size=1,
max_overflow=0,
recycle=3)
c1 = p.connect()
c_id = id(c1.connection)
c1.close()
c2 = p.connect()
assert id(c2.connection) == c_id
c2.close()
time.sleep(4)
c3 = p.connect()
assert id(c3.connection) != c_id
def test_recycle_on_invalidate(self):
p = self._queuepool_fixture(pool_size=1,
max_overflow=0)
c1 = p.connect()
c_id = id(c1.connection)
c1.close()
c2 = p.connect()
assert id(c2.connection) == c_id
p._invalidate(c2)
c2.close()
time.sleep(.5)
c3 = p.connect()
assert id(c3.connection) != c_id
def _assert_cleanup_on_pooled_reconnect(self, dbapi, p):
# p is QueuePool with size=1, max_overflow=2,
# and one connection in the pool that will need to
# reconnect when next used (either due to recycle or invalidate)
eq_(p.checkedout(), 0)
eq_(p._overflow, 0)
dbapi.shutdown(True)
assert_raises(
Exception,
p.connect
)
eq_(p._overflow, 0)
eq_(p.checkedout(), 0) # and not 1
dbapi.shutdown(False)
c1 = p.connect()
assert p._pool.empty() # poolsize is one, so we're empty OK
c2 = p.connect()
eq_(p._overflow, 1) # and not 2
# this hangs if p._overflow is 2
c3 = p.connect()
def test_error_on_pooled_reconnect_cleanup_invalidate(self):
dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=2)
c1 = p.connect()
c1.invalidate()
c1.close()
self._assert_cleanup_on_pooled_reconnect(dbapi, p)
def test_error_on_pooled_reconnect_cleanup_recycle(self):
dbapi, p = self._queuepool_dbapi_fixture(pool_size=1,
max_overflow=2, recycle=1)
c1 = p.connect()
c1.close()
time.sleep(1)
self._assert_cleanup_on_pooled_reconnect(dbapi, p)
def test_recycle_pool_no_race(self):
def slow_close():
slow_closing_connection._slow_close()
time.sleep(.5)
slow_closing_connection = Mock()
slow_closing_connection.connect.return_value.close = slow_close
class Error(Exception):
pass
dialect = Mock()
dialect.is_disconnect = lambda *arg, **kw: True
dialect.dbapi.Error = Error
pools = []
class TrackQueuePool(pool.QueuePool):
def __init__(self, *arg, **kw):
pools.append(self)
super(TrackQueuePool, self).__init__(*arg, **kw)
def creator():
return slow_closing_connection.connect()
p1 = TrackQueuePool(creator=creator, pool_size=20)
from sqlalchemy import create_engine
eng = create_engine(testing.db.url, pool=p1, _initialize=False)
eng.dialect = dialect
# 15 total connections
conns = [eng.connect() for i in range(15)]
# return 8 back to the pool
for conn in conns[3:10]:
conn.close()
def attempt(conn):
time.sleep(random.random())
try:
conn._handle_dbapi_exception(Error(), "statement", {}, Mock(), Mock())
except tsa.exc.DBAPIError:
pass
# run an error + invalidate operation on the remaining 7 open connections
threads = []
for conn in conns:
t = threading.Thread(target=attempt, args=(conn, ))
t.start()
threads.append(t)
for t in threads:
t.join()
# return all 15 connections to the pool
for conn in conns:
conn.close()
# re-open 15 total connections
conns = [eng.connect() for i in range(15)]
# 15 connections have been fully closed due to invalidate
assert slow_closing_connection._slow_close.call_count == 15
# 15 initial connections + 15 reconnections
assert slow_closing_connection.connect.call_count == 30
assert len(pools) <= 2, len(pools)
def test_invalidate(self):
p = self._queuepool_fixture(pool_size=1, max_overflow=0)
c1 = p.connect()
c_id = c1.connection.id
c1.close()
c1 = None
c1 = p.connect()
assert c1.connection.id == c_id
c1.invalidate()
c1 = None
c1 = p.connect()
assert c1.connection.id != c_id
def test_recreate(self):
p = self._queuepool_fixture(reset_on_return=None, pool_size=1, max_overflow=0)
p2 = p.recreate()
assert p2.size() == 1
assert p2._reset_on_return is pool.reset_none
assert p2._use_threadlocal is False
assert p2._max_overflow == 0
def test_reconnect(self):
"""tests reconnect operations at the pool level. SA's
engine/dialect includes another layer of reconnect support for
'database was lost' errors."""
dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)
c1 = p.connect()
c_id = c1.connection.id
c1.close()
c1 = None
c1 = p.connect()
assert c1.connection.id == c_id
dbapi.raise_error = True
c1.invalidate()
c1 = None
c1 = p.connect()
assert c1.connection.id != c_id
def test_detach(self):
dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)
c1 = p.connect()
c1.detach()
c2 = p.connect()
eq_(dbapi.connect.mock_calls, [call("foo.db"), call("foo.db")])
c1_con = c1.connection
assert c1_con is not None
eq_(c1_con.close.call_count, 0)
c1.close()
eq_(c1_con.close.call_count, 1)
def test_detach_via_invalidate(self):
dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)
c1 = p.connect()
c1_con = c1.connection
c1.invalidate()
assert c1.connection is None
eq_(c1_con.close.call_count, 1)
c2 = p.connect()
assert c2.connection is not c1_con
c2_con = c2.connection
c2.close()
eq_(c2_con.close.call_count, 0)
def test_threadfairy(self):
p = self._queuepool_fixture(pool_size=3, max_overflow=-1, use_threadlocal=True)
c1 = p.connect()
c1.close()
c2 = p.connect()
assert c2.connection is not None
class ResetOnReturnTest(PoolTestBase):
def _fixture(self, **kw):
dbapi = Mock()
return dbapi, pool.QueuePool(creator=lambda: dbapi.connect('foo.db'), **kw)
def test_plain_rollback(self):
dbapi, p = self._fixture(reset_on_return='rollback')
c1 = p.connect()
c1.close()
assert dbapi.connect().rollback.called
assert not dbapi.connect().commit.called
def test_plain_commit(self):
dbapi, p = self._fixture(reset_on_return='commit')
c1 = p.connect()
c1.close()
assert not dbapi.connect().rollback.called
assert dbapi.connect().commit.called
def test_plain_none(self):
dbapi, p = self._fixture(reset_on_return=None)
c1 = p.connect()
c1.close()
assert not dbapi.connect().rollback.called
assert not dbapi.connect().commit.called
def test_agent_rollback(self):
dbapi, p = self._fixture(reset_on_return='rollback')
class Agent(object):
def __init__(self, conn):
self.conn = conn
def rollback(self):
self.conn.special_rollback()
def commit(self):
self.conn.special_commit()
c1 = p.connect()
c1._reset_agent = Agent(c1)
c1.close()
assert dbapi.connect().special_rollback.called
assert not dbapi.connect().special_commit.called
assert not dbapi.connect().rollback.called
assert not dbapi.connect().commit.called
c1 = p.connect()
c1.close()
eq_(dbapi.connect().special_rollback.call_count, 1)
eq_(dbapi.connect().special_commit.call_count, 0)
assert dbapi.connect().rollback.called
assert not dbapi.connect().commit.called
def test_agent_commit(self):
dbapi, p = self._fixture(reset_on_return='commit')
class Agent(object):
def __init__(self, conn):
self.conn = conn
def rollback(self):
self.conn.special_rollback()
def commit(self):
self.conn.special_commit()
c1 = p.connect()
c1._reset_agent = Agent(c1)
c1.close()
assert not dbapi.connect().special_rollback.called
assert dbapi.connect().special_commit.called
assert not dbapi.connect().rollback.called
assert not dbapi.connect().commit.called
c1 = p.connect()
c1.close()
eq_(dbapi.connect().special_rollback.call_count, 0)
eq_(dbapi.connect().special_commit.call_count, 1)
assert not dbapi.connect().rollback.called
assert dbapi.connect().commit.called
class SingletonThreadPoolTest(PoolTestBase):
@testing.requires.threading_with_mock
def test_cleanup(self):
self._test_cleanup(False)
@testing.requires.threading_with_mock
def test_cleanup_no_gc(self):
self._test_cleanup(True)
def _test_cleanup(self, strong_refs):
"""test that the pool's connections are OK after cleanup() has
been called."""
dbapi = MockDBAPI()
lock = threading.Lock()
def creator():
# the mock iterator isn't threadsafe...
with lock:
return dbapi.connect()
p = pool.SingletonThreadPool(creator=creator, pool_size=3)
if strong_refs:
sr = set()
def _conn():
c = p.connect()
sr.add(c.connection)
return c
else:
def _conn():
return p.connect()
def checkout():
for x in range(10):
c = _conn()
assert c
c.cursor()
c.close()
time.sleep(.1)
threads = []
for i in range(10):
th = threading.Thread(target=checkout)
th.start()
threads.append(th)
for th in threads:
th.join(join_timeout)
assert len(p._all_conns) == 3
if strong_refs:
still_opened = len([c for c in sr if not c.close.call_count])
eq_(still_opened, 3)
class AssertionPoolTest(PoolTestBase):
def test_connect_error(self):
dbapi = MockDBAPI()
p = pool.AssertionPool(creator=lambda: dbapi.connect('foo.db'))
c1 = p.connect()
assert_raises(AssertionError, p.connect)
def test_connect_multiple(self):
dbapi = MockDBAPI()
p = pool.AssertionPool(creator=lambda: dbapi.connect('foo.db'))
c1 = p.connect()
c1.close()
c2 = p.connect()
c2.close()
c3 = p.connect()
assert_raises(AssertionError, p.connect)
class NullPoolTest(PoolTestBase):
def test_reconnect(self):
dbapi = MockDBAPI()
p = pool.NullPool(creator=lambda: dbapi.connect('foo.db'))
c1 = p.connect()
c1.close()
c1 = None
c1 = p.connect()
c1.invalidate()
c1 = None
c1 = p.connect()
dbapi.connect.assert_has_calls([
call('foo.db'),
call('foo.db')],
any_order=True)
class StaticPoolTest(PoolTestBase):
def test_recreate(self):
dbapi = MockDBAPI()
creator = lambda: dbapi.connect('foo.db')
p = pool.StaticPool(creator)
p2 = p.recreate()
assert p._creator is p2._creator
| bsd-3-clause | -4,810,547,575,421,312,000 | 29.431528 | 88 | 0.527331 | false |
GeotrekCE/Geotrek-admin | geotrek/outdoor/templatetags/outdoor_tags.py | 1 | 1138 | from django import template
from django.conf import settings
import json
from geotrek.outdoor.models import Practice, Site
register = template.Library()
@register.simple_tag
def is_outdoor_enabled():
return 'geotrek.outdoor' in settings.INSTALLED_APPS
@register.simple_tag
def site_practices():
practices = {
str(practice.pk): {
'types': {
str(type.pk): type.name
for type in practice.types.all()
},
'scales': {
str(scale.pk): {
'name': scale.name,
'ratings': {
str(rating.pk): rating.name
for rating in scale.ratings.all()
},
}
for scale in practice.rating_scales.all()
},
}
for practice in Practice.objects.all()
}
return json.dumps(practices)
@register.filter
def orientation_display(orientation):
return dict(Site.ORIENTATION_CHOICES)[orientation]
@register.filter
def wind_display(orientation):
return dict(Site.WIND_CHOICES)[orientation]
| bsd-2-clause | 8,670,964,272,676,028,000 | 23.73913 | 57 | 0.565026 | false |
uclouvain/OSIS-Louvain | program_management/forms/tree/detach.py | 1 | 2024 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business involves the administration of students, teachers,
# courses, programs and so on.
#
# Copyright (C) 2015-2020 Université catholique de Louvain (http://www.uclouvain.be)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of this license - GNU General Public License - is available
# at the root of the source code of this program. If not,
# see http://www.gnu.org/licenses/.
#
##############################################################################
from django import forms
from django.utils.translation import gettext_lazy as _
from program_management.ddd.domain import program_tree, node
from program_management.ddd.service import detach_node_service
class DetachNodeForm(forms.Form):
path = forms.CharField(widget=forms.HiddenInput)
def __init__(self, tree: program_tree.ProgramTree, **kwargs):
self.tree = tree
super().__init__(**kwargs)
def clean_path(self):
path = self.cleaned_data['path']
try:
self.tree.get_node(path)
except node.NodeNotFoundException:
raise forms.ValidationError(_("Invalid tree path"))
return path
def save(self):
return detach_node_service.detach_node(self.tree)
| agpl-3.0 | 4,766,222,956,132,599,000 | 40.285714 | 87 | 0.654968 | false |
chirpradio/chirpradio-volunteers | site-packages/sqlalchemy/orm/attributes.py | 1 | 46309 | # attributes.py - manages object attributes
# Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer [email protected]
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import operator, weakref
from itertools import chain
import UserDict
from sqlalchemy import util
from sqlalchemy.orm import interfaces, collections
from sqlalchemy.orm.util import identity_equal
from sqlalchemy import exceptions
PASSIVE_NORESULT = util.symbol('PASSIVE_NORESULT')
ATTR_WAS_SET = util.symbol('ATTR_WAS_SET')
NO_VALUE = util.symbol('NO_VALUE')
NEVER_SET = util.symbol('NEVER_SET')
class InstrumentedAttribute(interfaces.PropComparator):
"""public-facing instrumented attribute, placed in the
class dictionary.
"""
def __init__(self, impl, comparator=None):
"""Construct an InstrumentedAttribute.
comparator
a sql.Comparator to which class-level compare/math events will be sent
"""
self.impl = impl
self.comparator = comparator
def __set__(self, instance, value):
self.impl.set(instance._state, value, None)
def __delete__(self, instance):
self.impl.delete(instance._state)
def __get__(self, instance, owner):
if instance is None:
return self
return self.impl.get(instance._state)
def get_history(self, instance, **kwargs):
return self.impl.get_history(instance._state, **kwargs)
def clause_element(self):
return self.comparator.clause_element()
def expression_element(self):
return self.comparator.expression_element()
def label(self, name):
return self.clause_element().label(name)
def operate(self, op, *other, **kwargs):
return op(self.comparator, *other, **kwargs)
def reverse_operate(self, op, other, **kwargs):
return op(other, self.comparator, **kwargs)
def hasparent(self, instance, optimistic=False):
return self.impl.hasparent(instance._state, optimistic=optimistic)
def _property(self):
from sqlalchemy.orm.mapper import class_mapper
return class_mapper(self.impl.class_).get_property(self.impl.key)
property = property(_property, doc="the MapperProperty object associated with this attribute")
class ProxiedAttribute(InstrumentedAttribute):
"""Adds InstrumentedAttribute class-level behavior to a regular descriptor.
Obsoleted by proxied_attribute_factory.
"""
class ProxyImpl(object):
accepts_scalar_loader = False
def __init__(self, key):
self.key = key
def __init__(self, key, user_prop, comparator=None):
self.user_prop = user_prop
self._comparator = comparator
self.key = key
self.impl = ProxiedAttribute.ProxyImpl(key)
def comparator(self):
if callable(self._comparator):
self._comparator = self._comparator()
return self._comparator
comparator = property(comparator)
def __get__(self, instance, owner):
if instance is None:
self.user_prop.__get__(instance, owner)
return self
return self.user_prop.__get__(instance, owner)
def __set__(self, instance, value):
return self.user_prop.__set__(instance, value)
def __delete__(self, instance):
return self.user_prop.__delete__(instance)
def proxied_attribute_factory(descriptor):
"""Create an InstrumentedAttribute / user descriptor hybrid.
Returns a new InstrumentedAttribute type that delegates descriptor
behavior and getattr() to the given descriptor.
"""
class ProxyImpl(object):
accepts_scalar_loader = False
def __init__(self, key):
self.key = key
class Proxy(InstrumentedAttribute):
"""A combination of InsturmentedAttribute and a regular descriptor."""
def __init__(self, key, descriptor, comparator):
self.key = key
# maintain ProxiedAttribute.user_prop compatability.
self.descriptor = self.user_prop = descriptor
self._comparator = comparator
self.impl = ProxyImpl(key)
def comparator(self):
if callable(self._comparator):
self._comparator = self._comparator()
return self._comparator
comparator = property(comparator)
def __get__(self, instance, owner):
"""Delegate __get__ to the original descriptor."""
if instance is None:
descriptor.__get__(instance, owner)
return self
return descriptor.__get__(instance, owner)
def __set__(self, instance, value):
"""Delegate __set__ to the original descriptor."""
return descriptor.__set__(instance, value)
def __delete__(self, instance):
"""Delegate __delete__ to the original descriptor."""
return descriptor.__delete__(instance)
def __getattr__(self, attribute):
"""Delegate __getattr__ to the original descriptor."""
return getattr(descriptor, attribute)
Proxy.__name__ = type(descriptor).__name__ + 'Proxy'
util.monkeypatch_proxied_specials(Proxy, type(descriptor),
name='descriptor',
from_instance=descriptor)
return Proxy
class AttributeImpl(object):
"""internal implementation for instrumented attributes."""
def __init__(self, class_, key, callable_, trackparent=False, extension=None, compare_function=None, **kwargs):
"""Construct an AttributeImpl.
class_
the class to be instrumented.
key
string name of the attribute
callable_
optional function which generates a callable based on a parent
instance, which produces the "default" values for a scalar or
collection attribute when it's first accessed, if not present
already.
trackparent
if True, attempt to track if an instance has a parent attached
to it via this attribute.
extension
an AttributeExtension object which will receive
set/delete/append/remove/etc. events.
compare_function
a function that compares two values which are normally
assignable to this attribute.
"""
self.class_ = class_
self.key = key
self.callable_ = callable_
self.trackparent = trackparent
if compare_function is None:
self.is_equal = operator.eq
else:
self.is_equal = compare_function
self.extensions = util.to_list(extension or [])
def hasparent(self, state, optimistic=False):
"""Return the boolean value of a `hasparent` flag attached to the given item.
The `optimistic` flag determines what the default return value
should be if no `hasparent` flag can be located.
As this function is used to determine if an instance is an
*orphan*, instances that were loaded from storage should be
assumed to not be orphans, until a True/False value for this
flag is set.
An instance attribute that is loaded by a callable function
will also not have a `hasparent` flag.
"""
return state.parents.get(id(self), optimistic)
def sethasparent(self, state, value):
"""Set a boolean flag on the given item corresponding to
whether or not it is attached to a parent object via the
attribute represented by this ``InstrumentedAttribute``.
"""
state.parents[id(self)] = value
def set_callable(self, state, callable_):
"""Set a callable function for this attribute on the given object.
This callable will be executed when the attribute is next
accessed, and is assumed to construct part of the instances
previously stored state. When its value or values are loaded,
they will be established as part of the instance's *committed
state*. While *trackparent* information will be assembled for
these instances, attribute-level event handlers will not be
fired.
The callable overrides the class level callable set in the
``InstrumentedAttribute` constructor.
"""
if callable_ is None:
self.initialize(state)
else:
state.callables[self.key] = callable_
def get_history(self, state, passive=False):
raise NotImplementedError()
def _get_callable(self, state):
if self.key in state.callables:
return state.callables[self.key]
elif self.callable_ is not None:
return self.callable_(state.obj())
else:
return None
def initialize(self, state):
"""Initialize this attribute on the given object instance with an empty value."""
state.dict[self.key] = None
return None
def get(self, state, passive=False):
"""Retrieve a value from the given object.
If a callable is assembled on this object's attribute, and
passive is False, the callable will be executed and the
resulting value will be set as the new value for this attribute.
"""
try:
return state.dict[self.key]
except KeyError:
# if no history, check for lazy callables, etc.
if self.key not in state.committed_state:
callable_ = self._get_callable(state)
if callable_ is not None:
if passive:
return PASSIVE_NORESULT
value = callable_()
if value is not ATTR_WAS_SET:
return self.set_committed_value(state, value)
else:
if self.key not in state.dict:
return self.get(state, passive=passive)
return state.dict[self.key]
# Return a new, empty value
return self.initialize(state)
def append(self, state, value, initiator, passive=False):
self.set(state, value, initiator)
def remove(self, state, value, initiator, passive=False):
self.set(state, None, initiator)
def set(self, state, value, initiator):
raise NotImplementedError()
def get_committed_value(self, state):
"""return the unchanged value of this attribute"""
if self.key in state.committed_state:
if state.committed_state[self.key] is NO_VALUE:
return None
else:
return state.committed_state.get(self.key)
else:
return self.get(state)
def set_committed_value(self, state, value):
"""set an attribute value on the given instance and 'commit' it."""
state.commit_attr(self, value)
return value
class ScalarAttributeImpl(AttributeImpl):
"""represents a scalar value-holding InstrumentedAttribute."""
accepts_scalar_loader = True
def delete(self, state):
if self.key not in state.committed_state:
state.committed_state[self.key] = state.dict.get(self.key, NO_VALUE)
# TODO: catch key errors, convert to attributeerror?
del state.dict[self.key]
state.modified=True
def get_history(self, state, passive=False):
return _create_history(self, state, state.dict.get(self.key, NO_VALUE))
def set(self, state, value, initiator):
if initiator is self:
return
if self.key not in state.committed_state:
state.committed_state[self.key] = state.dict.get(self.key, NO_VALUE)
state.dict[self.key] = value
state.modified=True
def type(self):
self.property.columns[0].type
type = property(type)
class MutableScalarAttributeImpl(ScalarAttributeImpl):
"""represents a scalar value-holding InstrumentedAttribute, which can detect
changes within the value itself.
"""
def __init__(self, class_, key, callable_, copy_function=None, compare_function=None, **kwargs):
super(ScalarAttributeImpl, self).__init__(class_, key, callable_, compare_function=compare_function, **kwargs)
class_._class_state.has_mutable_scalars = True
if copy_function is None:
raise exceptions.ArgumentError("MutableScalarAttributeImpl requires a copy function")
self.copy = copy_function
def get_history(self, state, passive=False):
return _create_history(self, state, state.dict.get(self.key, NO_VALUE))
def commit_to_state(self, state, value):
state.committed_state[self.key] = self.copy(value)
def check_mutable_modified(self, state):
(added, unchanged, deleted) = self.get_history(state, passive=True)
if added or deleted:
state.modified = True
return True
else:
return False
def set(self, state, value, initiator):
if initiator is self:
return
if self.key not in state.committed_state:
if self.key in state.dict:
state.committed_state[self.key] = self.copy(state.dict[self.key])
else:
state.committed_state[self.key] = NO_VALUE
state.dict[self.key] = value
state.modified=True
class ScalarObjectAttributeImpl(ScalarAttributeImpl):
"""represents a scalar-holding InstrumentedAttribute, where the target object is also instrumented.
Adds events to delete/set operations.
"""
accepts_scalar_loader = False
def __init__(self, class_, key, callable_, trackparent=False, extension=None, copy_function=None, compare_function=None, **kwargs):
super(ScalarObjectAttributeImpl, self).__init__(class_, key,
callable_, trackparent=trackparent, extension=extension,
compare_function=compare_function, **kwargs)
if compare_function is None:
self.is_equal = identity_equal
def delete(self, state):
old = self.get(state)
# TODO: catch key errors, convert to attributeerror?
del state.dict[self.key]
self.fire_remove_event(state, old, self)
def get_history(self, state, passive=False):
if self.key in state.dict:
return _create_history(self, state, state.dict[self.key])
else:
current = self.get(state, passive=passive)
if current is PASSIVE_NORESULT:
return (None, None, None)
else:
return _create_history(self, state, current)
def set(self, state, value, initiator):
"""Set a value on the given InstanceState.
`initiator` is the ``InstrumentedAttribute`` that initiated the
``set()` operation and is used to control the depth of a circular
setter operation.
"""
if initiator is self:
return
if value is not None and not hasattr(value, '_state'):
raise TypeError("Can not assign %s instance to %s's %r attribute, "
"a mapped instance was expected." % (
type(value).__name__, type(state.obj()).__name__, self.key))
# TODO: add options to allow the get() to be passive
old = self.get(state)
state.dict[self.key] = value
self.fire_replace_event(state, value, old, initiator)
def fire_remove_event(self, state, value, initiator):
if self.key not in state.committed_state:
state.committed_state[self.key] = value
state.modified = True
if self.trackparent and value is not None:
self.sethasparent(value._state, False)
instance = state.obj()
for ext in self.extensions:
ext.remove(instance, value, initiator or self)
def fire_replace_event(self, state, value, previous, initiator):
if self.key not in state.committed_state:
state.committed_state[self.key] = previous
state.modified = True
if self.trackparent:
if value is not None:
self.sethasparent(value._state, True)
if previous is not value and previous is not None:
self.sethasparent(previous._state, False)
instance = state.obj()
for ext in self.extensions:
ext.set(instance, value, previous, initiator or self)
class CollectionAttributeImpl(AttributeImpl):
"""A collection-holding attribute that instruments changes in membership.
Only handles collections of instrumented objects.
InstrumentedCollectionAttribute holds an arbitrary, user-specified
container object (defaulting to a list) and brokers access to the
CollectionAdapter, a "view" onto that object that presents consistent
bag semantics to the orm layer independent of the user data implementation.
"""
accepts_scalar_loader = False
def __init__(self, class_, key, callable_, typecallable=None, trackparent=False, extension=None, copy_function=None, compare_function=None, **kwargs):
super(CollectionAttributeImpl, self).__init__(class_,
key, callable_, trackparent=trackparent, extension=extension,
compare_function=compare_function, **kwargs)
if copy_function is None:
copy_function = self.__copy
self.copy = copy_function
if typecallable is None:
typecallable = list
self.collection_factory = \
collections._prepare_instrumentation(typecallable)
# may be removed in 0.5:
self.collection_interface = \
util.duck_type_collection(self.collection_factory())
def __copy(self, item):
return [y for y in list(collections.collection_adapter(item))]
def get_history(self, state, passive=False):
current = self.get(state, passive=passive)
if current is PASSIVE_NORESULT:
return (None, None, None)
else:
return _create_history(self, state, current)
def fire_append_event(self, state, value, initiator):
if self.key not in state.committed_state and self.key in state.dict:
state.committed_state[self.key] = self.copy(state.dict[self.key])
state.modified = True
if self.trackparent and value is not None:
self.sethasparent(value._state, True)
instance = state.obj()
for ext in self.extensions:
ext.append(instance, value, initiator or self)
def fire_pre_remove_event(self, state, initiator):
if self.key not in state.committed_state and self.key in state.dict:
state.committed_state[self.key] = self.copy(state.dict[self.key])
def fire_remove_event(self, state, value, initiator):
if self.key not in state.committed_state and self.key in state.dict:
state.committed_state[self.key] = self.copy(state.dict[self.key])
state.modified = True
if self.trackparent and value is not None:
self.sethasparent(value._state, False)
instance = state.obj()
for ext in self.extensions:
ext.remove(instance, value, initiator or self)
def delete(self, state):
if self.key not in state.dict:
return
state.modified = True
collection = self.get_collection(state)
collection.clear_with_event()
# TODO: catch key errors, convert to attributeerror?
del state.dict[self.key]
def initialize(self, state):
"""Initialize this attribute on the given object instance with an empty collection."""
_, user_data = self._build_collection(state)
state.dict[self.key] = user_data
return user_data
def append(self, state, value, initiator, passive=False):
if initiator is self:
return
collection = self.get_collection(state, passive=passive)
if collection is PASSIVE_NORESULT:
state.get_pending(self.key).append(value)
self.fire_append_event(state, value, initiator)
else:
collection.append_with_event(value, initiator)
def remove(self, state, value, initiator, passive=False):
if initiator is self:
return
collection = self.get_collection(state, passive=passive)
if collection is PASSIVE_NORESULT:
state.get_pending(self.key).remove(value)
self.fire_remove_event(state, value, initiator)
else:
collection.remove_with_event(value, initiator)
def set(self, state, value, initiator):
"""Set a value on the given object.
`initiator` is the ``InstrumentedAttribute`` that initiated the
``set()` operation and is used to control the depth of a circular
setter operation.
"""
if initiator is self:
return
self._set_iterable(
state, value,
lambda adapter, i: adapter.adapt_like_to_iterable(i))
def _set_iterable(self, state, iterable, adapter=None):
"""Set a collection value from an iterable of state-bearers.
``adapter`` is an optional callable invoked with a CollectionAdapter
and the iterable. Should return an iterable of state-bearing
instances suitable for appending via a CollectionAdapter. Can be used
for, e.g., adapting an incoming dictionary into an iterator of values
rather than keys.
"""
# pulling a new collection first so that an adaptation exception does
# not trigger a lazy load of the old collection.
new_collection, user_data = self._build_collection(state)
if adapter:
new_values = list(adapter(new_collection, iterable))
else:
new_values = list(iterable)
old = self.get(state)
# ignore re-assignment of the current collection, as happens
# implicitly with in-place operators (foo.collection |= other)
if old is iterable:
return
if self.key not in state.committed_state:
state.committed_state[self.key] = self.copy(old)
old_collection = self.get_collection(state, old)
state.dict[self.key] = user_data
state.modified = True
collections.bulk_replace(new_values, old_collection, new_collection)
old_collection.unlink(old)
def set_committed_value(self, state, value):
"""Set an attribute value on the given instance and 'commit' it.
Loads the existing collection from lazy callables in all cases.
"""
collection, user_data = self._build_collection(state)
if value:
for item in value:
collection.append_without_event(item)
state.callables.pop(self.key, None)
state.dict[self.key] = user_data
if self.key in state.pending:
# pending items. commit loaded data, add/remove new data
state.committed_state[self.key] = list(value or [])
added = state.pending[self.key].added_items
removed = state.pending[self.key].deleted_items
for item in added:
collection.append_without_event(item)
for item in removed:
collection.remove_without_event(item)
del state.pending[self.key]
elif self.key in state.committed_state:
# no pending items. remove committed state if any.
# (this can occur with an expired attribute)
del state.committed_state[self.key]
return user_data
def _build_collection(self, state):
"""build a new, blank collection and return it wrapped in a CollectionAdapter."""
user_data = self.collection_factory()
collection = collections.CollectionAdapter(self, state, user_data)
return collection, user_data
def get_collection(self, state, user_data=None, passive=False):
"""retrieve the CollectionAdapter associated with the given state.
Creates a new CollectionAdapter if one does not exist.
"""
if user_data is None:
user_data = self.get(state, passive=passive)
if user_data is PASSIVE_NORESULT:
return user_data
try:
return getattr(user_data, '_sa_adapter')
except AttributeError:
# TODO: this codepath never occurs, and this
# except/initialize should be removed
collections.CollectionAdapter(self, state, user_data)
return getattr(user_data, '_sa_adapter')
class GenericBackrefExtension(interfaces.AttributeExtension):
"""An extension which synchronizes a two-way relationship.
A typical two-way relationship is a parent object containing a
list of child objects, where each child object references the
parent. The other are two objects which contain scalar references
to each other.
"""
def __init__(self, key):
self.key = key
def set(self, instance, child, oldchild, initiator):
if oldchild is child:
return
if oldchild is not None:
# With lazy=None, there's no guarantee that the full collection is
# present when updating via a backref.
impl = getattr(oldchild.__class__, self.key).impl
try:
impl.remove(oldchild._state, instance, initiator, passive=True)
except (ValueError, KeyError, IndexError):
pass
if child is not None:
getattr(child.__class__, self.key).impl.append(child._state, instance, initiator, passive=True)
def append(self, instance, child, initiator):
getattr(child.__class__, self.key).impl.append(child._state, instance, initiator, passive=True)
def remove(self, instance, child, initiator):
if child is not None:
getattr(child.__class__, self.key).impl.remove(child._state, instance, initiator, passive=True)
class ClassState(object):
"""tracks state information at the class level."""
def __init__(self):
self.mappers = {}
self.attrs = {}
self.has_mutable_scalars = False
import sets
_empty_set = sets.ImmutableSet()
class InstanceState(object):
"""tracks state information at the instance level."""
def __init__(self, obj):
self.class_ = obj.__class__
self.obj = weakref.ref(obj, self.__cleanup)
self.dict = obj.__dict__
self.committed_state = {}
self.modified = False
self.callables = {}
self.parents = {}
self.pending = {}
self.appenders = {}
self.instance_dict = None
self.runid = None
self.expired_attributes = _empty_set
def __cleanup(self, ref):
# tiptoe around Python GC unpredictableness
instance_dict = self.instance_dict
if instance_dict is None:
return
instance_dict = instance_dict()
if instance_dict is None or instance_dict._mutex is None:
return
# the mutexing here is based on the assumption that gc.collect()
# may be firing off cleanup handlers in a different thread than that
# which is normally operating upon the instance dict.
instance_dict._mutex.acquire()
try:
try:
self.__resurrect(instance_dict)
except:
# catch app cleanup exceptions. no other way around this
# without warnings being produced
pass
finally:
instance_dict._mutex.release()
def _check_resurrect(self, instance_dict):
instance_dict._mutex.acquire()
try:
return self.obj() or self.__resurrect(instance_dict)
finally:
instance_dict._mutex.release()
def get_pending(self, key):
if key not in self.pending:
self.pending[key] = PendingCollection()
return self.pending[key]
def is_modified(self):
if self.modified:
return True
elif self.class_._class_state.has_mutable_scalars:
for attr in _managed_attributes(self.class_):
if hasattr(attr.impl, 'check_mutable_modified') and attr.impl.check_mutable_modified(self):
return True
else:
return False
else:
return False
def __resurrect(self, instance_dict):
if self.is_modified():
# store strong ref'ed version of the object; will revert
# to weakref when changes are persisted
obj = new_instance(self.class_, state=self)
self.obj = weakref.ref(obj, self.__cleanup)
self._strong_obj = obj
obj.__dict__.update(self.dict)
self.dict = obj.__dict__
return obj
else:
del instance_dict[self.dict['_instance_key']]
return None
def __getstate__(self):
return {'committed_state':self.committed_state, 'pending':self.pending, 'parents':self.parents, 'modified':self.modified, 'instance':self.obj(), 'expired_attributes':self.expired_attributes, 'callables':self.callables}
def __setstate__(self, state):
self.committed_state = state['committed_state']
self.parents = state['parents']
self.pending = state['pending']
self.modified = state['modified']
self.obj = weakref.ref(state['instance'])
self.class_ = self.obj().__class__
self.dict = self.obj().__dict__
self.callables = state['callables']
self.runid = None
self.appenders = {}
self.expired_attributes = state['expired_attributes']
def initialize(self, key):
getattr(self.class_, key).impl.initialize(self)
def set_callable(self, key, callable_):
self.dict.pop(key, None)
self.callables[key] = callable_
def __call__(self):
"""__call__ allows the InstanceState to act as a deferred
callable for loading expired attributes, which is also
serializable.
"""
instance = self.obj()
unmodified = self.unmodified
self.class_._class_state.deferred_scalar_loader(instance, [
attr.impl.key for attr in _managed_attributes(self.class_) if
attr.impl.accepts_scalar_loader and
attr.impl.key in self.expired_attributes and
attr.impl.key in unmodified
])
for k in self.expired_attributes:
self.callables.pop(k, None)
self.expired_attributes.clear()
return ATTR_WAS_SET
def unmodified(self):
"""a set of keys which have no uncommitted changes"""
return util.Set([
attr.impl.key for attr in _managed_attributes(self.class_) if
attr.impl.key not in self.committed_state
and (not hasattr(attr.impl, 'commit_to_state') or not attr.impl.check_mutable_modified(self))
])
unmodified = property(unmodified)
def expire_attributes(self, attribute_names):
self.expired_attributes = util.Set(self.expired_attributes)
if attribute_names is None:
for attr in _managed_attributes(self.class_):
self.dict.pop(attr.impl.key, None)
self.expired_attributes.add(attr.impl.key)
if attr.impl.accepts_scalar_loader:
self.callables[attr.impl.key] = self
self.committed_state = {}
else:
for key in attribute_names:
self.dict.pop(key, None)
self.committed_state.pop(key, None)
self.expired_attributes.add(key)
if getattr(self.class_, key).impl.accepts_scalar_loader:
self.callables[key] = self
def reset(self, key):
"""remove the given attribute and any callables associated with it."""
self.dict.pop(key, None)
self.callables.pop(key, None)
def commit_attr(self, attr, value):
"""set the value of an attribute and mark it 'committed'."""
if hasattr(attr, 'commit_to_state'):
attr.commit_to_state(self, value)
else:
self.committed_state.pop(attr.key, None)
self.dict[attr.key] = value
self.pending.pop(attr.key, None)
self.appenders.pop(attr.key, None)
# we have a value so we can also unexpire it
self.callables.pop(attr.key, None)
if attr.key in self.expired_attributes:
self.expired_attributes.remove(attr.key)
def commit(self, keys):
"""commit all attributes named in the given list of key names.
This is used by a partial-attribute load operation to mark committed those attributes
which were refreshed from the database.
Attributes marked as "expired" can potentially remain "expired" after this step
if a value was not populated in state.dict.
"""
if self.class_._class_state.has_mutable_scalars:
for key in keys:
attr = getattr(self.class_, key).impl
if hasattr(attr, 'commit_to_state') and attr.key in self.dict:
attr.commit_to_state(self, self.dict[attr.key])
else:
self.committed_state.pop(attr.key, None)
self.pending.pop(key, None)
self.appenders.pop(key, None)
else:
for key in keys:
self.committed_state.pop(key, None)
self.pending.pop(key, None)
self.appenders.pop(key, None)
# unexpire attributes which have loaded
for key in self.expired_attributes.intersection(keys):
if key in self.dict:
self.expired_attributes.remove(key)
self.callables.pop(key, None)
def commit_all(self):
"""commit all attributes unconditionally.
This is used after a flush() or a regular instance load or refresh operation
to mark committed all populated attributes.
Attributes marked as "expired" can potentially remain "expired" after this step
if a value was not populated in state.dict.
"""
self.committed_state = {}
self.modified = False
self.pending = {}
self.appenders = {}
# unexpire attributes which have loaded
for key in list(self.expired_attributes):
if key in self.dict:
self.expired_attributes.remove(key)
self.callables.pop(key, None)
if self.class_._class_state.has_mutable_scalars:
for attr in _managed_attributes(self.class_):
if hasattr(attr.impl, 'commit_to_state') and attr.impl.key in self.dict:
attr.impl.commit_to_state(self, self.dict[attr.impl.key])
# remove strong ref
self._strong_obj = None
class WeakInstanceDict(UserDict.UserDict):
"""similar to WeakValueDictionary, but wired towards 'state' objects."""
def __init__(self, *args, **kw):
self._wr = weakref.ref(self)
# RLock because the mutex is used by a cleanup handler, which can be
# called at any time (including within an already mutexed block)
self._mutex = util.threading.RLock()
UserDict.UserDict.__init__(self, *args, **kw)
def __getitem__(self, key):
state = self.data[key]
o = state.obj()
if o is None:
o = state._check_resurrect(self)
if o is None:
raise KeyError, key
return o
def __contains__(self, key):
try:
state = self.data[key]
o = state.obj()
if o is None:
o = state._check_resurrect(self)
except KeyError:
return False
return o is not None
def has_key(self, key):
return key in self
def __repr__(self):
return "<InstanceDict at %s>" % id(self)
def __setitem__(self, key, value):
if key in self.data:
self._mutex.acquire()
try:
if key in self.data:
self.data[key].instance_dict = None
finally:
self._mutex.release()
self.data[key] = value._state
value._state.instance_dict = self._wr
def __delitem__(self, key):
state = self.data[key]
state.instance_dict = None
del self.data[key]
def get(self, key, default=None):
try:
state = self.data[key]
except KeyError:
return default
else:
o = state.obj()
if o is None:
# This should only happen
return default
else:
return o
def items(self):
L = []
for key, state in self.data.items():
o = state.obj()
if o is not None:
L.append((key, o))
return L
def iteritems(self):
for state in self.data.itervalues():
value = state.obj()
if value is not None:
yield value._instance_key, value
def iterkeys(self):
return self.data.iterkeys()
def __iter__(self):
return self.data.iterkeys()
def __len__(self):
return len(self.values())
def itervalues(self):
for state in self.data.itervalues():
instance = state.obj()
if instance is not None:
yield instance
def values(self):
L = []
for state in self.data.values():
o = state.obj()
if o is not None:
L.append(o)
return L
def popitem(self):
raise NotImplementedError()
def pop(self, key, *args):
raise NotImplementedError()
def setdefault(self, key, default=None):
raise NotImplementedError()
def update(self, dict=None, **kwargs):
raise NotImplementedError()
def copy(self):
raise NotImplementedError()
def all_states(self):
return self.data.values()
class StrongInstanceDict(dict):
def all_states(self):
return [o._state for o in self.values()]
def _create_history(attr, state, current):
original = state.committed_state.get(attr.key, NEVER_SET)
if hasattr(attr, 'get_collection'):
current = attr.get_collection(state, current)
if original is NO_VALUE:
return (list(current), [], [])
elif original is NEVER_SET:
return ([], list(current), [])
else:
collection = util.OrderedIdentitySet(current)
s = util.OrderedIdentitySet(original)
return (list(collection.difference(s)), list(collection.intersection(s)), list(s.difference(collection)))
else:
if current is NO_VALUE:
if original not in [None, NEVER_SET, NO_VALUE]:
deleted = [original]
else:
deleted = []
return ([], [], deleted)
elif original is NO_VALUE:
return ([current], [], [])
elif original is NEVER_SET or attr.is_equal(current, original) is True: # dont let ClauseElement expressions here trip things up
return ([], [current], [])
else:
if original is not None:
deleted = [original]
else:
deleted = []
return ([current], [], deleted)
class PendingCollection(object):
"""stores items appended and removed from a collection that has not been loaded yet.
When the collection is loaded, the changes present in PendingCollection are applied
to produce the final result.
"""
def __init__(self):
self.deleted_items = util.IdentitySet()
self.added_items = util.OrderedIdentitySet()
def append(self, value):
if value in self.deleted_items:
self.deleted_items.remove(value)
self.added_items.add(value)
def remove(self, value):
if value in self.added_items:
self.added_items.remove(value)
self.deleted_items.add(value)
def _managed_attributes(class_):
"""return all InstrumentedAttributes associated with the given class_ and its superclasses."""
return chain(*[cl._class_state.attrs.values() for cl in class_.__mro__[:-1] if hasattr(cl, '_class_state')])
def get_history(state, key, **kwargs):
return getattr(state.class_, key).impl.get_history(state, **kwargs)
def get_as_list(state, key, passive=False):
"""return an InstanceState attribute as a list,
regardless of it being a scalar or collection-based
attribute.
returns None if passive=True and the getter returns
PASSIVE_NORESULT.
"""
attr = getattr(state.class_, key).impl
x = attr.get(state, passive=passive)
if x is PASSIVE_NORESULT:
return None
elif hasattr(attr, 'get_collection'):
return attr.get_collection(state, x, passive=passive)
elif isinstance(x, list):
return x
else:
return [x]
def has_parent(class_, instance, key, optimistic=False):
return getattr(class_, key).impl.hasparent(instance._state, optimistic=optimistic)
def _create_prop(class_, key, uselist, callable_, typecallable, useobject, mutable_scalars, impl_class, **kwargs):
if impl_class:
return impl_class(class_, key, typecallable, **kwargs)
elif uselist:
return CollectionAttributeImpl(class_, key, callable_, typecallable, **kwargs)
elif useobject:
return ScalarObjectAttributeImpl(class_, key, callable_,**kwargs)
elif mutable_scalars:
return MutableScalarAttributeImpl(class_, key, callable_, **kwargs)
else:
return ScalarAttributeImpl(class_, key, callable_, **kwargs)
def manage(instance):
"""initialize an InstanceState on the given instance."""
if not hasattr(instance, '_state'):
instance._state = InstanceState(instance)
def new_instance(class_, state=None):
"""create a new instance of class_ without its __init__() method being called.
Also initializes an InstanceState on the new instance.
"""
s = class_.__new__(class_)
if state:
s._state = state
else:
s._state = InstanceState(s)
return s
def _init_class_state(class_):
if not '_class_state' in class_.__dict__:
class_._class_state = ClassState()
def register_class(class_, extra_init=None, on_exception=None, deferred_scalar_loader=None):
_init_class_state(class_)
class_._class_state.deferred_scalar_loader=deferred_scalar_loader
oldinit = None
doinit = False
def init(instance, *args, **kwargs):
if not hasattr(instance, '_state'):
instance._state = InstanceState(instance)
if extra_init:
extra_init(class_, oldinit, instance, args, kwargs)
try:
if doinit:
oldinit(instance, *args, **kwargs)
elif args or kwargs:
# simulate error message raised by object(), but don't copy
# the text verbatim
raise TypeError("default constructor for object() takes no parameters")
except:
if on_exception:
on_exception(class_, oldinit, instance, args, kwargs)
raise
# override oldinit
oldinit = class_.__init__
if oldinit is None or not hasattr(oldinit, '_oldinit'):
init._oldinit = oldinit
class_.__init__ = init
# if oldinit is already one of our 'init' methods, replace it
elif hasattr(oldinit, '_oldinit'):
init._oldinit = oldinit._oldinit
class_.__init = init
oldinit = oldinit._oldinit
if oldinit is not None:
doinit = oldinit is not object.__init__
try:
init.__name__ = oldinit.__name__
init.__doc__ = oldinit.__doc__
except:
# cant set __name__ in py 2.3 !
pass
def unregister_class(class_):
if hasattr(class_, '__init__') and hasattr(class_.__init__, '_oldinit'):
if class_.__init__._oldinit is not None:
class_.__init__ = class_.__init__._oldinit
else:
delattr(class_, '__init__')
if '_class_state' in class_.__dict__:
_class_state = class_.__dict__['_class_state']
for key, attr in _class_state.attrs.iteritems():
if key in class_.__dict__:
delattr(class_, attr.impl.key)
delattr(class_, '_class_state')
def register_attribute(class_, key, uselist, useobject, callable_=None, proxy_property=None, mutable_scalars=False, impl_class=None, **kwargs):
_init_class_state(class_)
typecallable = kwargs.pop('typecallable', None)
if isinstance(typecallable, InstrumentedAttribute):
typecallable = None
comparator = kwargs.pop('comparator', None)
if key in class_.__dict__ and isinstance(class_.__dict__[key], InstrumentedAttribute):
# this currently only occurs if two primary mappers are made for the same class.
# TODO: possibly have InstrumentedAttribute check "entity_name" when searching for impl.
# raise an error if two attrs attached simultaneously otherwise
return
if proxy_property:
proxy_type = proxied_attribute_factory(proxy_property)
inst = proxy_type(key, proxy_property, comparator)
else:
inst = InstrumentedAttribute(_create_prop(class_, key, uselist, callable_, useobject=useobject,
typecallable=typecallable, mutable_scalars=mutable_scalars, impl_class=impl_class, **kwargs), comparator=comparator)
setattr(class_, key, inst)
class_._class_state.attrs[key] = inst
def unregister_attribute(class_, key):
class_state = class_._class_state
if key in class_state.attrs:
del class_._class_state.attrs[key]
delattr(class_, key)
def init_collection(instance, key):
"""Initialize a collection attribute and return the collection adapter."""
attr = getattr(instance.__class__, key).impl
state = instance._state
user_data = attr.initialize(state)
return attr.get_collection(state, user_data)
| mit | -8,474,694,774,015,333,000 | 34.677196 | 226 | 0.612948 | false |
oxo42/FpTest | samples/test_GPONLink_Terminate.py | 1 | 2504 | """
Test the Terminate/GPONLink Product Order
The product order takes a serial number, calls LST-ONTDETAIL to get the details of the ONT then DEL-ONT to remove it.
This test case ensures that the right commands happen in the right order
"""
import fptest
class TerminateGponLinkTest(fptest.FpTest):
def test_workorders(self):
expected_workorders = [('LST-ONTDETAIL', 'WOS_Completed'), ('DEL-ONT', 'WOS_Completed')]
actual_workorders = [(wo.name, wo.status) for wo in self.cart_order_tracing.outgoing_workorders]
self.assertListEqual(expected_workorders, actual_workorders)
def test_command_for_lst_ontdetail(self):
self.assertEqual(['LST-ONTDETAIL::ALIAS=9999999999999999:0::;'],
self.cart_order_tracing.outgoing_workorders[0].params['#NE_COMMAND'])
def test_alias(self):
lst_ontdetail = self.get_first_wo('LST-ONTDETAIL')
self.assertRegex(lst_ontdetail.params['#NE_COMMAND'][0], r'ALIAS=9999999999999999')
def test_status(self):
self.assertEqual('OK', self.get_fp_status())
def request(self):
return """
<request>
<so>
<orderId>1412685518565</orderId>
<sod>
<domain>GPON</domain>
<verb>Terminate</verb>
<customerId>RegressionTesting</customerId>
<originator>WGET</originator>
<priority>10</priority>
<doCheckpoint>false</doCheckpoint>
<dataset>
<param>
<name>routerName</name>
<index>0</index>
<value>router</value>
</param>
</dataset>
<pod>
<productName>GPONLink</productName>
<productVerb>Terminate</productVerb>
<dataset>
<param>
<name>ElementManager</name>
<index>0</index>
<value>Huawei_U2000</value>
</param>
<param>
<name>serialNumber</name>
<index>0</index>
<value>9999999999999999</value>
</param>
<param>
<name>pppUsername</name>
<index>0</index>
<value>[email protected]</value>
</param>
</dataset>
</pod>
</sod>
</so>
</request>
""" | apache-2.0 | 8,545,692,665,036,219,000 | 34.28169 | 117 | 0.522364 | false |
thomaserlang/storitch | storitch/logger.py | 1 | 1031 | import logging, logging.handlers, os
from storitch import config
class logger(object):
@classmethod
def set_logger(cls, filename, to_sentry=False, fmt='[%(levelname)s %(asctime)s.%(msecs)d %(module)s:%(lineno)d]: %(message)s'):
logger = logging.getLogger()
logger.setLevel(getattr(logging, config['logging']['level'].upper()))
format_ = logging.Formatter(
fmt,
datefmt='%Y-%m-%d %H:%M:%S'
)
if config['logging']['path'] and filename:
channel = logging.handlers.RotatingFileHandler(
filename=os.path.join(config['logging']['path'], filename),
maxBytes=config['logging']['max_size'],
backupCount=config['logging']['num_backups']
)
channel.setFormatter(format_)
logger.addHandler(channel)
else:# send to console instead of file
channel = logging.StreamHandler()
channel.setFormatter(format_)
logger.addHandler(channel) | mit | -4,935,656,652,694,775,000 | 38.692308 | 131 | 0.588749 | false |
nedlowe/amaas-core-sdk-python | amaascore/tools/generate_transaction.py | 1 | 6700 | from __future__ import absolute_import, division, print_function, unicode_literals
from amaasutils.random_utils import random_string
import datetime
from decimal import Decimal
import random
from amaascore.core.comment import Comment
from amaascore.core.reference import Reference
from amaascore.transactions.cash_transaction import CashTransaction
from amaascore.transactions.children import Charge, Code, Link, Party, Rate
from amaascore.transactions.enums import TRANSACTION_ACTIONS, CASH_TRANSACTION_TYPES
from amaascore.transactions.position import Position
from amaascore.transactions.transaction import Transaction
CHARGE_TYPES = ['Tax', 'Commission']
CODE_TYPES = ['Settle Code', 'Client Classifier']
COMMENT_TYPES = ['Trader']
PARTY_TYPES = ['Prime Broker']
RATE_TYPES = ['Tax', 'Commission']
REFERENCE_TYPES = ['External']
def generate_common(asset_manager_id, asset_book_id, counterparty_book_id, asset_id, quantity, transaction_date,
transaction_id, transaction_action, transaction_type, transaction_status):
common = {'asset_manager_id': asset_manager_id or random.randint(1, 1000),
'asset_book_id': asset_book_id or random_string(8),
'counterparty_book_id': counterparty_book_id or random_string(8),
'asset_id': asset_id or str(random.randint(1, 1000)),
'quantity': quantity or Decimal(random.randint(0, 5000)),
'transaction_date': transaction_date or datetime.date.today(),
'transaction_action': transaction_action or random.choice(list(TRANSACTION_ACTIONS)),
'transaction_id': transaction_id,
'transaction_status': transaction_status or 'New',
'transaction_type': transaction_type or 'Trade'
}
common['settlement_date'] = (datetime.timedelta(days=2) + common['transaction_date'])
return common
def generate_transaction(asset_manager_id=None, asset_book_id=None, counterparty_book_id=None,
asset_id=None, quantity=None, transaction_date=None, transaction_id=None,
price=None, transaction_action=None, transaction_type=None,
transaction_status=None, transaction_currency=None, settlement_currency=None,
net_affecting_charges=None, charge_currency=None):
# Explicitly handle price is None (in case price is 0)
price = Decimal(random.uniform(1.0, 1000.0)).quantize(Decimal('0.01')) if price is None else price
transaction_currency = transaction_currency or random.choice(['SGD', 'USD'])
settlement_currency = settlement_currency or transaction_currency or random.choice(['SGD', 'USD'])
common = generate_common(asset_manager_id=asset_manager_id, asset_book_id=asset_book_id,
counterparty_book_id=counterparty_book_id, asset_id=asset_id, quantity=quantity,
transaction_date=transaction_date, transaction_id=transaction_id,
transaction_action=transaction_action, transaction_status=transaction_status,
transaction_type=transaction_type)
transaction = Transaction(price=price, transaction_currency=transaction_currency,
settlement_currency=settlement_currency, **common)
charges = {charge_type: Charge(charge_value=Decimal(random.uniform(1.0, 100.0)).quantize(Decimal('0.01')),
currency=charge_currency or random.choice(['USD', 'SGD']),
net_affecting=net_affecting_charges or random.choice([True, False]))
for charge_type in CHARGE_TYPES}
links = {'Single': Link(linked_transaction_id=random_string(8)),
'Multiple': {Link(linked_transaction_id=random_string(8)) for x in range(3)}}
codes = {code_type: Code(code_value=random_string(8)) for code_type in CODE_TYPES}
comments = {comment_type: Comment(comment_value=random_string(8)) for comment_type in COMMENT_TYPES}
parties = {party_type: Party(party_id=random_string(8)) for party_type in PARTY_TYPES}
rates = {rate_type:
Rate(rate_value=Decimal(random.uniform(1.0, 100.0)).quantize(Decimal('0.01')))
for rate_type in RATE_TYPES}
references = {ref_type: Reference(reference_value=random_string(10)) for ref_type in REFERENCE_TYPES}
transaction.charges.update(charges)
transaction.codes.update(codes)
transaction.comments.update(comments)
transaction.links.update(links)
transaction.parties.update(parties)
transaction.rates.update(rates)
transaction.references.update(references)
return transaction
def generate_cash_transaction(asset_manager_id=None, asset_book_id=None, counterparty_book_id=None,
asset_id=None, quantity=None, transaction_date=None, transaction_id=None,
transaction_action=None, transaction_type=None,
transaction_status=None):
transaction_type = transaction_type or random.choice(list(CASH_TRANSACTION_TYPES))
common = generate_common(asset_manager_id=asset_manager_id, asset_book_id=asset_book_id,
counterparty_book_id=counterparty_book_id, asset_id=asset_id, quantity=quantity,
transaction_date=transaction_date, transaction_id=transaction_id,
transaction_action=transaction_action, transaction_status=transaction_status,
transaction_type=transaction_type)
transaction = CashTransaction(**common)
return transaction
def generate_position(asset_manager_id=None, book_id=None, asset_id=None, quantity=None):
position = Position(asset_manager_id=asset_manager_id or random.randint(1, 1000),
book_id=book_id or random_string(8),
asset_id=asset_id or str(random.randint(1, 1000)),
quantity=quantity or Decimal(random.randint(1, 50000)))
return position
def generate_transactions(asset_manager_ids=[], number=5):
transactions = []
for i in range(number):
transaction = generate_transaction(asset_manager_id=random.choice(asset_manager_ids))
transactions.append(transaction)
return transactions
def generate_positions(asset_manager_ids=[], book_ids=[], number=5):
positions = []
for i in range(number):
position = generate_position(asset_manager_id=random.choice(asset_manager_ids),
book_id=random.choice(book_ids) if book_ids else None)
positions.append(position)
return positions
| apache-2.0 | -2,945,252,358,435,631,600 | 53.471545 | 112 | 0.667761 | false |
AntoDev96/GuidaSky | controller/channel_controller.py | 1 | 1075 | import codecs
import json
import urllib.request
from constants import constants, command_name_list
from telepot.namedtuple import KeyboardButton, ReplyKeyboardMarkup
from model.repositories import channel_repository
from bot import bot
from decorators.command import command
@command(command_name_list["listacanali"])
def get_all_channels(chat_id, message, **kwargs):
bot.sendChatAction(chat_id, "typing")
result = []
for channel in channel_repository.find_all_channels():
result.append([KeyboardButton(text = channel.name)])
keyboard = ReplyKeyboardMarkup(keyboard=result, one_time_keyboard=True, selective=True)
bot.sendMessage(chat_id, constants["selectChannel"], reply_markup=keyboard)
return "/listaprogrammi"
def find_channel(name):
url = constants["linkSky"] + "/" + constants["linkChannelList"]
httpResult = urllib.request.urlopen(url)
httpResult = codecs.getreader("UTF-8")(httpResult)
channels = json.load(httpResult)
for channel in channels:
if name == channel["name"]:
return channel["id"] | gpl-3.0 | 6,275,880,955,524,322,000 | 38.851852 | 91 | 0.736744 | false |
PaddlePaddle/models | PaddleCV/3d_vision/PointRCNN/tools/kitti_eval.py | 1 | 2220 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import argparse
def parse_args():
parser = argparse.ArgumentParser(
"KITTI mAP evaluation script")
parser.add_argument(
'--result_dir',
type=str,
default='./result_dir',
help='detection result directory to evaluate')
parser.add_argument(
'--data_dir',
type=str,
default='./data',
help='KITTI dataset root directory')
parser.add_argument(
'--split',
type=str,
default='val',
help='evaluation split, default val')
parser.add_argument(
'--class_name',
type=str,
default='Car',
help='evaluation class name, default Car')
args = parser.parse_args()
return args
def kitti_eval():
if float(sys.version[:3]) < 3.6:
print("KITTI mAP evaluation can only run with python3.6+")
sys.exit(1)
args = parse_args()
label_dir = os.path.join(args.data_dir, 'KITTI/object/training', 'label_2')
split_file = os.path.join(args.data_dir, 'KITTI/ImageSets',
'{}.txt'.format(args.split))
final_output_dir = os.path.join(args.result_dir, 'final_result', 'data')
name_to_class = {'Car': 0, 'Pedestrian': 1, 'Cyclist': 2}
from tools.kitti_object_eval_python.evaluate import evaluate as kitti_evaluate
ap_result_str, ap_dict = kitti_evaluate(
label_dir, final_output_dir, label_split_file=split_file,
current_class=name_to_class[args.class_name])
print("KITTI evaluate: ", ap_result_str, ap_dict)
if __name__ == "__main__":
kitti_eval()
| apache-2.0 | 1,994,207,320,236,597,000 | 30.267606 | 83 | 0.640991 | false |
Micronaet/micronaet-mx8 | mexal_mail_invoice_default/__init__.py | 1 | 1042 | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
###############################################################################
from . import mail_default
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| agpl-3.0 | -7,481,381,625,656,819,000 | 44.304348 | 79 | 0.611324 | false |
klmitch/tendril | tendril/__init__.py | 1 | 12025 | ## Copyright (C) 2012 by Kevin L. Mitchell <[email protected]>
##
## This program is free software: you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation, either version 3 of the
## License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see
## <http://www.gnu.org/licenses/>.
"""
==============================================
Tendril Frame-based Network Connection Tracker
==============================================
Tendril is a network communication library based on two main features:
it is based on sending and receiving frames, and it tracks the state
of an abstract connection as defined by the application. Tendril is
designed to be easy to use: creating an application requires
subclassing the ``Application`` class and providing an implementation
for the recv_frame() method; then get a ``TendrilManager`` class
instance and start it, and Tendril manages the rest.
Tendril Concepts
================
Frames
------
Tendril is based on the concept of passing around frames or packets of
data. The fact is, most network protocols are based on sending and
receiving frames; for instance, in the SMTP protocol used for sending
email, the sender will start off sending the frame "MAIL FROM
[email protected]" followed by a line termination sequence (a carriage
return followed by a newline). The SMTP server will then respond with
another frame acknowledging the "MAIL FROM" frame, and that frame will
also end with a line termination sequence. Thus, even though SMTP is
defined on top of the TCP protocol, which provides an undivided stream
of data between the client and server, a framing boundary is imposed
upon it--in this case, the carriage return followed by a newline that
terminates each frame.
Tendril includes the concept of *framers*. A framer is nothing more
than a subclass of ``Framer`` which has one method which extracts a
single frame from the stream of undifferentiated data, and another
method which converts a frame into an appropriate representation. In
the case of the SMTP protocol exchange above, the ``frameify()``
method finds each line terminated by the carriage return-newline pair,
strips off those characters, and returns just the frame. In the same
way, the corresponding ``streamify()`` method takes the frame and
appends a carriage return-newline pair.
For text-based protocols such as SMTP, this may seem like overkill.
However, for binary-based protocols, a lot of code is dedicated to
determining the boundaries between frames, and in some cases even
decoding the frame. Tendril's concept of a framer for a connection
enables the framing logic to be isolated from the rest of the
application, and even reused: Tendril comes with several pre-built
framers, including framers designed to work with a text-based protocol
such as SMTP.
Another important advantage of the framer concept is the ability to
switch between framers as needed. Taking again the example of the
SMTP protocol--the actual email data is transferred to the server by
the client first sending a "DATA" frame; the server responds
indicating that it is ready to begin receiving the message data, and
then the client simply sends the message data, ending it with a line
containing only a single period ("."). In this case, an SMTP server
application based on Tendril may wish to receive the message data as a
single frame; it can do this by creating a framer which buffers stream
data until it sees that ending sentinel (the period on a line by
itself), then returns the whole message as a single frame. Once the
server receives the "DATA" frame from the client, all it has to do is
temporarily switch out the framer in use for the receiving side of the
connection, then switch it back to the standard line-based framer once
it has received the message frame.
Tendril allows for different framers to be used on the receiving side
and sending side of the connection. This could be used in a case like
the SMTP server example cited above, where the server still wishes to
send line-oriented frames to the client, even while buffering a
message data frame. In addition, although the provided framers deal
with byte data, Tendril itself treats the frames as opaque;
applications can use this to build a framer that additionally parses a
given frame into a class object that the rest of the application then
processes as necessary.
Connection Tracking
-------------------
Tendril is also based on the concept of tracking connection state.
For connection-oriented protocols such as TCP, obviously, this is not
a big problem; however, Tendril is also designed to support
connectionless protocols such as UDP, where some applications need to
manage state information relevant to a given exchange. As an
admittedly contrived example, consider DNS, which is based on UDP. A
client of the DNS system will send a request to a DNS server over UDP;
when a response is received from that DNS server, the connection state
information tracked by Tendril can help connect that response with the
appropriate request, ensuring that the response goes to the right
place.
This connection state tracking is primarily intended to assist
applications which desire to be available over both
connection-oriented protocols such as TCP and over connectionless
protocols such as UDP. Although Tendril does not address reliability
or frame ordering, its connection state tracking eases the
implementation of an application which utilizes both types of
protocols.
Extensibility
-------------
Careful readers may have noticed the use of the terms, "such as TCP"
and "such as UDP." Although Tendril only has built-in support for TCP
and UDP connections, it is possible to extend Tendril to support other
protocols. All that is required is to create subclasses of
``Tendril`` (representing an individual connection) and of
``TendrilManager`` (which accepts and creates connections and manages
any necessary socket data flows), and to register the
``TendrilManager`` subclasses as ``pkg_resources`` entry points under
the ``tendril.manager`` namespace. See the ``setup.py`` for Tendril
for an example of how this may be done.
In addition to allowing Tendril to support protocols other than TCP
and UDP, it is also possible to implement new framers by subclassing
the ``Framer`` class. (Note: as Tendril deals with ``Framer``
objects, it is not necessary to register these framers using
``pkg_resources`` entry points.) Objects of these classes may then
simply be assigned to the appropriate ``framers`` attribute on the
``Tendril`` instance representing the connection.
Advanced Interfaces
-------------------
Tendril also provides an advanced interface that allows a given raw
socket to be "wrapped." Using this feature, an ordinary TCP socket
could be converted into an SSL socket. Other uses for this interface
are possible, such as setting socket options for the socket. Tendril
also provides an interface to allow multiple of these wrapper
functions to be called in a given order.
Standard Usage
==============
The first step in using Tendril is to define an application by
subclassing the ``Application`` class. (Subclassing is not strictly
necessary--Tendril uses Python's standard ``abc`` package for defining
abstract base classes--but using subclassing will pull in a few
helpful and/or required methods.) The subclass need merely implement
the recv_frame() method, which will be called when a frame is
received. The ``Application`` subclass constructor itself can be the
*acceptor* to be used by Tendril (more on acceptors in a moment).
Once the ``Application`` subclass has been created, the developer then
needs to get a ``TendrilManager`` instance, using the
``get_manager()`` factory function. The exact call to
``get_manager()`` depends on the needs; for making outgoing
connections, simply calling ``get_manager("tcp")`` is sufficient. If
listening on a port or making an outgoing connection from a specific
address and/or port is desired, the second argument to
``get_manager()`` may be a tuple of the desired local IP address and
the port number (i.e., ``("127.0.0.1", 80)``).
All managers must be started, and ``get_manager()`` does not start the
manager by itself. Check the manager's ``running`` attribute to see
if the manager is already running, and if it is not, call its
``start()`` method. To accept connections, pass ``start()`` the
*acceptor* (usually the ``Application`` subclass). The ``start()``
method also accepts a *wrapper*, which will be called with the
listening socket when it is created.
If, instead of accepting connections (as a server would do), the
desire is to make outgoing connections, simply call ``start()`` with
no arguments, then call the ``connect()`` method of the manager. This
method takes the *target* of the connection (i.e., the IP address and
port number, as a tuple) and the *acceptor*. (It also has an optional
*wrapper*, which will be called with the outgoing socket just prior to
initiating the connection.)
Acceptors
---------
An *acceptor* is simply a callable taking a single argument--the
``Tendril`` instance representing the connection--and returning an
instance of a subclass of ``Application``, which will be assigned to
the ``application`` attribute of the ``Tendril`` instance. The
acceptor initializes the application; it also has the opportunity to
manipulate that ``Tendril``, such as setting framers, calling the
``Tendril`` instance's ``wrap()`` method, or simply closing the
connection.
Although the ``TendrilManager`` does not provide the opportunity to
pass arguments to the acceptor, it is certainly possible to do so.
The standard Python ``functools.partial()`` is one obvious interface,
but Tendril additionally provides its own ``TendrilPartial`` utility;
the advantage of ``TendrilPartial`` is that the positional argument
passed to the acceptor--the ``Tendril`` instance--will be the first
positional argument, rather than the last one, as would be the case
with ``functools.partial()``.
Wrappers
--------
A *wrapper* is simply a callable again taking a single argument--in
this case, the socket object--and returning a wrapped version of that
argument; that wrapped version of the socket will then be used in
subsequent network calls. A wrapper which manipulates socket options
can simply return the socket object which was passed in, while one
which performs SSL encapsulation can return the SSL wrapper. Again,
although there is no opportunity to pass arguments to the wrapper in a
manager ``start()`` or ``connect()`` call (or a ``Tendril`` object's
``wrap()`` call), ``functools.partial()`` or Tendril's
``TendrilPartial`` utility can be used. In particular, in conjunction
with ``TendrilPartial``, the ``ssl.wrap_socket()`` call can be used as
a socket wrapper directly, enabling an SSL connection to be set up
easily.
Of course, it may be necessary to perform multiple "wrapping"
activities on a connection, such as setting socket options followed by
wrapping the socket in an SSL connection. For this case, Tendril
provides the ``WrapperChain``; it can be initialized in the same way
that ``TendrilPartial`` is, but additional wrappers can be added by
calling the ``chain()`` method; when called, the ``WrapperChain``
object will call each wrapper in the order defined, returning the
final wrapped socket in the end.
"""
from application import *
from connection import *
from framers import *
from manager import *
from utils import *
__all__ = (application.__all__ + connection.__all__ + framers.__all__ +
manager.__all__ + utils.__all__)
| gpl-3.0 | 6,401,577,186,917,081,000 | 48.485597 | 71 | 0.766486 | false |
linkinwong/word2vec | src/crf-paper-script/preprocessor10_refine_lbfgs_l2sgd.py | 1 | 10310 | # coding: utf-8
__author__ = 'linlin'
import os
import logging
import re
import pdb
logger = logging.getLogger(__name__)
################################################################
root_dir = '/home/linlin/time/0903_classify_false_start/1003_raw_features/'
separator = '\t\t'
################################################################
def MakeNewFolderVersionHigher(data_directory, dir_name):
## 在选定的文件夹里生成更高版本号的文件夹 data_directory - can be relative directory
## dir_name - the new folder name you want to creat
abs_data_directory = os.path.abspath(os.path.dirname(data_directory))
version_number = 1
dirs = os.listdir(abs_data_directory)
for dir in dirs:
if dir_name in dir:
version_str = re.findall(r'Dir_\d+',dir)
number_str =''.join((version_str[-1])[4:])
if True == number_str.isdigit():
number= int (number_str)
if number>version_number:
version_number = number
new_folder_name = dir_name + "_%d" %(version_number+1)
folderFullPath = os.path.join(abs_data_directory,new_folder_name )
os.makedirs(folderFullPath)
return folderFullPath
#########################################################
output_root_dir = MakeNewFolderVersionHigher(root_dir, 'processDir' )
data_dir = root_dir + 'data1'
code_dir = root_dir + 'src/'
##############################################################
def DirProcessing(source_path, dest_path):
path = source_path
for root, dirs, files in os.walk(path):
for filespath in files:
abs_file_path = os.path.join(root, filespath)
logger.debug("Visited one file!")
Standardize(abs_file_path, dest_path, ' ')
def DirProcessingForSSR(source_path, dest_path):
path = source_path
for root, dirs, files in os.walk(path):
for filespath in files:
abs_file_path = os.path.join(root, filespath)
logger.debug("Visited one file!")
GetSsrFeature(abs_file_path, dest_path, '\t')
def GetAttributes(source_path, dest_path):
################################################################
script_file = code_dir + 'chunker6_only_ssr_repetition.py'
################################################################
path = source_path
for root, dirs, files in os.walk(path):
for filespath in files:
abs_file_path = os.path.join(root, filespath)
logger.debug("Visited one file!")
crf_path = dest_path + '/' + os.path.basename(abs_file_path) + '.crfsuite'
os.system('cat ' + abs_file_path +' | python ' + script_file + " > " + crf_path )
def RunClassifier(source_path, dest_path):
path = source_path
for root, dirs, files in os.walk(path):
for filespath in files:
if 'tr.txt' in filespath:
train_path = os.path.join(root, filespath)
elif 'te.txt' in filespath:
test_path = os.path.join(root, filespath)
# result_path = dest_path + '/' + 'result_lbfgs.txt'
# model_path = dest_path + '/' + 'lbfgs.model'
# os.system('crfsuite learn -m ' + model_path + ' -a lbfgs' + ' -e2 ' +
# train_path + " " + test_path + " > " + result_path )
result_path = dest_path + '/' + 'result_lbfgs_c1_0.5_force_generate.txt'
model_path = dest_path + '/' + 'lbfgs.model'
os.system('crfsuite learn ' + ' -a lbfgs ' +
' -p feature.possible_states=1 -p feature.possible_transitions=1 ' +
' -p c1=0.5 ' + ' -e2 ' +
train_path + " " + test_path + " > " + result_path )
result_path = dest_path + '/' + 'result_lbfgs_c1_2.txt'
model_path = dest_path + '/' + 'lbfgs.model'
os.system('crfsuite learn ' + ' -a lbfgs ' +
' -p c1=2 ' + ' -e2 ' +
train_path + " " + test_path + " > " + result_path )
result_path = dest_path + '/' + 'result_l2sgd_c2_5.txt'
model_path = dest_path + '/' + 'l2sgd.model'
os.system('crfsuite learn ' + " -a l2sgd " +' -p c2=5 ' + ' -e2 ' +
train_path + " " + test_path + " > " + result_path )
result_path = dest_path + '/' + 'result_l2sgd_c2_15.txt'
model_path = dest_path + '/' + 'l2sgd.model'
os.system('crfsuite learn ' + " -a l2sgd " +' -p c2=15 ' + ' -e2 ' +
train_path + " " + test_path + " > " + result_path )
# result_path = dest_path + '/' + 'result_ap.txt'
# model_path = dest_path + '/' + 'ap.model'
# os.system('crfsuite learn ' +" -a ap " +' -p max_iterations=500 ' + ' -e2 ' +
# train_path + " " + test_path + " > " + result_path )
# result_path = dest_path + '/' + 'result_pa.txt'
# model_path = dest_path + '/' + 'pa.model'
# os.system('crfsuite learn '+ " -a pa " +' -p max_iterations=500 '+ ' -e2 ' +
# train_path + " " + test_path + " > " + result_path )
# result_path = dest_path + '/' + 'result_arow.txt'
# model_path = dest_path + '/' + 'arow.model'
# os.system('crfsuite learn ' + " -a arow" +' -p max_iterations=500 '+ ' -e2 ' +
# train_path + " " + test_path + " > " + result_path )
def FindNeighborTokenSubscript(first_token_list, current_pos , up_or_down ):
pos = current_pos
ind = up_or_down
li = first_token_list
if ind == 1:
i = 1
while len(li[pos+i]) < 1:
i += 1
return pos+i
if ind == -1:
i = 1
while len(li[pos-i]) < 1:
i += 1
return pos-i
def Standardize(path, dest_dir, sep):
output_path = dest_dir+ '/' + os.path.basename(path) + '.standard'
output_file_obj = open(output_path,'w')
file_obj = open(path)
line_list = file_obj.readlines()
token_list = []
for j in range(len(line_list)):
word_list = line_list[j].split()
if len(word_list) < 2:
token_list.append('')
else:
token_list.append(word_list[0])
repetition_vec_list = []
for i in range(len(line_list)):
if len(token_list[i]) == 0:
repetition_vec_list.append('')
else:
if i < 4 or i > len(line_list)- 5:
repetition_vec_list.append(['diff', 'diff','diff', 'diff'])
else:
previous_subscript = FindNeighborTokenSubscript(token_list, i, -1)
prev_prev_subscript = FindNeighborTokenSubscript(token_list, previous_subscript, -1)
next_subscript = FindNeighborTokenSubscript(token_list, i, 1)
next_next_subscript = FindNeighborTokenSubscript(token_list, next_subscript, 1)
prev_prev_label = 'same' if (token_list[i] == token_list[prev_prev_subscript]) else "diff"
prev_label = 'same' if (token_list[i] == token_list[previous_subscript]) else "diff"
next_label = 'same' if (token_list[i] == token_list[next_subscript]) else "diff"
next_next_subscript = 'same' if (token_list[i] == token_list[next_next_subscript]) else "diff"
repetition_vec_list.append([prev_prev_label, prev_label, next_label, next_next_subscript])
for k in range(len(line_list)):
line = line_list[k]
if len(line)<13:
label = ''
else:
word_list = line.split()
if 'filler' in word_list[4]:
label = 'filler'
elif 'repeat' in word_list[4] or 'nsert' in word_list[4]:
label = 'repeat'
elif 'restart' in word_list[4] or 'extraneou' in word_list[4]:
label = 'false_start'
elif 'elete' in word_list[4]:
label = 'other'
else:
label = 'OK'
if '-' in word_list[0]:
patial = 'patial'
else:
patial = 'nonpatial'
label = label
token = word_list[0]
pos = word_list[1]
word = word_list[2]
sem = word_list[3]
patial = patial
#pdb.set_trace()
pp = repetition_vec_list[k][0]
p = repetition_vec_list[k][1]
n = repetition_vec_list[k][2]
nn = repetition_vec_list[k][3]
#pdb.set_trace()
if len(line)<13:
line_format = ''
else:
line_format = (
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
%(label, sep, token,sep,pos, sep,word,sep,sem, sep, patial, sep,
pp, sep, p, sep, n,sep, nn))
output_file_obj.write(line_format)
output_file_obj.write('\n')
output_file_obj.close()
file_obj.close()
def GetSsrFeature(path, dest_dir, sep):
output_path = dest_dir+ '/' + os.path.basename(path) + '.noSpace'
output_file_obj = open(output_path,'w')
file_obj = open(path)
for line in file_obj:
if len(line)<3:
newLine = ''
else:
word_list = line[54:].split()
newLine = '_'.join(word_list)
token = line[:15].strip()
pos = line[15:25].strip()
word = line[25:40].strip()
sem = line[40:54].strip()
label = newLine
if len(line)<3:
line_format = ''
else:
line_format = "%s%s%s%s%s%s%s%s%s%s" %(token,sep,pos,sep,word,sep,sem, sep, label, sep)
output_file_obj.write(line_format)
output_file_obj.write('\n')
output_file_obj.close()
file_obj.close()
if __name__ == '__main__':
logFile = output_root_dir + "/logFile.txt"
logging.basicConfig(filename=logFile, level = logging.DEBUG)
os.makedirs(output_root_dir + "/standardStep1")
dest_dir = output_root_dir + "/standardStep1"
DirProcessing(data_dir, dest_dir)
# os.makedirs(output_root_dir + "/standardStep2") #
# dest_dir = output_root_dir + "/standardStep2"
# DirProcessing(data_dir, dest_dir) #
os.makedirs(output_root_dir + "/attributesStep3")
attr_dir = output_root_dir + "/attributesStep3"
GetAttributes(dest_dir, attr_dir)
os.makedirs(output_root_dir + "/classificationStep4")
result_dir = output_root_dir + "/classificationStep4"
RunClassifier( attr_dir, result_dir)
| apache-2.0 | 6,155,065,818,823,670,000 | 35.425532 | 110 | 0.525019 | false |
okolisny/integration_tests | cfme/middleware/server.py | 1 | 17554 | import re
from navmazing import NavigateToSibling, NavigateToAttribute
from selenium.common.exceptions import NoSuchElementException
from wrapanapi.hawkular import CanonicalPath
from cfme.common import Taggable, UtilizationMixin
from cfme.exceptions import MiddlewareServerNotFound, \
MiddlewareServerGroupNotFound
from cfme.middleware.domain import MiddlewareDomain
from cfme.middleware.provider import (
MiddlewareBase, download
)
from cfme.middleware.provider import (parse_properties, Container)
from cfme.middleware.provider.hawkular import HawkularProvider
from cfme.middleware.provider.middleware_views import (ServerAllView,
ServerDetailsView, ServerDatasourceAllView, ServerDeploymentAllView,
ServerMessagingAllView, ServerGroupDetailsView, AddDatasourceView,
AddJDBCDriverView, AddDeploymentView)
from cfme.middleware.server_group import MiddlewareServerGroup
from cfme.utils import attributize_string
from cfme.utils.appliance import Navigatable, current_appliance
from cfme.utils.appliance.implementations.ui import navigator, CFMENavigateStep, navigate_to
from cfme.utils.providers import get_crud_by_name, list_providers_by_class
from cfme.utils.varmeth import variable
def _db_select_query(name=None, feed=None, provider=None, server_group=None,
product=None):
"""column order: `id`, `name`, `hostname`, `feed`, `product`,
`provider_name`, `ems_ref`, `properties`, `server_group_name`"""
t_ms = current_appliance.db.client['middleware_servers']
t_msgr = current_appliance.db.client['middleware_server_groups']
t_ems = current_appliance.db.client['ext_management_systems']
query = current_appliance.db.client.session.query(
t_ms.id, t_ms.name, t_ms.hostname, t_ms.feed, t_ms.product,
t_ems.name.label('provider_name'),
t_ms.ems_ref, t_ms.properties,
t_msgr.name.label('server_group_name'))\
.join(t_ems, t_ms.ems_id == t_ems.id)\
.outerjoin(t_msgr, t_ms.server_group_id == t_msgr.id)
if name:
query = query.filter(t_ms.name == name)
if feed:
query = query.filter(t_ms.feed == feed)
if provider:
query = query.filter(t_ems.name == provider.name)
if server_group:
query = query.filter(t_msgr.name == server_group.name)
query = query.filter(t_msgr.feed == server_group.feed)
if product:
query = query.filter(t_ms.product == product)
return query
def _get_servers_page(provider=None, server_group=None):
if provider: # if provider instance is provided navigate through provider's servers page
return navigate_to(provider, 'ProviderServers')
elif server_group:
# if server group instance is provided navigate through it's servers page
return navigate_to(server_group, 'ServerGroupServers')
else: # if None(provider) given navigate through all middleware servers page
return navigate_to(MiddlewareServer, 'All')
class MiddlewareServer(MiddlewareBase, Taggable, Container, Navigatable, UtilizationMixin):
"""
MiddlewareServer class provides actions and details on Server page.
Class method available to get existing servers list
Args:
name: name of the server
hostname: Host name of the server
provider: Provider object (HawkularProvider)
product: Product type of the server
feed: feed of the server
db_id: database row id of server
Usage:
myserver = MiddlewareServer(name='Foo.war', provider=haw_provider)
myserver.reload_server()
myservers = MiddlewareServer.servers()
"""
property_tuples = [('name', 'Name'), ('feed', 'Feed'),
('bound_address', 'Bind Address')]
taggable_type = 'MiddlewareServer'
deployment_message = 'Deployment "{}" has been initiated on this server.'
def __init__(self, name, provider=None, appliance=None, **kwargs):
Navigatable.__init__(self, appliance=appliance)
if name is None:
raise KeyError("'name' should not be 'None'")
self.name = name
self.provider = provider
self.product = kwargs['product'] if 'product' in kwargs else None
self.hostname = kwargs['hostname'] if 'hostname' in kwargs else None
self.feed = kwargs['feed'] if 'feed' in kwargs else None
self.db_id = kwargs['db_id'] if 'db_id' in kwargs else None
if 'properties' in kwargs:
for prop in kwargs['properties']:
# check the properties first, so it will not overwrite core attributes
if getattr(self, attributize_string(prop), None) is None:
setattr(self, attributize_string(prop), kwargs['properties'][prop])
@classmethod
def servers(cls, provider=None, server_group=None, strict=True):
servers = []
view = _get_servers_page(provider=provider, server_group=server_group)
_provider = provider # In deployment UI, we cannot get provider name on list all page
for _ in view.entities.paginator.pages():
for row in view.entities.elements:
if strict:
_provider = get_crud_by_name(row.provider.text)
servers.append(MiddlewareServer(
name=row.server_name.text,
feed=row.feed.text,
hostname=row.host_name.text,
product=row.product.text
if row.product.text else None,
provider=_provider))
return servers
@classmethod
def headers(cls):
view = navigate_to(MiddlewareServer, 'All')
headers = [hdr.encode("utf-8")
for hdr in view.entities.elements.headers if hdr]
return headers
@classmethod
def servers_in_db(cls, name=None, feed=None, provider=None, product=None,
server_group=None, strict=True):
servers = []
rows = _db_select_query(name=name, feed=feed, provider=provider,
product=product, server_group=server_group).all()
_provider = provider
for server in rows:
if strict:
_provider = get_crud_by_name(server.provider_name)
servers.append(MiddlewareServer(
name=server.name,
hostname=server.hostname,
feed=server.feed,
product=server.product,
db_id=server.id,
provider=_provider,
properties=parse_properties(server.properties)))
return servers
@classmethod
def _servers_in_mgmt(cls, provider, server_group=None):
servers = []
rows = provider.mgmt.inventory.list_server(feed_id=server_group.feed
if server_group else None)
for row in rows:
server = MiddlewareServer(
name=re.sub('(Domain )|(WildFly Server \\[)|(\\])', '', row.name),
hostname=row.data['Hostname']
if 'Hostname' in row.data else None,
feed=row.path.feed_id,
product=row.data['Product Name']
if 'Product Name' in row.data else None,
provider=provider)
# if server_group is given, filter those servers which belongs to it
if not server_group or cls._belongs_to_group(server, server_group):
servers.append(server)
return servers
@classmethod
def servers_in_mgmt(cls, provider=None, server_group=None):
if provider is None:
servers = []
for _provider in list_providers_by_class(HawkularProvider):
servers.extend(cls._servers_in_mgmt(_provider, server_group))
return servers
else:
return cls._servers_in_mgmt(provider, server_group)
@classmethod
def _belongs_to_group(cls, server, server_group):
server_mgmt = server.server(method='mgmt')
return getattr(server_mgmt, attributize_string('Server Group'), None) == server_group.name
def load_details(self, refresh=False):
view = navigate_to(self, 'Details')
if not self.db_id or refresh:
tmp_ser = self.server(method='db')
self.db_id = tmp_ser.db_id
if refresh:
view.browser.selenium.refresh()
view.flush_widget_cache()
return view
@variable(alias='ui')
def server(self):
self.load_details(refresh=False)
return self
@server.variant('mgmt')
def server_in_mgmt(self):
db_srv = _db_select_query(name=self.name, provider=self.provider,
feed=self.feed).first()
if db_srv:
path = CanonicalPath(db_srv.ems_ref)
mgmt_srv = self.provider.mgmt.inventory.get_config_data(feed_id=path.feed_id,
resource_id=path.resource_id)
if mgmt_srv:
return MiddlewareServer(
provider=self.provider,
name=db_srv.name, feed=db_srv.feed,
properties=mgmt_srv.value)
return None
@server.variant('db')
def server_in_db(self):
server = _db_select_query(name=self.name, provider=self.provider,
feed=self.feed).first()
if server:
return MiddlewareServer(
db_id=server.id, provider=self.provider,
feed=server.feed, name=server.name,
hostname=server.hostname,
properties=parse_properties(server.properties))
return None
@server.variant('rest')
def server_in_rest(self):
raise NotImplementedError('This feature not implemented yet')
@variable(alias='ui')
def server_group(self):
self.load_details()
return MiddlewareServerGroup(
provider=self.provider,
name=self.get_detail("Properties", "Name"),
domain=MiddlewareDomain(
provider=self.provider,
name=self.get_detail("Relationships", "Middleware Domain")))
@variable(alias='ui')
def is_reload_required(self):
self.load_details(refresh=True)
return self.get_detail("Properties", "Server State") == 'Reload-required'
@variable(alias='ui')
def is_running(self):
self.load_details(refresh=True)
return self.get_detail("Properties", "Server State") == 'Running'
@variable(alias='db')
def is_suspended(self):
server = _db_select_query(name=self.name, provider=self.provider,
feed=self.feed).first()
if not server:
raise MiddlewareServerNotFound("Server '{}' not found in DB!".format(self.name))
return parse_properties(server.properties)['Suspend State'] == 'SUSPENDED'
@variable(alias='ui')
def is_starting(self):
self.load_details(refresh=True)
return self.get_detail("Properties", "Server State") == 'Starting'
@variable(alias='ui')
def is_stopping(self):
self.load_details(refresh=True)
return self.get_detail("Properties", "Server State") == 'Stopping'
@variable(alias='ui')
def is_stopped(self):
self.load_details(refresh=True)
return self.get_detail("Properties", "Server State") == 'Stopped'
def shutdown_server(self, timeout=10, cancel=False):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Gracefully shutdown Server')
view.power_operation_form.fill({
"timeout": timeout,
})
if cancel:
view.power_operation_form.cancel_button.click()
else:
view.power_operation_form.shutdown_button.click()
view.flash.assert_success_message('Shutdown initiated for selected server(s)')
def restart_server(self):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Restart Server', handle_alert=True)
view.flash.assert_success_message('Restart initiated for selected server(s)')
def start_server(self):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Start Server', handle_alert=True)
view.assert_success_message('Start initiated for selected server(s)')
def suspend_server(self, timeout=10, cancel=False):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Suspend Server')
view.power_operation_form.fill({
"timeout": timeout,
})
if cancel:
view.power_operation_form.cancel_button.click()
else:
view.power_operation_form.suspend_button.click()
view.flash.assert_success_message('Suspend initiated for selected server(s)')
def resume_server(self):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Resume Server', handle_alert=True)
view.flash.assert_success_message('Resume initiated for selected server(s)')
def reload_server(self):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Reload Server', handle_alert=True)
view.flash.assert_success_message('Reload initiated for selected server(s)')
def stop_server(self):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Stop Server', handle_alert=True)
view.flash.assert_success_message('Stop initiated for selected server(s)')
def kill_server(self):
view = self.load_details(refresh=True)
view.toolbar.power.item_select('Kill Server', handle_alert=True)
view.flash.assert_success_message('Kill initiated for selected server(s)')
@classmethod
def download(cls, extension, provider=None, server_group=None):
view = _get_servers_page(provider, server_group)
download(view, extension)
@navigator.register(MiddlewareServer, 'All')
class All(CFMENavigateStep):
VIEW = ServerAllView
prerequisite = NavigateToAttribute('appliance.server', 'LoggedIn')
def step(self):
self.prerequisite_view.navigation.select('Middleware', 'Servers')
@navigator.register(MiddlewareServer, 'Details')
class Details(CFMENavigateStep):
VIEW = ServerDetailsView
prerequisite = NavigateToSibling('All')
def step(self, *args, **kwargs):
try:
if self.obj.feed:
# TODO find_row_on_pages change to entities.get_entity()
row = self.prerequisite_view.entities.paginator.find_row_on_pages(
self.prerequisite_view.entities.elements,
server_name=self.obj.name, feed=self.obj.feed)
elif self.obj.hostname:
row = self.prerequisite_view.entities.paginator.find_row_on_pages(
self.prerequisite_view.entities.elements,
server_name=self.obj.name, host_name=self.obj.hostname)
else:
row = self.prerequisite_view.entities.paginator.find_row_on_pages(
self.prerequisite_view.entities.elements, server_name=self.obj.name)
except NoSuchElementException:
raise MiddlewareServerNotFound(
"Server '{}' not found in table".format(self.obj.name))
row.click()
@navigator.register(MiddlewareServer, 'ServerDatasources')
class ServerDatasources(CFMENavigateStep):
VIEW = ServerDatasourceAllView
prerequisite = NavigateToSibling('Details')
def step(self):
self.prerequisite_view.entities.relationships.click_at('Middleware Datasources')
@navigator.register(MiddlewareServer, 'ServerDeployments')
class ServerDeployments(CFMENavigateStep):
VIEW = ServerDeploymentAllView
prerequisite = NavigateToSibling('Details')
def step(self):
self.prerequisite_view.entities.relationships.click_at('Middleware Deployments')
@navigator.register(MiddlewareServer, 'ServerMessagings')
class ServerMessagings(CFMENavigateStep):
VIEW = ServerMessagingAllView
prerequisite = NavigateToSibling('Details')
def step(self):
self.prerequisite_view.entities.relationships.click_at('Middleware Messagings')
@navigator.register(MiddlewareServer, 'ServerGroup')
class ServerGroup(CFMENavigateStep):
VIEW = ServerGroupDetailsView
prerequisite = NavigateToSibling('Details')
def step(self):
try:
self.prerequisite_view.entities.relationships.click_at('Middleware Server Group')
except NoSuchElementException:
raise MiddlewareServerGroupNotFound('Server does not belong to Server Group')
@navigator.register(MiddlewareServer, 'AddDatasource')
class AddDatasource(CFMENavigateStep):
VIEW = AddDatasourceView
prerequisite = NavigateToSibling('Details')
def step(self):
self.prerequisite_view.toolbar.datasources.item_select('Add Datasource')
@navigator.register(MiddlewareServer, 'AddJDBCDriver')
class AddJDBCDriver(CFMENavigateStep):
VIEW = AddJDBCDriverView
prerequisite = NavigateToSibling('Details')
def step(self):
self.prerequisite_view.toolbar.drivers.item_select('Add JDBC Driver')
@navigator.register(MiddlewareServer, 'AddDeployment')
class AddDeployment(CFMENavigateStep):
VIEW = AddDeploymentView
prerequisite = NavigateToSibling('Details')
def step(self):
self.prerequisite_view.toolbar.deployments.item_select('Add Deployment')
| gpl-2.0 | 6,179,716,487,599,874,000 | 39.540416 | 98 | 0.645779 | false |
ESOedX/edx-platform | lms/djangoapps/verify_student/models.py | 1 | 42981 | # -*- coding: utf-8 -*-
"""
Models for Student Identity Verification
This is where we put any models relating to establishing the real-life identity
of a student over a period of time. Right now, the only models are the abstract
`PhotoVerification`, and its one concrete implementation
`SoftwareSecurePhotoVerification`. The hope is to keep as much of the
photo verification process as generic as possible.
"""
from __future__ import absolute_import, unicode_literals
import base64
import codecs
import functools
import json
import logging
import os.path
import simplejson
import uuid
from datetime import timedelta
from email.utils import formatdate
import requests
import six
from django.conf import settings
from django.contrib.auth.models import User
from django.core.files.base import ContentFile
from django.db import models
from django.urls import reverse
from django.utils.encoding import python_2_unicode_compatible
from django.utils.functional import cached_property
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy
from model_utils import Choices
from model_utils.models import StatusModel, TimeStampedModel
from opaque_keys.edx.django.models import CourseKeyField
from lms.djangoapps.verify_student.ssencrypt import (
encrypt_and_encode,
generate_signed_message,
random_aes_key,
rsa_encrypt
)
from openedx.core.djangoapps.signals.signals import LEARNER_NOW_VERIFIED
from openedx.core.storage import get_storage
from .utils import earliest_allowed_verification_date
log = logging.getLogger(__name__)
def generateUUID(): # pylint: disable=invalid-name
""" Utility function; generates UUIDs """
return six.text_type(uuid.uuid4())
class VerificationException(Exception):
pass
def status_before_must_be(*valid_start_statuses):
"""
Helper decorator with arguments to make sure that an object with a `status`
attribute is in one of a list of acceptable status states before a method
is called. You could use it in a class definition like:
@status_before_must_be("submitted", "approved", "denied")
def refund_user(self, user_id):
# Do logic here...
If the object has a status that is not listed when the `refund_user` method
is invoked, it will throw a `VerificationException`. This is just to avoid
distracting boilerplate when looking at a Model that needs to go through a
workflow process.
"""
def decorator_func(func):
"""
Decorator function that gets returned
"""
@functools.wraps(func)
def with_status_check(obj, *args, **kwargs):
if obj.status not in valid_start_statuses:
exception_msg = (
u"Error calling {} {}: status is '{}', must be one of: {}"
).format(func, obj, obj.status, valid_start_statuses)
raise VerificationException(exception_msg)
return func(obj, *args, **kwargs)
return with_status_check
return decorator_func
class IDVerificationAttempt(StatusModel):
"""
Each IDVerificationAttempt represents a Student's attempt to establish
their identity through one of several methods that inherit from this Model,
including PhotoVerification and SSOVerification.
.. pii: The User's name is stored in this and sub-models
.. pii_types: name
.. pii_retirement: retained
"""
STATUS = Choices('created', 'ready', 'submitted', 'must_retry', 'approved', 'denied')
user = models.ForeignKey(User, db_index=True, on_delete=models.CASCADE)
# They can change their name later on, so we want to copy the value here so
# we always preserve what it was at the time they requested. We only copy
# this value during the mark_ready() step. Prior to that, you should be
# displaying the user's name from their user.profile.name.
name = models.CharField(blank=True, max_length=255)
created_at = models.DateTimeField(auto_now_add=True, db_index=True)
updated_at = models.DateTimeField(auto_now=True, db_index=True)
class Meta(object):
app_label = "verify_student"
abstract = True
ordering = ['-created_at']
@property
def expiration_datetime(self):
"""Datetime that the verification will expire. """
days_good_for = settings.VERIFY_STUDENT["DAYS_GOOD_FOR"]
return self.created_at + timedelta(days=days_good_for)
def should_display_status_to_user(self):
"""Whether or not the status from this attempt should be displayed to the user."""
raise NotImplementedError
def active_at_datetime(self, deadline):
"""Check whether the verification was active at a particular datetime.
Arguments:
deadline (datetime): The date at which the verification was active
(created before and expiration datetime is after today).
Returns:
bool
"""
return (
self.created_at < deadline and
self.expiration_datetime > now()
)
@python_2_unicode_compatible
class ManualVerification(IDVerificationAttempt):
"""
Each ManualVerification represents a user's verification that bypasses the need for
any other verification.
.. pii: The User's name is stored in the parent model
.. pii_types: name
.. pii_retirement: retained
"""
reason = models.CharField(
max_length=255,
blank=True,
help_text=(
'Specifies the reason for manual verification of the user.'
)
)
class Meta(object):
app_label = 'verify_student'
def __str__(self):
return 'ManualIDVerification for {name}, status: {status}'.format(
name=self.name,
status=self.status,
)
def should_display_status_to_user(self):
"""
Whether or not the status should be displayed to the user.
"""
return False
@python_2_unicode_compatible
class SSOVerification(IDVerificationAttempt):
"""
Each SSOVerification represents a Student's attempt to establish their identity
by signing in with SSO. ID verification through SSO bypasses the need for
photo verification.
.. no_pii:
"""
OAUTH2 = 'third_party_auth.models.OAuth2ProviderConfig'
SAML = 'third_party_auth.models.SAMLProviderConfig'
LTI = 'third_party_auth.models.LTIProviderConfig'
IDENTITY_PROVIDER_TYPE_CHOICES = (
(OAUTH2, 'OAuth2 Provider'),
(SAML, 'SAML Provider'),
(LTI, 'LTI Provider'),
)
identity_provider_type = models.CharField(
max_length=100,
blank=False,
choices=IDENTITY_PROVIDER_TYPE_CHOICES,
default=SAML,
help_text=(
'Specifies which type of Identity Provider this verification originated from.'
)
)
identity_provider_slug = models.SlugField(
max_length=30, db_index=True, default='default',
help_text=(
'The slug uniquely identifying the Identity Provider this verification originated from.'
))
class Meta(object):
app_label = "verify_student"
def __str__(self):
return 'SSOIDVerification for {name}, status: {status}'.format(
name=self.name,
status=self.status,
)
def should_display_status_to_user(self):
"""Whether or not the status from this attempt should be displayed to the user."""
return False
class PhotoVerification(IDVerificationAttempt):
"""
Each PhotoVerification represents a Student's attempt to establish
their identity by uploading a photo of themselves and a picture ID. An
attempt actually has a number of fields that need to be filled out at
different steps of the approval process. While it's useful as a Django Model
for the querying facilities, **you should only edit a `PhotoVerification`
object through the methods provided**. Initialize them with a user:
attempt = PhotoVerification(user=user)
We track this attempt through various states:
`created`
Initial creation and state we're in after uploading the images.
`ready`
The user has uploaded their images and checked that they can read the
images. There's a separate state here because it may be the case that we
don't actually submit this attempt for review until payment is made.
`submitted`
Submitted for review. The review may be done by a staff member or an
external service. The user cannot make changes once in this state.
`must_retry`
We submitted this, but there was an error on submission (i.e. we did not
get a 200 when we POSTed to Software Secure)
`approved`
An admin or an external service has confirmed that the user's photo and
photo ID match up, and that the photo ID's name matches the user's.
`denied`
The request has been denied. See `error_msg` for details on why. An
admin might later override this and change to `approved`, but the
student cannot re-open this attempt -- they have to create another
attempt and submit it instead.
Because this Model inherits from IDVerificationAttempt, which inherits
from StatusModel, we can also do things like:
attempt.status == PhotoVerification.STATUS.created
attempt.status == "created"
pending_requests = PhotoVerification.submitted.all()
.. pii: The User's name is stored in the parent model, this one stores links to face and photo ID images
.. pii_types: name, image
.. pii_retirement: retained
"""
######################## Fields Set During Creation ########################
# See class docstring for description of status states
# Where we place the uploaded image files (e.g. S3 URLs)
face_image_url = models.URLField(blank=True, max_length=255)
photo_id_image_url = models.URLField(blank=True, max_length=255)
# Randomly generated UUID so that external services can post back the
# results of checking a user's photo submission without use exposing actual
# user IDs or something too easily guessable.
receipt_id = models.CharField(
db_index=True,
default=generateUUID,
max_length=255,
)
# Indicates whether or not a user wants to see the verification status
# displayed on their dash. Right now, only relevant for allowing students
# to "dismiss" a failed midcourse reverification message
# TODO: This field is deprecated.
display = models.BooleanField(db_index=True, default=True)
######################## Fields Set When Submitting ########################
submitted_at = models.DateTimeField(null=True, db_index=True)
#################### Fields Set During Approval/Denial #####################
# If the review was done by an internal staff member, mark who it was.
reviewing_user = models.ForeignKey(
User,
db_index=True,
default=None,
null=True,
related_name="photo_verifications_reviewed",
on_delete=models.CASCADE,
)
# Mark the name of the service used to evaluate this attempt (e.g
# Software Secure).
reviewing_service = models.CharField(blank=True, max_length=255)
# If status is "denied", this should contain text explaining why.
error_msg = models.TextField(blank=True)
# Non-required field. External services can add any arbitrary codes as time
# goes on. We don't try to define an exhuastive list -- this is just
# capturing it so that we can later query for the common problems.
error_code = models.CharField(blank=True, max_length=50)
class Meta(object):
app_label = "verify_student"
abstract = True
ordering = ['-created_at']
def parsed_error_msg(self):
"""
Sometimes, the error message we've received needs to be parsed into
something more human readable
The default behavior is to return the current error message as is.
"""
return self.error_msg
@status_before_must_be("created")
def upload_face_image(self, img):
raise NotImplementedError
@status_before_must_be("created")
def upload_photo_id_image(self, img):
raise NotImplementedError
@status_before_must_be("created")
def mark_ready(self):
"""
Mark that the user data in this attempt is correct. In order to
succeed, the user must have uploaded the necessary images
(`face_image_url`, `photo_id_image_url`). This method will also copy
their name from their user profile. Prior to marking it ready, we read
this value directly from their profile, since they're free to change it.
This often happens because people put in less formal versions of their
name on signup, but realize they want something different to go on a
formal document.
Valid attempt statuses when calling this method:
`created`
Status after method completes: `ready`
Other fields that will be set by this method:
`name`
State Transitions:
`created` → `ready`
This is what happens when the user confirms to us that the pictures
they uploaded are good. Note that we don't actually do a submission
anywhere yet.
"""
# At any point prior to this, they can change their names via their
# student dashboard. But at this point, we lock the value into the
# attempt.
self.name = self.user.profile.name
self.status = "ready"
self.save()
@status_before_must_be("must_retry", "submitted", "approved", "denied")
def approve(self, user_id=None, service=""):
"""
Approve this attempt. `user_id`
Valid attempt statuses when calling this method:
`submitted`, `approved`, `denied`
Status after method completes: `approved`
Other fields that will be set by this method:
`reviewed_by_user_id`, `reviewed_by_service`, `error_msg`
State Transitions:
`submitted` → `approved`
This is the usual flow, whether initiated by a staff user or an
external validation service.
`approved` → `approved`
No-op. First one to approve it wins.
`denied` → `approved`
This might happen if a staff member wants to override a decision
made by an external service or another staff member (say, in
response to a support request). In this case, the previous values
of `reviewed_by_user_id` and `reviewed_by_service` will be changed
to whoever is doing the approving, and `error_msg` will be reset.
The only record that this record was ever denied would be in our
logs. This should be a relatively rare occurence.
"""
# If someone approves an outdated version of this, the first one wins
if self.status == "approved":
return
log.info(u"Verification for user '{user_id}' approved by '{reviewer}'.".format(
user_id=self.user, reviewer=user_id
))
self.error_msg = "" # reset, in case this attempt was denied before
self.error_code = "" # reset, in case this attempt was denied before
self.reviewing_user = user_id
self.reviewing_service = service
self.status = "approved"
self.save()
# Emit signal to find and generate eligible certificates
LEARNER_NOW_VERIFIED.send_robust(
sender=PhotoVerification,
user=self.user
)
message = u'LEARNER_NOW_VERIFIED signal fired for {user}'
log.info(message.format(user=self.user.username))
@status_before_must_be("must_retry", "submitted", "approved", "denied")
def deny(self,
error_msg,
error_code="",
reviewing_user=None,
reviewing_service=""):
"""
Deny this attempt.
Valid attempt statuses when calling this method:
`submitted`, `approved`, `denied`
Status after method completes: `denied`
Other fields that will be set by this method:
`reviewed_by_user_id`, `reviewed_by_service`, `error_msg`,
`error_code`
State Transitions:
`submitted` → `denied`
This is the usual flow, whether initiated by a staff user or an
external validation service.
`approved` → `denied`
This might happen if a staff member wants to override a decision
made by an external service or another staff member, or just correct
a mistake made during the approval process. In this case, the
previous values of `reviewed_by_user_id` and `reviewed_by_service`
will be changed to whoever is doing the denying. The only record
that this record was ever approved would be in our logs. This should
be a relatively rare occurence.
`denied` → `denied`
Update the error message and reviewing_user/reviewing_service. Just
lets you amend the error message in case there were additional
details to be made.
"""
log.info(u"Verification for user '{user_id}' denied by '{reviewer}'.".format(
user_id=self.user, reviewer=reviewing_user
))
self.error_msg = error_msg
self.error_code = error_code
self.reviewing_user = reviewing_user
self.reviewing_service = reviewing_service
self.status = "denied"
self.save()
@status_before_must_be("must_retry", "submitted", "approved", "denied")
def system_error(self,
error_msg,
error_code="",
reviewing_user=None,
reviewing_service=""):
"""
Mark that this attempt could not be completed because of a system error.
Status should be moved to `must_retry`. For example, if Software Secure
reported to us that they couldn't process our submission because they
couldn't decrypt the image we sent.
"""
if self.status in ["approved", "denied"]:
return # If we were already approved or denied, just leave it.
self.error_msg = error_msg
self.error_code = error_code
self.reviewing_user = reviewing_user
self.reviewing_service = reviewing_service
self.status = "must_retry"
self.save()
@classmethod
def retire_user(cls, user_id):
"""
Retire user as part of GDPR Phase I
Returns 'True' if records found
:param user_id: int
:return: bool
"""
try:
user_obj = User.objects.get(id=user_id)
except User.DoesNotExist:
return False
photo_objects = cls.objects.filter(
user=user_obj
).update(
name='',
face_image_url='',
photo_id_image_url='',
photo_id_key=''
)
return photo_objects > 0
class SoftwareSecurePhotoVerification(PhotoVerification):
"""
Model to verify identity using a service provided by Software Secure. Much
of the logic is inherited from `PhotoVerification`, but this class
encrypts the photos.
Software Secure (http://www.softwaresecure.com/) is a remote proctoring
service that also does identity verification. A student uses their webcam
to upload two images: one of their face, one of a photo ID. Due to the
sensitive nature of the data, the following security precautions are taken:
1. The snapshot of their face is encrypted using AES-256 in CBC mode. All
face photos are encypted with the same key, and this key is known to
both Software Secure and edx-platform.
2. The snapshot of a user's photo ID is also encrypted using AES-256, but
the key is randomly generated using os.urandom. Every verification
attempt has a new key. The AES key is then encrypted using a public key
provided by Software Secure. We store only the RSA-encryped AES key.
Since edx-platform does not have Software Secure's private RSA key, it
means that we can no longer even read photo ID.
3. The encrypted photos are base64 encoded and stored in an S3 bucket that
edx-platform does not have read access to.
Note: this model handles *inital* verifications (which you must perform
at the time you register for a verified cert).
.. pii: The User's name is stored in the parent model, this one stores links to face and photo ID images
.. pii_types: name, image
.. pii_retirement: retained
"""
# This is a base64.urlsafe_encode(rsa_encrypt(photo_id_aes_key), ss_pub_key)
# So first we generate a random AES-256 key to encrypt our photo ID with.
# Then we RSA encrypt it with Software Secure's public key. Then we base64
# encode that. The result is saved here. Actual expected length is 344.
photo_id_key = models.TextField(max_length=1024)
IMAGE_LINK_DURATION = 5 * 60 * 60 * 24 # 5 days in seconds
copy_id_photo_from = models.ForeignKey("self", null=True, blank=True, on_delete=models.CASCADE)
# Fields for functionality of sending email when verification expires
# expiry_date: The date when the SoftwareSecurePhotoVerification will expire
# expiry_email_date: This field is used to maintain a check for learners to which email
# to notify for expired verification is already sent.
expiry_date = models.DateTimeField(null=True, blank=True, db_index=True)
expiry_email_date = models.DateTimeField(null=True, blank=True, db_index=True)
@status_before_must_be("must_retry", "submitted", "approved", "denied")
def approve(self, user_id=None, service=""):
"""
Approve the verification attempt for user
Valid attempt statuses when calling this method:
`submitted`, `approved`, `denied`
After method completes:
status is set to `approved`
expiry_date is set to one year from now
"""
self.expiry_date = now() + timedelta(
days=settings.VERIFY_STUDENT["DAYS_GOOD_FOR"]
)
super(SoftwareSecurePhotoVerification, self).approve(user_id, service)
@classmethod
def get_initial_verification(cls, user, earliest_allowed_date=None):
"""Get initial verification for a user with the 'photo_id_key'.
Arguments:
user(User): user object
earliest_allowed_date(datetime): override expiration date for initial verification
Return:
SoftwareSecurePhotoVerification (object) or None
"""
init_verification = cls.objects.filter(
user=user,
status__in=["submitted", "approved"],
created_at__gte=(
earliest_allowed_date or earliest_allowed_verification_date()
)
).exclude(photo_id_key='')
return init_verification.latest('created_at') if init_verification.exists() else None
@status_before_must_be("created")
def upload_face_image(self, img_data):
"""
Upload an image of the user's face. `img_data` should be a raw
bytestream of a PNG image. This method will take the data, encrypt it
using our FACE_IMAGE_AES_KEY, encode it with base64 and save it to the
storage backend.
Yes, encoding it to base64 adds compute and disk usage without much real
benefit, but that's what the other end of this API is expecting to get.
"""
# Skip this whole thing if we're running acceptance tests or if we're
# developing and aren't interested in working on student identity
# verification functionality. If you do want to work on it, you have to
# explicitly enable these in your private settings.
if settings.FEATURES.get('AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'):
return
aes_key_str = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["FACE_IMAGE_AES_KEY"]
if six.PY3:
aes_key = codecs.decode(aes_key_str, "hex")
else:
aes_key = aes_key_str.decode("hex")
path = self._get_path("face")
buff = ContentFile(encrypt_and_encode(img_data, aes_key))
self._storage.save(path, buff)
@status_before_must_be("created")
def upload_photo_id_image(self, img_data):
"""
Upload an the user's photo ID image. `img_data` should be a raw
bytestream of a PNG image. This method will take the data, encrypt it
using a randomly generated AES key, encode it with base64 and save it
to the storage backend. The random key is also encrypted using Software
Secure's public RSA key and stored in our `photo_id_key` field.
Yes, encoding it to base64 adds compute and disk usage without much real
benefit, but that's what the other end of this API is expecting to get.
"""
# Skip this whole thing if we're running acceptance tests or if we're
# developing and aren't interested in working on student identity
# verification functionality. If you do want to work on it, you have to
# explicitly enable these in your private settings.
if settings.FEATURES.get('AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'):
# fake photo id key is set only for initial verification
self.photo_id_key = 'fake-photo-id-key'
self.save()
return
aes_key = random_aes_key()
rsa_key_str = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["RSA_PUBLIC_KEY"]
rsa_encrypted_aes_key = rsa_encrypt(aes_key, rsa_key_str)
# Save this to the storage backend
path = self._get_path("photo_id")
buff = ContentFile(encrypt_and_encode(img_data, aes_key))
self._storage.save(path, buff)
# Update our record fields
if six.PY3:
self.photo_id_key = codecs.encode(rsa_encrypted_aes_key, 'base64')
else:
self.photo_id_key = rsa_encrypted_aes_key.encode('base64')
self.save()
@status_before_must_be("must_retry", "ready", "submitted")
def submit(self, copy_id_photo_from=None):
"""
Submit our verification attempt to Software Secure for validation. This
will set our status to "submitted" if the post is successful, and
"must_retry" if the post fails.
Keyword Arguments:
copy_id_photo_from (SoftwareSecurePhotoVerification): If provided, re-send the ID photo
data from this attempt. This is used for reverification, in which new face photos
are sent with previously-submitted ID photos.
"""
try:
response = self.send_request(copy_id_photo_from=copy_id_photo_from)
if response.ok:
self.submitted_at = now()
self.status = "submitted"
self.save()
else:
self.status = "must_retry"
self.error_msg = response.text
self.save()
except Exception: # pylint: disable=broad-except
log.exception(
u'Software Secure submission failed for user %s, setting status to must_retry',
self.user.username
)
self.status = "must_retry"
self.save()
def parsed_error_msg(self):
"""
Parse the error messages we receive from SoftwareSecure
Error messages are written in the form:
`[{"photoIdReasons": ["Not provided"]}]`
Returns:
str[]: List of error messages.
"""
parsed_errors = []
error_map = {
'EdX name not provided': 'name_mismatch',
'Name mismatch': 'name_mismatch',
'Photo/ID Photo mismatch': 'photos_mismatched',
'ID name not provided': 'id_image_missing_name',
'Invalid Id': 'id_invalid',
'No text': 'id_invalid',
'Not provided': 'id_image_missing',
'Photo hidden/No photo': 'id_image_not_clear',
'Text not clear': 'id_image_not_clear',
'Face out of view': 'user_image_not_clear',
'Image not clear': 'user_image_not_clear',
'Photo not provided': 'user_image_missing',
}
try:
messages = set()
message_groups = json.loads(self.error_msg)
for message_group in message_groups:
messages = messages.union(set(*six.itervalues(message_group)))
for message in messages:
parsed_error = error_map.get(message)
if parsed_error:
parsed_errors.append(parsed_error)
else:
log.debug(u'Ignoring photo verification error message: %s', message)
except Exception: # pylint: disable=broad-except
log.exception(u'Failed to parse error message for SoftwareSecurePhotoVerification %d', self.pk)
return parsed_errors
def image_url(self, name, override_receipt_id=None):
"""
We dynamically generate this, since we want it the expiration clock to
start when the message is created, not when the record is created.
Arguments:
name (str): Name of the image (e.g. "photo_id" or "face")
Keyword Arguments:
override_receipt_id (str): If provided, use this receipt ID instead
of the ID for this attempt. This is useful for reverification
where we need to construct a URL to a previously-submitted
photo ID image.
Returns:
string: The expiring URL for the image.
"""
path = self._get_path(name, override_receipt_id=override_receipt_id)
return self._storage.url(path)
@cached_property
def _storage(self):
"""
Return the configured django storage backend.
"""
config = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]
# Default to the S3 backend for backward compatibility
storage_class = config.get("STORAGE_CLASS", "storages.backends.s3boto.S3BotoStorage")
storage_kwargs = config.get("STORAGE_KWARGS", {})
# Map old settings to the parameters expected by the storage backend
if "AWS_ACCESS_KEY" in config:
storage_kwargs["access_key"] = config["AWS_ACCESS_KEY"]
if "AWS_SECRET_KEY" in config:
storage_kwargs["secret_key"] = config["AWS_SECRET_KEY"]
if "S3_BUCKET" in config:
storage_kwargs["bucket"] = config["S3_BUCKET"]
storage_kwargs["querystring_expire"] = self.IMAGE_LINK_DURATION
return get_storage(storage_class, **storage_kwargs)
def _get_path(self, prefix, override_receipt_id=None):
"""
Returns the path to a resource with this instance's `receipt_id`.
If `override_receipt_id` is given, the path to that resource will be
retrieved instead. This allows us to retrieve images submitted in
previous attempts (used for reverification, where we send a new face
photo with the same photo ID from a previous attempt).
"""
receipt_id = self.receipt_id if override_receipt_id is None else override_receipt_id
return os.path.join(prefix, receipt_id)
def _encrypted_user_photo_key_str(self):
"""
Software Secure needs to have both UserPhoto and PhotoID decrypted in
the same manner. So even though this is going to be the same for every
request, we're also using RSA encryption to encrypt the AES key for
faces.
"""
face_aes_key_str = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["FACE_IMAGE_AES_KEY"]
face_aes_key = codecs.decode(face_aes_key_str, 'hex')
rsa_key_str = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["RSA_PUBLIC_KEY"]
rsa_encrypted_face_aes_key = rsa_encrypt(face_aes_key, rsa_key_str)
return base64.b64encode(rsa_encrypted_face_aes_key)
def create_request(self, copy_id_photo_from=None):
"""
Construct the HTTP request to the photo verification service.
Keyword Arguments:
copy_id_photo_from (SoftwareSecurePhotoVerification): If provided, re-send the ID photo
data from this attempt. This is used for reverification, in which new face photos
are sent with previously-submitted ID photos.
Returns:
tuple of (header, body), where both `header` and `body` are dictionaries.
"""
access_key = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["API_ACCESS_KEY"]
secret_key = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["API_SECRET_KEY"]
scheme = "https" if settings.HTTPS == "on" else "http"
callback_url = "{}://{}{}".format(
scheme, settings.SITE_NAME, reverse('verify_student_results_callback')
)
# If we're copying the photo ID image from a previous verification attempt,
# then we need to send the old image data with the correct image key.
photo_id_url = (
self.image_url("photo_id")
if copy_id_photo_from is None
else self.image_url("photo_id", override_receipt_id=copy_id_photo_from.receipt_id)
)
photo_id_key = (
self.photo_id_key
if copy_id_photo_from is None else
copy_id_photo_from.photo_id_key
)
body = {
"EdX-ID": str(self.receipt_id),
"ExpectedName": self.name,
"PhotoID": photo_id_url,
"PhotoIDKey": photo_id_key,
"SendResponseTo": callback_url,
"UserPhoto": self.image_url("face"),
"UserPhotoKey": self._encrypted_user_photo_key_str(),
}
headers = {
"Content-Type": "application/json",
"Date": formatdate(timeval=None, localtime=False, usegmt=True)
}
_message, _sig, authorization = generate_signed_message(
"POST", headers, body, access_key, secret_key
)
headers['Authorization'] = authorization
return headers, body
def request_message_txt(self):
"""
This is the body of the request we send across. This is never actually
used in the code, but exists for debugging purposes -- you can call
`print attempt.request_message_txt()` on the console and get a readable
rendering of the request that would be sent across, without actually
sending anything.
"""
headers, body = self.create_request()
header_txt = "\n".join(
u"{}: {}".format(h, v) for h, v in sorted(headers.items())
)
body_txt = json.dumps(body, indent=2, sort_keys=True, ensure_ascii=False)
return header_txt + "\n\n" + body_txt
def send_request(self, copy_id_photo_from=None):
"""
Assembles a submission to Software Secure and sends it via HTTPS.
Keyword Arguments:
copy_id_photo_from (SoftwareSecurePhotoVerification): If provided, re-send the ID photo
data from this attempt. This is used for reverification, in which new face photos
are sent with previously-submitted ID photos.
Returns:
request.Response
"""
# If AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING is True, we want to
# skip posting anything to Software Secure. We actually don't even
# create the message because that would require encryption and message
# signing that rely on settings.VERIFY_STUDENT values that aren't set
# in dev. So we just pretend like we successfully posted
if settings.FEATURES.get('AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'):
fake_response = requests.Response()
fake_response.status_code = 200
return fake_response
headers, body = self.create_request(copy_id_photo_from=copy_id_photo_from)
response = requests.post(
settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["API_URL"],
headers=headers,
data=simplejson.dumps(body, indent=2, sort_keys=True, ensure_ascii=False).encode('utf-8'),
verify=False
)
log.info(u"Sent request to Software Secure for receipt ID %s.", self.receipt_id)
if copy_id_photo_from is not None:
log.info(
(
u"Software Secure attempt with receipt ID %s used the same photo ID "
u"data as the receipt with ID %s"
),
self.receipt_id, copy_id_photo_from.receipt_id
)
log.debug("Headers:\n{}\n\n".format(headers))
log.debug("Body:\n{}\n\n".format(body))
log.debug(u"Return code: {}".format(response.status_code))
log.debug(u"Return message:\n\n{}\n\n".format(response.text))
return response
def should_display_status_to_user(self):
"""Whether or not the status from this attempt should be displayed to the user."""
return True
@classmethod
def get_recent_verification(cls, user):
"""
Return the most recent approved verification of user
Keyword Arguments:
user (User): The user for which the most recent approved verification is fetched
Returns:
SoftwareSecurePhotoVerification (object) or None
"""
recent_verification = SoftwareSecurePhotoVerification.objects.filter(status='approved',
user_id=user.id,
expiry_date__isnull=False)
return recent_verification.latest('updated_at') if recent_verification.exists() else None
@classmethod
def update_expiry_email_date_for_user(cls, user, email_config):
"""
Updates the expiry_email_date to send expiry email if the most recent approved
verification for the user is expired.
Keyword Arguments:
user (User): user object
email_config (dict): Contains configuration related to verification expiry email
"""
today = now().replace(hour=0, minute=0, second=0, microsecond=0)
recently_expired_date = today - timedelta(days=email_config['DAYS_RANGE'])
verification = SoftwareSecurePhotoVerification.get_recent_verification(user)
if verification and verification.expiry_date < recently_expired_date and not verification.expiry_email_date:
expiry_email_date = today - timedelta(days=email_config['RESEND_DAYS'])
SoftwareSecurePhotoVerification.objects.filter(pk=verification.pk).update(
expiry_email_date=expiry_email_date)
class VerificationDeadline(TimeStampedModel):
"""
Represent a verification deadline for a particular course.
The verification deadline is the datetime after which
users are no longer allowed to submit photos for initial verification
in a course.
Note that this is NOT the same as the "upgrade" deadline, after
which a user is no longer allowed to upgrade to a verified enrollment.
If no verification deadline record exists for a course,
then that course does not have a deadline. This means that users
can submit photos at any time.
.. no_pii:
"""
class Meta(object):
app_label = "verify_student"
course_key = CourseKeyField(
max_length=255,
db_index=True,
unique=True,
help_text=ugettext_lazy(u"The course for which this deadline applies"),
)
deadline = models.DateTimeField(
help_text=ugettext_lazy(
u"The datetime after which users are no longer allowed "
"to submit photos for verification."
)
)
# The system prefers to set this automatically based on default settings. But
# if the field is set manually we want a way to indicate that so we don't
# overwrite the manual setting of the field.
deadline_is_explicit = models.BooleanField(default=False)
@classmethod
def set_deadline(cls, course_key, deadline, is_explicit=False):
"""
Configure the verification deadline for a course.
If `deadline` is `None`, then the course will have no verification
deadline. In this case, users will be able to verify for the course
at any time.
Arguments:
course_key (CourseKey): Identifier for the course.
deadline (datetime or None): The verification deadline.
"""
if deadline is None:
VerificationDeadline.objects.filter(course_key=course_key).delete()
else:
record, created = VerificationDeadline.objects.get_or_create(
course_key=course_key,
defaults={"deadline": deadline, "deadline_is_explicit": is_explicit}
)
if not created:
record.deadline = deadline
record.deadline_is_explicit = is_explicit
record.save()
@classmethod
def deadlines_for_enrollments(cls, enrollments_qs):
"""
Retrieve verification deadlines for a user's enrolled courses.
Arguments:
enrollments_qs: CourseEnrollment queryset. For performance reasons
we want the queryset here instead of passing in a
big list of course_keys in an "SELECT IN" query.
If we have a queryset, Django is smart enough to do
a performant subquery at the MySQL layer instead of
passing down all the course_keys through Python.
Returns:
dict: Map of course keys to datetimes (verification deadlines)
"""
verification_deadlines = VerificationDeadline.objects.filter(
course_key__in=enrollments_qs.values('course_id')
)
return {
deadline.course_key: deadline.deadline
for deadline in verification_deadlines
}
@classmethod
def deadline_for_course(cls, course_key):
"""
Retrieve the verification deadline for a particular course.
Arguments:
course_key (CourseKey): The identifier for the course.
Returns:
datetime or None
"""
try:
deadline = cls.objects.get(course_key=course_key)
return deadline.deadline
except cls.DoesNotExist:
return None
| agpl-3.0 | -2,559,742,744,883,523,000 | 38.31107 | 116 | 0.634324 | false |
tynn/lunchdate.bot | setup.py | 1 | 2335 | #!/usr/bin/env python
# vim: expandtab tabstop=4 shiftwidth=4
#
# Copyright (c) 2016 Christian Schmitz <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
A Slackbot for matching people for lunch once a week. Just let lunchdate.bot
have the hassle of pairing members of your team randomly, while they choose the
date themselves.
"""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name ='launchdate.bot',
version ='1.0',
description ="Slackbot for matching people for lunch once a week",
long_description=__doc__,
author ="Christian Schmitz",
author_email ="[email protected]",
url ="https://github.com/tynn/lunchdate.bot",
license ='LGPLv3+',
packages =[
'launchdate-bot',
'launchdate-bot.api',
'launchdate-bot.messenger'
],
package_dir ={'launchdate-bot': 'impl'},
platforms =['Linux'],
classifiers =[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: '
'GNU Lesser General Public License v3 or later (LGPLv3+)',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
])
| lgpl-3.0 | 3,637,720,484,865,586,700 | 37.278689 | 79 | 0.642398 | false |
DavidAndreev/indico | indico/modules/news/views.py | 1 | 1384 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# Indico is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Indico; if not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from indico.util.i18n import _
from MaKaC.webinterface.pages.admins import WPAdminsBase
from MaKaC.webinterface.pages.base import WPJinjaMixin, WPDecorated
class WPNews(WPJinjaMixin, WPDecorated):
template_prefix = 'news/'
def _getBody(self, params):
return self._getPageContent(params)
def getCSSFiles(self):
return WPDecorated.getCSSFiles(self) + self._asset_env['news_sass'].urls()
def _getTitle(self):
return WPDecorated._getTitle(self) + ' - ' + _("News")
class WPManageNews(WPJinjaMixin, WPAdminsBase):
sidemenu_option = 'news'
template_prefix = 'news/'
| gpl-3.0 | 2,399,463,689,616,099,000 | 34.487179 | 82 | 0.735549 | false |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_routes_operations.py | 1 | 20983 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class RoutesOperations:
"""RoutesOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2018_04_01.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def _delete_initial(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
**kwargs
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-04-01"
# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'),
'routeName': self._serialize.url("route_name", route_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore
async def begin_delete(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
**kwargs
) -> AsyncLROPoller[None]:
"""Deletes the specified route from a route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param route_name: The name of the route.
:type route_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
route_name=route_name,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'),
'routeName': self._serialize.url("route_name", route_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore
async def get(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
**kwargs
) -> "_models.Route":
"""Gets the specified route from a route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param route_name: The name of the route.
:type route_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Route, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2018_04_01.models.Route
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-04-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'),
'routeName': self._serialize.url("route_name", route_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('Route', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
route_parameters: "_models.Route",
**kwargs
) -> "_models.Route":
cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-04-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self._create_or_update_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'),
'routeName': self._serialize.url("route_name", route_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(route_parameters, 'Route')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('Route', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('Route', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore
async def begin_create_or_update(
self,
resource_group_name: str,
route_table_name: str,
route_name: str,
route_parameters: "_models.Route",
**kwargs
) -> AsyncLROPoller["_models.Route"]:
"""Creates or updates a route in the specified route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:param route_name: The name of the route.
:type route_name: str
:param route_parameters: Parameters supplied to the create or update route operation.
:type route_parameters: ~azure.mgmt.network.v2018_04_01.models.Route
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either Route or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2018_04_01.models.Route]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
route_table_name=route_table_name,
route_name=route_name,
route_parameters=route_parameters,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('Route', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'),
'routeName': self._serialize.url("route_name", route_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore
def list(
self,
resource_group_name: str,
route_table_name: str,
**kwargs
) -> AsyncIterable["_models.RouteListResult"]:
"""Gets all routes in a route table.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_table_name: The name of the route table.
:type route_table_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either RouteListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2018_04_01.models.RouteListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2018-04-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('RouteListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} # type: ignore
| mit | 1,575,352,485,687,395,300 | 48.025701 | 210 | 0.639327 | false |
christopherpoole/CADMesh | cmake/generateSingleHeader.py | 1 | 4672 |
import os
import subprocess
from glob import glob
from pathlib import Path
def readFile(filepath):
try:
with open(filepath) as f:
lines = f.readlines()
except:
return []
return lines
def readFiles(filepaths):
names = map(lambda p: Path(p).stem, filepaths)
files = map(readFile, filepaths)
return dict(zip(names, files))
def inlineSourceFunctions(sources):
# TODO: Tidy with clang first?
for name in sources.keys():
source = sources[name]
if name == "Exceptions":
for i, line in enumerate(source):
if line.strip().startswith("void ") and line.strip().endswith(")"):
sources[name][i] = "inline " + line
if name == "FileTypes":
for i, line in enumerate(source):
if line.strip().startswith("Type ") and line.strip().endswith(")"):
sources[name][i] = "inline " + line
else:
for i, line in enumerate(source):
if name + "::" in line and not line.startswith(" ") and not line.strip().endswith(";"):
sources[name][i] = "inline " + line
elif line.startswith("std::shared_ptr<BuiltInReader> BuiltIn()"):
sources[name][i] = "inline " + line
return sources
def stripComments(lines):
lines = [l for l in lines if not l.strip().startswith("/")]
lines = [l for l in lines if not l.strip().startswith("*")]
lines = [l.split("//")[0] for l in lines]
return lines
def stripMacros(lines):
lines = [l for l in lines if not l.strip().startswith("#pragma")]
return lines
def isLocalInclude(line, localIncludes):
if (not line.strip().startswith("#include")):
return False
include = Path(line.strip().split()[-1].strip("\"")).stem
return include in localIncludes
def stripLocalIncludes(lines, localIncludes):
lines = [l for l in lines if not isLocalInclude(l, localIncludes)]
return lines
def gatherIncludes(lines):
seen = []
unseen = []
for l in lines:
if (l.startswith("#include")):
if (l not in seen):
seen.append(l)
else:
continue
unseen.append(l)
return unseen
def addLicense(lines):
license = readFile("../LICENSE")
license = [ "// " + l for l in license ]
license.append("\n\n")
message = """// CADMESH - Load CAD files into Geant4 quickly and easily.
//
// Read all about it at: https://github.com/christopherpoole/CADMesh
//
// Basic usage:
//
// #include "CADMesh.hh" // This file.
// ...
// auto mesh = CADMesh::TessellatedMesh::FromSTL("mesh.stl");
// G4VSolid* solid = mesh->GetSolid();
// ...
//
// !! THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DON'T EDIT IT DIRECTLY. !!
"""
return license + [ message ] + lines
if __name__ == "__main__":
includes = [
"FileTypes"
, "Mesh"
, "Reader"
, "Lexer"
, "ASSIMPReader"
, "BuiltInReader"
, "CADMeshTemplate"
, "Exceptions"
, "TessellatedMesh"
, "TetrahedralMesh"
]
excludes = [
"CADMesh"
, "Configuration"
]
sources = [
"FileTypes"
, "Mesh"
, "Reader"
, "Lexer"
, "CADMeshTemplate"
, "Exceptions"
, "TessellatedMesh"
, "TetrahedralMesh"
]
readers = [
"LexerMacros"
, "STLReader"
, "OBJReader"
, "PLYReader"
, "ASSIMPReader"
, "BuiltInReader"
]
hh = readFiles([os.path.join("../include", i + ".hh") for i in includes + readers])
cc = readFiles([os.path.join("../src", s + ".cc") for s in sources + readers])
cc = inlineSourceFunctions(cc)
header = ["class " + h + ";\n" for h in hh]
for i in includes:
if i == "CADMeshTemplate":
header += "#ifndef CADMESH_DEFAULT_READER\n#define CADMESH_DEFAULT_READER BuiltIn\n#endif\n\n"
header += hh[i]
for s in sources:
header += cc[s]
for r in readers:
if r in includes and r in readers:
continue
header += hh[r]
for r in readers:
header += cc [r]
header = stripComments(header)
header = stripMacros(header)
header = stripLocalIncludes(header, sources + readers + excludes)
header = gatherIncludes(header)
header = [ "#pragma once\n\n" ] + header
header = addLicense(header)
with open("CADMesh.hh", "w") as f:
f.writelines(header)
subprocess.run(["clang-format", "-i", "CADMesh.hh"])
| mit | -8,369,801,982,411,803,000 | 20.730233 | 106 | 0.55244 | false |
kennethreitz/pipenv | pipenv/patched/notpip/_internal/commands/__init__.py | 1 | 4020 | """
Package containing all pip commands
"""
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import importlib
from collections import OrderedDict, namedtuple
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Any
from pipenv.patched.notpip._internal.cli.base_command import Command
CommandInfo = namedtuple('CommandInfo', 'module_path, class_name, summary')
# The ordering matters for help display.
# Also, even though the module path starts with the same
# "pipenv.patched.notpip._internal.commands" prefix in each case, we include the full path
# because it makes testing easier (specifically when modifying commands_dict
# in test setup / teardown by adding info for a FakeCommand class defined
# in a test-related module).
# Finally, we need to pass an iterable of pairs here rather than a dict
# so that the ordering won't be lost when using Python 2.7.
commands_dict = OrderedDict([
('install', CommandInfo(
'pipenv.patched.notpip._internal.commands.install', 'InstallCommand',
'Install packages.',
)),
('download', CommandInfo(
'pipenv.patched.notpip._internal.commands.download', 'DownloadCommand',
'Download packages.',
)),
('uninstall', CommandInfo(
'pipenv.patched.notpip._internal.commands.uninstall', 'UninstallCommand',
'Uninstall packages.',
)),
('freeze', CommandInfo(
'pipenv.patched.notpip._internal.commands.freeze', 'FreezeCommand',
'Output installed packages in requirements format.',
)),
('list', CommandInfo(
'pipenv.patched.notpip._internal.commands.list', 'ListCommand',
'List installed packages.',
)),
('show', CommandInfo(
'pipenv.patched.notpip._internal.commands.show', 'ShowCommand',
'Show information about installed packages.',
)),
('check', CommandInfo(
'pipenv.patched.notpip._internal.commands.check', 'CheckCommand',
'Verify installed packages have compatible dependencies.',
)),
('config', CommandInfo(
'pipenv.patched.notpip._internal.commands.configuration', 'ConfigurationCommand',
'Manage local and global configuration.',
)),
('search', CommandInfo(
'pipenv.patched.notpip._internal.commands.search', 'SearchCommand',
'Search PyPI for packages.',
)),
('wheel', CommandInfo(
'pipenv.patched.notpip._internal.commands.wheel', 'WheelCommand',
'Build wheels from your requirements.',
)),
('hash', CommandInfo(
'pipenv.patched.notpip._internal.commands.hash', 'HashCommand',
'Compute hashes of package archives.',
)),
('completion', CommandInfo(
'pipenv.patched.notpip._internal.commands.completion', 'CompletionCommand',
'A helper command used for command completion.',
)),
('debug', CommandInfo(
'pipenv.patched.notpip._internal.commands.debug', 'DebugCommand',
'Show information useful for debugging.',
)),
('help', CommandInfo(
'pipenv.patched.notpip._internal.commands.help', 'HelpCommand',
'Show help for commands.',
)),
]) # type: OrderedDict[str, CommandInfo]
def create_command(name, **kwargs):
# type: (str, **Any) -> Command
"""
Create an instance of the Command class with the given name.
"""
module_path, class_name, summary = commands_dict[name]
module = importlib.import_module(module_path)
command_class = getattr(module, class_name)
command = command_class(name=name, summary=summary, **kwargs)
return command
def get_similar_commands(name):
"""Command name auto-correct."""
from difflib import get_close_matches
name = name.lower()
close_commands = get_close_matches(name, commands_dict.keys())
if close_commands:
return close_commands[0]
else:
return False
| mit | -5,509,808,581,509,438,000 | 34.263158 | 90 | 0.677114 | false |
brian-rose/climlab | climlab/tests/test_emanuel_convection.py | 1 | 6379 | from __future__ import division
import numpy as np
import climlab
from climlab.convection import emanuel_convection
from climlab.tests.xarray_test import to_xarray
import pytest
# These test data are based on direct single-column tests of the CONVECT43c.f
# fortran source code. We are just checking to see if we get the right tendencies
num_lev = 20
# INPUT DATA
T = np.flipud([278.0, 273.9, 269.8, 265.7, 261.6, 257.5, 253.4, 249.3, 245.2,
241.1, 236.9, 232.8, 228.7, 224.6, 220.5, 216.4, 212.3, 214.0, 240., 270.])
Q = np.flipud([3.768E-03, 2.812E-03, 2.078E-03, 1.519E-03, 1.099E-03,
7.851E-04, 5.542E-04, 3.860E-04, 2.652E-04, 1.794E-04,
1.183E-04, 7.739E-05, 4.970E-05, 3.127E-05, 1.923E-05,
1.152E-05, 6.675E-06, 5.000E-06, 5.000E-06, 5.000E-06])
U = np.flipud([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0,
12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0])
V = 5. * np.ones_like(U)
DELT = 60.0*10.
# TENDENCIES FROM FORTRAN CODE
FT = np.flipud([-1.79016788E-05, -5.30500938E-06, -1.31774368E-05,
-1.52709208E-06, 2.39793881E-05, 5.00326714E-05, 5.81094064E-05,
3.53246978E-05, 2.92667046E-05, 1.72944201E-05, -1.29259779E-05,
-1.95585071E-05, 0.00000000, 0.00000000, 0.00000000, 0.00000000,
0.00000000, 0.00000000, 0.00000000, 0.00000000])
FQ = np.flipud([-1.25266510E-07, -1.77205965E-08, 2.25621442E-08,
1.20601991E-08, -2.24871144E-09, -8.65546035E-09, 1.32086608E-08,
3.48950842E-08, 4.61437244E-09, 3.59271168E-09, 3.54269192E-09,
1.12591925E-09, 0.00000000, 0.00000000, 0.00000000,
0.00000000, 0.00000000, 0.00000000 , 0.00000000, 0.00000000])
FU = np.flipud([6.96138741E-05, 2.54272982E-05, -4.23727352E-06,
-2.25807025E-06, 5.97735743E-06, 1.29817499E-05, -7.07237768E-06,
-5.06039614E-05, -8.67366180E-06, -1.08617351E-05, -1.97424633E-05,
-1.05507343E-05, 0.00000000, 0.00000000, 0.00000000,
0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000])
FV = np.zeros_like(FU)
# Set thermodynamic constants to their defaults from Emanuel's code
# so that we get same tendencies
emanuel_convection.CPD=1005.7
emanuel_convection.CPV=1870.0
emanuel_convection.RV=461.5
emanuel_convection.RD=287.04
emanuel_convection.LV0=2.501E6
emanuel_convection.G=9.8
emanuel_convection.ROWL=1000.0
@pytest.mark.compiled
@pytest.mark.fast
def test_convect_tendencies():
# Temperatures in a single column
state = climlab.column_state(num_lev=num_lev)
state.Tatm[:] = T
state['q'] = state.Tatm * 0. + Q
state['U'] = state.Tatm * 0. + U
state['V'] = state.Tatm * 0. + V
assert hasattr(state, 'Tatm')
assert hasattr(state, 'q')
assert hasattr(state, 'U')
assert hasattr(state, 'V')
conv = emanuel_convection.EmanuelConvection(state=state, timestep=DELT)
conv.step_forward()
# Did we get all the correct output?
assert conv.IFLAG == 1
# relative tolerance for these tests ...
tol = 1E-5
assert conv.CBMF == pytest.approx(3.10377218E-02, rel=tol)
tend = conv.tendencies
assert FT == pytest.approx(tend['Tatm'], rel=tol)
assert FQ == pytest.approx(tend['q'], rel=tol)
assert FU == pytest.approx(tend['U'], rel=tol)
assert FV == pytest.approx(tend['V'], rel=tol)
@pytest.mark.compiled
@pytest.mark.fast
def test_multidim_tendencies():
# Same test just repeated in two parallel columns
num_lat = 2
state = climlab.column_state(num_lev=num_lev, num_lat=num_lat)
state['q'] = state.Tatm * 0. #+ Q
state['U'] = state.Tatm * 0. #+ U
state['V'] = state.Tatm * 0. #+ V
for i in range(num_lat):
state.Tatm[i,:] = T
state['q'][i,:] += Q
state['U'][i,:] += U
state['V'][i,:] += V
assert hasattr(state, 'Tatm')
assert hasattr(state, 'q')
assert hasattr(state, 'U')
assert hasattr(state, 'V')
conv = emanuel_convection.EmanuelConvection(state=state, timestep=DELT)
conv.step_forward()
# Did we get all the correct output?
assert np.all(conv.IFLAG == 1)
# relative tolerance for these tests ...
tol = 1E-5
assert np.all(conv.CBMF == pytest.approx(3.10377218E-02, rel=tol))
tend = conv.tendencies
assert np.tile(FT,(num_lat,1)) == pytest.approx(tend['Tatm'], rel=tol)
assert np.tile(FQ,(num_lat,1)) == pytest.approx(tend['q'], rel=tol)
assert np.tile(FU,(num_lat,1)) == pytest.approx(tend['U'], rel=tol)
assert np.tile(FV,(num_lat,1)) == pytest.approx(tend['V'], rel=tol)
@pytest.mark.compiled
@pytest.mark.fast
def test_rcm_emanuel():
num_lev = 30
water_depth = 5.
# Temperatures in a single column
state = climlab.column_state(num_lev=num_lev, water_depth=water_depth)
# Initialize a nearly dry column (small background stratospheric humidity)
state['q'] = np.ones_like(state.Tatm) * 5.E-6
# ASYNCHRONOUS COUPLING -- the radiation uses a much longer timestep
short_timestep = climlab.constants.seconds_per_hour
# The top-level model
model = climlab.TimeDependentProcess(name='Radiative-Convective Model',
state=state,
timestep=short_timestep)
# Radiation coupled to water vapor
rad = climlab.radiation.RRTMG(name='Radiation',
state=state,
specific_humidity=state.q,
albedo=0.3,
timestep=24*short_timestep)
# Convection scheme -- water vapor is a state variable
conv = climlab.convection.EmanuelConvection(name='Convection',
state=state,
timestep=short_timestep)
# Surface heat flux processes
shf = climlab.surface.SensibleHeatFlux(name='SHF',
state=state, Cd=0.5E-3,
timestep=climlab.constants.seconds_per_hour)
lhf = climlab.surface.LatentHeatFlux(name='LHF',
state=state, Cd=0.5E-3,
timestep=short_timestep)
# Couple all the submodels together
for proc in [rad, conv, shf, lhf]:
model.add_subprocess(proc.name, proc)
model.step_forward()
to_xarray(model)
| mit | 1,299,065,267,706,858,000 | 42.691781 | 86 | 0.614046 | false |
nhr/openshift-ansible | roles/lib_openshift/library/oc_process.py | 1 | 55775 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) | | .` | (_) || | | _|| |) | | | |
# |___/ \___/ |_|\_|\___/ |_| |___|___/___| |_|
#
# Copyright 2016 Red Hat, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# -*- -*- -*- Begin included fragment: lib/import.py -*- -*- -*-
'''
OpenShiftCLI class that wraps the oc commands in a subprocess
'''
# pylint: disable=too-many-lines
from __future__ import print_function
import atexit
import copy
import json
import os
import re
import shutil
import subprocess
import tempfile
# pylint: disable=import-error
try:
import ruamel.yaml as yaml
except ImportError:
import yaml
from ansible.module_utils.basic import AnsibleModule
# -*- -*- -*- End included fragment: lib/import.py -*- -*- -*-
# -*- -*- -*- Begin included fragment: doc/process -*- -*- -*-
DOCUMENTATION = '''
---
module: oc_process
short_description: Module to process openshift templates
description:
- Process openshift templates programmatically.
options:
state:
description:
- State has a few different meanings when it comes to process.
- state: present - This state runs an `oc process <template>`. When used in
- conjunction with 'create: True' the process will be piped to | oc create -f
- state: absent - will remove a template
- state: list - will perform an `oc get template <template_name>`
default: present
choices: ["present", "absent", "list"]
aliases: []
kubeconfig:
description:
- The path for the kubeconfig file to use for authentication
required: false
default: /etc/origin/master/admin.kubeconfig
aliases: []
debug:
description:
- Turn on debug output.
required: false
default: False
aliases: []
template_name:
description:
- Name of the openshift template that is being processed.
required: false
default: None
aliases: []
namespace:
description:
- The namespace where the template lives.
required: false
default: default
aliases: []
content:
description:
- Template content that will be processed.
required: false
default: None
aliases: []
params:
description:
- A list of parameters that will be inserted into the template.
required: false
default: None
aliases: []
create:
description:
- Whether or not to create the template after being processed. e.g. oc process | oc create -f -
required: False
default: False
aliases: []
reconcile:
description:
- Whether or not to attempt to determine if there are updates or changes in the incoming template.
default: true
aliases: []
author:
- "Kenny Woodson <[email protected]>"
extends_documentation_fragment: []
'''
EXAMPLES = '''
- name: process the cloud volume provisioner template with variables
oc_process:
namespace: openshift-infra
template_name: online-volume-provisioner
create: True
params:
PLAT: rhel7
register: processout
run_once: true
- debug: var=processout
'''
# -*- -*- -*- End included fragment: doc/process -*- -*- -*-
# -*- -*- -*- Begin included fragment: ../../lib_utils/src/class/yedit.py -*- -*- -*-
class YeditException(Exception): # pragma: no cover
''' Exception class for Yedit '''
pass
# pylint: disable=too-many-public-methods
class Yedit(object): # pragma: no cover
''' Class to modify yaml files '''
re_valid_key = r"(((\[-?\d+\])|([0-9a-zA-Z%s/_-]+)).?)+$"
re_key = r"(?:\[(-?\d+)\])|([0-9a-zA-Z%s/_-]+)"
com_sep = set(['.', '#', '|', ':'])
# pylint: disable=too-many-arguments
def __init__(self,
filename=None,
content=None,
content_type='yaml',
separator='.',
backup=False):
self.content = content
self._separator = separator
self.filename = filename
self.__yaml_dict = content
self.content_type = content_type
self.backup = backup
self.load(content_type=self.content_type)
if self.__yaml_dict is None:
self.__yaml_dict = {}
@property
def separator(self):
''' getter method for separator '''
return self._separator
@separator.setter
def separator(self, inc_sep):
''' setter method for separator '''
self._separator = inc_sep
@property
def yaml_dict(self):
''' getter method for yaml_dict '''
return self.__yaml_dict
@yaml_dict.setter
def yaml_dict(self, value):
''' setter method for yaml_dict '''
self.__yaml_dict = value
@staticmethod
def parse_key(key, sep='.'):
'''parse the key allowing the appropriate separator'''
common_separators = list(Yedit.com_sep - set([sep]))
return re.findall(Yedit.re_key.format(''.join(common_separators)), key)
@staticmethod
def valid_key(key, sep='.'):
'''validate the incoming key'''
common_separators = list(Yedit.com_sep - set([sep]))
if not re.match(Yedit.re_valid_key.format(''.join(common_separators)), key):
return False
return True
@staticmethod
def remove_entry(data, key, sep='.'):
''' remove data at location key '''
if key == '' and isinstance(data, dict):
data.clear()
return True
elif key == '' and isinstance(data, list):
del data[:]
return True
if not (key and Yedit.valid_key(key, sep)) and \
isinstance(data, (list, dict)):
return None
key_indexes = Yedit.parse_key(key, sep)
for arr_ind, dict_key in key_indexes[:-1]:
if dict_key and isinstance(data, dict):
data = data.get(dict_key)
elif (arr_ind and isinstance(data, list) and
int(arr_ind) <= len(data) - 1):
data = data[int(arr_ind)]
else:
return None
# process last index for remove
# expected list entry
if key_indexes[-1][0]:
if isinstance(data, list) and int(key_indexes[-1][0]) <= len(data) - 1: # noqa: E501
del data[int(key_indexes[-1][0])]
return True
# expected dict entry
elif key_indexes[-1][1]:
if isinstance(data, dict):
del data[key_indexes[-1][1]]
return True
@staticmethod
def add_entry(data, key, item=None, sep='.'):
''' Get an item from a dictionary with key notation a.b.c
d = {'a': {'b': 'c'}}}
key = a#b
return c
'''
if key == '':
pass
elif (not (key and Yedit.valid_key(key, sep)) and
isinstance(data, (list, dict))):
return None
key_indexes = Yedit.parse_key(key, sep)
for arr_ind, dict_key in key_indexes[:-1]:
if dict_key:
if isinstance(data, dict) and dict_key in data and data[dict_key]: # noqa: E501
data = data[dict_key]
continue
elif data and not isinstance(data, dict):
raise YeditException("Unexpected item type found while going through key " +
"path: {} (at key: {})".format(key, dict_key))
data[dict_key] = {}
data = data[dict_key]
elif (arr_ind and isinstance(data, list) and
int(arr_ind) <= len(data) - 1):
data = data[int(arr_ind)]
else:
raise YeditException("Unexpected item type found while going through key path: {}".format(key))
if key == '':
data = item
# process last index for add
# expected list entry
elif key_indexes[-1][0] and isinstance(data, list) and int(key_indexes[-1][0]) <= len(data) - 1: # noqa: E501
data[int(key_indexes[-1][0])] = item
# expected dict entry
elif key_indexes[-1][1] and isinstance(data, dict):
data[key_indexes[-1][1]] = item
# didn't add/update to an existing list, nor add/update key to a dict
# so we must have been provided some syntax like a.b.c[<int>] = "data" for a
# non-existent array
else:
raise YeditException("Error adding to object at path: {}".format(key))
return data
@staticmethod
def get_entry(data, key, sep='.'):
''' Get an item from a dictionary with key notation a.b.c
d = {'a': {'b': 'c'}}}
key = a.b
return c
'''
if key == '':
pass
elif (not (key and Yedit.valid_key(key, sep)) and
isinstance(data, (list, dict))):
return None
key_indexes = Yedit.parse_key(key, sep)
for arr_ind, dict_key in key_indexes:
if dict_key and isinstance(data, dict):
data = data.get(dict_key)
elif (arr_ind and isinstance(data, list) and
int(arr_ind) <= len(data) - 1):
data = data[int(arr_ind)]
else:
return None
return data
@staticmethod
def _write(filename, contents):
''' Actually write the file contents to disk. This helps with mocking. '''
tmp_filename = filename + '.yedit'
with open(tmp_filename, 'w') as yfd:
yfd.write(contents)
os.rename(tmp_filename, filename)
def write(self):
''' write to file '''
if not self.filename:
raise YeditException('Please specify a filename.')
if self.backup and self.file_exists():
shutil.copy(self.filename, self.filename + '.orig')
# Try to set format attributes if supported
try:
self.yaml_dict.fa.set_block_style()
except AttributeError:
pass
# Try to use RoundTripDumper if supported.
try:
Yedit._write(self.filename, yaml.dump(self.yaml_dict, Dumper=yaml.RoundTripDumper))
except AttributeError:
Yedit._write(self.filename, yaml.safe_dump(self.yaml_dict, default_flow_style=False))
return (True, self.yaml_dict)
def read(self):
''' read from file '''
# check if it exists
if self.filename is None or not self.file_exists():
return None
contents = None
with open(self.filename) as yfd:
contents = yfd.read()
return contents
def file_exists(self):
''' return whether file exists '''
if os.path.exists(self.filename):
return True
return False
def load(self, content_type='yaml'):
''' return yaml file '''
contents = self.read()
if not contents and not self.content:
return None
if self.content:
if isinstance(self.content, dict):
self.yaml_dict = self.content
return self.yaml_dict
elif isinstance(self.content, str):
contents = self.content
# check if it is yaml
try:
if content_type == 'yaml' and contents:
# Try to set format attributes if supported
try:
self.yaml_dict.fa.set_block_style()
except AttributeError:
pass
# Try to use RoundTripLoader if supported.
try:
self.yaml_dict = yaml.safe_load(contents, yaml.RoundTripLoader)
except AttributeError:
self.yaml_dict = yaml.safe_load(contents)
# Try to set format attributes if supported
try:
self.yaml_dict.fa.set_block_style()
except AttributeError:
pass
elif content_type == 'json' and contents:
self.yaml_dict = json.loads(contents)
except yaml.YAMLError as err:
# Error loading yaml or json
raise YeditException('Problem with loading yaml file. {}'.format(err))
return self.yaml_dict
def get(self, key):
''' get a specified key'''
try:
entry = Yedit.get_entry(self.yaml_dict, key, self.separator)
except KeyError:
entry = None
return entry
def pop(self, path, key_or_item):
''' remove a key, value pair from a dict or an item for a list'''
try:
entry = Yedit.get_entry(self.yaml_dict, path, self.separator)
except KeyError:
entry = None
if entry is None:
return (False, self.yaml_dict)
if isinstance(entry, dict):
# AUDIT:maybe-no-member makes sense due to fuzzy types
# pylint: disable=maybe-no-member
if key_or_item in entry:
entry.pop(key_or_item)
return (True, self.yaml_dict)
return (False, self.yaml_dict)
elif isinstance(entry, list):
# AUDIT:maybe-no-member makes sense due to fuzzy types
# pylint: disable=maybe-no-member
ind = None
try:
ind = entry.index(key_or_item)
except ValueError:
return (False, self.yaml_dict)
entry.pop(ind)
return (True, self.yaml_dict)
return (False, self.yaml_dict)
def delete(self, path):
''' remove path from a dict'''
try:
entry = Yedit.get_entry(self.yaml_dict, path, self.separator)
except KeyError:
entry = None
if entry is None:
return (False, self.yaml_dict)
result = Yedit.remove_entry(self.yaml_dict, path, self.separator)
if not result:
return (False, self.yaml_dict)
return (True, self.yaml_dict)
def exists(self, path, value):
''' check if value exists at path'''
try:
entry = Yedit.get_entry(self.yaml_dict, path, self.separator)
except KeyError:
entry = None
if isinstance(entry, list):
if value in entry:
return True
return False
elif isinstance(entry, dict):
if isinstance(value, dict):
rval = False
for key, val in value.items():
if entry[key] != val:
rval = False
break
else:
rval = True
return rval
return value in entry
return entry == value
def append(self, path, value):
'''append value to a list'''
try:
entry = Yedit.get_entry(self.yaml_dict, path, self.separator)
except KeyError:
entry = None
if entry is None:
self.put(path, [])
entry = Yedit.get_entry(self.yaml_dict, path, self.separator)
if not isinstance(entry, list):
return (False, self.yaml_dict)
# AUDIT:maybe-no-member makes sense due to loading data from
# a serialized format.
# pylint: disable=maybe-no-member
entry.append(value)
return (True, self.yaml_dict)
# pylint: disable=too-many-arguments
def update(self, path, value, index=None, curr_value=None):
''' put path, value into a dict '''
try:
entry = Yedit.get_entry(self.yaml_dict, path, self.separator)
except KeyError:
entry = None
if isinstance(entry, dict):
# AUDIT:maybe-no-member makes sense due to fuzzy types
# pylint: disable=maybe-no-member
if not isinstance(value, dict):
raise YeditException('Cannot replace key, value entry in dict with non-dict type. ' +
'value=[{}] type=[{}]'.format(value, type(value)))
entry.update(value)
return (True, self.yaml_dict)
elif isinstance(entry, list):
# AUDIT:maybe-no-member makes sense due to fuzzy types
# pylint: disable=maybe-no-member
ind = None
if curr_value:
try:
ind = entry.index(curr_value)
except ValueError:
return (False, self.yaml_dict)
elif index is not None:
ind = index
if ind is not None and entry[ind] != value:
entry[ind] = value
return (True, self.yaml_dict)
# see if it exists in the list
try:
ind = entry.index(value)
except ValueError:
# doesn't exist, append it
entry.append(value)
return (True, self.yaml_dict)
# already exists, return
if ind is not None:
return (False, self.yaml_dict)
return (False, self.yaml_dict)
def put(self, path, value):
''' put path, value into a dict '''
try:
entry = Yedit.get_entry(self.yaml_dict, path, self.separator)
except KeyError:
entry = None
if entry == value:
return (False, self.yaml_dict)
# deepcopy didn't work
# Try to use ruamel.yaml and fallback to pyyaml
try:
tmp_copy = yaml.load(yaml.round_trip_dump(self.yaml_dict,
default_flow_style=False),
yaml.RoundTripLoader)
except AttributeError:
tmp_copy = copy.deepcopy(self.yaml_dict)
# set the format attributes if available
try:
tmp_copy.fa.set_block_style()
except AttributeError:
pass
result = Yedit.add_entry(tmp_copy, path, value, self.separator)
if result is None:
return (False, self.yaml_dict)
# When path equals "" it is a special case.
# "" refers to the root of the document
# Only update the root path (entire document) when its a list or dict
if path == '':
if isinstance(result, list) or isinstance(result, dict):
self.yaml_dict = result
return (True, self.yaml_dict)
return (False, self.yaml_dict)
self.yaml_dict = tmp_copy
return (True, self.yaml_dict)
def create(self, path, value):
''' create a yaml file '''
if not self.file_exists():
# deepcopy didn't work
# Try to use ruamel.yaml and fallback to pyyaml
try:
tmp_copy = yaml.load(yaml.round_trip_dump(self.yaml_dict,
default_flow_style=False),
yaml.RoundTripLoader)
except AttributeError:
tmp_copy = copy.deepcopy(self.yaml_dict)
# set the format attributes if available
try:
tmp_copy.fa.set_block_style()
except AttributeError:
pass
result = Yedit.add_entry(tmp_copy, path, value, self.separator)
if result is not None:
self.yaml_dict = tmp_copy
return (True, self.yaml_dict)
return (False, self.yaml_dict)
@staticmethod
def get_curr_value(invalue, val_type):
'''return the current value'''
if invalue is None:
return None
curr_value = invalue
if val_type == 'yaml':
curr_value = yaml.load(invalue)
elif val_type == 'json':
curr_value = json.loads(invalue)
return curr_value
@staticmethod
def parse_value(inc_value, vtype=''):
'''determine value type passed'''
true_bools = ['y', 'Y', 'yes', 'Yes', 'YES', 'true', 'True', 'TRUE',
'on', 'On', 'ON', ]
false_bools = ['n', 'N', 'no', 'No', 'NO', 'false', 'False', 'FALSE',
'off', 'Off', 'OFF']
# It came in as a string but you didn't specify value_type as string
# we will convert to bool if it matches any of the above cases
if isinstance(inc_value, str) and 'bool' in vtype:
if inc_value not in true_bools and inc_value not in false_bools:
raise YeditException('Not a boolean type. str=[{}] vtype=[{}]'.format(inc_value, vtype))
elif isinstance(inc_value, bool) and 'str' in vtype:
inc_value = str(inc_value)
# There is a special case where '' will turn into None after yaml loading it so skip
if isinstance(inc_value, str) and inc_value == '':
pass
# If vtype is not str then go ahead and attempt to yaml load it.
elif isinstance(inc_value, str) and 'str' not in vtype:
try:
inc_value = yaml.safe_load(inc_value)
except Exception:
raise YeditException('Could not determine type of incoming value. ' +
'value=[{}] vtype=[{}]'.format(type(inc_value), vtype))
return inc_value
@staticmethod
def process_edits(edits, yamlfile):
'''run through a list of edits and process them one-by-one'''
results = []
for edit in edits:
value = Yedit.parse_value(edit['value'], edit.get('value_type', ''))
if edit.get('action') == 'update':
# pylint: disable=line-too-long
curr_value = Yedit.get_curr_value(
Yedit.parse_value(edit.get('curr_value')),
edit.get('curr_value_format'))
rval = yamlfile.update(edit['key'],
value,
edit.get('index'),
curr_value)
elif edit.get('action') == 'append':
rval = yamlfile.append(edit['key'], value)
else:
rval = yamlfile.put(edit['key'], value)
if rval[0]:
results.append({'key': edit['key'], 'edit': rval[1]})
return {'changed': len(results) > 0, 'results': results}
# pylint: disable=too-many-return-statements,too-many-branches
@staticmethod
def run_ansible(params):
'''perform the idempotent crud operations'''
yamlfile = Yedit(filename=params['src'],
backup=params['backup'],
separator=params['separator'])
state = params['state']
if params['src']:
rval = yamlfile.load()
if yamlfile.yaml_dict is None and state != 'present':
return {'failed': True,
'msg': 'Error opening file [{}]. Verify that the '.format(params['src']) +
'file exists, that it is has correct permissions, and is valid yaml.'}
if state == 'list':
if params['content']:
content = Yedit.parse_value(params['content'], params['content_type'])
yamlfile.yaml_dict = content
if params['key']:
rval = yamlfile.get(params['key']) or {}
return {'changed': False, 'result': rval, 'state': state}
elif state == 'absent':
if params['content']:
content = Yedit.parse_value(params['content'], params['content_type'])
yamlfile.yaml_dict = content
if params['update']:
rval = yamlfile.pop(params['key'], params['value'])
else:
rval = yamlfile.delete(params['key'])
if rval[0] and params['src']:
yamlfile.write()
return {'changed': rval[0], 'result': rval[1], 'state': state}
elif state == 'present':
# check if content is different than what is in the file
if params['content']:
content = Yedit.parse_value(params['content'], params['content_type'])
# We had no edits to make and the contents are the same
if yamlfile.yaml_dict == content and \
params['value'] is None:
return {'changed': False, 'result': yamlfile.yaml_dict, 'state': state}
yamlfile.yaml_dict = content
# If we were passed a key, value then
# we enapsulate it in a list and process it
# Key, Value passed to the module : Converted to Edits list #
edits = []
_edit = {}
if params['value'] is not None:
_edit['value'] = params['value']
_edit['value_type'] = params['value_type']
_edit['key'] = params['key']
if params['update']:
_edit['action'] = 'update'
_edit['curr_value'] = params['curr_value']
_edit['curr_value_format'] = params['curr_value_format']
_edit['index'] = params['index']
elif params['append']:
_edit['action'] = 'append'
edits.append(_edit)
elif params['edits'] is not None:
edits = params['edits']
if edits:
results = Yedit.process_edits(edits, yamlfile)
# if there were changes and a src provided to us we need to write
if results['changed'] and params['src']:
yamlfile.write()
return {'changed': results['changed'], 'result': results['results'], 'state': state}
# no edits to make
if params['src']:
# pylint: disable=redefined-variable-type
rval = yamlfile.write()
return {'changed': rval[0],
'result': rval[1],
'state': state}
# We were passed content but no src, key or value, or edits. Return contents in memory
return {'changed': False, 'result': yamlfile.yaml_dict, 'state': state}
return {'failed': True, 'msg': 'Unkown state passed'}
# -*- -*- -*- End included fragment: ../../lib_utils/src/class/yedit.py -*- -*- -*-
# -*- -*- -*- Begin included fragment: lib/base.py -*- -*- -*-
# pylint: disable=too-many-lines
# noqa: E301,E302,E303,T001
class OpenShiftCLIError(Exception):
'''Exception class for openshiftcli'''
pass
ADDITIONAL_PATH_LOOKUPS = ['/usr/local/bin', os.path.expanduser('~/bin')]
def locate_oc_binary():
''' Find and return oc binary file '''
# https://github.com/openshift/openshift-ansible/issues/3410
# oc can be in /usr/local/bin in some cases, but that may not
# be in $PATH due to ansible/sudo
paths = os.environ.get("PATH", os.defpath).split(os.pathsep) + ADDITIONAL_PATH_LOOKUPS
oc_binary = 'oc'
# Use shutil.which if it is available, otherwise fallback to a naive path search
try:
which_result = shutil.which(oc_binary, path=os.pathsep.join(paths))
if which_result is not None:
oc_binary = which_result
except AttributeError:
for path in paths:
if os.path.exists(os.path.join(path, oc_binary)):
oc_binary = os.path.join(path, oc_binary)
break
return oc_binary
# pylint: disable=too-few-public-methods
class OpenShiftCLI(object):
''' Class to wrap the command line tools '''
def __init__(self,
namespace,
kubeconfig='/etc/origin/master/admin.kubeconfig',
verbose=False,
all_namespaces=False):
''' Constructor for OpenshiftCLI '''
self.namespace = namespace
self.verbose = verbose
self.kubeconfig = Utils.create_tmpfile_copy(kubeconfig)
self.all_namespaces = all_namespaces
self.oc_binary = locate_oc_binary()
# Pylint allows only 5 arguments to be passed.
# pylint: disable=too-many-arguments
def _replace_content(self, resource, rname, content, force=False, sep='.'):
''' replace the current object with the content '''
res = self._get(resource, rname)
if not res['results']:
return res
fname = Utils.create_tmpfile(rname + '-')
yed = Yedit(fname, res['results'][0], separator=sep)
changes = []
for key, value in content.items():
changes.append(yed.put(key, value))
if any([change[0] for change in changes]):
yed.write()
atexit.register(Utils.cleanup, [fname])
return self._replace(fname, force)
return {'returncode': 0, 'updated': False}
def _replace(self, fname, force=False):
'''replace the current object with oc replace'''
cmd = ['replace', '-f', fname]
if force:
cmd.append('--force')
return self.openshift_cmd(cmd)
def _create_from_content(self, rname, content):
'''create a temporary file and then call oc create on it'''
fname = Utils.create_tmpfile(rname + '-')
yed = Yedit(fname, content=content)
yed.write()
atexit.register(Utils.cleanup, [fname])
return self._create(fname)
def _create(self, fname):
'''call oc create on a filename'''
return self.openshift_cmd(['create', '-f', fname])
def _delete(self, resource, name=None, selector=None):
'''call oc delete on a resource'''
cmd = ['delete', resource]
if selector is not None:
cmd.append('--selector={}'.format(selector))
elif name is not None:
cmd.append(name)
else:
raise OpenShiftCLIError('Either name or selector is required when calling delete.')
return self.openshift_cmd(cmd)
def _process(self, template_name, create=False, params=None, template_data=None): # noqa: E501
'''process a template
template_name: the name of the template to process
create: whether to send to oc create after processing
params: the parameters for the template
template_data: the incoming template's data; instead of a file
'''
cmd = ['process']
if template_data:
cmd.extend(['-f', '-'])
else:
cmd.append(template_name)
if params:
param_str = ["{}={}".format(key, value) for key, value in params.items()]
cmd.append('-v')
cmd.extend(param_str)
results = self.openshift_cmd(cmd, output=True, input_data=template_data)
if results['returncode'] != 0 or not create:
return results
fname = Utils.create_tmpfile(template_name + '-')
yed = Yedit(fname, results['results'])
yed.write()
atexit.register(Utils.cleanup, [fname])
return self.openshift_cmd(['create', '-f', fname])
def _get(self, resource, name=None, selector=None):
'''return a resource by name '''
cmd = ['get', resource]
if selector is not None:
cmd.append('--selector={}'.format(selector))
elif name is not None:
cmd.append(name)
cmd.extend(['-o', 'json'])
rval = self.openshift_cmd(cmd, output=True)
# Ensure results are retuned in an array
if 'items' in rval:
rval['results'] = rval['items']
elif not isinstance(rval['results'], list):
rval['results'] = [rval['results']]
return rval
def _schedulable(self, node=None, selector=None, schedulable=True):
''' perform oadm manage-node scheduable '''
cmd = ['manage-node']
if node:
cmd.extend(node)
else:
cmd.append('--selector={}'.format(selector))
cmd.append('--schedulable={}'.format(schedulable))
return self.openshift_cmd(cmd, oadm=True, output=True, output_type='raw') # noqa: E501
def _list_pods(self, node=None, selector=None, pod_selector=None):
''' perform oadm list pods
node: the node in which to list pods
selector: the label selector filter if provided
pod_selector: the pod selector filter if provided
'''
cmd = ['manage-node']
if node:
cmd.extend(node)
else:
cmd.append('--selector={}'.format(selector))
if pod_selector:
cmd.append('--pod-selector={}'.format(pod_selector))
cmd.extend(['--list-pods', '-o', 'json'])
return self.openshift_cmd(cmd, oadm=True, output=True, output_type='raw')
# pylint: disable=too-many-arguments
def _evacuate(self, node=None, selector=None, pod_selector=None, dry_run=False, grace_period=None, force=False):
''' perform oadm manage-node evacuate '''
cmd = ['manage-node']
if node:
cmd.extend(node)
else:
cmd.append('--selector={}'.format(selector))
if dry_run:
cmd.append('--dry-run')
if pod_selector:
cmd.append('--pod-selector={}'.format(pod_selector))
if grace_period:
cmd.append('--grace-period={}'.format(int(grace_period)))
if force:
cmd.append('--force')
cmd.append('--evacuate')
return self.openshift_cmd(cmd, oadm=True, output=True, output_type='raw')
def _version(self):
''' return the openshift version'''
return self.openshift_cmd(['version'], output=True, output_type='raw')
def _import_image(self, url=None, name=None, tag=None):
''' perform image import '''
cmd = ['import-image']
image = '{0}'.format(name)
if tag:
image += ':{0}'.format(tag)
cmd.append(image)
if url:
cmd.append('--from={0}/{1}'.format(url, image))
cmd.append('-n{0}'.format(self.namespace))
cmd.append('--confirm')
return self.openshift_cmd(cmd)
def _run(self, cmds, input_data):
''' Actually executes the command. This makes mocking easier. '''
curr_env = os.environ.copy()
curr_env.update({'KUBECONFIG': self.kubeconfig})
proc = subprocess.Popen(cmds,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=curr_env)
stdout, stderr = proc.communicate(input_data)
return proc.returncode, stdout.decode(), stderr.decode()
# pylint: disable=too-many-arguments,too-many-branches
def openshift_cmd(self, cmd, oadm=False, output=False, output_type='json', input_data=None):
'''Base command for oc '''
cmds = [self.oc_binary]
if oadm:
cmds.append('adm')
cmds.extend(cmd)
if self.all_namespaces:
cmds.extend(['--all-namespaces'])
elif self.namespace is not None and self.namespace.lower() not in ['none', 'emtpy']: # E501
cmds.extend(['-n', self.namespace])
rval = {}
results = ''
err = None
if self.verbose:
print(' '.join(cmds))
try:
returncode, stdout, stderr = self._run(cmds, input_data)
except OSError as ex:
returncode, stdout, stderr = 1, '', 'Failed to execute {}: {}'.format(subprocess.list2cmdline(cmds), ex)
rval = {"returncode": returncode,
"results": results,
"cmd": ' '.join(cmds)}
if returncode == 0:
if output:
if output_type == 'json':
try:
rval['results'] = json.loads(stdout)
except ValueError as verr:
if "No JSON object could be decoded" in verr.args:
err = verr.args
elif output_type == 'raw':
rval['results'] = stdout
if self.verbose:
print("STDOUT: {0}".format(stdout))
print("STDERR: {0}".format(stderr))
if err:
rval.update({"err": err,
"stderr": stderr,
"stdout": stdout,
"cmd": cmds})
else:
rval.update({"stderr": stderr,
"stdout": stdout,
"results": {}})
return rval
class Utils(object): # pragma: no cover
''' utilities for openshiftcli modules '''
@staticmethod
def _write(filename, contents):
''' Actually write the file contents to disk. This helps with mocking. '''
with open(filename, 'w') as sfd:
sfd.write(contents)
@staticmethod
def create_tmp_file_from_contents(rname, data, ftype='yaml'):
''' create a file in tmp with name and contents'''
tmp = Utils.create_tmpfile(prefix=rname)
if ftype == 'yaml':
# AUDIT:no-member makes sense here due to ruamel.YAML/PyYAML usage
# pylint: disable=no-member
if hasattr(yaml, 'RoundTripDumper'):
Utils._write(tmp, yaml.dump(data, Dumper=yaml.RoundTripDumper))
else:
Utils._write(tmp, yaml.safe_dump(data, default_flow_style=False))
elif ftype == 'json':
Utils._write(tmp, json.dumps(data))
else:
Utils._write(tmp, data)
# Register cleanup when module is done
atexit.register(Utils.cleanup, [tmp])
return tmp
@staticmethod
def create_tmpfile_copy(inc_file):
'''create a temporary copy of a file'''
tmpfile = Utils.create_tmpfile('lib_openshift-')
Utils._write(tmpfile, open(inc_file).read())
# Cleanup the tmpfile
atexit.register(Utils.cleanup, [tmpfile])
return tmpfile
@staticmethod
def create_tmpfile(prefix='tmp'):
''' Generates and returns a temporary file name '''
with tempfile.NamedTemporaryFile(prefix=prefix, delete=False) as tmp:
return tmp.name
@staticmethod
def create_tmp_files_from_contents(content, content_type=None):
'''Turn an array of dict: filename, content into a files array'''
if not isinstance(content, list):
content = [content]
files = []
for item in content:
path = Utils.create_tmp_file_from_contents(item['path'] + '-',
item['data'],
ftype=content_type)
files.append({'name': os.path.basename(item['path']),
'path': path})
return files
@staticmethod
def cleanup(files):
'''Clean up on exit '''
for sfile in files:
if os.path.exists(sfile):
if os.path.isdir(sfile):
shutil.rmtree(sfile)
elif os.path.isfile(sfile):
os.remove(sfile)
@staticmethod
def exists(results, _name):
''' Check to see if the results include the name '''
if not results:
return False
if Utils.find_result(results, _name):
return True
return False
@staticmethod
def find_result(results, _name):
''' Find the specified result by name'''
rval = None
for result in results:
if 'metadata' in result and result['metadata']['name'] == _name:
rval = result
break
return rval
@staticmethod
def get_resource_file(sfile, sfile_type='yaml'):
''' return the service file '''
contents = None
with open(sfile) as sfd:
contents = sfd.read()
if sfile_type == 'yaml':
# AUDIT:no-member makes sense here due to ruamel.YAML/PyYAML usage
# pylint: disable=no-member
if hasattr(yaml, 'RoundTripLoader'):
contents = yaml.load(contents, yaml.RoundTripLoader)
else:
contents = yaml.safe_load(contents)
elif sfile_type == 'json':
contents = json.loads(contents)
return contents
@staticmethod
def filter_versions(stdout):
''' filter the oc version output '''
version_dict = {}
version_search = ['oc', 'openshift', 'kubernetes']
for line in stdout.strip().split('\n'):
for term in version_search:
if not line:
continue
if line.startswith(term):
version_dict[term] = line.split()[-1]
# horrible hack to get openshift version in Openshift 3.2
# By default "oc version in 3.2 does not return an "openshift" version
if "openshift" not in version_dict:
version_dict["openshift"] = version_dict["oc"]
return version_dict
@staticmethod
def add_custom_versions(versions):
''' create custom versions strings '''
versions_dict = {}
for tech, version in versions.items():
# clean up "-" from version
if "-" in version:
version = version.split("-")[0]
if version.startswith('v'):
versions_dict[tech + '_numeric'] = version[1:].split('+')[0]
# "v3.3.0.33" is what we have, we want "3.3"
versions_dict[tech + '_short'] = version[1:4]
return versions_dict
@staticmethod
def openshift_installed():
''' check if openshift is installed '''
import yum
yum_base = yum.YumBase()
if yum_base.rpmdb.searchNevra(name='atomic-openshift'):
return True
return False
# Disabling too-many-branches. This is a yaml dictionary comparison function
# pylint: disable=too-many-branches,too-many-return-statements,too-many-statements
@staticmethod
def check_def_equal(user_def, result_def, skip_keys=None, debug=False):
''' Given a user defined definition, compare it with the results given back by our query. '''
# Currently these values are autogenerated and we do not need to check them
skip = ['metadata', 'status']
if skip_keys:
skip.extend(skip_keys)
for key, value in result_def.items():
if key in skip:
continue
# Both are lists
if isinstance(value, list):
if key not in user_def:
if debug:
print('User data does not have key [%s]' % key)
print('User data: %s' % user_def)
return False
if not isinstance(user_def[key], list):
if debug:
print('user_def[key] is not a list key=[%s] user_def[key]=%s' % (key, user_def[key]))
return False
if len(user_def[key]) != len(value):
if debug:
print("List lengths are not equal.")
print("key=[%s]: user_def[%s] != value[%s]" % (key, len(user_def[key]), len(value)))
print("user_def: %s" % user_def[key])
print("value: %s" % value)
return False
for values in zip(user_def[key], value):
if isinstance(values[0], dict) and isinstance(values[1], dict):
if debug:
print('sending list - list')
print(type(values[0]))
print(type(values[1]))
result = Utils.check_def_equal(values[0], values[1], skip_keys=skip_keys, debug=debug)
if not result:
print('list compare returned false')
return False
elif value != user_def[key]:
if debug:
print('value should be identical')
print(user_def[key])
print(value)
return False
# recurse on a dictionary
elif isinstance(value, dict):
if key not in user_def:
if debug:
print("user_def does not have key [%s]" % key)
return False
if not isinstance(user_def[key], dict):
if debug:
print("dict returned false: not instance of dict")
return False
# before passing ensure keys match
api_values = set(value.keys()) - set(skip)
user_values = set(user_def[key].keys()) - set(skip)
if api_values != user_values:
if debug:
print("keys are not equal in dict")
print(user_values)
print(api_values)
return False
result = Utils.check_def_equal(user_def[key], value, skip_keys=skip_keys, debug=debug)
if not result:
if debug:
print("dict returned false")
print(result)
return False
# Verify each key, value pair is the same
else:
if key not in user_def or value != user_def[key]:
if debug:
print("value not equal; user_def does not have key")
print(key)
print(value)
if key in user_def:
print(user_def[key])
return False
if debug:
print('returning true')
return True
class OpenShiftCLIConfig(object):
'''Generic Config'''
def __init__(self, rname, namespace, kubeconfig, options):
self.kubeconfig = kubeconfig
self.name = rname
self.namespace = namespace
self._options = options
@property
def config_options(self):
''' return config options '''
return self._options
def to_option_list(self):
'''return all options as a string'''
return self.stringify()
def stringify(self):
''' return the options hash as cli params in a string '''
rval = []
for key in sorted(self.config_options.keys()):
data = self.config_options[key]
if data['include'] \
and (data['value'] or isinstance(data['value'], int)):
rval.append('--{}={}'.format(key.replace('_', '-'), data['value']))
return rval
# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*-
# -*- -*- -*- Begin included fragment: class/oc_process.py -*- -*- -*-
# pylint: disable=too-many-instance-attributes
class OCProcess(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
# pylint allows 5. we need 6
# pylint: disable=too-many-arguments
def __init__(self,
namespace,
tname=None,
params=None,
create=False,
kubeconfig='/etc/origin/master/admin.kubeconfig',
tdata=None,
verbose=False):
''' Constructor for OpenshiftOC '''
super(OCProcess, self).__init__(namespace, kubeconfig=kubeconfig, verbose=verbose)
self.name = tname
self.data = tdata
self.params = params
self.create = create
self._template = None
@property
def template(self):
'''template property'''
if self._template is None:
results = self._process(self.name, False, self.params, self.data)
if results['returncode'] != 0:
raise OpenShiftCLIError('Error processing template [%s].' % self.name)
self._template = results['results']['items']
return self._template
def get(self):
'''get the template'''
results = self._get('template', self.name)
if results['returncode'] != 0:
# Does the template exist??
if 'not found' in results['stderr']:
results['returncode'] = 0
results['exists'] = False
results['results'] = []
return results
def delete(self, obj):
'''delete a resource'''
return self._delete(obj['kind'], obj['metadata']['name'])
def create_obj(self, obj):
'''create a resource'''
return self._create_from_content(obj['metadata']['name'], obj)
def process(self, create=None):
'''process a template'''
do_create = False
if create != None:
do_create = create
else:
do_create = self.create
return self._process(self.name, do_create, self.params, self.data)
def exists(self):
'''return whether the template exists'''
# Always return true if we're being passed template data
if self.data:
return True
t_results = self._get('template', self.name)
if t_results['returncode'] != 0:
# Does the template exist??
if 'not found' in t_results['stderr']:
return False
else:
raise OpenShiftCLIError('Something went wrong. %s' % t_results)
return True
def needs_update(self):
'''attempt to process the template and return it for comparison with oc objects'''
obj_results = []
for obj in self.template:
# build a list of types to skip
skip = []
if obj['kind'] == 'ServiceAccount':
skip.extend(['secrets', 'imagePullSecrets'])
if obj['kind'] == 'BuildConfig':
skip.extend(['lastTriggeredImageID'])
if obj['kind'] == 'ImageStream':
skip.extend(['generation'])
if obj['kind'] == 'DeploymentConfig':
skip.extend(['lastTriggeredImage'])
# fetch the current object
curr_obj_results = self._get(obj['kind'], obj['metadata']['name'])
if curr_obj_results['returncode'] != 0:
# Does the template exist??
if 'not found' in curr_obj_results['stderr']:
obj_results.append((obj, True))
continue
# check the generated object against the existing object
if not Utils.check_def_equal(obj, curr_obj_results['results'][0], skip_keys=skip):
obj_results.append((obj, True))
continue
obj_results.append((obj, False))
return obj_results
# pylint: disable=too-many-return-statements
@staticmethod
def run_ansible(params, check_mode):
'''run the ansible idempotent code'''
ocprocess = OCProcess(params['namespace'],
params['template_name'],
params['params'],
params['create'],
kubeconfig=params['kubeconfig'],
tdata=params['content'],
verbose=params['debug'])
state = params['state']
api_rval = ocprocess.get()
if state == 'list':
if api_rval['returncode'] != 0:
return {"failed": True, "msg" : api_rval}
return {"changed" : False, "results": api_rval, "state": state}
elif state == 'present':
if check_mode and params['create']:
return {"changed": True, 'msg': "CHECK_MODE: Would have processed template."}
if not ocprocess.exists() or not params['reconcile']:
#FIXME: this code will never get run in a way that succeeds when
# module.params['reconcile'] is true. Because oc_process doesn't
# create the actual template, the check of ocprocess.exists()
# is meaningless. Either it's already here and this code
# won't be run, or this code will fail because there is no
# template available for oc process to use. Have we conflated
# the template's existence with the existence of the objects
# it describes?
# Create it here
api_rval = ocprocess.process()
if api_rval['returncode'] != 0:
return {"failed": True, "msg": api_rval}
if params['create']:
return {"changed": True, "results": api_rval, "state": state}
return {"changed": False, "results": api_rval, "state": state}
# verify results
update = False
rval = []
all_results = ocprocess.needs_update()
for obj, status in all_results:
if status:
ocprocess.delete(obj)
results = ocprocess.create_obj(obj)
results['kind'] = obj['kind']
rval.append(results)
update = True
if not update:
return {"changed": update, "results": api_rval, "state": state}
for cmd in rval:
if cmd['returncode'] != 0:
return {"failed": True, "changed": update, "msg": rval, "state": state}
return {"changed": update, "results": rval, "state": state}
# -*- -*- -*- End included fragment: class/oc_process.py -*- -*- -*-
# -*- -*- -*- Begin included fragment: ansible/oc_process.py -*- -*- -*-
def main():
'''
ansible oc module for processing templates
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str', choices=['present', 'list']),
debug=dict(default=False, type='bool'),
namespace=dict(default='default', type='str'),
template_name=dict(default=None, type='str'),
content=dict(default=None, type='str'),
params=dict(default=None, type='dict'),
create=dict(default=False, type='bool'),
reconcile=dict(default=True, type='bool'),
),
supports_check_mode=True,
)
rval = OCProcess.run_ansible(module.params, module.check_mode)
if 'failed' in rval:
module.fail_json(**rval)
module.exit_json(**rval)
if __name__ == '__main__':
main()
# -*- -*- -*- End included fragment: ansible/oc_process.py -*- -*- -*-
| apache-2.0 | -1,190,890,207,806,126,300 | 33.134027 | 118 | 0.530937 | false |
antofik/Wartech | WartechLogic/map/views.py | 1 | 3743 | # coding=utf-8
from django.db import transaction
from django.http import HttpResponse
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db.models import Q
from models import *
from random import randint
from PIL import Image
def JsonResponse(request, data):
mimetype = 'text/plain'
if 'HTTP_ACCEPT_ENCODING' in request.META.keys():
if "application/json" in request.META['HTTP_ACCEPT_ENCODING']:
mimetype = 'application/json'
response = HttpResponse(json.dumps(data), content_type=mimetype)
response["Access-Control-Allow-Credentials"] = "true"
response["Access-Control-Allow-Origin"] = "*"
response["Access-Control-Allow-Methods"] = "POST, GET, OPTIONS"
response["Access-Control-Max-Age"] = "86400"
if request.method == "OPTIONS":
response["Access-Control-Allow-Headers"] = "origin, content-type, x-requested-with, accept, authorization"
return response
def create_roughness(heights):
for i in xrange(len(heights)):
r = randint(0, 20)
if r > 19:
heights[i] += 3
elif r > 18:
heights[i] -= 3
elif r > 16:
heights[i] += 2
elif r > 14:
heights[i] -= 2
elif r > 11:
heights[i] += 1
elif r > 8:
heights[i] -= 1
heights[i] = max(0, min(7, heights[i]))
for x in xrange(1,99):
for y in xrange(1,99):
heights[y*100+x] = (heights[y*100+x] + heights[y*100+x+1] + heights[y*100+x-1] + heights[y*100+x+100] + heights[y*100+x-100])/5
def create_mountains(heights):
def coordinates(width=0):
return randint(width, 99-width), randint(width, 99-width)
for i in xrange(randint(0, 100)):
x, y = coordinates()
def create_ravines(heights):
pass
def generate_map(sx, sy):
"""
sx,sy=0..999
"""
sx, sy = int(sx), int(sy)
im = Image.open("media/images/map.png")
pixels = im.load()
pixel = pixels[sx, sy]
material = Materials.Water
height = 0
if pixel == 75:
material = Materials.Water
height = 0
elif pixel == 2:
material = Materials.Soil
height = 2
elif pixel == 3:
material = Materials.Soil
height = 4
elif pixel == 5:
material = Materials.Soil
height = 6
elif pixel == 6:
material = Materials.Soil
height = 7
m = [material] * 10000
for x in xrange(10):
for y in xrange(10):
point = (sx*10 + x) * 1000000 + (sy*10 + y)
heights = [height] * 10000
if material == Materials.Soil:
create_roughness(heights)
create_mountains(heights)
create_ravines(heights)
elif material == Materials.Rock:
create_roughness(heights)
create_mountains(heights)
elif material == Materials.Sand:
create_roughness(heights)
m = ''.join(m)
heights = ''.join(map(str, heights))
MapTile(point=point, type=4, data=m, heights=heights).save()
def get_map(sx, sy):
"""
x=0..9999, y=0.9999
result contain 100x100 cells
"""
point = sx * 1000000 + sy
try:
m = MapTile.objects.get(Q(point=point), Q(type=4))
except MapTile.DoesNotExist:
generate_map(sx//10, sy//10)
m = MapTile.objects.get(Q(point=point), Q(type=4))
return m
def get(request):
sx = int(request.GET.get('x', 0))
sy = int(request.GET.get('y', 0))
map = get_map(sx, sy)
jsonData = {'map': map.data, 'heights': map.heights}
return JsonResponse(request, jsonData) #3, 2, 75, 5, 6
| mit | 8,021,711,613,826,038,000 | 27.792308 | 139 | 0.576543 | false |
koalalorenzo/python-digitalocean | digitalocean/tests/test_load_balancer.py | 1 | 18560 | import json
import unittest
import responses
import digitalocean
from .BaseTest import BaseTest
class TestLoadBalancer(BaseTest):
def setUp(self):
super(TestLoadBalancer, self).setUp()
self.lb_id = '4de7ac8b-495b-4884-9a69-1050c6793cd6'
self.vpc_uuid = "c33931f2-a26a-4e61-b85c-4e95a2ec431b"
self.lb = digitalocean.LoadBalancer(id=self.lb_id, token=self.token)
@responses.activate
def test_load(self):
data = self.load_from_file('loadbalancer/single.json')
url = self.base_url + 'load_balancers/' + self.lb_id
responses.add(responses.GET,
url,
body=data,
status=200,
content_type='application/json')
self.lb.load()
rules = self.lb.forwarding_rules
self.assert_get_url_equal(responses.calls[0].request.url, url)
self.assertEqual(self.lb.id, self.lb_id)
self.assertEqual(self.lb.region['slug'], 'nyc3')
self.assertEqual(self.lb.size, 'lb-small')
self.assertEqual(self.lb.algorithm, 'round_robin')
self.assertEqual(self.lb.ip, '104.131.186.241')
self.assertEqual(self.lb.name, 'example-lb-01')
self.assertEqual(len(rules), 2)
self.assertEqual(rules[0].entry_protocol, 'http')
self.assertEqual(rules[0].entry_port, 80)
self.assertEqual(rules[0].target_protocol, 'http')
self.assertEqual(rules[0].target_port, 80)
self.assertEqual(rules[0].tls_passthrough, False)
self.assertEqual(self.lb.health_check.protocol, 'http')
self.assertEqual(self.lb.health_check.port, 80)
self.assertEqual(self.lb.sticky_sessions.type, 'none')
self.assertEqual(self.lb.droplet_ids, [3164444, 3164445])
self.assertEqual(self.lb.redirect_http_to_https, False)
self.assertEqual(self.lb.enable_proxy_protocol, False)
self.assertEqual(self.lb.enable_backend_keepalive, False)
self.assertEqual(self.lb.vpc_uuid, self.vpc_uuid)
@responses.activate
def test_create_ids(self):
data = self.load_from_file('loadbalancer/single.json')
url = self.base_url + "load_balancers"
responses.add(responses.POST,
url,
body=data,
status=201,
content_type='application/json')
rule1 = digitalocean.ForwardingRule(entry_port=80,
entry_protocol='http',
target_port=80,
target_protocol='http')
rule2 = digitalocean.ForwardingRule(entry_port=443,
entry_protocol='https',
target_port=443,
target_protocol='https',
tls_passthrough=True)
check = digitalocean.HealthCheck()
sticky = digitalocean.StickySessions(type='none')
lb = digitalocean.LoadBalancer(name='example-lb-01', region='nyc3',
algorithm='round_robin',
size='lb-small',
forwarding_rules=[rule1, rule2],
health_check=check,
sticky_sessions=sticky,
redirect_http_to_https=False,
droplet_ids=[3164444, 3164445],
vpc_uuid=self.vpc_uuid,
token=self.token).create()
resp_rules = lb.forwarding_rules
self.assert_url_query_equal(responses.calls[0].request.url, url)
self.assertEqual(lb.id, self.lb_id)
self.assertEqual(lb.algorithm, 'round_robin')
self.assertEqual(lb.ip, '104.131.186.241')
self.assertEqual(lb.name, 'example-lb-01')
self.assertEqual(lb.size, 'lb-small')
self.assertEqual(len(resp_rules), 2)
self.assertEqual(resp_rules[0].entry_protocol, 'http')
self.assertEqual(resp_rules[0].entry_port, 80)
self.assertEqual(resp_rules[0].target_protocol, 'http')
self.assertEqual(resp_rules[0].target_port, 80)
self.assertEqual(resp_rules[0].tls_passthrough, False)
self.assertEqual(lb.health_check.protocol, 'http')
self.assertEqual(lb.health_check.port, 80)
self.assertEqual(lb.sticky_sessions.type, 'none')
self.assertEqual(lb.droplet_ids, [3164444, 3164445])
self.assertEqual(lb.redirect_http_to_https, False)
self.assertEqual(lb.enable_proxy_protocol, False)
self.assertEqual(lb.enable_backend_keepalive, False)
self.assertEqual(lb.vpc_uuid, self.vpc_uuid)
@responses.activate
def test_create_tag(self):
data = self.load_from_file('loadbalancer/single_tag.json')
url = self.base_url + "load_balancers"
responses.add(responses.POST,
url,
body=data,
status=201,
content_type='application/json')
rule1 = digitalocean.ForwardingRule(entry_port=80,
entry_protocol='http',
target_port=80,
target_protocol='http')
rule2 = digitalocean.ForwardingRule(entry_port=443,
entry_protocol='https',
target_port=443,
target_protocol='https',
tls_passthrough=True)
check = digitalocean.HealthCheck()
sticky = digitalocean.StickySessions(type='none')
lb = digitalocean.LoadBalancer(name='example-lb-01', region='nyc3',
algorithm='round_robin',
size='lb-small',
forwarding_rules=[rule1, rule2],
health_check=check,
sticky_sessions=sticky,
redirect_http_to_https=False,
tag='web:prod',
vpc_uuid=self.vpc_uuid,
token=self.token).create()
resp_rules = lb.forwarding_rules
self.assertEqual(responses.calls[0].request.url,
self.base_url + 'load_balancers')
self.assertEqual(lb.id, '4de7ac8b-495b-4884-9a69-1050c6793cd6')
self.assertEqual(lb.algorithm, 'round_robin')
self.assertEqual(lb.ip, '104.131.186.248')
self.assertEqual(lb.name, 'example-lb-01')
self.assertEqual(lb.size, 'lb-small')
self.assertEqual(len(resp_rules), 2)
self.assertEqual(resp_rules[0].entry_protocol, 'http')
self.assertEqual(resp_rules[0].entry_port, 80)
self.assertEqual(resp_rules[0].target_protocol, 'http')
self.assertEqual(resp_rules[0].target_port, 80)
self.assertEqual(resp_rules[0].tls_passthrough, False)
self.assertEqual(lb.health_check.protocol, 'http')
self.assertEqual(lb.health_check.port, 80)
self.assertEqual(lb.sticky_sessions.type, 'none')
self.assertEqual(lb.tag, 'web:prod')
self.assertEqual(lb.droplet_ids, [3164444, 3164445])
self.assertEqual(lb.redirect_http_to_https, False)
self.assertEqual(lb.enable_proxy_protocol, False)
self.assertEqual(lb.enable_backend_keepalive, False)
self.assertEqual(lb.vpc_uuid, self.vpc_uuid)
@responses.activate
def test_create_exception(self):
data = self.load_from_file('loadbalancer/single_tag.json')
url = self.base_url + "load_balancers/"
responses.add(responses.POST,
url,
body=data,
status=201,
content_type='application/json')
rule = digitalocean.ForwardingRule(entry_port=80,
entry_protocol='http',
target_port=80,
target_protocol='http')
check = digitalocean.HealthCheck()
sticky = digitalocean.StickySessions(type='none')
lb = digitalocean.LoadBalancer(name='example-lb-01', region='nyc3',
algorithm='round_robin',
size='lb-small',
forwarding_rules=[rule],
health_check=check,
sticky_sessions=sticky,
redirect_http_to_https=False,
tag='web:prod',
droplet_ids=[123456, 789456],
vpc_uuid=self.vpc_uuid,
token=self.token)
with self.assertRaises(ValueError) as context:
lb.create()
self.assertEqual('droplet_ids and tag are mutually exclusive args',
str(context.exception))
@responses.activate
def test_save(self):
data1 = self.load_from_file('loadbalancer/single.json')
url = '{0}load_balancers/{1}'.format(self.base_url, self.lb_id)
responses.add(responses.GET,
url,
body=data1,
status=200,
content_type='application/json')
self.lb.load()
rules = self.lb.forwarding_rules
self.assert_get_url_equal(responses.calls[0].request.url, url)
self.assertEqual(self.lb.id, self.lb_id)
self.assertEqual(self.lb.region['slug'], 'nyc3')
self.assertEqual(self.lb.algorithm, 'round_robin')
self.assertEqual(self.lb.ip, '104.131.186.241')
self.assertEqual(self.lb.name, 'example-lb-01')
self.assertEqual(len(rules), 2)
self.assertEqual(rules[0].entry_protocol, 'http')
self.assertEqual(rules[0].entry_port, 80)
self.assertEqual(rules[0].target_protocol, 'http')
self.assertEqual(rules[0].target_port, 80)
self.assertEqual(rules[0].tls_passthrough, False)
self.assertEqual(rules[1].entry_protocol, 'https')
self.assertEqual(rules[1].entry_port, 444)
self.assertEqual(rules[1].target_protocol, 'https')
self.assertEqual(rules[1].target_port, 443)
self.assertEqual(rules[1].tls_passthrough, True)
self.assertEqual(self.lb.health_check.protocol, 'http')
self.assertEqual(self.lb.health_check.port, 80)
self.assertEqual(self.lb.health_check.path, '/')
self.assertEqual(self.lb.health_check.check_interval_seconds, 10)
self.assertEqual(self.lb.health_check.response_timeout_seconds, 5)
self.assertEqual(self.lb.health_check.healthy_threshold, 5)
self.assertEqual(self.lb.health_check.unhealthy_threshold, 3)
self.assertEqual(self.lb.sticky_sessions.type, 'none')
self.assertEqual(self.lb.droplet_ids, [3164444, 3164445])
self.assertEqual(self.lb.tag, '')
self.assertEqual(self.lb.redirect_http_to_https, False)
self.assertEqual(self.lb.enable_proxy_protocol, False)
self.assertEqual(self.lb.enable_backend_keepalive, False)
self.assertEqual(self.lb.vpc_uuid, self.vpc_uuid)
data2 = self.load_from_file('loadbalancer/save.json')
url = '{0}load_balancers/{1}'.format(self.base_url, self.lb_id)
responses.add(responses.PUT,
url,
body=data2,
status=202,
content_type='application/json')
self.lb.algorithm = 'least_connections'
self.lb.sticky_sessions.type = 'cookies'
self.lb.sticky_sessions.cookie_name = 'DO_LB'
self.lb.sticky_sessions.cookie_ttl_seconds = 300
self.lb.droplet_ids = [34153248, 34153250]
self.lb.vpc_uuid = self.vpc_uuid
self.lb.redirect_http_to_https = True
self.lb.enable_proxy_protocol = True
self.lb.enable_backend_keepalive = True
res = self.lb.save()
lb = digitalocean.LoadBalancer(**res['load_balancer'])
lb.health_check = digitalocean.HealthCheck(**res['load_balancer']['health_check'])
lb.sticky_sessions = digitalocean.StickySessions(**res['load_balancer']['sticky_sessions'])
rules = list()
for rule in lb.forwarding_rules:
rules.append(digitalocean.ForwardingRule(**rule))
self.assertEqual(lb.id, self.lb_id)
self.assertEqual(lb.region['slug'], 'nyc3')
self.assertEqual(lb.algorithm, 'least_connections')
self.assertEqual(lb.ip, '104.131.186.241')
self.assertEqual(lb.name, 'example-lb-01')
self.assertEqual(len(rules), 2)
self.assertEqual(rules[0].entry_protocol, 'http')
self.assertEqual(rules[0].entry_port, 80)
self.assertEqual(rules[0].target_protocol, 'http')
self.assertEqual(rules[0].target_port, 80)
self.assertEqual(rules[0].tls_passthrough, False)
self.assertEqual(rules[1].entry_protocol, 'https')
self.assertEqual(rules[1].entry_port, 444)
self.assertEqual(rules[1].target_protocol, 'https')
self.assertEqual(rules[1].target_port, 443)
self.assertEqual(rules[1].tls_passthrough, True)
self.assertEqual(lb.health_check.protocol, 'http')
self.assertEqual(lb.health_check.port, 80)
self.assertEqual(lb.health_check.path, '/')
self.assertEqual(lb.health_check.check_interval_seconds, 10)
self.assertEqual(lb.health_check.response_timeout_seconds, 5)
self.assertEqual(lb.health_check.healthy_threshold, 5)
self.assertEqual(lb.health_check.unhealthy_threshold, 3)
self.assertEqual(lb.sticky_sessions.type, 'cookies')
self.assertEqual(lb.sticky_sessions.cookie_name, 'DO_LB')
self.assertEqual(lb.sticky_sessions.cookie_ttl_seconds, 300)
self.assertEqual(lb.droplet_ids, [34153248, 34153250])
self.assertEqual(lb.tag, '')
self.assertEqual(lb.redirect_http_to_https, True)
self.assertEqual(lb.enable_proxy_protocol, True)
self.assertEqual(lb.enable_backend_keepalive, True)
self.assertEqual(self.lb.vpc_uuid, self.vpc_uuid)
@responses.activate
def test_destroy(self):
url = '{0}load_balancers/{1}'.format(self.base_url, self.lb_id)
responses.add(responses.DELETE,
url,
status=204,
content_type='application/json')
self.lb.destroy()
self.assertEqual(responses.calls[0].request.url, url)
@responses.activate
def test_add_droplets(self):
url = '{0}load_balancers/{1}/droplets'.format(self.base_url,
self.lb_id)
responses.add(responses.POST,
url,
status=204,
content_type='application/json')
self.lb.add_droplets([12345, 78945])
body = '{"droplet_ids": [12345, 78945]}'
self.assertEqual(responses.calls[0].request.url, url)
self.assertEqual(responses.calls[0].request.body, body)
@responses.activate
def test_remove_droplets(self):
url = '{0}load_balancers/{1}/droplets'.format(self.base_url,
self.lb_id)
responses.add(responses.DELETE,
url,
status=204,
content_type='application/json')
self.lb.remove_droplets([12345, 78945])
body = '{"droplet_ids": [12345, 78945]}'
self.assertEqual(responses.calls[0].request.url, url)
self.assertEqual(responses.calls[0].request.body, body)
@responses.activate
def test_add_forwarding_rules(self):
url = '{0}load_balancers/{1}/forwarding_rules'.format(self.base_url,
self.lb_id)
responses.add(responses.POST,
url,
status=204,
content_type='application/json')
rule = digitalocean.ForwardingRule(entry_port=3306,
entry_protocol='tcp',
target_port=3306,
target_protocol='tcp')
self.lb.add_forwarding_rules([rule])
req_body = json.loads("""{
"forwarding_rules": [
{
"entry_protocol": "tcp",
"entry_port": 3306,
"target_protocol": "tcp",
"target_port": 3306,
"certificate_id": "",
"tls_passthrough": false
}
]
}""")
body = json.loads(responses.calls[0].request.body)
self.assertEqual(responses.calls[0].request.url, url)
self.assertEqual(sorted(body.items()), sorted(req_body.items()))
@responses.activate
def test_remove_forwarding_rules(self):
url = '{0}load_balancers/{1}/forwarding_rules'.format(self.base_url,
self.lb_id)
responses.add(responses.DELETE,
url,
status=204,
content_type='application/json')
rule = digitalocean.ForwardingRule(entry_port=3306,
entry_protocol='tcp',
target_port=3306,
target_protocol='tcp')
self.lb.remove_forwarding_rules([rule])
req_body = json.loads("""{
"forwarding_rules": [
{
"entry_protocol": "tcp",
"entry_port": 3306,
"target_protocol": "tcp",
"target_port": 3306,
"certificate_id": "",
"tls_passthrough": false
}
]
}""")
body = json.loads(responses.calls[0].request.body)
self.assertEqual(responses.calls[0].request.url, url)
self.assertEqual(sorted(body.items()), sorted(req_body.items()))
if __name__ == '__main__':
unittest.main()
| lgpl-3.0 | -7,799,904,155,731,132,000 | 43.722892 | 99 | 0.550862 | false |
ak-67/ZeroNet | src/Db/Db.py | 1 | 12059 | import sqlite3
import json
import time
import logging
import re
import os
import gevent
from DbCursor import DbCursor
opened_dbs = []
# Close idle databases to save some memory
def dbCleanup():
while 1:
time.sleep(60 * 5)
for db in opened_dbs[:]:
if time.time() - db.last_query_time > 60 * 3:
db.close()
gevent.spawn(dbCleanup)
class Db:
def __init__(self, schema, db_path):
self.db_path = db_path
self.db_dir = os.path.dirname(db_path) + "/"
self.schema = schema
self.schema["version"] = self.schema.get("version", 1)
self.conn = None
self.cur = None
self.log = logging.getLogger("Db:%s" % schema["db_name"])
self.table_names = None
self.collect_stats = False
self.query_stats = {}
self.db_keyvalues = {}
self.last_query_time = time.time()
def __repr__(self):
return "<Db:%s>" % self.db_path
def connect(self):
if self not in opened_dbs:
opened_dbs.append(self)
self.log.debug("Connecting to %s (sqlite version: %s)..." % (self.db_path, sqlite3.version))
if not os.path.isdir(self.db_dir): # Directory not exist yet
os.makedirs(self.db_dir)
self.log.debug("Created Db path: %s" % self.db_dir)
if not os.path.isfile(self.db_path):
self.log.debug("Db file not exist yet: %s" % self.db_path)
self.conn = sqlite3.connect(self.db_path)
self.conn.row_factory = sqlite3.Row
self.conn.isolation_level = None
self.cur = self.getCursor()
# We need more speed then security
self.cur.execute("PRAGMA journal_mode = WAL")
self.cur.execute("PRAGMA journal_mode = MEMORY")
self.cur.execute("PRAGMA synchronous = OFF")
# Execute query using dbcursor
def execute(self, query, params=None):
self.last_query_time = time.time()
if not self.conn:
self.connect()
return self.cur.execute(query, params)
def close(self):
self.log.debug("Closing, opened: %s" % opened_dbs)
if self in opened_dbs:
opened_dbs.remove(self)
if self.cur:
self.cur.close()
if self.conn:
self.conn.close()
self.conn = None
self.cur = None
# Gets a cursor object to database
# Return: Cursor class
def getCursor(self):
if not self.conn:
self.connect()
return DbCursor(self.conn, self)
# Get the table version
# Return: Table version or None if not exist
def getTableVersion(self, table_name):
"""if not self.table_names: # Get existing table names
res = self.cur.execute("SELECT name FROM sqlite_master WHERE type='table'")
self.table_names = [row["name"] for row in res]
if table_name not in self.table_names:
return False
else:"""
if not self.db_keyvalues: # Get db keyvalues
try:
res = self.cur.execute("SELECT * FROM keyvalue WHERE json_id=0") # json_id = 0 is internal keyvalues
except sqlite3.OperationalError, err: # Table not exist
self.log.debug("Query error: %s" % err)
return False
for row in res:
self.db_keyvalues[row["key"]] = row["value"]
return self.db_keyvalues.get("table.%s.version" % table_name, 0)
# Check Db tables
# Return: <list> Changed table names
def checkTables(self):
s = time.time()
changed_tables = []
cur = self.getCursor()
cur.execute("BEGIN")
# Check internal tables
# Check keyvalue table
changed = cur.needTable("keyvalue", [
["keyvalue_id", "INTEGER PRIMARY KEY AUTOINCREMENT"],
["key", "TEXT"],
["value", "INTEGER"],
["json_id", "INTEGER REFERENCES json (json_id)"],
], [
"CREATE UNIQUE INDEX key_id ON keyvalue(json_id, key)"
], version=self.schema["version"])
if changed:
changed_tables.append("keyvalue")
# Check json table
if self.schema["version"] == 1:
changed = cur.needTable("json", [
["json_id", "INTEGER PRIMARY KEY AUTOINCREMENT"],
["path", "VARCHAR(255)"]
], [
"CREATE UNIQUE INDEX path ON json(path)"
], version=self.schema["version"])
else:
changed = cur.needTable("json", [
["json_id", "INTEGER PRIMARY KEY AUTOINCREMENT"],
["directory", "VARCHAR(255)"],
["file_name", "VARCHAR(255)"]
], [
"CREATE UNIQUE INDEX path ON json(directory, file_name)"
], version=self.schema["version"])
if changed:
changed_tables.append("json")
# Check schema tables
for table_name, table_settings in self.schema["tables"].items():
changed = cur.needTable(
table_name, table_settings["cols"],
table_settings["indexes"], version=table_settings["schema_changed"]
)
if changed:
changed_tables.append(table_name)
cur.execute("COMMIT")
self.log.debug("Db check done in %.3fs, changed tables: %s" % (time.time() - s, changed_tables))
return changed_tables
# Load json file to db
# Return: True if matched
def loadJson(self, file_path, file=None, cur=None):
if not file_path.startswith(self.db_dir):
return False # Not from the db dir: Skipping
relative_path = re.sub("^%s" % self.db_dir, "", file_path) # File path realative to db file
# Check if filename matches any of mappings in schema
matched_maps = []
for match, map_settings in self.schema["maps"].items():
if re.match(match, relative_path):
matched_maps.append(map_settings)
# No match found for the file
if not matched_maps:
return False
# Load the json file
if not file:
file = open(file_path)
data = json.load(file)
# No cursor specificed
if not cur:
cur = self.getCursor()
cur.execute("BEGIN")
cur.logging = False
commit_after_done = True
else:
commit_after_done = False
# Row for current json file
json_row = cur.getJsonRow(relative_path)
# Check matched mappings in schema
for map in matched_maps:
# Insert non-relational key values
if map.get("to_keyvalue"):
# Get current values
res = cur.execute("SELECT * FROM keyvalue WHERE json_id = ?", (json_row["json_id"],))
current_keyvalue = {}
current_keyvalue_id = {}
for row in res:
current_keyvalue[row["key"]] = row["value"]
current_keyvalue_id[row["key"]] = row["keyvalue_id"]
for key in map["to_keyvalue"]:
if key not in current_keyvalue: # Keyvalue not exist yet in the db
cur.execute(
"INSERT INTO keyvalue ?",
{"key": key, "value": data.get(key), "json_id": json_row["json_id"]}
)
elif data.get(key) != current_keyvalue[key]: # Keyvalue different value
cur.execute(
"UPDATE keyvalue SET value = ? WHERE keyvalue_id = ?",
(data.get(key), current_keyvalue_id[key])
)
"""
for key in map.get("to_keyvalue", []):
cur.execute("INSERT OR REPLACE INTO keyvalue ?",
{"key": key, "value": data.get(key), "json_id": json_row["json_id"]}
)
"""
# Insert data to tables
for table_settings in map.get("to_table", []):
if isinstance(table_settings, dict): # Custom settings
table_name = table_settings["table"] # Table name to insert datas
node = table_settings.get("node", table_name) # Node keyname in data json file
key_col = table_settings.get("key_col") # Map dict key as this col
val_col = table_settings.get("val_col") # Map dict value as this col
import_cols = table_settings.get("import_cols")
replaces = table_settings.get("replaces")
else: # Simple settings
table_name = table_settings
node = table_settings
key_col = None
val_col = None
import_cols = None
replaces = None
cur.execute("DELETE FROM %s WHERE json_id = ?" % table_name, (json_row["json_id"],))
if node not in data:
continue
if key_col: # Map as dict
for key, val in data[node].iteritems():
if val_col: # Single value
cur.execute(
"INSERT OR REPLACE INTO %s ?" % table_name,
{key_col: key, val_col: val, "json_id": json_row["json_id"]}
)
else: # Multi value
if isinstance(val, dict): # Single row
row = val
if import_cols:
row = {key: row[key] for key in import_cols} # Filter row by import_cols
row[key_col] = key
# Replace in value if necessary
if replaces:
for replace_key, replace in replaces.iteritems():
if replace_key in row:
for replace_from, replace_to in replace.iteritems():
row[replace_key] = row[replace_key].replace(replace_from, replace_to)
row["json_id"] = json_row["json_id"]
cur.execute("INSERT OR REPLACE INTO %s ?" % table_name, row)
else: # Multi row
for row in val:
row[key_col] = key
row["json_id"] = json_row["json_id"]
cur.execute("INSERT OR REPLACE INTO %s ?" % table_name, row)
else: # Map as list
for row in data[node]:
row["json_id"] = json_row["json_id"]
cur.execute("INSERT OR REPLACE INTO %s ?" % table_name, row)
if commit_after_done:
cur.execute("COMMIT")
return True
if __name__ == "__main__":
s = time.time()
console_log = logging.StreamHandler()
logging.getLogger('').setLevel(logging.DEBUG)
logging.getLogger('').addHandler(console_log)
console_log.setLevel(logging.DEBUG)
dbjson = Db(json.load(open("zerotalk.schema.json")), "data/users/zerotalk.db")
dbjson.collect_stats = True
dbjson.checkTables()
cur = dbjson.getCursor()
cur.execute("BEGIN")
cur.logging = False
dbjson.loadJson("data/users/content.json", cur=cur)
for user_dir in os.listdir("data/users"):
if os.path.isdir("data/users/%s" % user_dir):
dbjson.loadJson("data/users/%s/data.json" % user_dir, cur=cur)
# print ".",
cur.logging = True
cur.execute("COMMIT")
print "Done in %.3fs" % (time.time() - s)
for query, stats in sorted(dbjson.query_stats.items()):
print "-", query, stats
| gpl-2.0 | 8,408,613,494,907,893,000 | 38.02589 | 117 | 0.509495 | false |
OpenSourcePolicyCenter/taxdata | puf_stage1/factors_finalprep.py | 1 | 3867 | """
Transform Stage_I_factors.csv (written by the stage1.py script) and
benefit_growth_rates.csv into growfactors.csv (used by Tax-Calculator).
"""
import numpy as np
import pandas as pd
import os
# pylint: disable=invalid-name
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
first_benefit_year = 2014
inben_filename = os.path.join(CUR_PATH, 'benefit_growth_rates.csv')
first_data_year = 2011
infac_filename = os.path.join(CUR_PATH, 'Stage_I_factors.csv')
output_filename = os.path.join(CUR_PATH, 'growfactors.csv')
# --------------------------------------------------------------------------
# read in raw average benefit amounts by year and
# convert into "one plus annual proportion change" factors
bgr_all = pd.read_csv(inben_filename, index_col='YEAR')
bnames = ['mcare', 'mcaid', 'ssi', 'snap', 'wic', 'housing', 'tanf', 'vet']
keep_cols = ['{}_average_benefit'.format(bname) for bname in bnames]
bgr_raw = bgr_all[keep_cols]
gf_bnames = ['ABEN{}'.format(bname.upper()) for bname in bnames]
bgr_raw.columns = gf_bnames
bgf = 1.0 + bgr_raw.astype('float64').pct_change()
# specify first row values because pct_change() leaves first year undefined
for var in list(bgf):
bgf[var][first_benefit_year] = 1.0
# add rows of ones for years from first_data_year thru first_benefit_year-1
ones = [1.0] * len(bnames)
for year in range(first_data_year, first_benefit_year):
row = pd.DataFrame(data=[ones], columns=gf_bnames, index=[year])
bgf = pd.concat([bgf, row], verify_integrity=True)
bgf.sort_index(inplace=True)
# round converted factors to six decimal digits of accuracy
bgf = bgf.round(6)
# --------------------------------------------------------------------------
# read in blowup factors used internally in taxdata repository
data = pd.read_csv(infac_filename, index_col='YEAR')
# convert some aggregate factors into per-capita factors
elderly_pop = data['APOPSNR']
data['ASOCSEC'] = data['ASOCSEC'] / elderly_pop
pop = data['APOPN']
data['AWAGE'] = data['AWAGE'] / pop
data['ATXPY'] = data['ATXPY'] / pop
data['ASCHCI'] = data['ASCHCI'] / pop
data['ASCHCL'] = data['ASCHCL'] / pop
data['ASCHF'] = data['ASCHF'] / pop
data['AINTS'] = data['AINTS'] / pop
data['ADIVS'] = data['ADIVS'] / pop
data['ASCHEI'] = data['ASCHEI'] / pop
data['ASCHEL'] = data['ASCHEL'] / pop
data['ACGNS'] = data['ACGNS'] / pop
data['ABOOK'] = data['ABOOK'] / pop
data['ABENEFITS'] = data['ABENEFITS'] / pop
data.rename(columns={'ABENEFITS': 'ABENOTHER'}, inplace=True)
# convert factors into "one plus annual proportion change" format
data = 1.0 + data.pct_change()
# specify first row values because pct_change() leaves first year undefined
for var in list(data):
data[var][first_data_year] = 1.0
# round converted factors to six decimal digits of accuracy
data = data.round(6)
# --------------------------------------------------------------------------
# combine data and bgf DataFrames
gfdf = pd.concat([data, bgf], axis='columns', verify_integrity=True)
# --------------------------------------------------------------------------
# delete from data the variables not used by Tax-Calculator (TC)
TC_USED_VARS = set(['ABOOK',
'ACGNS',
'ACPIM',
'ACPIU',
'ADIVS',
'AINTS',
'AIPD',
'ASCHCI',
'ASCHCL',
'ASCHEI',
'ASCHEL',
'ASCHF',
'ASOCSEC',
'ATXPY',
'AUCOMP',
'AWAGE',
'ABENOTHER'] + gf_bnames)
ALL_VARS = set(list(gfdf))
TC_UNUSED_VARS = ALL_VARS - TC_USED_VARS
gfdf = gfdf.drop(TC_UNUSED_VARS, axis=1)
# write out grow factors used in blowup logic in Tax-Calculator repository
gfdf.to_csv(output_filename, index_label='YEAR')
| mit | -5,736,347,475,636,523,000 | 36.543689 | 76 | 0.587794 | false |
MatthieuDartiailh/pyvisa-sim | pyvisa-sim/parser.py | 1 | 8388 | # -*- coding: utf-8 -*-
"""
pyvisa-sim.parser
~~~~~~~~~~~~~~~~~
Parser function
:copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
import os
from io import open, StringIO
from contextlib import closing
from traceback import format_exc
import pkg_resources
import yaml
from .component import NoResponse
from .devices import Devices, Device
from .channels import Channels
def _ver_to_tuple(ver):
return tuple(map(int, (ver.split("."))))
#: Version of the specification
SPEC_VERSION = '1.1'
SPEC_VERSION_TUPLE = _ver_to_tuple(SPEC_VERSION)
class SimpleChainmap(object):
"""Combine multiple mappings for sequential lookup.
"""
def __init__(self, *maps):
self._maps = maps
def __getitem__(self, key):
for mapping in self._maps:
try:
return mapping[key]
except KeyError:
pass
raise KeyError(key)
def _s(s):
"""Strip white spaces
"""
if s is NoResponse:
return s
return s.strip(' ')
def _get_pair(dd):
"""Return a pair from a dialogue dictionary.
:param dd: Dialogue dictionary.
:type dd: Dict[str, str]
:return: (query, response)
:rtype: (str, str)
"""
return _s(dd['q']), _s(dd.get('r', NoResponse))
def _get_triplet(dd):
"""Return a triplet from a dialogue dictionary.
:param dd: Dialogue dictionary.
:type dd: Dict[str, str]
:return: (query, response, error response)
:rtype: (str, str | NoResponse, str | NoResponse)
"""
return _s(dd['q']), _s(dd.get('r', NoResponse)), _s(dd.get('e', NoResponse))
def _load(content_or_fp):
"""YAML Parse a file or str and check version.
"""
try:
data = yaml.load(content_or_fp, Loader=yaml.loader.BaseLoader)
except Exception as e:
raise type(e)('Malformed yaml file:\n%r' % format_exc())
try:
ver = data['spec']
except:
raise ValueError('The file does not specify a spec version')
try:
ver = tuple(map(int, (ver.split("."))))
except:
raise ValueError("Invalid spec version format. Expect 'X.Y'"
" (X and Y integers), found %s" % ver)
if ver > SPEC_VERSION_TUPLE:
raise ValueError('The spec version of the file is '
'%s but the parser is %s. '
'Please update pyvisa-sim.' % (ver, SPEC_VERSION))
return data
def parse_resource(name):
"""Parse a resource file
"""
with closing(pkg_resources.resource_stream(__name__, name)) as fp:
rbytes = fp.read()
return _load(StringIO(rbytes.decode('utf-8')))
def parse_file(fullpath):
"""Parse a file
"""
with open(fullpath, encoding='utf-8') as fp:
return _load(fp)
def update_component(name, comp, component_dict):
"""Get a component from a component dict.
"""
for dia in component_dict.get('dialogues', ()):
try:
comp.add_dialogue(*_get_pair(dia))
except Exception as e:
msg = 'In device %s, malformed dialogue %s\n%r'
raise Exception(msg % (name, dia, e))
for prop_name, prop_dict in component_dict.get('properties', {}).items():
try:
getter = (_get_pair(prop_dict['getter'])
if 'getter' in prop_dict else None)
setter = (_get_triplet(prop_dict['setter'])
if 'setter' in prop_dict else None)
comp.add_property(prop_name, prop_dict.get('default', ''),
getter, setter, prop_dict.get('specs', {}))
except Exception as e:
msg = 'In device %s, malformed property %s\n%r'
raise type(e)(msg % (name, prop_name, format_exc()))
def get_bases(definition_dict, loader):
"""Collect dependencies.
"""
bases = definition_dict.get('bases', ())
if bases:
bases = (loader.get_comp_dict(required_version=SPEC_VERSION_TUPLE[0],
**b)
for b in bases)
return SimpleChainmap(definition_dict, *bases)
else:
return definition_dict
def get_channel(device, ch_name, channel_dict, loader, resource_dict):
"""Get a channels from a channels dictionary.
:param name: name of the device
:param device_dict: device dictionary
:rtype: Device
"""
channel_dict = get_bases(channel_dict, loader)
r_ids = resource_dict.get('channel_ids', {}).get(ch_name, [])
ids = r_ids if r_ids else channel_dict.get('ids', {})
can_select = False if channel_dict.get('can_select') == 'False' else True
channels = Channels(device, ids, can_select)
update_component(ch_name, channels, channel_dict)
return channels
def get_device(name, device_dict, loader, resource_dict):
"""Get a device from a device dictionary.
:param name: name of the device
:param device_dict: device dictionary
:rtype: Device
"""
device = Device(name, device_dict.get('delimiter', ';').encode('utf-8'))
device_dict = get_bases(device_dict, loader)
err = device_dict.get('error', {})
device.add_error_handler(err)
for itype, eom_dict in device_dict.get('eom', {}).items():
device.add_eom(itype, *_get_pair(eom_dict))
update_component(name, device, device_dict)
for ch_name, ch_dict in device_dict.get('channels', {}).items():
device.add_channels(ch_name, get_channel(device, ch_name, ch_dict,
loader, resource_dict))
return device
class Loader(object):
def __init__(self, filename, bundled):
# (absolute path / resource name / None, bundled) -> dict
# :type: dict[str | None, bool, dict]
self._cache = {}
self.data = self._load(filename, bundled, SPEC_VERSION_TUPLE[0])
self._filename = filename
self._bundled = bundled
self._basepath = os.path.dirname(filename)
def load(self, filename, bundled, parent, required_version):
if self._bundled and not bundled:
msg = 'Only other bundled files can be loaded from bundled files.'
raise ValueError(msg)
if parent is None:
parent = self._filename
base = os.path.dirname(parent)
filename = os.path.join(base, filename)
return self._load(filename, bundled, required_version)
def _load(self, filename, bundled, required_version):
if (filename, bundled) in self._cache:
return self._cache[(filename, bundled)]
if bundled:
data = parse_resource(filename)
else:
data = parse_file(filename)
ver = _ver_to_tuple(data['spec'])[0]
if ver != required_version:
raise ValueError('Invalid version in %s (bundled = %s). '
'Expected %s, found %s,' % (filename, bundled,
required_version, ver)
)
self._cache[(filename, bundled)] = data
return data
def get_device_dict(self, device, filename, bundled, required_version):
if filename is None:
data = self.data
else:
data = self.load(filename, bundled, required_version)
return data['devices'][device]
def get_devices(filename, bundled):
"""Get a Devices object from a file.
:param filename: full path of the file to parse or name of the resource.
:param is_resource: boolean indicating if it is a resource.
:rtype: Devices
"""
loader = Loader(filename, bundled)
data = loader.data
devices = Devices()
# Iterate through the resources and generate each individual device
# on demand.
for resource_name, resource_dict in data.get('resources', {}).items():
device_name = resource_dict['device']
dd = loader.get_device_dict(device_name,
resource_dict.get('filename', None),
resource_dict.get('bundled', False),
required_version=SPEC_VERSION_TUPLE[0])
devices.add_device(resource_name,
get_device(device_name, dd, loader, resource_dict))
return devices
| mit | 8,398,695,646,469,128,000 | 27.147651 | 80 | 0.580472 | false |
CodingCat/mxnet | tests/python/gpu/test_operator_gpu.py | 1 | 86764 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from __future__ import print_function
import sys
import os
import time
import multiprocessing as mp
import unittest
import mxnet as mx
import numpy as np
import unittest
from nose.tools import assert_raises
from mxnet.test_utils import check_consistency, set_default_context, assert_almost_equal
from mxnet.base import MXNetError
from numpy.testing import assert_allclose
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(curr_path, '../unittest'))
from common import setup_module, with_seed
from test_operator import *
from test_optimizer import *
from test_random import *
from test_gluon import *
from test_loss import *
from test_exc_handling import *
#from test_rnn import *
from test_gluon_rnn import *
from test_sparse_ndarray import test_create_csr, test_create_row_sparse, test_sparse_nd_slice
from test_sparse_ndarray import test_create_sparse_nd_empty, test_create_sparse_nd_from_sparse
from test_sparse_ndarray import test_create_sparse_nd_from_dense, test_create_sparse_nd_infer_shape
from test_sparse_ndarray import test_sparse_nd_check_format, test_sparse_nd_copy
from test_sparse_ndarray import test_sparse_nd_setitem, test_sparse_nd_binary_scalar_op
from test_sparse_operator import *
from test_ndarray import *
set_default_context(mx.gpu(0))
del test_support_vector_machine_l1_svm
del test_support_vector_machine_l2_svm
def check_countsketch(in_dim,out_dim,n):
sym = mx.sym.contrib.count_sketch(name='countsketch',out_dim = out_dim)
shape = [(n,in_dim), (1,in_dim),(1,in_dim)] #shape of input x, hash h and hash s
arr = [mx.nd.empty(shape[i]) for i in range(3)]
arr_grad = [mx.nd.empty(shape[i]) for i in range(3)]
x = np.random.uniform(-10, 10, shape[0])
arr[0][:] = x #input x
h = np.random.randint(0, out_dim, shape[1])
arr[1][:] = h #hash h
s = np.random.randint(0, 2, shape[2])*2-np.ones(shape[2])
arr[2][:] = s #hash s
# forward
exe_list = [sym.bind(mx.gpu(0), arr, arr_grad)]
for exe in exe_list:
exe.forward(is_train= True)
out1 = [exe.outputs[0].asnumpy() for exe in exe_list]
a = np.zeros((n,out_dim))
temp = np.multiply(x, s)
for num_sample in np.arange(0,n):
for idx in np.arange(0,in_dim):
a[num_sample][h[0][idx]] += temp[num_sample][idx]
assert_almost_equal(a,out1[0],rtol=1e-3, atol=1e-12)
# backward
out_grad = mx.nd.empty((n,out_dim))
out_grad[:] = np.random.normal(-3, 3, (n,out_dim))
for exe in exe_list:
exe.backward([out_grad])
a = np.zeros((n,in_dim))
for j in np.arange(0,n):
for i in np.arange(0,in_dim):
a[j,i] = out_grad.asnumpy()[j, h[0,i]] * s[0,i]
assert_almost_equal(a,arr_grad[0].asnumpy(),rtol=1e-3, atol=1e-12)
@with_seed(0)
def test_countsketch():
nrepeat = 2
minindim = 40
maxindim = 100
minoutdim = 5
maxoutdim = 30
maxn = 200
for repeat in range(nrepeat):
in_dim = np.random.randint(minindim, maxindim)
out_dim = np.random.randint(minoutdim, maxoutdim)
n = np.random.randint(1,maxn)
check_countsketch(in_dim, out_dim, n)
def check_ifft(shape):
shape_old = shape
if len(shape) == 2:
if shape[1]%2 != 0:
lst = list(shape)
lst[1] = lst[1]*2
shape = tuple(lst)
shape_old = shape
shape = (shape[0],shape[1]*2)
if len(shape) == 4:
if shape[3]%2 != 0:
lst = list(shape)
lst[3] = lst[3]*2
shape = tuple(lst)
shape_old = shape
shape = (shape[0],shape[1],shape[2],shape[3]*2)
sym = mx.sym.contrib.ifft(name='ifft', compute_size = 128)
init = [np.random.normal(size=shape, scale=1.0)]
arr_grad = [mx.nd.empty(shape)]
ctx_list = [{'ctx': mx.gpu(0),'ifft_data': shape, 'type_dict': {'ifft_data': np.float32}}]
exe_list = [sym.simple_bind(args_grad=arr_grad,**ctx) for ctx in ctx_list]
for exe in exe_list:
for arr, iarr in zip(exe.arg_arrays, init):
arr[:] = iarr.astype(arr.dtype)
# forward
for exe in exe_list:
exe.forward(is_train= True)
out1 = [exe.outputs[0].asnumpy() for exe in exe_list]
if len(shape) == 2:
init_complex = np.zeros(shape_old,dtype = np.complex64)
for i in range(0,shape_old[1]):
init_complex.real[:,i] = init[0][:,2*i]
init_complex.imag[:,i] = init[0][:,2*i+1]
a = np.fft.ifft(init_complex, n=None, axis=-1, norm=None)
assert_almost_equal(a.real, out1[0]/shape_old[1],rtol=1e-3, atol=1e-12)
if len(shape) == 4:
init_complex = np.zeros(shape_old,dtype = np.complex64)
for i in range(0,shape_old[3]):
init_complex.real[:,:,:,i] = init[0][:,:,:,2*i]
init_complex.imag[:,:,:,i] = init[0][:,:,:,2*i+1]
a = np.fft.ifft(init_complex, n=None, axis=-1, norm=None)
assert_almost_equal(a.real, out1[0]/shape_old[3],rtol=1e-3, atol=1e-12)
# backward
if len(shape) == 2:
out_grad = mx.nd.empty(shape_old)
out_grad[:] = np.random.normal(-3, 3, shape_old)
for exe in exe_list:
exe.backward([out_grad])
temp = exe.grad_arrays[0].asnumpy()
temp = np.zeros(shape_old)
for i in range(shape_old[1]):
temp[:,i] = exe.grad_arrays[0].asnumpy()[:,2*i]
a = np.fft.fft(out_grad.asnumpy(), n=None, axis=-1, norm=None)
assert_almost_equal(a.real, temp, rtol=1e-3, atol=1e-12)
if len(shape) == 4:
out_grad = mx.nd.empty(shape_old)
out_grad[:] = np.random.normal(-3, 3, shape_old)
for exe in exe_list:
exe.backward([out_grad])
temp = exe.grad_arrays[0].asnumpy()
temp = np.zeros(shape_old)
for i in range(shape_old[3]):
temp[:,:,:,i] = exe.grad_arrays[0].asnumpy()[:,:,:,2*i]
a = np.fft.fft(out_grad.asnumpy(), n=None, axis=-1, norm=None)
assert_almost_equal(a.real, temp, rtol=1e-3, atol=1e-12)
@with_seed(0)
def test_ifft():
nrepeat = 2
maxdim = 10
for repeat in range(nrepeat):
for order in [2,4]:
shape = tuple(np.random.randint(1, maxdim, size=order))
check_ifft(shape)
def check_fft(shape):
sym = mx.sym.contrib.fft(name='fft', compute_size = 128)
if len(shape) == 2:
if shape[1]%2 != 0:
lst = list(shape)
lst[1] = lst[1]*2
shape = tuple(lst)
shape_old = shape
if len(shape) == 4:
if shape[3]%2 != 0:
lst = list(shape)
lst[3] = lst[3]*2
shape = tuple(lst)
shape_old = shape
init = [np.random.normal(size=shape, scale=1.0)]
arr_grad = [mx.nd.empty(shape)]
ctx_list = [{'ctx': mx.gpu(0),'fft_data': shape, 'type_dict': {'fft_data': np.float32}}]
exe_list = [sym.simple_bind(args_grad=arr_grad,**ctx) for ctx in ctx_list]
for exe in exe_list:
for arr, iarr in zip(exe.arg_arrays, init):
arr[:] = iarr.astype(arr.dtype)
#forward
for exe in exe_list:
exe.forward(is_train=True)
out1 = [exe.outputs[0].asnumpy() for exe in exe_list]
out = np.fft.fft(init, n=None, axis=-1, norm=None)
if len(shape) == 2:
out = np.reshape(out,(out.shape[1],out.shape[2]))
out2 = np.append(out.real, out.imag, axis = 1)
a = np.zeros(out1[0].shape)
p = 0
for i in range(out2.shape[1]//2):
a[:,p] = out2[:,i]
a[:,p+1] = out2[:,i+out2.shape[1]//2]
p = p+2
if len(shape) == 4:
out = np.reshape(out,(out.shape[1],out.shape[2],out.shape[3],out.shape[4]))
out2 = np.append(out.real, out.imag, axis = 1)
a = np.zeros(out1[0].shape)
for i in range(out1[0].shape[0]):
for j in range(out1[0].shape[1]):
p = 0
for k in range(out2.shape[3]):
a[i,j,:,p] = out2[i,j,:,k]
a[i,j,:,p+1] = out2[i,j+out1[0].shape[1],:,k]
p = p+2
assert_almost_equal(a, out1[0],rtol=1e-3, atol=1e-6)
# backward
if len(shape) == 2:
out_grad = mx.nd.empty((shape[0],2*shape[1]))
out_grad[:] = np.random.normal(-3, 3, (shape[0],2*shape[1]))
# out_grad_to_complex
out_grad_complex = np.zeros(shape,dtype = np.complex64)
for i in range(0,shape[1]):
out_grad_complex.real[:,i] = out_grad.asnumpy()[:,2*i]
out_grad_complex.imag[:,i] = out_grad.asnumpy()[:,2*i+1]
for exe in exe_list:
exe.backward([out_grad])
a = np.fft.ifft(out_grad_complex, n=None, axis=-1, norm=None)
assert_almost_equal(a.real, exe.grad_arrays[0].asnumpy()/shape[1],rtol=1e-3, atol=1e-8)
if len(shape) == 4:
out_grad = mx.nd.empty(out1[0].shape)
out_grad[:] = np.random.normal(-3, 3, out1[0].shape)
# out_grad_to_complex
out_grad_complex = np.zeros(shape,dtype = np.complex64)
for i in range(0,shape[3]):
out_grad_complex.real[:,:,:,i] = out_grad.asnumpy()[:,:,:,2*i]
out_grad_complex.imag[:,:,:,i] = out_grad.asnumpy()[:,:,:,2*i+1]
for exe in exe_list:
exe.backward([out_grad])
a = np.fft.ifft(out_grad_complex, n=None, axis=-1, norm=None)
assert_almost_equal(a.real, exe.grad_arrays[0].asnumpy()/shape[3],rtol=1e-3, atol=1e-6)
@with_seed(0)
def test_fft():
nrepeat = 2
maxdim = 10
for repeat in range(nrepeat):
for order in [2,4]:
shape = tuple(np.random.randint(1, maxdim, size=order))
check_fft(shape)
@with_seed()
def test_batchnorm_with_type():
ctx_list_v1_2D = [
{'ctx': mx.cpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float32}},
{'ctx': mx.gpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float32}},
]
ctx_list_v2_2D = [
{'ctx': mx.cpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float32}},
{'ctx': mx.cpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float16}},
{'ctx': mx.cpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float64}},
{'ctx': mx.gpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float32}},
{'ctx': mx.gpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float16}},
{'ctx': mx.gpu(0), 'norm_data': (10, 2, 10, 10), 'type_dict': {'norm_data': np.float64}},
]
ctx_list_v2_1D = [
{'ctx': mx.cpu(0), 'norm_data': (10, 2, 10), 'type_dict': {'norm_data': np.float16}},
{'ctx': mx.cpu(0), 'norm_data': (10, 2, 10), 'type_dict': {'norm_data': np.float32}},
{'ctx': mx.cpu(0), 'norm_data': (10, 2, 10), 'type_dict': {'norm_data': np.float64}},
{'ctx': mx.gpu(0), 'norm_data': (10, 2, 10), 'type_dict': {'norm_data': np.float16}},
{'ctx': mx.gpu(0), 'norm_data': (10, 2, 10), 'type_dict': {'norm_data': np.float32}},
{'ctx': mx.gpu(0), 'norm_data': (10, 2, 10), 'type_dict': {'norm_data': np.float64}},
]
ctx_list_v2_3D = [
{'ctx': mx.cpu(0), 'norm_data': (4, 2, 3, 5, 5), 'type_dict': {'norm_data': np.float16}},
{'ctx': mx.cpu(0), 'norm_data': (4, 2, 3, 5, 5), 'type_dict': {'norm_data': np.float32}},
{'ctx': mx.cpu(0), 'norm_data': (4, 2, 3, 5, 5), 'type_dict': {'norm_data': np.float64}},
{'ctx': mx.gpu(0), 'norm_data': (4, 2, 3, 5, 5), 'type_dict': {'norm_data': np.float16}},
{'ctx': mx.gpu(0), 'norm_data': (4, 2, 3, 5, 5), 'type_dict': {'norm_data': np.float32}},
{'ctx': mx.gpu(0), 'norm_data': (4, 2, 3, 5, 5), 'type_dict': {'norm_data': np.float64}}
]
# V1, 2D
sym = mx.sym.BatchNorm_v1(name='norm', fix_gamma=False)
check_consistency(sym, ctx_list_v1_2D)
sym = mx.sym.BatchNorm_v1(name='norm', fix_gamma=True)
check_consistency(sym, ctx_list_v1_2D)
# V2, 2D
sym = mx.sym.BatchNorm(name='norm', fix_gamma=False, cudnn_off=True)
check_consistency(sym, ctx_list_v2_2D)
sym = mx.sym.BatchNorm(name='norm', fix_gamma=False, cudnn_off=True)
check_consistency(sym, ctx_list_v2_2D)
sym = mx.sym.BatchNorm(name='norm', fix_gamma=True, cudnn_off=True)
check_consistency(sym, ctx_list_v2_2D)
sym = mx.sym.BatchNorm(name='norm', fix_gamma=True, cudnn_off=True)
check_consistency(sym, ctx_list_v2_2D)
# V2, 1D
sym = mx.sym.BatchNorm(name='norm', fix_gamma=False, cudnn_off=True)
check_consistency(sym, ctx_list_v2_1D)
sym = mx.sym.BatchNorm(name='norm', fix_gamma=False, cudnn_off=True)
check_consistency(sym, ctx_list_v2_1D)
sym = mx.sym.BatchNorm(name='norm', fix_gamma=True, cudnn_off=True)
check_consistency(sym, ctx_list_v2_1D)
sym = mx.sym.BatchNorm(name='norm', fix_gamma=True, cudnn_off=True)
check_consistency(sym, ctx_list_v2_1D)
#
# # V2, 3D
sym = mx.sym.BatchNorm(name='norm', fix_gamma=False, cudnn_off=True)
check_consistency(sym, ctx_list_v2_3D)
sym = mx.sym.BatchNorm(name='norm', fix_gamma=True, cudnn_off=True)
check_consistency(sym, ctx_list_v2_3D)
@with_seed()
def test_batchnorm_versions():
def test_batchnorm_versions_helper(batchnorm_op_list, data, fix_gamma, use_global_stats):
ctx_list = []
sym_list = []
# BatchNormV1 cpu
if 'batchnorm_v1_cpu' in batchnorm_op_list:
ctx_list.append({'ctx': mx.cpu(0), 'batchnorm_data': data, 'type_dict': {'batchnorm_data': np.float32}})
sym_list.append(mx.sym.BatchNorm_v1(fix_gamma=fix_gamma,
use_global_stats=use_global_stats,
name='batchnorm'))
# BatchNormV1 gpu (organic)
if 'batchnorm_v1_gpu' in batchnorm_op_list:
ctx_list.append({'ctx': mx.gpu(0), 'batchnorm_data': data, 'type_dict': {'batchnorm_data': np.float32}})
sym_list.append(mx.sym.BatchNorm_v1(fix_gamma=fix_gamma,
use_global_stats=use_global_stats,
name='batchnorm'))
# BatchNorm cpu
if 'batchnorm_cpu' in batchnorm_op_list:
ctx_list.append({'ctx': mx.cpu(0), 'batchnorm_data': data, 'type_dict': {'batchnorm_data': np.float32}})
sym_list.append(mx.sym.BatchNorm(fix_gamma=fix_gamma,
use_global_stats=use_global_stats,
name='batchnorm'))
# BatchNorm gpu (organic)
if 'batchnorm_gpu' in batchnorm_op_list:
ctx_list.append({'ctx': mx.gpu(0), 'batchnorm_data': data, 'type_dict': {'batchnorm_data': np.float32}})
sym_list.append(mx.sym.BatchNorm(fix_gamma=fix_gamma,
use_global_stats=use_global_stats,
name='batchnorm', cudnn_off=True))
# BatchNorm gpu cudnn (if cudnn is enabled)
if 'batchnorm_cudnn' in batchnorm_op_list:
ctx_list.append({'ctx': mx.gpu(0), 'batchnorm_data': data, 'type_dict': {'batchnorm_data': np.float32}})
sym_list.append(mx.sym.BatchNorm(fix_gamma=fix_gamma,
use_global_stats=use_global_stats,
name='batchnorm', cudnn_off=False))
check_consistency(sym_list, ctx_list)
def test_1d_batchnorm(fix_gamma, use_global_stats):
data = (2, 3, 20)
test_batchnorm_versions_helper(batchnorm_op_list=['batchnorm_cpu',
'batchnorm_gpu', 'batchnorm_cudnn'],
data=data,
fix_gamma=fix_gamma, use_global_stats=use_global_stats)
def test_2d_batchnorm(fix_gamma, use_global_stats):
data = (2, 3, 10, 10)
test_batchnorm_versions_helper(batchnorm_op_list=['batchnorm_v1_cpu', 'batchnorm_v1_gpu',
'batchnorm_cpu',
'batchnorm_gpu', 'batchnorm_cudnn'],
data=data,
fix_gamma=fix_gamma, use_global_stats=use_global_stats)
def test_3d_batchnorm(fix_gamma, use_global_stats):
data = (2, 3, 3, 5, 5)
test_batchnorm_versions_helper(batchnorm_op_list=['batchnorm_cpu',
'batchnorm_gpu'],
data=data,
fix_gamma=fix_gamma, use_global_stats=use_global_stats)
test_1d_batchnorm(True, False)
test_1d_batchnorm(False, False)
test_1d_batchnorm(False, True)
test_1d_batchnorm(True, True)
test_2d_batchnorm(True, False)
test_2d_batchnorm(False, False)
test_2d_batchnorm(False, True)
test_2d_batchnorm(True, True)
test_3d_batchnorm(True, False)
test_3d_batchnorm(False, False)
test_3d_batchnorm(False, True)
test_3d_batchnorm(True, True)
@with_seed(1234)
def test_convolution_with_type():
sym1 = mx.sym.Convolution(num_filter=3, kernel=(3,3), name='conv')
data = mx.sym.Variable('conv_data')
w = mx.sym.Variable('conv_weight')
b = mx.sym.Variable('conv_bias')
w = mx.sym.transpose(w, axes=(0,2,3,1))
sym2 = mx.sym.transpose(data, axes=(0,2,3,1))
sym2 = mx.sym.Convolution(sym2, w, b, layout='NHWC', num_filter=3, kernel=(3,3))
sym2 = mx.sym.transpose(sym2, axes=(0,3,1,2), name='conv')
sym = [sym1, sym1, sym1, sym1, sym1, sym2, sym2]
ctx_list = [{'ctx': mx.gpu(0), 'conv_data': (2, 2, 10, 10), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 10, 10), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 10, 10), 'type_dict': {'conv_data': np.float16}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 10, 10), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 10, 10), 'type_dict': {'conv_data': np.float32}},
# NHWC
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 10, 10), 'conv_weight': (3, 2, 3, 3),
'type_dict': {'conv_data': np.float32, 'conv_weight': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 10, 10), 'conv_weight': (3, 2, 3, 3),
'type_dict': {'conv_data': np.float16, 'conv_weight': np.float16}}
]
# wider tolerance needed for true-fp16 NCHW test above
tol = {np.dtype(np.float16): 0.5,
np.dtype(np.float32): 1e-3,
np.dtype(np.float64): 1e-5,
np.dtype(np.uint8): 0,
np.dtype(np.int32): 0}
check_consistency(sym, ctx_list, tol=tol)
# test ability to turn off training on bias
check_consistency(sym, ctx_list, grad_req={'conv_data': 'write', 'conv_weight': 'write', 'conv_bias': 'null'}, tol=tol)
# Apply N symbols against each of M contexts, checking that all NxM combinations match.
def check_consistency_NxM(sym_list, ctx_list):
# e.g. if sym_list=[sym1, sym2] and ctx_list=[ctx1, ctx2, ctx3], then resulting lists are:
# sym_list=[sym1, sym1, sym1, sym2, sym2, sym2] and ctx_list=[ctx1, ctx2, ctx3, ctx1, ctx2, ctx3]
check_consistency(np.repeat(sym_list, len(ctx_list)), ctx_list * len(sym_list))
@with_seed()
def test_convolution_options():
# 1D convolution
ctx_list = [{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7), 'type_dict': {'conv_data': np.float16}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 7), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 7), 'type_dict': {'conv_data': np.float32}}]
# Pad > 0
sym = mx.sym.Convolution(layout='NCW', num_filter=3, kernel=(3,), pad=(1,), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(3,), pad=(1,), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Stride > 1
sym = mx.sym.Convolution(layout='NCW', num_filter=3, kernel=(3,), stride=(2,), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(3,), stride=(2,), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Dilate > 1
sym = mx.sym.Convolution(layout='NCW', num_filter=3, kernel=(3,), dilate=(2,), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(3,), dilate=(2,), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# 1x1 convolution
sym = mx.sym.Convolution(layout='NCW', num_filter=3, kernel=(1,), pad=(0,), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(1,), pad=(0,), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# 2D convolution
ctx_list = [{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float16}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float32}}]
# Pad > 0
sym = mx.sym.Convolution(num_filter=3, kernel=(3,3), pad=(1,1), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(3,3), pad=(1,1), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Stride > 1
sym = mx.sym.Convolution(num_filter=3, kernel=(3,3), stride=(2,2), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(3,3), stride=(2,2), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Dilate > 1
sym = mx.sym.Convolution(num_filter=3, kernel=(3,3), dilate=(2,2), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(3,3), dilate=(2,2), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# 1x1 convolution
sym = mx.sym.Convolution(num_filter=3, kernel=(1,1), pad=(0,0), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(1,1), pad=(0,0), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# 3D convolution
ctx_list = [{'ctx': mx.cpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float64}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float32}}]
# Pad > 0
sym = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), pad=(1,1,1), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), pad=(1,1,1), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Stride > 1
sym = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), stride=(2,2,2), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), stride=(2,2,2), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# 1x1 convolution
sym = mx.sym.Convolution(num_filter=3, kernel=(1,1,1), pad=(0,0,0), name='conv')
sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(1,1,1), pad=(0,0,0), cudnn_off=True, name='conv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
@with_seed()
def test_convolution_versions():
# 2D convolution NCHW
ctx_list = [{'ctx': mx.cpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 7, 7), 'type_dict': {'conv_data': np.float32}}]
conv_v1_cpu = mx.sym.Convolution_v1(num_filter=3, kernel=(3,3), pad=(1,1), name='conv')
conv_v1_gpu = mx.sym.Convolution_v1(num_filter=3, kernel=(3,3), pad=(1,1), cudnn_off=True, name='conv')
conv_cudnn = mx.sym.Convolution(num_filter=3, kernel=(3,3), pad=(1,1), name='conv')
conv_cpu = mx.sym.Convolution(num_filter=3, kernel=(3,3), pad=(1,1), name='conv')
conv_gpu = mx.sym.Convolution(num_filter=3, kernel=(3,3), pad=(1,1), cudnn_off=True, name='conv')
syms = [conv_v1_cpu, conv_v1_gpu, conv_cudnn, conv_cpu, conv_gpu]
check_consistency(syms, ctx_list)
# 3D convolution NCDHW
ctx_list = [{'ctx': mx.gpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.cpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float32}},
{'ctx': mx.gpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float32}}]
conv_cudnn = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), pad=(1,1,1), name='conv')
conv_cpu = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), pad=(1,1,1), name='conv')
conv_gpu = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), pad=(1,1,1), cudnn_off=True, name='conv')
syms = [conv_cudnn, conv_cpu, conv_gpu]
check_consistency(syms, ctx_list)
@with_seed()
def test_pooling_with_type():
ctx_list = [{'ctx': mx.gpu(0), 'pool_data': (2, 2, 10, 10), 'type_dict': {'pool_data': np.float64}},
{'ctx': mx.gpu(0), 'pool_data': (2, 2, 10, 10), 'type_dict': {'pool_data': np.float32}},
{'ctx': mx.gpu(0), 'pool_data': (2, 2, 10, 10), 'type_dict': {'pool_data': np.float16}},
{'ctx': mx.cpu(0), 'pool_data': (2, 2, 10, 10), 'type_dict': {'pool_data': np.float64}},
{'ctx': mx.cpu(0), 'pool_data': (2, 2, 10, 10), 'type_dict': {'pool_data': np.float32}}]
sym = mx.sym.Pooling(kernel=(3,3), pool_type='max', pooling_convention='valid', name='pool')
check_consistency(sym, ctx_list)
sym = mx.sym.Pooling(kernel=(3,3), pool_type='max', pooling_convention='full', name='pool')
check_consistency(sym, ctx_list)
sym = mx.sym.Pooling(kernel=(300,300), pool_type='max', global_pool=True, name='pool')
check_consistency(sym, ctx_list)
@with_seed()
def test_deconvolution_with_type():
# Test basic deconvolution without exercising stride, pad or dilation.
# 1D deconvolution
sym = mx.sym.Deconvolution(num_filter=3, kernel=(3,), name='deconv')
ctx_list = [{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float32}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float16}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float32}}]
# wider tolerance needed for true-fp16 test above
tol = {np.dtype(np.float16): 0.3,
np.dtype(np.float32): 1e-3,
np.dtype(np.float64): 1e-5,
np.dtype(np.uint8): 0,
np.dtype(np.int32): 0}
check_consistency(sym, ctx_list, tol=tol)
check_consistency(sym, ctx_list, tol=tol, grad_req="add")
# 2D deconvolution
sym = mx.sym.Deconvolution(num_filter=2, kernel=(3,3), name='deconv')
ctx_list = [{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float32}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float16}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float32}}]
# wider tolerance needed for true-fp16 test above
tol = {np.dtype(np.float16): 0.3,
np.dtype(np.float32): 1e-3,
np.dtype(np.float64): 1e-5,
np.dtype(np.uint8): 0,
np.dtype(np.int32): 0}
check_consistency(sym, ctx_list, tol=tol)
check_consistency(sym, ctx_list, tol=tol, grad_req="add")
@with_seed()
def test_deconvolution_options():
# 1D deconvolution
ctx_list = [{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float32}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float16}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 7), 'type_dict': {'deconv_data': np.float32}}]
# Pad > 0
sym = mx.sym.Deconvolution(layout='NCW', num_filter=3, kernel=(3,), pad=(1,), name='deconv')
sym_no_cudnn = mx.sym.Deconvolution(num_filter=3, kernel=(3,), pad=(1,), cudnn_off=True, name='deconv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Stride > 1
sym = mx.sym.Deconvolution(layout='NCW', num_filter=3, kernel=(3,), stride=(2,), name='deconv')
sym_no_cudnn = mx.sym.Deconvolution(num_filter=3, kernel=(3,), stride=(2,), cudnn_off=True, name='deconv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Dilate > 1
sym = mx.sym.Deconvolution(layout='NCW', num_filter=3, kernel=(3,), dilate=(2,), name='deconv')
sym_no_cudnn = mx.sym.Deconvolution(num_filter=3, kernel=(3,), dilate=(2,), cudnn_off=True, name='deconv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# 2D deconvolution
ctx_list = [{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float32}},
{'ctx': mx.gpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float16}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float64}},
{'ctx': mx.cpu(0), 'deconv_data': (2, 2, 10, 10), 'type_dict': {'deconv_data': np.float32}}]
# Pad > 0
sym = mx.sym.Deconvolution(num_filter=2, kernel=(3,3), pad=(1,1), name='deconv')
sym_no_cudnn = mx.sym.Deconvolution(num_filter=2, kernel=(3,3), pad=(1,1), cudnn_off=True, name='deconv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Stride > 1
sym = mx.sym.Deconvolution(num_filter=2, kernel=(3,3), stride=(2,2), name='deconv')
sym_no_cudnn = mx.sym.Deconvolution(num_filter=2, kernel=(3,3), stride=(2,2), cudnn_off=True, name='deconv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# Dilate > 1
sym = mx.sym.Deconvolution(num_filter=2, kernel=(3,3), dilate=(2,2), name='deconv')
sym_no_cudnn = mx.sym.Deconvolution(num_filter=2, kernel=(3,3), dilate=(2,2), cudnn_off=True, name='deconv')
check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# # 3D deconvolution (not yet enabled)
# ctx_list = [{'ctx': mx.cpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float64}},
# {'ctx': mx.cpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float64}},
# {'ctx': mx.gpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float64}},
# {'ctx': mx.gpu(0), 'conv_data': (2, 2, 5, 7, 7), 'type_dict': {'conv_data': np.float32}}]
# # Pad > 0
# sym = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), pad=(1,1,1), name='conv')
# sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), pad=(1,1,1), cudnn_off=True, name='conv')
# check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
# # Stride > 1
# sym = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), stride=(2,2,2), name='conv')
# sym_no_cudnn = mx.sym.Convolution(num_filter=3, kernel=(2,3,3), stride=(2,2,2), cudnn_off=True, name='conv')
# check_consistency_NxM([sym, sym_no_cudnn], ctx_list)
@with_seed(1234)
def test_bilinear_sampler_with_type():
data = mx.sym.Variable('data')
grid = mx.sym.Variable('grid')
sym = mx.sym.BilinearSampler(data=data, grid=grid)
ctx_list = [{'ctx': mx.gpu(0), 'data': (1, 5, 10, 10), 'grid': (1, 2, 10, 10),
'type_dict': {'data': np.float64}},
{'ctx': mx.gpu(0), 'data': (1, 5, 10, 10), 'grid': (1, 2, 10, 10),
'type_dict': {'data': np.float32}},
{'ctx': mx.gpu(0), 'data': (1, 5, 10, 10), 'grid': (1, 2, 10, 10),
'type_dict': {'data': np.float16}},
{'ctx': mx.cpu(0), 'data': (1, 5, 10, 10), 'grid': (1, 2, 10, 10),
'type_dict': {'data': np.float64}},
{'ctx': mx.cpu(0), 'data': (1, 5, 10, 10), 'grid': (1, 2, 10, 10),
'type_dict': {'data': np.float32}}]
check_consistency(sym, ctx_list)
check_consistency(sym, ctx_list, grad_req="add")
@with_seed()
def test_grid_generator_with_type():
data = mx.sym.Variable('data')
sym = mx.sym.GridGenerator(data=data, transform_type='affine', target_shape=(20, 20))
ctx_list = [{'ctx': mx.gpu(0), 'data': (3, 6), 'type_dict': {'data': np.float32}},
{'ctx': mx.cpu(0), 'data': (3, 6), 'type_dict': {'data': np.float32}}]
check_consistency(sym, ctx_list)
check_consistency(sym, ctx_list, grad_req="add")
sym = mx.sym.GridGenerator(data=data, transform_type='warp', target_shape=(20, 20))
ctx_list = [{'ctx': mx.gpu(0), 'data': (3, 2, 20, 20), 'type_dict': {'data': np.float32}},
{'ctx': mx.cpu(0), 'data': (3, 2, 20, 20), 'type_dict': {'data': np.float32}}]
check_consistency(sym, ctx_list)
check_consistency(sym, ctx_list, grad_req="add")
@unittest.skip("test fails intermittently. temporarily disabled till it gets fixed. tracked at https://github.com/apache/incubator-mxnet/issues/7645")
@with_seed(1234)
def test_spatial_transformer_with_type():
data = mx.sym.Variable('data')
loc = mx.sym.Flatten(data)
loc = mx.sym.FullyConnected(data=loc, num_hidden=10)
loc = mx.sym.Activation(data=loc, act_type='relu')
loc = mx.sym.FullyConnected(data=loc, num_hidden=6)
sym = mx.sym.SpatialTransformer(data=data, loc=loc, target_shape=(10, 10),
transform_type="affine", sampler_type="bilinear")
ctx_list = [{'ctx': mx.gpu(0), 'data': (1, 5, 10, 10), 'type_dict': {'data': np.float32}},
{'ctx': mx.cpu(0), 'data': (1, 5, 10, 10), 'type_dict': {'data': np.float32}}]
check_consistency(sym, ctx_list)
check_consistency(sym, ctx_list, grad_req="add")
# Checking max pooling consistency over the data sets of different float types is problematic
# as one max value in a float32 data set may not be the max value in a float16 data set.
# This function will not be called.
@with_seed(1234)
def test_pooling_with_type():
ctx_list = [{'ctx': mx.gpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float64}},
{'ctx': mx.gpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float32}},
{'ctx': mx.gpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float16}},
{'ctx': mx.cpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float64}},
{'ctx': mx.cpu(0), 'pool_data': (10, 2, 10, 10), 'type_dict': {'pool_data': np.float32}}]
sym = mx.sym.Pooling(name='pool', kernel=(3,3), stride=(2,2), pool_type='max')
check_consistency(sym, ctx_list)
sym = mx.sym.Pooling(name='pool', kernel=(3,3), pad=(1,1), pool_type='avg')
check_consistency(sym, ctx_list)
# this is unstable
# sym = mx.sym.Pooling(name='pool', kernel=(5,5), pad=(2,2), pool_type='max')
# check_consistency(sym, ctx_list)
sym = mx.sym.Pooling(name='pool', kernel=(3,3), pad=(1,1), pool_type='sum')
check_consistency(sym, ctx_list)
@with_seed()
def test_pooling_versions():
def test_pooling_versions_helper(pool_op_list, data, kernel, pool_type, pad, stride,
pooling_convention='valid', global_pool=False):
ctx_list = []
sym_list = []
# PoolingV1 cpu
if 'pool_v1_cpu' in pool_op_list:
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
if not global_pool:
sym_list.append(mx.sym.Pooling_v1(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, name='pool'))
else:
sym_list.append(mx.sym.Pooling_v1(kernel=kernel, pool_type=pool_type, global_pool=True, name='pool'))
# PoolingV1 gpu
if 'pool_v1_gpu' in pool_op_list:
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
if not global_pool:
sym_list.append(mx.sym.Pooling_v1(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, name='pool'))
else:
sym_list.append(mx.sym.Pooling_v1(kernel=kernel, pool_type=pool_type, global_pool=True, name='pool'))
# Pooling cpu
if 'pool_cpu' in pool_op_list:
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
if not global_pool:
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, name='pool'))
else:
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type, global_pool=True, name='pool'))
# Pooling gpu
if 'pool_gpu' in pool_op_list:
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
if not global_pool:
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, cudnn_off=True, name='pool'))
else:
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type, global_pool=True, cudnn_off=True,
name='pool'))
# CuDNNPooling
if 'pool_cudnn' in pool_op_list:
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
if not global_pool:
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, cudnn_off=False, name='pool'))
else:
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type, global_pool=True, cudnn_off=False,
name='pool'))
check_consistency(sym_list, ctx_list)
def test_1d_pooling(pool_type):
data = (2, 3, 20)
kernel = (4,)
pad = (0,)
stride = (1,)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='valid', global_pool=False)
pad = (2,)
stride = (2,)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='valid', global_pool=False)
pad = (0,)
stride = (1,)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='full', global_pool=False)
pad = (2,)
stride = (2,)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='full', global_pool=False)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
global_pool=True)
def test_2d_pooling(pool_type):
data = (2, 3, 20, 20)
kernel = (4, 5)
pad = (0, 0)
stride = (1, 1)
test_pooling_versions_helper(pool_op_list=['pool_v1_cpu', 'pool_v1_gpu', 'pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='valid', global_pool=False)
# pool_v1 has bugs when pad is not 0, do not test PoolingV1 here
pad = (2, 3)
stride = (2, 3)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='valid', global_pool=False)
pad = (0, 0)
stride = (1, 1)
test_pooling_versions_helper(pool_op_list=['pool_v1_cpu', 'pool_v1_gpu', 'pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='full', global_pool=False)
# pool_v1 has bugs when pad is not 0, do not test PoolingV1 here
pad = (2, 3)
stride = (2, 3)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='full', global_pool=False)
test_pooling_versions_helper(pool_op_list=['pool_v1_cpu', 'pool_v1_gpu', 'pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
global_pool=True)
def test_3d_pooling(pool_type):
data = (2, 3, 20, 20, 20)
kernel = (4, 5, 3)
pad = (0, 0, 0)
stride = (1, 1, 1)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='valid', global_pool=False)
pad = (2, 3, 3)
stride = (2, 3, 1)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='valid', global_pool=False)
pad = (0, 0, 0)
stride = (1, 1, 1)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='full', global_pool=False)
pad = (2, 3, 3)
stride = (2, 3, 1)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention='full', global_pool=False)
test_pooling_versions_helper(pool_op_list=['pool_cpu', 'pool_gpu', 'pool_cudnn'],
data=data, kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
global_pool=True)
test_1d_pooling('max')
test_1d_pooling('avg')
test_1d_pooling('sum')
test_2d_pooling('max')
test_2d_pooling('avg')
test_2d_pooling('sum')
test_3d_pooling('max')
test_3d_pooling('avg')
test_3d_pooling('sum')
@with_seed()
def test_global_pooling():
def test_1d_pooling(pool_type):
data = (2, 3, 20)
kernel = (4,)
pad = (2,)
stride = (2,)
ctx_list = []
sym_list = []
pooling_convention = 'valid'
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, name='pool'))
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=False, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=False, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=True, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=True, name='pool'))
check_consistency(sym_list, ctx_list)
def test_2d_pooling(pool_type):
data = (2, 3, 20, 20)
kernel = (4, 4)
pad = (2, 2)
stride = (2, 2)
ctx_list = []
sym_list = []
pooling_convention = 'valid'
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling_v1(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, name='pool'))
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling_v1(kernel=kernel, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, name='pool'))
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, name='pool'))
ctx_list.append({'ctx': mx.cpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=False, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=False, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pad=pad, stride=stride, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=True, name='pool'))
ctx_list.append({'ctx': mx.gpu(0), 'pool_data': data, 'type_dict': {'pool_data': np.float32}})
sym_list.append(mx.sym.Pooling(kernel=kernel, pool_type=pool_type,
pooling_convention=pooling_convention, global_pool=True, cudnn_off=True, name='pool'))
check_consistency(sym_list, ctx_list)
test_1d_pooling('max')
test_1d_pooling('avg')
test_1d_pooling('sum')
test_2d_pooling('max')
test_2d_pooling('avg')
test_2d_pooling('sum')
@with_seed()
def test_upsampling_with_type():
sym = mx.sym.UpSampling(scale=2, num_filter=2, name='up', sample_type='nearest', num_args=1)
ctx_list = [{'ctx': mx.gpu(0), 'up_arg0': (2, 2, 2, 10), 'type_dict': {'up_arg0': np.float64}},
{'ctx': mx.gpu(0), 'up_arg0': (2, 2, 2, 10), 'type_dict': {'up_arg0': np.float32}},
{'ctx': mx.gpu(0), 'up_arg0': (2, 2, 2, 10), 'type_dict': {'up_arg0': np.float16}},
{'ctx': mx.cpu(0), 'up_arg0': (2, 2, 2, 10), 'type_dict': {'up_arg0': np.float64}},
{'ctx': mx.cpu(0), 'up_arg0': (2, 2, 2, 10), 'type_dict': {'up_arg0': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_upsampling_bilinear_with_type():
sym = mx.sym.UpSampling(scale=2, num_filter=2, name='up', sample_type='bilinear', num_args=1)
ctx_list = [{'ctx': mx.gpu(0), 'up_data': (2, 2, 2, 10), 'type_dict': {'up_data': np.float64}},
{'ctx': mx.gpu(0), 'up_data': (2, 2, 2, 10), 'type_dict': {'up_data': np.float32}},
{'ctx': mx.gpu(0), 'up_data': (2, 2, 2, 10), 'type_dict': {'up_data': np.float16}},
{'ctx': mx.cpu(0), 'up_data': (2, 2, 2, 10), 'type_dict': {'up_data': np.float64}},
{'ctx': mx.cpu(0), 'up_data': (2, 2, 2, 10), 'type_dict': {'up_data': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_concat_with_type():
sym = mx.sym.Concat(name='concat', num_args=2)
ctx_list = [{'ctx': mx.gpu(0), 'concat_arg1': (2, 10), 'concat_arg0': (2, 10),
'type_dict': {'concat_arg0': np.float64, 'concat_arg1': np.float64}},
{'ctx': mx.gpu(0), 'concat_arg1': (2, 10), 'concat_arg0': (2, 10),
'type_dict': {'concat_arg0': np.float32, 'concat_arg1': np.float32}},
{'ctx': mx.gpu(0), 'concat_arg1': (2, 10), 'concat_arg0': (2, 10),
'type_dict': {'concat_arg0': np.float16, 'concat_arg1': np.float16}},
{'ctx': mx.cpu(0), 'concat_arg1': (2, 10), 'concat_arg0': (2, 10),
'type_dict': {'concat_arg0': np.float64, 'concat_arg1': np.float64}},
{'ctx': mx.cpu(0), 'concat_arg1': (2, 10), 'concat_arg0': (2, 10),
'type_dict': {'concat_arg0': np.float32, 'concat_arg1': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_elementwisesum_with_type():
dev_types = [[mx.gpu(0), [np.float64, np.float32, np.float16]],
[mx.cpu(0), [np.float64, np.float32]] ]
for num_args in range(1, 6):
ews_arg_shape = {}
for i in range(num_args):
ews_arg_shape['ews_arg'+str(i)] = (2, 10)
sym = mx.sym.ElementWiseSum(name='ews', num_args=num_args)
ctx_list = []
for dev, types in dev_types:
for dtype in types:
ews_arg_dtype = {'type_dict':{}}
for i in range(num_args):
ews_arg_dtype['type_dict']['ews_arg'+str(i)] = dtype
ctx_elem = {'ctx': dev}
ctx_elem.update(ews_arg_shape)
ctx_elem.update(ews_arg_dtype)
ctx_list.append(ctx_elem)
check_consistency(sym, ctx_list)
@with_seed()
def test_reshape_with_type():
sym = mx.sym.Reshape(name='reshape', shape=(-1,1,1,0))
ctx_list = [{'ctx': mx.gpu(0), 'reshape_data': (2, 2, 2, 10), 'type_dict': {'reshape_data': np.float64}},
{'ctx': mx.gpu(0), 'reshape_data': (2, 2, 2, 10), 'type_dict': {'reshape_data': np.float32}},
{'ctx': mx.gpu(0), 'reshape_data': (2, 2, 2, 10), 'type_dict': {'reshape_data': np.float16}},
{'ctx': mx.cpu(0), 'reshape_data': (2, 2, 2, 10), 'type_dict': {'reshape_data': np.float64}},
{'ctx': mx.cpu(0), 'reshape_data': (2, 2, 2, 10), 'type_dict': {'reshape_data': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_blockgrad_with_type():
sym = mx.sym.BlockGrad(name='bg')
ctx_list = [{'ctx': mx.gpu(0), 'bg_data': (2, 2, 2, 10), 'type_dict': {'bg_data': np.float64}},
{'ctx': mx.gpu(0), 'bg_data': (2, 2, 2, 10), 'type_dict': {'bg_data': np.float32}},
{'ctx': mx.gpu(0), 'bg_data': (2, 2, 2, 10), 'type_dict': {'bg_data': np.float16}},
{'ctx': mx.cpu(0), 'bg_data': (2, 2, 2, 10), 'type_dict': {'bg_data': np.float64}},
{'ctx': mx.cpu(0), 'bg_data': (2, 2, 2, 10), 'type_dict': {'bg_data': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_swapaxis_with_type():
sym = mx.sym.SwapAxis(name='swap', dim1=1)
ctx_list = [{'ctx': mx.gpu(0), 'swap_data': (2, 2, 2, 10), 'type_dict': {'swap_data': np.float64}},
{'ctx': mx.gpu(0), 'swap_data': (2, 2, 2, 10), 'type_dict': {'swap_data': np.float32}},
{'ctx': mx.gpu(0), 'swap_data': (2, 2, 2, 10), 'type_dict': {'swap_data': np.float16}},
{'ctx': mx.cpu(0), 'swap_data': (2, 2, 2, 10), 'type_dict': {'swap_data': np.float64}},
{'ctx': mx.cpu(0), 'swap_data': (2, 2, 2, 10), 'type_dict': {'swap_data': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_fullyconnected_with_type():
sym = mx.sym.FullyConnected(num_hidden=3, name='inner')
ctx_list = [{'ctx': mx.gpu(0), 'inner_data': (2, 10), 'type_dict': {'inner_data': np.float64}},
{'ctx': mx.gpu(0), 'inner_data': (2, 10), 'type_dict': {'inner_data': np.float32}},
{'ctx': mx.gpu(0), 'inner_data': (2, 10), 'type_dict': {'inner_data': np.float16}},
{'ctx': mx.cpu(0), 'inner_data': (2, 10), 'type_dict': {'inner_data': np.float64}},
{'ctx': mx.cpu(0), 'inner_data': (2, 10), 'type_dict': {'inner_data': np.float32}}]
check_consistency(sym, ctx_list)
# Sizes are divisible by 8 to test TensorCore on Volta GPU.
sym = mx.sym.FullyConnected(num_hidden=8, name='inner')
ctx_list = [{'ctx': mx.gpu(0), 'inner_data': (16, 24), 'type_dict': {'inner_data': np.float16}},
{'ctx': mx.cpu(0), 'inner_data': (16, 24), 'type_dict': {'inner_data': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_activation_with_type():
sym = mx.sym.Activation(name='act', act_type='sigmoid')
ctx_list = [{'ctx': mx.gpu(0), 'act_data': (2, 2, 10, 10), 'type_dict': {'act_data': np.float64}},
{'ctx': mx.gpu(0), 'act_data': (2, 2, 10, 10), 'type_dict': {'act_data': np.float32}},
{'ctx': mx.gpu(0), 'act_data': (2, 2, 10, 10), 'type_dict': {'act_data': np.float16}},
{'ctx': mx.cpu(0), 'act_data': (2, 2, 10, 10), 'type_dict': {'act_data': np.float64}},
{'ctx': mx.cpu(0), 'act_data': (2, 2, 10, 10), 'type_dict': {'act_data': np.float32}},
{'ctx': mx.cpu(0), 'act_data': (2, 2, 10, 10), 'type_dict': {'act_data': np.float16}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_lrn():
sym = mx.sym.LRN(alpha=0.0001, beta=0.75, knorm=2, nsize=5, name='lrn')
ctx_list = [{'ctx': mx.gpu(0), 'lrn_data': (2, 6, 10, 10), 'type_dict': {'lrn_data': np.float32}},
{'ctx': mx.cpu(0), 'lrn_data': (2, 6, 10, 10), 'type_dict': {'lrn_data': np.float32}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_embedding_with_type():
def test_embedding_helper(data_types, weight_types, low_pad, high_pad):
NVD = [[20, 10, 20], [200, 10, 300]]
for N, V, D in NVD:
sym = mx.sym.Embedding(name='embedding', input_dim=V, output_dim=D)
ctx_list = []
for data_type in data_types:
for weight_type in weight_types:
ctx_list.append({'ctx': mx.gpu(0), 'embedding_data': (N,),
'type_dict': {'embedding_data': data_type, 'embedding_weight': weight_type}})
ctx_list.append({'ctx': mx.cpu(0), 'embedding_data': (N,),
'type_dict': {'embedding_data': data_type, 'embedding_weight': weight_type}})
arg_params = {'embedding_data': np.random.randint(low=-low_pad, high=V+high_pad, size=(N,))}
check_consistency(sym, ctx_list, grad_req={'embedding_data': 'null','embedding_weight': 'write'},
arg_params=arg_params)
data_types = [np.float16, np.float32, np.float64, np.int32]
weight_types = [np.float16, np.float32, np.float64]
test_embedding_helper(data_types, weight_types, 5, 5)
data_types = [np.uint8]
weight_types = [np.float16, np.float32, np.float64]
test_embedding_helper(data_types, weight_types, 0, 5)
@unittest.skip("test fails intermittently. temporarily disabled till it gets fixed. tracked at https://github.com/apache/incubator-mxnet/issues/8288")
@with_seed()
def test_svmoutput_with_type():
sym = mx.sym.SVMOutput(name='svmoutput', use_linear=True)
ctx_list = [{'ctx': mx.gpu(0), 'svmoutput_data': (20, 10), 'type_dict': {'svmoutput_data': np.float64}},
{'ctx': mx.gpu(0), 'svmoutput_data': (20, 10), 'type_dict': {'svmoutput_data': np.float32}},
{'ctx': mx.gpu(0), 'svmoutput_data': (20, 10), 'type_dict': {'svmoutput_data': np.float16}},
{'ctx': mx.cpu(0), 'svmoutput_data': (20, 10), 'type_dict': {'svmoutput_data': np.float64}},
{'ctx': mx.cpu(0), 'svmoutput_data': (20, 10), 'type_dict': {'svmoutput_data': np.float32}},
{'ctx': mx.cpu(0), 'svmoutput_data': (20, 10), 'type_dict': {'svmoutput_data': np.float16}}]
check_consistency(sym, ctx_list)
@with_seed()
def test_take_with_type():
sym = mx.sym.take(name='take')
for data_ndim in range(2, 5):
for idx_ndim in range(1, 4):
data_shape = ()
for _ in range(data_ndim):
data_shape += (np.random.randint(low=3, high=6), )
idx_shape = ()
for _ in range(idx_ndim):
idx_shape += (np.random.randint(low=3, high=5), )
ctx_list = [{'ctx': mx.gpu(0), 'take_indices': idx_shape,
'take_a': data_shape,
'type_dict': {'take_indices': np.float64,
'take_a': np.float64}},
{'ctx': mx.gpu(0), 'take_indices': idx_shape,
'take_a': data_shape,
'type_dict': {'take_indices': np.float32,
'take_a': np.float32}},
{'ctx': mx.gpu(0), 'take_indices': idx_shape,
'take_a': data_shape,
'type_dict': {'take_indices': np.float16,
'take_a': np.float16}},
{'ctx': mx.cpu(0), 'take_indices': idx_shape,
'take_a': data_shape,
'type_dict': {'take_indices': np.float64,
'take_a': np.float64}},
{'ctx': mx.cpu(0), 'take_indices': idx_shape,
'take_a': data_shape,
'type_dict': {'take_indices': np.float32,
'take_a': np.float32}},
{'ctx': mx.cpu(0), 'take_indices': idx_shape,
'take_a': data_shape,
'type_dict': {'take_indices': np.float16,
'take_a': np.float16}}]
arg_params = {'take_indices': np.random.randint(low=0,
high=data_shape[0],
size=idx_shape),
'take_a': np.random.normal(size=data_shape)}
check_consistency(sym, ctx_list,
grad_req={'take_indices': 'null',
'take_a': 'write'},
arg_params=arg_params)
def check_rnn_consistency(cell1, cell2):
dshape = (32, 5, 200)
data = mx.sym.Variable('data')
sym1, _ = cell1.unroll(5, data, merge_outputs=True)
mod1 = mx.mod.Module(sym1, label_names=None, context=mx.gpu(0))
mod1.bind(data_shapes=[('data', dshape)], label_shapes=None)
sym2, _ = cell2.unroll(5, data, merge_outputs=True)
mod2 = mx.mod.Module(sym2, label_names=None, context=mx.gpu(0))
mod2.bind(data_shapes=[('data', dshape)], label_shapes=None)
mod1.init_params()
args, auxs = mod1.get_params()
args = cell1.unpack_weights(args)
args = cell2.pack_weights(args)
mod2.set_params(args, auxs)
batch=mx.io.DataBatch(data=[mx.random.uniform(shape=dshape)], label=[])
mod1.forward(batch, is_train=False)
mod2.forward(batch, is_train=False)
assert_allclose(mod1.get_outputs()[0].asnumpy(), mod2.get_outputs()[0].asnumpy(), rtol=1e-2, atol=1e-4)
@with_seed()
def test_rnn():
fused = mx.rnn.FusedRNNCell(100, num_layers=2, mode='rnn_relu', prefix='')
stack = mx.rnn.SequentialRNNCell()
stack.add(mx.rnn.RNNCell(100, activation='relu', prefix='l0_'))
stack.add(mx.rnn.RNNCell(100, activation='relu', prefix='l1_'))
check_rnn_consistency(fused, stack)
check_rnn_consistency(stack, fused)
@with_seed()
def test_lstm():
fused = mx.rnn.FusedRNNCell(100, num_layers=2, mode='lstm', prefix='')
stack = mx.rnn.SequentialRNNCell()
stack.add(mx.rnn.LSTMCell(100, prefix='l0_'))
stack.add(mx.rnn.LSTMCell(100, prefix='l1_'))
check_rnn_consistency(fused, stack)
check_rnn_consistency(stack, fused)
@with_seed()
def test_lstm_forget_bias():
forget_bias = 2.0
fused = mx.rnn.FusedRNNCell(10, forget_bias=forget_bias, num_layers=2, mode='lstm', prefix='')
dshape = (32, 1, 20)
data = mx.sym.Variable('data')
sym, _ = fused.unroll(1, data, merge_outputs=True)
mod = mx.mod.Module(sym, label_names=None, context=mx.gpu(0))
mod.bind(data_shapes=[('data', dshape)], label_shapes=None)
mod.init_params()
args, auxs = mod.get_params()
args = fused.unpack_weights(args)
bias_name = next(x for x in args if x.endswith('f_bias'))
expected_bias = forget_bias * np.ones(10, )
assert_allclose(args[bias_name].asnumpy(), expected_bias)
@with_seed()
def test_gru():
fused = mx.rnn.FusedRNNCell(100, num_layers=2, mode='gru', prefix='')
stack = mx.rnn.SequentialRNNCell()
stack.add(mx.rnn.GRUCell(100, prefix='l0_'))
stack.add(mx.rnn.GRUCell(100, prefix='l1_'))
check_rnn_consistency(fused, stack)
check_rnn_consistency(stack, fused)
@with_seed()
def test_bidirectional():
fused = mx.rnn.FusedRNNCell(100, num_layers=2, mode='gru', prefix='',
bidirectional=True)
stack = mx.rnn.SequentialRNNCell()
stack.add(mx.rnn.BidirectionalCell(
mx.rnn.GRUCell(100, prefix='l0_'),
mx.rnn.GRUCell(100, prefix='r0_'),
output_prefix='bi_gru_0_'))
stack.add(mx.rnn.BidirectionalCell(
mx.rnn.GRUCell(100, prefix='l1_'),
mx.rnn.GRUCell(100, prefix='r1_'),
output_prefix='bi_gru_1_'))
check_rnn_consistency(fused, stack)
check_rnn_consistency(stack, fused)
@with_seed()
def test_unfuse():
for mode in ['rnn_tanh', 'rnn_relu', 'lstm', 'gru']:
fused = mx.rnn.FusedRNNCell(
100, num_layers=2, mode=mode,
prefix='test_%s'%mode,
bidirectional=True,
dropout=0.5)
stack = fused.unfuse()
check_rnn_consistency(fused, stack)
check_rnn_consistency(stack, fused)
@with_seed(1234)
def test_psroipooling_with_type():
arg_params = {
'psroipool_rois': np.array([[0, 10, 22, 161, 173], [0, 20, 15, 154, 160]])}
# plain psroipooling
sym = mx.sym.contrib.PSROIPooling(spatial_scale=0.0625, output_dim=2, pooled_size=3, name='psroipool')
ctx_list = [{'ctx': mx.gpu(0),
'psroipool_data': (1, 18, 14, 14),
'psroipool_rois': (2, 5),
'type_dict': {'psroipool_data': np.float64, 'psroipool_rois': np.float64}},
{'ctx': mx.gpu(0),
'psroipool_data': (1, 18, 14, 14),
'psroipool_rois': (2, 5),
'type_dict': {'psroipool_data': np.float32, 'psroipool_rois': np.float32}},
{'ctx': mx.gpu(0),
'psroipool_data': (1, 18, 14, 14),
'psroipool_rois': (2, 5),
'type_dict': {'psroipool_data': np.float16, 'psroipool_rois': np.float16}},
]
check_consistency(sym, ctx_list, grad_req={'psroipool_data': 'write',
'psroipool_rois': 'null'}, arg_params=arg_params)
@with_seed(1234)
def test_deformable_psroipooling_with_type():
arg_params = {
'deformable_psroipool_rois': np.array([[0, 10, 22, 161, 173], [0, 20, 15, 154, 160]])}
# deformable psroipooling
sym = mx.sym.contrib.DeformablePSROIPooling(spatial_scale=0.0625, sample_per_part=4, group_size=3, pooled_size=3,
output_dim=2, trans_std=0.1, no_trans=False, name='deformable_psroipool')
ctx_list = [{'ctx': mx.gpu(0),
'deformable_psroipool_data': (1, 18, 14, 14),
'deformable_psroipool_rois': (2, 5),
'deformable_psroipool_trans': (2, 4, 3, 3),
'type_dict': {'deformable_psroipool_data': np.float64, 'deformable_psroipool_rois': np.float64,
'deformable_psroipool_trans': np.float64}},
{'ctx': mx.gpu(0),
'deformable_psroipool_data': (1, 18, 14, 14),
'deformable_psroipool_rois': (2, 5),
'deformable_psroipool_trans': (2, 4, 3, 3),
'type_dict': {'deformable_psroipool_data': np.float32, 'deformable_psroipool_rois': np.float32,
'deformable_psroipool_trans': np.float32}},
{'ctx': mx.gpu(0),
'deformable_psroipool_data': (1, 18, 14, 14),
'deformable_psroipool_rois': (2, 5),
'deformable_psroipool_trans': (2, 4, 3, 3),
'type_dict': {'deformable_psroipool_data': np.float16, 'deformable_psroipool_rois': np.float16,
'deformable_psroipool_trans': np.float16}},
]
check_consistency(sym, ctx_list, grad_req={'deformable_psroipool_data': 'write',
'deformable_psroipool_rois': 'null',
'deformable_psroipool_trans': 'write'}, arg_params=arg_params)
@with_seed(1234)
def test_deformable_convolution_with_type():
sym = mx.sym.contrib.DeformableConvolution(num_filter=3, kernel=(3,3), name='deformable_conv')
# since atomicAdd does not support fp16 (which deformable conv uses in backward), we do not test fp16 here
ctx_list = [{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 10, 10),
'deformable_conv_offset': (2, 18, 8, 8),
'type_dict': {'deformable_conv_data': np.float64, 'deformable_conv_offset': np.float64}},
{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 10, 10),
'deformable_conv_offset': (2, 18, 8, 8),
'type_dict': {'deformable_conv_data': np.float32, 'deformable_conv_offset': np.float32}},
# {'ctx': mx.gpu(0),
# 'deformable_conv_data': (2, 2, 10, 10),
# 'deformable_conv_offset': (2, 18, 8, 8),
# 'type_dict': {'deformable_conv_data': np.float16, 'deformable_conv_offset': np.float16}},
]
# wider tolerance needed for true-fp16 NCHW test above
tol = {np.dtype(np.float16): 0.5,
np.dtype(np.float32): 1e-3,
np.dtype(np.float64): 1e-5,
np.dtype(np.uint8): 0,
np.dtype(np.int32): 0}
check_consistency(sym, ctx_list, tol=tol)
# test ability to turn off training on bias
check_consistency(sym, ctx_list, grad_req={'deformable_conv_data': 'write',
'deformable_conv_offset': 'write',
'deformable_conv_weight': 'write',
'deformable_conv_bias': 'null'}, tol=tol)
@with_seed()
def test_deformable_convolution_options():
# 2D convolution
# Pad > 0
# since atomicAdd does not support fp16 (which deformable conv uses in backward), we do not test fp16 here
ctx_list = [{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 18, 7, 7),
'type_dict': {'deformable_conv_data': np.float64, 'deformable_conv_offset': np.float64}},
{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 18, 7, 7),
'type_dict': {'deformable_conv_data': np.float32, 'deformable_conv_offset': np.float32}},
# {'ctx': mx.gpu(0),
# 'deformable_conv_data': (2, 2, 7, 7),
# 'deformable_offset': (2, 18, 7, 7),
# 'type_dict': {'deformable_conv_data': np.float16, 'deformable_offset': np.float16}},
]
sym = mx.sym.contrib.DeformableConvolution(num_filter=3, kernel=(3,3), pad=(1,1), name='deformable_conv')
check_consistency(sym, ctx_list)
# Stride > 1
# since atomicAdd does not support fp16 (which deformable conv uses in backward), we do not test fp16 here
ctx_list = [{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 18, 3, 3),
'type_dict': {'deformable_conv_data': np.float64, 'deformable_conv_offset': np.float64}},
{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 18, 3, 3),
'type_dict': {'deformable_conv_data': np.float32, 'deformable_conv_offset': np.float32}},
# {'ctx': mx.gpu(0),
# 'deformable_conv_data': (2, 2, 7, 7),
# 'deformable_conv_offset': (2, 18, 3, 3),
# 'type_dict': {'deformable_conv_data': np.float16, 'deformable_offset': np.float16}},
]
sym = mx.sym.contrib.DeformableConvolution(num_filter=3, kernel=(3,3), stride=(2,2), name='deformable_conv')
check_consistency(sym, ctx_list)
# Dilate > 1
# since atomicAdd does not support fp16 (which deformable conv uses in backward), we do not test fp16 here
ctx_list = [{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 18, 3, 3),
'type_dict': {'deformable_conv_data': np.float64, 'deformable_conv_offset': np.float64}},
{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 18, 3, 3),
'type_dict': {'deformable_conv_data': np.float32, 'deformable_conv_offset': np.float32}},
# {'ctx': mx.gpu(0),
# 'deformable_conv_data': (2, 2, 7, 7),
# 'deformable_conv_offset': (2, 18, 3, 3),
# 'type_dict': {'deformable_conv_data': np.float16, 'deformable_offset': np.float16}},
]
sym = mx.sym.contrib.DeformableConvolution(num_filter=3, kernel=(3,3), dilate=(2,2), name='deformable_conv')
check_consistency(sym, ctx_list)
# Deformable group > 1
# since atomicAdd does not support fp16 (which deformable conv uses in backward), we do not test fp16 here
ctx_list = [{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 36, 5, 5),
'type_dict': {'deformable_conv_data': np.float64, 'deformable_conv_offset': np.float64}},
{'ctx': mx.gpu(0),
'deformable_conv_data': (2, 2, 7, 7),
'deformable_conv_offset': (2, 36, 5, 5),
'type_dict': {'deformable_conv_data': np.float32, 'deformable_conv_offset': np.float32}},
# {'ctx': mx.gpu(0),
# 'deformable_conv_data': (2, 2, 7, 7),
# 'deformable_conv_offset': (2, 36, 5, 5),
# 'type_dict': {'deformable_conv_data': np.float16, 'deformable_offset': np.float16}},
]
sym = mx.sym.contrib.DeformableConvolution(num_filter=4, kernel=(3,3), num_deformable_group=2,
name='deformable_conv')
@with_seed()
def test_residual_fused():
cell = mx.rnn.ResidualCell(
mx.rnn.FusedRNNCell(50, num_layers=3, mode='lstm',
prefix='rnn_', dropout=0.5))
inputs = [mx.sym.Variable('rnn_t%d_data'%i) for i in range(2)]
outputs, _ = cell.unroll(2, inputs, merge_outputs=None)
assert sorted(cell.params._params.keys()) == \
['rnn_parameters']
args, outs, auxs = outputs.infer_shape(rnn_t0_data=(10, 50), rnn_t1_data=(10, 50))
assert outs == [(10, 2, 50)]
outputs = outputs.eval(ctx=mx.gpu(0),
rnn_t0_data=mx.nd.ones((10, 50), ctx=mx.gpu(0))+5,
rnn_t1_data=mx.nd.ones((10, 50), ctx=mx.gpu(0))+5,
rnn_parameters=mx.nd.zeros((61200,), ctx=mx.gpu(0)))
expected_outputs = np.ones((10, 2, 50))+5
assert np.array_equal(outputs[0].asnumpy(), expected_outputs)
def check_rnn_layer(layer):
layer.collect_params().initialize(ctx=[mx.cpu(0), mx.gpu(0)])
with mx.gpu(0):
x = mx.nd.ones((10, 16, 30))
states = layer.begin_state(16)
go, gs = layer(x, states)
with mx.cpu(0):
x = mx.nd.ones((10, 16, 30))
states = layer.begin_state(16)
co, cs = layer(x, states)
# atol of 1e-6 required, as exposed by seed 2124685726
assert_almost_equal(go.asnumpy(), co.asnumpy(), rtol=1e-2, atol=1e-6)
for g, c in zip(gs, cs):
assert_almost_equal(g.asnumpy(), c.asnumpy(), rtol=1e-2, atol=1e-6)
def check_rnn_layer_w_rand_inputs(layer):
layer.collect_params().initialize(ctx=[mx.cpu(0), mx.gpu(0)])
x = mx.nd.uniform(shape=(10, 16, 30))
with mx.gpu(0):
x = x.copyto(mx.gpu(0))
states = layer.begin_state(16)
go, gs = layer(x, states)
with mx.cpu(0):
x = x.copyto(mx.cpu(0))
states = layer.begin_state(16)
co, cs = layer(x, states)
assert_almost_equal(go.asnumpy(), co.asnumpy(), rtol=1e-2, atol=1e-6)
for g, c in zip(gs, cs):
assert_almost_equal(g.asnumpy(), c.asnumpy(), rtol=1e-2, atol=1e-6)
@with_seed()
def test_rnn_layer():
check_rnn_layer(gluon.rnn.RNN(100, num_layers=3))
check_rnn_layer(gluon.rnn.RNN(100, activation='tanh', num_layers=3))
check_rnn_layer(gluon.rnn.LSTM(100, num_layers=3))
check_rnn_layer(gluon.rnn.GRU(100, num_layers=3))
check_rnn_layer(gluon.rnn.LSTM(100, num_layers=3, bidirectional=True))
check_rnn_layer_w_rand_inputs(gluon.rnn.LSTM(100, num_layers=3, bidirectional=True))
@with_seed()
def test_sequence_reverse():
check_sequence_reverse(mx.gpu(0))
@unittest.skip("Test fails intermittently. Temporarily disabled until fixed. Tracked at https://github.com/apache/incubator-mxnet/issues/8211")
@with_seed()
def test_autograd_save_memory():
x = mx.nd.zeros((128, 512, 512), ctx=mx.gpu(0))
x.attach_grad()
with mx.autograd.record():
for i in range(200):
x = x + 1
x.wait_to_read()
x.backward()
@with_seed()
def test_gluon_ctc_consistency():
loss = mx.gluon.loss.CTCLoss()
data = mx.nd.arange(0, 4, repeat=40, ctx=mx.gpu(0)).reshape((2,20,4)).flip(axis=0)
cpu_label = mx.nd.array([[2,1,-1,-1],[3,2,2,-1]], ctx=mx.cpu(0))
gpu_label = mx.nd.array([[2,1,-1,-1],[3,2,2,-1]], ctx=mx.gpu(0))
cpu_data = data.copy().as_in_context(mx.cpu(0))
cpu_data.attach_grad()
with mx.autograd.record():
l_cpu = loss(cpu_data, cpu_label)
l_cpu.backward()
gpu_data = data.copyto(mx.gpu(0))
gpu_data.attach_grad()
with mx.autograd.record():
l_gpu = loss(gpu_data, gpu_label)
l_gpu.backward()
assert_almost_equal(cpu_data.grad.asnumpy(), gpu_data.grad.asnumpy(), atol=1e-3, rtol=1e-3)
@with_seed()
def test_cuda_rtc():
source = r'''
extern "C" __global__ void axpy(const float *x, float *y, float alpha) {
int i = threadIdx.x + blockIdx.x * blockDim.x;
y[i] += alpha * x[i];
}
extern "C" __global__ void saxpy(const float *x, float *y, float alpha) {
extern __shared__ float smem[];
int i = threadIdx.x + blockIdx.x * blockDim.x;
smem[threadIdx.x] = x[i];
y[i] += alpha * smem[threadIdx.x];
}
'''
module = mx.rtc.CudaModule(source)
axpy = module.get_kernel("axpy", "const float *x, float *y, float alpha")
x = mx.nd.ones((10,), ctx=mx.gpu(0))
y = mx.nd.zeros((10,), ctx=mx.gpu(0))
axpy.launch([x, y, 3.0], mx.gpu(0), (1, 1, 1), (10, 1, 1))
assert (y.asnumpy() == 3).all()
saxpy = module.get_kernel("saxpy", "const float *x, float *y, float alpha")
saxpy.launch([x, y, 4.0], mx.gpu(0), (1, 1, 1), (10, 1, 1), 10)
assert (y.asnumpy() == 7).all()
saxpy.launch([x, y, 5.0], mx.gpu(0), (2, 1, 1), (5, 1, 1), 5)
assert (y.asnumpy() == 12).all()
@with_seed()
def test_global_norm_clip_multi_device():
x1 = mx.nd.ones((3,3), ctx=mx.gpu(0))
x2 = mx.nd.ones((4,4), ctx=mx.cpu(0))
norm = gluon.utils.clip_global_norm([x1, x2], 1.0)
assert norm == 5.0
assert_almost_equal(x1.asnumpy(), np.ones((3,3))/5)
assert_almost_equal(x2.asnumpy(), np.ones((4,4))/5)
@with_seed()
def test_cross_device_autograd():
x = mx.nd.random.uniform(shape=(10,))
x.attach_grad()
with mx.autograd.record():
y = mx.nd.tanh(x)
y = y.copyto(mx.gpu(0))
y = mx.nd.tanh(y)
y = y.copyto(mx.cpu(0))
y = mx.nd.tanh(y)
y = y.copyto(mx.gpu(0))
y = y.copyto(mx.gpu(0))
y.backward()
dx = x.grad.asnumpy()
x.grad[:] = 0
with mx.autograd.record():
y = x
for i in range(3):
y = mx.nd.tanh(y)
y.backward()
assert_almost_equal(dx, x.grad.asnumpy())
@unittest.skip("JIRA issue: https://issues.apache.org/jira/projects/MXNET/issues/MXNET-130")
@with_seed()
def test_multi_proposal_op():
# paramters
feature_stride = 16
scales = (8, 16, 32)
ratios = (0.5, 1, 2)
rpn_pre_nms_top_n = 12000
rpn_post_nms_top_n = 2000
threshold = 0.7
rpn_min_size = feature_stride
feat_len = (1000 + 15) // 16
H, W = feat_len, feat_len
num_anchors = len(scales) * len(ratios)
count_anchors = H * W * num_anchors
def get_new_data(batch_size, ctx):
'''
cls_prob: (batch_size, 2 * num_anchors, H, W)
bbox_pred: (batch_size, 4 * num_anchors, H, W)
im_info: (batch_size, 3)
'''
dtype = np.float32
cls_prob = mx.nd.empty((batch_size, 2 * num_anchors, H, W), dtype = dtype, ctx = ctx)
bbox_pred = mx.nd.empty((batch_size, 4 * num_anchors, H, W), dtype = dtype, ctx = ctx)
im_info = mx.nd.empty((batch_size, 3), dtype = dtype, ctx = ctx)
cls = [1.0 * (i + 1) / cls_prob.size for i in range(cls_prob.size)]
np.random.shuffle(cls)
cls_prob = mx.nd.reshape(mx.nd.array(cls, dtype = dtype, ctx = ctx), shape = cls_prob.shape)
bbox_pred = mx.nd.array(np.random.randint(-2, 3, size = bbox_pred.shape), dtype = dtype, ctx = ctx)
for i in range(batch_size):
im_size = np.random.randint(600, feat_len * feature_stride, size = (2,))
im_scale = np.random.randint(80, 100) / 100.0
im_info[i, :] = [im_size[0], im_size[1], im_scale]
return cls_prob, bbox_pred, im_info
def check_proposal_consistency(op, batch_size):
'''
op is mx.nd.contrib.Proposal or mx.nd.contrib.MultiProposal
'''
cls_prob, bbox_pred, im_info = get_new_data(batch_size, mx.cpu(0))
rois_cpu, score_cpu = op(
cls_score = cls_prob,
bbox_pred = bbox_pred,
im_info = im_info,
feature_stride = feature_stride,
scales = scales,
ratios = ratios,
rpn_pre_nms_top_n = rpn_pre_nms_top_n,
rpn_post_nms_top_n = rpn_post_nms_top_n,
threshold = threshold,
rpn_min_size = rpn_min_size, output_score = True)
gpu_ctx = mx.gpu(0)
# copy data to gpu from cpu
cls_prob_gpu = cls_prob.as_in_context(gpu_ctx)
bbox_pred_gpu = bbox_pred.as_in_context(gpu_ctx)
im_info_gpu = im_info.as_in_context(gpu_ctx)
rois_gpu, score_gpu = op(
cls_score = cls_prob_gpu,
bbox_pred = bbox_pred_gpu,
im_info = im_info_gpu,
feature_stride = feature_stride,
scales = scales,
ratios = ratios,
rpn_pre_nms_top_n = rpn_pre_nms_top_n,
rpn_post_nms_top_n = rpn_post_nms_top_n,
threshold = threshold,
rpn_min_size = rpn_min_size, output_score = True)
rois_cpu_np = rois_cpu.asnumpy()
rois_gpu_np = rois_gpu.asnumpy()
score_cpu_np = score_cpu.asnumpy()
score_gpu_np = score_gpu.asnumpy()
assert_almost_equal(score_cpu_np, score_gpu_np, atol = 1e-3, rtol = 1e-3)
assert_almost_equal(rois_cpu_np, rois_gpu_np, atol = 1e-3, rtol = 1e-3)
check_proposal_consistency(mx.nd.contrib.Proposal, 1)
check_proposal_consistency(mx.nd.contrib.MultiProposal, 20)
# The following 2 functions launch 0-thread kernels, an error that should be caught and signaled.
def kernel_error_check_imperative():
os.environ['MXNET_ENGINE_TYPE'] = 'NaiveEngine'
a = mx.nd.array([1,2,3],ctx=mx.gpu(0))
b = mx.nd.array([],ctx=mx.gpu(0))
c = (a / b).asnumpy()
def kernel_error_check_symbolic():
os.environ['MXNET_ENGINE_TYPE'] = 'NaiveEngine'
a = mx.sym.Variable('a')
b = mx.sym.Variable('b')
c = a / b
f = c.bind(mx.gpu(0), { 'a':mx.nd.array([1,2,3],ctx=mx.gpu(0)),
'b':mx.nd.array([],ctx=mx.gpu(0))})
f.forward()
g = f.outputs[0].asnumpy()
def test_kernel_error_checking():
# Running tests that may throw exceptions out of worker threads will stop CI testing
# if not run in a separate process (with its own address space for CUDA compatibility).
try:
mpctx = mp.get_context('spawn')
except:
print('SKIP: python%s.%s lacks the required process fork-exec support ... ' %
sys.version_info[0:2], file=sys.stderr, end='')
else:
with discard_stderr():
for f in [kernel_error_check_imperative, kernel_error_check_symbolic]:
p = mpctx.Process(target=f)
p.start()
p.join()
assert p.exitcode != 0,\
"Expected a synchronous kernel error from %s(), none seen." % f.__name__
def test_incorrect_gpu():
# Try setting dev_id to a really big number
assert_raises(MXNetError, mx.nd.ones, (2,2), ctx=mx.gpu(100001))
if __name__ == '__main__':
import nose
nose.runmodule()
| apache-2.0 | -6,496,676,072,106,310,000 | 47.417411 | 150 | 0.552234 | false |
npadgen/read-a-script | utils.py | 1 | 1176 | from enum import Enum
import jouvence.document
class ElementType(Enum):
ACTION = jouvence.document.TYPE_ACTION
CENTERED_ACTION = jouvence.document.TYPE_CENTEREDACTION
CHARACTER = jouvence.document.TYPE_CHARACTER
DIALOG = jouvence.document.TYPE_DIALOG
PARENTHETICAL = jouvence.document.TYPE_PARENTHETICAL
TRANSITION = jouvence.document.TYPE_TRANSITION
LYRICS = jouvence.document.TYPE_LYRICS
PAGE_BREAK = jouvence.document.TYPE_PAGEBREAK
SECTION = jouvence.document.TYPE_SECTION
SYNOPSIS = jouvence.document.TYPE_SYNOPSIS
def mixrange(s):
"""
Expand a range which looks like "1-3,6,8-10" to [1, 2, 3, 6, 8, 9, 10]
"""
r = []
for i in s.split(","):
if "-" not in i:
r.append(int(i))
else:
l, h = list(map(int, i.split("-")))
r += list(range(l, h + 1))
return r
def merge(dict_1, dict_2):
"""Merge two dictionaries.
Values that evaluate to true take priority over falsy values.
`dict_1` takes priority over `dict_2`.
"""
return dict((str(key), dict_1.get(key) or dict_2.get(key))
for key in set(dict_2) | set(dict_1))
| bsd-3-clause | -8,294,019,624,756,107,000 | 27 | 74 | 0.632653 | false |
ngageoint/scale | scale/job/test/messages/test_uncancel_jobs.py | 1 | 7505 | from __future__ import unicode_literals
import datetime
import django
from django.utils.timezone import now
from django.test import TransactionTestCase
from job.messages.uncancel_jobs import UncancelJobs
from job.models import Job
from job.test import utils as job_test_utils
from recipe.test import utils as recipe_test_utils
class TestUncancelJobs(TransactionTestCase):
def setUp(self):
django.setup()
def test_json(self):
"""Tests coverting an UncancelJobs message to and from JSON"""
old_when = now()
when = old_when + datetime.timedelta(minutes=60)
job_1 = job_test_utils.create_job(num_exes=0, status='PENDING', last_status_change=old_when)
job_2 = job_test_utils.create_job(num_exes=0, status='CANCELED', last_status_change=old_when)
job_3 = job_test_utils.create_job(num_exes=1, status='CANCELED', last_status_change=old_when)
job_4 = job_test_utils.create_job(num_exes=1, status='FAILED', last_status_change=old_when)
job_ids = [job_1.id, job_2.id, job_3.id, job_4.id]
# Add jobs to message
message = UncancelJobs()
message.when = when
if message.can_fit_more():
message.add_job(job_1.id)
if message.can_fit_more():
message.add_job(job_2.id)
if message.can_fit_more():
message.add_job(job_3.id)
if message.can_fit_more():
message.add_job(job_4.id)
# Convert message to JSON and back, and then execute
message_json_dict = message.to_json()
new_message = UncancelJobs.from_json(message_json_dict)
result = new_message.execute()
self.assertTrue(result)
jobs = Job.objects.filter(id__in=job_ids).order_by('id')
# Job 1 should not be updated because it was not CANCELED
self.assertEqual(jobs[0].status, 'PENDING')
self.assertEqual(jobs[0].last_status_change, old_when)
# Job 2 should be uncanceled
self.assertEqual(jobs[1].status, 'PENDING')
self.assertEqual(jobs[1].last_status_change, when)
# Job 3 should not be updated since it has already been queued
self.assertEqual(jobs[2].status, 'CANCELED')
self.assertEqual(jobs[2].last_status_change, old_when)
# Job 4 should not be updated because it was not CANCELED
self.assertEqual(jobs[3].status, 'FAILED')
self.assertEqual(jobs[3].last_status_change, old_when)
def test_execute(self):
"""Tests calling UncancelJobs.execute() successfully"""
old_when = now()
when = old_when + datetime.timedelta(minutes=60)
recipe = recipe_test_utils.create_recipe()
job_1 = job_test_utils.create_job(num_exes=0, status='PENDING', last_status_change=old_when)
job_2 = job_test_utils.create_job(num_exes=0, status='CANCELED', last_status_change=old_when, recipe=recipe)
job_3 = job_test_utils.create_job(num_exes=1, status='CANCELED', last_status_change=old_when)
job_4 = job_test_utils.create_job(num_exes=1, status='FAILED', last_status_change=old_when)
job_ids = [job_1.id, job_2.id, job_3.id, job_4.id]
recipe_test_utils.create_recipe_job(recipe=recipe, job=job_2)
# Add jobs to message
message = UncancelJobs()
message.when = when
if message.can_fit_more():
message.add_job(job_1.id)
if message.can_fit_more():
message.add_job(job_2.id)
if message.can_fit_more():
message.add_job(job_3.id)
if message.can_fit_more():
message.add_job(job_4.id)
# Execute message
result = message.execute()
self.assertTrue(result)
from recipe.diff.forced_nodes import ForcedNodes
from recipe.diff.json.forced_nodes_v6 import convert_forced_nodes_to_v6
forced_nodes = ForcedNodes()
forced_nodes.set_all_nodes()
forced_nodes_dict = convert_forced_nodes_to_v6(forced_nodes).get_dict()
jobs = Job.objects.filter(id__in=job_ids).order_by('id')
# Job 1 should not be updated because it was not CANCELED
self.assertEqual(jobs[0].status, 'PENDING')
self.assertEqual(jobs[0].last_status_change, old_when)
# Job 2 should be uncanceled
self.assertEqual(jobs[1].status, 'PENDING')
self.assertEqual(jobs[1].last_status_change, when)
# Job 3 should not be updated since it has already been queued
self.assertEqual(jobs[2].status, 'CANCELED')
self.assertEqual(jobs[2].last_status_change, old_when)
# Job 4 should not be updated because it was not CANCELED
self.assertEqual(jobs[3].status, 'FAILED')
self.assertEqual(jobs[3].last_status_change, old_when)
# Make sure update_recipe and update_recipe_metrics messages were created
self.assertEqual(len(message.new_messages), 2)
update_recipe_msg = None
update_recipe_metrics_msg = None
for msg in message.new_messages:
if msg.type == 'update_recipe':
update_recipe_msg = msg
elif msg.type == 'update_recipe_metrics':
update_recipe_metrics_msg = msg
self.assertIsNotNone(update_recipe_msg)
self.assertIsNotNone(update_recipe_metrics_msg)
self.assertEqual(update_recipe_msg.root_recipe_id, recipe.id)
self.assertDictEqual(convert_forced_nodes_to_v6(update_recipe_msg.forced_nodes).get_dict(), forced_nodes_dict)
self.assertListEqual(update_recipe_metrics_msg._recipe_ids, [recipe.id])
# Test executing message again
newer_when = when + datetime.timedelta(minutes=60)
message_json_dict = message.to_json()
message = UncancelJobs.from_json(message_json_dict)
message.when = newer_when
result = message.execute()
self.assertTrue(result)
jobs = Job.objects.filter(id__in=job_ids).order_by('id')
# Job 1 should not be updated because it was not CANCELED
self.assertEqual(jobs[0].status, 'PENDING')
self.assertEqual(jobs[0].last_status_change, old_when)
# Job 2 should not be updated since it already was last mexxage execution
self.assertEqual(jobs[1].status, 'PENDING')
self.assertEqual(jobs[1].last_status_change, when)
# Job 3 should not be updated since it has already been queued
self.assertEqual(jobs[2].status, 'CANCELED')
self.assertEqual(jobs[2].last_status_change, old_when)
# Job 4 should not be updated because it was not CANCELED
self.assertEqual(jobs[3].status, 'FAILED')
self.assertEqual(jobs[3].last_status_change, old_when)
# Make sure update_recipe and update_recipe_metrics messages were created
self.assertEqual(len(message.new_messages), 2)
update_recipe_msg = None
update_recipe_metrics_msg = None
for msg in message.new_messages:
if msg.type == 'update_recipe':
update_recipe_msg = msg
elif msg.type == 'update_recipe_metrics':
update_recipe_metrics_msg = msg
self.assertIsNotNone(update_recipe_msg)
self.assertIsNotNone(update_recipe_metrics_msg)
self.assertEqual(update_recipe_msg.root_recipe_id, recipe.id)
self.assertDictEqual(convert_forced_nodes_to_v6(update_recipe_msg.forced_nodes).get_dict(), forced_nodes_dict)
self.assertListEqual(update_recipe_metrics_msg._recipe_ids, [recipe.id])
| apache-2.0 | -4,129,883,464,434,995,700 | 44.484848 | 118 | 0.650366 | false |
Jchase2/py-pubsubhubbub-subscriber | fffp.py | 1 | 2310 | #!/usr/local/bin/python
# Copyright 2015 JChase II
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Addition permissions upon request on a case by case basis.
#
# This is a pubsubhubbub subscriber that subscribes to and handles a youtube
# channel subscription via the youtube API v.3
print('Content-type: text/html\n') # So print actually prints to the webpage. w
import requests # Library for sending http requests.
# imported to get raw data from GET and POST requests.
import os
import sys
# Change these values to your own.
a_topic = 'insert topic url to subscribe to here'
a_callback = 'insert webhook url pointing to this script.'
a_mode = 'subscribe'
a_verify = 'sync'
a_hub = 'https://pubsubhubbub.appspot.com/'
# First, we send a subscription request to googles subscriber...
payload = {'hub.callback': a_callback,
'hub.mode': a_mode, 'hub.verify': a_verify, 'hub.topic':
a_topic}
returned = requests.post(a_hub, data=payload)
# Check to make sure the hub responds with 204 or 202 (verified or accepted)
if returned != 204 or 202:
print ("Hub did not return 204 or 202")
print("Status code is: ",returned.status_code)
print("Text Value: ", returned.text)
sys.exit('Error!')
# Next, the hub needs to verify we sent a subscription request.
# It'll send a GET request to the webhook including details of the
# subscription... Also a hub.challenge. We must serve a 200 status and
# output hub.challenge in the response.
Qdict = {}
QString = os.getenv("QUERY_STRING")
Qdict = dict(item.split("=") for item in QString.split("&"))
plzCheckTopic = Qdict['hub.topic'];
if (plzCheckTopic == a_topic):
print(Qdict["hub.challenge"])
print("204")
else:
print("404")
| gpl-2.0 | 3,373,865,880,684,674,000 | 32.478261 | 79 | 0.724242 | false |
patrick246/tdesktop | Telegram/SourceFiles/mtproto/generate.py | 1 | 45625 | '''
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
It is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014 John Preston, https://desktop.telegram.org
'''
import glob
import re
import binascii
# define some checked flag convertions
# the key flag type should be a subset of the value flag type
# with exact the same names, then the key flag can be implicitly
# casted to the value flag type
parentFlags = {};
parentFlagsList = [];
def addChildParentFlags(child, parent):
parentFlagsList.append(child);
parentFlags[child] = parent;
addChildParentFlags('MTPDmessageService', 'MTPDmessage');
addChildParentFlags('MTPDupdateShortMessage', 'MTPDmessage');
addChildParentFlags('MTPDupdateShortChatMessage', 'MTPDmessage');
addChildParentFlags('MTPDupdateShortSentMessage', 'MTPDmessage');
addChildParentFlags('MTPDreplyKeyboardHide', 'MTPDreplyKeyboardMarkup');
addChildParentFlags('MTPDreplyKeyboardForceReply', 'MTPDreplyKeyboardMarkup');
addChildParentFlags('MTPDinputPeerNotifySettings', 'MTPDpeerNotifySettings');
addChildParentFlags('MTPDpeerNotifySettings', 'MTPDinputPeerNotifySettings');
addChildParentFlags('MTPDchannelForbidden', 'MTPDchannel');
# this is a map (key flags -> map (flag name -> flag bit))
# each key flag of parentFlags should be a subset of the value flag here
parentFlagsCheck = {};
layer = '';
funcs = 0
types = 0;
consts = 0
funcsNow = 0
enums = [];
funcsDict = {};
funcsList = [];
typesDict = {};
TypesDict = {};
typesList = [];
boxed = {};
funcsText = '';
typesText = '';
dataTexts = '';
creatorProxyText = '';
inlineMethods = '';
textSerializeInit = '';
textSerializeMethods = '';
forwards = '';
forwTypedefs = '';
out = open('scheme_auto.h', 'w')
out.write('/*\n');
out.write('Created from \'/SourceFiles/mtproto/scheme.tl\' by \'/SourceFiles/mtproto/generate.py\' script\n\n');
out.write('WARNING! All changes made in this file will be lost!\n\n');
out.write('This file is part of Telegram Desktop,\n');
out.write('the official desktop version of Telegram messaging app, see https://telegram.org\n');
out.write('\n');
out.write('Telegram Desktop is free software: you can redistribute it and/or modify\n');
out.write('it under the terms of the GNU General Public License as published by\n');
out.write('the Free Software Foundation, either version 3 of the License, or\n');
out.write('(at your option) any later version.\n');
out.write('\n');
out.write('It is distributed in the hope that it will be useful,\n');
out.write('but WITHOUT ANY WARRANTY; without even the implied warranty of\n');
out.write('MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n');
out.write('GNU General Public License for more details.\n');
out.write('\n');
out.write('In addition, as a special exception, the copyright holders give permission\n');
out.write('to link the code of portions of this program with the OpenSSL library.\n');
out.write('\n');
out.write('Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n');
out.write('Copyright (c) 2014 John Preston, https://desktop.telegram.org\n');
out.write('*/\n');
out.write('#pragma once\n\n#include "mtproto/core_types.h"\n');
with open('scheme.tl') as f:
for line in f:
layerline = re.match(r'// LAYER (\d+)', line)
if (layerline):
layer = 'static constexpr mtpPrime CurrentLayer = ' + layerline.group(1) + ';';
nocomment = re.match(r'^(.*?)//', line)
if (nocomment):
line = nocomment.group(1);
if (re.match(r'\-\-\-functions\-\-\-', line)):
funcsNow = 1;
continue;
if (re.match(r'\-\-\-types\-\-\-', line)):
funcsNow = 0;
continue;
if (re.match(r'^\s*$', line)):
continue;
nametype = re.match(r'([a-zA-Z\.0-9_]+)#([0-9a-f]+)([^=]*)=\s*([a-zA-Z\.<>0-9_]+);', line);
if (not nametype):
if (not re.match(r'vector#1cb5c415 \{t:Type\} # \[ t \] = Vector t;', line)):
print('Bad line found: ' + line);
continue;
name = nametype.group(1);
nameInd = name.find('.');
if (nameInd >= 0):
Name = name[0:nameInd] + '_' + name[nameInd + 1:nameInd + 2].upper() + name[nameInd + 2:];
name = name.replace('.', '_');
else:
Name = name[0:1].upper() + name[1:];
typeid = nametype.group(2);
while (len(typeid) > 0 and typeid[0] == '0'):
typeid = typeid[1:];
if (len(typeid) == 0):
typeid = '0';
typeid = '0x' + typeid;
cleanline = nametype.group(1) + nametype.group(3) + '= ' + nametype.group(4);
cleanline = re.sub(r' [a-zA-Z0-9_]+\:flags\.[0-9]+\?true', '', cleanline);
cleanline = cleanline.replace('<', ' ').replace('>', ' ').replace(' ', ' ');
cleanline = re.sub(r'^ ', '', cleanline);
cleanline = re.sub(r' $', '', cleanline);
cleanline = cleanline.replace(':bytes ', ':string ');
cleanline = cleanline.replace('?bytes ', '?string ');
cleanline = cleanline.replace('{', '');
cleanline = cleanline.replace('}', '');
countTypeId = binascii.crc32(binascii.a2b_qp(cleanline));
if (countTypeId < 0):
countTypeId += 2 ** 32;
countTypeId = '0x' + re.sub(r'^0x|L$', '', hex(countTypeId));
if (typeid != countTypeId):
print('Warning: counted ' + countTypeId + ' mismatch with provided ' + typeid + ' (' + cleanline + ')');
continue;
params = nametype.group(3);
restype = nametype.group(4);
if (restype.find('<') >= 0):
templ = re.match(r'^([vV]ector<)([A-Za-z0-9\._]+)>$', restype);
if (templ):
vectemplate = templ.group(2);
if (re.match(r'^[A-Z]', vectemplate) or re.match(r'^[a-zA-Z0-9]+_[A-Z]', vectemplate)):
restype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string'):
restype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
else:
foundmeta = '';
for metatype in typesDict:
for typedata in typesDict[metatype]:
if (typedata[0] == vectemplate):
foundmeta = metatype;
break;
if (len(foundmeta) > 0):
break;
if (len(foundmeta) > 0):
ptype = templ.group(1) + 'MTP' + foundmeta.replace('.', '_') + '>';
else:
print('Bad vector param: ' + vectemplate);
continue;
else:
print('Bad template type: ' + restype);
continue;
resType = restype.replace('.', '_');
if (restype.find('.') >= 0):
parts = re.match(r'([a-z]+)\.([A-Z][A-Za-z0-9<>\._]+)', restype)
if (parts):
restype = parts.group(1) + '_' + parts.group(2)[0:1].lower() + parts.group(2)[1:];
else:
print('Bad result type name with dot: ' + restype);
continue;
else:
if (re.match(r'^[A-Z]', restype)):
restype = restype[:1].lower() + restype[1:];
else:
print('Bad result type name: ' + restype);
continue;
boxed[resType] = restype;
boxed[Name] = name;
enums.append('\tmtpc_' + name + ' = ' + typeid);
paramsList = params.strip().split(' ');
prms = {};
conditions = {};
trivialConditions = {}; # true type
prmsList = [];
conditionsList = [];
isTemplate = hasFlags = hasTemplate = '';
for param in paramsList:
if (re.match(r'^\s*$', param)):
continue;
templ = re.match(r'^{([A-Za-z]+):Type}$', param);
if (templ):
hasTemplate = templ.group(1);
continue;
pnametype = re.match(r'([a-z_][a-z0-9_]*):([A-Za-z0-9<>\._]+|![a-zA-Z]+|\#|[a-z_][a-z0-9_]*\.[0-9]+\?[A-Za-z0-9<>\._]+)$', param);
if (not pnametype):
print('Bad param found: "' + param + '" in line: ' + line);
continue;
pname = pnametype.group(1);
ptypewide = pnametype.group(2);
if (re.match(r'^!([a-zA-Z]+)$', ptypewide)):
if ('!' + hasTemplate == ptypewide):
isTemplate = pname;
ptype = 'TQueryType';
else:
print('Bad template param name: "' + param + '" in line: ' + line);
continue;
elif (ptypewide == '#'):
hasFlags = pname;
if funcsNow:
ptype = 'flags<MTP' + name + '::Flags>';
else:
ptype = 'flags<MTPD' + name + '::Flags>';
else:
ptype = ptypewide;
if (ptype.find('?') >= 0):
pmasktype = re.match(r'([a-z_][a-z0-9_]*)\.([0-9]+)\?([A-Za-z0-9<>\._]+)', ptype);
if (not pmasktype or pmasktype.group(1) != hasFlags):
print('Bad param found: "' + param + '" in line: ' + line);
continue;
ptype = pmasktype.group(3);
if (ptype.find('<') >= 0):
templ = re.match(r'^([vV]ector<)([A-Za-z0-9\._]+)>$', ptype);
if (templ):
vectemplate = templ.group(2);
if (re.match(r'^[A-Z]', vectemplate) or re.match(r'^[a-zA-Z0-9]+_[A-Z]', vectemplate)):
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string'):
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
else:
foundmeta = '';
for metatype in typesDict:
for typedata in typesDict[metatype]:
if (typedata[0] == vectemplate):
foundmeta = metatype;
break;
if (len(foundmeta) > 0):
break;
if (len(foundmeta) > 0):
ptype = templ.group(1) + 'MTP' + foundmeta.replace('.', '_') + '>';
else:
print('Bad vector param: ' + vectemplate);
continue;
else:
print('Bad template type: ' + ptype);
continue;
if (not pname in conditions):
conditionsList.append(pname);
conditions[pname] = pmasktype.group(2);
if (ptype == 'true'):
trivialConditions[pname] = 1;
elif (ptype.find('<') >= 0):
templ = re.match(r'^([vV]ector<)([A-Za-z0-9\._]+)>$', ptype);
if (templ):
vectemplate = templ.group(2);
if (re.match(r'^[A-Z]', vectemplate) or re.match(r'^[a-zA-Z0-9]+_[A-Z]', vectemplate)):
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
elif (vectemplate == 'int' or vectemplate == 'long' or vectemplate == 'string'):
ptype = templ.group(1) + 'MTP' + vectemplate.replace('.', '_') + '>';
else:
foundmeta = '';
for metatype in typesDict:
for typedata in typesDict[metatype]:
if (typedata[0] == vectemplate):
foundmeta = metatype;
break;
if (len(foundmeta) > 0):
break;
if (len(foundmeta) > 0):
ptype = templ.group(1) + 'MTP' + foundmeta.replace('.', '_') + '>';
else:
print('Bad vector param: ' + vectemplate);
continue;
else:
print('Bad template type: ' + ptype);
continue;
prmsList.append(pname);
prms[pname] = ptype.replace('.', '_');
if (isTemplate == '' and resType == 'X'):
print('Bad response type "X" in "' + name +'" in line: ' + line);
continue;
if funcsNow:
if (isTemplate != ''):
funcsText += '\ntemplate <typename TQueryType>';
funcsText += '\nclass MTP' + name + ' { // RPC method \'' + nametype.group(1) + '\'\n'; # class
funcsText += 'public:\n';
prmsStr = [];
prmsInit = [];
prmsNames = [];
if (hasFlags != ''):
funcsText += '\tenum class Flag : int32 {\n';
maxbit = 0;
parentFlagsCheck['MTP' + name] = {};
for paramName in conditionsList:
funcsText += '\t\tf_' + paramName + ' = (1 << ' + conditions[paramName] + '),\n';
parentFlagsCheck['MTP' + name][paramName] = conditions[paramName];
maxbit = max(maxbit, int(conditions[paramName]));
if (maxbit > 0):
funcsText += '\n';
funcsText += '\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n';
funcsText += '\t};\n';
funcsText += '\tQ_DECLARE_FLAGS(Flags, Flag);\n';
funcsText += '\tfriend inline Flags operator~(Flag v) { return QFlag(~static_cast<int32>(v)); }\n';
funcsText += '\n';
if (len(conditions)):
for paramName in conditionsList:
if (paramName in trivialConditions):
funcsText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n';
else:
funcsText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n';
funcsText += '\n';
if (len(prms) > len(trivialConditions)):
for paramName in prmsList:
if (paramName in trivialConditions):
continue;
paramType = prms[paramName];
prmsInit.append('v' + paramName + '(_' + paramName + ')');
prmsNames.append('_' + paramName);
if (paramName == isTemplate):
ptypeFull = paramType;
else:
ptypeFull = 'MTP' + paramType;
funcsText += '\t' + ptypeFull + ' v' + paramName + ';\n';
if (paramType in ['int', 'Int', 'bool', 'Bool', 'flags<Flags>']):
prmsStr.append(ptypeFull + ' _' + paramName);
else:
prmsStr.append('const ' + ptypeFull + ' &_' + paramName);
funcsText += '\n';
funcsText += '\tMTP' + name + '() {\n\t}\n'; # constructor
funcsText += '\tMTP' + name + '(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_' + name + ') {\n\t\tread(from, end, cons);\n\t}\n'; # stream constructor
if (len(prms) > len(trivialConditions)):
funcsText += '\tMTP' + name + '(' + ', '.join(prmsStr) + ') : ' + ', '.join(prmsInit) + ' {\n\t}\n';
funcsText += '\n';
funcsText += '\tuint32 innerLength() const {\n'; # count size
size = [];
for k in prmsList:
v = prms[k];
if (k in conditionsList):
if (not k in trivialConditions):
size.append('(has_' + k + '() ? v' + k + '.innerLength() : 0)');
else:
size.append('v' + k + '.innerLength()');
if (not len(size)):
size.append('0');
funcsText += '\t\treturn ' + ' + '.join(size) + ';\n';
funcsText += '\t}\n';
funcsText += '\tmtpTypeId type() const {\n\t\treturn mtpc_' + name + ';\n\t}\n'; # type id
funcsText += '\tvoid read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_' + name + ') {\n'; # read method
for k in prmsList:
v = prms[k];
if (k in conditionsList):
if (not k in trivialConditions):
funcsText += '\t\tif (has_' + k + '()) { v' + k + '.read(from, end); } else { v' + k + ' = MTP' + v + '(); }\n';
else:
funcsText += '\t\tv' + k + '.read(from, end);\n';
funcsText += '\t}\n';
funcsText += '\tvoid write(mtpBuffer &to) const {\n'; # write method
for k in prmsList:
v = prms[k];
if (k in conditionsList):
if (not k in trivialConditions):
funcsText += '\t\tif (has_' + k + '()) v' + k + '.write(to);\n';
else:
funcsText += '\t\tv' + k + '.write(to);\n';
funcsText += '\t}\n';
if (isTemplate != ''):
funcsText += '\n\ttypedef typename TQueryType::ResponseType ResponseType;\n';
else:
funcsText += '\n\ttypedef MTP' + resType + ' ResponseType;\n'; # method return type
funcsText += '};\n'; # class ending
if (len(conditionsList)):
funcsText += 'Q_DECLARE_OPERATORS_FOR_FLAGS(MTP' + name + '::Flags)\n\n';
if (isTemplate != ''):
funcsText += 'template <typename TQueryType>\n';
funcsText += 'class MTP' + Name + ' : public MTPBoxed<MTP' + name + '<TQueryType> > {\n';
funcsText += 'public:\n';
funcsText += '\tMTP' + Name + '() {\n\t}\n';
funcsText += '\tMTP' + Name + '(const MTP' + name + '<TQueryType> &v) : MTPBoxed<MTP' + name + '<TQueryType> >(v) {\n\t}\n';
if (len(prms) > len(trivialConditions)):
funcsText += '\tMTP' + Name + '(' + ', '.join(prmsStr) + ') : MTPBoxed<MTP' + name + '<TQueryType> >(MTP' + name + '<TQueryType>(' + ', '.join(prmsNames) + ')) {\n\t}\n';
funcsText += '};\n';
else:
funcsText += 'class MTP' + Name + ' : public MTPBoxed<MTP' + name + '> {\n';
funcsText += 'public:\n';
funcsText += '\tMTP' + Name + '() {\n\t}\n';
funcsText += '\tMTP' + Name + '(const MTP' + name + ' &v) : MTPBoxed<MTP' + name + '>(v) {\n\t}\n';
funcsText += '\tMTP' + Name + '(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed<MTP' + name + '>(from, end, cons) {\n\t}\n';
if (len(prms) > len(trivialConditions)):
funcsText += '\tMTP' + Name + '(' + ', '.join(prmsStr) + ') : MTPBoxed<MTP' + name + '>(MTP' + name + '(' + ', '.join(prmsNames) + ')) {\n\t}\n';
funcsText += '};\n';
funcs = funcs + 1;
if (not restype in funcsDict):
funcsList.append(restype);
funcsDict[restype] = [];
# TypesDict[restype] = resType;
funcsDict[restype].append([name, typeid, prmsList, prms, hasFlags, conditionsList, conditions, trivialConditions]);
else:
if (isTemplate != ''):
print('Template types not allowed: "' + resType + '" in line: ' + line);
continue;
if (not restype in typesDict):
typesList.append(restype);
typesDict[restype] = [];
TypesDict[restype] = resType;
typesDict[restype].append([name, typeid, prmsList, prms, hasFlags, conditionsList, conditions, trivialConditions]);
consts = consts + 1;
# text serialization: types and funcs
def addTextSerialize(lst, dct, dataLetter):
result = '';
for restype in lst:
v = dct[restype];
for data in v:
name = data[0];
prmsList = data[2];
prms = data[3];
hasFlags = data[4];
conditionsList = data[5];
conditions = data[6];
trivialConditions = data[7];
result += 'void _serialize_' + name + '(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n';
if (len(conditions)):
result += '\tMTP' + dataLetter + name + '::Flags flag(iflag);\n\n';
if (len(prms)):
result += '\tif (stage) {\n';
result += '\t\tto.add(",\\n").addSpaces(lev);\n';
result += '\t} else {\n';
result += '\t\tto.add("{ ' + name + '");\n';
result += '\t\tto.add("\\n").addSpaces(lev);\n';
result += '\t}\n';
result += '\tswitch (stage) {\n';
stage = 0;
for k in prmsList:
v = prms[k];
result += '\tcase ' + str(stage) + ': to.add(" ' + k + ': "); ++stages.back(); ';
if (k == hasFlags):
result += 'if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; ';
if (k in trivialConditions):
result += 'if (flag & MTP' + dataLetter + name + '::Flag::f_' + k + ') { ';
result += 'to.add("YES [ BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); ';
result += '} else { to.add("[ SKIPPED BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); } ';
else:
if (k in conditions):
result += 'if (flag & MTP' + dataLetter + name + '::Flag::f_' + k + ') { ';
result += 'types.push_back(';
vtypeget = re.match(r'^[Vv]ector<MTP([A-Za-z0-9\._]+)>', v);
if (vtypeget):
if (not re.match(r'^[A-Z]', v)):
result += 'mtpc_vector';
else:
result += '0';
restype = vtypeget.group(1);
try:
if boxed[restype]:
restype = 0;
except KeyError:
if re.match(r'^[A-Z]', restype):
restype = 0;
else:
restype = v;
try:
if boxed[restype]:
restype = 0;
except KeyError:
if re.match(r'^[A-Z]', restype):
restype = 0;
if (restype):
try:
conses = typesDict[restype];
if (len(conses) > 1):
print('Complex bare type found: "' + restype + '" trying to serialize "' + k + '" of type "' + v + '"');
continue;
if (vtypeget):
result += '); vtypes.push_back(';
result += 'mtpc_' + conses[0][0];
if (not vtypeget):
result += '); vtypes.push_back(0';
except KeyError:
if (vtypeget):
result += '); vtypes.push_back(';
if (re.match(r'^flags<', restype)):
result += 'mtpc_flags';
else:
result += 'mtpc_' + restype + '+0';
if (not vtypeget):
result += '); vtypes.push_back(0';
else:
result += '0); vtypes.push_back(0';
result += '); stages.push_back(0); flags.push_back(0); ';
if (k in conditions):
result += '} else { to.add("[ SKIPPED BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); } ';
result += 'break;\n';
stage = stage + 1;
result += '\tdefault: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;\n';
result += '\t}\n';
else:
result += '\tto.add("{ ' + name + ' }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back();\n';
result += '}\n\n';
return result;
# text serialization: types and funcs
def addTextSerializeInit(lst, dct):
result = '';
for restype in lst:
v = dct[restype];
for data in v:
name = data[0];
result += '\t\t_serializers.insert(mtpc_' + name + ', _serialize_' + name + ');\n';
return result;
textSerializeMethods += addTextSerialize(typesList, typesDict, 'D');
textSerializeInit += addTextSerializeInit(typesList, typesDict) + '\n';
textSerializeMethods += addTextSerialize(funcsList, funcsDict, '');
textSerializeInit += addTextSerializeInit(funcsList, funcsDict) + '\n';
for restype in typesList:
v = typesDict[restype];
resType = TypesDict[restype];
withData = 0;
creatorsText = '';
constructsText = '';
constructsInline = '';
forwards += 'class MTP' + restype + ';\n';
forwTypedefs += 'typedef MTPBoxed<MTP' + restype + '> MTP' + resType + ';\n';
withType = (len(v) > 1);
switchLines = '';
friendDecl = '';
getters = '';
reader = '';
writer = '';
sizeList = [];
sizeFast = '';
newFast = '';
sizeCases = '';
for data in v:
name = data[0];
typeid = data[1];
prmsList = data[2];
prms = data[3];
hasFlags = data[4];
conditionsList = data[5];
conditions = data[6];
trivialConditions = data[7];
dataText = '';
dataText += '\nclass MTPD' + name + ' : public mtpDataImpl<MTPD' + name + '> {\n'; # data class
dataText += 'public:\n';
sizeList = [];
creatorParams = [];
creatorParamsList = [];
readText = '';
writeText = '';
if (hasFlags != ''):
dataText += '\tenum class Flag : int32 {\n';
maxbit = 0;
parentFlagsCheck['MTPD' + name] = {};
for paramName in conditionsList:
dataText += '\t\tf_' + paramName + ' = (1 << ' + conditions[paramName] + '),\n';
parentFlagsCheck['MTPD' + name][paramName] = conditions[paramName];
maxbit = max(maxbit, int(conditions[paramName]));
if (maxbit > 0):
dataText += '\n';
dataText += '\t\tMAX_FIELD = (1 << ' + str(maxbit) + '),\n';
dataText += '\t};\n';
dataText += '\tQ_DECLARE_FLAGS(Flags, Flag);\n';
dataText += '\tfriend inline Flags operator~(Flag v) { return QFlag(~static_cast<int32>(v)); }\n';
dataText += '\n';
if (len(conditions)):
for paramName in conditionsList:
if (paramName in trivialConditions):
dataText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n';
else:
dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & Flag::f_' + paramName + '; }\n';
dataText += '\n';
dataText += '\tMTPD' + name + '() {\n\t}\n'; # default constructor
switchLines += '\t\tcase mtpc_' + name + ': '; # for by-type-id type constructor
if (len(prms) > len(trivialConditions)):
switchLines += 'setData(new MTPD' + name + '()); ';
withData = 1;
getters += '\n\tMTPD' + name + ' &_' + name + '() {\n'; # splitting getter
getters += '\t\tif (!data) throw mtpErrorUninitialized();\n';
if (withType):
getters += '\t\tif (_type != mtpc_' + name + ') throw mtpErrorWrongTypeId(_type, mtpc_' + name + ');\n';
getters += '\t\tsplit();\n';
getters += '\t\treturn *(MTPD' + name + '*)data;\n';
getters += '\t}\n';
getters += '\tconst MTPD' + name + ' &c_' + name + '() const {\n'; # const getter
getters += '\t\tif (!data) throw mtpErrorUninitialized();\n';
if (withType):
getters += '\t\tif (_type != mtpc_' + name + ') throw mtpErrorWrongTypeId(_type, mtpc_' + name + ');\n';
getters += '\t\treturn *(const MTPD' + name + '*)data;\n';
getters += '\t}\n';
constructsText += '\texplicit MTP' + restype + '(MTPD' + name + ' *_data);\n'; # by-data type constructor
constructsInline += 'inline MTP' + restype + '::MTP' + restype + '(MTPD' + name + ' *_data) : mtpDataOwner(_data)';
if (withType):
constructsInline += ', _type(mtpc_' + name + ')';
constructsInline += ' {\n}\n';
dataText += '\tMTPD' + name + '('; # params constructor
prmsStr = [];
prmsInit = [];
for paramName in prmsList:
if (paramName in trivialConditions):
continue;
paramType = prms[paramName];
if (paramType in ['int', 'Int', 'bool', 'Bool']):
prmsStr.append('MTP' + paramType + ' _' + paramName);
creatorParams.append('MTP' + paramType + ' _' + paramName);
else:
prmsStr.append('const MTP' + paramType + ' &_' + paramName);
creatorParams.append('const MTP' + paramType + ' &_' + paramName);
creatorParamsList.append('_' + paramName);
prmsInit.append('v' + paramName + '(_' + paramName + ')');
if (withType):
readText += '\t\t';
writeText += '\t\t';
if (paramName in conditions):
readText += '\tif (v.has_' + paramName + '()) { v.v' + paramName + '.read(from, end); } else { v.v' + paramName + ' = MTP' + paramType + '(); }\n';
writeText += '\tif (v.has_' + paramName + '()) v.v' + paramName + '.write(to);\n';
sizeList.append('(v.has_' + paramName + '() ? v.v' + paramName + '.innerLength() : 0)');
else:
readText += '\tv.v' + paramName + '.read(from, end);\n';
writeText += '\tv.v' + paramName + '.write(to);\n';
sizeList.append('v.v' + paramName + '.innerLength()');
forwards += 'class MTPD' + name + ';\n'; # data class forward declaration
dataText += ', '.join(prmsStr) + ') : ' + ', '.join(prmsInit) + ' {\n\t}\n';
dataText += '\n';
for paramName in prmsList: # fields declaration
if (paramName in trivialConditions):
continue;
paramType = prms[paramName];
dataText += '\tMTP' + paramType + ' v' + paramName + ';\n';
sizeCases += '\t\tcase mtpc_' + name + ': {\n';
sizeCases += '\t\t\tconst MTPD' + name + ' &v(c_' + name + '());\n';
sizeCases += '\t\t\treturn ' + ' + '.join(sizeList) + ';\n';
sizeCases += '\t\t}\n';
sizeFast = '\tconst MTPD' + name + ' &v(c_' + name + '());\n\treturn ' + ' + '.join(sizeList) + ';\n';
newFast = 'new MTPD' + name + '()';
else:
sizeFast = '\treturn 0;\n';
switchLines += 'break;\n';
dataText += '};\n'; # class ending
if (len(prms) > len(trivialConditions)):
dataTexts += dataText; # add data class
if (not friendDecl):
friendDecl += '\tfriend class MTP::internal::TypeCreator;\n';
creatorProxyText += '\tinline static MTP' + restype + ' new_' + name + '(' + ', '.join(creatorParams) + ') {\n';
if (len(prms) > len(trivialConditions)): # creator with params
creatorProxyText += '\t\treturn MTP' + restype + '(new MTPD' + name + '(' + ', '.join(creatorParamsList) + '));\n';
else:
if (withType): # creator by type
creatorProxyText += '\t\treturn MTP' + restype + '(mtpc_' + name + ');\n';
else: # single creator
creatorProxyText += '\t\treturn MTP' + restype + '();\n';
creatorProxyText += '\t}\n';
if (len(conditionsList)):
creatorsText += 'Q_DECLARE_OPERATORS_FOR_FLAGS(MTPD' + name + '::Flags)\n';
creatorsText += 'inline MTP' + restype + ' MTP_' + name + '(' + ', '.join(creatorParams) + ') {\n';
creatorsText += '\treturn MTP::internal::TypeCreator::new_' + name + '(' + ', '.join(creatorParamsList) + ');\n';
creatorsText += '}\n';
if (withType):
reader += '\t\tcase mtpc_' + name + ': _type = cons; '; # read switch line
if (len(prms) > len(trivialConditions)):
reader += '{\n';
reader += '\t\t\tif (!data) setData(new MTPD' + name + '());\n';
reader += '\t\t\tMTPD' + name + ' &v(_' + name + '());\n';
reader += readText;
reader += '\t\t} break;\n';
writer += '\t\tcase mtpc_' + name + ': {\n'; # write switch line
writer += '\t\t\tconst MTPD' + name + ' &v(c_' + name + '());\n';
writer += writeText;
writer += '\t\t} break;\n';
else:
reader += 'break;\n';
else:
if (len(prms) > len(trivialConditions)):
reader += '\n\tif (!data) setData(new MTPD' + name + '());\n';
reader += '\tMTPD' + name + ' &v(_' + name + '());\n';
reader += readText;
writer += '\tconst MTPD' + name + ' &v(c_' + name + '());\n';
writer += writeText;
forwards += '\n';
typesText += '\nclass MTP' + restype; # type class declaration
if (withData):
typesText += ' : private mtpDataOwner'; # if has data fields
typesText += ' {\n';
typesText += 'public:\n';
typesText += '\tMTP' + restype + '()'; # default constructor
inits = [];
if (withType):
if (withData):
inits.append('mtpDataOwner(0)');
inits.append('_type(0)');
else:
if (withData):
inits.append('mtpDataOwner(' + newFast + ')');
if (withData and not withType):
typesText += ';\n';
inlineMethods += '\ninline MTP' + restype + '::MTP' + restype + '()';
if (inits):
inlineMethods += ' : ' + ', '.join(inits);
inlineMethods += ' {\n}\n';
else:
if (inits):
typesText += ' : ' + ', '.join(inits);
typesText += ' {\n\t}\n';
inits = [];
if (withData):
inits.append('mtpDataOwner(0)');
if (withType):
inits.append('_type(0)');
typesText += '\tMTP' + restype + '(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons';
if (not withType):
typesText += ' = mtpc_' + name;
typesText += ')'; # read constructor
if (inits):
typesText += ' : ' + ', '.join(inits);
typesText += ' {\n\t\tread(from, end, cons);\n\t}\n';
if (withData):
typesText += getters;
typesText += '\n\tuint32 innerLength() const;\n'; # size method
inlineMethods += '\ninline uint32 MTP' + restype + '::innerLength() const {\n';
if (withType and sizeCases):
inlineMethods += '\tswitch (_type) {\n';
inlineMethods += sizeCases;
inlineMethods += '\t}\n';
inlineMethods += '\treturn 0;\n';
else:
inlineMethods += sizeFast;
inlineMethods += '}\n';
typesText += '\tmtpTypeId type() const;\n'; # type id method
inlineMethods += 'inline mtpTypeId MTP' + restype + '::type() const {\n';
if (withType):
inlineMethods += '\tif (!_type) throw mtpErrorUninitialized();\n';
inlineMethods += '\treturn _type;\n';
else:
inlineMethods += '\treturn mtpc_' + v[0][0] + ';\n';
inlineMethods += '}\n';
typesText += '\tvoid read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons'; # read method
if (not withType):
typesText += ' = mtpc_' + name;
typesText += ');\n';
inlineMethods += 'inline void MTP' + restype + '::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) {\n';
if (withData):
if (withType):
inlineMethods += '\tif (cons != _type) setData(0);\n';
else:
inlineMethods += '\tif (cons != mtpc_' + v[0][0] + ') throw mtpErrorUnexpected(cons, "MTP' + restype + '");\n';
if (withType):
inlineMethods += '\tswitch (cons) {\n'
inlineMethods += reader;
inlineMethods += '\t\tdefault: throw mtpErrorUnexpected(cons, "MTP' + restype + '");\n';
inlineMethods += '\t}\n';
else:
inlineMethods += reader;
inlineMethods += '}\n';
typesText += '\tvoid write(mtpBuffer &to) const;\n'; # write method
inlineMethods += 'inline void MTP' + restype + '::write(mtpBuffer &to) const {\n';
if (withType and writer != ''):
inlineMethods += '\tswitch (_type) {\n';
inlineMethods += writer;
inlineMethods += '\t}\n';
else:
inlineMethods += writer;
inlineMethods += '}\n';
typesText += '\n\ttypedef void ResponseType;\n'; # no response types declared
typesText += '\nprivate:\n'; # private constructors
if (withType): # by-type-id constructor
typesText += '\texplicit MTP' + restype + '(mtpTypeId type);\n';
inlineMethods += 'inline MTP' + restype + '::MTP' + restype + '(mtpTypeId type) : ';
if (withData):
inlineMethods += 'mtpDataOwner(0), ';
inlineMethods += '_type(type)';
inlineMethods += ' {\n';
inlineMethods += '\tswitch (type) {\n'; # type id check
inlineMethods += switchLines;
inlineMethods += '\t\tdefault: throw mtpErrorBadTypeId(type, "MTP' + restype + '");\n\t}\n';
inlineMethods += '}\n'; # by-type-id constructor end
if (withData):
typesText += constructsText;
inlineMethods += constructsInline;
if (friendDecl):
typesText += '\n' + friendDecl;
if (withType):
typesText += '\n\tmtpTypeId _type;\n'; # type field var
typesText += '};\n'; # type class ended
inlineMethods += creatorsText;
typesText += 'typedef MTPBoxed<MTP' + restype + '> MTP' + resType + ';\n'; # boxed type definition
for childName in parentFlagsList:
parentName = parentFlags[childName];
for flag in parentFlagsCheck[childName]:
if (not flag in parentFlagsCheck[parentName]):
print('Flag ' + flag + ' not found in ' + parentName + ' which should be a flags-parent of ' + childName);
error
elif (parentFlagsCheck[childName][flag] != parentFlagsCheck[parentName][flag]):
print('Flag ' + flag + ' has different value in ' + parentName + ' which should be a flags-parent of ' + childName);
error
inlineMethods += 'inline ' + parentName + '::Flags mtpCastFlags(' + childName + '::Flags flags) { return ' + parentName + '::Flags(QFlag(flags)); }\n';
inlineMethods += 'inline ' + parentName + '::Flags mtpCastFlags(MTPflags<' + childName + '::Flags> flags) { return mtpCastFlags(flags.v); }\n';
# manual types added here
textSerializeMethods += 'void _serialize_rpc_result(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n';
textSerializeMethods += '\tif (stage) {\n';
textSerializeMethods += '\t\tto.add(",\\n").addSpaces(lev);\n';
textSerializeMethods += '\t} else {\n';
textSerializeMethods += '\t\tto.add("{ rpc_result");\n';
textSerializeMethods += '\t\tto.add("\\n").addSpaces(lev);\n';
textSerializeMethods += '\t}\n';
textSerializeMethods += '\tswitch (stage) {\n';
textSerializeMethods += '\tcase 0: to.add(" req_msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;\n';
textSerializeMethods += '\tcase 1: to.add(" result: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;\n';
textSerializeMethods += '\tdefault: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;\n';
textSerializeMethods += '\t}\n';
textSerializeMethods += '}\n\n';
textSerializeInit += '\t\t_serializers.insert(mtpc_rpc_result, _serialize_rpc_result);\n';
textSerializeMethods += 'void _serialize_msg_container(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n';
textSerializeMethods += '\tif (stage) {\n';
textSerializeMethods += '\t\tto.add(",\\n").addSpaces(lev);\n';
textSerializeMethods += '\t} else {\n';
textSerializeMethods += '\t\tto.add("{ msg_container");\n';
textSerializeMethods += '\t\tto.add("\\n").addSpaces(lev);\n';
textSerializeMethods += '\t}\n';
textSerializeMethods += '\tswitch (stage) {\n';
textSerializeMethods += '\tcase 0: to.add(" messages: "); ++stages.back(); types.push_back(mtpc_vector); vtypes.push_back(mtpc_core_message); stages.push_back(0); flags.push_back(0); break;\n';
textSerializeMethods += '\tdefault: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;\n';
textSerializeMethods += '\t}\n';
textSerializeMethods += '}\n\n';
textSerializeInit += '\t\t_serializers.insert(mtpc_msg_container, _serialize_msg_container);\n';
textSerializeMethods += 'void _serialize_core_message(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag) {\n';
textSerializeMethods += '\tif (stage) {\n';
textSerializeMethods += '\t\tto.add(",\\n").addSpaces(lev);\n';
textSerializeMethods += '\t} else {\n';
textSerializeMethods += '\t\tto.add("{ core_message");\n';
textSerializeMethods += '\t\tto.add("\\n").addSpaces(lev);\n';
textSerializeMethods += '\t}\n';
textSerializeMethods += '\tswitch (stage) {\n';
textSerializeMethods += '\tcase 0: to.add(" msg_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;\n';
textSerializeMethods += '\tcase 1: to.add(" seq_no: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;\n';
textSerializeMethods += '\tcase 2: to.add(" bytes: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;\n';
textSerializeMethods += '\tcase 3: to.add(" body: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;\n';
textSerializeMethods += '\tdefault: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;\n';
textSerializeMethods += '\t}\n';
textSerializeMethods += '}\n\n';
textSerializeInit += '\t\t_serializers.insert(mtpc_core_message, _serialize_core_message);\n';
textSerializeFull = '\nvoid mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpPrime *end, mtpPrime cons, uint32 level, mtpPrime vcons) {\n';
textSerializeFull += '\tif (_serializers.isEmpty()) initTextSerializers();\n\n';
textSerializeFull += '\tQVector<mtpTypeId> types, vtypes;\n';
textSerializeFull += '\tQVector<int32> stages, flags;\n';
textSerializeFull += '\ttypes.reserve(20); vtypes.reserve(20); stages.reserve(20); flags.reserve(20);\n';
textSerializeFull += '\ttypes.push_back(mtpTypeId(cons)); vtypes.push_back(mtpTypeId(vcons)); stages.push_back(0); flags.push_back(0);\n\n';
textSerializeFull += '\tconst mtpPrime *start = from;\n';
textSerializeFull += '\tmtpTypeId type = cons, vtype = vcons;\n';
textSerializeFull += '\tint32 stage = 0, flag = 0;\n\n';
textSerializeFull += '\twhile (!types.isEmpty()) {\n';
textSerializeFull += '\t\ttype = types.back();\n';
textSerializeFull += '\t\tvtype = vtypes.back();\n';
textSerializeFull += '\t\tstage = stages.back();\n';
textSerializeFull += '\t\tflag = flags.back();\n';
textSerializeFull += '\t\tif (!type) {\n';
textSerializeFull += '\t\t\tif (from >= end) {\n';
textSerializeFull += '\t\t\t\tthrow Exception("from >= end");\n';
textSerializeFull += '\t\t\t} else if (stage) {\n';
textSerializeFull += '\t\t\t\tthrow Exception("unknown type on stage > 0");\n';
textSerializeFull += '\t\t\t}\n';
textSerializeFull += '\t\t\ttypes.back() = type = *from;\n';
textSerializeFull += '\t\t\tstart = ++from;\n';
textSerializeFull += '\t\t}\n\n';
textSerializeFull += '\t\tint32 lev = level + types.size() - 1;\n';
textSerializeFull += '\t\tTextSerializers::const_iterator it = _serializers.constFind(type);\n';
textSerializeFull += '\t\tif (it != _serializers.cend()) {\n';
textSerializeFull += '\t\t\t(*it.value())(to, stage, lev, types, vtypes, stages, flags, start, end, flag);\n';
textSerializeFull += '\t\t} else {\n';
textSerializeFull += '\t\t\tmtpTextSerializeCore(to, from, end, type, lev, vtype);\n';
textSerializeFull += '\t\t\ttypes.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back();\n';
textSerializeFull += '\t\t}\n';
textSerializeFull += '\t}\n';
textSerializeFull += '}\n';
out.write('\n// Creator current layer and proxy class declaration\n');
out.write('namespace MTP {\nnamespace internal {\n\n' + layer + '\n\n');
out.write('class TypeCreator;\n\n} // namespace internal\n} // namespace MTP\n');
out.write('\n// Type id constants\nenum {\n' + ',\n'.join(enums) + '\n};\n');
out.write('\n// Type forward declarations\n' + forwards);
out.write('\n// Boxed types definitions\n' + forwTypedefs);
out.write('\n// Type classes definitions\n' + typesText);
out.write('\n// Type constructors with data\n' + dataTexts);
out.write('\n// RPC methods\n' + funcsText);
out.write('\n// Creator proxy class definition\nnamespace MTP {\nnamespace internal {\n\nclass TypeCreator {\npublic:\n' + creatorProxyText + '\t};\n\n} // namespace internal\n} // namespace MTP\n');
out.write('\n// Inline methods definition\n' + inlineMethods);
out.write('\n// Human-readable text serialization\nvoid mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpPrime *end, mtpPrime cons, uint32 level, mtpPrime vcons);\n');
outCpp = open('scheme_auto.cpp', 'w');
outCpp.write('/*\n');
outCpp.write('Created from \'/SourceFiles/mtproto/scheme.tl\' by \'/SourceFiles/mtproto/generate.py\' script\n\n');
outCpp.write('WARNING! All changes made in this file will be lost!\n\n');
outCpp.write('This file is part of Telegram Desktop,\n');
outCpp.write('the official desktop version of Telegram messaging app, see https://telegram.org\n');
outCpp.write('\n');
outCpp.write('Telegram Desktop is free software: you can redistribute it and/or modify\n');
outCpp.write('it under the terms of the GNU General Public License as published by\n');
outCpp.write('the Free Software Foundation, either version 3 of the License, or\n');
outCpp.write('(at your option) any later version.\n');
outCpp.write('\n');
outCpp.write('It is distributed in the hope that it will be useful,\n');
outCpp.write('but WITHOUT ANY WARRANTY; without even the implied warranty of\n');
outCpp.write('MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n');
outCpp.write('GNU General Public License for more details.\n');
outCpp.write('\n');
outCpp.write('Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\n');
outCpp.write('Copyright (c) 2014 John Preston, https://desktop.telegram.org\n');
outCpp.write('*/\n');
outCpp.write('#include "stdafx.h"\n\n#include "mtproto/scheme_auto.h"\n\n');
outCpp.write('typedef QVector<mtpTypeId> Types;\ntypedef QVector<int32> StagesFlags;\n\n');
outCpp.write(textSerializeMethods);
outCpp.write('namespace {\n');
outCpp.write('\ttypedef void(*mtpTextSerializer)(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 iflag);\n');
outCpp.write('\ttypedef QMap<mtpTypeId, mtpTextSerializer> TextSerializers;\n\tTextSerializers _serializers;\n\n');
outCpp.write('\tvoid initTextSerializers() {\n');
outCpp.write(textSerializeInit);
outCpp.write('\t}\n}\n');
outCpp.write(textSerializeFull + '\n');
print('Done, written {0} constructors, {1} functions.'.format(consts, funcs));
| gpl-3.0 | -8,282,897,700,748,940,000 | 45.17915 | 232 | 0.573874 | false |
chen0040/pyalgs | pyalgs/algorithms/graphs/directed_cycle.py | 1 | 1475 | from pyalgs.data_structures.commons.stack import Stack
from pyalgs.data_structures.graphs.graph import DirectedEdgeWeightedGraph, Digraph
class DirectedCycle(object):
marked = None
onStack = None
cycle = None
edgeTo = None
def __init__(self, G):
if isinstance(G, DirectedEdgeWeightedGraph):
G = G.to_digraph()
if not isinstance(G, Digraph):
raise ValueError('Graph must be unweighted digraph')
vertex_count = G.vertex_count()
self.marked = [False] * vertex_count
self.onStack = [False] * vertex_count
self.edgeTo = [-1] * vertex_count
for v in range(vertex_count):
if not self.marked[v]:
self.dfs(G, v)
def dfs(self, G, v):
self.marked[v] = True
self.onStack[v] = True
for w in G.adj(v):
if not self.marked[w]:
self.edgeTo[w] = v
self.dfs(G, w)
elif self.cycle is not None:
break
elif self.onStack[w]:
self.cycle = Stack.create()
x = v
while x != w:
self.cycle.push(x)
x = self.edgeTo[x]
self.cycle.push(w)
self.cycle.push(v)
break
self.onStack[v] = False
def hasCycle(self):
return self.cycle is not None
def get_cycle(self):
return self.cycle.iterate()
| bsd-3-clause | -2,261,778,148,886,728,400 | 26.314815 | 82 | 0.522712 | false |
ppmim/AFOSN | run_patch.py | 1 | 7925 | """
DESCRIPTION
-----------
For each directory provided on the command line the
headers all of the FITS files in that directory are modified
to add information like LST, apparent object position, and more.
See the full documentation for a list of the specific keywords
that are modified.
Header patching
^^^^^^^^^^^^^^^
This is basically a wrapper around the function
:func:`patch_headers.patch_headers` with the options set so that:
+ "Bad" keywords written by MaxImDL 5 are purged.
+ ``IMAGETYP`` keyword is changed from default MaxIM DL style
to IRAF style (e.g. "Bias Frame" to "BIAS")
+ Additional useful times like LST, JD are added to the header.
+ Apparent position (Alt/Az, hour angle) are added to the header.
+ Information about overscan is added to the header.
+ Files are overwritten.
For more control over what is patched and where the patched files are saved
see the documentation for ``patch_headers`` at
:func:`patch_headers.patch_headers`.
Adding OBJECT keyword
^^^^^^^^^^^^^^^^^^^^^
``run_patch`` also adds the name of the object being observed when
appropriate (i.e. only for light files) and possible. It needs to be
given a list of objects; looking up the coordinates for those objects
requires an Internet connection. See
For a detailed description of the object list file see
:func:`Object file format <patch_headers.read_object_list>`.
for a detailed description of the function that actually adds the object name
see :func:`patch_headers.add_object_info`.
If no object list is specified or present in the directory being processed
the `OBJECT` keyword is simply not added to the FITS header.
.. Note::
This script is **NOT RECURSIVE**; it will not process files in
subdirectories of the the directories supplied on the command line.
.. WARNING::
This script OVERWRITES the image files in the directories
specified on the command line unless you use the --destination-dir
option.
EXAMPLES
--------
Invoking this script from the command line::
run_patch.py /my/folder/of/images
To work on the same folder from within python, do this::
from msumastro.scripts import run_patch
run_patch.main(['/my/folder/of/images'])
To use the same object list for several different directories do this::
run_patch.py --object-list path/to/list.txt dir1 dir2 dir3
where ``path/to/list.txt`` is the path to your object list and ``dir1``,
``dir2``, etc. are the directories you want to process.
From within python this would be::
from msumastro.scripts import run_patch
run_patch.main(['--object-list', 'path/to/list.txt',
'dir1', 'dir2', 'dir3'])
"""
from __future__ import (print_function, division, absolute_import,
unicode_literals)
from os import getcwd
from os import path
import warnings
import logging
from ..header_processing import patch_headers, add_object_info, list_name_is_url
from ..customlogger import console_handler, add_file_handlers
from .script_helpers import (setup_logging, construct_default_parser,
handle_destination_dir_logging_check,
_main_function_docstring)
logger = logging.getLogger()
screen_handler = console_handler()
logger.addHandler(screen_handler)
DEFAULT_OBJ_LIST = 'obsinfo.txt'
DEFAULT_OBJECT_URL = ('https://raw.github.com/mwcraig/feder-object-list'
'/master/feder_object_list.csv')
def patch_directories(directories, verbose=False, object_list=None,
destination=None,
no_log_destination=False,
overscan_only=False,
script_name='run_patch'):
"""
Patch all of the files in each of a list of directories.
Parameters
----------
directories : str or list of str
Directory or directories whose FITS files are to be processed.
verbose : bool, optional
Control amount of logging output.
object_list : str, optional
Path to or URL of a file containing a list of objects that
might be in the files in `directory`. If not provided it defaults
to looking for a file called `obsinfo.txt` in the directory being
processed.
destination : str, optional
Path to directory in which patched images will be stored. Default
value is None, which means that **files will be overwritten** in
the directory being processed.
"""
no_explicit_object_list = (object_list is None)
if not no_explicit_object_list:
if list_name_is_url(object_list):
obj_dir = None
obj_name = object_list
else:
full_path = path.abspath(object_list)
obj_dir, obj_name = path.split(full_path)
for currentDir in directories:
if destination is not None:
working_dir = destination
else:
working_dir = currentDir
if (not no_log_destination) and (destination is not None):
add_file_handlers(logger, working_dir, 'run_patch')
logger.info("Working on directory: %s", currentDir)
with warnings.catch_warnings():
# suppress warning from overwriting FITS files
ignore_from = 'astropy.io.fits.hdu.hdulist'
warnings.filterwarnings('ignore', module=ignore_from)
if overscan_only:
patch_headers(currentDir, new_file_ext='', overwrite=True,
save_location=destination,
purge_bad=False,
add_time=False,
add_apparent_pos=False,
add_overscan=True,
fix_imagetype=False,
add_unit=False)
else:
patch_headers(currentDir, new_file_ext='', overwrite=True,
save_location=destination)
default_object_list_present = path.exists(path.join(currentDir,
DEFAULT_OBJ_LIST))
if (default_object_list_present and no_explicit_object_list):
obj_dir = currentDir
obj_name = DEFAULT_OBJ_LIST
add_object_info(working_dir, new_file_ext='', overwrite=True,
save_location=destination,
object_list_dir=obj_dir, object_list=obj_name)
def construct_parser():
parser = construct_default_parser(__doc__)
object_list_help = ('Path to or URL of file containing list (and '
'optionally coordinates of) objects that might be in '
'these files. If not provided it defaults to looking '
'for a file called obsinfo.txt in the directory '
'being processed')
parser.add_argument('-o', '--object-list',
help=object_list_help,
default=DEFAULT_OBJECT_URL)
parser.add_argument('--overscan-only', action='store_true',
help='Only add appropriate overscan keywords')
return parser
def main(arglist=None):
"""See script_helpers._main_function_docstring for actual documentation
"""
parser = construct_parser()
args = parser.parse_args(arglist)
setup_logging(logger, args, screen_handler)
add_file_handlers(logger, getcwd(), 'run_patch')
do_not_log_in_destination = handle_destination_dir_logging_check(args)
patch_directories(args.dir, verbose=args.verbose,
object_list=args.object_list,
destination=args.destination_dir,
no_log_destination=do_not_log_in_destination,
overscan_only=args.overscan_only)
main.__doc__ = _main_function_docstring(__name__)
| gpl-2.0 | -6,576,618,754,313,954,000 | 36.206573 | 80 | 0.627129 | false |
Ripley6811/TAIMAU | src/db_tools/TM2014_tables_v3.py | 1 | 20670 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Version 3 splits Order into Order and OrderItem,
Shipment into Shipment and ShipmentItem.
Just as Invoice was split from version 1 to 2.
InvoiceItem and ShipmentItem now reference each other.
Invoice number is removed as primary key and placed with integer.
NOTE: Class functions can be changed and added without migration.
"""
import sqlalchemy as sqla
from sqlalchemy.orm import relationship as rel
from sqlalchemy.orm import backref, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import datetime
import json
Int = sqla.Integer
#Str = sqla.String #TODO: Can probably delete this line
Utf = sqla.Unicode
Float = sqla.Float
Col = sqla.Column
Bool = sqla.Boolean
Date = sqla.Date
DateTime = sqla.DateTime
ForeignKey = sqla.ForeignKey
Base = declarative_base()
def today():
return datetime.datetime.now()
def AddDictRepr(aClass):
def repr_str(obj):
'''Returns a string representation of the dictionary object with
underscored keywords removed ("_keyword").
'''
copy = obj.__dict__.copy()
for key in copy.keys():
if key.startswith(u'_'):
try:
del copy[key]
except KeyError:
pass
return repr(copy)
aClass.__repr__ = repr_str
return aClass
#==============================================================================
# Order class
#==============================================================================
@AddDictRepr
class Order(Base):
__tablename__ = 'order'
id = Col(Int, primary_key=True)
group = Col(Utf(4), ForeignKey('cogroup.name'), nullable=False) # Of second party main company
seller = Col(Utf(4), ForeignKey('branch.name'), nullable=False) # For billing/receipts
buyer = Col(Utf(4), ForeignKey('branch.name'), nullable=False) # For billing/receipts
parent = rel('CoGroup')
recorddate = Col(DateTime, nullable=False, default=today) # Date of entering a record
# Keep all product information in the outgoing product list
MPN = Col(Utf(20), ForeignKey('product.MPN'), nullable=False) # Product code
price = Col(Float) # Price for one SKU or unit on this order
discount = Col(Int, nullable=False, default=0) # Discount percentage as integer (0-100)
#XXX: name change in version 3: totalskus = Col(Int)
qty = Col(Int, nullable=False)
applytax = Col(Bool, nullable=False) # True = 5%, False = 0%
#XXX: Remove in version 3
#totalunits = Col(Float) # AUTO: unitssku * totalskus
#subtotal = Col(Float) #TODO: Remove and leave final totals in attached invoice.
#totalcharge = Col(Int) #TODO: Remove
orderdate = Col(Date, nullable=False) # Order placement date
duedate = Col(Date) # Expected delivery date
date = Col(Date) # Extra date field if needed
orderID = Col(Utf(20)) # PO Number
ordernote = Col(Utf(100)) # Information concerning the order
note = Col(Utf(100)) # Extra note field if needed.
checked = Col(Bool, nullable=False, default=False) # Match against second party records
is_sale = Col(Bool, nullable=False, default=False) # Boolean. Customer
is_purchase = Col(Bool, nullable=False, default=False) # Boolean. Supplier
shipments = rel('ShipmentItem', backref='order')
invoices = rel('InvoiceItem', backref='order')
product = rel('Product')
#XXX: New in version 3
is_open = Col(Bool, nullable=False, default=True) # Active or closed PO
@property
def units(self):
return self.qty * self.product.units
def shipped_value(self):
'''Return the value of total shipped items.'''
value = self.qty_shipped() * self.price
if self.product.unitpriced:
value = value * self.product.units
if self.applytax:
value = value * 1.05
return value
def qty_shipped(self):
'''By number of SKUs'''
if len(self.shipments) == 0:
return 0
return sum([srec.qty if isinstance(srec.qty,int) else 0 for srec in self.shipments])
def qty_remaining(self):
'''By number of SKUs remaining to be shipped'''
return int(self.qty - self.qty_shipped())
def all_shipped(self):
'''By number of SKUs'''
if len(self.shipments) == 0:
return False
return self.qty == self.qty_shipped()
def qty_invoiced(self):
'''By number of SKUs'''
if len(self.invoices) == 0:
return 0
return sum([prec.qty if isinstance(prec.qty,int) else 0 for prec in self.invoices])
def all_invoiced(self):
'''By number of SKUs'''
# if len(self.invoices) == 0:
# return False
return self.qty_shipped() == self.qty_invoiced()
def total_paid(self):
if len(self.invoices) == 0:
return 0
return sum([prec.qty if prec.paid else 0 for prec in self.invoices])
def all_paid(self):
if len(self.invoices) == 0:
return False
return not (False in [prec.invoice.paid for prec in self.invoices])
def qty_quote(self, qty):
subtotal = self.price * qty
if self.product.unitpriced:
subtotal *= self.product.units
return int(round(subtotal))
#==============================================================================
# Shipment (track multiple shipments in SKU's for one order)
#==============================================================================
@AddDictRepr
class Shipment(Base): # Keep track of shipments/SKUs for one order
'''
#TODO: Separate manifest info and manifest items.
order : backref to Order
'''
__tablename__ = 'shipment'
id = Col(Int, primary_key=True)
shipmentdate = Col(Date, nullable=False)
shipment_no = Col(Utf(20), default=u'') # i.e., Manifest number
shipmentnote = Col(Utf(100), default=u'') # Information concerning the delivery
shipmentdest = Col(Utf(100), default=u'')
driver = Col(Utf(4)) # Track vehicle driver (optional)
truck = Col(Utf(10)) # Track vehicle by license (optional)
note = Col(Utf(100)) # Extra note field if needed
checked = Col(Bool, nullable=False, default=False) # Extra boolean for matching/verifying
items = rel('ShipmentItem', backref='shipment')
# # METHODS
# def listbox_summary(self):
# """
# Return a single line unicode summary intended for a listbox.
# """
# txt = u'{date:<10} 編號: {s.shipment_no:<10} QTY: {s.items[0].qty:>5} {s.order.product.SKU:<6} 品名: {s.order.product.inventory_name}'
# txt = txt.format(s=self, date=str(self.shipmentdate))
# return txt
@AddDictRepr
class ShipmentItem(Base):
__tablename__ = 'shipmentitem'
id = Col(Int, primary_key=True)
order_id = Col(Int, ForeignKey('order.id'), nullable=False)
shipment_id = Col(Int, ForeignKey('shipment.id'))
qty = Col(Int, nullable=False) # Deduct from total SKUs due
lot = Col(Utf(20))
lot_start = Col(Int)
lot_end = Col(Int)
rt_no = Col(Utf(20))
duedate = Col(Date)
shipped = Col(Bool, default=False)
invoiceitem = rel('InvoiceItem', backref='shipmentitem')
#==============================================================================
# Invoice class (track multiple invoices for one order)
#==============================================================================
@AddDictRepr
class Invoice(Base): # Keep track of invoices/payments for one order
__tablename__ = 'invoice'
#XXX: New in version 3, primary key change
id = Col(Int, primary_key=True)
invoice_no = Col(Utf(20), default=u'') # i.e., Invoice number
seller = Col(Utf(4), ForeignKey('branch.name'), nullable=False) # For billing/receipts
buyer = Col(Utf(4), ForeignKey('branch.name'), nullable=False) # For billing/receipts
invoicedate = Col(Date, nullable=False)
invoicenote = Col(Utf(100)) # Information concerning the invoice
check_no = Col(Utf(20))
paid = Col(Bool, nullable=False, default=False)
paydate = Col(Date)
note = Col(Utf(100)) # Extra note field if needed
checked = Col(Bool, nullable=False, default=False) # Extra boolean for matching/verifying
items = rel('InvoiceItem', backref='invoice')
def subtotal(self):
return sum([item.subtotal() for item in self.items])
def tax(self):
'''Tax is rounded to nearest integer before returning value.'''
return int(round(self.subtotal() * 0.05))
def taxtotal(self):
total = self.subtotal() + (self.tax() if self.items[0].order.applytax else 0)
return int(round(total))
#==============================================================================
# InvoiceItem class (track multiple products for one invoice)
#==============================================================================
@AddDictRepr
class InvoiceItem(Base): # Keep track of invoices/payments for one order
'''
order : backref to Order
invoice : backref to Invoice
shipmentitem : backref to ShipmentItem
'''
__tablename__ = 'invoiceitem'
id = Col(Int, primary_key=True)
invoice_id = Col(Int, ForeignKey('invoice.id'), nullable=False)
shipmentitem_id = Col(Int, ForeignKey('shipmentitem.id'), nullable=False)
order_id = Col(Int, ForeignKey('order.id'), nullable=False)
qty = Col(Int, nullable=False)
def subtotal(self):
subtotal = self.order.price * self.qty
if self.order.product.unitpriced:
subtotal *= self.order.product.units
return int(round(subtotal,0))
def total(self):
subtotal = self.subtotal()
if self.order.applytax:
subtotal *= 1.05
return int(round(subtotal,0))
# def listbox_summary(self):
# """
# Return a single line unicode summary intended for a listbox.
# """
# txt = u'{date:<10} 編號: {s.invoice_no:<10} QTY: {s.qty:>5} {s.order.product.SKU:<6} Subtotal: ${total:<6} 品名: {s.order.product.inventory_name}'
# txt = txt.format(s=self, date=str(self.invoice.invoicedate), total=self.subtotal())
# return txt
#==============================================================================
# CoGroup (company grouping class for branches)
#==============================================================================
@AddDictRepr
class CoGroup(Base):
__tablename__ = 'cogroup'
name = Col(Utf(4), primary_key=True, nullable=False) # Abbreviated name of company (2 to 4 chars)
is_active = Col(Bool, nullable=False, default=True) # Boolean for listing the company. Continuing business.
is_supplier = Col(Bool, nullable=False, default=True) # Maybe use in later versions
is_customer = Col(Bool, nullable=False, default=True) # Maybe use in later versions
branches = rel('Branch', backref='cogroup', lazy='joined') # lazy -> Attaches on retrieving a cogroup
orders = rel('Order')
products = rel('Product', backref='cogroup')
contacts = rel('Contact')
purchases = rel('Order', primaryjoin="and_(CoGroup.name==Order.group, Order.is_sale==False)") #Purchases FROM this company
sales = rel('Order', primaryjoin="and_(CoGroup.name==Order.group, Order.is_sale==True)") #Sales TO this company
openpurchases = rel('Order', primaryjoin="and_(CoGroup.name==Order.group, Order.is_sale==False, Order.is_open==True)") #Purchases FROM this company
opensales = rel('Order', primaryjoin="and_(CoGroup.name==Order.group, Order.is_sale==True, Order.is_open==True)") #Sales TO this company
#==============================================================================
# Branch class
#==============================================================================
@AddDictRepr
class Branch(Base):
__tablename__ = 'branch'
name = Col(Utf(4), primary_key=True, nullable=False) # Abbreviated name of company (2 to 4 chars)
group= Col(Utf(4), ForeignKey('cogroup.name'), nullable=False) # Name of main company representing all branches
fullname = Col(Utf(100), default=u'')
english_name = Col(Utf(100), default=u'')
tax_id = Col(Utf(8), nullable=False, default=u'')
phone = Col(Utf(20), default=u'')
fax = Col(Utf(20), default=u'')
email = Col(Utf(20), default=u'')
note = Col(Utf(100), default=u'')
address_office = Col(Utf(100), default=u'')
address_shipping = Col(Utf(100), default=u'')
address_billing = Col(Utf(100), default=u'')
address = Col(Utf(100), default=u'') # Extra address space if needed
is_active = Col(Bool, nullable=False, default=True) # Boolean for listing the company. Continuing business.
# parent = rel('CoGroup')
contacts = rel('Contact')
purchases = rel('Order', primaryjoin="and_(Branch.name==Order.seller, Order.is_sale==False)") #Purchases FROM this company
sales = rel('Order', primaryjoin="and_(Branch.name==Order.buyer, Order.is_sale==True)") #Sales TO this company
#==============================================================================
# Contact class
#==============================================================================
@AddDictRepr
class Contact(Base):
__tablename__ = 'contact'
id = Col(Int, primary_key=True)
group = Col(Utf(4), ForeignKey('cogroup.name'), nullable=False)
branch = Col(Utf(4), ForeignKey('branch.name'))
name = Col(Utf(20), nullable=False)
position = Col(Utf(20), default=u'')
phone = Col(Utf(20), default=u'')
fax = Col(Utf(20), default=u'')
email = Col(Utf(20), default=u'')
note = Col(Utf(100), default=u'')
#==============================================================================
# Product class
#==============================================================================
@AddDictRepr
class Product(Base): # Information for each unique product (including packaging)
__tablename__ = 'product'
MPN = Col(Utf(20), primary_key=True)
group = Col(Utf(4), ForeignKey('cogroup.name'), nullable=False)
product_label = Col(Utf(100), default=u'') #Optional 2nd party product name
inventory_name = Col(Utf(100), nullable=False) #Required
english_name = Col(Utf(100), default=u'')
units = Col(Float, nullable=False) #Units per SKU
UM = Col(Utf(10), nullable=False) #Unit measurement
SKU = Col(Utf(10), nullable=False) #Stock keeping unit (countable package)
SKUlong = Col(Utf(100), default=u'')
unitpriced = Col(Bool, nullable=False)
ASE_PN = Col(Utf(20)) # ASE product number
ASE_RT = Col(Utf(20)) # ASE department routing number
ASE_END = Col(Int) # Last used SKU index number for current lot
note = Col(Utf(100)) # {JSON} contains extra data, i.e. current ASE and RT numbers
# {JSON} must be appended to the end after any notes. Last char == '}'
is_supply = Col(Bool, nullable=False)
discontinued = Col(Bool, nullable=False, default=False)
curr_price = Col(Float, default=0.0)
stock = rel('Stock', backref='product')
orders = rel('Order', primaryjoin="Product.MPN==Order.MPN")
@property
def price(self):
if self.curr_price.is_integer():
return int(self.curr_price)
return self.curr_price
@property
def PrMeas(self):
'''Return the unit measure associated with the price.
PrMeas = pricing measure
'''
return self.UM if self.unitpriced or self.SKU == u'槽車' else self.SKU
def qty_available(self):
available = dict(
units = 0.0,
SKUs = 0.0,
value = 0.0,
unit_value = None,
SKU_value = None
)
for each in self.stock:
available['units'] += each.adj_unit
available['SKUs'] += each.adj_SKU
available['value'] += each.adj_value
if available['units'] != 0.0:
available['unit_value'] = available['value'] / available['units']
if available['SKUs'] != 0.0:
available['SKU_value'] = available['value'] / available['SKUs']
return available
def label(self):
'''Returns product_label, which is the client desired name.
If a product_label does not exist, then return our inventory_name
for the product.
'''
if self.product_label != u'':
return self.product_label
else:
return self.inventory_name
@property
def name(self):
'''Returns product_label, which is the client desired name.
If a product_label does not exist, then return our inventory_name
for the product.
'''
if self.product_label != u'':
return self.product_label
else:
return self.inventory_name
@property
def specs(self):
'''Short text of product key values.
"## UM SKU"
e.g. "20 kg barrel"
'''
u = self.units
units = int(u) if int(u)==u else u #Truncate if mantissa is zero
if self.SKU == u'槽車':
return u'槽車-{}'.format(self.UM)
else:
txt = u"{0} {1} {2}"
return txt.format(units,self.UM,self.SKU)
def json(self, new_dic=None):
'''Saves 'new_dic' as a json string and overwrites previous json.
Returns contents of json string as a dictionary object.
Note: Commit session after making changes.'''
if new_dic == None:
if self.note.find(u'}') != -1:
return json.loads(self.note[self.note.index(u'{'):])
else:
return {}
else:
old_dic = dict()
# Delete existing json string
if self.note.find(u'}') != -1:
old_dic = self.json()
self.note = self.note.split(u'{')[0]
# Merge and overwrite old with new.
new_dic = dict(old_dic.items() + new_dic.items())
self.note += json.dumps(new_dic)
return True
return False
#==============================================================================
# Stock class
#==============================================================================
@AddDictRepr
class Stock(Base): #For warehouse transactions
__tablename__ = 'stock'
id = Col(Int, primary_key=True)
MPN = Col(Utf(20), ForeignKey('product.MPN'), nullable=False)
date = Col(Date, nullable=False)
adj_unit = Col(Float, nullable=False) #Use units for stock amounts
adj_SKU = Col(Float) #Probably will NOT use this
adj_value = Col(Float, nullable=False) #Value of units in transaction
note = Col(Utf(100))
#==============================================================================
# Vehicle class
#==============================================================================
@AddDictRepr
class Vehicle(Base):
__tablename__ = 'vehicle'
id = Col(Utf(10), primary_key=True) #license plate number
purchasedate = Col(Date)
description = Col(Utf(100))
value = Col(Float)
note = Col(Utf(100))
#==============================================================================
# Database loading method
#==============================================================================
def get_database(db_path, echo=False):
'''Opens a database and returns an 'engine' object.'''
database = sqla.create_engine(db_path, echo=echo)
Base.metadata.create_all(database) #FIRST TIME SETUP ONLY
return database
#==============================================================================
# Testing and Debugging
#==============================================================================
if __name__ == '__main__':
engine = get_database(u'test.db', echo=False)
session = sessionmaker(bind=engine)()
session.add(Vehicle(id=u'MONKEY'))
veh = session.query(Vehicle).get(u'MONKEY')
print veh
print veh.__dict__
order = Order(orderID=u'ZV1234', seller=u'Oscorp', buyer=u'Marvel', group=u'DC comics',
is_sale=True, MPN=666, subtotal=1000, duedate=datetime.date.today(), totalskus=24)
product = Product(MPN=666, group=u'DC comics', units=12, UM=u'ounce', SKU=u'vial', unitpriced=False, is_supply=False, product_label=u'Muscle Juice', inventory_name=u'serim 234')
shipment = Shipment(shipment_no=u'003568', qty=10, order=order, shipmentdate=datetime.date.today())
session.add(product)
session.add(order)
order = session.query(Order).first()
print 'order', order
print order.formatted()
for each in order.shipments:
print each.listbox_summary()
| gpl-2.0 | -3,743,926,320,139,685,400 | 35.795009 | 181 | 0.57446 | false |
drhagen/parsita | tests/test_basic.py | 1 | 18599 | from unittest import TestCase
import pytest
from parsita import *
class LiteralTestCase(TestCase):
def test_literals(self):
class TestParsers(GeneralParsers):
a = lit('a')
bb = lit('bb')
self.assertEqual(TestParsers.a.parse('a'), Success('a'))
self.assertEqual(TestParsers.bb.parse('bb'), Success('bb'))
self.assertEqual(TestParsers.bb.parse('bbb'), Failure('Expected end of source but found b at index 2'))
self.assertEqual(TestParsers.bb.parse('aa'), Failure('Expected b but found a at index 0'))
self.assertEqual(str(TestParsers.a), "a = 'a'")
self.assertEqual(str(TestParsers.bb), "bb = 'bb'")
def test_multiple_literals(self):
class TestParsers(GeneralParsers):
ab = lit('a', 'b')
self.assertEqual(TestParsers.ab.parse('a'), Success('a'))
self.assertEqual(TestParsers.ab.parse('b'), Success('b'))
def test_or_die(self):
class TestParsers(GeneralParsers):
a = lit('a')
bb = lit('bb')
self.assertEqual(TestParsers.a.parse('a').or_die(), 'a')
self.assertRaisesRegex(ParseError, 'Expected b but found a at index 0', TestParsers.bb.parse('aa').or_die)
class PredicateTestCase(TestCase):
def test_predicate(self):
class TestParsers(GeneralParsers):
a = pred(any1, lambda x: x in ('A', 'a'), 'letter A')
d = pred(any1, str.isdigit, 'digit')
self.assertEqual(TestParsers.a.parse('a'), Success('a'))
self.assertEqual(TestParsers.a.parse('A'), Success('A'))
self.assertEqual(TestParsers.d.parse('2'), Success('2'))
self.assertEqual(TestParsers.d.parse('23'), Failure('Expected end of source but found 3 at index 1'))
self.assertEqual(TestParsers.d.parse('a'), Failure('Expected digit but found a at index 0'))
self.assertEqual(str(TestParsers.a), 'a = pred(any1, letter A)')
class ForwardDeclarationTestCase(TestCase):
def test_forward_declaration(self):
class TestParsers(GeneralParsers):
a = b
b = lit('b')
self.assertEqual(TestParsers.a.parse('b'), Success('b'))
self.assertEqual(TestParsers.a.parse('ab'), Failure('Expected b but found a at index 0'))
def test_forward_expression(self):
class TestParsers(GeneralParsers):
a = lit('a')
ca = c | a
da = d & a
c = lit('c')
d = lit('d')
self.assertEqual(TestParsers.ca.parse('c'), Success('c'))
self.assertEqual(TestParsers.ca.parse('a'), Success('a'))
self.assertEqual(TestParsers.da.parse('da'), Success(['d', 'a']))
self.assertEqual(str(TestParsers.ca), 'ca = c | a')
self.assertEqual(str(TestParsers.da), 'da = d & a')
def test_manual_forward(self):
class TestParsers(GeneralParsers):
b = fwd()
a = 'a' & b
b.define('b' & opt(a))
self.assertEqual(TestParsers.a.parse('ab'), Success(['a', ['b', []]]))
self.assertEqual(TestParsers.a.parse('abab'), Success(['a', ['b', [['a', ['b', []]]]]]))
def test_manual_forward_mutual(self):
class TestParsers(GeneralParsers):
a = fwd()
b = fwd()
a.define('a' & b)
b.define('b' & opt(a))
self.assertEqual(TestParsers.a.parse('ab'), Success(['a', ['b', []]]))
self.assertEqual(TestParsers.a.parse('abab'), Success(['a', ['b', [['a', ['b', []]]]]]))
def test_multiple_references(self):
class TestParsers(GeneralParsers):
a = lit('a')
cora = c | a
canda = c & a
c = 'c'
self.assertEqual(TestParsers.cora.parse('c'), Success('c'))
self.assertEqual(TestParsers.cora.parse('a'), Success('a'))
self.assertEqual(TestParsers.canda.parse('ca'), Success(['c', 'a']))
self.assertEqual(str(TestParsers.cora), "cora = 'c' | a")
self.assertEqual(str(TestParsers.canda), "canda = 'c' & a")
class OptionalTestCase(TestCase):
def test_optional(self):
class TestParsers(GeneralParsers):
a = lit('a')
b = opt(a)
self.assertEqual(TestParsers.b.parse('a'), Success(['a']))
self.assertEqual(TestParsers.b.parse('c'), Failure('Expected a or end of source but found c at index 0'))
self.assertEqual(str(TestParsers.b), 'b = opt(a)')
def test_optional_longer(self):
class TestParsers(GeneralParsers):
a = lit('ab')
b = opt(a)
self.assertEqual(TestParsers.b.parse('ab'), Success(['ab']))
self.assertEqual(TestParsers.b.parse('ac'), Failure('Expected b but found c at index 1'))
self.assertEqual(str(TestParsers.b), 'b = opt(a)')
def test_optional_literal(self):
class TestParsers(GeneralParsers):
b = opt('ab')
self.assertEqual(TestParsers.b.parse('ab'), Success(['ab']))
self.assertEqual(TestParsers.b.parse('ac'), Failure('Expected b but found c at index 1'))
self.assertEqual(str(TestParsers.b), "b = opt('ab')")
class AlternativeTestCase(TestCase):
def test_alternative(self):
class TestParsers(GeneralParsers):
a = lit('a')
b = lit('b')
c = lit('cd')
ab = a | b
bc = b | c
self.assertEqual(TestParsers.ab.parse('a'), Success('a'))
self.assertEqual(TestParsers.ab.parse('b'), Success('b'))
self.assertEqual(TestParsers.ab.parse('c'), Failure('Expected a or b but found c at index 0'))
self.assertEqual(TestParsers.bc.parse('cd'), Success('cd'))
self.assertEqual(TestParsers.bc.parse('ce'), Failure('Expected d but found e at index 1'))
self.assertEqual(str(TestParsers.bc), 'bc = b | c')
def test_multiple(self):
class TestParsers(GeneralParsers):
a = lit('aaaa')
b = lit('bbb')
c = lit('cc')
d = lit('d')
back = a | (b | c | d)
front = (a | b | c) | d
both = (a | b) | c | d
for parser in [TestParsers.back, TestParsers.front, TestParsers.both]:
self.assertEqual(parser.parse('aaaa'), Success('aaaa'))
self.assertEqual(parser.parse('cc'), Success('cc'))
self.assertEqual(parser.parse('bbc'), Failure('Expected b but found c at index 2'))
self.assertEqual(parser.parse('bbba'), Failure('Expected end of source but found a at index 3'))
str(TestParsers.back), 'back = a | b | c | d'
str(TestParsers.front), 'front = a | b | c | d'
str(TestParsers.both), 'both = a | b | c | d'
def test_right_or(self):
class TestParsers(GeneralParsers):
ab = 'a' | lit('b')
self.assertEqual(TestParsers.ab.parse('a'), Success('a'))
def test_multiple_messages_duplicate(self):
class TestParsers(GeneralParsers):
a = lit('a')
ab = a & 'b'
ac = a & 'c'
either = ab | ac
self.assertEqual(TestParsers.either.parse('cc'), Failure('Expected a but found c at index 0'))
class SequentialTestCase(TestCase):
def test_sequential(self):
class TestParsers(GeneralParsers):
a = lit('a')
b = lit('b')
c = lit('cd')
ab = a & b
bc = b & c
abc = a & b & c
self.assertEqual(TestParsers.ab.parse('ab'), Success(['a', 'b']))
self.assertEqual(TestParsers.bc.parse('bcd'), Success(['b', 'cd']))
self.assertEqual(TestParsers.abc.parse('abcd'), Success(['a', 'b', 'cd']))
self.assertEqual(TestParsers.abc.parse('abc'), Failure('Expected d but found end of source'))
self.assertEqual(TestParsers.abc.parse('abf'), Failure('Expected c but found f at index 2'))
self.assertEqual(str(TestParsers.abc), 'abc = a & b & c')
class DiscardTestCase(TestCase):
def test_discard_left(self):
class TestParsers(GeneralParsers):
a = lit('a')
b = lit('b')
ab = a >> b
ac = a >> c
c = lit('c')
self.assertEqual(TestParsers.ab.parse('ab'), Success('b'))
self.assertEqual(TestParsers.ac.parse('ac'), Success('c'))
self.assertEqual(str(TestParsers.ac), 'ac = a >> c')
def test_discard_right(self):
class TestParsers(GeneralParsers):
a = lit('a')
b = lit('b')
ab = a << b
ac = a << c
c = lit('c')
self.assertEqual(TestParsers.ab.parse('ab'), Success('a'))
self.assertEqual(TestParsers.ac.parse('ac'), Success('a'))
self.assertEqual(TestParsers.ac.parse('aa'), Failure('Expected c but found a at index 1'))
self.assertEqual(str(TestParsers.ac), 'ac = a << c')
def test_discard_bare_literals(self):
class TestParsers(GeneralParsers):
a = lit('a')
b = 'b'
rshift = a >> b
rrshift = b >> a
lshift = a << b
rlshift = b << a
self.assertEqual(TestParsers.rshift.parse('ab'), Success('b'))
self.assertEqual(TestParsers.rrshift.parse('ba'), Success('a'))
self.assertEqual(TestParsers.lshift.parse('ab'), Success('a'))
self.assertEqual(TestParsers.rlshift.parse('ba'), Success('b'))
class RepeatedTestCase(TestCase):
def test_repeated(self):
class TestParsers(GeneralParsers):
bs = rep1('b')
cs = rep('c')
self.assertEqual(TestParsers.bs.parse('bbbb'), Success(['b', 'b', 'b', 'b']))
self.assertEqual(TestParsers.bs.parse('b'), Success(['b']))
self.assertEqual(TestParsers.bs.parse(''), Failure('Expected b but found end of source'))
self.assertEqual(TestParsers.bs.parse('bbbc'), Failure('Expected b or end of source but found c at index 3'))
self.assertEqual(TestParsers.cs.parse('ccc'), Success(['c', 'c', 'c']))
self.assertEqual(TestParsers.cs.parse('c'), Success(['c']))
self.assertEqual(TestParsers.cs.parse(''), Success([]))
self.assertEqual(TestParsers.cs.parse('cccb'), Failure('Expected c or end of source but found b at index 3'))
self.assertEqual(str(TestParsers.bs), "bs = rep1('b')")
self.assertEqual(str(TestParsers.cs), "cs = rep('c')")
def test_repeated_longer(self):
class TestParsers(GeneralParsers):
bf = rep1('bf')
cf = rep('cf')
self.assertEqual(TestParsers.bf.parse('bfbf'), Success(['bf', 'bf']))
self.assertEqual(TestParsers.bf.parse('bf'), Success(['bf']))
self.assertEqual(TestParsers.bf.parse(''), Failure('Expected b but found end of source'))
self.assertEqual(TestParsers.bf.parse('bfbc'), Failure('Expected f but found c at index 3'))
self.assertEqual(TestParsers.cf.parse('cfcfcf'), Success(['cf', 'cf', 'cf']))
self.assertEqual(TestParsers.cf.parse('cf'), Success(['cf']))
self.assertEqual(TestParsers.cf.parse(''), Success([]))
self.assertEqual(TestParsers.cf.parse('cfcb'), Failure('Expected f but found b at index 3'))
self.assertEqual(str(TestParsers.bf), "bf = rep1('bf')")
self.assertEqual(str(TestParsers.cf), "cf = rep('cf')")
def test_repeated_separated(self):
class TestParsers(GeneralParsers):
bs = rep1sep('b', ',')
cs = repsep('c', ',')
self.assertEqual(TestParsers.bs.parse('b,b,b'), Success(['b', 'b', 'b']))
self.assertEqual(TestParsers.bs.parse('b'), Success(['b']))
self.assertEqual(TestParsers.bs.parse(''), Failure('Expected b but found end of source'))
self.assertEqual(TestParsers.cs.parse('c,c,c'), Success(['c', 'c', 'c']))
self.assertEqual(TestParsers.cs.parse('c'), Success(['c']))
self.assertEqual(TestParsers.cs.parse(''), Success([]))
self.assertEqual(str(TestParsers.bs), "bs = rep1sep('b', ',')")
self.assertEqual(str(TestParsers.cs), "cs = repsep('c', ',')")
def test_repeated_separated_nonliteral(self):
class TestParsers(GeneralParsers):
bs = rep1sep('b', opt(','))
cs = repsep('c', opt(','))
self.assertEqual(TestParsers.bs.parse('b,bb'), Success(['b', 'b', 'b']))
self.assertEqual(TestParsers.bs.parse('b'), Success(['b']))
self.assertEqual(TestParsers.bs.parse(''), Failure('Expected b but found end of source'))
self.assertEqual(TestParsers.cs.parse('cc,c'), Success(['c', 'c', 'c']))
self.assertEqual(TestParsers.cs.parse('c'), Success(['c']))
self.assertEqual(TestParsers.cs.parse(''), Success([]))
self.assertEqual(str(TestParsers.bs), "bs = rep1sep('b', opt(','))")
self.assertEqual(str(TestParsers.cs), "cs = repsep('c', opt(','))")
@pytest.mark.timeout(2)
def test_infinite_recursion_protection(self):
class TestParsers(GeneralParsers):
bad_rep = rep(opt('a'))
bad_rep1 = rep1(opt('a'))
bad_repsep = repsep(opt('a'), opt(':'))
bad_rep1sep = rep1sep(opt('a'), opt(':'))
# Recursion happens in middle of stream
for parser in (TestParsers.bad_rep, TestParsers.bad_rep1, TestParsers.bad_repsep, TestParsers.bad_rep1sep):
with self.assertRaisesRegex(RuntimeError,
'Infinite recursion detected in '
r"bad_rep1?(sep)? = rep1?(sep)?\(opt\('a'\)(, opt\(':'\))?\); "
'empty string was matched and will be matched forever at index 2 before b'):
parser.parse('aab')
# Recursion happens at end of stream
for parser in (TestParsers.bad_rep, TestParsers.bad_rep1, TestParsers.bad_repsep, TestParsers.bad_rep1sep):
with self.assertRaisesRegex(RuntimeError,
'Infinite recursion detected in '
r"bad_rep1?(sep)? = rep1?(sep)?\(opt\('a'\)(, opt\(':'\))?\); "
'empty string was matched and will be matched forever at end of source'):
parser.parse('aa')
class ConversionTestCase(TestCase):
def test_conversion(self):
class TestParsers(GeneralParsers):
one = lit('1') > int
two = lit('2') > int
twelve = one & two > (lambda x: x[0] * 10 + x[1])
def make_twentyone(x):
return x[0] * 10 + x[1]
twentyone = two & one > make_twentyone
self.assertEqual(TestParsers.one.parse('1'), Success(1))
self.assertEqual(TestParsers.twelve.parse('12'), Success(12))
self.assertEqual(TestParsers.twentyone.parse('21'), Success(21))
self.assertEqual(str(TestParsers.twelve), 'twelve = one & two')
self.assertEqual(str(TestParsers.twentyone), 'twentyone = two & one')
def test_recursion(self):
class TestParsers(GeneralParsers):
one = lit('1') > float
six = lit('6') > float
eleven = lit('11') > float
numbers = eleven | one | six
def make_expr(x):
digits1, maybe_expr = x
if maybe_expr:
digits2 = maybe_expr[0]
return digits1 + digits2
else:
return digits1
expr = numbers & opt('+' >> expr) > make_expr
self.assertEqual(TestParsers.expr.parse('11'), Success(11))
self.assertEqual(TestParsers.expr.parse('6+11'), Success(17))
self.assertEqual(TestParsers.expr.parse('1+6+6'), Success(13))
class ProtectionTestCase(TestCase):
def test_protection(self):
class TestParsers(GeneralParsers):
ab = lit('a') & lit('b')
abc = ab & 'c'
dab = 'd' & ab
self.assertEqual(TestParsers.abc.parse('abc'), Success([['a', 'b'], 'c']))
self.assertEqual(TestParsers.dab.parse('dab'), Success(['d', ['a', 'b']]))
class EndOfSourceTestCase(TestCase):
def test_protection(self):
class TestParsers(GeneralParsers):
end_a = 'a' << eof
b = lit('b')
bba = rep(b | end_a)
self.assertEqual(TestParsers.bba.parse('bba'), Success(['b', 'b', 'a']))
self.assertEqual(TestParsers.bba.parse('a'), Success(['a']))
self.assertEqual(TestParsers.bba.parse('ab'), Failure('Expected end of source but found b at index 1'))
self.assertEqual(str(TestParsers.end_a), "end_a = 'a' << eof")
class SuccessFailureTestCase(TestCase):
def test_protection(self):
class TestParsers(GeneralParsers):
aaa = rep('a') & success(1) & rep('b')
bbb = 'aa' & failure('something else') & 'bb'
self.assertEqual(TestParsers.aaa.parse('aabb'), Success([['a', 'a'], 1, ['b', 'b']]))
self.assertEqual(TestParsers.aaa.parse(''), Success([[], 1, []]))
self.assertEqual(TestParsers.bbb.parse('aabb'), Failure('Expected something else but found b at index 2'))
self.assertEqual(str(TestParsers.aaa), "aaa = rep('a') & success(1) & rep('b')")
self.assertEqual(str(TestParsers.bbb), "bbb = 'aa' & failure('something else') & 'bb'")
class AnyTestCase(TestCase):
def test_any(self):
class TestParsers(GeneralParsers):
any2 = any1 & any1
self.assertEqual(TestParsers.any2.parse('ab'), Success(['a', 'b']))
self.assertEqual(TestParsers.any2.parse('a'), Failure('Expected anything but found end of source'))
self.assertEqual(str(TestParsers.any2), 'any2 = any1 & any1')
class OptionsResetTest(TestCase):
def test_nested_class(self):
class TestOuter(GeneralParsers):
start = '%'
class TestInner(GeneralParsers):
inner = '"' >> rep(lit('a', 'b', 'c')) << '"'
wrapped = '(' >> TestInner.inner << ')'
outer = start >> wrapped
self.assertEqual(TestOuter.outer.parse('%("abc")'), Success(['a', 'b', 'c']))
self.assertIsInstance(TestOuter.outer.parse('%("abc ")'), Failure)
self.assertIsInstance(TestOuter.outer.parse(' %("abc")'), Failure)
self.assertIsInstance(TestOuter.outer.parse('%("abc") '), Failure)
class MetaclassTest(TestCase):
def test_disallow_instatiation(self):
class TestParsers(GeneralParsers):
a = lit('a')
bb = lit('bb')
with self.assertRaises(TypeError):
_ = TestParsers()
| mit | 1,325,069,052,045,348,000 | 40.984199 | 117 | 0.571644 | false |
drewkhoury/aws-daredevil | daredevil.py | 1 | 2729 | import boto3
from pprint import pprint
from datetime import datetime
import time
def make_tag_dict(ec2_object):
"""Given an tagable ec2_object, return dictionary of existing tags."""
tag_dict = {}
if ec2_object.tags is None: return tag_dict
for tag in ec2_object.tags:
tag_dict[tag['Key']] = tag['Value']
return tag_dict
def make_tag_string(ec2_object):
"""Given an tagable ec2_object, return string of existing tags."""
tag_string = ''
if ec2_object.tags is None: return tag_string
for tag in ec2_object.tags:
tag_string = tag_string + tag['Key'] + "=" + tag['Value'] + " "
return tag_string
def time_difference(the_time):
# convert to timestamp
the_time_ts = time.mktime(the_time.timetuple())
# current time as timestamp
now = datetime.utcnow()
now_ts = time.mktime(now.timetuple())
# find the difference in days (how many days the instance has been up)
difference_ts = now_ts-the_time_ts
return ( difference_ts/60/60/24 )
def get_ec2_instances(region):
print ''
print "REGION: %s" % (region)
print '-----------------------'
ec2 = boto3.resource('ec2', region_name=region)
instances = ec2.instances.filter(
Filters=[{'Name': 'instance-state-name', 'Values': ['running']}])
for instance in instances:
# nicer structures
tag_dict = make_tag_dict(instance)
tag_string = make_tag_string(instance)
# clean the name
if 'Name' in tag_dict:
clean_name = tag_dict['Name']
else:
clean_name = '<no-name>'
# find out how many days the EC2 has been running
days_running = time_difference(instance.launch_time)
days_running = round(days_running,2)
# print the info
print "%s - %s - %s - %s - %s - %s - %s - %s days running" % (instance.vpc_id, instance.subnet_id, instance.id, instance.image_id, instance.instance_type, instance.state['Name'], clean_name, days_running)#, instance.launch_time, tag_string)
#pprint (instance.__dict__)
#print "this is the {id} ".format(**instance.__dict__)
def lambda_handler(event, context):
print '-------------------------'
print '----- start -----'
print ''
# regions = ['us-east-1','us-west-2','us-west-1','eu-west-1','eu-central-1','ap-southeast-1','ap-southeast-2','ap-northeast-1','sa-east-1']
# quicker
regions = ['ap-southeast-2','ap-northeast-1']
for region in regions: get_ec2_instances(region)
print ''
print '----- end -----'
print '-------------------------'
return 'foo'
| mit | 3,425,234,492,745,836,500 | 30.744186 | 248 | 0.573104 | false |
JPalmerio/GRB_population_code | catalogs/GBM_cat/GBM_Ep_constraint_testing.py | 1 | 1178 | import sys
import platform
if platform.system() == 'Linux':
sys.path.insert(0,'/nethome/palmerio/Dropbox/Plotting_GUI/Src')
elif platform.system() == 'Darwin':
sys.path.insert(0,'/Users/palmerio/Dropbox/Plotting_GUI/Src')
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import plotting_functions as pf
from matplotlib.transforms import blended_transform_factory
plt.style.use('ggplot')
fig = plt.figure()
ax = fig.add_subplot(111)
root_dir = '/nethome/palmerio/1ere_annee/Frederic/GRB_population_code/Model_outputs/'
filename = root_dir +'run_LIA/EpGBM_constraint.dat'
Ep_bins = pf.read_data(filename, 0)
Ep_hist_mod = pf.read_data(filename, 1)
Ep_hist_obs = pf.read_data(filename, 2)
x=np.linspace(1.,4., 500)
y = max(Ep_hist_obs) * pf.gaussian(x, 2.25, 0.35)
y2 = max(Ep_hist_obs) * pf.gaussian(x, 2.25, 0.375)
ep = np.linspace(1,4, 100)
ep_gauss = pf.gaussian(ep, 2.2, 0.4)*max(Ep_hist_obs)
ax.plot(Ep_bins, Ep_hist_obs, label = 'Observations')
#ax.plot(Ep_bins, Ep_hist_mod, label = 'MC simulation')
#ax.plot(ep, ep_gauss, ls=':', lw=2)
ax.plot(x,y, label='gaussian')
ax.plot(x,y2, label='gaussian2')
ax.legend(loc='best')
plt.show()
| gpl-3.0 | 6,795,155,745,150,622,000 | 24.06383 | 85 | 0.705433 | false |
Ken69267/gpytage | gpytage/rename.py | 1 | 4560 | #!/usr/bin/env python
#
# rename.py GPytage module
#
############################################################################
# Copyright (C) 2009-2010 by Kenneth Prugh #
# [email protected] #
# #
# This program is free software; you can redistribute it and#or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation under version 2 of the license. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
############################################################################
import pygtk; pygtk.require("2.0")
import gtk
from config import get_config_path
from datastore import reinitializeDatabase
from PackageFileObj import PackageFileObj
from FolderObj import FolderObj
from sys import stderr
from os import rename
from errorDialog import errorDialog
from fileOperations import ensureNotModified
msg = "A file cannot be renamed with unsaved changes. Please save your changes."
def renameFile(*args):
""" Renames the currently selected file """
from leftpanel import leftview
model, iter = leftview.get_selection().get_selected()
from datastore import F_REF
try:
object = model.get_value(iter, F_REF)
if isinstance(object, PackageFileObj): # A file
type = "File"
if object.parent == None:
setFolder = get_config_path()
else:
setFolder = object.parent.path
elif isinstance(object, FolderObj): # A folder
type = "Directory"
setFolder = object.parent.path
if ensureNotModified(msg):
__createRenameDialog(object, type, setFolder)
except TypeError,e:
print >>stderr, "__renameFile:",e
def __createRenameDialog(object, type, setFolder):
""" Spawms the Rename Dialog where a user can choose what the file should
be renamed to """
fc = gtk.FileChooserDialog("Rename file...", None,
gtk.FILE_CHOOSER_ACTION_SAVE, (gtk.STOCK_CANCEL,
gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
fc.set_do_overwrite_confirmation(True)
fc.set_filename(object.path) #Set the fc to the object to be renamed
fc.set_extra_widget(gtk.Label("Renaming " + object.path))
response = fc.run()
if response == gtk.RESPONSE_ACCEPT:
if fc.get_filename() != None:
__writeRenamedFile(object.path, fc.get_filename())
reinitializeDatabase()
__reselectAfterRename(fc.get_filename(), type)
else:
print >>stderr, "Invalid rename request"
fc.destroy()
def __writeRenamedFile(oldFile, newFile):
""" Performs the actual renaming of the file """
try:
rename(oldFile, newFile)
print oldFile + " renamed to " + newFile
except OSError,e:
print >>stderr, "Rename: ",e
d = errorDialog("Error Renaming...", str(e))
d.spawn()
def __reselectAfterRename(filePath, type):
""" Reselects the parent folder of the deleted object """
from leftpanel import leftview
model = leftview.get_model()
model.foreach(getMatch, [filePath, leftview, type])
def getMatch(model, path, iter, data):
""" Obtain the match and perform the selection """
testObject = model.get_value(iter, 1) #col 1 stores the reference
# clarify values passed in from data list
filePath = data[0]
leftview = data[1]
#type = data[2]
if testObject.path == filePath:
# We found the file object we just renamed, lets select it
leftview.expand_to_path(path)
leftview.set_cursor(path, None, False)
return True
else:
return False
| gpl-2.0 | -8,155,855,760,534,155,000 | 41.616822 | 80 | 0.573465 | false |
kevindiltinero/seass3 | src/thefile.py | 1 | 1064 | def get_cmmds(filename):
values = []
next = []
final = []
file = open(filename, 'r')
for line in file:
values.append(line.split(' '))
for i in range(len(values)):
for j in range(4):
temporary = values[i][j]
if temporary.endswith('\n'):
next.append(temporary[:-1])
else:
next.append(temporary)
for i in range(len(next)):
temporary = next[i]
if ',' in temporary:
bridge = temporary.split(',')
for element in bridge:
final.append(element)
else:
final.append(temporary)
sublist = [final[n:n+6] for n in range(0, len(final), 6)]
return sublist
def execute_cmmds(seats, cmmd, x1, y1, blank, x2, y2):
if cmmd == toggle:
seats = toggle.toggle_it(x1, y1, x2, y2, seats)
elif cmmd == empty:
seats = empty.empty_it(x1, y1, x2, y2, seats)
elif cmmd == occupy:
seats = occupy.occupy_seats(x1, y1, x2, y2, seats) | bsd-2-clause | -2,216,852,053,547,423,700 | 27.783784 | 61 | 0.511278 | false |
steveyen/moxi | t/moxi_mock_b2b.py | 1 | 30300 | import sys
import string
import socket
import select
import unittest
import threading
import time
import re
import struct
from memcacheConstants import REQ_MAGIC_BYTE, RES_MAGIC_BYTE
from memcacheConstants import REQ_PKT_FMT, RES_PKT_FMT, MIN_RECV_PACKET
from memcacheConstants import SET_PKT_FMT, DEL_PKT_FMT, INCRDECR_RES_FMT
import memcacheConstants
import moxi_mock_server
# Before you run moxi_mock_b2b.py, start a moxi like...
#
# ./moxi -z 11333=localhost:11311 -p 0 -U 0 -vvv -t 1 -O stderr
# -Z downstream_max=1
#
# Or, if you're using the vbucket-aware moxi...
#
# ./moxi -z ./t/moxi_mock.cfg -p 0 -U 0 -vvv -t 1 -O stderr
# -Z downstream_max=1,downstream_protocol=binary
#
# Then...
#
# python ./t/moxi_mock_b2b.py
#
# ----------------------------------
class TestProxyBinary(moxi_mock_server.ProxyClientBase):
def __init__(self, x):
moxi_mock_server.ProxyClientBase.__init__(self, x)
def SOON_testBasicVersion(self):
"""Test version command does not reach mock server"""
self.client_connect()
self.client_send("version\r\n")
self.client_recv("VERSION .*\r\n")
self.assertTrue(self.mock_quiet())
self.client_connect()
self.client_send("version\r\n")
self.client_recv("VERSION .*\r\n")
self.assertTrue(self.mock_quiet())
def testBasicSerialGet(self):
"""Test basic serial get commands"""
self.client_connect()
self.client_send(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_recv(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_send(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
self.client_recv(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
self.client_send(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_recv(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_send(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
self.client_recv(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
self.client_send(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_recv(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_send(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
self.client_recv(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
def testBasicQuit(self):
"""Test quit command does not reach mock server"""
self.client_connect()
self.client_send(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_recv(self.packReq(memcacheConstants.CMD_GETK, key='keyNotThere0'))
self.mock_send(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
self.client_recv(self.packRes(memcacheConstants.CMD_GETK,
status=memcacheConstants.ERR_NOT_FOUND,
key='keyNotThere0'))
self.client_send(self.packReq(memcacheConstants.CMD_QUIT))
self.assertTrue(self.mock_quiet())
def SOON_testBogusCommand(self):
"""Test bogus commands do not reach mock server"""
self.client_connect()
self.client_send('bogus\r\n')
self.client_recv('.*ERROR.*\r\n')
self.assertTrue(self.mock_quiet())
def doTestSimpleSet(self, flg=0, exp=0, val='1'):
"""Test simple set against mock server"""
self.client_connect()
self.client_send(self.packReq(memcacheConstants.CMD_SET, key='simpleSet',
extraHeader=struct.pack(memcacheConstants.SET_PKT_FMT, flg, exp),
val=val))
self.mock_recv(self.packReq(memcacheConstants.CMD_SET, key='simpleSet',
extraHeader=struct.pack(memcacheConstants.SET_PKT_FMT, flg, exp),
val=val))
self.mock_send(self.packRes(memcacheConstants.CMD_SET, status=0))
self.client_recv(self.packRes(memcacheConstants.CMD_SET, status=0))
def testSimpleSet(self):
self.doTestSimpleSet()
def testSimpleSetWithParams(self):
self.doTestSimpleSet(flg=1234, exp=4321)
def testSimpleSetWithEmptyVal(self):
self.doTestSimpleSet(flg=1234, exp=4321, val='')
def doTestFlushAllBroadcast(self, exp=0):
"""Test flush_all scatter/gather"""
self.client_connect()
self.client_send(self.packReq(memcacheConstants.CMD_FLUSH,
extraHeader=struct.pack(memcacheConstants.FLUSH_PKT_FMT, exp)))
self.mock_recv(self.packReq(memcacheConstants.CMD_FLUSH,
extraHeader=struct.pack(memcacheConstants.FLUSH_PKT_FMT, exp)))
self.mock_send(self.packRes(memcacheConstants.CMD_FLUSH, status=0))
self.client_recv(self.packRes(memcacheConstants.CMD_FLUSH, status=0))
def testFlushAllBroadcast(self):
self.doTestFlushAllBroadcast()
def testFlushAllWithTime(self):
self.doTestFlushAllBroadcast(exp=1234)
def testSplitResponseOverSeveralWrites(self):
"""Test split a response over several writes"""
self.client_connect()
self.client_send(self.packReq(memcacheConstants.CMD_SET, key='splitResponse',
extraHeader=struct.pack(memcacheConstants.SET_PKT_FMT, 0, 0),
val='1'))
self.mock_recv(self.packReq(memcacheConstants.CMD_SET, key='splitResponse',
extraHeader=struct.pack(memcacheConstants.SET_PKT_FMT, 0, 0),
val='1'))
r = self.packRes(memcacheConstants.CMD_SET, status=0)
self.mock_send(r[0:3])
self.wait(1)
self.mock_send(r[3:6])
self.wait(1)
self.mock_send(r[6:22])
self.wait(1)
self.mock_send(r[22:]) # Header is 24 bytes.
self.client_recv(r)
def testSplitRequestOverSeveralWrites(self):
"""Test split a request over several writes"""
self.client_connect()
r = self.packReq(memcacheConstants.CMD_SET, key='splitRequest',
extraHeader=struct.pack(memcacheConstants.SET_PKT_FMT, 0, 0),
val='hello')
self.client_send(r[0:3])
self.wait(1)
self.client_send(r[3:24])
self.wait(1)
self.client_send(r[24:26])
self.wait(1)
self.client_send(r[26:])
self.mock_recv(r)
self.mock_send(self.packRes(memcacheConstants.CMD_SET, status=0))
self.client_recv(self.packRes(memcacheConstants.CMD_SET, status=0))
def testTerminateResponseWithServerClose(self):
"""Test chop the response with a server close"""
self.client_connect()
r = self.packReq(memcacheConstants.CMD_SET, key='chopped',
extraHeader=struct.pack(memcacheConstants.SET_PKT_FMT, 0, 0),
val='1')
self.client_send(r)
self.mock_recv(r)
self.mock_close()
self.client_recv('.*ERROR .*\r\n') # Oddly, this passes due to the error message.
def testMultiGetValueAllMiss(self):
"""Test the proxy handles VALUE response"""
self.client_connect()
r = (self.packReq(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13) +
self.packReq(memcacheConstants.CMD_NOOP))
self.client_send(r)
self.mock_recv(r)
self.mock_send(self.packRes(memcacheConstants.CMD_NOOP))
self.client_recv(self.packRes(memcacheConstants.CMD_NOOP))
def testMultiGetValueSomeHit(self):
self.client_connect()
r = (self.packReq(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13) +
self.packReq(memcacheConstants.CMD_NOOP))
self.client_send(r)
self.mock_recv(r)
self.mock_send(self.packRes(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 567),
val='0123456789'))
self.mock_send(self.packRes(memcacheConstants.CMD_NOOP))
self.client_recv(self.packRes(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 567),
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
def testMultiGetValueAllHit(self):
self.client_connect()
r = (self.packReq(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13) +
self.packReq(memcacheConstants.CMD_NOOP))
self.client_send(r)
self.mock_recv(r)
self.mock_send(self.packRes(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789'))
self.mock_send(self.packRes(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789'))
self.mock_send(self.packRes(memcacheConstants.CMD_NOOP))
self.client_recv(
self.packRes(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789') +
self.packRes(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
def testMultiGetValueAllReversedHit(self):
self.client_connect()
r = (self.packReq(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13) +
self.packReq(memcacheConstants.CMD_NOOP))
self.client_send(r)
self.mock_recv(r)
self.mock_send(self.packRes(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789'))
self.mock_send(self.packRes(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789'))
self.mock_send(self.packRes(memcacheConstants.CMD_NOOP))
self.client_recv(
self.packRes(memcacheConstants.CMD_GETKQ, key='someVal1', opaque=13,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789') +
self.packRes(memcacheConstants.CMD_GETKQ, key='someVal0', opaque=4,
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
def testGetEmptyValue(self):
"""Test the proxy handles empty VALUE response"""
self.client_connect()
r = self.packReq(memcacheConstants.CMD_GETK, key='someVal')
self.client_send(r)
self.mock_recv(r)
q = self.packRes(memcacheConstants.CMD_GETK, key='someVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='')
self.mock_send(q)
self.client_recv(q)
def SOON_testTerminateResponseWithServerCloseInValue(self):
"""Test chop the VALUE response with a server close"""
self.client_connect()
self.client_send('get someChoppedVal\r\n')
self.mock_recv(self.packReq(memcacheConstants.CMD_GETK, key='someChoppedVal'))
r = self.packRes(memcacheConstants.CMD_GETK, key='someChoppedVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789')
self.mock_send(r[0:30]) # Header (24) + Ext (4) + Value (10) == 38, so missing a few bytes.
self.mock_close()
self.client_recv('END\r\n')
def SOON_testTerminateResponseWithServerCloseIn2ndValue(self):
"""Test chop the 2nd VALUE response with a server close"""
self.client_connect()
self.client_send('get someWholeVal someChoppedVal\r\n')
self.mock_recv(self.packReq(memcacheConstants.CMD_GETKQ, key='someWholeVal', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someChoppedVal', opaque=17) +
self.packReq(memcacheConstants.CMD_NOOP))
r = (self.packRes(memcacheConstants.CMD_GETK, key='someWholeVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=4,
val='0123456789') +
self.packRes(memcacheConstants.CMD_GETK, key='someChoppedVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=17,
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
self.mock_send(r[0:(24 + 4 + 12 + 10 + 5)])
self.mock_close()
self.client_recv('VALUE someWholeVal 0 10\r\n0123456789\r\nEND\r\n')
def SOON_testTerminateResponseWithServerCloseIn2ndValueData(self):
"""Test chop the 2nd VALUE data response with a server close"""
self.client_connect()
self.client_send('get someWholeVal someChoppedVal\r\n')
self.mock_recv(self.packReq(memcacheConstants.CMD_GETKQ, key='someWholeVal', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someChoppedVal', opaque=17) +
self.packReq(memcacheConstants.CMD_NOOP))
r = (self.packRes(memcacheConstants.CMD_GETK, key='someWholeVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=4,
val='0123456789') +
self.packRes(memcacheConstants.CMD_GETK, key='someChoppedVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=17,
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
self.mock_send(r[0:(24 + 4 + 12 + 10 + 24 + 4 + 20)])
self.mock_close()
self.client_recv('VALUE someWholeVal 0 10\r\n0123456789\r\nEND\r\n')
def SOON_testTerminateResponseWithServerCloseInNOOP(self):
"""Test chop NOOP terminator"""
self.client_connect()
self.client_send('get someWholeVal someChoppedVal\r\n')
self.mock_recv(self.packReq(memcacheConstants.CMD_GETKQ, key='someWholeVal', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someChoppedVal', opaque=17) +
self.packReq(memcacheConstants.CMD_NOOP))
r = (self.packRes(memcacheConstants.CMD_GETK, key='someWholeVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=4,
val='0123456789') +
self.packRes(memcacheConstants.CMD_GETK, key='someChoppedVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=17,
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
self.mock_send(r[:-4])
self.mock_close()
# TODO: Need to diagnose why moxi gives this response.
self.client_recv('VALUE someWholeVal 0 10\r\n0123456789\r\n' +
'END\r\n')
def SOON_testTerminateResponseWithServerCloseAfterValueHeader(self):
"""Test chop response after 2nd item header"""
self.client_connect()
self.client_send('get someWholeVal someChoppedVal\r\n')
self.mock_recv(self.packReq(memcacheConstants.CMD_GETKQ, key='someWholeVal', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someChoppedVal', opaque=17) +
self.packReq(memcacheConstants.CMD_NOOP))
r = (self.packRes(memcacheConstants.CMD_GETK, key='someWholeVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=4,
val='0123456789') +
self.packRes(memcacheConstants.CMD_GETK, key='someChoppedVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=17,
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
self.mock_send(r[0:(24 + 4 + 12 + 10 + 24)])
self.mock_close()
self.client_recv('VALUE someWholeVal 0 10\r\n0123456789\r\n' +
'END\r\n')
def SOON_testTerminateResponseWithServerCloseAfter1stItem(self):
"""Test chop response after 1st item"""
self.client_connect()
self.client_send('get someWholeVal someChoppedVal\r\n')
self.mock_recv(self.packReq(memcacheConstants.CMD_GETKQ, key='someWholeVal', opaque=4) +
self.packReq(memcacheConstants.CMD_GETKQ, key='someChoppedVal', opaque=17) +
self.packReq(memcacheConstants.CMD_NOOP))
r = (self.packRes(memcacheConstants.CMD_GETK, key='someWholeVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=4,
val='0123456789') +
self.packRes(memcacheConstants.CMD_GETK, key='someChoppedVal',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
opaque=17,
val='0123456789') +
self.packRes(memcacheConstants.CMD_NOOP))
self.mock_send(r[0:(24 + 4 + 12 + 10)])
self.mock_close()
self.client_recv('VALUE someWholeVal 0 10\r\n0123456789\r\n' +
'END\r\n')
def testServerGoingDownAndUp(self):
"""Test server going up and down with no client impact"""
self.client_connect()
r = self.packReq(memcacheConstants.CMD_GETK, key='someUp')
self.client_send(r)
self.mock_recv(r)
q = self.packRes(memcacheConstants.CMD_GETK, key='someUp',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789')
self.mock_send(q)
self.client_recv(q)
self.mock_close()
self.client_send(r)
self.mock_recv(r)
self.mock_send(q)
self.client_recv(q)
def testServerGoingDownAndUpAfterResponse(self):
"""Test server going up and down after response with no client impact"""
self.client_connect()
r = self.packReq(memcacheConstants.CMD_GETK, key='someUp')
self.client_send(r)
self.mock_recv(r)
q = self.packRes(memcacheConstants.CMD_GETK, key='someUp',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789')
self.mock_send(q)
self.mock_close() # Try close before client_recv().
self.client_recv(q)
self.client_send(r)
self.mock_recv(r)
self.mock_send(q)
self.client_recv(q)
def testTwoSerialClients(self):
"""Test two serial clients"""
# Assuming proxy's downstream_max is 1,
# and number of threads is 1.
self.client_connect(0)
r = self.packReq(memcacheConstants.CMD_GETK, key='client0')
self.client_send(r)
self.mock_recv(r)
q = self.packRes(memcacheConstants.CMD_GETK, key='client0',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789')
self.mock_send(q)
self.client_recv(q)
# Note that mock server sees 1 session that's reused
# even though two clients are connected.
self.client_connect(1)
r = self.packReq(memcacheConstants.CMD_GETK, key='client1')
self.client_send(r)
self.mock_recv(r)
q = self.packRes(memcacheConstants.CMD_GETK, key='client1',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789')
self.mock_send(q)
self.client_recv(q)
def testTwoSerialClientsConnectingUpfront(self):
"""Test two serial clients that both connect upfront"""
# Assuming proxy's downstream_max is 1,
# and number of threads is 1.
self.client_connect(0)
self.client_connect(1)
r = self.packReq(memcacheConstants.CMD_GETK, key='client0')
self.client_send(r)
self.mock_recv(r)
q = self.packRes(memcacheConstants.CMD_GETK, key='client0',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789')
self.mock_send(q)
self.client_recv(q)
# Note that mock server sees 1 session that's reused
# even though two clients are connected.
r = self.packReq(memcacheConstants.CMD_GETK, key='client1')
self.client_send(r)
self.mock_recv(r)
q = self.packRes(memcacheConstants.CMD_GETK, key='client1',
extraHeader=struct.pack(memcacheConstants.GET_RES_FMT, 0),
val='0123456789')
self.mock_send(q)
self.client_recv(q)
# Dedupe of keys is disabled for now in vbucket-aware moxi.
#
def TODO_testGetSquash(self):
"""Test multiget by multiple clients are deduped"""
# Assuming proxy's downstream_max is 1,
# and number of threads is 1.
self.client_connect(0)
self.client_connect(1)
self.client_connect(2)
self.client_send('get cork0\r\n', 0)
self.mock_recv('get cork0\r\n', 0)
# Mock server is 'busy' at this point, so
# any client sends should be able to be
# de-duplicated by the proxy.
self.client_send('get a b c\r\n', 1)
self.client_send('get b c d\r\n', 2)
self.wait(10)
self.mock_send('END\r\n', 0)
self.client_recv('END\r\n', 0)
self.mock_recv('get a b c d\r\n', 0)
self.mock_send('VALUE a 0 1\r\na\r\n', 0)
self.mock_send('VALUE b 0 1\r\nb\r\n', 0)
self.mock_send('VALUE c 0 1\r\nc\r\n', 0)
self.mock_send('VALUE d 0 1\r\nd\r\n', 0)
self.mock_send('END\r\n', 0)
self.client_recv('VALUE a 0 1\r\na\r\n' +
'VALUE b 0 1\r\nb\r\n' +
'VALUE c 0 1\r\nc\r\n' +
'END\r\n', 1)
self.client_recv('VALUE b 0 1\r\nb\r\n' +
'VALUE c 0 1\r\nc\r\n' +
'VALUE d 0 1\r\nd\r\n' +
'END\r\n', 2)
# Dedupe of keys is disabled for now in vbucket-aware moxi.
#
def TODO_testGetSquashOneKey(self):
"""Test multiget of one key by multiple clients are deduped"""
# Assuming proxy's downstream_max is 1,
# and number of threads is 1.
self.client_connect(0)
self.client_connect(1)
self.client_connect(2)
self.client_connect(3)
self.client_connect(4)
self.client_send('get wait0\r\n', 0)
self.mock_recv('get wait0\r\n', 0)
# Mock server is 'busy' at this point, so
# any client sends should be able to be
# de-duplicated by the proxy.
self.client_send('get a\r\n', 1)
self.client_send('get a\r\n', 2)
self.client_send('get a\r\n', 3)
self.client_send('get a\r\n', 4)
self.wait(10)
self.mock_send('END\r\n', 0)
self.client_recv('END\r\n', 0)
self.mock_recv('get a\r\n', 0)
self.mock_send('VALUE a 0 1\r\na\r\n', 0)
self.mock_send('END\r\n', 0)
self.client_recv('VALUE a 0 1\r\na\r\n' +
'END\r\n', 1)
self.client_recv('VALUE a 0 1\r\na\r\n' +
'END\r\n', 2)
self.client_recv('VALUE a 0 1\r\na\r\n' +
'END\r\n', 3)
self.client_recv('VALUE a 0 1\r\na\r\n' +
'END\r\n', 4)
# Dedupe of keys is disabled for now in vbucket-aware moxi.
#
def TODO_testGetSquashNoKeyOverlap(self):
"""Test multiget dedupe, but no key overlap"""
# Assuming proxy's downstream_max is 1,
# and number of threads is 1.
self.client_connect(0)
self.client_connect(1)
self.client_connect(2)
self.client_send('get cork0\r\n', 0)
self.mock_recv('get cork0\r\n', 0)
# Mock server is 'busy' at this point, so
# any client sends should be able to be
# de-duplicated by the proxy.
self.client_send('get a\r\n', 1)
self.client_send('get x\r\n', 2)
self.wait(10)
self.mock_send('END\r\n', 0)
self.client_recv('END\r\n', 0)
self.mock_recv('get a x\r\n', 0)
self.mock_send('VALUE a 0 1\r\na\r\n', 0)
self.mock_send('VALUE x 0 1\r\nx\r\n', 0)
self.mock_send('END\r\n', 0)
self.client_recv('VALUE a 0 1\r\na\r\n' +
'END\r\n', 1)
self.client_recv('VALUE x 0 1\r\nx\r\n' +
'END\r\n', 2)
def TODO_testTimeout(self):
"""Test downstream timeout handling"""
return """TODO: Highly dependent on hardcoded downstream timeout val"""
# Assuming proxy's downstream_max is 1,
# and number of threads is 1.
self.client_connect(0)
self.client_send('get time0\r\n', 0)
self.mock_recv('get time0\r\n', 0)
# Mock server is 'busy' at this point, so
# downstream timeout logic should kick in,
# without our mock server having to send anything.
self.wait(210)
self.client_recv('END\r\n', 0)
# TODO: The number of server sessions should be 0,
# except the close might not have propagated.
def TODO_testSharedServerConns(self):
"""Test proxy only uses a few server conns"""
return "TODO: getting nondetermistic behavior here due to retry feature"
self.assertEqual(len(self.clients), 0)
self.assertEqual(len(self.mock_server().sessions), 0)
large_num_clients = 30
for i in range(0, large_num_clients):
self.client_connect(i)
self.client_send('get fromClient' + str(i) + '\r\n', i)
self.assertEqual(len(self.clients), large_num_clients)
self.wait(10)
self.assertTrue(len(self.mock_server().sessions) < large_num_clients)
self.assertTrue(len(self.mock_server().sessions) > 0)
def TODO_testServerSeesRetry(self):
"""Test server going down sees a retry"""
return "TODO: getting nondetermistic behavior here due to retry feature"
self.client_connect()
self.client_send('get someDown\r\n')
self.mock_recv("get someDown\r\n")
self.mock_send('VALUE someDown 0 10\r\n')
self.mock_close() # Go down before full reply, we should see retry.
self.mock_recv("get someDown\r\n")
self.mock_send('VALUE someDown 0 10\r\n')
self.mock_send('0123456789\r\n')
self.mock_send('END\r\n')
self.client_recv('VALUE someDown 0 10\r\n0123456789\r\nEND\r\n')
# More test ideas...
#
# Test chopped up responses from multiple mock servers.
# Test chopped up requests from multiple clients.
# Test servers going down during multiget write.
# Test chopped up server responses during multiget.
# Test if one server goes down during a broadcast/scatter-gather.
# Test server going down.
# Test server coming back up.
# Test server getting very slow.
# Test several backend servers, and one or more start flapping.
## test get and multi-get
## test simple update commands
## test broadcast commands like flush_all
#
# Retest all the above with binary protocol.
if __name__ == '__main__':
unittest.main()
| bsd-3-clause | 7,174,979,452,577,066,000 | 42.913043 | 103 | 0.572376 | false |
anna-effeindzourou/trunk | examples/anna_scripts/tilt/tilttest_box.py | 1 | 9173 | # -*- coding: utf-8
from yade import ymport,utils,pack,export,qt,bodiesHandling
import gts,os
# for plotting
from math import *
from yade import plot
############################
### DEFINING PARAMETERS ###
############################
#GEOMETRIC :dimension of the rectangular box
a=.2 # side dimension
h=.1 # height
#MATERIAL PROPERTIES
frictionAngle=radians(35)
density=2700
Kn=25e7 #normal stiffness Plassiard thesis
Ks=5e7 #tangential stiffness Plassiard thesis
#PARTICLE SIZE
Rs=0.015# mean particle radius
Rf=0.5 # dispersion (Rs±Rf*Rs)
nSpheres=2000# number of particles
#ENGINES PARAMETERS
g=9.81
damping_coeff = 0.5
#MATERIAL'S PARAMETERS
#box
young_box=30e5
poison_box=0.25
friction_box=radians(10)
density_box=1576.
#gravel
G=40e5
poisson_g=0.25
young_g=30e5
m=1.878
v=(4*pi*pow(Rs,3))/3
#TIME STEP
dt=1.e-7
#TAG
####################
### ENGINES ###
####################
O.engines=[
ForceResetter(),
InsertionSortCollider([
Bo1_Sphere_Aabb(),
Bo1_GridConnection_Aabb(),
Bo1_PFacet_Aabb()
]),
InteractionLoop([
Ig2_GridNode_GridNode_GridNodeGeom6D(),
Ig2_Sphere_PFacet_ScGridCoGeom(),
Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
Ig2_GridConnection_PFacet_ScGeom(),
Ig2_Sphere_GridConnection_ScGridCoGeom(),
Ig2_Sphere_Sphere_ScGeom(),
Ig2_PFacet_PFacet_ScGeom()
],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
Law2_ScGeom_FrictPhys_CundallStrack(),
Law2_ScGridCoGeom_FrictPhys_CundallStrack(),Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
]
),
]
############################
### DEFINING MATERIAL ###
############################
O.materials.append(CohFrictMat(young=young_box,poisson=poison_box,density=density,frictionAngle=friction_box,normalCohesion=1e19,shearCohesion=1e19,momentRotationLaw=True,alphaKr=5,label='NodeMat'))
boxMat = O.materials.append(FrictMat(young=young_box ,poisson=poison_box,frictionAngle=friction_box,density=density))
sphereMat = O.materials.append(FrictMat(young=young_box ,poisson=poison_box,frictionAngle=friction_box,density=density))
rWall=0.05
x=a/2.+rWall
y=0
z=0
fac=2.+rWall
clump=0
color=Vector3(1,0,0)
fixed=False
rWall=0.008
#### define box
nodesIds=[]
nodesIds.append( O.bodies.append(gridNode([-x,-y,h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,-y,h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,-y,2*h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([-x,-y,2*h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([-x,2*x,h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,2*x,h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,2*x,2*h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([-x,2*x,2*h+fac*rWall],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
cylIds=[]
pfIds=[]
pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[1],nodesIds[2],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[2],nodesIds[3],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
#pfIds.append(pfacetCreator3(nodesIds[1],nodesIds[5],nodesIds[2],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
#pfIds.append(pfacetCreator3(nodesIds[5],nodesIds[6],nodesIds[2],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[5],nodesIds[6],nodesIds[1],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[6],nodesIds[2],nodesIds[1],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[7],nodesIds[6],nodesIds[4],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[6],nodesIds[5],nodesIds[4],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
#pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[4],nodesIds[3],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
#pfIds.append(pfacetCreator3(nodesIds[4],nodesIds[7],nodesIds[3],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[7],nodesIds[0],nodesIds[4],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[7],nodesIds[3],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=True,mask=-1))
nbodies=[]
#O.step()
for i in nodesIds:
O.bodies[i].state.blockedDOFs='x'
#nbodies.append(O.bodies[i])
#clump,clumpIds=O.bodies.appendClumped(nbodies)
#O.bodies[clump].state.blockedDOFs='xyzXYZ'
fixed=True
nodesIds=[]
nodesIds.append( O.bodies.append(gridNode([-x,-y,0],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,-y,0],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,-y,h],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([-x,-y,h],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([-x,2*x,0],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,2*x,0],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([x,2*x,h],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
nodesIds.append( O.bodies.append(gridNode([-x,2*x,h],rWall,wire=False,fixed=fixed,material='NodeMat',color=color)) )
cylIds=[]
pfIds=[]
pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[1],nodesIds[2],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[2],nodesIds[3],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[1],nodesIds[5],nodesIds[2],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[5],nodesIds[6],nodesIds[2],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[7],nodesIds[6],nodesIds[4],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[6],nodesIds[5],nodesIds[4],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[4],nodesIds[3],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[4],nodesIds[7],nodesIds[3],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[0],nodesIds[1],nodesIds[5],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
pfIds.append(pfacetCreator3(nodesIds[4],nodesIds[0],nodesIds[5],cylIds=cylIds,pfIds=pfIds,wire=False,material=boxMat,Ecyl=None,color=color,fixed=fixed,mask=-1))
############################
### DEFINING ENGINES ###
############################
init=0
para=1000
coll=100
def rotate():
global init
init=O.iter
Newton_Integrator.damping=0.2
#for i in nodesIds1:
#O.bodies[i].state.blockedDOFs='x'
#O.bodies[clump].state.blockedDOFs='x'
O.engines+=[
RotationEngine(ids=idsToRotate,angularVelocity=angularVelocity,rotateAroundZero=True,zeroPoint=(-rWall,0,0),rotationAxis=(1,0,0),label='rotationEngine'),
#VTKRecorder(iterPeriod=para,dead=True,initRun=True,fileName='paraview/'+O.tags['description']+'_',recorders=['spheres','velocity','intr','materialId'],label='parav'),
#PyRunner(initRun=True,iterPeriod=coll,command='dataCollector()')
]
angularVelocity=0.1
idsToRotate=nodesIds
O.dt=0.0001
O.engines+=[NewtonIntegrator(gravity=(0,0,-9.81),damping=0.2,label='Newton_Integrator')]
############################
### VISUALIZATION ###
############################
renderer = qt.Renderer()
qt.View()
O.saveTmp()
#O.run()
def getAngle():
alpha=angularVelocity*O.iter*O.dt/pi*180.
print 'alpha = ', alpha
| gpl-2.0 | 7,845,792,730,657,617,000 | 38.029787 | 198 | 0.744331 | false |
sibskull/synaptiks | tests/kde/widgets/test_config.py | 1 | 5513 | # -*- coding: utf-8 -*-
# Copyright (c) 2011, Sebastian Wiesner <[email protected]>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from __future__ import (print_function, division, unicode_literals,
absolute_import)
import pytest
config = pytest.importorskip('synaptiks.kde.widgets.config')
from PyQt4.QtCore import pyqtSignal
from PyQt4.QtGui import QWidget, QHBoxLayout, QCheckBox, QLineEdit
class DummyConfig(dict):
"""
A dummy configuration object for use in the tests.
"""
@property
def defaults(self):
return {'lineedit': 'spam', 'checkbox': False}
class DummyConfigWidget(QWidget, config.ConfigurationWidgetMixin):
NAME_PREFIX = 'dummy'
PROPERTY_MAP = dict(QCheckBox='checked', QLineEdit='text')
CHANGED_SIGNAL_MAP = dict(QCheckBox='toggled', QLineEdit='textChanged')
configurationChanged = pyqtSignal(bool)
def __init__(self, config, parent=None):
QWidget.__init__(self, parent)
layout = QHBoxLayout(self)
self.setLayout(layout)
self.checkbox = QCheckBox(self)
self.checkbox.setObjectName('dummy_checkbox')
layout.addWidget(self.checkbox)
self.lineedit = QLineEdit(self)
self.lineedit.setObjectName('dummy_lineedit')
layout.addWidget(self.lineedit)
self._setup(config)
def change(self, text, check_state):
self.lineedit.setText(text)
self.checkbox.setChecked(check_state)
def check(self, text, check_state):
__tracebackhide__ = True
assert unicode(self.lineedit.text()) == text
assert self.checkbox.isChecked() == check_state
def pytest_funcarg__config(request):
return DummyConfig({'lineedit': 'spam', 'checkbox': False})
def pytest_funcarg__config_widget(request):
# we must have a qt app object before we can construct widgets
request.getfuncargvalue('qtapp')
return DummyConfigWidget(request.getfuncargvalue('config'))
class TestConfigurationWidgetMixin(object):
def test_setup_no_defaults_attribute(self, qtapp, config):
invalid_config = dict(config)
assert not hasattr(invalid_config, 'defaults')
with pytest.raises(TypeError) as exc_info:
DummyConfigWidget(invalid_config)
msg = 'The given configuration does not provide defaults'
assert str(exc_info.value) == msg
def test_setup(self, config_widget):
config_widget.check('spam', False)
def test_configuration_changed(self, config_widget):
signal_calls = []
config_widget.configurationChanged.connect(signal_calls.append)
config_widget.change('eggs', True)
assert signal_calls == [True, True]
del signal_calls[:]
config_widget.apply_configuration()
signal_calls == [False]
del signal_calls[:]
config_widget.load_defaults()
assert signal_calls == [True, True]
del signal_calls[:]
config_widget.load_configuration()
assert signal_calls == [True, False]
def test_is_configuration_changed(self, config_widget):
assert not config_widget.is_configuration_changed
config_widget.change('eggs', True)
assert config_widget.is_configuration_changed
config_widget.apply_configuration()
assert not config_widget.is_configuration_changed
def test_load_defaults(self, config_widget):
config_widget.change('eggs', True)
assert not config_widget.shows_defaults()
config_widget.load_defaults()
assert config_widget.shows_defaults()
config_widget.check('spam', False)
def test_shows_defaults(self, config, config_widget):
assert config_widget.shows_defaults()
config_widget.change('eggs', True)
assert not config_widget.shows_defaults()
def test_load_configuration(self, config, config_widget):
config['checkbox'] = True
config['lineedit'] = 'eggs'
config_widget.load_configuration()
config_widget.check('eggs', True)
def test_apply_configuration(self, config, config_widget):
config_widget.change('eggs', True)
config_widget.apply_configuration()
assert config == {'lineedit': 'eggs', 'checkbox': True}
| bsd-2-clause | -2,184,364,509,986,881,300 | 37.552448 | 77 | 0.695629 | false |
toirl/cointrader | cointrader/strategy.py | 1 | 2832 | #!/usr/bin/env python
import datetime
import logging
from cointrader.indicators import (
WAIT, BUY, SELL, Signal, macdh_momententum, macdh, double_cross
)
log = logging.getLogger(__name__)
class Strategy(object):
"""Docstring for Strategy. """
def __str__(self):
return "{}".format(self.__class__)
def __init__(self):
self.signals = {}
"""Dictionary with details on the signal(s)
{"indicator": {"signal": 1, "details": Foo}}"""
def signal(self, chart):
"""Will return either a BUY, SELL or WAIT signal for the given
market"""
raise NotImplementedError
class NullStrategy(Strategy):
"""The NullStrategy does nothing than WAIT. It will emit not BUY or
SELL signal and is therefor the default strategy when starting
cointrader to protect the user from loosing money by accident."""
def signal(self, chart):
"""Will return either a BUY, SELL or WAIT signal for the given
market"""
signal = Signal(WAIT, datetime.datetime.utcnow())
self.signals["WAIT"] = signal
return signal
class Klondike(Strategy):
def signal(self, chart):
signal = macdh_momententum(chart)
self.signals["MACDH_MOMEMENTUM"] = signal
if signal.buy:
return signal
elif signal.sell:
return signal
return Signal(WAIT, datetime.datetime.utcfromtimestamp(chart.date))
class Followtrend(Strategy):
"""Simple trend follow strategie."""
def __init__(self):
Strategy.__init__(self)
self._macd = WAIT
def signal(self, chart):
# Get current chart
closing = chart.values()
self._value = closing[-1][1]
self._date = datetime.datetime.utcfromtimestamp(closing[-1][0])
# MACDH is an early indicator for trend changes. We are using the
# MACDH as a precondition for trading signals here and required
# the MACDH signal a change into a bullish/bearish market. This
# signal stays true as long as the signal changes.
macdh_signal = macdh(chart)
if macdh_signal.value == BUY:
self._macd = BUY
if macdh_signal.value == SELL:
self._macd = SELL
log.debug("macdh signal: {}".format(self._macd))
# Finally we are using the double_cross signal as confirmation
# of the former MACDH signal
dc_signal = double_cross(chart)
if self._macd == BUY and dc_signal.value == BUY:
signal = dc_signal
elif self._macd == SELL and dc_signal.value == SELL:
signal = dc_signal
else:
signal = Signal(WAIT, dc_signal.date)
log.debug("Final signal @{}: {}".format(signal.date, signal.value))
self.signals["DC"] = signal
return signal
| mit | 1,515,232,139,479,647,000 | 29.782609 | 75 | 0.614054 | false |
duembeg/gsat | modules/wnd_main_config.py | 1 | 10359 | """----------------------------------------------------------------------------
wnd_main_config.py
Copyright (C) 2013-2020 Wilhelm Duembeg
This file is part of gsat. gsat is a cross-platform GCODE debug/step for
Grbl like GCODE interpreters. With features similar to software debuggers.
Features such as breakpoint, change current program counter, inspection
and modification of variables.
gsat is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
gsat is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with gsat. If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------------"""
import os
import sys
import glob
import serial
import re
import time
import shutil
import logging
import wx
import wx.combo
# from wx import stc as stc
# from wx.lib.mixins import listctrl as listmix
from wx.lib.agw import aui as aui
from wx.lib.agw import floatspin as fs
from wx.lib.agw import genericmessagedialog as gmd
# from wx.lib.agw import flatmenu as fm
from wx.lib.wordwrap import wordwrap
from wx.lib import scrolledpanel as scrolled
import modules.config as gc
import modules.machif_config as mi
import images.icons as ico
import modules.wnd_editor_config as edc
import modules.wnd_machine_config as mcc
import modules.wnd_jogging_config as jogc
import modules.wnd_cli_config as clic
import modules.wnd_compvision_config as compvc
class gsatGeneralSettingsPanel(scrolled.ScrolledPanel):
""" General panel settings
"""
def __init__(self, parent, configData, **args):
scrolled.ScrolledPanel.__init__(
self, parent, style=wx.TAB_TRAVERSAL | wx.NO_BORDER)
self.configData = configData
self.InitUI()
self.SetAutoLayout(True)
self.SetupScrolling()
# self.FitInside()
def InitUI(self):
font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
vBoxSizer = wx.BoxSizer(wx.VERTICAL)
# run time dialog settings
st = wx.StaticText(self, label="General")
st.SetFont(font)
vBoxSizer.Add(st, 0, wx.ALL, border=5)
# Add file save backup check box
self.cbDisplayRunTimeDialog = wx.CheckBox(
self, wx.ID_ANY, "Display run time dialog at program end")
self.cbDisplayRunTimeDialog.SetValue(
self.configData.get('/mainApp/DisplayRunTimeDialog'))
vBoxSizer.Add(self.cbDisplayRunTimeDialog, flag=wx.LEFT, border=25)
# file settings
st = wx.StaticText(self, label="Files")
st.SetFont(font)
vBoxSizer.Add(st, 0, wx.ALL, border=5)
# Add file save backup check box
self.cbBackupFile = wx.CheckBox(
self, wx.ID_ANY, "Create a backup copy of file before saving")
self.cbBackupFile.SetValue(self.configData.get('/mainApp/BackupFile'))
vBoxSizer.Add(self.cbBackupFile, flag=wx.LEFT, border=25)
# Add file history spin ctrl
hBoxSizer = wx.BoxSizer(wx.HORIZONTAL)
self.scFileHistory = wx.SpinCtrl(self, wx.ID_ANY, "")
self.scFileHistory.SetRange(0, 100)
self.scFileHistory.SetValue(
self.configData.get('/mainApp/FileHistory/FilesMaxHistory'))
hBoxSizer.Add(self.scFileHistory, flag=wx.ALL |
wx.ALIGN_CENTER_VERTICAL, border=5)
st = wx.StaticText(self, wx.ID_ANY, "Recent file history size")
hBoxSizer.Add(st, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=5)
vBoxSizer.Add(hBoxSizer, 0, flag=wx.LEFT | wx.EXPAND, border=20)
# tools settings
st = wx.StaticText(self, label="Tools")
font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
st.SetFont(font)
vBoxSizer.Add(st, 0, wx.ALL, border=5)
# Add Inch to mm round digits spin ctrl
hBoxSizer = wx.BoxSizer(wx.HORIZONTAL)
self.scIN2MMRound = wx.SpinCtrl(self, wx.ID_ANY, "")
self.scIN2MMRound.SetRange(0, 100)
self.scIN2MMRound.SetValue(
self.configData.get('/mainApp/RoundInch2mm'))
hBoxSizer.Add(self.scIN2MMRound, flag=wx.ALL |
wx.ALIGN_CENTER_VERTICAL, border=5)
st = wx.StaticText(self, wx.ID_ANY, "Inch to mm round digits")
hBoxSizer.Add(st, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=5)
vBoxSizer.Add(hBoxSizer, 0, flag=wx.LEFT | wx.EXPAND, border=20)
# Add mm to Inch round digits spin ctrl
hBoxSizer = wx.BoxSizer(wx.HORIZONTAL)
self.scMM2INRound = wx.SpinCtrl(self, wx.ID_ANY, "")
self.scMM2INRound.SetRange(0, 100)
self.scMM2INRound.SetValue(
self.configData.get('/mainApp/Roundmm2Inch'))
hBoxSizer.Add(self.scMM2INRound, flag=wx.ALL |
wx.ALIGN_CENTER_VERTICAL, border=5)
st = wx.StaticText(self, wx.ID_ANY, "mm to Inch round digits")
hBoxSizer.Add(st, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=5)
vBoxSizer.Add(hBoxSizer, 0, flag=wx.LEFT | wx.EXPAND, border=20)
self.SetSizer(vBoxSizer)
def UpdateConfigData(self):
self.configData.set('/mainApp/DisplayRunTimeDialog',
self.cbDisplayRunTimeDialog.GetValue())
self.configData.set('/mainApp/BackupFile',
self.cbBackupFile.GetValue())
self.configData.set('/mainApp/FileHistory/FilesMaxHistory',
self.scFileHistory.GetValue())
self.configData.set('/mainApp/RoundInch2mm',
self.scIN2MMRound.GetValue())
self.configData.set('/mainApp/Roundmm2Inch',
self.scMM2INRound.GetValue())
class gsatSettingsDialog(wx.Dialog):
""" Dialog to control program settings
"""
def __init__(self, parent, configData, id=wx.ID_ANY, title="Settings",
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):
wx.Dialog.__init__(self, parent, id, title, style=style)
self.configData = configData
self.InitUI()
def InitUI(self):
sizer = wx.BoxSizer(wx.VERTICAL)
# init note book
self.imageList = wx.ImageList(16, 16)
self.imageList.Add(ico.imgGeneralSettings.GetBitmap())
# self.imageList.Add(ico.imgPlugConnect.GetBitmap())
self.imageList.Add(ico.imgProgram.GetBitmap())
self.imageList.Add(ico.imgLog.GetBitmap())
self.imageList.Add(ico.imgCli.GetBitmap())
self.imageList.Add(ico.imgMachine.GetBitmap())
self.imageList.Add(ico.imgMove.GetBitmap())
self.imageList.Add(ico.imgEye.GetBitmap())
# for Windows and OS X, tabbed on the left don't work as well
if sys.platform.startswith('linux'):
self.noteBook = wx.Notebook(
self, size=(700, 400), style=wx.BK_LEFT)
else:
self.noteBook = wx.Notebook(self, size=(700, 400))
self.noteBook.AssignImageList(self.imageList)
# add pages
self.AddGeneralPage(0)
self.AddProgramPage(1)
self.AddOutputPage(2)
self.AddCliPage(3)
self.AddMachinePage(4)
self.AddJoggingPage(5)
self.AddCV2Panel(6)
# self.noteBook.Layout()
sizer.Add(self.noteBook, 1, wx.ALL | wx.EXPAND, 5)
# buttons
line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
sizer.Add(line, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL |
wx.LEFT | wx.RIGHT | wx.TOP, border=5)
btnsizer = wx.StdDialogButtonSizer()
btn = wx.Button(self, wx.ID_OK)
btnsizer.AddButton(btn)
btn = wx.Button(self, wx.ID_CANCEL)
btnsizer.AddButton(btn)
btnsizer.Realize()
sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL |
wx.ALIGN_RIGHT | wx.ALL, 5)
self.SetSizerAndFit(sizer)
# self.SetAutoLayout(True)
self.Layout()
def AddGeneralPage(self, page):
self.generalPage = gsatGeneralSettingsPanel(
self.noteBook, self.configData)
self.noteBook.AddPage(self.generalPage, "General")
self.noteBook.SetPageImage(page, page)
def AddProgramPage(self, page):
self.programPage = edc.gsatStyledTextCtrlSettingsPanel(
self.noteBook, self.configData, "code")
self.noteBook.AddPage(self.programPage, "Program")
self.noteBook.SetPageImage(page, page)
def AddOutputPage(self, page):
self.outputPage = edc.gsatStyledTextCtrlSettingsPanel(
self.noteBook, self.configData, "output")
self.noteBook.AddPage(self.outputPage, "Output")
self.noteBook.SetPageImage(page, page)
def AddCliPage(self, page):
self.cliPage = clic.gsatCliSettingsPanel(self.noteBook, self.configData)
self.noteBook.AddPage(self.cliPage, "Cli")
self.noteBook.SetPageImage(page, page)
def AddMachinePage(self, page):
self.machinePage = mcc.gsatMachineSettingsPanel(
self.noteBook, self.configData)
self.noteBook.AddPage(self.machinePage, "Machine")
self.noteBook.SetPageImage(page, page)
def AddJoggingPage(self, page):
self.jogPage = jogc.gsatJoggingSettingsPanel(
self.noteBook, self.configData)
self.noteBook.AddPage(self.jogPage, "Jogging")
self.noteBook.SetPageImage(page, page)
def AddCV2Panel(self, page):
self.CV2Page = compvc.gsatCV2SettingsPanel(
self.noteBook, self.configData)
self.noteBook.AddPage(self.CV2Page, " OpenCV2")
self.noteBook.SetPageImage(page, page)
def UpdateConfigData(self):
self.generalPage.UpdateConfigData()
self.programPage.UpdateConfigData()
self.outputPage.UpdateConfigData()
self.cliPage.UpdateConfigData()
self.machinePage.UpdateConfigData()
self.jogPage.UpdateConfigData()
self.CV2Page.UpdateConfigData()
| gpl-2.0 | -5,809,503,624,998,932,000 | 36.129032 | 80 | 0.643498 | false |
ifding/ifding.github.io | stylegan2-ada/metrics/clustering.py | 1 | 4125 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
"""Inception Score (IS) from the paper
"Improved techniques for training GANs"."""
import pickle
import numpy as np
import tensorflow as tf
import dnnlib
import dnnlib.tflib as tflib
from metrics import metric_base
from training import dataset
from sklearn.metrics.cluster import normalized_mutual_info_score, adjusted_rand_score
def compute_purity(y_pred, y_true):
"""
Calculate the purity, a measurement of quality for the clustering
results.
Each cluster is assigned to the class which is most frequent in the
cluster. Using these classes, the percent accuracy is then calculated.
Returns:
A number between 0 and 1. Poor clusterings have a purity close to 0
while a perfect clustering has a purity of 1.
"""
# get the set of unique cluster ids
clusters = set(y_pred)
# find out what class is most frequent in each cluster
cluster_classes = {}
correct = 0
for cluster in clusters:
# get the indices of rows in this cluster
indices = np.where(y_pred == cluster)[0]
cluster_labels = y_true[indices]
majority_label = np.argmax(np.bincount(cluster_labels))
correct += np.sum(cluster_labels == majority_label)
#cor = np.sum(cluster_labels == majority_label)
#print(cluster, len(indices), float(cor)/len(indices))
return float(correct) / len(y_pred)
#----------------------------------------------------------------------------
class CL(metric_base.MetricBase):
def __init__(self, num_images, num_splits, minibatch_per_gpu, **kwargs):
super().__init__(**kwargs)
self.num_images = num_images
self.num_splits = num_splits
self.minibatch_per_gpu = minibatch_per_gpu
def _evaluate(self, E, G_kwargs, num_gpus, **_kwargs): # pylint: disable=arguments-differ
minibatch_size = num_gpus * self.minibatch_per_gpu
dataset_obj = dataset.load_dataset(**self._dataset_args)
dataset_obj.configure(minibatch_size)
trues = np.empty([self.num_images, 10], dtype=np.int32)
preds = np.empty([self.num_images, 10], dtype=np.float32)
# Construct TensorFlow graph.
result_expr = []
true_labels = []
for gpu_idx in range(num_gpus):
with tf.device(f'/gpu:{gpu_idx}'):
E_clone = E.clone()
images, labels = dataset_obj.get_minibatch_tf()
outputs = E_clone.get_output_for(images, labels, **G_kwargs)
output_logits = outputs[:, 512:]
output_labels = tf.nn.softmax(output_logits)
result_expr.append(output_labels)
true_labels.append(labels)
# Calculate activations for fakes.
for begin in range(0, self.num_images, minibatch_size):
self._report_progress(begin, self.num_images)
end = min(begin + minibatch_size, self.num_images)
trues[begin:end] = np.concatenate(tflib.run(true_labels), axis=0)[:end-begin]
preds[begin:end] = np.concatenate(tflib.run(result_expr), axis=0)[:end-begin]
labels_true = np.argmax(trues, axis=1)
labels_pred = np.argmax(preds, axis=1)
purity = compute_purity(labels_pred, labels_true)
ari = adjusted_rand_score(labels_true, labels_pred)
nmi = normalized_mutual_info_score(labels_true, labels_pred)
self._report_result(purity, suffix='purity')
self._report_result(ari, suffix='ari')
self._report_result(nmi, suffix='nmi')
#----------------------------------------------------------------------------
| mit | 7,644,442,276,359,923,000 | 38.663462 | 93 | 0.618667 | false |
boriel/zxbasic | src/symbols/number.py | 1 | 4546 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: ts=4:et:sw=4:
# ----------------------------------------------------------------------
# Copyleft (K), Jose M. Rodriguez-Rosa (a.k.a. Boriel)
#
# This program is Free Software and is released under the terms of
# the GNU General License
# ----------------------------------------------------------------------
import numbers
from typing import Optional
from src.api.constants import CLASS
from .symbol_ import Symbol
from .type_ import SymbolTYPE
from .type_ import Type as TYPE
from .const import SymbolCONST
def _get_val(other):
""" Given a Number, a Numeric Constant or a python number return its value
"""
assert isinstance(other, (numbers.Number, SymbolNUMBER, SymbolCONST))
if isinstance(other, SymbolNUMBER):
return other.value
if isinstance(other, SymbolCONST):
return other.expr.value
return other
class SymbolNUMBER(Symbol):
""" Defines an NUMBER symbol.
"""
def __init__(self, value, lineno: int, type_: Optional[SymbolTYPE] = None):
assert lineno is not None
assert type_ is None or isinstance(type_, SymbolTYPE)
if isinstance(value, SymbolNUMBER):
value = value.value
assert isinstance(value, numbers.Number)
super().__init__()
self.class_ = CLASS.const
if int(value) == value:
value = int(value)
else:
value = float(value)
self.value = value
if type_ is not None:
self.type_ = type_
elif isinstance(value, float):
if -32768.0 < value < 32767:
self.type_ = TYPE.fixed
else:
self.type_ = TYPE.float_
elif isinstance(value, int):
if 0 <= value < 256:
self.type_ = TYPE.ubyte
elif -128 <= value < 128:
self.type_ = TYPE.byte_
elif 0 <= value < 65536:
self.type_ = TYPE.uinteger
elif -32768 <= value < 32768:
self.type_ = TYPE.integer
elif value < 0:
self.type_ = TYPE.long_
else:
self.type_ = TYPE.ulong
self.lineno = lineno
def __str__(self):
return str(self.value)
def __repr__(self):
return "%s:%s" % (self.type_, str(self))
def __hash__(self):
return id(self)
@property
def t(self):
return str(self)
def __eq__(self, other):
if not isinstance(other, (numbers.Number, SymbolNUMBER, SymbolCONST)):
return False
return self.value == _get_val(other)
def __lt__(self, other):
return self.value < _get_val(other)
def __le__(self, other):
return self.value <= _get_val(other)
def __gt__(self, other):
return self.value > _get_val(other)
def __ge__(self, other):
return self.value >= _get_val(other)
def __add__(self, other):
return SymbolNUMBER(self.value + _get_val(other), self.lineno)
def __radd__(self, other):
return SymbolNUMBER(_get_val(other) + self.value, self.lineno)
def __sub__(self, other):
return SymbolNUMBER(self.value - _get_val(other), self.lineno)
def __rsub__(self, other):
return SymbolNUMBER(_get_val(other) - self.value, self.lineno)
def __mul__(self, other):
return SymbolNUMBER(self.value * _get_val(other), self.lineno)
def __rmul__(self, other):
return SymbolNUMBER(_get_val(other) * self.value, self.lineno)
def __truediv__(self, other):
return SymbolNUMBER(self.value / _get_val(other), self.lineno)
def __div__(self, other):
return self.__truediv__(other)
def __rtruediv__(self, other):
return SymbolNUMBER(_get_val(other) / self.value, self.lineno)
def __rdiv__(self, other):
return self.__rtruediv__(other)
def __or__(self, other):
return SymbolNUMBER(self.value | _get_val(other), self.lineno)
def __ror__(self, other):
return SymbolNUMBER(_get_val(other | self.value), self.lineno)
def __and__(self, other):
return SymbolNUMBER(self.value & _get_val(other), self.lineno)
def __rand__(self, other):
return SymbolNUMBER(_get_val(other) & self.value, self.lineno)
def __mod__(self, other):
return SymbolNUMBER(self.value % _get_val(other), self.lineno)
def __rmod__(self, other):
return SymbolNUMBER(_get_val(other) % self.value, self.lineno)
| gpl-3.0 | -1,612,557,358,971,773,200 | 27.4125 | 79 | 0.558293 | false |
ftrimble/route-grower | pyroute/lib_gpx.py | 1 | 2521 | #!/usr/bin/python
#-----------------------------------------------------------------------------
# Library for handling GPX files
#
# Usage:
#
#-----------------------------------------------------------------------------
# Copyright 2007, Oliver White
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-----------------------------------------------------------------------------
import os
import cairo
from xml.sax import make_parser, handler
class lib_gpx(handler.ContentHandler):
""" """
def __init__(self):
self.lines = []
def draw(self,cr,proj):
cr.set_line_cap(cairo.LINE_CAP_ROUND)
cr.set_source_rgb(0.7,0.7,0)
cr.set_line_width(5)
for l in self.lines:
first = 1
for p in l:
x,y = proj.ll2xy(p[0], p[1])
if(first):
cr.move_to(x,y)
first = 0
else:
cr.line_to(x,y)
cr.stroke()
def saveAs(self,filename, title="untitled"):
file = open(filename,"w")
file.write("<?xml version=\"1.0\"?>\n")
file.write('<gpx>\n')
file.write('<trk>\n')
file.write('<name>%s</name>\n' % title)
for l in self.lines:
file.write('<trkseg>\n')
for p in l:
file.write('<trkpt lat="%f" lon="%f"/>\n'%(p[0], p[1]))
file.write('</trkseg>\n')
file.write('</trk>\n')
file.write('</gpx>\n')
file.close()
def load(self, filename):
if(not os.path.exists(filename)):
print "No such tracklog \"%s\"" % filename
return
self.inField = False
parser = make_parser()
parser.setContentHandler(self)
parser.parse(filename)
def startElement(self, name, attrs):
if name == 'trk':
pass
if name == 'trkseg':
self.latest = []
self.lines.append(self.latest)
pass
if name == "trkpt":
lat = float(attrs.get('lat'))
lon = float(attrs.get('lon'))
self.latest.append([lat,lon])
| apache-2.0 | -9,187,451,632,071,958,000 | 29.743902 | 78 | 0.548592 | false |
ddico/account-financial-tools | account_credit_control_dunning_fees/tests/test_fees_generation.py | 1 | 4628 | # Copyright 2014-2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
class FixedFeesTester(common.TransactionCase):
def setUp(self):
"""Initialize credit control level mock to test fees computations"""
super(FixedFeesTester, self).setUp()
self.currency_model = self.env['res.currency']
self.euro = self.currency_model.search([('name', '=', 'EUR')])
self.assertTrue(self.euro)
self.usd = self.currency_model.search([('name', '=', 'USD')])
self.assertTrue(self.usd)
self.company = self.browse_ref('base.main_company')
self.env.cr.execute(
"""UPDATE res_company SET currency_id = %s
WHERE id = %s""", (self.company.id, self.euro.id),
)
level_obj = self.env['credit.control.policy.level']
self.euro_level = level_obj.new({
'name': 'Euro Level',
'dunning_fixed_amount': 5.0,
'dunning_currency_id': self.euro,
'dunning_type': 'fixed',
})
self.usd_level = level_obj.new({
'name': 'USD Level',
'dunning_fixed_amount': 5.0,
'dunning_currency_id': self.usd,
'dunning_type': 'fixed',
})
self.dunning_model = self.env['credit.control.dunning.fees.computer']
self.line_model = self.env['credit.control.line']
def test_type_getter(self):
"""Test that correct compute function is returned for "fixed" type"""
c_fun = self.dunning_model._get_compute_fun('fixed')
self.assertEqual(c_fun, self.dunning_model.compute_fixed_fees)
def test_unknow_type(self):
"""Test that non implemented error is raised if invalide fees type"""
with self.assertRaises(NotImplementedError):
self.dunning_model._get_compute_fun('bang')
def test_computation_same_currency(self):
"""Test that fees are correctly computed with same currency"""
credit_line = self.line_model.new({
'policy_level_id': self.euro_level,
'currency_id': self.euro,
'company_id': self.company,
})
fees = self.dunning_model.compute_fixed_fees(credit_line)
self.assertEqual(fees, self.euro_level.dunning_fixed_amount)
def test_computation_different_currency(self):
"""Test that fees are correctly computed with different currency"""
credit_line = self.line_model.new({
'policy_level_id': self.euro_level,
'currency_id': self.usd.id,
'company_id': self.company,
})
fees = self.dunning_model.compute_fixed_fees(credit_line)
self.assertNotEqual(fees, self.euro_level.dunning_fixed_amount)
def test_computation_credit_currency_empty(self):
"""Test that fees are correctly computed with empty credit currency"""
credit_line = self.line_model.new({
'policy_level_id': self.euro_level,
'currency_id': False,
'company_id': self.company,
})
fees = self.dunning_model.compute_fixed_fees(credit_line)
self.assertEqual(fees, self.euro_level.dunning_fixed_amount)
def test_computation_level_currency_empty(self):
"""Test that fees are correctly computed with empty level currency"""
credit_line = self.line_model.new({
'policy_level_id': self.euro_level,
'currency_id': self.euro,
'company_id': self.company,
})
self.euro_level.currency_id = False
fees = self.dunning_model.compute_fixed_fees(credit_line)
self.assertEqual(fees, self.euro_level.dunning_fixed_amount)
def test_computation_all_currency_empty(self):
"""Test that fees are correctly computed with empty currencies"""
credit_line = self.line_model.new({
'policy_level_id': self.euro_level,
'currency_id': False,
'company_id': self.company,
})
self.euro_level.currency_id = False
fees = self.dunning_model.compute_fixed_fees(credit_line)
self.assertEqual(fees, self.euro_level.dunning_fixed_amount)
def test_no_fees(self):
"""Test that fees are not generated if no amount defined on level"""
credit_line = self.line_model.new({
'policy_level_id': self.euro_level,
'currency_id': self.usd,
'company_id': self.company,
})
self.euro_level.dunning_fixed_amount = 0.0
fees = self.dunning_model.compute_fixed_fees(credit_line)
self.assertEqual(fees, 0.0)
| agpl-3.0 | 9,153,253,812,203,657,000 | 40.693694 | 78 | 0.611495 | false |
EmilStenstrom/nephele | nephele.py | 1 | 1817 | #!/usr/bin/env python -u
"""
Nephele - Finding movies to watch on the internet is easy,
finding GOOD movies to watch is hard. Let Nephele, the greek
nymph of the clouds, help you.
Usage:
nephele.py get_popular [--limit=<n>] [--filter=<spec>] [--debug]
nephele.py get_grades <directory> [--limit=<n>] [--filter=<spec>] [--debug]
nephele.py clear <name> [--debug]
Options:
-h --help Show this screen.
--debug Print debug information.
--limit=<n> Limit number of returned hits [default: 10]
--filter=<spec> Filter resulting movies on this specification
<spec> takes a comma separated list of movie field names,
followed by an operator and a value to compare to.
Valid operators are:
* Equal: == (if the value is a list, equal means "contains" instead)
* Not equal: == (if the value is a list, not equal means "does not contain" instead)
* Larger than: >, Less than: <
* Larger than or equal: >=, Less than or equal: <=
Examples:
* --filter="imdb_rating>4.5"
* --filter="filmtipset_my_grade>=4"
* --filter="imdb_rating>5,filmtipset_my_grade>=4"
* --filter="genre==Romance"
* --filter="genre!=Animation"
"""
import importlib
from docopt import docopt
if __name__ == '__main__':
arguments = docopt(__doc__)
command_str = [
key
for key, value in arguments.items()
if value and not key.startswith("--") and not key.startswith("<")
][0]
command = importlib.import_module("commands." + command_str)
command.main(arguments)
| mit | -386,543,294,171,400,450 | 36.081633 | 108 | 0.544304 | false |
teto/libnl_old | python/netlink/route/link.py | 1 | 16902 | #
# Copyright (c) 2011 Thomas Graf <[email protected]>
#
"""Module providing access to network links
This module provides an interface to view configured network links,
modify them and to add and delete virtual network links.
The following is a basic example:
import netlink.core as netlink
import netlink.route.link as link
sock = netlink.Socket()
sock.connect(netlink.NETLINK_ROUTE)
cache = link.LinkCache() # create new empty link cache
cache.refill(sock) # fill cache with all configured links
eth0 = cache['eth0'] # lookup link "eth0"
print(eth0) # print basic configuration
The module contains the following public classes:
- Link -- Represents a network link. Instances can be created directly
via the constructor (empty link objects) or via the refill()
method of a LinkCache.
- LinkCache -- Derived from netlink.Cache, holds any number of
network links (Link instances). Main purpose is to keep
a local list of all network links configured in the
kernel.
The following public functions exist:
- get_from_kernel(socket, name)
"""
from __future__ import absolute_import
__version__ = '0.1'
__all__ = [
'LinkCache',
'Link',
'get_from_kernel',
]
import socket
from .. import core as netlink
from .. import capi as core_capi
from . import capi as capi
from .links import inet as inet
from .. import util as util
# Link statistics definitions
RX_PACKETS = 0
TX_PACKETS = 1
RX_BYTES = 2
TX_BYTES = 3
RX_ERRORS = 4
TX_ERRORS = 5
RX_DROPPED = 6
TX_DROPPED = 7
RX_COMPRESSED = 8
TX_COMPRESSED = 9
RX_FIFO_ERR = 10
TX_FIFO_ERR = 11
RX_LEN_ERR = 12
RX_OVER_ERR = 13
RX_CRC_ERR = 14
RX_FRAME_ERR = 15
RX_MISSED_ERR = 16
TX_ABORT_ERR = 17
TX_CARRIER_ERR = 18
TX_HBEAT_ERR = 19
TX_WIN_ERR = 20
COLLISIONS = 21
MULTICAST = 22
IP6_INPKTS = 23
IP6_INHDRERRORS = 24
IP6_INTOOBIGERRORS = 25
IP6_INNOROUTES = 26
IP6_INADDRERRORS = 27
IP6_INUNKNOWNPROTOS = 28
IP6_INTRUNCATEDPKTS = 29
IP6_INDISCARDS = 30
IP6_INDELIVERS = 31
IP6_OUTFORWDATAGRAMS = 32
IP6_OUTPKTS = 33
IP6_OUTDISCARDS = 34
IP6_OUTNOROUTES = 35
IP6_REASMTIMEOUT = 36
IP6_REASMREQDS = 37
IP6_REASMOKS = 38
IP6_REASMFAILS = 39
IP6_FRAGOKS = 40
IP6_FRAGFAILS = 41
IP6_FRAGCREATES = 42
IP6_INMCASTPKTS = 43
IP6_OUTMCASTPKTS = 44
IP6_INBCASTPKTS = 45
IP6_OUTBCASTPKTS = 46
IP6_INOCTETS = 47
IP6_OUTOCTETS = 48
IP6_INMCASTOCTETS = 49
IP6_OUTMCASTOCTETS = 50
IP6_INBCASTOCTETS = 51
IP6_OUTBCASTOCTETS = 52
ICMP6_INMSGS = 53
ICMP6_INERRORS = 54
ICMP6_OUTMSGS = 55
ICMP6_OUTERRORS = 56
class LinkCache(netlink.Cache):
"""Cache of network links"""
def __init__(self, family=socket.AF_UNSPEC, cache=None):
if not cache:
cache = self._alloc_cache_name('route/link')
self._info_module = None
self._protocol = netlink.NETLINK_ROUTE
self._nl_cache = cache
self._set_arg1(family)
def __getitem__(self, key):
if type(key) is int:
link = capi.rtnl_link_get(self._nl_cache, key)
else:
link = capi.rtnl_link_get_by_name(self._nl_cache, key)
if link is None:
raise KeyError()
else:
return Link.from_capi(link)
@staticmethod
def _new_object(obj):
return Link(obj)
def _new_cache(self, cache):
return LinkCache(family=self.arg1, cache=cache)
class Link(netlink.Object):
"""Network link"""
def __init__(self, obj=None):
netlink.Object.__init__(self, 'route/link', 'link', obj)
self._rtnl_link = self._obj2type(self._nl_object)
if self.type:
self._module_lookup('netlink.route.links.' + self.type)
self.inet = inet.InetLink(self)
self.af = {'inet' : self.inet }
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, tb):
if exc_type is None:
self.change()
else:
return false
@classmethod
def from_capi(cls, obj):
return cls(capi.link2obj(obj))
@staticmethod
def _obj2type(obj):
return capi.obj2link(obj)
def __cmp__(self, other):
return self.ifindex - other.ifindex
@staticmethod
def _new_instance(obj):
if not obj:
raise ValueError()
return Link(obj)
@property
@netlink.nlattr(type=int, immutable=True, fmt=util.num)
def ifindex(self):
"""interface index"""
return capi.rtnl_link_get_ifindex(self._rtnl_link)
@ifindex.setter
def ifindex(self, value):
capi.rtnl_link_set_ifindex(self._rtnl_link, int(value))
# ifindex is immutable but we assume that if _orig does not
# have an ifindex specified, it was meant to be given here
if capi.rtnl_link_get_ifindex(self._orig) == 0:
capi.rtnl_link_set_ifindex(self._orig, int(value))
@property
@netlink.nlattr(type=str, fmt=util.bold)
def name(self):
"""Name of link"""
return capi.rtnl_link_get_name(self._rtnl_link)
@name.setter
def name(self, value):
capi.rtnl_link_set_name(self._rtnl_link, value)
# name is the secondary identifier, if _orig does not have
# the name specified yet, assume it was meant to be specified
# here. ifindex will always take priority, therefore if ifindex
# is specified as well, this will be ignored automatically.
if capi.rtnl_link_get_name(self._orig) is None:
capi.rtnl_link_set_name(self._orig, value)
@property
@netlink.nlattr(type=str, fmt=util.string)
def flags(self):
"""Flags
Setting this property will *Not* reset flags to value you supply in
Examples:
link.flags = '+xxx' # add xxx flag
link.flags = 'xxx' # exactly the same
link.flags = '-xxx' # remove xxx flag
link.flags = [ '+xxx', '-yyy' ] # list operation
"""
flags = capi.rtnl_link_get_flags(self._rtnl_link)
return capi.rtnl_link_flags2str(flags, 256)[0].split(',')
def _set_flag(self, flag):
if flag.startswith('-'):
i = capi.rtnl_link_str2flags(flag[1:])
capi.rtnl_link_unset_flags(self._rtnl_link, i)
elif flag.startswith('+'):
i = capi.rtnl_link_str2flags(flag[1:])
capi.rtnl_link_set_flags(self._rtnl_link, i)
else:
i = capi.rtnl_link_str2flags(flag)
capi.rtnl_link_set_flags(self._rtnl_link, i)
@flags.setter
def flags(self, value):
if not (type(value) is str):
for flag in value:
self._set_flag(flag)
else:
self._set_flag(value)
@property
@netlink.nlattr(type=int, fmt=util.num)
def mtu(self):
"""Maximum Transmission Unit"""
return capi.rtnl_link_get_mtu(self._rtnl_link)
@mtu.setter
def mtu(self, value):
capi.rtnl_link_set_mtu(self._rtnl_link, int(value))
@property
@netlink.nlattr(type=int, immutable=True, fmt=util.num)
def family(self):
"""Address family"""
return capi.rtnl_link_get_family(self._rtnl_link)
@family.setter
def family(self, value):
capi.rtnl_link_set_family(self._rtnl_link, value)
@property
@netlink.nlattr(type=str, fmt=util.addr)
def address(self):
"""Hardware address (MAC address)"""
a = capi.rtnl_link_get_addr(self._rtnl_link)
return netlink.AbstractAddress(a)
@address.setter
def address(self, value):
capi.rtnl_link_set_addr(self._rtnl_link, value._addr)
@property
@netlink.nlattr(type=str, fmt=util.addr)
def broadcast(self):
"""Hardware broadcast address"""
a = capi.rtnl_link_get_broadcast(self._rtnl_link)
return netlink.AbstractAddress(a)
@broadcast.setter
def broadcast(self, value):
capi.rtnl_link_set_broadcast(self._rtnl_link, value._addr)
@property
@netlink.nlattr(type=str, immutable=True, fmt=util.string)
def qdisc(self):
"""Name of qdisc (cannot be changed)"""
return capi.rtnl_link_get_qdisc(self._rtnl_link)
@qdisc.setter
def qdisc(self, value):
capi.rtnl_link_set_qdisc(self._rtnl_link, value)
@property
@netlink.nlattr(type=int, fmt=util.num)
def txqlen(self):
"""Length of transmit queue"""
return capi.rtnl_link_get_txqlen(self._rtnl_link)
@txqlen.setter
def txqlen(self, value):
capi.rtnl_link_set_txqlen(self._rtnl_link, int(value))
@property
@netlink.nlattr(type=str, immutable=True, fmt=util.string)
def arptype(self):
"""Type of link (cannot be changed)"""
type_ = capi.rtnl_link_get_arptype(self._rtnl_link)
return core_capi.nl_llproto2str(type_, 64)[0]
@arptype.setter
def arptype(self, value):
i = core_capi.nl_str2llproto(value)
capi.rtnl_link_set_arptype(self._rtnl_link, i)
@property
@netlink.nlattr(type=str, immutable=True, fmt=util.string, title='state')
def operstate(self):
"""Operational status"""
operstate = capi.rtnl_link_get_operstate(self._rtnl_link)
return capi.rtnl_link_operstate2str(operstate, 32)[0]
@operstate.setter
def operstate(self, value):
i = capi.rtnl_link_str2operstate(value)
capi.rtnl_link_set_operstate(self._rtnl_link, i)
@property
@netlink.nlattr(type=str, immutable=True, fmt=util.string)
def mode(self):
"""Link mode"""
mode = capi.rtnl_link_get_linkmode(self._rtnl_link)
return capi.rtnl_link_mode2str(mode, 32)[0]
@mode.setter
def mode(self, value):
i = capi.rtnl_link_str2mode(value)
capi.rtnl_link_set_linkmode(self._rtnl_link, i)
@property
@netlink.nlattr(type=str, fmt=util.string)
def alias(self):
"""Interface alias (SNMP)"""
return capi.rtnl_link_get_ifalias(self._rtnl_link)
@alias.setter
def alias(self, value):
capi.rtnl_link_set_ifalias(self._rtnl_link, value)
@property
@netlink.nlattr(type=str, fmt=util.string)
def type(self):
"""Link type"""
return capi.rtnl_link_get_type(self._rtnl_link)
@type.setter
def type(self, value):
if capi.rtnl_link_set_type(self._rtnl_link, value) < 0:
raise NameError('unknown info type')
self._module_lookup('netlink.route.links.' + value)
def get_stat(self, stat):
"""Retrieve statistical information"""
if type(stat) is str:
stat = capi.rtnl_link_str2stat(stat)
if stat < 0:
raise NameError('unknown name of statistic')
return capi.rtnl_link_get_stat(self._rtnl_link, stat)
def add(self, sock=None, flags=None):
if not sock:
sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
if not flags:
flags = netlink.NLM_F_CREATE
ret = capi.rtnl_link_add(sock._sock, self._rtnl_link, flags)
if ret < 0:
raise netlink.KernelError(ret)
def change(self, sock=None, flags=0):
"""Commit changes made to the link object"""
if sock is None:
sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
if not self._orig:
raise netlink.NetlinkError('Original link not available')
ret = capi.rtnl_link_change(sock._sock, self._orig, self._rtnl_link, flags)
if ret < 0:
raise netlink.KernelError(ret)
def delete(self, sock=None):
"""Attempt to delete this link in the kernel"""
if sock is None:
sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
ret = capi.rtnl_link_delete(sock._sock, self._rtnl_link)
if ret < 0:
raise netlink.KernelError(ret)
###################################################################
# private properties
#
# Used for formatting output. USE AT OWN RISK
@property
def _state(self):
if 'up' in self.flags:
buf = util.good('up')
if 'lowerup' not in self.flags:
buf += ' ' + util.bad('no-carrier')
else:
buf = util.bad('down')
return buf
@property
def _brief(self):
return self._module_brief() + self._foreach_af('brief')
@property
def _flags(self):
ignore = [
'up',
'running',
'lowerup',
]
return ','.join([flag for flag in self.flags if flag not in ignore])
def _foreach_af(self, name, args=None):
buf = ''
for af in self.af:
try:
func = getattr(self.af[af], name)
s = str(func(args))
if len(s) > 0:
buf += ' ' + s
except AttributeError:
pass
return buf
def format(self, details=False, stats=False, indent=''):
"""Return link as formatted text"""
fmt = util.MyFormatter(self, indent)
buf = fmt.format('{a|ifindex} {a|name} {a|arptype} {a|address} '\
'{a|_state} <{a|_flags}> {a|_brief}')
if details:
buf += fmt.nl('\t{t|mtu} {t|txqlen} {t|weight} '\
'{t|qdisc} {t|operstate}')
buf += fmt.nl('\t{t|broadcast} {t|alias}')
buf += self._foreach_af('details', fmt)
if stats:
l = [['Packets', RX_PACKETS, TX_PACKETS],
['Bytes', RX_BYTES, TX_BYTES],
['Errors', RX_ERRORS, TX_ERRORS],
['Dropped', RX_DROPPED, TX_DROPPED],
['Compressed', RX_COMPRESSED, TX_COMPRESSED],
['FIFO Errors', RX_FIFO_ERR, TX_FIFO_ERR],
['Length Errors', RX_LEN_ERR, None],
['Over Errors', RX_OVER_ERR, None],
['CRC Errors', RX_CRC_ERR, None],
['Frame Errors', RX_FRAME_ERR, None],
['Missed Errors', RX_MISSED_ERR, None],
['Abort Errors', None, TX_ABORT_ERR],
['Carrier Errors', None, TX_CARRIER_ERR],
['Heartbeat Errors', None, TX_HBEAT_ERR],
['Window Errors', None, TX_WIN_ERR],
['Collisions', None, COLLISIONS],
['Multicast', None, MULTICAST],
['', None, None],
['Ipv6:', None, None],
['Packets', IP6_INPKTS, IP6_OUTPKTS],
['Bytes', IP6_INOCTETS, IP6_OUTOCTETS],
['Discards', IP6_INDISCARDS, IP6_OUTDISCARDS],
['Multicast Packets', IP6_INMCASTPKTS, IP6_OUTMCASTPKTS],
['Multicast Bytes', IP6_INMCASTOCTETS, IP6_OUTMCASTOCTETS],
['Broadcast Packets', IP6_INBCASTPKTS, IP6_OUTBCASTPKTS],
['Broadcast Bytes', IP6_INBCASTOCTETS, IP6_OUTBCASTOCTETS],
['Delivers', IP6_INDELIVERS, None],
['Forwarded', None, IP6_OUTFORWDATAGRAMS],
['No Routes', IP6_INNOROUTES, IP6_OUTNOROUTES],
['Header Errors', IP6_INHDRERRORS, None],
['Too Big Errors', IP6_INTOOBIGERRORS, None],
['Address Errors', IP6_INADDRERRORS, None],
['Unknown Protocol', IP6_INUNKNOWNPROTOS, None],
['Truncated Packets', IP6_INTRUNCATEDPKTS, None],
['Reasm Timeouts', IP6_REASMTIMEOUT, None],
['Reasm Requests', IP6_REASMREQDS, None],
['Reasm Failures', IP6_REASMFAILS, None],
['Reasm OK', IP6_REASMOKS, None],
['Frag Created', None, IP6_FRAGCREATES],
['Frag Failures', None, IP6_FRAGFAILS],
['Frag OK', None, IP6_FRAGOKS],
['', None, None],
['ICMPv6:', None, None],
['Messages', ICMP6_INMSGS, ICMP6_OUTMSGS],
['Errors', ICMP6_INERRORS, ICMP6_OUTERRORS]]
buf += '\n\t%s%s%s%s\n' % (33 * ' ', util.title('RX'),
15 * ' ', util.title('TX'))
for row in l:
row[0] = util.kw(row[0])
row[1] = self.get_stat(row[1]) if row[1] else ''
row[2] = self.get_stat(row[2]) if row[2] else ''
buf += '\t{0[0]:27} {0[1]:>16} {0[2]:>16}\n'.format(row)
buf += self._foreach_af('stats')
return buf
def get(name, sock=None):
"""Lookup Link object directly from kernel"""
if not name:
raise ValueError()
if not sock:
sock = netlink.lookup_socket(netlink.NETLINK_ROUTE)
# returns a struct rtnl_link, defined in netlink-private/types.h
link = capi.get_from_kernel(sock._sock, 0, name)
if not link:
return None
return Link.from_capi(link)
_link_cache = LinkCache()
def resolve(name):
_link_cache.refill()
return _link_cache[name]
| lgpl-2.1 | -5,284,595,556,784,319,000 | 30.184502 | 83 | 0.580464 | false |
liutairan/eMolFrag | Old versions/eMolFrag_2016_12_21_02/eMolFrag.py | 1 | 37326 | #Process:
#1. Get a list of original sdf files
#2. Use chopRDKit02.py generates fragments and list of files with total atom number, carbon atom number, nitrogen and oxygen atom number
#3. Form lists of by atom numbers
#4. Run rmRedLinker03.py or rmRedRigid01.py on different lists generated by step 3. Remove redundancy of linkers and rigids.
#5. Remove temp file and dir.
#main-script:
# - eMolFrag.py
#sub-scripts used:
# - loader.py
# - chopRDKit02.py,
# - combineLinkers01.py
# - rmRedRigid01.py,
# - rmRedLinker03.py,
# - mol-ali-04.py.
#Usage: Read README file for detailed information.
# 1. Configure path: python ConfigurePath.py # Path only need to be set before the first run if no changes to the paths.
# 2. /Path_to_Python/python /Path_to_scripts/eMolFrag.py /Path_to_input_directory/ /Path_to_output_directory/ Number-Of-Cores
#Args:
# - /Path to Python/ ... Use python to run the script
# - /Path to scripts/echop.py ... The directory of scripts and the name of the entrance to the software
# - /Path to input directory/ ... The path to the input directory, in which is the input molecules in *.mol2 format
# - /Path to output directory/ ... The path to the output directory, in which is the output files
# - Number-Of-Cores ... Number of processings to be used in the run
#Update Log:
#This script is written by Tairan Liu.
# Created 01/17/2016 - Chop
# Modification 01/17/2016 - Remove bug
# Modification 01/18/2016 - Reconnect linkers
# Modification 01/21/2016 - Remove redundancy
# Modification 02/29/2016 - Remove bug
# Modification 03/16/2016 - Remove bug
# Modification 03/17/2016 - Remove bug
# Modification 03/24/2016 - Remove bug
# Modification 03/25/2016 - Change each step to functions
# Modification 04/03/2016 - Remove bug
# Modification 04/06/2016 - Reduce temp output files
# Modification 04/06/2016 - Remove bug
# Modification 04/06/2016 - Start parallel with chop
# Modification 04/17/2016 - Improve efficiency
# Modification 04/18/2016 - Remove bug
# Modification 05/24/2016 - Start parallel with remove redundancy
# Modification 06/14/2016 - Add parallel option as arg
# Modification 06/14/2016 - Remove bug
# Modification 06/29/2016 - Remove bug
# Modification 07/08/2016 - Change similarity criteria of rigids from 0.95 to 0.97
# Modification 07/11/2016 - Improve efficiency
# Modification 07/18/2016 - Pack up, format.
# Modification 07/19/2016 - Solve python 2.x/3.x compatibility problem.
# Modification 07/20/2016 - Solve python 2.x/3.x compatibility problem.
# Modification 07/21/2016 - Solve python 2.x/3.x compatibility problem.
# Modification 07/22/2016 - Solve python 2.x/3.x compatibility problem.
# Modification 07/22/2016 - Modify README file
# Last revision 09/13/2016 - Solve output path conflict problem.
import subprocess
import os
import path
import os.path
import shutil
import sys
import time
from multiprocessing import Pool
from functools import partial
def ParseArgs():
#input and output path define and create
args=sys.argv
#inputFolderPath=args[1]
#outputDir=args[2]
mainEntryPath=os.path.abspath(args[0])
inputFolderPath = []
outputDir = []
processNum = 1
outputSelection = 0
outputFormat = 0
if len(args) > 1:
argList = args[1:]
else:
print('Error Code: 1010. Incorrect arguments.')
return
if len(argList) == 10: # -i -o -p -m -c
paraFlag = 1
#print('Show')
if (argList[0] == '-i') and (argList[2] == '-o') and (argList[4] == '-p') and (argList[6] == '-m') and (argList[8] == '-c'):
# input path
tempPath1 = os.path.abspath(argList[1])
#print(tempPath1)
if os.path.isdir(tempPath1):
inputFolderPath = tempPath1
if inputFolderPath[-1]=='/':
pass
else:
inputFolderPath=inputFolderPath+'/'
else:
paraFlag = 0
#print(paraFlag)
# output path
tempPath2 = os.path.abspath(argList[3])
#print(tempPath2)
#if os.path.isdir(tempPath2):
outputDir = tempPath2
if outputDir[-1]=='/':
pass
else:
outputDir=outputDir+'/'
#else:
# paraFlag = 0
#print(outputDir)
# parallel
tempCoreNum = int(argList[5])
if (tempCoreNum >= 1) and (tempCoreNum <= 16):
processNum = tempCoreNum
else:
paraFlag = 0
#print(paraFlag)
# output select
tempOutputSelection = int(argList[7])
if (tempOutputSelection >= 0) and (tempOutputSelection <= 2):
outputSelection = tempOutputSelection
else:
paraFlag = 0
# output format
tempOutputFormat = int(argList[9])
if (tempOutputFormat >= 0) and (tempOutputFormat <= 1):
outputFormat = tempOutputFormat
else:
paraFlag = 0
else:
paraFlag = 0
if paraFlag == 1:
pass
else:
print('Error Code: 1012. Incorrect arguments.')
return
elif len(argList) == 8: # -i -o, two of three (-p -m -c)
paraFlag = 1
if (argList[0] == '-i') and (argList[2] == '-o'):
# input path
tempPath1 = os.path.abspath(argList[1])
if os.path.isdir(tempPath1):
inputFolderPath = tempPath1
if inputFolderPath[-1]=='/':
pass
else:
inputFolderPath=inputFolderPath+'/'
else:
paraFlag = 0
# output path
tempPath2 = os.path.abspath(argList[3])
#if os.path.isdir(tempPath2):
outputDir = tempPath2
if outputDir[-1]=='/':
pass
else:
outputDir=outputDir+'/'
#else:
# paraFlag = 0
else:
paraFlag = 0
if (argList[4] == '-p') and (argList[6] == '-m'):
# parallel
tempCoreNum = int(argList[5])
if (tempCoreNum >= 1) and (tempCoreNum <= 16):
processNum = tempCoreNum
else:
paraFlag = 0
# output select
tempOutputSelection = int(argList[7])
if (tempOutputSelection >= 0) and (tempOutputSelection <= 2):
outputSelection = tempOutputSelection
else:
paraFlag = 0
elif (argList[4] == '-p') and (argList[6] == '-c'):
# parallel
tempCoreNum = int(argList[5])
if (tempCoreNum >= 1) and (tempCoreNum <= 16):
processNum = tempCoreNum
else:
paraFlag = 0
# output format
tempOutputFormat = int(argList[9])
if (tempOutputFormat >= 0) and (tempOutputFormat <= 1):
outputFormat = tempOutputFormat
else:
paraFlag = 0
elif (argList[4] == '-m') and (argList[6] == '-c'):
# output select
tempOutputSelection = int(argList[7])
if (tempOutputSelection >= 0) and (tempOutputSelection <= 2):
outputSelection = tempOutputSelection
else:
paraFlag = 0
# output format
tempOutputFormat = int(argList[9])
if (tempOutputFormat >= 0) and (tempOutputFormat <= 1):
outputFormat = tempOutputFormat
else:
paraFlag = 0
else:
paraFlag = 0
if paraFlag == 1:
pass
else:
print('Error Code: 1013. Incorrect arguments.')
return
elif len(argList) == 6: # -i -o, one of three (-p -m -c)
paraFlag = 1
if (argList[0] == '-i') and (argList[2] == '-o'):
# input path
tempPath1 = os.path.abspath(argList[1])
if os.path.isdir(tempPath1):
inputFolderPath = tempPath1
if inputFolderPath[-1]=='/':
pass
else:
inputFolderPath=inputFolderPath+'/'
else:
paraFlag = 0
# output path
tempPath2 = os.path.abspath(argList[3])
#if os.path.isdir(tempPath2):
outputDir = tempPath2
if outputDir[-1]=='/':
pass
else:
outputDir=outputDir+'/'
#else:
# paraFlag = 0
else:
paraFlag = 0
if (argList[4] == '-p'):
# parallel
tempCoreNum = int(argList[5])
if (tempCoreNum >= 1) and (tempCoreNum <= 16):
processNum = tempCoreNum
else:
paraFlag = 0
elif (argList[4] == '-c'):
# output format
tempOutputFormat = int(argList[9])
if (tempOutputFormat >= 0) and (tempOutputFormat <= 1):
outputFormat = tempOutputFormat
else:
paraFlag = 0
elif (argList[4] == '-m'):
# output select
tempOutputSelection = int(argList[7])
if (tempOutputSelection >= 0) and (tempOutputSelection <= 2):
outputSelection = tempOutputSelection
else:
paraFlag = 0
else:
paraFlag = 0
if paraFlag == 1:
pass
else:
print('Error Code: 1014. Incorrect arguments.')
return
elif len(argList) == 4: # -i -o
paraFlag = 1
if (argList[0] == '-i') and (argList[2] == '-o'):
# input path
tempPath1 = os.path.abspath(argList[1])
if os.path.isdir(tempPath1):
inputFolderPath = tempPath1
if inputFolderPath[-1]=='/':
pass
else:
inputFolderPath=inputFolderPath+'/'
else:
paraFlag = 0
# output path
tempPath2 = os.path.abspath(argList[3])
#if os.path.isdir(tempPath2):
outputDir = tempPath2
if outputDir[-1]=='/':
pass
else:
outputDir=outputDir+'/'
#else:
# paraFlag = 0
else:
paraFlag = 0
if paraFlag == 1:
pass
else:
print('Error Code: 1015. Incorrect arguments.')
return
else:
print('Error Code: 1011. Incorrect arguments.')
return
return [mainEntryPath, inputFolderPath, outputDir, processNum, outputSelection, outputFormat]
def PrepareEnv(outputDir, mainEntryPath, processNum):
try:
# check output folder conflict or not
# detect output folder
if os.path.exists(outputDir):
print('Designate output path already exists, do you want to use another path? [y/n]')
flagSetPath = 1
ver = sys.version[0]
p1 = ''
p2 = ''
while flagSetPath:
if ver == '2':
p1 = raw_input()
if p1 == 'y':
print('Please type a new output path')
p2 = raw_input()
outputDir=os.path.abspath(p2)
print(outputDir)
if outputDir[-1]=='/':
pass
else:
outputDir=outputDir+'/'
if os.path.exists(outputDir):
print('Designate output path already exists, do you want to use another path? [y/n]')
else:
flagSetPath = 0
print('Output path successfully set. Continue...')
elif p1 == 'n':
print('Old files in this path will be deleted, continue? [y/n]')
p3 = raw_input()
if p3 == 'y':
shutil.rmtree(outputDir)
flagSetPath = 0
elif p3 == 'n':
print('Designate output path already exists, do you want to use another path? [y/n]')
else:
print('Unrecognizable character, please type again: [y/n]')
else:
print('Unrecognizable character, please type again: [y/n]')
elif ver == '3':
p1 = input()
if p1 == 'y':
print('Please type a new output path')
p2 = input()
outputDir=os.path.abspath(p2)
print(outputDir)
if outputDir[-1]=='/':
pass
else:
outputDir=outputDir+'/'
if os.path.exists(outputDir):
print('Designate output path already exists, do you want to use another path? [y/n]')
else:
flagSetPath = 0
print('Output path successfully set. Continue...')
elif p1 == 'n':
print('Old files in this path will be deleted, continue? [y/n]')
p3 = input()
if p3 == 'y':
shutil.rmtree(outputDir)
flagSetPath = 0
elif p3 == 'n':
print('Designate output path already exists, do you want to use another path? [y/n]')
else:
print('Unrecognizable character, please type again: [y/n]')
else:
print('Unrecognizable character, please type again: [y/n]')
else:
print('Error Code: 1021. Get python version failed.')
return
except:
print('Error Code: 1020.')
return
try:
# check scripts existance and completeness
if os.path.exists(mainEntryPath):
mainPath=os.path.dirname(mainEntryPath)
if os.path.exists(mainPath+'/loader.py'):
os.chdir(mainPath)
pass
else:
print('Error Code: 1032. Cannot find part of script files.\nExit.')
sys.exit()
else:
print('Error Code: 1031. Error input format.\nExit.')
sys.exit()
except:
print('Error Code: 1030.')
return
try:
pool=Pool(processes=processNum)
except:
print('Error Code: 1040.')
return
try:
outputFolderPath_log=outputDir+'output-log/'
outputFolderPath_chop=outputDir+'output-chop/'
outputFolderPath_active=outputDir+'output-rigid/'
outputFolderPath_linker=outputDir+'output-linker/'
outputFolderPath_sdf=outputDir+'output-sdf/'
outputFolderPath_chop_comb=outputDir+'output-chop-comb/'
if not os.path.exists(outputDir):
os.mkdir(outputDir)
#else:
# print('Designate output path already exists, do you want to use another path?')
if not os.path.exists(outputFolderPath_log):
os.mkdir(outputFolderPath_log)
if not os.path.exists(outputFolderPath_chop):
os.mkdir(outputFolderPath_chop)
if not os.path.exists(outputFolderPath_active):
os.mkdir(outputFolderPath_active)
if not os.path.exists(outputFolderPath_linker):
os.mkdir(outputFolderPath_linker)
if not os.path.exists(outputFolderPath_sdf):
os.mkdir(outputFolderPath_sdf)
if not os.path.exists(outputFolderPath_chop_comb):
os.mkdir(outputFolderPath_chop_comb)
except:
print('Error Code: 1050.')
return
try:
try:
from loader import Loader
except:
print('Error Code: 1061. Failed to load loader.')
return
try:
initState=Loader(mainEntryPath)
except:
print('Error Code: 1062. Failed to load scripts and configures.')
return
if initState == 0:
pass
else:
print('Error Code: 1063. Cannot load prerequisit.\nExit.')
sys.exit()
except:
print('Error Code: 1060.')
return
outputPathList = [outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb]
return [outputPathList, pool]
def ProcessData(inputFolderPath, outputPathList, outputSelection, outputFormat, pool):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1130. Failed to parse output path list.')
return
try:
from combineLinkers01 import combineLinkers
from rmRedLinker03 import RmLinkerRed
from rmRedRigid01 import RmRigidRed
from chopRDKit02 import ChopWithRDKit
except:
print('Error Code: 1070. Failed to load required lib files.')
return
# Create work
try:
path = outputFolderPath_log+'Process.log'
msg = ' Create Work ' + inputFolderPath+' '+outputDir
PrintLog(path, msg)
except:
print('Error Code: 1071. Failed to write log file.')
try:
GetInputList(inputFolderPath, outputFolderPath_log)
except:
print('Error Code: 1072.')
return
try:
Chop(outputPathList, pool)
except:
print('Error Code: 1073.')
return
if (outputSelection == 0) or (outputSelection == 2):
try:
RmRigidRedundancy(outputPathList, pool)
except:
print('Error Code: 1074.')
return
try:
RmLinkerRedundancy(outputPathList, pool)
except:
print('Error Code: 1075.')
return
else:
pass
# End Work
try:
path = outputFolderPath_log+'Process.log'
msg = ' End Work '
PrintLog(path, msg)
except:
print('Error Code: 1076. Failed to write log file.')
return
def AdjustOutput(outputPathList, outputSelection, outputFormat):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1130. Failed to parse output path list.')
return
#Step 5: Clear temp file and directory.
if outputSelection == 0: # default output selection, full process and output, left 4 folders: log, rigid, linker, chop-comb
shutil.rmtree(outputFolderPath_chop)
shutil.rmtree(outputFolderPath_sdf)
elif outputSelection == 1: # only chop and reconnect, not remove redundancy, left 2 folders: log, chop-comb
shutil.rmtree(outputFolderPath_chop)
shutil.rmtree(outputFolderPath_sdf)
shutil.rmtree(outputFolderPath_active)
shutil.rmtree(outputFolderPath_linker)
elif outputSelection == 2: # chop and remove redundancy, but remove temp files, left 3 folders: log rigid, linker
shutil.rmtree(outputFolderPath_chop)
shutil.rmtree(outputFolderPath_sdf)
shutil.rmtree(outputFolderPath_chop_comb)
else:
print('Error Code: 1131. Invalid output selection.')
return
if outputFormat == 1: # traditional format, each file only contain one molecule
pass
elif outputFormat == 0: # default output format, only one rigid file and only one linker file
if outputSelection == 0: # 4 output files, (rigid, linker)*(before remove, after remove)
try:
AdjustSub0(outputPathList)
except:
print('Error Code: 1134.')
return
elif outputSelection == 1: # 2 output files, (rigid, linker)*(before remove)
try:
AdjustSub1(outputPathList)
except:
print('Error Code: 1135.')
return
elif outputSelection == 2: # 2 output files, (rigid, linker)*(after remove)
try:
AdjustSub2(outputPathList)
except:
print('Error Code: 1136.')
return
else:
print('Error Code: 1133.')
return
else:
print('Error Code: 1132. Invalid output format.')
return
def AdjustSub0(outputPathList):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1140. Failed to parse output path list.')
return
try:
[combFilePath, combFileName] = GetFileList(outputFolderPath_chop_comb)
except:
print('Error Code: 1141.')
return
try:
tempRigidContent = []
tempLinkerContent = []
b4rmRigidPath = outputDir + 'RigidFull.sdf'
b4rmLinkerPath = outputDir + 'LinkerFull.sdf'
for i in range(len(combFilePath)):
if combFileName[i][0] == 'r':
with open(combFilePath[i], 'r') as inf:
tempRigidContent = inf.readlines()
with open(b4rmRigidPath, 'at') as outf:
outf.writelines(tempRigidContent)
outf.write('\n')
tempRigidContent = []
elif combFileName[i][0] == 'l':
with open(combFilePath[i], 'r') as inf:
tempLinkerContent = inf.readlines()
with open(b4rmLinkerPath, 'at') as outf:
outf.writelines(tempLinkerContent)
outf.write('\n')
tempLinkerContent = []
else:
pass
except:
print('Error Code: 1142.')
try:
[rigidFilePath, rigidFileName] = GetFileList(outputFolderPath_active)
except:
print('Error Code: 1143.')
try:
tempRigidContent = []
rmdRigidPath = outputDir + 'RigidUnique.sdf'
for i in range(len(rigidFilePath)):
if rigidFileName[i][0] == 'r':
with open(rigidFilePath[i], 'r') as inf:
tempRigidContent = inf.readlines()
with open(rmdRigidPath, 'at') as outf:
outf.writelines(tempRigidContent)
outf.write('\n')
tempRigidContent = []
except:
print('Error Code: 1144.')
try:
[linkerFilePath, linkerFileName] = GetFileList(outputFolderPath_linker)
except:
print('Error Code: 1145.')
try:
tempLinkerContent = []
rmdLinkerPath = outputDir + 'LinkerUnique.sdf'
for i in range(len(linkerFilePath)):
if linkerFileName[i][0] == 'l':
with open(linkerFilePath[i], 'r') as inf:
tempLinkerContent = inf.readlines()
with open(rmdLinkerPath, 'at') as outf:
outf.writelines(tempLinkerContent)
outf.write('\n')
tempLinkerContent = []
except:
print('Error Code: 1146.')
try:
shutil.rmtree(outputFolderPath_chop_comb)
shutil.rmtree(outputFolderPath_active)
shutil.rmtree(outputFolderPath_linker)
except:
print('Error Code: 1147. Failed to remove temp files.')
def AdjustSub1(outputPathList):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1150. Failed to parse output path list.')
return
try:
[combFilePath, combFileName] = GetFileList(outputFolderPath_chop_comb)
except:
print('Error Code: 1151.')
return
try:
tempRigidContent = []
tempLinkerContent = []
b4rmRigidPath = outputDir + 'RigidFull.sdf'
b4rmLinkerPath = outputDir + 'LinkerFull.sdf'
for i in range(len(combFilePath)):
if combFileName[i][0] == 'r':
with open(combFilePath[i], 'r') as inf:
tempRigidContent = inf.readlines()
with open(b4rmRigidPath, 'at') as outf:
outf.writelines(tempRigidContent)
outf.write('\n')
tempRigidContent = []
elif combFileName[i][0] == 'l':
with open(combFilePath[i], 'r') as inf:
tempLinkerContent = inf.readlines()
with open(b4rmLinkerPath, 'at') as outf:
outf.writelines(tempLinkerContent)
outf.write('\n')
tempLinkerContent = []
else:
pass
except:
print('Error Code: 1152.')
try:
shutil.rmtree(outputFolderPath_chop_comb)
except:
print('Error Code: 1157. Failed to remove temp files.')
def AdjustSub2(outputPathList):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1160. Failed to parse output path list.')
return
try:
[rigidFilePath, rigidFileName] = GetFileList(outputFolderPath_active)
except:
print('Error Code: 1163.')
try:
tempRigidContent = []
rmdRigidPath = outputDir + 'RigidUnique.sdf'
for i in range(len(rigidFilePath)):
if rigidFileName[i][0] == 'r':
with open(rigidFilePath[i], 'r') as inf:
tempRigidContent = inf.readlines()
with open(rmdRigidPath, 'at') as outf:
outf.writelines(tempRigidContent)
outf.write('\n')
tempRigidContent = []
except:
print('Error Code: 1164.')
try:
[linkerFilePath, linkerFileName] = GetFileList(outputFolderPath_linker)
except:
print('Error Code: 1165.')
try:
tempLinkerContent = []
rmdLinkerPath = outputDir + 'LinkerUnique.sdf'
for i in range(len(linkerFilePath)):
if linkerFileName[i][0] == 'l':
with open(linkerFilePath[i], 'r') as inf:
tempLinkerContent = inf.readlines()
with open(rmdLinkerPath, 'at') as outf:
outf.writelines(tempLinkerContent)
outf.write('\n')
tempLinkerContent = []
except:
print('Error Code: 1166.')
try:
shutil.rmtree(outputFolderPath_active)
shutil.rmtree(outputFolderPath_linker)
except:
print('Error Code: 1167. Failed to remove temp files.')
def GetFileList(path):
try:
fileNameList = []
filePathList = []
try:
for root, dirs, files in os.walk(path):
for file in files:
fileNameList.append(file)
filePathList.append(path+file)
return [filePathList, fileNameList]
except:
print('Error Code: 1171.')
return
except:
print('Error Code: 1170.')
return
def GetInputList(inputFolderPath, outputFolderPath_log):
#Step 1: Get a list of original *.mol2 files
try:
fileNameList=[]
infilePathList=[]
outfilePathList=[]
try:
for root, dirs, files in os.walk(inputFolderPath):
for file in files:
fileNameList.append(file)
infilePathList.append(inputFolderPath+file+'\n')
except:
print('Error Code: 1081.')
return
try:
with open(outputFolderPath_log+'InputList','at') as outList:
outList.writelines(infilePathList)
except:
print('Error Code: 1082.')
return
except:
print('Error Code: 1080. Failed to get input file list.')
return
def Chop(outputPathList, pool):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1130. Failed to parse output path list.')
return
try:
from chopRDKit02 import ChopWithRDKit
except:
print('Error Code: 1090-01.')
return
#Step 2: chop and generate list
# Log
try:
path = outputFolderPath_log+'Process.log'
msg = ' Start Chop '
PrintLog(path, msg)
except:
print('Error Code: 1090. Failed to write log file.')
return
try:
inputList=[]
with open(outputFolderPath_log+'InputList','r') as inList:
for lines in inList:
inputList.append(lines.replace('\n',''))
except:
print('Error Code: 1091.')
return
try:
partial_Chop=partial(ChopWithRDKit, outputDir)
pool.map(partial_Chop,inputList)
except:
print('Error Code: 1092.')
return
try:
# Log
path = outputFolderPath_log+'Process.log'
msg = ' End Chop '
PrintLog(path, msg)
except:
print('Error Code: 1093.')
return
def RmRigidRedundancy(outputPathList, pool):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1130. Failed to parse output path list.')
return
try:
from rmRedRigid01 import RmRigidRed
except:
print('Error Code: 1100-01')
return
# Rigid Part
#Step 3: Form and group lists by atom numbers
fileNameAndAtomNumList_R=[]
try:
with open(outputFolderPath_log+'RigidListAll.txt','r') as inList:
fileNameAndAtomNumList_R=inList.readlines()
except:
print('Error Code: 1100.')
return
FNAANLList_R=[] #file name and atom number list list
try:
for FNAAN in fileNameAndAtomNumList_R: #FNAAN: file name and atom number
FNAANList=FNAAN.split() #FNAANList: file name and atom number list
FNAANLList_R.append([FNAANList[0],FNAANList[1:]])
except:
print('Error Code: 1101.')
return
atomNumPro_R=[]
try:
for tempValue in FNAANLList_R: #tempValue: [[filename],['T','','C','','N','','O','']]
if tempValue[1] not in atomNumPro_R: #tempValue[1]: ['T','','C','','N','','O',''],Group Property
atomNumPro_R.append(tempValue[1])
except:
print('Error Code: 1102.')
return
try:
fileNameGroup_R=[[y[0] for y in FNAANLList_R if y[1]==x] for x in atomNumPro_R]
except:
print('Error Code: 1103.')
return
try:
with open(outputFolderPath_log+'RigidGroupList.txt','w') as groupOut:
for i in range(len(atomNumPro_R)):
groupOut.write(' '.join(atomNumPro_R[i])+' - ')
groupOut.write('File Num: ')
groupOut.write(str(len(fileNameGroup_R[i])))
groupOut.write('\n')
except:
print('Error Code: 1104.')
return
try:
# Log
path = outputFolderPath_log+'Process.log'
msg = ' Start Remove Rigid Redundancy '
PrintLog(path, msg)
except:
print('Error Code: 1105.')
return
#Step 4: Generate similarity data and etc.
try:
fileNameGroup_Rs=sorted(fileNameGroup_R,key=lambda x:len(x),reverse=True) #process long list first
except:
print('Error Code: 1106.')
return
try:
partial_RmRigid=partial(RmRigidRed, outputDir)
pool.map(partial_RmRigid,fileNameGroup_Rs)
except:
print('Error Code: 1107.')
return
try:
# Log
path = outputFolderPath_log+'Process.log'
msg = ' End Remove Rigid Redundancy '
PrintLog(path, msg)
except:
print('Error Code: 1108.')
return
def RmLinkerRedundancy(outputPathList, pool):
try:
[outputDir, outputFolderPath_log, outputFolderPath_chop, outputFolderPath_active, outputFolderPath_linker, outputFolderPath_sdf, outputFolderPath_chop_comb] = outputPathList
except:
print('Error Code: 1130. Failed to parse output path list.')
return
try:
from combineLinkers01 import combineLinkers
from rmRedLinker03 import RmLinkerRed
except:
print('Error Code: 1110-01')
return
# Linker Part
#Step 3: Form and group lists by atom numbers
fileNameAndAtomNumList_L=[]
try:
with open(outputFolderPath_log+'LinkerListAll.txt','r') as inList:
fileNameAndAtomNumList_L=inList.readlines()
except:
print('Error Code: 1110.')
return
FNAANLList_L=[] #file name and atom number list list
try:
for FNAAN in fileNameAndAtomNumList_L: #FNAAN: file name and atom number
FNAANList=FNAAN.split() #FNAANList: file name and atom number list
FNAANLList_L.append([FNAANList[0],FNAANList[1:]])
except:
print('Error Code: 1111.')
return
atomNumPro_L=[]
try:
for tempValue in FNAANLList_L:
if tempValue[1] not in atomNumPro_L:
atomNumPro_L.append(tempValue[1])
except:
print('Error Code: 1112.')
return
try:
fileNameGroup_L=[[y[0] for y in FNAANLList_L if y[1]==x] for x in atomNumPro_L]
except:
print('Error Code: 1113.')
return
try:
with open(outputFolderPath_log+'LinkerGroupList.txt','w') as groupOut:
for i in range(len(atomNumPro_L)):
groupOut.write(' '.join(atomNumPro_L[i])+' - ')
groupOut.write('File Num: ')
groupOut.write(str(len(fileNameGroup_L[i])))
groupOut.write('\n')
except:
print('Error Code: 1114.')
return
try:
# Log
path = outputFolderPath_log+'Process.log'
msg = ' Start Remove Linker Redundancy '
PrintLog(path, msg)
except:
print('Error Code: 1115.')
return
#Step 4: Generate similarity data and etc.
try:
partial_RmLinker=partial(RmLinkerRed, outputDir)
except:
print('Error Code: 1116.')
return
inputL=[]
try:
for i in range(len(fileNameGroup_L)):
inputL.append([fileNameGroup_L[i],atomNumPro_L[i]])
except:
print('Error Code: 1117.')
return
try:
inputLs=sorted(inputL,key=lambda x:len(x[0]),reverse=True)
except:
print('1118.')
return
try:
pool.map(partial_RmLinker,inputLs)
except:
print('1119.')
return
try:
# Log
path = outputFolderPath_log+'Process.log'
msg = ' End Remove Linker Redundancy '
PrintLog(path, msg)
except:
print('Error Code: 1120.')
return
def PrintLog(path, msg):
# write log
with open(path, 'at') as outLog:
outLog.write(time.asctime( time.localtime(time.time()) ))
outLog.write(msg)
outLog.write('\n')
def main():
try:
try:
[mainEntryPath, inputFolderPath, outputDir, processNum, outputSelection, outputFormat] = ParseArgs()
except:
print('Error Code: 1001. Failed to parse input commands.')
return
try:
[outputPathList, pool] = PrepareEnv(outputDir, mainEntryPath, processNum)
except:
print('Error Code: 1002. Failed to prepare running evnironment.')
return
try:
ProcessData(inputFolderPath, outputPathList, outputSelection, outputFormat, pool)
except:
print('Error Code: 1003. Failed to process data.')
return
try:
AdjustOutput(outputPathList, outputSelection, outputFormat)
except:
print('Error Code: 1004. Failed to adjust output format.')
return
except:
print('Error Code: 1000')
return
if __name__ == "__main__":
main()
| gpl-3.0 | 8,407,459,200,154,259,000 | 32.59676 | 181 | 0.550313 | false |
tombstone/models | research/object_detection/utils/object_detection_evaluation_test.py | 1 | 48048 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for object_detection.utils.object_detection_evaluation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
from absl.testing import parameterized
import numpy as np
import six
from six.moves import range
import tensorflow.compat.v1 as tf
from object_detection import eval_util
from object_detection.core import standard_fields
from object_detection.utils import object_detection_evaluation
from object_detection.utils import tf_version
class OpenImagesV2EvaluationTest(tf.test.TestCase):
def test_returns_correct_metric_values(self):
categories = [{
'id': 1,
'name': 'cat'
}, {
'id': 2,
'name': 'dog'
}, {
'id': 3,
'name': 'elephant'
}]
oiv2_evaluator = object_detection_evaluation.OpenImagesDetectionEvaluator(
categories)
image_key1 = 'img1'
groundtruth_boxes1 = np.array(
[[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]], dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
oiv2_evaluator.add_single_ground_truth_image_info(image_key1, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1,
standard_fields.InputDataFields.groundtruth_group_of:
np.array([], dtype=bool)
})
image_key2 = 'img2'
groundtruth_boxes2 = np.array(
[[10, 10, 11, 11], [500, 500, 510, 510], [10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([1, 1, 3], dtype=int)
groundtruth_is_group_of_list2 = np.array([False, True, False], dtype=bool)
oiv2_evaluator.add_single_ground_truth_image_info(image_key2, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes2,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels2,
standard_fields.InputDataFields.groundtruth_group_of:
groundtruth_is_group_of_list2
})
image_key3 = 'img3'
groundtruth_boxes3 = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels3 = np.array([2], dtype=int)
oiv2_evaluator.add_single_ground_truth_image_info(image_key3, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes3,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels3
})
# Add detections
image_key = 'img2'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120], [100, 100, 220, 220]],
dtype=float)
detected_class_labels = np.array([1, 1, 3], dtype=int)
detected_scores = np.array([0.7, 0.8, 0.9], dtype=float)
oiv2_evaluator.add_single_detected_image_info(image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels
})
metrics = oiv2_evaluator.evaluate()
self.assertAlmostEqual(
metrics['OpenImagesV2_PerformanceByCategory/[email protected]/dog'], 0.0)
self.assertAlmostEqual(
metrics['OpenImagesV2_PerformanceByCategory/[email protected]/elephant'], 0.0)
self.assertAlmostEqual(
metrics['OpenImagesV2_PerformanceByCategory/[email protected]/cat'], 0.16666666)
self.assertAlmostEqual(metrics['OpenImagesV2_Precision/[email protected]'],
0.05555555)
oiv2_evaluator.clear()
self.assertFalse(oiv2_evaluator._image_ids)
class OpenImagesChallengeEvaluatorTest(tf.test.TestCase):
def test_returns_correct_detection_metric_values(self):
categories = [{
'id': 1,
'name': 'cat'
}, {
'id': 2,
'name': 'dog'
}, {
'id': 3,
'name': 'elephant'
}]
oivchallenge_evaluator = (
object_detection_evaluation.OpenImagesChallengeEvaluator(
categories, evaluate_masks=False, group_of_weight=0.5))
image_key = 'img1'
groundtruth_boxes = np.array(
[[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]], dtype=float)
groundtruth_class_labels = np.array([1, 3, 1], dtype=int)
groundtruth_is_group_of_list = np.array([False, False, True], dtype=bool)
groundtruth_verified_labels = np.array([1, 2, 3], dtype=int)
oivchallenge_evaluator.add_single_ground_truth_image_info(
image_key, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels,
standard_fields.InputDataFields.groundtruth_group_of:
groundtruth_is_group_of_list,
standard_fields.InputDataFields.groundtruth_image_classes:
groundtruth_verified_labels,
})
image_key = 'img2'
groundtruth_boxes = np.array(
[[10, 10, 11, 11], [500, 500, 510, 510], [10, 10, 12, 12]], dtype=float)
groundtruth_class_labels = np.array([1, 1, 3], dtype=int)
groundtruth_is_group_of_list = np.array([False, False, True], dtype=bool)
oivchallenge_evaluator.add_single_ground_truth_image_info(
image_key, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels,
standard_fields.InputDataFields.groundtruth_group_of:
groundtruth_is_group_of_list
})
image_key = 'img3'
groundtruth_boxes = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels = np.array([2], dtype=int)
oivchallenge_evaluator.add_single_ground_truth_image_info(
image_key, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels
})
image_key = 'img1'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120]], dtype=float)
detected_class_labels = np.array([2, 2], dtype=int)
detected_scores = np.array([0.7, 0.8], dtype=float)
oivchallenge_evaluator.add_single_detected_image_info(
image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels
})
image_key = 'img2'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120], [100, 100, 220, 220],
[10, 10, 11, 11]],
dtype=float)
detected_class_labels = np.array([1, 1, 2, 3], dtype=int)
detected_scores = np.array([0.7, 0.8, 0.5, 0.9], dtype=float)
oivchallenge_evaluator.add_single_detected_image_info(
image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels
})
image_key = 'img3'
detected_boxes = np.array([[0, 0, 1, 1]], dtype=float)
detected_class_labels = np.array([2], dtype=int)
detected_scores = np.array([0.5], dtype=float)
oivchallenge_evaluator.add_single_detected_image_info(
image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels
})
metrics = oivchallenge_evaluator.evaluate()
expected_metric_name = 'OpenImagesDetectionChallenge'
self.assertAlmostEqual(
metrics[
expected_metric_name + '_PerformanceByCategory/[email protected]/dog'],
0.3333333333)
self.assertAlmostEqual(
metrics[
expected_metric_name + '_PerformanceByCategory/[email protected]/elephant'],
0.333333333333)
self.assertAlmostEqual(
metrics[
expected_metric_name + '_PerformanceByCategory/[email protected]/cat'],
0.142857142857)
self.assertAlmostEqual(
metrics[expected_metric_name + '_Precision/[email protected]'],
0.269841269)
oivchallenge_evaluator.clear()
self.assertFalse(oivchallenge_evaluator._image_ids)
def test_returns_correct_instance_segm_metric_values(self):
categories = [{'id': 1, 'name': 'cat'}, {'id': 2, 'name': 'dog'}]
oivchallenge_evaluator = (
object_detection_evaluation.OpenImagesChallengeEvaluator(
categories, evaluate_masks=True))
image_key = 'img1'
groundtruth_boxes = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels = np.array([1, 2, 1], dtype=int)
groundtruth_is_group_of_list = np.array([False, False, True], dtype=bool)
groundtruth_verified_labels = np.array([1, 2, 3], dtype=int)
groundtruth_mask_0 = np.array([[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
dtype=np.uint8)
zero_mask = np.array([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
dtype=np.uint8)
groundtruth_masks = np.stack([groundtruth_mask_0, zero_mask, zero_mask],
axis=0)
oivchallenge_evaluator.add_single_ground_truth_image_info(
image_key, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels,
standard_fields.InputDataFields.groundtruth_group_of:
groundtruth_is_group_of_list,
standard_fields.InputDataFields.groundtruth_image_classes:
groundtruth_verified_labels,
standard_fields.InputDataFields.groundtruth_instance_masks:
groundtruth_masks
})
image_key = 'img3'
groundtruth_boxes = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels = np.array([2], dtype=int)
groundtruth_mask_0 = np.array([[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
dtype=np.uint8)
groundtruth_masks = np.stack([groundtruth_mask_0], axis=0)
oivchallenge_evaluator.add_single_ground_truth_image_info(
image_key, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels,
standard_fields.InputDataFields.groundtruth_instance_masks:
groundtruth_masks
})
image_key = 'img1'
detected_boxes = np.array([[0, 0, 2, 2], [2, 2, 3, 3]], dtype=float)
detection_mask_0 = np.array([[1, 1, 0, 0], [1, 1, 0, 0], [0, 0, 0, 0]],
dtype=np.uint8)
detected_masks = np.stack([detection_mask_0, zero_mask], axis=0)
detected_class_labels = np.array([2, 1], dtype=int)
detected_scores = np.array([0.7, 0.8], dtype=float)
oivchallenge_evaluator.add_single_detected_image_info(
image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels,
standard_fields.DetectionResultFields.detection_masks:
detected_masks
})
image_key = 'img3'
detected_boxes = np.array([[0, 0, 1, 1]], dtype=float)
detected_class_labels = np.array([2], dtype=int)
detected_scores = np.array([0.5], dtype=float)
detected_mask_0 = np.array([[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
dtype=np.uint8)
detected_masks = np.stack([detected_mask_0], axis=0)
oivchallenge_evaluator.add_single_detected_image_info(
image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels,
standard_fields.DetectionResultFields.detection_masks:
detected_masks
})
metrics = oivchallenge_evaluator.evaluate()
expected_metric_name = 'OpenImagesInstanceSegmentationChallenge'
self.assertAlmostEqual(
metrics[expected_metric_name + '_PerformanceByCategory/[email protected]/dog'],
1.0)
self.assertAlmostEqual(
metrics[
expected_metric_name + '_PerformanceByCategory/[email protected]/cat'],
0)
self.assertAlmostEqual(
metrics[expected_metric_name + '_Precision/[email protected]'], 0.5)
oivchallenge_evaluator.clear()
self.assertFalse(oivchallenge_evaluator._image_ids)
class PascalEvaluationTest(tf.test.TestCase):
def test_returns_correct_metric_values_on_boxes(self):
categories = [{'id': 1, 'name': 'cat'},
{'id': 2, 'name': 'dog'},
{'id': 3, 'name': 'elephant'}]
# Add groundtruth
pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
categories)
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
pascal_evaluator.add_single_ground_truth_image_info(
image_key1,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1,
standard_fields.InputDataFields.groundtruth_difficult:
np.array([], dtype=bool)})
image_key2 = 'img2'
groundtruth_boxes2 = np.array([[10, 10, 11, 11], [500, 500, 510, 510],
[10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([1, 1, 3], dtype=int)
groundtruth_is_difficult_list2 = np.array([False, True, False], dtype=bool)
pascal_evaluator.add_single_ground_truth_image_info(
image_key2,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes2,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels2,
standard_fields.InputDataFields.groundtruth_difficult:
groundtruth_is_difficult_list2})
image_key3 = 'img3'
groundtruth_boxes3 = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels3 = np.array([2], dtype=int)
pascal_evaluator.add_single_ground_truth_image_info(
image_key3,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes3,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels3})
# Add detections
image_key = 'img2'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120], [100, 100, 220, 220]],
dtype=float)
detected_class_labels = np.array([1, 1, 3], dtype=int)
detected_scores = np.array([0.7, 0.8, 0.9], dtype=float)
pascal_evaluator.add_single_detected_image_info(
image_key,
{standard_fields.DetectionResultFields.detection_boxes: detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels})
metrics = pascal_evaluator.evaluate()
self.assertAlmostEqual(
metrics['PascalBoxes_PerformanceByCategory/[email protected]/dog'], 0.0)
self.assertAlmostEqual(
metrics['PascalBoxes_PerformanceByCategory/[email protected]/elephant'], 0.0)
self.assertAlmostEqual(
metrics['PascalBoxes_PerformanceByCategory/[email protected]/cat'], 0.16666666)
self.assertAlmostEqual(metrics['PascalBoxes_Precision/[email protected]'],
0.05555555)
pascal_evaluator.clear()
self.assertFalse(pascal_evaluator._image_ids)
def test_returns_correct_metric_values_on_masks(self):
categories = [{'id': 1, 'name': 'cat'},
{'id': 2, 'name': 'dog'},
{'id': 3, 'name': 'elephant'}]
# Add groundtruth
pascal_evaluator = (
object_detection_evaluation.PascalInstanceSegmentationEvaluator(
categories))
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
groundtruth_masks_1_0 = np.array([[1, 0, 0, 0],
[1, 0, 0, 0],
[1, 0, 0, 0]], dtype=np.uint8)
groundtruth_masks_1_1 = np.array([[0, 0, 1, 0],
[0, 0, 1, 0],
[0, 0, 1, 0]], dtype=np.uint8)
groundtruth_masks_1_2 = np.array([[0, 1, 0, 0],
[0, 1, 0, 0],
[0, 1, 0, 0]], dtype=np.uint8)
groundtruth_masks1 = np.stack(
[groundtruth_masks_1_0, groundtruth_masks_1_1, groundtruth_masks_1_2],
axis=0)
pascal_evaluator.add_single_ground_truth_image_info(
image_key1, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_instance_masks:
groundtruth_masks1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1,
standard_fields.InputDataFields.groundtruth_difficult:
np.array([], dtype=bool)
})
image_key2 = 'img2'
groundtruth_boxes2 = np.array([[10, 10, 11, 11], [500, 500, 510, 510],
[10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([1, 1, 3], dtype=int)
groundtruth_is_difficult_list2 = np.array([False, True, False], dtype=bool)
groundtruth_masks_2_0 = np.array([[1, 1, 1, 1],
[0, 0, 0, 0],
[0, 0, 0, 0]], dtype=np.uint8)
groundtruth_masks_2_1 = np.array([[0, 0, 0, 0],
[1, 1, 1, 1],
[0, 0, 0, 0]], dtype=np.uint8)
groundtruth_masks_2_2 = np.array([[0, 0, 0, 0],
[0, 0, 0, 0],
[1, 1, 1, 1]], dtype=np.uint8)
groundtruth_masks2 = np.stack(
[groundtruth_masks_2_0, groundtruth_masks_2_1, groundtruth_masks_2_2],
axis=0)
pascal_evaluator.add_single_ground_truth_image_info(
image_key2, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes2,
standard_fields.InputDataFields.groundtruth_instance_masks:
groundtruth_masks2,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels2,
standard_fields.InputDataFields.groundtruth_difficult:
groundtruth_is_difficult_list2
})
image_key3 = 'img3'
groundtruth_boxes3 = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels3 = np.array([2], dtype=int)
groundtruth_masks_3_0 = np.array([[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1]], dtype=np.uint8)
groundtruth_masks3 = np.stack([groundtruth_masks_3_0], axis=0)
pascal_evaluator.add_single_ground_truth_image_info(
image_key3, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes3,
standard_fields.InputDataFields.groundtruth_instance_masks:
groundtruth_masks3,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels3
})
# Add detections
image_key = 'img2'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120], [100, 100, 220, 220]],
dtype=float)
detected_class_labels = np.array([1, 1, 3], dtype=int)
detected_scores = np.array([0.7, 0.8, 0.9], dtype=float)
detected_masks_0 = np.array([[1, 1, 1, 1],
[0, 0, 1, 0],
[0, 0, 0, 0]], dtype=np.uint8)
detected_masks_1 = np.array([[1, 0, 0, 0],
[1, 1, 0, 0],
[0, 0, 0, 0]], dtype=np.uint8)
detected_masks_2 = np.array([[0, 1, 0, 0],
[0, 1, 1, 0],
[0, 1, 0, 0]], dtype=np.uint8)
detected_masks = np.stack(
[detected_masks_0, detected_masks_1, detected_masks_2], axis=0)
pascal_evaluator.add_single_detected_image_info(
image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_masks:
detected_masks,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels
})
metrics = pascal_evaluator.evaluate()
self.assertAlmostEqual(
metrics['PascalMasks_PerformanceByCategory/[email protected]/dog'], 0.0)
self.assertAlmostEqual(
metrics['PascalMasks_PerformanceByCategory/[email protected]/elephant'], 0.0)
self.assertAlmostEqual(
metrics['PascalMasks_PerformanceByCategory/[email protected]/cat'], 0.16666666)
self.assertAlmostEqual(metrics['PascalMasks_Precision/[email protected]'],
0.05555555)
pascal_evaluator.clear()
self.assertFalse(pascal_evaluator._image_ids)
def test_value_error_on_duplicate_images(self):
categories = [{'id': 1, 'name': 'cat'},
{'id': 2, 'name': 'dog'},
{'id': 3, 'name': 'elephant'}]
# Add groundtruth
pascal_evaluator = object_detection_evaluation.PascalDetectionEvaluator(
categories)
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
pascal_evaluator.add_single_ground_truth_image_info(
image_key1,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1})
with self.assertRaises(ValueError):
pascal_evaluator.add_single_ground_truth_image_info(
image_key1,
{standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1})
class WeightedPascalEvaluationTest(tf.test.TestCase):
def setUp(self):
self.categories = [{'id': 1, 'name': 'cat'},
{'id': 2, 'name': 'dog'},
{'id': 3, 'name': 'elephant'}]
def create_and_add_common_ground_truth(self):
# Add groundtruth
self.wp_eval = (
object_detection_evaluation.WeightedPascalDetectionEvaluator(
self.categories))
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key1,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1})
# add 'img2' separately
image_key3 = 'img3'
groundtruth_boxes3 = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels3 = np.array([2], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key3,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes3,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels3})
def add_common_detected(self):
image_key = 'img2'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120], [100, 100, 220, 220]],
dtype=float)
detected_class_labels = np.array([1, 1, 3], dtype=int)
detected_scores = np.array([0.7, 0.8, 0.9], dtype=float)
self.wp_eval.add_single_detected_image_info(
image_key,
{standard_fields.DetectionResultFields.detection_boxes: detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels})
def test_returns_correct_metric_values(self):
self.create_and_add_common_ground_truth()
image_key2 = 'img2'
groundtruth_boxes2 = np.array([[10, 10, 11, 11], [500, 500, 510, 510],
[10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([1, 1, 3], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key2,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes2,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels2
})
self.add_common_detected()
metrics = self.wp_eval.evaluate()
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/dog'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/elephant'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/cat'], 0.5 / 4)
self.assertAlmostEqual(metrics[self.wp_eval._metric_prefix +
'Precision/[email protected]'],
1. / (4 + 1 + 2) / 3)
self.wp_eval.clear()
self.assertFalse(self.wp_eval._image_ids)
def test_returns_correct_metric_values_with_difficult_list(self):
self.create_and_add_common_ground_truth()
image_key2 = 'img2'
groundtruth_boxes2 = np.array([[10, 10, 11, 11], [500, 500, 510, 510],
[10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([1, 1, 3], dtype=int)
groundtruth_is_difficult_list2 = np.array([False, True, False], dtype=bool)
self.wp_eval.add_single_ground_truth_image_info(
image_key2,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes2,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels2,
standard_fields.InputDataFields.groundtruth_difficult:
groundtruth_is_difficult_list2
})
self.add_common_detected()
metrics = self.wp_eval.evaluate()
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/dog'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/elephant'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/cat'], 0.5 / 3)
self.assertAlmostEqual(metrics[self.wp_eval._metric_prefix +
'Precision/[email protected]'],
1. / (3 + 1 + 2) / 3)
self.wp_eval.clear()
self.assertFalse(self.wp_eval._image_ids)
def test_value_error_on_duplicate_images(self):
# Add groundtruth
self.wp_eval = (
object_detection_evaluation.WeightedPascalDetectionEvaluator(
self.categories))
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key1,
{standard_fields.InputDataFields.groundtruth_boxes: groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1})
with self.assertRaises(ValueError):
self.wp_eval.add_single_ground_truth_image_info(
image_key1,
{standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1})
class PrecisionAtRecallEvaluationTest(tf.test.TestCase):
def setUp(self):
self.categories = [{
'id': 1,
'name': 'cat'
}, {
'id': 2,
'name': 'dog'
}, {
'id': 3,
'name': 'elephant'
}]
def create_and_add_common_ground_truth(self):
# Add groundtruth
self.wp_eval = (
object_detection_evaluation.PrecisionAtRecallDetectionEvaluator(
self.categories, recall_lower_bound=0.0, recall_upper_bound=0.5))
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key1, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1
})
# add 'img2' separately
image_key3 = 'img3'
groundtruth_boxes3 = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels3 = np.array([2], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key3, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes3,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels3
})
def add_common_detected(self):
image_key = 'img2'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120], [100, 100, 220, 220]],
dtype=float)
detected_class_labels = np.array([1, 1, 3], dtype=int)
detected_scores = np.array([0.7, 0.8, 0.9], dtype=float)
self.wp_eval.add_single_detected_image_info(
image_key, {
standard_fields.DetectionResultFields.detection_boxes:
detected_boxes,
standard_fields.DetectionResultFields.detection_scores:
detected_scores,
standard_fields.DetectionResultFields.detection_classes:
detected_class_labels
})
def test_returns_correct_metric_values(self):
self.create_and_add_common_ground_truth()
image_key2 = 'img2'
groundtruth_boxes2 = np.array(
[[10, 10, 11, 11], [500, 500, 510, 510], [10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([1, 1, 3], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key2, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes2,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels2
})
self.add_common_detected()
metrics = self.wp_eval.evaluate()
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/dog'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/elephant'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/cat'], 0.5 / 4)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'Precision/[email protected]@[0.0,0.5]Recall'], 1. / (3 + 1 + 2) / 4)
self.wp_eval.clear()
self.assertFalse(self.wp_eval._image_ids)
def test_returns_correct_metric_values_with_difficult_list(self):
self.create_and_add_common_ground_truth()
image_key2 = 'img2'
groundtruth_boxes2 = np.array(
[[10, 10, 11, 11], [500, 500, 510, 510], [10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([1, 1, 3], dtype=int)
groundtruth_is_difficult_list2 = np.array([False, True, False], dtype=bool)
self.wp_eval.add_single_ground_truth_image_info(
image_key2, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes2,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels2,
standard_fields.InputDataFields.groundtruth_difficult:
groundtruth_is_difficult_list2
})
self.add_common_detected()
metrics = self.wp_eval.evaluate()
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/dog'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/elephant'], 0.0)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'PerformanceByCategory/[email protected]/cat'], 0.5 / 3)
self.assertAlmostEqual(
metrics[self.wp_eval._metric_prefix +
'Precision/[email protected]@[0.0,0.5]Recall'], 1. / (3 + 1 + 2) / 3)
self.wp_eval.clear()
self.assertFalse(self.wp_eval._image_ids)
def test_value_error_on_duplicate_images(self):
# Add groundtruth
self.wp_eval = (
object_detection_evaluation.PrecisionAtRecallDetectionEvaluator(
self.categories, recall_lower_bound=0.0, recall_upper_bound=0.5))
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([1, 3, 1], dtype=int)
self.wp_eval.add_single_ground_truth_image_info(
image_key1, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1
})
with self.assertRaises(ValueError):
self.wp_eval.add_single_ground_truth_image_info(
image_key1, {
standard_fields.InputDataFields.groundtruth_boxes:
groundtruth_boxes1,
standard_fields.InputDataFields.groundtruth_classes:
groundtruth_class_labels1
})
class ObjectDetectionEvaluationTest(tf.test.TestCase):
def setUp(self):
num_groundtruth_classes = 3
self.od_eval = object_detection_evaluation.ObjectDetectionEvaluation(
num_groundtruth_classes)
image_key1 = 'img1'
groundtruth_boxes1 = np.array([[0, 0, 1, 1], [0, 0, 2, 2], [0, 0, 3, 3]],
dtype=float)
groundtruth_class_labels1 = np.array([0, 2, 0], dtype=int)
self.od_eval.add_single_ground_truth_image_info(
image_key1, groundtruth_boxes1, groundtruth_class_labels1)
image_key2 = 'img2'
groundtruth_boxes2 = np.array([[10, 10, 11, 11], [500, 500, 510, 510],
[10, 10, 12, 12]], dtype=float)
groundtruth_class_labels2 = np.array([0, 0, 2], dtype=int)
groundtruth_is_difficult_list2 = np.array([False, True, False], dtype=bool)
groundtruth_is_group_of_list2 = np.array([False, False, True], dtype=bool)
self.od_eval.add_single_ground_truth_image_info(
image_key2, groundtruth_boxes2, groundtruth_class_labels2,
groundtruth_is_difficult_list2, groundtruth_is_group_of_list2)
image_key3 = 'img3'
groundtruth_boxes3 = np.array([[0, 0, 1, 1]], dtype=float)
groundtruth_class_labels3 = np.array([1], dtype=int)
self.od_eval.add_single_ground_truth_image_info(
image_key3, groundtruth_boxes3, groundtruth_class_labels3)
image_key = 'img2'
detected_boxes = np.array(
[[10, 10, 11, 11], [100, 100, 120, 120], [100, 100, 220, 220]],
dtype=float)
detected_class_labels = np.array([0, 0, 2], dtype=int)
detected_scores = np.array([0.7, 0.8, 0.9], dtype=float)
self.od_eval.add_single_detected_image_info(
image_key, detected_boxes, detected_scores, detected_class_labels)
def test_value_error_on_zero_classes(self):
with self.assertRaises(ValueError):
object_detection_evaluation.ObjectDetectionEvaluation(
num_groundtruth_classes=0)
def test_add_single_ground_truth_image_info(self):
expected_num_gt_instances_per_class = np.array([3, 1, 1], dtype=int)
expected_num_gt_imgs_per_class = np.array([2, 1, 2], dtype=int)
self.assertTrue(np.array_equal(expected_num_gt_instances_per_class,
self.od_eval.num_gt_instances_per_class))
self.assertTrue(np.array_equal(expected_num_gt_imgs_per_class,
self.od_eval.num_gt_imgs_per_class))
groundtruth_boxes2 = np.array([[10, 10, 11, 11], [500, 500, 510, 510],
[10, 10, 12, 12]], dtype=float)
self.assertTrue(np.allclose(self.od_eval.groundtruth_boxes['img2'],
groundtruth_boxes2))
groundtruth_is_difficult_list2 = np.array([False, True, False], dtype=bool)
self.assertTrue(np.allclose(
self.od_eval.groundtruth_is_difficult_list['img2'],
groundtruth_is_difficult_list2))
groundtruth_is_group_of_list2 = np.array([False, False, True], dtype=bool)
self.assertTrue(
np.allclose(self.od_eval.groundtruth_is_group_of_list['img2'],
groundtruth_is_group_of_list2))
groundtruth_class_labels1 = np.array([0, 2, 0], dtype=int)
self.assertTrue(np.array_equal(self.od_eval.groundtruth_class_labels[
'img1'], groundtruth_class_labels1))
def test_add_single_detected_image_info(self):
expected_scores_per_class = [[np.array([0.8, 0.7], dtype=float)], [],
[np.array([0.9], dtype=float)]]
expected_tp_fp_labels_per_class = [[np.array([0, 1], dtype=bool)], [],
[np.array([0], dtype=bool)]]
expected_num_images_correctly_detected_per_class = np.array([0, 0, 0],
dtype=int)
for i in range(self.od_eval.num_class):
for j in range(len(expected_scores_per_class[i])):
self.assertTrue(np.allclose(expected_scores_per_class[i][j],
self.od_eval.scores_per_class[i][j]))
self.assertTrue(np.array_equal(expected_tp_fp_labels_per_class[i][
j], self.od_eval.tp_fp_labels_per_class[i][j]))
self.assertTrue(np.array_equal(
expected_num_images_correctly_detected_per_class,
self.od_eval.num_images_correctly_detected_per_class))
def test_evaluate(self):
(average_precision_per_class, mean_ap, precisions_per_class,
recalls_per_class, corloc_per_class,
mean_corloc) = self.od_eval.evaluate()
expected_precisions_per_class = [np.array([0, 0.5], dtype=float),
np.array([], dtype=float),
np.array([0], dtype=float)]
expected_recalls_per_class = [
np.array([0, 1. / 3.], dtype=float), np.array([], dtype=float),
np.array([0], dtype=float)
]
expected_average_precision_per_class = np.array([1. / 6., 0, 0],
dtype=float)
expected_corloc_per_class = np.array([0, 0, 0], dtype=float)
expected_mean_ap = 1. / 18
expected_mean_corloc = 0.0
for i in range(self.od_eval.num_class):
self.assertTrue(np.allclose(expected_precisions_per_class[i],
precisions_per_class[i]))
self.assertTrue(np.allclose(expected_recalls_per_class[i],
recalls_per_class[i]))
self.assertTrue(np.allclose(expected_average_precision_per_class,
average_precision_per_class))
self.assertTrue(np.allclose(expected_corloc_per_class, corloc_per_class))
self.assertAlmostEqual(expected_mean_ap, mean_ap)
self.assertAlmostEqual(expected_mean_corloc, mean_corloc)
def test_merge_internal_state(self):
# Test that if initial state is merged, the results of the evaluation are
# the same.
od_eval_state = self.od_eval.get_internal_state()
copy_od_eval = object_detection_evaluation.ObjectDetectionEvaluation(
self.od_eval.num_class)
copy_od_eval.merge_internal_state(od_eval_state)
(average_precision_per_class, mean_ap, precisions_per_class,
recalls_per_class, corloc_per_class,
mean_corloc) = self.od_eval.evaluate()
(copy_average_precision_per_class, copy_mean_ap, copy_precisions_per_class,
copy_recalls_per_class, copy_corloc_per_class,
copy_mean_corloc) = copy_od_eval.evaluate()
for i in range(self.od_eval.num_class):
self.assertTrue(
np.allclose(copy_precisions_per_class[i], precisions_per_class[i]))
self.assertTrue(
np.allclose(copy_recalls_per_class[i], recalls_per_class[i]))
self.assertTrue(
np.allclose(copy_average_precision_per_class,
average_precision_per_class))
self.assertTrue(np.allclose(copy_corloc_per_class, corloc_per_class))
self.assertAlmostEqual(copy_mean_ap, mean_ap)
self.assertAlmostEqual(copy_mean_corloc, mean_corloc)
@unittest.skipIf(tf_version.is_tf2(), 'Eval Metrics ops are supported in TF1.X '
'only.')
class ObjectDetectionEvaluatorTest(tf.test.TestCase, parameterized.TestCase):
def setUp(self):
self.categories = [{
'id': 1,
'name': 'person'
}, {
'id': 2,
'name': 'dog'
}, {
'id': 3,
'name': 'cat'
}]
self.od_eval = object_detection_evaluation.ObjectDetectionEvaluator(
categories=self.categories)
def _make_evaluation_dict(self,
resized_groundtruth_masks=False,
batch_size=1,
max_gt_boxes=None,
scale_to_absolute=False):
input_data_fields = standard_fields.InputDataFields
detection_fields = standard_fields.DetectionResultFields
image = tf.zeros(shape=[batch_size, 20, 20, 3], dtype=tf.uint8)
if batch_size == 1:
key = tf.constant('image1')
else:
key = tf.constant([str(i) for i in range(batch_size)])
detection_boxes = tf.concat([
tf.tile(
tf.constant([[[0., 0., 1., 1.]]]), multiples=[batch_size - 1, 1, 1
]),
tf.constant([[[0., 0., 0.5, 0.5]]])
],
axis=0)
detection_scores = tf.concat([
tf.tile(tf.constant([[0.5]]), multiples=[batch_size - 1, 1]),
tf.constant([[0.8]])
],
axis=0)
detection_classes = tf.tile(tf.constant([[0]]), multiples=[batch_size, 1])
detection_masks = tf.tile(
tf.ones(shape=[1, 2, 20, 20], dtype=tf.float32),
multiples=[batch_size, 1, 1, 1])
groundtruth_boxes = tf.constant([[0., 0., 1., 1.]])
groundtruth_classes = tf.constant([1])
groundtruth_instance_masks = tf.ones(shape=[1, 20, 20], dtype=tf.uint8)
num_detections = tf.ones([batch_size])
if resized_groundtruth_masks:
groundtruth_instance_masks = tf.ones(shape=[1, 10, 10], dtype=tf.uint8)
if batch_size > 1:
groundtruth_boxes = tf.tile(
tf.expand_dims(groundtruth_boxes, 0), multiples=[batch_size, 1, 1])
groundtruth_classes = tf.tile(
tf.expand_dims(groundtruth_classes, 0), multiples=[batch_size, 1])
groundtruth_instance_masks = tf.tile(
tf.expand_dims(groundtruth_instance_masks, 0),
multiples=[batch_size, 1, 1, 1])
detections = {
detection_fields.detection_boxes: detection_boxes,
detection_fields.detection_scores: detection_scores,
detection_fields.detection_classes: detection_classes,
detection_fields.detection_masks: detection_masks,
detection_fields.num_detections: num_detections
}
groundtruth = {
input_data_fields.groundtruth_boxes:
groundtruth_boxes,
input_data_fields.groundtruth_classes:
groundtruth_classes,
input_data_fields.groundtruth_instance_masks:
groundtruth_instance_masks,
}
if batch_size > 1:
return eval_util.result_dict_for_batched_example(
image,
key,
detections,
groundtruth,
scale_to_absolute=scale_to_absolute,
max_gt_boxes=max_gt_boxes)
else:
return eval_util.result_dict_for_single_example(
image,
key,
detections,
groundtruth,
scale_to_absolute=scale_to_absolute)
@parameterized.parameters({
'batch_size': 1,
'expected_map': 0,
'max_gt_boxes': None,
'scale_to_absolute': True
}, {
'batch_size': 8,
'expected_map': 0.765625,
'max_gt_boxes': [1],
'scale_to_absolute': True
}, {
'batch_size': 1,
'expected_map': 0,
'max_gt_boxes': None,
'scale_to_absolute': False
}, {
'batch_size': 8,
'expected_map': 0.765625,
'max_gt_boxes': [1],
'scale_to_absolute': False
})
def test_get_estimator_eval_metric_ops(self,
batch_size=1,
expected_map=1,
max_gt_boxes=None,
scale_to_absolute=False):
eval_dict = self._make_evaluation_dict(
batch_size=batch_size,
max_gt_boxes=max_gt_boxes,
scale_to_absolute=scale_to_absolute)
tf.logging.info('eval_dict: {}'.format(eval_dict))
metric_ops = self.od_eval.get_estimator_eval_metric_ops(eval_dict)
_, update_op = metric_ops['Precision/[email protected]']
with self.test_session() as sess:
metrics = {}
for key, (value_op, _) in six.iteritems(metric_ops):
metrics[key] = value_op
sess.run(update_op)
metrics = sess.run(metrics)
self.assertAlmostEqual(expected_map, metrics['Precision/[email protected]'])
if __name__ == '__main__':
tf.test.main()
| apache-2.0 | -2,066,689,750,020,593,200 | 42.092377 | 80 | 0.60221 | false |
getpatchwork/patchwork | patchwork/migrations/0043_merge_patch_submission.py | 1 | 11421 | from django.conf import settings
from django.db import connection, migrations, models
import django.db.models.deletion
import patchwork.fields
def migrate_data(apps, schema_editor):
if connection.vendor == 'postgresql':
schema_editor.execute(
"""
UPDATE patchwork_submission
SET archived = patchwork_patch.archived2,
commit_ref = patchwork_patch.commit_ref2,
delegate_id = patchwork_patch.delegate2_id,
diff = patchwork_patch.diff2,
hash = patchwork_patch.hash2,
number = patchwork_patch.number2,
pull_url = patchwork_patch.pull_url2,
related_id = patchwork_patch.related2_id,
series_id = patchwork_patch.series2_id,
state_id = patchwork_patch.state2_id
FROM patchwork_patch
WHERE patchwork_submission.id = patchwork_patch.submission_ptr_id
"""
)
elif connection.vendor == 'mysql':
schema_editor.execute(
"""
UPDATE patchwork_submission, patchwork_patch
SET patchwork_submission.archived = patchwork_patch.archived2,
patchwork_submission.commit_ref = patchwork_patch.commit_ref2,
patchwork_submission.delegate_id = patchwork_patch.delegate2_id,
patchwork_submission.diff = patchwork_patch.diff2,
patchwork_submission.hash = patchwork_patch.hash2,
patchwork_submission.number = patchwork_patch.number2,
patchwork_submission.pull_url = patchwork_patch.pull_url2,
patchwork_submission.related_id = patchwork_patch.related2_id,
patchwork_submission.series_id = patchwork_patch.series2_id,
patchwork_submission.state_id = patchwork_patch.state2_id
WHERE patchwork_submission.id = patchwork_patch.submission_ptr_id
""" # noqa
)
else:
schema_editor.execute(
"""
UPDATE patchwork_submission
SET (
archived, commit_ref, delegate_id, diff, hash, number,
pull_url, related_id, series_id, state_id
) = (
SELECT
patchwork_patch.archived2,
patchwork_patch.commit_ref2,
patchwork_patch.delegate2_id,
patchwork_patch.diff2,
patchwork_patch.hash2,
patchwork_patch.number2,
patchwork_patch.pull_url2,
patchwork_patch.related2_id,
patchwork_patch.series2_id,
patchwork_patch.state2_id
FROM patchwork_patch
WHERE patchwork_patch.submission_ptr_id = patchwork_submission.id
)
WHERE
EXISTS (
SELECT *
FROM patchwork_patch
WHERE patchwork_patch.submission_ptr_id = patchwork_submission.id
)
""" # noqa
)
class Migration(migrations.Migration):
atomic = False
dependencies = [
('patchwork', '0042_add_cover_model'),
]
operations = [
# move the 'PatchTag' model to point to 'Submission'
migrations.RemoveField(model_name='patch', name='tags',),
migrations.AddField(
model_name='submission',
name='tags',
field=models.ManyToManyField(
through='patchwork.PatchTag', to='patchwork.Tag'
),
),
migrations.AlterField(
model_name='patchtag',
name='patch',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to='patchwork.Submission',
),
),
# do the same for any other field that references 'Patch'
migrations.AlterField(
model_name='bundle',
name='patches',
field=models.ManyToManyField(
through='patchwork.BundlePatch', to='patchwork.Submission'
),
),
migrations.AlterField(
model_name='bundlepatch',
name='patch',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to='patchwork.Submission',
),
),
migrations.AlterField(
model_name='check',
name='patch',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to='patchwork.Submission',
),
),
migrations.AlterField(
model_name='event',
name='patch',
field=models.ForeignKey(
blank=True,
help_text='The patch that this event was created for.',
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='+',
to='patchwork.Submission',
),
),
migrations.AlterField(
model_name='patchchangenotification',
name='patch',
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
primary_key=True,
serialize=False,
to='patchwork.Submission',
),
),
# rename all the fields on 'Patch' so we don't have duplicates when we
# add them to 'Submission'
migrations.RemoveIndex(
model_name='patch', name='patch_list_covering_idx',
),
migrations.AlterUniqueTogether(name='patch', unique_together=set([]),),
migrations.RenameField(
model_name='patch', old_name='archived', new_name='archived2',
),
migrations.RenameField(
model_name='patch', old_name='commit_ref', new_name='commit_ref2',
),
migrations.RenameField(
model_name='patch', old_name='delegate', new_name='delegate2',
),
migrations.RenameField(
model_name='patch', old_name='diff', new_name='diff2',
),
migrations.RenameField(
model_name='patch', old_name='hash', new_name='hash2',
),
migrations.RenameField(
model_name='patch', old_name='number', new_name='number2',
),
migrations.RenameField(
model_name='patch', old_name='pull_url', new_name='pull_url2',
),
migrations.RenameField(
model_name='patch', old_name='related', new_name='related2',
),
migrations.RenameField(
model_name='patch', old_name='series', new_name='series2',
),
migrations.RenameField(
model_name='patch', old_name='state', new_name='state2',
),
# add the fields found on 'Patch' to 'Submission'
migrations.AddField(
model_name='submission',
name='archived',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='submission',
name='commit_ref',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='submission',
name='delegate',
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
migrations.AddField(
model_name='submission',
name='diff',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='submission',
name='hash',
field=patchwork.fields.HashField(
blank=True, max_length=40, null=True
),
),
migrations.AddField(
model_name='submission',
name='number',
field=models.PositiveSmallIntegerField(
default=None,
help_text='The number assigned to this patch in the series',
null=True,
),
),
migrations.AddField(
model_name='submission',
name='pull_url',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='submission',
name='related',
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name='patches',
related_query_name='patch',
to='patchwork.PatchRelation',
),
),
migrations.AddField(
model_name='submission',
name='series',
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='patches',
related_query_name='patch',
to='patchwork.Series',
),
),
migrations.AddField(
model_name='submission',
name='state',
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
to='patchwork.State',
),
),
# copy the data from 'Patch' to 'Submission'
migrations.RunPython(migrate_data, None, atomic=False),
# configure metadata for the 'Submission' model
migrations.AlterModelOptions(
name='submission',
options={
'base_manager_name': 'objects',
'ordering': ['date'],
'verbose_name_plural': 'Patches',
},
),
migrations.AlterUniqueTogether(
name='submission',
unique_together=set([('series', 'number'), ('msgid', 'project')]),
),
migrations.RemoveIndex(
model_name='submission', name='submission_covering_idx',
),
migrations.AddIndex(
model_name='submission',
index=models.Index(
fields=[
'archived',
'state',
'delegate',
'date',
'project',
'submitter',
'name',
],
name='patch_covering_idx',
),
),
# remove the foreign key fields from the 'Patch' model
migrations.RemoveField(model_name='patch', name='delegate2',),
migrations.RemoveField(model_name='patch', name='patch_project',),
migrations.RemoveField(model_name='patch', name='related2',),
migrations.RemoveField(model_name='patch', name='series2',),
migrations.RemoveField(model_name='patch', name='state2',),
migrations.RemoveField(model_name='patch', name='submission_ptr',),
# drop the 'Patch' model and rename 'Submission' to 'Patch'
migrations.DeleteModel(name='Patch',),
migrations.RenameModel(old_name='Submission', new_name='Patch',),
]
| gpl-2.0 | -758,566,755,988,265,600 | 34.468944 | 82 | 0.523159 | false |
iandees/all-the-places | locations/spiders/elpolloloco.py | 1 | 2496 | import scrapy
import re
from locations.items import GeojsonPointItem
class ElPolloLocoSpider(scrapy.Spider):
name = "elpolloloco"
allowed_domains = ["www.elpolloloco.com"]
start_urls = (
'https://www.elpolloloco.com/locations/all-locations.html',
)
def parse_stores(self, response):
properties = {
'addr_full': response.xpath('normalize-space(//meta[@itemprop="streetAddress"]/@content)').extract_first(),
'phone': response.xpath('normalize-space(//div[@itemprop="telephone"]/text())').extract_first(),
'city': response.xpath('normalize-space(//meta[@itemprop="addressLocality"]/@content)').extract_first(),
'state': response.xpath('normalize-space(//meta[@itemprop="addressRegion"]/@content)').extract_first(),
'postcode':response.xpath('normalize-space(//meta[@itemprop="postalCode"]/@content)').extract_first(),
'ref': response.xpath('normalize-space(//div[@itemprop="branchCode"]/text())').extract_first(),
'website': response.url,
'lat': response.xpath('normalize-space(//meta[@itemprop="latitude"]/@content)').extract_first(),
'lon': response.xpath('normalize-space(//meta[@itemprop="longitude"]/@content)').extract_first(),
'opening_hours': self.parse_opening_hours(response.xpath('//div[@itemprop="openingHoursSpecification"]')),
}
yield GeojsonPointItem(**properties)
def parse_opening_hours(self, opening_hours_div):
result_array = []
for div in opening_hours_div:
day_of_week_list = div.xpath('normalize-space(./meta[@itemprop="dayOfWeek"]/@href)').extract_first().rsplit("/",1)
open_time = div.xpath('normalize-space(./meta[@itemprop="opens"]/@content)').extract_first().rsplit(":",1)[0]
close_time = div.xpath('normalize-space(./meta[@itemprop="closes"]/@content)').extract_first().rsplit(":",1)[0]
if (len(day_of_week_list) == 2):
day_of_week = day_of_week_list[-1][:2]
result_array.append("%s %s-%s" % (day_of_week, open_time, close_time))
return ';'.join(result_array)
def parse(self, response):
urls = response.xpath('//p[@class="locaFLstoreInfo" and ./a/span[@class ="locaSSComingSoon" and not(contains(./text(),"(Coming Soon)"))]]/a/@href').extract()
for path in urls:
yield scrapy.Request(response.urljoin(path), callback=self.parse_stores)
| mit | -1,993,626,636,176,950,500 | 55.727273 | 165 | 0.623798 | false |
daeilkim/refinery | refinery/refinery/data/models.py | 1 | 10950 | # models.py contains code for defining the user object and behavior which will be used throughout the site
from refinery import db, app
import datetime
from refinery.webapp.pubsub import msgServer
from collections import defaultdict
import random,os,re,codecs
from collections import defaultdict
import pickle
# Defines a User class that takes the database and returns a User object that contains id,nickname,email
class User(db.Model):
id = db.Column(db.Integer, primary_key = True)
username = db.Column(db.String(64), index = True, unique = True)
password = db.Column(db.String(64), index = True)
email = db.Column(db.String(120), index = True, unique = True)
image = db.Column(db.String(100))
#datasets = db.relationship('Dataset', backref = 'author', lazy = 'dynamic')
def __init__(self, username, password, email):
self.username = username
self.password = password
self.email = email
self.image = None
def is_authenticated(self):
return True
def is_active(self):
return True
def is_anonymous(self):
return False
def get_id(self):
return unicode(self.id)
def __repr__(self):
return '<User %r>' % (self.username)
def check_password(self, proposed_password):
if self.password != proposed_password:
return False
else:
return True
class Experiment(db.Model):
id = db.Column(db.Integer, primary_key = True)
extype = db.Column(db.String(100)) # name of the model i.e topic_model
status = db.Column(db.Text) # status (idle,start,inprogress,finish)
def __init__(self, owner_id, extype):
self.owner_id = owner_id
self.extype = extype
self.status = 'idle'
def getExInfo(self):
if(self.extype == "topicmodel"):
return TopicModelEx.query.filter_by(ex_id=self.id).first()
elif(self.extype == "summarize"):
return SummarizeEx.query.filter_by(ex_id=self.id).first()
else:
return None
class TopicModelEx(db.Model):
id = db.Column(db.Integer, primary_key = True)
ex_id = db.Column(db.Integer, db.ForeignKey('experiment.id'))
viz_data = db.Column(db.PickleType) #the top words and topic proportions
nTopics = db.Column(db.Integer)
stopwords = db.Column(db.PickleType)
def __init__(self, ex_id, nTopics):
self.ex_id = ex_id
self.viz_data = None
self.nTopics = nTopics
self.stopwords = []
class SummarizeEx(db.Model):
id = db.Column(db.Integer, primary_key = True)
ex_id = db.Column(db.Integer, db.ForeignKey('experiment.id'))
current_summary = db.Column(db.PickleType) # a list of sentences in the current summary
top_candidates = db.Column(db.PickleType) # a list of top ranked candidate sentences
sents = db.Column(db.PickleType)
running = db.Column(db.Integer)
def __init__(self, ex_id):
self.ex_id = ex_id
self.current_summary = []
self.top_candidates = []
self.running = 0
class DataDoc(db.Model):
id = db.Column(db.Integer, primary_key = True)
data_id = db.Column(db.Integer, db.ForeignKey('dataset.id'))
doc_id = db.Column(db.Integer, db.ForeignKey('document.id'))
def __init__(self, dset, doc):
self.data_id = dset
self.doc_id = doc
class Document(db.Model):
id = db.Column(db.Integer, primary_key = True)
name = db.Column(db.String(256)) #the name of this file
path = db.Column(db.String(256)) #the path to the raw file data
def __init__(self, name, path):
self.name = name
self.path = path
self.sents = []
def getStaticURL(self):
print "!!!!!!!","/" + os.path.relpath(self.path,"refinery")
return "/" + os.path.relpath(self.path,"refinery")
def getText(self):
lines = [line for line in codecs.open(self.path,"r","utf-8")]
return "\n".join(lines)
def tokenize_sentence(text):
''' Returns list of words found in String. Matches A-Za-z and \'s '''
wordPattern = "[A-Za-z]+[']*[A-Za-z]*"
wordlist = re.findall( wordPattern, text)
return wordlist
class Folder(db.Model):
id = db.Column(db.Integer, primary_key = True)
dataset_id = db.Column(db.Integer, db.ForeignKey('dataset.id')) # the dataset that was used
docIDs = db.Column(db.PickleType) #hopefully, this can be a dictionary of included docIDs
name = db.Column(db.String)
tm_id = db.Column(db.Integer, db.ForeignKey('experiment.id'))
sum_id = db.Column(db.Integer, db.ForeignKey('experiment.id'))
vocabSize = db.Column(db.Integer)
dirty = db.Column(db.String(20))
def __init__(self, dataset_id, name, docIDs):
self.dataset_id = dataset_id
self.docIDs = docIDs
self.name = name
self.tm_id = None
self.sum_id = None
self.dirty = "dirty"
def numSents(self):
s = Experiment.query.get(self.sum_id).getExInfo()
if s.sents:
return sum([len(s.sents[ss]) for ss in s.sents])
return 0
def numTopics(self):
tm = Experiment.query.get(self.tm_id)
return tm.getExInfo().nTopics
def topicModelEx(self):
return Experiment.query.get(self.tm_id)
def sumModelEx(self):
return Experiment.query.get(self.sum_id)
def initialize(self):
ex1 = Experiment(self.id, "topicmodel")
db.session.add(ex1)
db.session.commit()
tm = TopicModelEx(ex1.id,10)
db.session.add(tm)
db.session.commit()
self.tm_id = ex1.id
ex2 = Experiment(self.id, "summarize")
db.session.add(ex2)
db.session.commit()
ei = SummarizeEx(ex2.id)
db.session.add(ei)
db.session.commit()
self.sum_id = ex2.id
db.session.commit()
def documents(self): # a generator for documents
dataset = Dataset.query.get(self.dataset_id)
for d in dataset.documents:
if d.id in self.docIDs:
yield d
def N(self):
dataset = Dataset.query.get(self.dataset_id)
tot = len(list(self.documents()))
return tot
def all_docs(self):
return sorted([Document.query.get(x.doc_id) for x in self.documents()],key=lambda x: x.id)
def preprocTM(self, username, min_doc, max_doc_percent):
#we need to add options, like to get rid of xml tags!
STOPWORDFILEPATH = 'refinery/static/assets/misc/stopwords.txt'
stopwords = set([x.strip() for x in open(STOPWORDFILEPATH)])
allD = self.all_docs()
nDocs = len(allD)
WC = defaultdict(int)
DWC = defaultdict( lambda: defaultdict(int) )
def addWord(f,w):
WC[w] += 1
DWC[f][w] += 1
c = 0.0
prev = 0
for d in allD:
filE = d.path
c += 1.0
pc = int(c / float(nDocs) * 100)
if pc > prev:
prev = pc
s = 'pprog,Step 1,' + str(self.id) + "," + str(pc)
msgServer.publish(username + 'Xmenus', "%s" % s)
[[addWord(filE,word) for word in tokenize_sentence(line) if word.lower() not in stopwords] for line in open(filE)]
# now remove words with bad appearace stats
to_remove = []
c = 0.0
oldpc = -1
for w in WC:
c += 1.0
pc = int(c/float(len(WC)) * 100)
if not oldpc == pc:
s = 'pprog,Step 2,' + str(self.id) + "," + str(pc)
#print s
msgServer.publish(username + 'Xmenus', "%s" % s)
oldpc = pc
has_w = [d for d,m in DWC.items() if w in m]
n_has_w = len(has_w)
doc_percent = float(n_has_w)/float(nDocs)
#print w,doc_percent,n_has_w
if n_has_w < min_doc or doc_percent > max_doc_percent:
[DWC[d].pop(w,None) for d in has_w]
to_remove.append(w)
[WC.pop(w,None) for w in to_remove]
vocab = [w for w in WC]
print "N VOCAB",len(vocab)
v_enum = defaultdict(int)
for w in vocab:
v_enum[w] = len(v_enum)
d_enum = defaultdict(int)
for f in allD:
d_enum[f.path] = len(d_enum)
outfile = open(self.wordcount_path(),'w')
for d in allD:
f = d.path
m = DWC[f]
fID = d_enum[f]
for w, c in m.items():
wID = v_enum[w]
outfile.write(str(fID) + ',' + str(wID) + ',' + str(c) + '\n')
outfile.close()
self.vocabSize = len(vocab)
outfile = open(self.vocab_path(),'w')
[outfile.write(x + "\n") for x in vocab]
outfile.close()
self.dirty = "clean"
db.session.commit()
def preproc_path(self):
dataset = Dataset.query.get(self.dataset_id)
return "refinery/static/users/" + User.query.get(dataset.owner_id).username + "/processed/"
def wordcount_path(self):
return self.preproc_path() + str(self.id) + "_word_count.txt"
def vocab_path(self):
return self.preproc_path() + str(self.id) + "_vocab.txt"
def unigram(self):
wcfile = self.wordcount_path()
lines = [x.strip().split(",") for x in open(wcfile,'r')]
unigram_dist = [0.0 for _ in xrange(self.vocabSize)]
for l in lines:
wID = int(l[1])
wC = int(l[2])
unigram_dist[wID] += wC
tot = sum(unigram_dist)
return [x / tot for x in unigram_dist]
#return unigram_dist
def get_vocab_list(self):
vocabfile = self.vocab_path()
return [x.strip() for x in open(vocabfile,'r')]
class Dataset(db.Model):
id = db.Column(db.Integer, primary_key = True)
owner_id = db.Column(db.Integer, db.ForeignKey('user.id'))
name = db.Column(db.String(100)) # name of the dataset
summary = db.Column(db.Text) # summary of the dataset (optional)
img = db.Column(db.String(100)) # path to dataset img
owner = db.relationship('User', backref = 'datasets')
folders = db.relationship('Folder', backref = 'dataset', lazy = 'dynamic')
documents = db.relationship('DataDoc', backref = 'docdataset', lazy = 'dynamic')
def get_folders(self):
return self.folders.order_by(Folder.id)
def __init__(self, owner, name, summary, img=None):
self.owner_id = owner
self.name = name
self.summary = summary
if img is None:
random_img = random.choice(os.listdir(app.config['RANDOM_IMG_DIRECTORY']))
self.img = os.path.join("assets/images/random", random_img)
else:
self.img = img
| mit | -3,804,350,228,446,922,000 | 30.285714 | 127 | 0.572603 | false |
cloudartisan/jarvis | streams.py | 1 | 3192 | #!/usr/bin/env python
import time
import StringIO
from threading import Thread
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
import cv2
import numpy
from PIL import Image
class DummyStream:
def __init__(self):
self.stopped = False
self._frame = None
@property
def frame(self):
return self._frame
@frame.setter
def frame(self, frame):
self._frame = frame
def read(self):
return self.frame
def start(self):
return self
def stop(self):
self.stopped = True
class WebcamVideoStream:
def __init__(self, device=0, should_mirror=False):
self.should_mirror = should_mirror
self.stopped = False
self.grabbed = False
self._frame = None
self._stream = cv2.VideoCapture(device)
def read(self):
if self.should_mirror and self._frame is not None:
return numpy.fliplr(self._frame).copy()
else:
return self._frame
def start(self):
t = Thread(target=self.update, args=())
t.daemon = True
t.start()
return self
def update(self):
while not self.stopped:
self.grabbed, self._frame = self._stream.read()
def stop(self):
self.stopped = True
class WebRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path.endswith('.mjpg'):
self.send_response(200)
self.send_header('Content-type','multipart/x-mixed-replace; boundary=--jpgboundary')
self.end_headers()
while not self.server.stopped:
frame = self.server.camera_feed.read()
if frame is None:
continue
image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
image = Image.fromarray(image)
s = StringIO.StringIO()
image.save(s, 'JPEG')
self.wfile.write('--jpgboundary')
self.send_header('Content-type', 'image/jpeg')
self.send_header('Content-length', str(s.len))
self.end_headers()
image.save(self.wfile, 'JPEG')
else:
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write('<html><head></head><body>')
self.wfile.write('<img src="/stream.mjpg"/>')
self.wfile.write('</body></html>')
class ThreadedWebStream(Thread):
def __init__(self, camera_feed, ip='127.0.0.1', port=8000):
class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): pass
super(ThreadedWebStream, self).__init__()
self.ip = ip
self.port = port
self.server = ThreadedHTTPServer((ip, port), WebRequestHandler)
self.server.camera_feed = camera_feed
self.server.stopped = True
def run(self):
self.server.stopped = False
self.server.serve_forever()
def stop(self):
self.server.stopped = True
self.server.shutdown()
def __str__(self):
return "{}:{}".format(self.ip, self.port)
| apache-2.0 | -5,632,914,860,883,558,000 | 27.247788 | 96 | 0.579887 | false |
pmillerchip/firejail | contrib/fjclip.py | 1 | 1239 | #!/usr/bin/env python
import re
import sys
import subprocess
import fjdisplay
usage = """fjclip.py src dest. src or dest can be named firejails or - for stdin or stdout.
firemon --x11 to see available running x11 firejails. firejail names can be shortened
to least ambiguous. for example 'work-libreoffice' can be shortened to 'work' if no
other firejails name starts with 'work'.
warning: browsers are dangerous. clipboards from browsers are dangerous. see
https://github.com/dxa4481/Pastejacking
fjclip.py strips whitespace from both
ends, but does nothing else to protect you. use a simple gui text editor like
gedit if you want to see what your pasting."""
if len(sys.argv) != 3 or sys.argv == '-h' or sys.argv == '--help':
print(usage)
exit(1)
if sys.argv[1] == '-':
clipin_raw = sys.stdin.read()
else:
display = fjdisplay.getdisplay(sys.argv[1])
clipin_raw = subprocess.check_output(['xsel', '-b', '--display', display])
clipin = clipin_raw.strip()
if sys.argv[2] == '-':
print(clipin)
else:
display = fjdisplay.getdisplay(sys.argv[2])
clipout = subprocess.Popen(['xsel', '-b', '-i', '--display', display],
stdin=subprocess.PIPE)
clipout.communicate(clipin)
| gpl-2.0 | 1,670,571,682,513,023,000 | 33.416667 | 91 | 0.688458 | false |
tiggerntatie/ggame-tutorials | tutorial3.py | 1 | 1622 | """
tutorial3.py
by E. Dennison
"""
from ggame import App, RectangleAsset, ImageAsset, SoundAsset
from ggame import LineStyle, Color, Sprite, Sound
myapp = App()
# define colors and line style
green = Color(0x00ff00, 1)
black = Color(0, 1)
noline = LineStyle(0, black)
# a rectangle asset and sprite to use as background
bg_asset = RectangleAsset(myapp.width, myapp.height, noline, green)
bg = Sprite(bg_asset, (0,0))
# A ball! This is already in the ggame-tutorials repository
ball_asset = ImageAsset("images/orb-150545_640.png")
ball = Sprite(ball_asset, (0, 0))
# Original image is too big. Scale it to 1/10 its original size
ball.scale = 0.1
# custom attributes
ball.direction = 1
ball.go = True
# Sounds
pew1_asset = SoundAsset("sounds/pew1.mp3")
pew1 = Sound(pew1_asset)
pop_asset = SoundAsset("sounds/reappear.mp3")
pop = Sound(pop_asset)
# reverse - change the ball direction
def reverse(b):
pop.play()
b.direction *= -1
# Set up function for handling screen refresh
def step():
if ball.go:
ball.x += ball.direction
if ball.x + ball.width > myapp.width or ball.x < 0:
ball.x -= ball.direction
reverse(ball)
# Handle the space key
def spaceKey(event):
ball.go = not ball.go
# Handle the "reverse" key
def reverseKey(event):
reverse(ball)
# Handle the mouse click
def mouseClick(event):
pew1.play()
ball.x = event.x
ball.y = event.y
# Set up event handlers for the app
myapp.listenKeyEvent('keydown', 'space', spaceKey)
myapp.listenKeyEvent('keydown', 'r', reverseKey)
myapp.listenMouseEvent('click', mouseClick)
myapp.run(step) | mit | 71,991,645,884,679,840 | 25.177419 | 67 | 0.695438 | false |
kalikaneko/bitmask-dev | src/leap/bitmask/bonafide/_srp.py | 1 | 4517 | # -*- coding: utf-8 -*-
# _srp.py
# Copyright (C) 2015 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
SRP Authentication.
"""
import binascii
import json
import srp
class SRPAuthMechanism(object):
"""
Implement a protocol-agnostic SRP Authentication mechanism.
"""
def __init__(self, username, password):
self.username = username
self.srp_user = srp.User(username, password,
srp.SHA256, srp.NG_1024)
_, A = self.srp_user.start_authentication()
self.A = A
self.M = None
self.M2 = None
def get_handshake_params(self):
return {'login': bytes(self.username),
'A': binascii.hexlify(self.A)}
def process_handshake(self, handshake_response):
challenge = json.loads(handshake_response)
self._check_for_errors(challenge)
salt = challenge.get('salt', None)
B = challenge.get('B', None)
unhex_salt, unhex_B = self._unhex_salt_B(salt, B)
self.M = self.srp_user.process_challenge(unhex_salt, unhex_B)
def get_authentication_params(self):
# It looks A is not used server side
return {'client_auth': binascii.hexlify(self.M),
'A': binascii.hexlify(self.A)}
def process_authentication(self, authentication_response):
auth = json.loads(authentication_response)
self._check_for_errors(auth)
uuid = auth.get('id', None)
token = auth.get('token', None)
self.M2 = auth.get('M2', None)
self._check_auth_params(uuid, token, self.M2)
return uuid, token
def verify_authentication(self):
unhex_M2 = _safe_unhexlify(self.M2)
self.srp_user.verify_session(unhex_M2)
assert self.srp_user.authenticated()
def _check_for_errors(self, response):
if 'errors' in response:
msg = response['errors']['base']
raise SRPAuthError(unicode(msg).encode('utf-8'))
def _unhex_salt_B(self, salt, B):
if salt is None:
raise SRPAuthNoSalt()
if B is None:
raise SRPAuthNoB()
try:
unhex_salt = _safe_unhexlify(salt)
unhex_B = _safe_unhexlify(B)
except (TypeError, ValueError) as e:
raise SRPAuthBadDataFromServer(str(e))
return unhex_salt, unhex_B
def _check_auth_params(self, uuid, token, M2):
if not all((uuid, token, M2)):
msg = '%s' % str((M2, uuid, token))
raise SRPAuthBadDataFromServer(msg)
class SRPSignupMechanism(object):
"""
Implement a protocol-agnostic SRP Registration mechanism.
"""
def get_signup_params(self, username, password):
salt, verifier = srp.create_salted_verification_key(
bytes(username), bytes(password),
srp.SHA256, srp.NG_1024)
user_data = {
'user[login]': username,
'user[password_salt]': binascii.hexlify(salt),
'user[password_verifier]': binascii.hexlify(verifier)}
return user_data
def process_signup(self, signup_response):
signup = json.loads(signup_response)
errors = signup.get('errors')
if errors:
msg = 'username ' + errors.get('login')[0]
raise SRPRegistrationError(msg)
else:
username = signup.get('login')
return username
def _safe_unhexlify(val):
return binascii.unhexlify(val) \
if (len(val) % 2 == 0) else binascii.unhexlify('0' + val)
class SRPAuthError(Exception):
"""
Base exception for srp authentication errors
"""
class SRPAuthNoSalt(SRPAuthError):
message = 'The server didn\'t send the salt parameter'
class SRPAuthNoB(SRPAuthError):
message = 'The server didn\'t send the B parameter'
class SRPAuthBadDataFromServer(SRPAuthError):
pass
class SRPRegistrationError(Exception):
pass
| gpl-3.0 | -6,066,140,394,348,291,000 | 29.52027 | 71 | 0.625858 | false |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_nat_gateways_operations.py | 1 | 26826 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
from ... import models as _models
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class NatGatewaysOperations:
"""NatGatewaysOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2020_04_01.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
async def _delete_initial(
self,
resource_group_name: str,
nat_gateway_name: str,
**kwargs
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01"
accept = "application/json"
# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore
async def begin_delete(
self,
resource_group_name: str,
nat_gateway_name: str,
**kwargs
) -> AsyncLROPoller[None]:
"""Deletes the specified nat gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param nat_gateway_name: The name of the nat gateway.
:type nat_gateway_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._delete_initial(
resource_group_name=resource_group_name,
nat_gateway_name=nat_gateway_name,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore
async def get(
self,
resource_group_name: str,
nat_gateway_name: str,
expand: Optional[str] = None,
**kwargs
) -> "_models.NatGateway":
"""Gets the specified nat gateway in a specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param nat_gateway_name: The name of the nat gateway.
:type nat_gateway_name: str
:param expand: Expands referenced resources.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: NatGateway, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2020_04_01.models.NatGateway
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('NatGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore
async def _create_or_update_initial(
self,
resource_group_name: str,
nat_gateway_name: str,
parameters: "_models.NatGateway",
**kwargs
) -> "_models.NatGateway":
cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self._create_or_update_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'NatGateway')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201, 202]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('NatGateway', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('NatGateway', pipeline_response)
if response.status_code == 202:
deserialized = self._deserialize('NatGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore
async def begin_create_or_update(
self,
resource_group_name: str,
nat_gateway_name: str,
parameters: "_models.NatGateway",
**kwargs
) -> AsyncLROPoller["_models.NatGateway"]:
"""Creates or updates a nat gateway.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param nat_gateway_name: The name of the nat gateway.
:type nat_gateway_name: str
:param parameters: Parameters supplied to the create or update nat gateway operation.
:type parameters: ~azure.mgmt.network.v2020_04_01.models.NatGateway
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either NatGateway or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2020_04_01.models.NatGateway]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = await self._create_or_update_initial(
resource_group_name=resource_group_name,
nat_gateway_name=nat_gateway_name,
parameters=parameters,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('NatGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = AsyncNoPolling()
else: polling_method = polling
if cont_token:
return AsyncLROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore
async def update_tags(
self,
resource_group_name: str,
nat_gateway_name: str,
parameters: "_models.TagsObject",
**kwargs
) -> "_models.NatGateway":
"""Updates nat gateway tags.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param nat_gateway_name: The name of the nat gateway.
:type nat_gateway_name: str
:param parameters: Parameters supplied to update nat gateway tags.
:type parameters: ~azure.mgmt.network.v2020_04_01.models.TagsObject
:keyword callable cls: A custom type or function that will be passed the direct response
:return: NatGateway, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2020_04_01.models.NatGateway
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGateway"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.update_tags.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'natGatewayName': self._serialize.url("nat_gateway_name", nat_gateway_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'TagsObject')
body_content_kwargs['content'] = body_content
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('NatGateway', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} # type: ignore
def list_all(
self,
**kwargs
) -> AsyncIterable["_models.NatGatewayListResult"]:
"""Gets all the Nat Gateways in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NatGatewayListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NatGatewayListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_all.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('NatGatewayListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways'} # type: ignore
def list(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["_models.NatGatewayListResult"]:
"""Gets all nat gateways in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either NatGatewayListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2020_04_01.models.NatGatewayListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.NatGatewayListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-04-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
async def extract_data(pipeline_response):
deserialized = self._deserialize('NatGatewayListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways'} # type: ignore
| mit | 4,977,310,186,275,821,000 | 47.952555 | 191 | 0.640163 | false |
PanDAWMS/autopyfactory | autopyfactory/plugins/queue/batchsubmit/CondorSSH.py | 1 | 6343 | #!/bin/env python
#
# AutoPyfactory batch plugin for Condor
#
#
# At init
# - confirm bosco local exists
# - get paths for auth tokens
#At submit
# -check if cluster is added to bosco
# -if not,
# get lock
# cp files
# add cluster
# test bosco
# - do submit
# 1) create ~/.ssh/bosco_key.rsa ~/.ssh/bosco_key.rsa.pub
# 2) create ~/.bosco/.pass (passphrase for ssh key)
# bosco_cluster -a griddev03.racf.bnl.gov (adds as PBS)
# 3) change ~/.bosco/clusterlist <host> entry=griddev03.racf.bnl.gov max_queued=-1 cluster_type=pbs -> slurm
# 4) bosco_cluster --test griddev03.racf.bnl.gov
#
# Two-hop SSH command:
# ssh -A -t ssh01.sdcc.bnl.gov ssh -A -t icsubmit01.sdcc.bnl.gov
#
# Host midway-login1.rcc.uchicago.edu
# User lincolnb
# IdentityFile ~/.ssh/id_midway
#
import os
import shutil
from autopyfactory import jsd
from autopyfactory import bosco
from CondorBase import CondorBase
class CondorSSH(CondorBase):
id = 'condorssh'
"""
This class is expected to have separate instances for each PandaQueue object.
"""
def __init__(self, apfqueue, config, section):
qcl = config
newqcl = qcl.clone().filterkeys('batchsubmit.condorssh', 'batchsubmit.condorbase')
super(CondorSSH, self).__init__(apfqueue, newqcl, section)
# check local bosco install, will throw exeption if not present
try:
self.batch = qcl.generic_get(self.apfqname, 'batchsubmit.condorssh.batch')
self.host = qcl.generic_get(self.apfqname, 'batchsubmit.condorssh.host')
self.port = qcl.generic_get(self.apfqname,'batchsubmit.condorssh.port' )
self.user = qcl.generic_get(self.apfqname,'batchsubmit.condorssh.user' )
self.authprofile = qcl.generic_get(self.apfqname,'batchsubmit.condorssh.authprofile' )
self.log.debug("SSH target attributes gathered from config. ")
# Get auth info
self.pubkeyfile = None
self.privkeyfile = None
self.passfile = None
self._getSSHAuthTokens()
# Back up user's SSH items
self._backupSSHDefaults()
# Unconditionally create ~/.ssh/config
self._createSSHConfig()
#Handle bosco
self.boscocli = bosco.BoscoCLI()
self.boscocli._checkbosco()
self.boscocli._checktarget(self.user,
self.host,
self.port,
self.batch,
self.pubkeyfile,
self.privkeyfile,
self.passfile)
self.log.info('CondorSSH: Object initialized.')
except Exception as e:
self.log.error("Caught exception: %s " % str(e))
raise
def _backupSSHDefaults(self):
'''
If they exist, copies to make a backup of:
~/.ssh/id_rsa.pub
~/.ssh/id_rsa
~/.ssh/config
'''
SSHDEFAULTS = ['~/.ssh/id_rsa.pub',
'~/.ssh/id_rsa',
'~/.ssh/config'
]
for sshdefault in SSHDEFAULTS:
dp = os.path.expanduser(sshdefault)
if os.path.exists(dp):
if not os.path.exists("%s.apfbackup" % dp):
self.log.debug("Backing up SSH file %s" % dp)
try:
shutil.copy(dp,"%s.apfbackup" % dp )
except Exception:
self.log.warning("Unable to back up %s" % dp)
def _createSSHConfig(self):
'''
'''
SSHCONFIG='''Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
'''
self.log.debug("Creating standard ssh config for APF submission.")
f = os.path.expanduser('~/.ssh/config')
fh = open(f, 'w')
try:
fh.write(SSHCONFIG)
except Exception:
self.log.error('Problem writing to ~/.ssh/config')
finally:
fh.close()
os.chmod(f, 0o600)
def _getSSHAuthTokens(self):
"""
uses authmanager to find out the paths to SSH auth info
"""
self.log.debug("Retrieving SSH auth token info. Profile: %s" % self.authprofile)
(self.pubkeyfile, self.privkeyfile, self.passfile) = self.factory.authmanager.getSSHKeyPairPaths(self.authprofile)
self.log.debug("Got paths: pubkey %s privkey %s passfile %s" % (self.pubkeyfile,
self.privkeyfile,
self.passfile))
def _addJSD(self):
"""
add things to the JSD object
executable = probescript.sh
arguments = -s 15
Transfer_Executable = true
universe = grid
grid_resource = batch slurm griddev03.racf.bnl.gov --rgahp-key /home/me/privkey --rgahp-pass /home/me/mypassphrase
#??? can host take port???
output = output/$(Cluster).$(Process).out
error= output/$(Cluster).$(Process).error
log = output/$(Cluster).$(Process).log
queue
grid_resource = batch pbs [email protected] --rgahp-key /home/me/privkey --rgahp-pass /home/me/mypassphrase
"""
self.log.debug('CondorBosco.addJSD: Starting.')
self.JSD.add("universe", "grid")
self.JSD.add('grid_resource', 'batch %s %s@%s --rgahp-key %s ' % (self.batch,
self.user,
self.host,
#self.port,
self.privkeyfile,
#self.passfile
) )
self.JSD.add('+TransferOutput', '""')
super(CondorSSH, self)._addJSD()
self.log.debug('CondorBosco.addJSD: Leaving.')
| apache-2.0 | -4,152,023,180,054,246,400 | 36.311765 | 122 | 0.509853 | false |
MarkusHackspacher/unknown-horizons | horizons/ai/aiplayer/internationaltrademanager.py | 1 | 7150 | # ###################################################
# Copyright (C) 2008-2017 The Unknown Horizons Team
# [email protected]
# This file is part of Unknown Horizons.
#
# Unknown Horizons is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ###################################################
import logging
from collections import defaultdict
from horizons.component.storagecomponent import StorageComponent
from horizons.component.tradepostcomponent import TradePostComponent
from horizons.constants import RES, TRADER
from .mission.internationaltrade import InternationalTrade
class InternationalTradeManager:
"""
An object of this class manages the international trade routes of one AI player.
The current implementation is limited to one active route between each pair of our
settlement and another player's settlement where each route can have at most one
bought and one sold resource. The routes are automatically removed when they have
been used once or when the ship gets destroyed.
"""
log = logging.getLogger("ai.aiplayer.internationaltrade")
def __init__(self, owner):
super().__init__()
self.owner = owner
self.world = owner.world
self.session = owner.session
self.personality = owner.personality_manager.get('InternationalTradeManager')
def _trade_mission_exists(self, settlement, settlement_manager):
"""Return a boolean showing whether there is a trade route between the settlements."""
for mission in self.owner.missions:
if not isinstance(mission, InternationalTrade):
continue
if mission.settlement is settlement and mission.settlement_manager is settlement_manager:
return True
return False
def _add_route(self):
"""Add a new international trade route if possible."""
ship = None
for possible_ship, state in self.owner.ships.items():
if state is self.owner.shipStates.idle:
ship = possible_ship
break
if not ship:
#self.log.info('%s international trade: no available ships', self)
return
# find all possible legal trade route options
options = defaultdict(list) # {(settlement, settlement_manager): (total value, amount, resource id, bool(selling)), ...}
for settlement in self.world.settlements:
if settlement.owner is self.owner:
continue # don't allow routes of this type between the player's own settlements
for settlement_manager in self.owner.settlement_managers:
if self._trade_mission_exists(settlement, settlement_manager):
continue # allow only one international trade route between a pair of settlements
my_inventory = settlement_manager.settlement.get_component(StorageComponent).inventory
resource_manager = settlement_manager.resource_manager
# add the options where we sell to the other player
for resource_id, limit in settlement.get_component(TradePostComponent).buy_list.items():
if resource_id not in resource_manager.resource_requirements:
continue # not a well-known resource: ignore it
if limit <= settlement.get_component(StorageComponent).inventory[resource_id]:
continue # they aren't actually buying the resource
if my_inventory[resource_id] <= resource_manager.resource_requirements[resource_id]:
continue # my settlement is unable to sell the resource
price = int(self.session.db.get_res_value(resource_id) * TRADER.PRICE_MODIFIER_SELL)
tradable_amount = min(my_inventory[resource_id] - resource_manager.resource_requirements[resource_id],
limit - settlement.get_component(StorageComponent).inventory[resource_id], ship.get_component(StorageComponent).inventory.get_limit(), settlement.owner.get_component(StorageComponent).inventory[RES.GOLD] // price)
options[(settlement, settlement_manager)].append((tradable_amount * price, tradable_amount, resource_id, True))
# add the options where we buy from the other player
for resource_id, limit in settlement.get_component(TradePostComponent).sell_list.items():
if resource_id not in resource_manager.resource_requirements:
continue # not a well-known resource: ignore it
if limit >= settlement.get_component(StorageComponent).inventory[resource_id]:
continue # they aren't actually selling the resource
if my_inventory[resource_id] >= resource_manager.resource_requirements[resource_id]:
continue # my settlement doesn't want to buy the resource
price = int(self.session.db.get_res_value(resource_id) * TRADER.PRICE_MODIFIER_BUY)
tradable_amount = min(resource_manager.resource_requirements[resource_id] - my_inventory[resource_id],
settlement.get_component(StorageComponent).inventory[resource_id] - limit, ship.get_component(StorageComponent).inventory.get_limit(), self.owner.get_component(StorageComponent).inventory[RES.GOLD] // price)
options[(settlement, settlement_manager)].append((tradable_amount * price, tradable_amount, resource_id, False))
if not options:
#self.log.info('%s international trade: no interesting options', self)
return
# make up final options where a route is limited to at most one resource bought and one resource sold
final_options = [] # [(value, bought resource id or None, sold resource id or None, settlement, settlement_manager), ...]
for (settlement, settlement_manager), option in sorted(options.items()):
best_buy = None # largest amount of resources
best_sale = None # most expensive sale
for total_price, tradable_amount, resource_id, selling in option:
if selling:
if best_sale is None or best_sale[0] < total_price:
best_sale = (total_price, tradable_amount, resource_id)
else:
if best_buy is None or best_buy[1] < tradable_amount:
best_buy = (total_price, tradable_amount, resource_id)
buy_coefficient = self.personality.buy_coefficient_rich if self.owner.get_component(StorageComponent).inventory[RES.GOLD] > self.personality.little_money else self.personality.buy_coefficient_poor
total_value = (best_sale[0] if best_sale else 0) + (best_buy[1] if best_buy else 0) * buy_coefficient
final_options.append((total_value, best_buy[2] if best_buy else None, best_sale[2] if best_sale else None, settlement, settlement_manager))
bought_resource, sold_resource, settlement, settlement_manager = sorted(final_options, reverse=True, key=lambda x: x[0])[0][1:]
self.owner.start_mission(InternationalTrade(settlement_manager, settlement, ship, bought_resource, sold_resource, self.owner.report_success, self.owner.report_failure))
def tick(self):
self._add_route()
| gpl-2.0 | -3,247,088,160,504,770,000 | 53.580153 | 219 | 0.744336 | false |
fermat618/pida | tests/core/test_languages_extern.py | 1 | 4614 | import os
#from pida.core.doctype import DocType
#from pida.core.testing import test, assert_equal, assert_notequal
from pida.utils.languages import OutlineItem, ValidationError, Definition, \
Suggestion, Documentation
from pida.core.languages import (Validator, Outliner, External, JobServer,
ExternalProxy,
Documentator, Definer, Completer, LanguageService)
from pida.core.document import Document
from .test_services import MockBoss
class TestExternalValidator(Validator):
def run(self):
yield os.getpid()
for i in xrange(50):
yield ValidationError(message="error %s" % i)
class TestExternalOutliner(Outliner):
def run(self):
yield os.getpid()
for i in xrange(50):
yield OutlineItem(name="run %s" % i, line=i)
class TestDocumentator(Documentator):
def run(self, buffer, offset):
yield os.getpid()
yield buffer
yield offset
for i in xrange(50):
yield Documentation(path="run %s" % i, short="short %s" % i,
long=buffer[i:i + 5])
class TestCompleter(Completer):
def run(self, base, buffer, offset):
yield os.getpid()
yield base
yield buffer
yield offset
for i in xrange(30):
yield Suggestion("run %s" % i)
class TestDefiner(Definer):
def run(self, buffer, offset, *k):
yield os.getpid()
yield buffer
yield offset
for i in xrange(30):
yield Definition(line="run %s" % i, offset=i)
class MyExternal(External):
validator = TestExternalValidator
outliner = TestExternalOutliner
documentator = TestDocumentator
completer = TestCompleter
definer = TestDefiner
class MYService(LanguageService):
# only test if it gets overridden
outliner_factory = TestExternalOutliner
validator_factory = TestExternalValidator
external = MyExternal
def __init__(self, boss):
LanguageService.__init__(self, boss)
self.something = False
self.started = False
def pytest_funcarg__svc(request):
boss = MockBoss()
svc = MYService(boss)
svc.create_all()
return svc
def pytest_funcarg__doc(request):
svc = request.getfuncargvalue('svc')
doc = Document(svc.boss, __file__)
mkp = request.getfuncargvalue('monkeypatch')
mkp.setattr(Document, 'project', None)
doc.project = None
return doc
def test_service_override(svc):
assert isinstance(svc.jobserver, JobServer)
assert issubclass(svc.validator_factory, ExternalProxy)
assert issubclass(svc.outliner_factory, ExternalProxy)
def test_outliner(svc, doc):
# test iterators
outliner = svc.outliner_factory(svc, doc)
for i, v in enumerate(outliner.run()):
if i == 0:
assert os.getpid() != v
else:
assert isinstance(v, OutlineItem)
assert "run %s" % (i - 1) == v.name
def test_validator(svc, doc):
validator = svc.validator_factory(svc, doc)
for i, v in enumerate(validator.run()):
if i == 0:
assert os.getpid() != v
else:
assert isinstance(v, ValidationError)
assert "error %s" % (i - 1) == v.message
def test_completer(svc, doc):
completer = svc.completer_factory(svc, doc)
for i, v in enumerate(completer.run('base', 'some text', 3)):
if i == 0:
assert os.getpid() != v
elif i == 1:
assert v == 'base'
elif i == 2:
assert v == 'some text'
elif i == 3:
assert v == 3
else:
assert isinstance(v, Suggestion)
assert "run %s" % (i - 4) == v
def test_documenter(svc, doc):
documentator = svc.documentator_factory(svc, doc)
for i, v in enumerate(documentator.run('base', 'some text')):
if i == 0:
assert v != os.getpid()
elif i == 1:
assert 'base' == v
elif i == 2:
assert 'some text' == v
else:
assert isinstance(v, Documentation)
assert "short %s" % (i - 3) == v.short
assert "run %s" % (i - 3) == v.path
def test_definer(svc, doc):
definer = svc.definer_factory(svc, doc)
for i, v in enumerate(definer.run('some text', 4)):
if i == 0:
assert os.getpid() != v
elif i == 1:
assert 'some text' == v
elif i == 2:
assert v == 4
else:
assert isinstance(v, Definition)
assert i - 3 == v.offset
assert "run %s" % (i - 3) == v.line
| gpl-2.0 | 6,641,927,541,506,754,000 | 26.628743 | 76 | 0.58886 | false |
dokipen/trac | trac/mimeview/patch.py | 1 | 12980 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005 Christopher Lenz <[email protected]>
# Copyright (C) 2006 Christian Boos <[email protected]>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.
#
# Author: Christopher Lenz <[email protected]>
# Ludvig Strigeus
import os.path
from trac.core import *
from trac.mimeview.api import content_to_unicode, IHTMLPreviewRenderer, \
Mimeview
from trac.util.html import escape, Markup
from trac.util.text import expandtabs
from trac.util.translation import _
from trac.web.chrome import Chrome, add_script, add_stylesheet
__all__ = ['PatchRenderer']
class PatchRenderer(Component):
"""HTML renderer for patches in unified diff format.
This uses the same layout as in the wiki diff view or the changeset view.
"""
implements(IHTMLPreviewRenderer)
# IHTMLPreviewRenderer methods
def get_quality_ratio(self, mimetype):
if mimetype == 'text/x-diff':
return 8
return 0
def render(self, context, mimetype, content, filename=None, rev=None):
req = context.req
content = content_to_unicode(self.env, content, mimetype)
changes = self._diff_to_hdf(content.splitlines(),
Mimeview(self.env).tab_width)
if not changes:
raise TracError(_('Invalid unified diff content'))
data = {'diff': {'style': 'inline'}, 'no_id': True,
'changes': changes, 'longcol': 'File', 'shortcol': ''}
add_script(req, 'common/js/diff.js')
add_stylesheet(req, 'common/css/diff.css')
return Chrome(self.env).render_template(req, 'diff_div.html',
data, fragment=True)
# Internal methods
# FIXME: This function should probably share more code with the
# trac.versioncontrol.diff module
def _diff_to_hdf(self, difflines, tabwidth):
"""
Translate a diff file into something suitable for inclusion in HDF.
The result is [(filename, revname_old, revname_new, changes)],
where changes has the same format as the result of
`trac.versioncontrol.diff.hdf_diff`.
If the diff cannot be parsed, this method returns None.
"""
def _markup_intraline_change(fromlines, tolines):
from trac.versioncontrol.diff import _get_change_extent
for i in xrange(len(fromlines)):
fr, to = fromlines[i], tolines[i]
(start, end) = _get_change_extent(fr, to)
if start != 0 or end != 0:
last = end+len(fr)
fromlines[i] = fr[:start] + '\0' + fr[start:last] + \
'\1' + fr[last:]
last = end+len(to)
tolines[i] = to[:start] + '\0' + to[start:last] + \
'\1' + to[last:]
import re
space_re = re.compile(' ( +)|^ ')
def htmlify(match):
div, mod = divmod(len(match.group(0)), 2)
return div * ' ' + mod * ' '
comments = []
changes = []
lines = iter(difflines)
try:
line = lines.next()
while True:
oldpath = oldrev = newpath = newrev = ''
oldinfo = newinfo = []
binary = False
# consume preample, storing free lines in comments
# (also detect the special case of git binary patches)
if not line.startswith('--- '):
if not line.startswith('Index: ') and line != '='*67:
comments.append(line)
if line == "GIT binary patch":
binary = True
line = lines.next()
while line and line != '':
line = lines.next()
comments.append(line)
diffcmd_line = comments[0] # diff --git a/... b/,,,
oldpath, newpath = diffcmd_line.split()[-2:]
index_line = comments[1] # index 8f****78..1e****5c
oldrev, newrev = index_line.split()[-1].split('..')
oldinfo = ['', oldpath, oldrev]
newinfo = ['', newpath, newrev]
else:
line = lines.next()
continue
if not oldinfo and not newinfo:
# Base filename/version from '--- <file> [rev]'
oldinfo = line.split(None, 2)
if len(oldinfo) > 1:
oldpath = oldinfo[1]
if len(oldinfo) > 2:
oldrev = oldinfo[2]
# Changed filename/version from '+++ <file> [rev]'
line = lines.next()
if not line.startswith('+++ '):
self.log.debug('expected +++ after ---, got '+line)
return None
newinfo = line.split(None, 2)
if len(newinfo) > 1:
newpath = newinfo[1]
if len(newinfo) > 2:
newrev = newinfo[2]
shortrev = ('old', 'new')
if oldpath or newpath:
sep = re.compile(r'([/.~\\])')
commonprefix = ''.join(os.path.commonprefix(
[sep.split(newpath), sep.split(oldpath)]))
commonsuffix = ''.join(os.path.commonprefix(
[sep.split(newpath)[::-1],
sep.split(oldpath)[::-1]])[::-1])
if len(commonprefix) > len(commonsuffix):
common = commonprefix
elif commonsuffix:
common = commonsuffix.lstrip('/')
a = oldpath[:-len(commonsuffix)]
b = newpath[:-len(commonsuffix)]
if len(a) < 4 and len(b) < 4:
shortrev = (a, b)
elif oldpath == '/dev/null':
common = _("new file %(new)s",
new=newpath.lstrip('b/'))
shortrev = ('-', '+')
elif newpath == '/dev/null':
common = _("deleted file %(deleted)s",
deleted=oldpath.lstrip('a/'))
shortrev = ('+', '-')
else:
common = '(a) %s vs. (b) %s' % (oldpath, newpath)
shortrev = ('a', 'b')
else:
common = ''
groups = []
groups_title = []
changes.append({'change': 'edit', 'props': [],
'comments': '\n'.join(comments),
'binary': binary,
'diffs': groups,
'diffs_title': groups_title,
'old': {'path': common,
'rev': ' '.join(oldinfo[1:]),
'shortrev': shortrev[0]},
'new': {'path': common,
'rev': ' '.join(newinfo[1:]),
'shortrev': shortrev[1]}})
comments = []
line = lines.next()
while line:
# "@@ -333,10 +329,8 @@" or "@@ -1 +1 @@ [... title ...]"
r = re.match(r'@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@'
'(.*)', line)
if not r:
break
blocks = []
groups.append(blocks)
fromline, fromend, toline, toend = \
[int(x or 1) for x in r.groups()[:4]]
groups_title.append(r.group(5))
last_type = extra = None
fromend += fromline
toend += toline
line = lines.next()
while fromline < fromend or toline < toend or extra:
# First character is the command
command = ' '
if line:
command, line = line[0], line[1:]
# Make a new block?
if (command == ' ') != last_type:
last_type = command == ' '
kind = last_type and 'unmod' or 'mod'
block = {'type': kind,
'base': {'offset': fromline - 1,
'lines': []},
'changed': {'offset': toline - 1,
'lines': []}}
blocks.append(block)
else:
block = blocks[-1]
if command == ' ':
sides = ['base', 'changed']
elif command == '+':
last_side = 'changed'
sides = [last_side]
elif command == '-':
last_side = 'base'
sides = [last_side]
elif command == '\\' and last_side:
meta = block[last_side].setdefault('meta', {})
meta[len(block[last_side]['lines'])] = True
sides = [last_side]
elif command == '@': # ill-formed patch
groups_title[-1] = "%s (%s)" % (
groups_title[-1],
_("this hunk was shorter than expected"))
line = '@'+line
break
else:
self.log.debug('expected +, - or \\, got '+command)
return None
for side in sides:
if side == 'base':
fromline += 1
else:
toline += 1
block[side]['lines'].append(line)
line = lines.next()
extra = line and line[0] == '\\'
except StopIteration:
pass
# Go through all groups/blocks and mark up intraline changes, and
# convert to html
for o in changes:
for group in o['diffs']:
for b in group:
base, changed = b['base'], b['changed']
f, t = base['lines'], changed['lines']
if b['type'] == 'mod':
if len(f) == 0:
b['type'] = 'add'
elif len(t) == 0:
b['type'] = 'rem'
elif len(f) == len(t):
_markup_intraline_change(f, t)
for i in xrange(len(f)):
line = expandtabs(f[i], tabwidth, '\0\1')
line = escape(line, quotes=False)
line = '<del>'.join([space_re.sub(htmlify, seg)
for seg in line.split('\0')])
line = line.replace('\1', '</del>')
f[i] = Markup(line)
if 'meta' in base and i in base['meta']:
f[i] = Markup('<em>%s</em>') % f[i]
for i in xrange(len(t)):
line = expandtabs(t[i], tabwidth, '\0\1')
line = escape(line, quotes=False)
line = '<ins>'.join([space_re.sub(htmlify, seg)
for seg in line.split('\0')])
line = line.replace('\1', '</ins>')
t[i] = Markup(line)
if 'meta' in changed and i in changed['meta']:
t[i] = Markup('<em>%s</em>') % t[i]
return changes
| bsd-3-clause | -9,055,686,318,459,183,000 | 44.069444 | 79 | 0.4047 | false |
PrincetonUniversity/pywsse | wsse/server/django/tests/test_store.py | 1 | 1594 | # wsse/server/django/tests/test_store.py
# coding=utf-8
# pywsse
# Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso
# Date: September 1st, 2016
# Description: Test the Django database store.
from django.test import TransactionTestCase
from wsse.server.default.tests import test_store
from wsse.server.django.wsse import store
from wsse.server.django.wsse.models import WSSEEvent
class TestDjangoNonceStore(TransactionTestCase,
test_store.TestSQLiteNonceStore):
'''
Test the `store.DjangoNonceStore` class.
'''
@classmethod
def setUpClass(cls):
'''
Set up the class for running tests.
'''
cls.store = store.DjangoNonceStore()
def count_nonces(self):
'''
Count the number of nonces in the database.
:return: number of nonces in the database
:rtype: int
'''
return WSSEEvent.objects.count()
def get_nonces(self):
'''
Get all nonces from the database.
:return: nonces in the database
:rtype: list
'''
return list(WSSEEvent.objects.all().values_list('nonce', flat = True))
def add_nonce(self, nonce, ts):
'''
Add a nonce into the database.
:param nonce: nonce to add
:type nonce: str
:param ts: timestamp of the nonce
:type ts: datetime.datetime
'''
WSSEEvent.objects.create(nonce = nonce, timestamp = ts)
def test_add_nonce_bytestring(self):
'''
Adding a nonce as bytes should succeed and be present in the database
(as a string).
'''
self.store.add_nonce(b'abc')
count = self.count_nonces()
nonce = self.get_nonces()[0]
self.assertEqual(count, 1)
self.assertEqual(nonce, 'abc')
| lgpl-3.0 | 1,039,035,677,915,644,000 | 22.761194 | 76 | 0.71294 | false |
jptomo/rpython-lang-scheme | rpython/rtyper/module/test/test_ll_os_path.py | 1 | 1610 | import py
import sys, os
from rpython.rtyper.lltypesystem.module.ll_os_path import Implementation as impl
from rpython.rtyper.test.test_llinterp import interpret
from rpython.tool.udir import udir
def test_exists():
filename = impl.to_rstr(str(py.path.local(__file__)))
assert impl.ll_os_path_exists(filename) == True
assert not impl.ll_os_path_exists(impl.to_rstr(
"strange_filename_that_looks_improbable.sde"))
def test_posixpath():
import posixpath
def f():
assert posixpath.join("/foo", "bar") == "/foo/bar"
assert posixpath.join("/foo", "spam/egg") == "/foo/spam/egg"
assert posixpath.join("/foo", "/bar") == "/bar"
interpret(f, [])
def test_ntpath():
import ntpath
def f():
assert ntpath.join("\\foo", "bar") == "\\foo\\bar"
assert ntpath.join("c:\\foo", "spam\\egg") == "c:\\foo\\spam\\egg"
assert ntpath.join("c:\\foo", "d:\\bar") == "d:\\bar"
interpret(f, [])
def test_isdir():
if sys.platform != 'win32':
py.test.skip("XXX cannot run os.stat() on the llinterp yet")
s = str(udir.join('test_isdir'))
def f():
return os.path.isdir(s)
res = interpret(f, [])
assert res == os.path.isdir(s)
os.mkdir(s)
res = interpret(f, [])
assert res is True
# On Windows, the libc stat() is flawed:
# stat('c:/temp') works
# but stat('c:/temp/') does not find the directory...
# This test passes with our own stat() implementation.
s += os.path.sep
def f():
return os.path.isdir(s)
res = interpret(f, [])
assert res is True
| mit | -1,676,571,330,086,425,600 | 29.377358 | 80 | 0.6 | false |
pycontw/pycontw2016 | src/users/admin.py | 1 | 1812 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import gettext_lazy as _
from .models import User, CocRecord
from .forms import AdminUserChangeForm, UserCreationForm
@admin.register(User)
class UserAdmin(UserAdmin):
fieldsets = (
(
None,
{'fields': ('email', 'password')}
),
(
_('Personal info'),
{
'fields': (
'speaker_name', 'bio', 'photo',
'twitter_id', 'github_id', 'facebook_profile_url',
),
},
),
(
_('Permissions'),
{
'fields': (
'verified', 'is_active', 'is_staff', 'is_superuser',
'groups', 'user_permissions',
),
},
),
(
_('Important dates'),
{'fields': ('last_login', 'date_joined')},
),
)
add_fieldsets = (
(
None, {
'classes': ('wide',),
'fields': (
'email', 'password1', 'password2',
'speaker_name', 'bio', 'verified',
),
},
),
)
form = AdminUserChangeForm
add_form = UserCreationForm
list_display = ('email', 'is_staff', 'as_hash')
list_filter = (
'verified', 'is_active', 'is_staff', 'is_superuser',
'groups',
)
search_fields = ('email',)
ordering = ('email',)
filter_horizontal = ('groups', 'user_permissions',)
@admin.register(CocRecord)
class CocRecordAdmin(admin.ModelAdmin):
list_display = ('user', 'coc_version', 'agreed_at', )
list_filter = ('coc_version', )
raw_id_fields = ('user', )
| mit | 3,297,041,993,475,273,000 | 25.26087 | 72 | 0.46468 | false |
DedMemez/ODS-August-2017 | safezone/GameTutorials.py | 1 | 15275 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.safezone.GameTutorials
from panda3d.core import Vec4
from direct.gui.DirectGui import *
from direct.fsm import FSM
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from direct.interval.IntervalGlobal import *
class ChineseTutorial(DirectFrame, FSM.FSM):
def __init__(self, doneFunction, doneEvent = None, callback = None):
FSM.FSM.__init__(self, 'ChineseTutorial')
self.doneFunction = doneFunction
base.localAvatar.startSleepWatch(self.handleQuit)
self.doneEvent = doneEvent
self.callback = callback
self.setStateArray(['Page1', 'Page2', 'Quit'])
base.localAvatar.startSleepWatch(self.handleQuit)
DirectFrame.__init__(self, pos=(-0.7, 0.0, 0.0), image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.0, 1.5, 1.0), text='', text_scale=0.06)
self.accept('stoppedAsleep', self.handleQuit)
self['image'] = DGG.getDefaultDialogGeom()
self.title = DirectLabel(self, relief=None, text='', text_pos=(0.0, 0.4), text_fg=(1, 0, 0, 1), text_scale=0.13, text_font=ToontownGlobals.getSignFont())
images = loader.loadModel('phase_6/models/golf/checker_tutorial')
images.setTransparency(1)
self.iPage1 = images.find('**/tutorialPage1*')
self.iPage1.reparentTo(aspect2d)
self.iPage1.setPos(0.43, -0.1, 0.0)
self.iPage1.setScale(13.95)
self.iPage1.setTransparency(1)
self.iPage1.hide()
self.iPage1.getChildren()[1].hide()
self.iPage2 = images.find('**/tutorialPage3*')
self.iPage2.reparentTo(aspect2d)
self.iPage2.setPos(0.43, -0.1, 0.5)
self.iPage2.setScale(13.95)
self.iPage2.setTransparency(1)
self.iPage2.hide()
self.iPage3 = images.find('**/tutorialPage2*')
self.iPage3.reparentTo(aspect2d)
self.iPage3.setPos(0.43, -0.1, -0.5)
self.iPage3.setScale(13.95)
self.iPage3.setTransparency(1)
self.iPage3.hide()
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
self.bNext = DirectButton(self, image=(gui.find('**/Horiz_Arrow_UP'),
gui.find('**/Horiz_Arrow_DN'),
gui.find('**/Horiz_Arrow_Rllvr'),
gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), relief=None, text=TTLocalizer.ChineseTutorialNext, text3_fg=Vec4(0, 0, 0, 0.5), text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.35, -0.3, -0.33), command=self.requestNext)
self.bPrev = DirectButton(self, image=(gui.find('**/Horiz_Arrow_UP'),
gui.find('**/Horiz_Arrow_DN'),
gui.find('**/Horiz_Arrow_Rllvr'),
gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), image_scale=(-1.0, 1.0, 1.0), relief=None, text=TTLocalizer.ChineseTutorialPrev, text3_fg=Vec4(0, 0, 0, 0.5), text_scale=0.05, text_pos=(0.0, -0.1), pos=(-0.35, -0.3, -0.33), command=self.requestPrev)
self.bQuit = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.ChineseTutorialDone, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, -0.3, -0.33), command=self.handleQuit)
self.bQuit.hide()
buttons.removeNode()
gui.removeNode()
self.request('Page1')
return
def __del__(self):
self.cleanup()
def enterPage1(self, *args):
self.bNext.show()
self.title['text'] = (TTLocalizer.ChineseTutorialTitle1,)
self['text'] = TTLocalizer.ChinesePage1
self['text_pos'] = (0.0, 0.23)
self['text_wordwrap'] = 13.5
self.bPrev['state'] = DGG.DISABLED
self.bPrev.hide()
self.bNext['state'] = DGG.NORMAL
self.iPage1.show()
self.blinker = Sequence()
obj = self.iPage1.getChildren()[1]
self.iPage1.getChildren()[1].show()
self.blinker.append(LerpColorInterval(obj, 0.5, Vec4(0.5, 0.5, 0, 0.0), Vec4(0.2, 0.2, 0.2, 1)))
self.blinker.append(LerpColorInterval(obj, 0.5, Vec4(0.2, 0.2, 0.2, 1), Vec4(0.5, 0.5, 0, 0.0)))
self.blinker.loop()
def exitPage1(self, *args):
self.bPrev['state'] = DGG.NORMAL
self.iPage1.hide()
self.iPage1.getChildren()[1].hide()
self.blinker.finish()
def enterPage2(self, *args):
self.bPrev.show()
self.title['text'] = (TTLocalizer.ChineseTutorialTitle2,)
self['text'] = TTLocalizer.ChinesePage2
self['text_pos'] = (0.0, 0.28)
self['text_wordwrap'] = 12.5
self.bNext['state'] = DGG.DISABLED
self.bNext.hide()
self.iPage2.show()
self.iPage3.show()
self.bQuit.show()
def exitPage2(self, *args):
self.iPage2.hide()
self.bQuit.hide()
self.iPage3.hide()
def enterQuit(self, *args):
self.iPage1.removeNode()
self.iPage2.removeNode()
self.iPage3.removeNode()
self.bNext.destroy()
self.bPrev.destroy()
self.bQuit.destroy()
DirectFrame.destroy(self)
def exitQuit(self, *args):
pass
def handleQuit(self, task = None):
base.cr.playGame.getPlace().setState('walk')
self.forceTransition('Quit')
self.doneFunction()
if task != None:
task.done
return
class CheckersTutorial(DirectFrame, FSM.FSM):
def __init__(self, doneFunction, doneEvent = None, callback = None):
FSM.FSM.__init__(self, 'CheckersTutorial')
self.doneFunction = doneFunction
base.localAvatar.startSleepWatch(self.handleQuit)
self.doneEvent = doneEvent
self.callback = callback
self.setStateArray(['Page1',
'Page2',
'Page3',
'Quit'])
DirectFrame.__init__(self, pos=(-0.7, 0.0, 0.0), image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.0, 1.5, 1.0), text='', text_scale=0.06)
self.accept('stoppedAsleep', self.handleQuit)
self['image'] = DGG.getDefaultDialogGeom()
self.title = DirectLabel(self, relief=None, text='', text_pos=(0.0, 0.4), text_fg=(1, 0, 0, 1), text_scale=0.13, text_font=ToontownGlobals.getSignFont())
images = loader.loadModel('phase_6/models/golf/regularchecker_tutorial')
images.setTransparency(1)
self.iPage1 = images.find('**/tutorialPage1*')
self.iPage1.reparentTo(aspect2d)
self.iPage1.setPos(0.43, -0.1, 0.0)
self.iPage1.setScale(0.4)
self.iPage1.setTransparency(1)
self.iPage1.hide()
self.iPage2 = images.find('**/tutorialPage2*')
self.iPage2.reparentTo(aspect2d)
self.iPage2.setPos(0.43, -0.1, 0.0)
self.iPage2.setScale(0.4)
self.iPage2.setTransparency(1)
self.iPage2.hide()
self.iPage3 = images.find('**/tutorialPage3*')
self.iPage3.reparentTo(aspect2d)
self.iPage3.setPos(0.6, -0.1, 0.5)
self.iPage3.setScale(0.4)
self.iPage3.setTransparency(1)
self.obj = self.iPage3.find('**/king*')
self.iPage3.hide()
self.iPage4 = images.find('**/tutorialPage4*')
self.iPage4.reparentTo(aspect2d)
self.iPage4.setPos(0.6, -0.1, -0.5)
self.iPage4.setScale(0.4)
self.iPage4.setTransparency(1)
self.iPage4.hide()
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
self.bNext = DirectButton(self, image=(gui.find('**/Horiz_Arrow_UP'),
gui.find('**/Horiz_Arrow_DN'),
gui.find('**/Horiz_Arrow_Rllvr'),
gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), relief=None, text=TTLocalizer.ChineseTutorialNext, text3_fg=Vec4(0, 0, 0, 0.5), text_scale=0.05, text_pos=(0.0, -0.08), pos=(0.35, -0.3, -0.38), command=self.requestNext)
self.bPrev = DirectButton(self, image=(gui.find('**/Horiz_Arrow_UP'),
gui.find('**/Horiz_Arrow_DN'),
gui.find('**/Horiz_Arrow_Rllvr'),
gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), image_scale=(-1.0, 1.0, 1.0), relief=None, text=TTLocalizer.ChineseTutorialPrev, text3_fg=Vec4(0, 0, 0, 0.5), text_scale=0.05, text_pos=(0.0, -0.08), pos=(-0.35, -0.3, -0.38), command=self.requestPrev)
self.bQuit = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.ChineseTutorialDone, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, -0.3, -0.38), command=self.handleQuit)
self.bQuit.hide()
buttons.removeNode()
gui.removeNode()
self.request('Page1')
return
def __del__(self):
self.cleanup()
def enterPage1(self, *args):
self.bNext.show()
self.title['text'] = (TTLocalizer.ChineseTutorialTitle1,)
self['text'] = TTLocalizer.CheckersPage1
self['text_pos'] = (0.0, 0.23)
self['text_wordwrap'] = 13.5
self['text_scale'] = 0.06
self.bPrev['state'] = DGG.DISABLED
self.bPrev.hide()
self.bNext['state'] = DGG.NORMAL
self.iPage1.show()
def exitPage1(self, *args):
self.bPrev['state'] = DGG.NORMAL
self.iPage1.hide()
def enterPage2(self, *args):
self.bPrev.show()
self.bNext.show()
self.title['text'] = (TTLocalizer.ChineseTutorialTitle2,)
self['text'] = TTLocalizer.CheckersPage2
self['text_pos'] = (0.0, 0.28)
self['text_wordwrap'] = 12.5
self['text_scale'] = 0.06
self.bNext['state'] = DGG.NORMAL
self.iPage2.show()
def exitPage2(self, *args):
self.iPage2.hide()
def enterPage3(self, *args):
self.bPrev.show()
self.title['text'] = (TTLocalizer.ChineseTutorialTitle2,)
self['text'] = TTLocalizer.CheckersPage3 + '\n\n' + TTLocalizer.CheckersPage4
self['text_pos'] = (0.0, 0.32)
self['text_wordwrap'] = 19
self['text_scale'] = 0.05
self.bNext['state'] = DGG.DISABLED
self.blinker = Sequence()
self.blinker.append(LerpColorInterval(self.obj, 0.5, Vec4(0.5, 0.5, 0, 0.0), Vec4(0.9, 0.9, 0, 1)))
self.blinker.append(LerpColorInterval(self.obj, 0.5, Vec4(0.9, 0.9, 0, 1), Vec4(0.5, 0.5, 0, 0.0)))
self.blinker.loop()
self.bNext.hide()
self.iPage3.show()
self.iPage4.show()
self.bQuit.show()
def exitPage3(self, *args):
self.blinker.finish()
self.iPage3.hide()
self.bQuit.hide()
self.iPage4.hide()
def enterQuit(self, *args):
self.iPage1.removeNode()
self.iPage2.removeNode()
self.iPage3.removeNode()
self.bNext.destroy()
self.bPrev.destroy()
self.bQuit.destroy()
DirectFrame.destroy(self)
def exitQuit(self, *args):
pass
def handleQuit(self, task = None):
self.forceTransition('Quit')
base.cr.playGame.getPlace().setState('walk')
self.doneFunction()
if task != None:
task.done
return
class FindFourTutorial(DirectFrame, FSM.FSM):
def __init__(self, doneFunction, doneEvent = None, callback = None):
FSM.FSM.__init__(self, 'FindFourTutorial')
self.doneFunction = doneFunction
base.localAvatar.startSleepWatch(self.handleQuit)
self.doneEvent = doneEvent
self.callback = callback
self.setStateArray(['Page1', 'Page2', 'Quit'])
base.localAvatar.startSleepWatch(self.handleQuit)
DirectFrame.__init__(self, pos=(-0.7, 0.0, 0.0), image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.0, 1.5, 1.0), text='', text_scale=0.06)
self.accept('stoppedAsleep', self.handleQuit)
self['image'] = DGG.getDefaultDialogGeom()
self.title = DirectLabel(self, relief=None, text='', text_pos=(0.0, 0.4), text_fg=(1, 0, 0, 1), text_scale=0.13, text_font=ToontownGlobals.getSignFont())
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
self.bNext = DirectButton(self, image=(gui.find('**/Horiz_Arrow_UP'),
gui.find('**/Horiz_Arrow_DN'),
gui.find('**/Horiz_Arrow_Rllvr'),
gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), relief=None, text=TTLocalizer.ChineseTutorialNext, text3_fg=Vec4(0, 0, 0, 0.5), text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.35, -0.3, -0.33), command=self.requestNext)
self.bPrev = DirectButton(self, image=(gui.find('**/Horiz_Arrow_UP'),
gui.find('**/Horiz_Arrow_DN'),
gui.find('**/Horiz_Arrow_Rllvr'),
gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), image_scale=(-1.0, 1.0, 1.0), relief=None, text=TTLocalizer.ChineseTutorialPrev, text3_fg=Vec4(0, 0, 0, 0.5), text_scale=0.05, text_pos=(0.0, -0.1), pos=(-0.35, -0.3, -0.33), command=self.requestPrev)
self.bQuit = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.ChineseTutorialDone, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, -0.3, -0.33), command=self.handleQuit)
self.bQuit.hide()
buttons.removeNode()
gui.removeNode()
self.request('Page1')
return
def __del__(self):
self.cleanup()
def enterPage1(self, *args):
self.bNext.show()
self.title['text'] = (TTLocalizer.ChineseTutorialTitle1,)
self['text'] = TTLocalizer.FindFourPage1
self['text_pos'] = (0.0, 0.23)
self['text_wordwrap'] = 13.5
self.bPrev['state'] = DGG.DISABLED
self.bPrev.hide()
self.bNext['state'] = DGG.NORMAL
def exitPage1(self, *args):
self.bPrev['state'] = DGG.NORMAL
def enterPage2(self, *args):
self.bPrev.show()
self.title['text'] = (TTLocalizer.ChineseTutorialTitle2,)
self['text'] = TTLocalizer.FindFourPage2
self['text_pos'] = (0.0, 0.28)
self['text_wordwrap'] = 12.5
self.bNext['state'] = DGG.DISABLED
self.bNext.hide()
self.bQuit.show()
def exitPage2(self, *args):
self.bQuit.hide()
def enterQuit(self, *args):
self.bNext.destroy()
self.bPrev.destroy()
self.bQuit.destroy()
DirectFrame.destroy(self)
def exitQuit(self, *args):
pass
def handleQuit(self, task = None):
base.cr.playGame.getPlace().setState('walk')
self.forceTransition('Quit')
self.doneFunction()
if task != None:
task.done
return | apache-2.0 | -6,883,993,430,927,133,000 | 43.198225 | 294 | 0.594697 | false |
a1ezzz/wasp-general | wasp_general/cli/curses_commands.py | 1 | 2162 | # -*- coding: utf-8 -*-
# wasp_general/cli/curses_commands.py
#
# Copyright (C) 2016 the wasp-general authors and contributors
# <see AUTHORS file>
#
# This file is part of wasp-general.
#
# Wasp-general is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Wasp-general is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with wasp-general. If not, see <http://www.gnu.org/licenses/>.
# TODO: document the code
# TODO: write tests for the code
# noinspection PyUnresolvedReferences
from wasp_general.version import __author__, __version__, __credits__, __license__, __copyright__, __email__
# noinspection PyUnresolvedReferences
from wasp_general.version import __status__
from wasp_general.verify import verify_type
from wasp_general.command.command import WCommand
from wasp_general.command.result import WPlainCommandResult
from wasp_general.cli.curses import WCursesConsole
class WExitCommand(WCommand):
@verify_type(console=WCursesConsole)
def __init__(self, console):
WCommand.__init__(self)
self.__console = console
def console(self):
return self.__console
@verify_type('paranoid', command_tokens=str)
def match(self, *command_tokens, **command_env):
return command_tokens == ('exit',) or command_tokens == ('quit',)
@verify_type('paranoid', command_tokens=str)
def _exec(self, *command_tokens, **command_env):
self.__console.stop()
return WPlainCommandResult('Exiting...')
class WEmptyCommand(WCommand):
@verify_type('paranoid', command_tokens=str)
def match(self, *command_tokens, **command_env):
return len(command_tokens) == 0
@verify_type('paranoid', command_tokens=str)
def _exec(self, *command_tokens, **command_env):
return WPlainCommandResult('')
| lgpl-3.0 | 1,186,058,328,410,375,000 | 32.78125 | 108 | 0.740981 | false |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.