content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
_base_ = [ '../_base_/models/hv_pointpillars_fpn_nus.py', '../_base_/datasets/nus-3d.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py', ] # Note that the order of class names should be consistent with # the following anchors' order point_cloud_range = [-50, -50, -5, 50, 50, 3] class_names = [ 'bicycle', 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier', 'car', 'truck', 'trailer', 'bus', 'construction_vehicle' ] train_pipeline = [ dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict( type='GlobalRotScaleTrans', rot_range=[-0.3925, 0.3925], scale_ratio_range=[0.95, 1.05], translation_std=[0, 0, 0]), dict( type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5, flip_ratio_bev_vertical=0.5), dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), dict(type='PointShuffle'), dict(type='DefaultFormatBundle3D', class_names=class_names), dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), pts_scale_ratio=1, flip=False, transforms=[ dict( type='GlobalRotScaleTrans', rot_range=[0, 0], scale_ratio_range=[1., 1.], translation_std=[0, 0, 0]), dict(type='RandomFlip3D'), dict( type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict( type='DefaultFormatBundle3D', class_names=class_names, with_label=False), dict(type='Collect3D', keys=['points']) ]) ] data = dict( samples_per_gpu=2, workers_per_gpu=4, train=dict(pipeline=train_pipeline, classes=class_names), val=dict(pipeline=test_pipeline, classes=class_names), test=dict(pipeline=test_pipeline, classes=class_names)) # model settings model = dict( pts_voxel_layer=dict(max_num_points=20), pts_voxel_encoder=dict(feat_channels=[64, 64]), pts_neck=dict( _delete_=True, type='SECONDFPN', norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01), in_channels=[64, 128, 256], upsample_strides=[1, 2, 4], out_channels=[128, 128, 128]), pts_bbox_head=dict( _delete_=True, type='ShapeAwareHead', num_classes=10, in_channels=384, feat_channels=384, use_direction_classifier=True, anchor_generator=dict( type='AlignedAnchor3DRangeGeneratorPerCls', ranges=[[-50, -50, -1.67339111, 50, 50, -1.67339111], [-50, -50, -1.71396371, 50, 50, -1.71396371], [-50, -50, -1.61785072, 50, 50, -1.61785072], [-50, -50, -1.80984986, 50, 50, -1.80984986], [-50, -50, -1.76396500, 50, 50, -1.76396500], [-50, -50, -1.80032795, 50, 50, -1.80032795], [-50, -50, -1.74440365, 50, 50, -1.74440365], [-50, -50, -1.68526504, 50, 50, -1.68526504], [-50, -50, -1.80673031, 50, 50, -1.80673031], [-50, -50, -1.64824291, 50, 50, -1.64824291]], sizes=[ [0.60058911, 1.68452161, 1.27192197], # bicycle [0.76279481, 2.09973778, 1.44403034], # motorcycle [0.66344886, 0.72564370, 1.75748069], # pedestrian [0.39694519, 0.40359262, 1.06232151], # traffic cone [2.49008838, 0.48578221, 0.98297065], # barrier [1.95017717, 4.60718145, 1.72270761], # car [2.45609390, 6.73778078, 2.73004906], # truck [2.87427237, 12.01320693, 3.81509561], # trailer [2.94046906, 11.1885991, 3.47030982], # bus [2.73050468, 6.38352896, 3.13312415] # construction vehicle ], custom_values=[0, 0], rotations=[0, 1.57], reshape_out=False), tasks=[ dict( num_class=2, class_names=['bicycle', 'motorcycle'], shared_conv_channels=(64, 64), shared_conv_strides=(1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01)), dict( num_class=1, class_names=['pedestrian'], shared_conv_channels=(64, 64), shared_conv_strides=(1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01)), dict( num_class=2, class_names=['traffic_cone', 'barrier'], shared_conv_channels=(64, 64), shared_conv_strides=(1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01)), dict( num_class=1, class_names=['car'], shared_conv_channels=(64, 64, 64), shared_conv_strides=(2, 1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01)), dict( num_class=4, class_names=[ 'truck', 'trailer', 'bus', 'construction_vehicle' ], shared_conv_channels=(64, 64, 64), shared_conv_strides=(2, 1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=1e-3, momentum=0.01)) ], assign_per_class=True, diff_rad_by_sin=True, dir_offset=0.7854, # pi/4 dir_limit_offset=0, bbox_coder=dict(type='DeltaXYZWLHRBBoxCoder', code_size=9), loss_cls=dict( type='FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0), loss_dir=dict( type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.2)), # model training and testing settings train_cfg=dict( _delete_=True, pts=dict( assigner=[ dict( # bicycle type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.35, min_pos_iou=0.35, ignore_iof_thr=-1), dict( # motorcycle type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.3, min_pos_iou=0.3, ignore_iof_thr=-1), dict( # pedestrian type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict( # traffic cone type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict( # barrier type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict( # car type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6, neg_iou_thr=0.45, min_pos_iou=0.45, ignore_iof_thr=-1), dict( # truck type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict( # trailer type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.35, min_pos_iou=0.35, ignore_iof_thr=-1), dict( # bus type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict( # construction vehicle type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.35, min_pos_iou=0.35, ignore_iof_thr=-1) ], allowed_border=0, code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.2, 0.2], pos_weight=-1, debug=False)))
_base_ = ['../_base_/models/hv_pointpillars_fpn_nus.py', '../_base_/datasets/nus-3d.py', '../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py'] point_cloud_range = [-50, -50, -5, 50, 50, 3] class_names = ['bicycle', 'motorcycle', 'pedestrian', 'traffic_cone', 'barrier', 'car', 'truck', 'trailer', 'bus', 'construction_vehicle'] train_pipeline = [dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), dict(type='LoadAnnotations3D', with_bbox_3d=True, with_label_3d=True), dict(type='GlobalRotScaleTrans', rot_range=[-0.3925, 0.3925], scale_ratio_range=[0.95, 1.05], translation_std=[0, 0, 0]), dict(type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5, flip_ratio_bev_vertical=0.5), dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), dict(type='PointShuffle'), dict(type='DefaultFormatBundle3D', class_names=class_names), dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d'])] test_pipeline = [dict(type='LoadPointsFromFile', coord_type='LIDAR', load_dim=5, use_dim=5), dict(type='LoadPointsFromMultiSweeps', sweeps_num=10), dict(type='MultiScaleFlipAug3D', img_scale=(1333, 800), pts_scale_ratio=1, flip=False, transforms=[dict(type='GlobalRotScaleTrans', rot_range=[0, 0], scale_ratio_range=[1.0, 1.0], translation_std=[0, 0, 0]), dict(type='RandomFlip3D'), dict(type='PointsRangeFilter', point_cloud_range=point_cloud_range), dict(type='DefaultFormatBundle3D', class_names=class_names, with_label=False), dict(type='Collect3D', keys=['points'])])] data = dict(samples_per_gpu=2, workers_per_gpu=4, train=dict(pipeline=train_pipeline, classes=class_names), val=dict(pipeline=test_pipeline, classes=class_names), test=dict(pipeline=test_pipeline, classes=class_names)) model = dict(pts_voxel_layer=dict(max_num_points=20), pts_voxel_encoder=dict(feat_channels=[64, 64]), pts_neck=dict(_delete_=True, type='SECONDFPN', norm_cfg=dict(type='naiveSyncBN2d', eps=0.001, momentum=0.01), in_channels=[64, 128, 256], upsample_strides=[1, 2, 4], out_channels=[128, 128, 128]), pts_bbox_head=dict(_delete_=True, type='ShapeAwareHead', num_classes=10, in_channels=384, feat_channels=384, use_direction_classifier=True, anchor_generator=dict(type='AlignedAnchor3DRangeGeneratorPerCls', ranges=[[-50, -50, -1.67339111, 50, 50, -1.67339111], [-50, -50, -1.71396371, 50, 50, -1.71396371], [-50, -50, -1.61785072, 50, 50, -1.61785072], [-50, -50, -1.80984986, 50, 50, -1.80984986], [-50, -50, -1.763965, 50, 50, -1.763965], [-50, -50, -1.80032795, 50, 50, -1.80032795], [-50, -50, -1.74440365, 50, 50, -1.74440365], [-50, -50, -1.68526504, 50, 50, -1.68526504], [-50, -50, -1.80673031, 50, 50, -1.80673031], [-50, -50, -1.64824291, 50, 50, -1.64824291]], sizes=[[0.60058911, 1.68452161, 1.27192197], [0.76279481, 2.09973778, 1.44403034], [0.66344886, 0.7256437, 1.75748069], [0.39694519, 0.40359262, 1.06232151], [2.49008838, 0.48578221, 0.98297065], [1.95017717, 4.60718145, 1.72270761], [2.4560939, 6.73778078, 2.73004906], [2.87427237, 12.01320693, 3.81509561], [2.94046906, 11.1885991, 3.47030982], [2.73050468, 6.38352896, 3.13312415]], custom_values=[0, 0], rotations=[0, 1.57], reshape_out=False), tasks=[dict(num_class=2, class_names=['bicycle', 'motorcycle'], shared_conv_channels=(64, 64), shared_conv_strides=(1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=0.001, momentum=0.01)), dict(num_class=1, class_names=['pedestrian'], shared_conv_channels=(64, 64), shared_conv_strides=(1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=0.001, momentum=0.01)), dict(num_class=2, class_names=['traffic_cone', 'barrier'], shared_conv_channels=(64, 64), shared_conv_strides=(1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=0.001, momentum=0.01)), dict(num_class=1, class_names=['car'], shared_conv_channels=(64, 64, 64), shared_conv_strides=(2, 1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=0.001, momentum=0.01)), dict(num_class=4, class_names=['truck', 'trailer', 'bus', 'construction_vehicle'], shared_conv_channels=(64, 64, 64), shared_conv_strides=(2, 1, 1), norm_cfg=dict(type='naiveSyncBN2d', eps=0.001, momentum=0.01))], assign_per_class=True, diff_rad_by_sin=True, dir_offset=0.7854, dir_limit_offset=0, bbox_coder=dict(type='DeltaXYZWLHRBBoxCoder', code_size=9), loss_cls=dict(type='FocalLoss', use_sigmoid=True, gamma=2.0, alpha=0.25, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0 / 9.0, loss_weight=1.0), loss_dir=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.2)), train_cfg=dict(_delete_=True, pts=dict(assigner=[dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.35, min_pos_iou=0.35, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.3, min_pos_iou=0.3, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.6, neg_iou_thr=0.45, min_pos_iou=0.45, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.35, min_pos_iou=0.35, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.55, neg_iou_thr=0.4, min_pos_iou=0.4, ignore_iof_thr=-1), dict(type='MaxIoUAssigner', iou_calculator=dict(type='BboxOverlapsNearest3D'), pos_iou_thr=0.5, neg_iou_thr=0.35, min_pos_iou=0.35, ignore_iof_thr=-1)], allowed_border=0, code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.2, 0.2], pos_weight=-1, debug=False)))
# # PySNMP MIB module ZHONE-COM-VOIP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-COM-VOIP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:41:09 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion") InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType") applIndex, = mibBuilder.importSymbols("NETWORK-SERVICES-MIB", "applIndex") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") TimeTicks, NotificationType, iso, ModuleIdentity, ObjectIdentity, Bits, Counter64, Integer32, Unsigned32, IpAddress, Gauge32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "NotificationType", "iso", "ModuleIdentity", "ObjectIdentity", "Bits", "Counter64", "Integer32", "Unsigned32", "IpAddress", "Gauge32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32") TruthValue, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "DisplayString", "TextualConvention") ZhoneCodecType, = mibBuilder.importSymbols("ZHONE-GEN-SUBSCRIBER", "ZhoneCodecType") zhoneVoice, = mibBuilder.importSymbols("Zhone", "zhoneVoice") ZhoneRowStatus, = mibBuilder.importSymbols("Zhone-TC", "ZhoneRowStatus") zhoneVoip = ModuleIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4)) zhoneVoip.setRevisions(('2014-10-16 23:33', '2014-08-26 10:40', '2014-07-03 02:40', '2014-06-16 21:40', '2014-05-22 14:09', '2014-01-02 22:13', '2012-09-17 23:42', '2012-09-17 23:39', '2011-12-22 02:24', '2011-10-20 12:14', '2011-07-25 11:44', '2009-10-07 01:41', '2009-03-21 02:08', '2008-10-31 01:12', '2008-08-27 23:02', '2008-06-11 17:40', '2007-07-16 02:45', '2006-04-13 15:53', '2005-10-11 11:46', '2005-07-12 10:25', '2005-07-07 16:06', '2005-07-07 15:12', '2005-06-01 11:09', '2005-05-19 15:46', '2005-05-14 21:24', '2005-02-28 10:49', '2004-11-01 14:34', '2004-03-03 17:40', '2004-02-24 12:36', '2004-01-06 15:37', '2003-11-06 10:08', '2003-10-16 14:53', '2003-08-27 11:30', '2003-08-08 17:19', '2003-05-28 12:00', '2003-03-31 18:03', '2003-02-18 14:32',)) if mibBuilder.loadTexts: zhoneVoip.setLastUpdated('201408261040Z') if mibBuilder.loadTexts: zhoneVoip.setOrganization('Zhone Technologies.') zhoneVoipSystem = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1)) if mibBuilder.loadTexts: zhoneVoipSystem.setStatus('deprecated') zhoneVoipSystemProtocol = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("sip", 1), ("mgcp", 2))).clone('sip')).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneVoipSystemProtocol.setStatus('deprecated') zhoneVoipSystemSendCallProceedingTone = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipSystemSendCallProceedingTone.setStatus('deprecated') zhoneVoipSystemRtcpEnabled = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipSystemRtcpEnabled.setStatus('deprecated') zhoneVoipSystemRtcpPacketInterval = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2500, 10000)).clone(5000)).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipSystemRtcpPacketInterval.setStatus('deprecated') zhoneVoipSystemInterdigitTimeout = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 5), Integer32().clone(10)).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipSystemInterdigitTimeout.setStatus('deprecated') zhoneVoipSystemIpTos = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipSystemIpTos.setStatus('deprecated') zhoneVoipSystemDomainName = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 7), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneVoipSystemDomainName.setStatus('deprecated') zhoneVoipObjects = ObjectGroup((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 2)).setObjects(("ZHONE-COM-VOIP-MIB", "nextVoipSipDialPlanId"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialString"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialIpAddr"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialPlanRowStatus"), ("ZHONE-COM-VOIP-MIB", "nextZhoneVoipHuntGroupId"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipHuntGroupDestUri"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipHuntGroupRowStatus"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialPrefixAdd"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialPrefixStrip"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialNumOfDigits"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialDestName"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipHuntGroupPortMembers"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipHuntGroupDefaultCodec"), ("ZHONE-COM-VOIP-MIB", "nextVoipMaliciousCallerId"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipMaliciousCallerUri"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerId"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerUdpPortNumber"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerAddr"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerAddrType"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerRowStatus"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialPlanType"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerSessionTimer"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerSessionExpiration"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerSessionMinSE"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerSessionCallerReqTimer"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerSessionCalleeReqTimer"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerSessionCallerSpecifyRefresher"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerSessionCalleeSpecifyRefresher"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerExpiresInvite"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerExpiresRegister"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerHeaderMethod"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipMaliciousCallerRowStatus"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipMaliciousCallerEnable"), ("ZHONE-COM-VOIP-MIB", "zhoneVoipServerBehaviorStringOne")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): zhoneVoipObjects = zhoneVoipObjects.setStatus('current') zhoneVoipSipDialPlan = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3)) nextVoipSipDialPlanId = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nextVoipSipDialPlanId.setStatus('current') zhoneVoipSipDialPlanTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2), ) if mibBuilder.loadTexts: zhoneVoipSipDialPlanTable.setStatus('current') zhoneVoipSipDialPlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1), ).setIndexNames((0, "ZHONE-COM-VOIP-MIB", "zhoneVoipSipDialPlanId")) if mibBuilder.loadTexts: zhoneVoipSipDialPlanEntry.setStatus('current') zhoneVoipSipDialPlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: zhoneVoipSipDialPlanId.setStatus('current') zhoneVoipSipDialString = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialString.setStatus('current') zhoneVoipSipDialIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 3), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialIpAddr.setStatus('current') zhoneVoipSipDialPlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 4), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialPlanRowStatus.setStatus('current') zhoneVoipSipDialDestName = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 5), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialDestName.setStatus('current') zhoneVoipSipDialNumOfDigits = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialNumOfDigits.setStatus('current') zhoneVoipSipDialPrefixStrip = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialPrefixStrip.setStatus('current') zhoneVoipSipDialPrefixAdd = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 8), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialPrefixAdd.setStatus('current') zhoneVoipSipDialPlanType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("normal", 1), ("callpark", 2), ("esa", 3), ("isdnsig", 4), ("intercom", 5))).clone('normal')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialPlanType.setStatus('current') zhoneVoipServerEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerEntryIndex.setStatus('current') zhoneVoipOverrideInterdigitTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 11), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipOverrideInterdigitTimeout.setStatus('current') zhoneVoipSipDialPlanClass = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 12), Bits().clone(namedValues=NamedValues(("emergency", 0)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSipDialPlanClass.setStatus('current') zhoneVoipSipDialPlanDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 13), SnmpAdminString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipSipDialPlanDescription.setStatus('current') zhoneVoipHuntGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4)) nextZhoneVoipHuntGroupId = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nextZhoneVoipHuntGroupId.setStatus('current') zhoneVoipHuntGroupTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3), ) if mibBuilder.loadTexts: zhoneVoipHuntGroupTable.setStatus('current') zhoneVoipHuntGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1), ).setIndexNames((0, "ZHONE-COM-VOIP-MIB", "zhoneVoipHuntGroupId")) if mibBuilder.loadTexts: zhoneVoipHuntGroupEntry.setStatus('current') zhoneVoipHuntGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: zhoneVoipHuntGroupId.setStatus('current') zhoneVoipHuntGroupDestUri = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipHuntGroupDestUri.setStatus('current') zhoneVoipHuntGroupDefaultCodec = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 3), ZhoneCodecType().clone('g711mu')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipHuntGroupDefaultCodec.setStatus('current') zhoneVoipHuntGroupPortMembers = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 4), Bits().clone(namedValues=NamedValues(("port1", 0), ("port2", 1), ("port3", 2), ("port4", 3), ("port5", 4), ("port6", 5), ("port7", 6), ("port8", 7), ("port9", 8), ("port10", 9), ("port11", 10), ("port12", 11), ("port13", 12), ("port14", 13), ("port15", 14), ("port16", 15), ("port17", 16), ("port18", 17), ("port19", 18), ("port20", 19), ("port21", 20), ("port22", 21), ("port23", 22), ("port24", 23)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipHuntGroupPortMembers.setStatus('current') zhoneVoipHuntGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 5), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipHuntGroupRowStatus.setStatus('current') zhoneVoipMaliciousCaller = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5)) nextVoipMaliciousCallerId = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nextVoipMaliciousCallerId.setStatus('current') zhoneVoipMaliciousCallerTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2), ) if mibBuilder.loadTexts: zhoneVoipMaliciousCallerTable.setStatus('current') zhoneVoipMaliciousCallerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1), ).setIndexNames((0, "ZHONE-COM-VOIP-MIB", "zhoneVoipMaliciousCallerId")) if mibBuilder.loadTexts: zhoneVoipMaliciousCallerEntry.setStatus('current') zhoneVoipMaliciousCallerId = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: zhoneVoipMaliciousCallerId.setStatus('current') zhoneVoipMaliciousCallerUri = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 2), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipMaliciousCallerUri.setStatus('current') zhoneVoipMaliciousCallerEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 3), TruthValue().clone('true')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipMaliciousCallerEnable.setStatus('current') zhoneVoipMaliciousCallerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 4), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipMaliciousCallerRowStatus.setStatus('current') zhoneVoipServerCfg = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6)) zhoneVoipServerTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1), ) if mibBuilder.loadTexts: zhoneVoipServerTable.setStatus('current') zhoneVoipServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1), ).setIndexNames((0, "NETWORK-SERVICES-MIB", "applIndex"), (0, "ZHONE-COM-VOIP-MIB", "zhoneVoipServerAddressIndex")) if mibBuilder.loadTexts: zhoneVoipServerEntry.setStatus('current') zhoneVoipServerAddressIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: zhoneVoipServerAddressIndex.setStatus('current') zhoneVoipServerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 2), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerRowStatus.setStatus('current') zhoneVoipServerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 3), InetAddressType().clone('ipv4')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerAddrType.setStatus('current') zhoneVoipServerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 4), InetAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerAddr.setStatus('current') zhoneVoipServerUdpPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(2427)).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerUdpPortNumber.setStatus('current') zhoneVoipServerId = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38))).clone(namedValues=NamedValues(("longboard", 1), ("asterisk", 2), ("sipexpressrouter", 3), ("metaswitch", 4), ("sylantro", 5), ("broadsoft", 6), ("ubiquity", 7), ("generalbandwidth", 8), ("tekelec-T6000", 9), ("generic", 10), ("sonus", 11), ("siemens", 12), ("tekelec-T9000", 13), ("lucent-telica", 14), ("nortel-cs2000", 15), ("nuera", 16), ("lucent-imerge", 17), ("coppercom", 18), ("newcross", 19), ("cisco-bts", 20), ("cirpack-utp", 21), ("italtel-issw", 22), ("cisco-pgw", 23), ("microtrol-msk10", 24), ("nortel-dms10", 25), ("verso-clarent-c5cm", 26), ("cedarpoint-safari", 27), ("huawei-softx3000", 28), ("nortel-cs1500", 29), ("taqua-t7000", 30), ("utstarcom-mswitch", 31), ("broadsoft-broadworks", 32), ("broadsoft-m6", 33), ("genband-g9", 34), ("netcentrex", 35), ("genband-g6", 36), ("alu-5060", 37), ("ericsson-apz60", 38))).clone('generic')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerId.setStatus('current') zhoneVoipServerProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("sip", 1), ("mgcp", 2), ("megaco", 3), ("ncs", 4))).clone('sip')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerProtocol.setStatus('current') zhoneVoipServerSendCallProceedingTone = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 8), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSendCallProceedingTone.setStatus('current') zhoneVoipServerRtcpEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 9), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerRtcpEnabled.setStatus('current') zhoneVoipServerRtcpPacketInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 10), Integer32().clone(5000)).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerRtcpPacketInterval.setStatus('current') zhoneVoipServerInterDigitTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 11), Integer32().clone(10)).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerInterDigitTimeout.setStatus('current') zhoneVoipServerIpTos = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 12), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerIpTos.setStatus('current') zhoneVoipServerDomainName = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 13), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerDomainName.setStatus('current') zhoneVoipServerExpiresInvite = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 14), Unsigned32()).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerExpiresInvite.setStatus('current') zhoneVoipServerExpiresRegister = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 15), Unsigned32()).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerExpiresRegister.setStatus('current') zhoneVoipServerHeaderMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 16), Bits().clone(namedValues=NamedValues(("invite", 0), ("register", 1)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerHeaderMethod.setStatus('current') zhoneVoipServerSessionTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2))).clone('off')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSessionTimer.setStatus('current') zhoneVoipServerSessionExpiration = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 18), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(90, 2147483647)).clone(180)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSessionExpiration.setStatus('current') zhoneVoipServerSessionMinSE = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 19), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(90, 2147483647)).clone(180)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSessionMinSE.setStatus('current') zhoneVoipServerSessionCallerReqTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2))).clone('no')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSessionCallerReqTimer.setStatus('current') zhoneVoipServerSessionCalleeReqTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2))).clone('no')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSessionCalleeReqTimer.setStatus('current') zhoneVoipServerSessionCallerSpecifyRefresher = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("uac", 1), ("uas", 2), ("omit", 3))).clone('omit')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSessionCallerSpecifyRefresher.setStatus('current') zhoneVoipServerSessionCalleeSpecifyRefresher = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uac", 1), ("uas", 2))).clone('uac')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSessionCalleeSpecifyRefresher.setStatus('current') zhoneVoipServerDtmfMode = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inband", 1), ("rfc2833", 2), ("rfc2833only", 3))).clone('rfc2833')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerDtmfMode.setStatus('current') zhoneVoipServerBehaviorStringOne = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 25), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setUnits('characters').setMaxAccess("readonly") if mibBuilder.loadTexts: zhoneVoipServerBehaviorStringOne.setStatus('current') zhoneVoipServerRtpTermIdSyntax = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 26), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 96))).setUnits('characters').setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipServerRtpTermIdSyntax.setStatus('current') zhoneVoipServerRtpDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 27), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 8))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerRtpDSCP.setStatus('current') zhoneVoipServerSignalingDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 28), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 8))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerSignalingDSCP.setStatus('current') zhoneVoipServerDtmfPayloadId = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 29), Integer32().subtype(subtypeSpec=ValueRangeConstraint(96, 127)).clone(101)).setMaxAccess("readwrite") if mibBuilder.loadTexts: zhoneVoipServerDtmfPayloadId.setStatus('current') zhoneVoipServerRegisterReadyTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 30), Unsigned32().clone(10)).setUnits('seconds').setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerRegisterReadyTimeout.setStatus('current') zhoneVoipServerMessageRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 31), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerMessageRetryCount.setStatus('current') zhoneVoipServerFeatures = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 32), Bits().clone(namedValues=NamedValues(("sip-outbound", 0), ("gruu", 1)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerFeatures.setStatus('current') zhoneVoipServerTransportProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("udp", 1), ("tcp", 2))).clone('udp')).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipServerTransportProtocol.setStatus('current') zhoneVoipSigLocalPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 34), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(5060)).setMaxAccess("readcreate") if mibBuilder.loadTexts: zhoneVoipSigLocalPortNumber.setStatus('current') mibBuilder.exportSymbols("ZHONE-COM-VOIP-MIB", nextZhoneVoipHuntGroupId=nextZhoneVoipHuntGroupId, PYSNMP_MODULE_ID=zhoneVoip, zhoneVoipHuntGroupRowStatus=zhoneVoipHuntGroupRowStatus, zhoneVoipServerSessionCalleeReqTimer=zhoneVoipServerSessionCalleeReqTimer, zhoneVoipHuntGroupEntry=zhoneVoipHuntGroupEntry, zhoneVoipHuntGroupId=zhoneVoipHuntGroupId, zhoneVoipServerDomainName=zhoneVoipServerDomainName, zhoneVoipServerSendCallProceedingTone=zhoneVoipServerSendCallProceedingTone, zhoneVoipSigLocalPortNumber=zhoneVoipSigLocalPortNumber, zhoneVoipServerTransportProtocol=zhoneVoipServerTransportProtocol, zhoneVoipServerRtcpEnabled=zhoneVoipServerRtcpEnabled, nextVoipMaliciousCallerId=nextVoipMaliciousCallerId, zhoneVoipServerDtmfPayloadId=zhoneVoipServerDtmfPayloadId, zhoneVoipServerCfg=zhoneVoipServerCfg, zhoneVoipServerRowStatus=zhoneVoipServerRowStatus, zhoneVoipSystemRtcpPacketInterval=zhoneVoipSystemRtcpPacketInterval, zhoneVoipSystemDomainName=zhoneVoipSystemDomainName, zhoneVoipSystemIpTos=zhoneVoipSystemIpTos, zhoneVoipServerSessionTimer=zhoneVoipServerSessionTimer, zhoneVoipSystemSendCallProceedingTone=zhoneVoipSystemSendCallProceedingTone, zhoneVoipHuntGroupTable=zhoneVoipHuntGroupTable, zhoneVoipServerEntryIndex=zhoneVoipServerEntryIndex, zhoneVoipServerSessionCalleeSpecifyRefresher=zhoneVoipServerSessionCalleeSpecifyRefresher, zhoneVoipServerRtpTermIdSyntax=zhoneVoipServerRtpTermIdSyntax, zhoneVoipServerFeatures=zhoneVoipServerFeatures, zhoneVoipServerRtpDSCP=zhoneVoipServerRtpDSCP, zhoneVoipServerHeaderMethod=zhoneVoipServerHeaderMethod, zhoneVoipSystem=zhoneVoipSystem, zhoneVoipServerExpiresRegister=zhoneVoipServerExpiresRegister, zhoneVoipMaliciousCallerRowStatus=zhoneVoipMaliciousCallerRowStatus, zhoneVoipServerAddrType=zhoneVoipServerAddrType, zhoneVoipSipDialPrefixStrip=zhoneVoipSipDialPrefixStrip, zhoneVoipServerAddressIndex=zhoneVoipServerAddressIndex, zhoneVoipServerId=zhoneVoipServerId, zhoneVoipSipDialPlanTable=zhoneVoipSipDialPlanTable, zhoneVoipHuntGroupDestUri=zhoneVoipHuntGroupDestUri, zhoneVoipServerSessionMinSE=zhoneVoipServerSessionMinSE, zhoneVoip=zhoneVoip, zhoneVoipOverrideInterdigitTimeout=zhoneVoipOverrideInterdigitTimeout, zhoneVoipSystemRtcpEnabled=zhoneVoipSystemRtcpEnabled, zhoneVoipSipDialIpAddr=zhoneVoipSipDialIpAddr, zhoneVoipSipDialPlanEntry=zhoneVoipSipDialPlanEntry, zhoneVoipServerMessageRetryCount=zhoneVoipServerMessageRetryCount, zhoneVoipSipDialNumOfDigits=zhoneVoipSipDialNumOfDigits, zhoneVoipServerSessionCallerReqTimer=zhoneVoipServerSessionCallerReqTimer, zhoneVoipSipDialPlanRowStatus=zhoneVoipSipDialPlanRowStatus, zhoneVoipServerRegisterReadyTimeout=zhoneVoipServerRegisterReadyTimeout, zhoneVoipServerDtmfMode=zhoneVoipServerDtmfMode, zhoneVoipServerSignalingDSCP=zhoneVoipServerSignalingDSCP, zhoneVoipMaliciousCallerUri=zhoneVoipMaliciousCallerUri, zhoneVoipServerAddr=zhoneVoipServerAddr, zhoneVoipServerSessionCallerSpecifyRefresher=zhoneVoipServerSessionCallerSpecifyRefresher, zhoneVoipSipDialPlanId=zhoneVoipSipDialPlanId, zhoneVoipServerIpTos=zhoneVoipServerIpTos, zhoneVoipSipDialDestName=zhoneVoipSipDialDestName, zhoneVoipServerUdpPortNumber=zhoneVoipServerUdpPortNumber, zhoneVoipSipDialPlanType=zhoneVoipSipDialPlanType, zhoneVoipServerBehaviorStringOne=zhoneVoipServerBehaviorStringOne, zhoneVoipHuntGroupPortMembers=zhoneVoipHuntGroupPortMembers, zhoneVoipServerRtcpPacketInterval=zhoneVoipServerRtcpPacketInterval, zhoneVoipServerInterDigitTimeout=zhoneVoipServerInterDigitTimeout, zhoneVoipSipDialPlanDescription=zhoneVoipSipDialPlanDescription, zhoneVoipServerEntry=zhoneVoipServerEntry, zhoneVoipHuntGroup=zhoneVoipHuntGroup, zhoneVoipMaliciousCallerId=zhoneVoipMaliciousCallerId, zhoneVoipSipDialPlanClass=zhoneVoipSipDialPlanClass, zhoneVoipSystemProtocol=zhoneVoipSystemProtocol, zhoneVoipMaliciousCallerTable=zhoneVoipMaliciousCallerTable, zhoneVoipServerExpiresInvite=zhoneVoipServerExpiresInvite, zhoneVoipSipDialPlan=zhoneVoipSipDialPlan, zhoneVoipObjects=zhoneVoipObjects, zhoneVoipMaliciousCallerEntry=zhoneVoipMaliciousCallerEntry, zhoneVoipHuntGroupDefaultCodec=zhoneVoipHuntGroupDefaultCodec, zhoneVoipServerSessionExpiration=zhoneVoipServerSessionExpiration, nextVoipSipDialPlanId=nextVoipSipDialPlanId, zhoneVoipServerTable=zhoneVoipServerTable, zhoneVoipMaliciousCaller=zhoneVoipMaliciousCaller, zhoneVoipSipDialPrefixAdd=zhoneVoipSipDialPrefixAdd, zhoneVoipMaliciousCallerEnable=zhoneVoipMaliciousCallerEnable, zhoneVoipSystemInterdigitTimeout=zhoneVoipSystemInterdigitTimeout, zhoneVoipServerProtocol=zhoneVoipServerProtocol, zhoneVoipSipDialString=zhoneVoipSipDialString)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, single_value_constraint, value_size_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (inet_address, inet_address_type) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddress', 'InetAddressType') (appl_index,) = mibBuilder.importSymbols('NETWORK-SERVICES-MIB', 'applIndex') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup') (time_ticks, notification_type, iso, module_identity, object_identity, bits, counter64, integer32, unsigned32, ip_address, gauge32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'NotificationType', 'iso', 'ModuleIdentity', 'ObjectIdentity', 'Bits', 'Counter64', 'Integer32', 'Unsigned32', 'IpAddress', 'Gauge32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32') (truth_value, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'DisplayString', 'TextualConvention') (zhone_codec_type,) = mibBuilder.importSymbols('ZHONE-GEN-SUBSCRIBER', 'ZhoneCodecType') (zhone_voice,) = mibBuilder.importSymbols('Zhone', 'zhoneVoice') (zhone_row_status,) = mibBuilder.importSymbols('Zhone-TC', 'ZhoneRowStatus') zhone_voip = module_identity((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4)) zhoneVoip.setRevisions(('2014-10-16 23:33', '2014-08-26 10:40', '2014-07-03 02:40', '2014-06-16 21:40', '2014-05-22 14:09', '2014-01-02 22:13', '2012-09-17 23:42', '2012-09-17 23:39', '2011-12-22 02:24', '2011-10-20 12:14', '2011-07-25 11:44', '2009-10-07 01:41', '2009-03-21 02:08', '2008-10-31 01:12', '2008-08-27 23:02', '2008-06-11 17:40', '2007-07-16 02:45', '2006-04-13 15:53', '2005-10-11 11:46', '2005-07-12 10:25', '2005-07-07 16:06', '2005-07-07 15:12', '2005-06-01 11:09', '2005-05-19 15:46', '2005-05-14 21:24', '2005-02-28 10:49', '2004-11-01 14:34', '2004-03-03 17:40', '2004-02-24 12:36', '2004-01-06 15:37', '2003-11-06 10:08', '2003-10-16 14:53', '2003-08-27 11:30', '2003-08-08 17:19', '2003-05-28 12:00', '2003-03-31 18:03', '2003-02-18 14:32')) if mibBuilder.loadTexts: zhoneVoip.setLastUpdated('201408261040Z') if mibBuilder.loadTexts: zhoneVoip.setOrganization('Zhone Technologies.') zhone_voip_system = object_identity((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1)) if mibBuilder.loadTexts: zhoneVoipSystem.setStatus('deprecated') zhone_voip_system_protocol = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('sip', 1), ('mgcp', 2))).clone('sip')).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneVoipSystemProtocol.setStatus('deprecated') zhone_voip_system_send_call_proceeding_tone = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 2), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipSystemSendCallProceedingTone.setStatus('deprecated') zhone_voip_system_rtcp_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 3), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipSystemRtcpEnabled.setStatus('deprecated') zhone_voip_system_rtcp_packet_interval = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(2500, 10000)).clone(5000)).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipSystemRtcpPacketInterval.setStatus('deprecated') zhone_voip_system_interdigit_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 5), integer32().clone(10)).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipSystemInterdigitTimeout.setStatus('deprecated') zhone_voip_system_ip_tos = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipSystemIpTos.setStatus('deprecated') zhone_voip_system_domain_name = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 1, 7), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneVoipSystemDomainName.setStatus('deprecated') zhone_voip_objects = object_group((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 2)).setObjects(('ZHONE-COM-VOIP-MIB', 'nextVoipSipDialPlanId'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialString'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialIpAddr'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialPlanRowStatus'), ('ZHONE-COM-VOIP-MIB', 'nextZhoneVoipHuntGroupId'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipHuntGroupDestUri'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipHuntGroupRowStatus'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialPrefixAdd'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialPrefixStrip'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialNumOfDigits'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialDestName'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipHuntGroupPortMembers'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipHuntGroupDefaultCodec'), ('ZHONE-COM-VOIP-MIB', 'nextVoipMaliciousCallerId'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipMaliciousCallerUri'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerId'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerUdpPortNumber'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerAddr'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerAddrType'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerRowStatus'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialPlanType'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerSessionTimer'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerSessionExpiration'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerSessionMinSE'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerSessionCallerReqTimer'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerSessionCalleeReqTimer'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerSessionCallerSpecifyRefresher'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerSessionCalleeSpecifyRefresher'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerExpiresInvite'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerExpiresRegister'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerHeaderMethod'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipMaliciousCallerRowStatus'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipMaliciousCallerEnable'), ('ZHONE-COM-VOIP-MIB', 'zhoneVoipServerBehaviorStringOne')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): zhone_voip_objects = zhoneVoipObjects.setStatus('current') zhone_voip_sip_dial_plan = mib_identifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3)) next_voip_sip_dial_plan_id = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nextVoipSipDialPlanId.setStatus('current') zhone_voip_sip_dial_plan_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2)) if mibBuilder.loadTexts: zhoneVoipSipDialPlanTable.setStatus('current') zhone_voip_sip_dial_plan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1)).setIndexNames((0, 'ZHONE-COM-VOIP-MIB', 'zhoneVoipSipDialPlanId')) if mibBuilder.loadTexts: zhoneVoipSipDialPlanEntry.setStatus('current') zhone_voip_sip_dial_plan_id = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: zhoneVoipSipDialPlanId.setStatus('current') zhone_voip_sip_dial_string = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 2), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 128))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialString.setStatus('current') zhone_voip_sip_dial_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 3), ip_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialIpAddr.setStatus('current') zhone_voip_sip_dial_plan_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 4), zhone_row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialPlanRowStatus.setStatus('current') zhone_voip_sip_dial_dest_name = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 5), snmp_admin_string()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialDestName.setStatus('current') zhone_voip_sip_dial_num_of_digits = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 32))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialNumOfDigits.setStatus('current') zhone_voip_sip_dial_prefix_strip = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 32))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialPrefixStrip.setStatus('current') zhone_voip_sip_dial_prefix_add = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 8), snmp_admin_string()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialPrefixAdd.setStatus('current') zhone_voip_sip_dial_plan_type = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('normal', 1), ('callpark', 2), ('esa', 3), ('isdnsig', 4), ('intercom', 5))).clone('normal')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialPlanType.setStatus('current') zhone_voip_server_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerEntryIndex.setStatus('current') zhone_voip_override_interdigit_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 11), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipOverrideInterdigitTimeout.setStatus('current') zhone_voip_sip_dial_plan_class = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 12), bits().clone(namedValues=named_values(('emergency', 0)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSipDialPlanClass.setStatus('current') zhone_voip_sip_dial_plan_description = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 3, 2, 1, 13), snmp_admin_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipSipDialPlanDescription.setStatus('current') zhone_voip_hunt_group = mib_identifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4)) next_zhone_voip_hunt_group_id = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nextZhoneVoipHuntGroupId.setStatus('current') zhone_voip_hunt_group_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3)) if mibBuilder.loadTexts: zhoneVoipHuntGroupTable.setStatus('current') zhone_voip_hunt_group_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1)).setIndexNames((0, 'ZHONE-COM-VOIP-MIB', 'zhoneVoipHuntGroupId')) if mibBuilder.loadTexts: zhoneVoipHuntGroupEntry.setStatus('current') zhone_voip_hunt_group_id = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: zhoneVoipHuntGroupId.setStatus('current') zhone_voip_hunt_group_dest_uri = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 2), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 128))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipHuntGroupDestUri.setStatus('current') zhone_voip_hunt_group_default_codec = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 3), zhone_codec_type().clone('g711mu')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipHuntGroupDefaultCodec.setStatus('current') zhone_voip_hunt_group_port_members = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 4), bits().clone(namedValues=named_values(('port1', 0), ('port2', 1), ('port3', 2), ('port4', 3), ('port5', 4), ('port6', 5), ('port7', 6), ('port8', 7), ('port9', 8), ('port10', 9), ('port11', 10), ('port12', 11), ('port13', 12), ('port14', 13), ('port15', 14), ('port16', 15), ('port17', 16), ('port18', 17), ('port19', 18), ('port20', 19), ('port21', 20), ('port22', 21), ('port23', 22), ('port24', 23)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipHuntGroupPortMembers.setStatus('current') zhone_voip_hunt_group_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 4, 3, 1, 5), zhone_row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipHuntGroupRowStatus.setStatus('current') zhone_voip_malicious_caller = mib_identifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5)) next_voip_malicious_caller_id = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: nextVoipMaliciousCallerId.setStatus('current') zhone_voip_malicious_caller_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2)) if mibBuilder.loadTexts: zhoneVoipMaliciousCallerTable.setStatus('current') zhone_voip_malicious_caller_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1)).setIndexNames((0, 'ZHONE-COM-VOIP-MIB', 'zhoneVoipMaliciousCallerId')) if mibBuilder.loadTexts: zhoneVoipMaliciousCallerEntry.setStatus('current') zhone_voip_malicious_caller_id = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: zhoneVoipMaliciousCallerId.setStatus('current') zhone_voip_malicious_caller_uri = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 2), snmp_admin_string()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipMaliciousCallerUri.setStatus('current') zhone_voip_malicious_caller_enable = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 3), truth_value().clone('true')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipMaliciousCallerEnable.setStatus('current') zhone_voip_malicious_caller_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 5, 2, 1, 4), zhone_row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipMaliciousCallerRowStatus.setStatus('current') zhone_voip_server_cfg = mib_identifier((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6)) zhone_voip_server_table = mib_table((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1)) if mibBuilder.loadTexts: zhoneVoipServerTable.setStatus('current') zhone_voip_server_entry = mib_table_row((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1)).setIndexNames((0, 'NETWORK-SERVICES-MIB', 'applIndex'), (0, 'ZHONE-COM-VOIP-MIB', 'zhoneVoipServerAddressIndex')) if mibBuilder.loadTexts: zhoneVoipServerEntry.setStatus('current') zhone_voip_server_address_index = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 1), unsigned32()) if mibBuilder.loadTexts: zhoneVoipServerAddressIndex.setStatus('current') zhone_voip_server_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 2), zhone_row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerRowStatus.setStatus('current') zhone_voip_server_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 3), inet_address_type().clone('ipv4')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerAddrType.setStatus('current') zhone_voip_server_addr = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 4), inet_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerAddr.setStatus('current') zhone_voip_server_udp_port_number = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(2427)).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerUdpPortNumber.setStatus('current') zhone_voip_server_id = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38))).clone(namedValues=named_values(('longboard', 1), ('asterisk', 2), ('sipexpressrouter', 3), ('metaswitch', 4), ('sylantro', 5), ('broadsoft', 6), ('ubiquity', 7), ('generalbandwidth', 8), ('tekelec-T6000', 9), ('generic', 10), ('sonus', 11), ('siemens', 12), ('tekelec-T9000', 13), ('lucent-telica', 14), ('nortel-cs2000', 15), ('nuera', 16), ('lucent-imerge', 17), ('coppercom', 18), ('newcross', 19), ('cisco-bts', 20), ('cirpack-utp', 21), ('italtel-issw', 22), ('cisco-pgw', 23), ('microtrol-msk10', 24), ('nortel-dms10', 25), ('verso-clarent-c5cm', 26), ('cedarpoint-safari', 27), ('huawei-softx3000', 28), ('nortel-cs1500', 29), ('taqua-t7000', 30), ('utstarcom-mswitch', 31), ('broadsoft-broadworks', 32), ('broadsoft-m6', 33), ('genband-g9', 34), ('netcentrex', 35), ('genband-g6', 36), ('alu-5060', 37), ('ericsson-apz60', 38))).clone('generic')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerId.setStatus('current') zhone_voip_server_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('sip', 1), ('mgcp', 2), ('megaco', 3), ('ncs', 4))).clone('sip')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerProtocol.setStatus('current') zhone_voip_server_send_call_proceeding_tone = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 8), truth_value().clone('false')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSendCallProceedingTone.setStatus('current') zhone_voip_server_rtcp_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 9), truth_value().clone('false')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerRtcpEnabled.setStatus('current') zhone_voip_server_rtcp_packet_interval = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 10), integer32().clone(5000)).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerRtcpPacketInterval.setStatus('current') zhone_voip_server_inter_digit_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 11), integer32().clone(10)).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerInterDigitTimeout.setStatus('current') zhone_voip_server_ip_tos = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 12), integer32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerIpTos.setStatus('current') zhone_voip_server_domain_name = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 13), snmp_admin_string()).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerDomainName.setStatus('current') zhone_voip_server_expires_invite = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 14), unsigned32()).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerExpiresInvite.setStatus('current') zhone_voip_server_expires_register = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 15), unsigned32()).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerExpiresRegister.setStatus('current') zhone_voip_server_header_method = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 16), bits().clone(namedValues=named_values(('invite', 0), ('register', 1)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerHeaderMethod.setStatus('current') zhone_voip_server_session_timer = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 17), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('on', 1), ('off', 2))).clone('off')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSessionTimer.setStatus('current') zhone_voip_server_session_expiration = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 18), unsigned32().subtype(subtypeSpec=value_range_constraint(90, 2147483647)).clone(180)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSessionExpiration.setStatus('current') zhone_voip_server_session_min_se = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 19), unsigned32().subtype(subtypeSpec=value_range_constraint(90, 2147483647)).clone(180)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSessionMinSE.setStatus('current') zhone_voip_server_session_caller_req_timer = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('yes', 1), ('no', 2))).clone('no')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSessionCallerReqTimer.setStatus('current') zhone_voip_server_session_callee_req_timer = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 21), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('yes', 1), ('no', 2))).clone('no')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSessionCalleeReqTimer.setStatus('current') zhone_voip_server_session_caller_specify_refresher = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('uac', 1), ('uas', 2), ('omit', 3))).clone('omit')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSessionCallerSpecifyRefresher.setStatus('current') zhone_voip_server_session_callee_specify_refresher = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('uac', 1), ('uas', 2))).clone('uac')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSessionCalleeSpecifyRefresher.setStatus('current') zhone_voip_server_dtmf_mode = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('inband', 1), ('rfc2833', 2), ('rfc2833only', 3))).clone('rfc2833')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerDtmfMode.setStatus('current') zhone_voip_server_behavior_string_one = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 25), octet_string().subtype(subtypeSpec=value_size_constraint(0, 512))).setUnits('characters').setMaxAccess('readonly') if mibBuilder.loadTexts: zhoneVoipServerBehaviorStringOne.setStatus('current') zhone_voip_server_rtp_term_id_syntax = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 26), octet_string().subtype(subtypeSpec=value_size_constraint(0, 96))).setUnits('characters').setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipServerRtpTermIdSyntax.setStatus('current') zhone_voip_server_rtp_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 27), octet_string().subtype(subtypeSpec=value_size_constraint(1, 8))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerRtpDSCP.setStatus('current') zhone_voip_server_signaling_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 28), octet_string().subtype(subtypeSpec=value_size_constraint(1, 8))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerSignalingDSCP.setStatus('current') zhone_voip_server_dtmf_payload_id = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 29), integer32().subtype(subtypeSpec=value_range_constraint(96, 127)).clone(101)).setMaxAccess('readwrite') if mibBuilder.loadTexts: zhoneVoipServerDtmfPayloadId.setStatus('current') zhone_voip_server_register_ready_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 30), unsigned32().clone(10)).setUnits('seconds').setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerRegisterReadyTimeout.setStatus('current') zhone_voip_server_message_retry_count = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 31), integer32().subtype(subtypeSpec=value_range_constraint(1, 10)).clone(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerMessageRetryCount.setStatus('current') zhone_voip_server_features = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 32), bits().clone(namedValues=named_values(('sip-outbound', 0), ('gruu', 1)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerFeatures.setStatus('current') zhone_voip_server_transport_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 33), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('udp', 1), ('tcp', 2))).clone('udp')).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipServerTransportProtocol.setStatus('current') zhone_voip_sig_local_port_number = mib_table_column((1, 3, 6, 1, 4, 1, 5504, 4, 3, 4, 6, 1, 1, 34), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(5060)).setMaxAccess('readcreate') if mibBuilder.loadTexts: zhoneVoipSigLocalPortNumber.setStatus('current') mibBuilder.exportSymbols('ZHONE-COM-VOIP-MIB', nextZhoneVoipHuntGroupId=nextZhoneVoipHuntGroupId, PYSNMP_MODULE_ID=zhoneVoip, zhoneVoipHuntGroupRowStatus=zhoneVoipHuntGroupRowStatus, zhoneVoipServerSessionCalleeReqTimer=zhoneVoipServerSessionCalleeReqTimer, zhoneVoipHuntGroupEntry=zhoneVoipHuntGroupEntry, zhoneVoipHuntGroupId=zhoneVoipHuntGroupId, zhoneVoipServerDomainName=zhoneVoipServerDomainName, zhoneVoipServerSendCallProceedingTone=zhoneVoipServerSendCallProceedingTone, zhoneVoipSigLocalPortNumber=zhoneVoipSigLocalPortNumber, zhoneVoipServerTransportProtocol=zhoneVoipServerTransportProtocol, zhoneVoipServerRtcpEnabled=zhoneVoipServerRtcpEnabled, nextVoipMaliciousCallerId=nextVoipMaliciousCallerId, zhoneVoipServerDtmfPayloadId=zhoneVoipServerDtmfPayloadId, zhoneVoipServerCfg=zhoneVoipServerCfg, zhoneVoipServerRowStatus=zhoneVoipServerRowStatus, zhoneVoipSystemRtcpPacketInterval=zhoneVoipSystemRtcpPacketInterval, zhoneVoipSystemDomainName=zhoneVoipSystemDomainName, zhoneVoipSystemIpTos=zhoneVoipSystemIpTos, zhoneVoipServerSessionTimer=zhoneVoipServerSessionTimer, zhoneVoipSystemSendCallProceedingTone=zhoneVoipSystemSendCallProceedingTone, zhoneVoipHuntGroupTable=zhoneVoipHuntGroupTable, zhoneVoipServerEntryIndex=zhoneVoipServerEntryIndex, zhoneVoipServerSessionCalleeSpecifyRefresher=zhoneVoipServerSessionCalleeSpecifyRefresher, zhoneVoipServerRtpTermIdSyntax=zhoneVoipServerRtpTermIdSyntax, zhoneVoipServerFeatures=zhoneVoipServerFeatures, zhoneVoipServerRtpDSCP=zhoneVoipServerRtpDSCP, zhoneVoipServerHeaderMethod=zhoneVoipServerHeaderMethod, zhoneVoipSystem=zhoneVoipSystem, zhoneVoipServerExpiresRegister=zhoneVoipServerExpiresRegister, zhoneVoipMaliciousCallerRowStatus=zhoneVoipMaliciousCallerRowStatus, zhoneVoipServerAddrType=zhoneVoipServerAddrType, zhoneVoipSipDialPrefixStrip=zhoneVoipSipDialPrefixStrip, zhoneVoipServerAddressIndex=zhoneVoipServerAddressIndex, zhoneVoipServerId=zhoneVoipServerId, zhoneVoipSipDialPlanTable=zhoneVoipSipDialPlanTable, zhoneVoipHuntGroupDestUri=zhoneVoipHuntGroupDestUri, zhoneVoipServerSessionMinSE=zhoneVoipServerSessionMinSE, zhoneVoip=zhoneVoip, zhoneVoipOverrideInterdigitTimeout=zhoneVoipOverrideInterdigitTimeout, zhoneVoipSystemRtcpEnabled=zhoneVoipSystemRtcpEnabled, zhoneVoipSipDialIpAddr=zhoneVoipSipDialIpAddr, zhoneVoipSipDialPlanEntry=zhoneVoipSipDialPlanEntry, zhoneVoipServerMessageRetryCount=zhoneVoipServerMessageRetryCount, zhoneVoipSipDialNumOfDigits=zhoneVoipSipDialNumOfDigits, zhoneVoipServerSessionCallerReqTimer=zhoneVoipServerSessionCallerReqTimer, zhoneVoipSipDialPlanRowStatus=zhoneVoipSipDialPlanRowStatus, zhoneVoipServerRegisterReadyTimeout=zhoneVoipServerRegisterReadyTimeout, zhoneVoipServerDtmfMode=zhoneVoipServerDtmfMode, zhoneVoipServerSignalingDSCP=zhoneVoipServerSignalingDSCP, zhoneVoipMaliciousCallerUri=zhoneVoipMaliciousCallerUri, zhoneVoipServerAddr=zhoneVoipServerAddr, zhoneVoipServerSessionCallerSpecifyRefresher=zhoneVoipServerSessionCallerSpecifyRefresher, zhoneVoipSipDialPlanId=zhoneVoipSipDialPlanId, zhoneVoipServerIpTos=zhoneVoipServerIpTos, zhoneVoipSipDialDestName=zhoneVoipSipDialDestName, zhoneVoipServerUdpPortNumber=zhoneVoipServerUdpPortNumber, zhoneVoipSipDialPlanType=zhoneVoipSipDialPlanType, zhoneVoipServerBehaviorStringOne=zhoneVoipServerBehaviorStringOne, zhoneVoipHuntGroupPortMembers=zhoneVoipHuntGroupPortMembers, zhoneVoipServerRtcpPacketInterval=zhoneVoipServerRtcpPacketInterval, zhoneVoipServerInterDigitTimeout=zhoneVoipServerInterDigitTimeout, zhoneVoipSipDialPlanDescription=zhoneVoipSipDialPlanDescription, zhoneVoipServerEntry=zhoneVoipServerEntry, zhoneVoipHuntGroup=zhoneVoipHuntGroup, zhoneVoipMaliciousCallerId=zhoneVoipMaliciousCallerId, zhoneVoipSipDialPlanClass=zhoneVoipSipDialPlanClass, zhoneVoipSystemProtocol=zhoneVoipSystemProtocol, zhoneVoipMaliciousCallerTable=zhoneVoipMaliciousCallerTable, zhoneVoipServerExpiresInvite=zhoneVoipServerExpiresInvite, zhoneVoipSipDialPlan=zhoneVoipSipDialPlan, zhoneVoipObjects=zhoneVoipObjects, zhoneVoipMaliciousCallerEntry=zhoneVoipMaliciousCallerEntry, zhoneVoipHuntGroupDefaultCodec=zhoneVoipHuntGroupDefaultCodec, zhoneVoipServerSessionExpiration=zhoneVoipServerSessionExpiration, nextVoipSipDialPlanId=nextVoipSipDialPlanId, zhoneVoipServerTable=zhoneVoipServerTable, zhoneVoipMaliciousCaller=zhoneVoipMaliciousCaller, zhoneVoipSipDialPrefixAdd=zhoneVoipSipDialPrefixAdd, zhoneVoipMaliciousCallerEnable=zhoneVoipMaliciousCallerEnable, zhoneVoipSystemInterdigitTimeout=zhoneVoipSystemInterdigitTimeout, zhoneVoipServerProtocol=zhoneVoipServerProtocol, zhoneVoipSipDialString=zhoneVoipSipDialString)
''' Created on Aug 29 2015 @author: kevin.chien@94301.ca ''' class FlamesStatus(object): def __init__(self, code, key, message): self.code = code self.key = key self.message = message def __eq__(self, other): if isinstance(other, FlamesStatus): return other.code == self.code return False def __ne__(self, other): return not self.__eq__(other) # server info status code OK = FlamesStatus(0, 'common.ok', 'OK.') # server error status code UNEXPECTED_EXCEPTION = FlamesStatus(1000001, 'common.unexpected_exception', 'Unknown Error.') UNKNOWN_RESOURCE = FlamesStatus(1000002, 'common.unknown_resource', 'Unknown Resource.') PARAMETER_VALIDATED_FAILED = FlamesStatus(1000003, 'common.parameter_validated_failed', 'Parameter validated error : {messages}') AUTH_FAILED = FlamesStatus(1000004, 'common.auth_failed', "Authorization failed : {messages}") JSON_PARSING_FAILED = FlamesStatus(1000004, 'common.json_parsing_failed', 'Parsing json string failed : {message}') USER_DUPLICATE = FlamesStatus(1080001, "user_duplicate", "'{user_id}' is existed") USER_NOT_FOUND = FlamesStatus(1080002, "user_not_found", "'{user_id}' is not found")
""" Created on Aug 29 2015 @author: kevin.chien@94301.ca """ class Flamesstatus(object): def __init__(self, code, key, message): self.code = code self.key = key self.message = message def __eq__(self, other): if isinstance(other, FlamesStatus): return other.code == self.code return False def __ne__(self, other): return not self.__eq__(other) ok = flames_status(0, 'common.ok', 'OK.') unexpected_exception = flames_status(1000001, 'common.unexpected_exception', 'Unknown Error.') unknown_resource = flames_status(1000002, 'common.unknown_resource', 'Unknown Resource.') parameter_validated_failed = flames_status(1000003, 'common.parameter_validated_failed', 'Parameter validated error : {messages}') auth_failed = flames_status(1000004, 'common.auth_failed', 'Authorization failed : {messages}') json_parsing_failed = flames_status(1000004, 'common.json_parsing_failed', 'Parsing json string failed : {message}') user_duplicate = flames_status(1080001, 'user_duplicate', "'{user_id}' is existed") user_not_found = flames_status(1080002, 'user_not_found', "'{user_id}' is not found")
# with open("status.json","w") as outf: # print('{"status":"ok"}',file=outf) with open("status.json","w") as outf: print('{"status":"updating"}',file=outf)
with open('status.json', 'w') as outf: print('{"status":"updating"}', file=outf)
#Write a program that calculates how many hours an architect will need to draw projects of several construction sites. #The preparation of a project takes approximately three hours. name=input() number_of_projects=int(input()) required_hours=number_of_projects*3 print(f'The architect {name} will need {required_hours} hours to complete {number_of_projects} project/s.')
name = input() number_of_projects = int(input()) required_hours = number_of_projects * 3 print(f'The architect {name} will need {required_hours} hours to complete {number_of_projects} project/s.')
with open('day17.txt') as f: lines = [line.strip() for line in f] xmin,xmax,ymin,ymax,zmin,zmax,wmin,wmax = 0,0,0,0,0,0,0,0 active = set() for row in range(len(lines)): for col in range(len(lines[0])): if lines[row][col] == '#': xmin = min(xmin, col) xmax = max(xmax, col) ymin = min(ymin, row) ymax = max(ymax, row) active.add((col, row, 0, 0)) def count_active_neighbors(x,y,z,w): count = 0 for hyper in range(w - 1, w + 2): for layer in range(z - 1, z + 2): for row in range(y - 1, y + 2): for col in range (x - 1, x + 2): if layer == z and row == y and col == x and hyper == w: continue if (col, row, layer, hyper) in active: count += 1 return count ITER = 6 for iteration in range(ITER): active_copy = set(active) for hyper in range(wmin - 1, wmax + 2): for layer in range(zmin - 1, zmax + 2): for row in range(ymin - 1, ymax + 2): for col in range(xmin - 1, xmax + 2): pos = (col, row, layer, hyper) current_is_active = pos in active active_neighbor_count = count_active_neighbors(*pos) if current_is_active and (active_neighbor_count < 2 or active_neighbor_count > 3): active_copy.remove(pos) elif not current_is_active and active_neighbor_count == 3: xmin = min(xmin, col) xmax = max(xmax, col) ymin = min(ymin, row) ymax = max(ymax, row) zmin = min(zmin, layer) zmax = max(zmax, layer) wmin = min(wmin, hyper) wmax = max(wmax, hyper) active_copy.add(pos) active = active_copy print(len(active))
with open('day17.txt') as f: lines = [line.strip() for line in f] (xmin, xmax, ymin, ymax, zmin, zmax, wmin, wmax) = (0, 0, 0, 0, 0, 0, 0, 0) active = set() for row in range(len(lines)): for col in range(len(lines[0])): if lines[row][col] == '#': xmin = min(xmin, col) xmax = max(xmax, col) ymin = min(ymin, row) ymax = max(ymax, row) active.add((col, row, 0, 0)) def count_active_neighbors(x, y, z, w): count = 0 for hyper in range(w - 1, w + 2): for layer in range(z - 1, z + 2): for row in range(y - 1, y + 2): for col in range(x - 1, x + 2): if layer == z and row == y and (col == x) and (hyper == w): continue if (col, row, layer, hyper) in active: count += 1 return count iter = 6 for iteration in range(ITER): active_copy = set(active) for hyper in range(wmin - 1, wmax + 2): for layer in range(zmin - 1, zmax + 2): for row in range(ymin - 1, ymax + 2): for col in range(xmin - 1, xmax + 2): pos = (col, row, layer, hyper) current_is_active = pos in active active_neighbor_count = count_active_neighbors(*pos) if current_is_active and (active_neighbor_count < 2 or active_neighbor_count > 3): active_copy.remove(pos) elif not current_is_active and active_neighbor_count == 3: xmin = min(xmin, col) xmax = max(xmax, col) ymin = min(ymin, row) ymax = max(ymax, row) zmin = min(zmin, layer) zmax = max(zmax, layer) wmin = min(wmin, hyper) wmax = max(wmax, hyper) active_copy.add(pos) active = active_copy print(len(active))
# "Global" users list. users = [] while True: # Initialize a new user. This uses fromkeys as a shorthand for literally # creating a new dictionary and setting its values to None, which is fine. # But, show this to users, since it's much faster. # user = dict.fromkeys(['first_name', 'last_name', 'middle_initial', 'address','email', 'phone_number']) user = { "first_name": "", "last_name": "", "middle_initial": "", "address": "", "email": "", "phone_number": "" } # Prompt user for user's identification information... user['first_name'] = input('Please enter your first name. ') user['last_name'] = input('Please enter your last name. ') user['middle_initial'] = input('Please enter your middle initial. ') # Prompt user for user's contact information... user['address'] = input('Please enter your address. ') user['email'] = input('Please enter your email. ') user['phone_number'] = input('Please enter your phone_number. ') # Print a separator... print('-' * 18) # Print all to the console... for key, value in user.items(): print('your {0} is {1}.'.format(key, value)) # Print a separator... print('-' * 18) # Prompt for confirmation. Use lower so users can enter either Y or y. if input('Is this information correct? (Y/n) ').lower() == 'y': users.append(user) print(users) # Prompt users to add more user information. if input ('Would you like to input another user\'s information? (Y/n)').lower() == 'y': continue else: print('You\'ve entered the following user profiles:') print('-' * 18) # Print information for every user in the list. for user in users: for key, value in user.items(): print('your {0} is {1}.'.format(key, value)) print('-' * 18) break
users = [] while True: user = {'first_name': '', 'last_name': '', 'middle_initial': '', 'address': '', 'email': '', 'phone_number': ''} user['first_name'] = input('Please enter your first name. ') user['last_name'] = input('Please enter your last name. ') user['middle_initial'] = input('Please enter your middle initial. ') user['address'] = input('Please enter your address. ') user['email'] = input('Please enter your email. ') user['phone_number'] = input('Please enter your phone_number. ') print('-' * 18) for (key, value) in user.items(): print('your {0} is {1}.'.format(key, value)) print('-' * 18) if input('Is this information correct? (Y/n) ').lower() == 'y': users.append(user) print(users) if input("Would you like to input another user's information? (Y/n)").lower() == 'y': continue else: print("You've entered the following user profiles:") print('-' * 18) for user in users: for (key, value) in user.items(): print('your {0} is {1}.'.format(key, value)) print('-' * 18) break
nome = 'Pedro Paulo Barros Correia da Silva' print(nome.upper()) print(nome.lower()) nome_sem_espaco = (nome.replace(' ','')) print(len(nome_sem_espaco))
nome = 'Pedro Paulo Barros Correia da Silva' print(nome.upper()) print(nome.lower()) nome_sem_espaco = nome.replace(' ', '') print(len(nome_sem_espaco))
def test_passwd_file(File): passwd = File("/etc/passwd") assert passwd.contains("root") assert passwd.user == "root" assert passwd.group == "root" assert passwd.mode == 0o644 def test_nginx_is_installed(Package): nginx = Package("nginx") assert nginx.is_installed assert nginx.version.startswith("1.2") def test_nginx_running_and_enabled(Service): nginx = Service("nginx") assert nginx.is_running assert nginx.is_enabled
def test_passwd_file(File): passwd = file('/etc/passwd') assert passwd.contains('root') assert passwd.user == 'root' assert passwd.group == 'root' assert passwd.mode == 420 def test_nginx_is_installed(Package): nginx = package('nginx') assert nginx.is_installed assert nginx.version.startswith('1.2') def test_nginx_running_and_enabled(Service): nginx = service('nginx') assert nginx.is_running assert nginx.is_enabled
#!/usr/bin/python3.5 print('Running ETL For Riders') # Brings data using the Cloudstitch API # into staging tables for further processing by other parts # of the process
print('Running ETL For Riders')
# # PySNMP MIB module Juniper-PPP-Profile-CONF (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-PPP-Profile-CONF # Produced by pysmi-0.3.4 at Mon Apr 29 19:53:03 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion") juniProfileAgents, = mibBuilder.importSymbols("Juniper-Agents", "juniProfileAgents") AgentCapabilities, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "AgentCapabilities", "NotificationGroup", "ModuleCompliance") ModuleIdentity, Counter64, NotificationType, ObjectIdentity, Counter32, Bits, IpAddress, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Unsigned32, Gauge32, TimeTicks, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "Counter64", "NotificationType", "ObjectIdentity", "Counter32", "Bits", "IpAddress", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Unsigned32", "Gauge32", "TimeTicks", "Integer32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") juniPppProfileAgent = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3)) juniPppProfileAgent.setRevisions(('2009-09-18 07:24', '2009-08-10 14:23', '2007-07-12 12:15', '2005-10-19 16:26', '2003-11-03 21:32', '2003-03-13 16:47', '2002-09-06 16:54', '2002-09-03 22:38', '2002-01-25 14:10', '2002-01-16 17:58', '2002-01-08 19:43', '2001-10-17 17:10',)) if mibBuilder.loadTexts: juniPppProfileAgent.setLastUpdated('200909180724Z') if mibBuilder.loadTexts: juniPppProfileAgent.setOrganization('Juniper Networks, Inc.') juniPppProfileAgentV1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV1 = juniPppProfileAgentV1.setProductRelease('Version 1 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 3.0 through\n 3.2 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV1 = juniPppProfileAgentV1.setStatus('obsolete') juniPppProfileAgentV2 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV2 = juniPppProfileAgentV2.setProductRelease('Version 2 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 3.3 system\n release.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV2 = juniPppProfileAgentV2.setStatus('obsolete') juniPppProfileAgentV3 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 3)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV3 = juniPppProfileAgentV3.setProductRelease('Version 3 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 3.4 and\n subsequent 3.x system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV3 = juniPppProfileAgentV3.setStatus('obsolete') juniPppProfileAgentV4 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 4)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV4 = juniPppProfileAgentV4.setProductRelease('Version 4 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 4.0 system\n releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV4 = juniPppProfileAgentV4.setStatus('obsolete') juniPppProfileAgentV5 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 5)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV5 = juniPppProfileAgentV5.setProductRelease('Version 5 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 4.1 through\n 5.0 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV5 = juniPppProfileAgentV5.setStatus('obsolete') juniPppProfileAgentV6 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 6)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV6 = juniPppProfileAgentV6.setProductRelease('Version 6 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 5.1 and 5.2\n system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV6 = juniPppProfileAgentV6.setStatus('obsolete') juniPppProfileAgentV7 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 7)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV7 = juniPppProfileAgentV7.setProductRelease('Version 7 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 5.3 through\n 7.2 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV7 = juniPppProfileAgentV7.setStatus('obsolete') juniPppProfileAgentV8 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 8)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV8 = juniPppProfileAgentV8.setProductRelease('Version 8 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 7.2 system\n releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV8 = juniPppProfileAgentV8.setStatus('obsolete') juniPppProfileAgentV9 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 9)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV9 = juniPppProfileAgentV9.setProductRelease('Version 9 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 7.3 and\n subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV9 = juniPppProfileAgentV9.setStatus('obsolete') juniPppProfileAgentV10 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 10)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV10 = juniPppProfileAgentV10.setProductRelease('Version 10 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 11.0 and\n subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV10 = juniPppProfileAgentV10.setStatus('obsolete') juniPppProfileAgentV11 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 11)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV11 = juniPppProfileAgentV11.setProductRelease('Version 11 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 11.1 and\n subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juniPppProfileAgentV11 = juniPppProfileAgentV11.setStatus('current') mibBuilder.exportSymbols("Juniper-PPP-Profile-CONF", juniPppProfileAgentV9=juniPppProfileAgentV9, juniPppProfileAgentV10=juniPppProfileAgentV10, juniPppProfileAgentV2=juniPppProfileAgentV2, juniPppProfileAgentV11=juniPppProfileAgentV11, juniPppProfileAgentV7=juniPppProfileAgentV7, juniPppProfileAgentV5=juniPppProfileAgentV5, juniPppProfileAgentV8=juniPppProfileAgentV8, juniPppProfileAgentV1=juniPppProfileAgentV1, PYSNMP_MODULE_ID=juniPppProfileAgent, juniPppProfileAgentV3=juniPppProfileAgentV3, juniPppProfileAgent=juniPppProfileAgent, juniPppProfileAgentV4=juniPppProfileAgentV4, juniPppProfileAgentV6=juniPppProfileAgentV6)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, value_size_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion') (juni_profile_agents,) = mibBuilder.importSymbols('Juniper-Agents', 'juniProfileAgents') (agent_capabilities, notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'AgentCapabilities', 'NotificationGroup', 'ModuleCompliance') (module_identity, counter64, notification_type, object_identity, counter32, bits, ip_address, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, unsigned32, gauge32, time_ticks, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'Counter64', 'NotificationType', 'ObjectIdentity', 'Counter32', 'Bits', 'IpAddress', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'Unsigned32', 'Gauge32', 'TimeTicks', 'Integer32') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') juni_ppp_profile_agent = module_identity((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3)) juniPppProfileAgent.setRevisions(('2009-09-18 07:24', '2009-08-10 14:23', '2007-07-12 12:15', '2005-10-19 16:26', '2003-11-03 21:32', '2003-03-13 16:47', '2002-09-06 16:54', '2002-09-03 22:38', '2002-01-25 14:10', '2002-01-16 17:58', '2002-01-08 19:43', '2001-10-17 17:10')) if mibBuilder.loadTexts: juniPppProfileAgent.setLastUpdated('200909180724Z') if mibBuilder.loadTexts: juniPppProfileAgent.setOrganization('Juniper Networks, Inc.') juni_ppp_profile_agent_v1 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 1)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v1 = juniPppProfileAgentV1.setProductRelease('Version 1 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 3.0 through\n 3.2 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v1 = juniPppProfileAgentV1.setStatus('obsolete') juni_ppp_profile_agent_v2 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 2)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v2 = juniPppProfileAgentV2.setProductRelease('Version 2 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 3.3 system\n release.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v2 = juniPppProfileAgentV2.setStatus('obsolete') juni_ppp_profile_agent_v3 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 3)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v3 = juniPppProfileAgentV3.setProductRelease('Version 3 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 3.4 and\n subsequent 3.x system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v3 = juniPppProfileAgentV3.setStatus('obsolete') juni_ppp_profile_agent_v4 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 4)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v4 = juniPppProfileAgentV4.setProductRelease('Version 4 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 4.0 system\n releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v4 = juniPppProfileAgentV4.setStatus('obsolete') juni_ppp_profile_agent_v5 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 5)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v5 = juniPppProfileAgentV5.setProductRelease('Version 5 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 4.1 through\n 5.0 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v5 = juniPppProfileAgentV5.setStatus('obsolete') juni_ppp_profile_agent_v6 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 6)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v6 = juniPppProfileAgentV6.setProductRelease('Version 6 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component was supported in JUNOSe 5.1 and 5.2\n system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v6 = juniPppProfileAgentV6.setStatus('obsolete') juni_ppp_profile_agent_v7 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 7)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v7 = juniPppProfileAgentV7.setProductRelease('Version 7 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 5.3 through\n 7.2 system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v7 = juniPppProfileAgentV7.setStatus('obsolete') juni_ppp_profile_agent_v8 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 8)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v8 = juniPppProfileAgentV8.setProductRelease('Version 8 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 7.2 system\n releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v8 = juniPppProfileAgentV8.setStatus('obsolete') juni_ppp_profile_agent_v9 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 9)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v9 = juniPppProfileAgentV9.setProductRelease('Version 9 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 7.3 and\n subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v9 = juniPppProfileAgentV9.setStatus('obsolete') juni_ppp_profile_agent_v10 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 10)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v10 = juniPppProfileAgentV10.setProductRelease('Version 10 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 11.0 and\n subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v10 = juniPppProfileAgentV10.setStatus('obsolete') juni_ppp_profile_agent_v11 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 3, 11)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v11 = juniPppProfileAgentV11.setProductRelease('Version 11 of the PPP Profile component of the JUNOSe SNMP agent. This\n version of the PPP Profile component is supported in JUNOSe 11.1 and\n subsequent system releases.') if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): juni_ppp_profile_agent_v11 = juniPppProfileAgentV11.setStatus('current') mibBuilder.exportSymbols('Juniper-PPP-Profile-CONF', juniPppProfileAgentV9=juniPppProfileAgentV9, juniPppProfileAgentV10=juniPppProfileAgentV10, juniPppProfileAgentV2=juniPppProfileAgentV2, juniPppProfileAgentV11=juniPppProfileAgentV11, juniPppProfileAgentV7=juniPppProfileAgentV7, juniPppProfileAgentV5=juniPppProfileAgentV5, juniPppProfileAgentV8=juniPppProfileAgentV8, juniPppProfileAgentV1=juniPppProfileAgentV1, PYSNMP_MODULE_ID=juniPppProfileAgent, juniPppProfileAgentV3=juniPppProfileAgentV3, juniPppProfileAgent=juniPppProfileAgent, juniPppProfileAgentV4=juniPppProfileAgentV4, juniPppProfileAgentV6=juniPppProfileAgentV6)
load( "@com_activestate_rules_vendor//private:dependencies.bzl", _vendor_dependencies = "vendor_dependencies" ) load( "@com_activestate_rules_vendor//private:generate.bzl", _vendor_generate = "vendor_generate" ) vendor_dependencies = _vendor_dependencies vendor_generate = _vendor_generate
load('@com_activestate_rules_vendor//private:dependencies.bzl', _vendor_dependencies='vendor_dependencies') load('@com_activestate_rules_vendor//private:generate.bzl', _vendor_generate='vendor_generate') vendor_dependencies = _vendor_dependencies vendor_generate = _vendor_generate
# OpenWeatherMap API Key weather_api_key = "532f8d0abc1e638795cea2ce10729a26" # Google API Key g_key = "AIzaSyBIgvIa9rZosgo9uoIOjJL9Cgdz5ZIdj9Q"
weather_api_key = '532f8d0abc1e638795cea2ce10729a26' g_key = 'AIzaSyBIgvIa9rZosgo9uoIOjJL9Cgdz5ZIdj9Q'
class Solution: def isAnagram(self, s: str, t: str) -> bool: if s == t: return True if len(s) != len(t) or len(s) == 0 or len(t) == 0: return False pre_map = {} for i in s: if pre_map.__contains__(i): pre_map[i] += 1 else: pre_map[i] = 1 for j in t: if not pre_map.__contains__(j): return False pre_map[j] -= 1 if pre_map[j] == 0: del pre_map[j] if len(pre_map) == 0: return True else: return False slu = Solution() print(slu.isAnagram("anagram", "nagaram"))
class Solution: def is_anagram(self, s: str, t: str) -> bool: if s == t: return True if len(s) != len(t) or len(s) == 0 or len(t) == 0: return False pre_map = {} for i in s: if pre_map.__contains__(i): pre_map[i] += 1 else: pre_map[i] = 1 for j in t: if not pre_map.__contains__(j): return False pre_map[j] -= 1 if pre_map[j] == 0: del pre_map[j] if len(pre_map) == 0: return True else: return False slu = solution() print(slu.isAnagram('anagram', 'nagaram'))
class Solution: def findNumberOfLIS(self, nums: List[int]) -> int: n = len(nums) if n < 2: return n length, cnt = [1] * n, [1] * n for idx, _ in enumerate(nums): for j in range(idx): if nums[j] < _: if length[idx] == length[j]: length[idx] += 1 cnt[idx] = cnt[j] elif length[idx] == length[j] + 1: cnt[idx] += cnt[j] longest = max(length) return sum([x[1] for x in enumerate(cnt) if length[x[0]] == longest]) ''' l = 1 cnt = 0 def helper(idx, tmp): nonlocal cnt, l if len(tmp) == l: cnt += 1 elif len(tmp) > l: l = len(tmp) cnt = 1 for i in range(idx, len(nums)): if tmp == []: helper(i + 1, [nums[i]]) else: if nums[i] > tmp[-1]: helper(i + 1, tmp + [nums[i]]) helper(0, []) return cnt '''
class Solution: def find_number_of_lis(self, nums: List[int]) -> int: n = len(nums) if n < 2: return n (length, cnt) = ([1] * n, [1] * n) for (idx, _) in enumerate(nums): for j in range(idx): if nums[j] < _: if length[idx] == length[j]: length[idx] += 1 cnt[idx] = cnt[j] elif length[idx] == length[j] + 1: cnt[idx] += cnt[j] longest = max(length) return sum([x[1] for x in enumerate(cnt) if length[x[0]] == longest]) ' \n l = 1\n cnt = 0\n def helper(idx, tmp):\n nonlocal cnt, l\n if len(tmp) == l:\n cnt += 1\n elif len(tmp) > l:\n l = len(tmp)\n cnt = 1\n for i in range(idx, len(nums)):\n if tmp == []:\n helper(i + 1, [nums[i]])\n else:\n if nums[i] > tmp[-1]:\n helper(i + 1, tmp + [nums[i]])\n helper(0, [])\n return cnt\n '
# Finding Bridges in Undirected Graph def computeBridges(l): id = 0 n = len(l) # No of vertices in graph low = [0] * n visited = [False] * n def dfs(at, parent, bridges, id): visited[at] = True low[at] = id id += 1 for to in l[at]: if to == parent: pass elif not visited[to]: dfs(to, at, bridges, id) low[at] = min(low[at], low[to]) if at < low[to]: bridges.append([at, to]) else: # This edge is a back edge and cannot be a bridge low[at] = min(low[at], to) bridges = [] for i in range(n): if not visited[i]: dfs(i, -1, bridges, id) print(bridges) l = { 0: [1, 2], 1: [0, 2], 2: [0, 1, 3, 5], 3: [2, 4], 4: [3], 5: [2, 6, 8], 6: [5, 7], 7: [6, 8], 8: [5, 7], } computeBridges(l)
def compute_bridges(l): id = 0 n = len(l) low = [0] * n visited = [False] * n def dfs(at, parent, bridges, id): visited[at] = True low[at] = id id += 1 for to in l[at]: if to == parent: pass elif not visited[to]: dfs(to, at, bridges, id) low[at] = min(low[at], low[to]) if at < low[to]: bridges.append([at, to]) else: low[at] = min(low[at], to) bridges = [] for i in range(n): if not visited[i]: dfs(i, -1, bridges, id) print(bridges) l = {0: [1, 2], 1: [0, 2], 2: [0, 1, 3, 5], 3: [2, 4], 4: [3], 5: [2, 6, 8], 6: [5, 7], 7: [6, 8], 8: [5, 7]} compute_bridges(l)
class BaseError(Exception): pass class ResourceNotFoundError(BaseError): name = "ResourceNotFoundError" status = 404 def __init__(self, message=None): self.body = { "message": message or "Resource not found" } class BadParametersError(BaseError): name = "BadParametersError" status = 400 def __init__(self, message=None): self.body = { "message": message or "Bad Parameters" } class MissingParameterError(BaseError): name = "MissingParameterError" status = 400 def __init__(self, message=None, missing_params=None): self.body = { "message": message or "Missing Parameters Error", "missing_params": missing_params } class MissingRequiredHeader(BaseError): name = "MissingRequiredHeader" status = 400 body = {"message": "Missing Required Header"} def __init__(self, message=None): self.body = { "message": message or "Missing Required Header" } class ForbiddenError(BaseError): name = "ForbiddenError" status = 403 def __init__(self, message=None): self.body = { "message": message or "Forbidden error" } class ConflictError(BaseError): name = "ConflictError" status = 409 body = {"message": "Resource Conflict"} class UnauthorizedError(BaseError): name = "UnauthorizedError" status = 401 def __init__(self, message=None): self.body = { "message": message or "Unauthorized Error" } class RemoteAPIError(BaseError): name = "RemoteAPIError" status = 502 def __init__(self, message=None, remote_error=None, remote_message=None, sent_params={}): self.body = { "message": message or "Remote API Error", "remote_error": remote_error, "remote_message": remote_message, "sent_params": sent_params } class UnknownError(BaseError): name = "UnknownError" status = 500 def __init__(self, message=None): self.body = { "message": message or "UnknownError", }
class Baseerror(Exception): pass class Resourcenotfounderror(BaseError): name = 'ResourceNotFoundError' status = 404 def __init__(self, message=None): self.body = {'message': message or 'Resource not found'} class Badparameterserror(BaseError): name = 'BadParametersError' status = 400 def __init__(self, message=None): self.body = {'message': message or 'Bad Parameters'} class Missingparametererror(BaseError): name = 'MissingParameterError' status = 400 def __init__(self, message=None, missing_params=None): self.body = {'message': message or 'Missing Parameters Error', 'missing_params': missing_params} class Missingrequiredheader(BaseError): name = 'MissingRequiredHeader' status = 400 body = {'message': 'Missing Required Header'} def __init__(self, message=None): self.body = {'message': message or 'Missing Required Header'} class Forbiddenerror(BaseError): name = 'ForbiddenError' status = 403 def __init__(self, message=None): self.body = {'message': message or 'Forbidden error'} class Conflicterror(BaseError): name = 'ConflictError' status = 409 body = {'message': 'Resource Conflict'} class Unauthorizederror(BaseError): name = 'UnauthorizedError' status = 401 def __init__(self, message=None): self.body = {'message': message or 'Unauthorized Error'} class Remoteapierror(BaseError): name = 'RemoteAPIError' status = 502 def __init__(self, message=None, remote_error=None, remote_message=None, sent_params={}): self.body = {'message': message or 'Remote API Error', 'remote_error': remote_error, 'remote_message': remote_message, 'sent_params': sent_params} class Unknownerror(BaseError): name = 'UnknownError' status = 500 def __init__(self, message=None): self.body = {'message': message or 'UnknownError'}
class Antibiotico: def __init__(self, nombre, tipoAnimal, dosis, precio): self.__nombre = nombre self.__tipoAnimal = tipoAnimal self.__dosis = dosis self.__precio = precio @property def nombre(self): return self.__nombre @property def tipoAnimal(self): return self.__tipoAnimal @property def dosis(self): return self.__dosis @property def precio(self): return self.__precio
class Antibiotico: def __init__(self, nombre, tipoAnimal, dosis, precio): self.__nombre = nombre self.__tipoAnimal = tipoAnimal self.__dosis = dosis self.__precio = precio @property def nombre(self): return self.__nombre @property def tipo_animal(self): return self.__tipoAnimal @property def dosis(self): return self.__dosis @property def precio(self): return self.__precio
{ "targets": [ { "target_name": "unidecode", "sources": [ "src/addon.cxx" ], "include_dirs" : [ "<!(node -e \"require('nan')\")" ], "cflags": ["-g"], 'cflags_cc!': [ '-fno-exceptions' ], 'conditions': [ ['OS=="mac"', { 'xcode_settings': { 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES' } }] ] }, { "target_name": "action_after_build", "type": "none", "dependencies": [ "<(module_name)" ], "copies": [ { "files": [ "<(PRODUCT_DIR)/<(module_name).node" ], "destination": "<(module_path)" } ] } ] }
{'targets': [{'target_name': 'unidecode', 'sources': ['src/addon.cxx'], 'include_dirs': ['<!(node -e "require(\'nan\')")'], 'cflags': ['-g'], 'cflags_cc!': ['-fno-exceptions'], 'conditions': [['OS=="mac"', {'xcode_settings': {'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'}}]]}, {'target_name': 'action_after_build', 'type': 'none', 'dependencies': ['<(module_name)'], 'copies': [{'files': ['<(PRODUCT_DIR)/<(module_name).node'], 'destination': '<(module_path)'}]}]}
#!/usr/bin/python # not_kwd.py grades = ["A", "B", "C", "D", "E", "F"] grade = "L" if grade not in grades: print ("Unknown grade")
grades = ['A', 'B', 'C', 'D', 'E', 'F'] grade = 'L' if grade not in grades: print('Unknown grade')
def setup(bot): return DISCORD_EPOCH = 1420070400000 def ReadableTime(first, last): readTime = int(last-first) weeks = int(readTime/604800) days = int((readTime-(weeks*604800))/86400) hours = int((readTime-(days*86400 + weeks*604800))/3600) minutes = int((readTime-(hours*3600 + days*86400 + weeks*604800))/60) seconds = int(readTime-(minutes*60 + hours*3600 + days*86400 + weeks*604800)) msg = '' if weeks > 0: msg += '1 week, ' if weeks == 1 else '{:,} weeks, '.format(weeks) if weeks > 0: msg += "1 week, " if weeks == 1 else "{:,} weeks, ".format(weeks) if days > 0: msg += "1 day, " if days == 1 else "{:,} days, ".format(days) if hours > 0: msg += "1 hour, " if hours == 1 else "{:,} hours, ".format(hours) if minutes > 0: msg += "1 minute, " if minutes == 1 else "{:,} minutes, ".format(minutes) if seconds > 0: msg += "1 second, " if seconds == 1 else "{:,} seconds, ".format(seconds) if msg == "": return "0 seconds" else: return msg[:-2]
def setup(bot): return discord_epoch = 1420070400000 def readable_time(first, last): read_time = int(last - first) weeks = int(readTime / 604800) days = int((readTime - weeks * 604800) / 86400) hours = int((readTime - (days * 86400 + weeks * 604800)) / 3600) minutes = int((readTime - (hours * 3600 + days * 86400 + weeks * 604800)) / 60) seconds = int(readTime - (minutes * 60 + hours * 3600 + days * 86400 + weeks * 604800)) msg = '' if weeks > 0: msg += '1 week, ' if weeks == 1 else '{:,} weeks, '.format(weeks) if weeks > 0: msg += '1 week, ' if weeks == 1 else '{:,} weeks, '.format(weeks) if days > 0: msg += '1 day, ' if days == 1 else '{:,} days, '.format(days) if hours > 0: msg += '1 hour, ' if hours == 1 else '{:,} hours, '.format(hours) if minutes > 0: msg += '1 minute, ' if minutes == 1 else '{:,} minutes, '.format(minutes) if seconds > 0: msg += '1 second, ' if seconds == 1 else '{:,} seconds, '.format(seconds) if msg == '': return '0 seconds' else: return msg[:-2]
EXAMPLES1 = ( ('09-exemple1.txt', 15), ) EXAMPLES2 = ( ('09-exemple1.txt', 1134), ) INPUT = '09.txt' def read_data(fn): data = list() with open(fn) as f: for line in f: line = line.strip() data.append(line) return data def neighbours(data, i, j): neigh = ((i - 1, j), (i + 1, j), (i, j - 1), (i, j + 1)) return [x for x in neigh if 0 <= x[0] < len(data) and 0 <= x[1] < len(data[0])] def low_points(data): points = list() for i, line in enumerate(data): for j, c in enumerate(line): if all(data[i2][j2] > c for i2, j2 in neighbours(data, i, j)): points.append((i, j)) return points def code1(data): score = 0 for i, j in low_points(data): score += int(data[i][j]) + 1 return score def make_bassin(data, bassin, i, j): for i2, j2 in neighbours(data, i, j): if (i2, j2) in bassin or data[i2][j2] == '9': pass else: bassin.add((i2, j2)) bassin = make_bassin(data, bassin, i2, j2) return bassin def code2(data): size_bassins = list() for i, j in low_points(data): bassin = set() bassin.add((i, j)) bassin = make_bassin(data, bassin, i, j) size_bassins.append(len(bassin)) x, y, z = sorted(size_bassins, reverse=True)[:3] return x * y * z def test(n, code, examples, myinput): for fn, result in examples: data = read_data(fn) assert result is None or code(data) == result, (data, result, code(data)) print(f'{n}>', code(read_data(myinput))) test(1, code1, EXAMPLES1, INPUT) test(2, code2, EXAMPLES2, INPUT)
examples1 = (('09-exemple1.txt', 15),) examples2 = (('09-exemple1.txt', 1134),) input = '09.txt' def read_data(fn): data = list() with open(fn) as f: for line in f: line = line.strip() data.append(line) return data def neighbours(data, i, j): neigh = ((i - 1, j), (i + 1, j), (i, j - 1), (i, j + 1)) return [x for x in neigh if 0 <= x[0] < len(data) and 0 <= x[1] < len(data[0])] def low_points(data): points = list() for (i, line) in enumerate(data): for (j, c) in enumerate(line): if all((data[i2][j2] > c for (i2, j2) in neighbours(data, i, j))): points.append((i, j)) return points def code1(data): score = 0 for (i, j) in low_points(data): score += int(data[i][j]) + 1 return score def make_bassin(data, bassin, i, j): for (i2, j2) in neighbours(data, i, j): if (i2, j2) in bassin or data[i2][j2] == '9': pass else: bassin.add((i2, j2)) bassin = make_bassin(data, bassin, i2, j2) return bassin def code2(data): size_bassins = list() for (i, j) in low_points(data): bassin = set() bassin.add((i, j)) bassin = make_bassin(data, bassin, i, j) size_bassins.append(len(bassin)) (x, y, z) = sorted(size_bassins, reverse=True)[:3] return x * y * z def test(n, code, examples, myinput): for (fn, result) in examples: data = read_data(fn) assert result is None or code(data) == result, (data, result, code(data)) print(f'{n}>', code(read_data(myinput))) test(1, code1, EXAMPLES1, INPUT) test(2, code2, EXAMPLES2, INPUT)
# Selecting Indices # Explain in simple terms what idxmin and idxmax do in the short program below. # When would you use these methods? data = pd.read_csv('../../data/gapminder_gdp_europe.csv', index_col='country') print(data.idxmin()) print(data.idxmax())
data = pd.read_csv('../../data/gapminder_gdp_europe.csv', index_col='country') print(data.idxmin()) print(data.idxmax())
# status: testado com exemplos da prova if __name__ == '__main__': char = input() all_words = input().split() words = [word for word in all_words if char in word] print("{0:.1f}".format(len(words) / len(all_words) * 100))
if __name__ == '__main__': char = input() all_words = input().split() words = [word for word in all_words if char in word] print('{0:.1f}'.format(len(words) / len(all_words) * 100))
#! /usr/bin/env python model0.initialize() model1.initialize() time = model0.get_current_time() end_time = model0.get_end_time() while time < end_time: has_converged = False while has_converged is False: state1 = model1.get_value("some_state_variable") model0.set_value("some_state_variable", state1) model0.solve() state0 = model0.get_value("boundary_flows") model1.set_value("boundary_flows", state0) model1.solve() has_converged = check_convergence(model0, model1, convergence_criteria) model1.update() model0.update() time = model0.get_current_time()
model0.initialize() model1.initialize() time = model0.get_current_time() end_time = model0.get_end_time() while time < end_time: has_converged = False while has_converged is False: state1 = model1.get_value('some_state_variable') model0.set_value('some_state_variable', state1) model0.solve() state0 = model0.get_value('boundary_flows') model1.set_value('boundary_flows', state0) model1.solve() has_converged = check_convergence(model0, model1, convergence_criteria) model1.update() model0.update() time = model0.get_current_time()
class LinkedListNode: def __init__(self, data): self.data = data self.next = None class Stack: def __init__(self): self.num_elements = 0 self.head = None def push(self, data): new_node = LinkedListNode(data) if self.head is None: self.head = new_node else: new_node.next = self.head self.head = new_node self.num_elements += 1 def pop(self): if self.is_empty(): return None temp = self.head.data self.head = self.head.next self.num_elements -= 1 return temp def top(self): if self.head is None: return None return self.head.data def size(self): return self.num_elements def is_empty(self): return self.num_elements == 0 def evaluate_post_fix(input_list): stack = Stack() for element in input_list: if element == '*': second = stack.pop() first = stack.pop() output = first * second stack.push(output) elif element == '/': second = stack.pop() first = stack.pop() output = int(first / second) stack.push(output) elif element == '+': second = stack.pop() first = stack.pop() output = first + second stack.push(output) elif element == '-': second = stack.pop() first = stack.pop() output = first - second stack.push(output) else: stack.push(int(element)) return stack.pop() def test_function(test_case): output = evaluate_post_fix(test_case[0]) print(output) if output == test_case[1]: print("Pass") else: print("Fail") test_case_1 = [["3", "1", "+", "4", "*"], 16] test_function(test_case_1) test_case_2 = [["4", "13", "5", "/", "+"], 6] test_function(test_case_2) test_case_3 = [["10", "6", "9", "3", "+", "-11", "*", "/", "*", "17", "+", "5", "+"], 22] test_function(test_case_3)
class Linkedlistnode: def __init__(self, data): self.data = data self.next = None class Stack: def __init__(self): self.num_elements = 0 self.head = None def push(self, data): new_node = linked_list_node(data) if self.head is None: self.head = new_node else: new_node.next = self.head self.head = new_node self.num_elements += 1 def pop(self): if self.is_empty(): return None temp = self.head.data self.head = self.head.next self.num_elements -= 1 return temp def top(self): if self.head is None: return None return self.head.data def size(self): return self.num_elements def is_empty(self): return self.num_elements == 0 def evaluate_post_fix(input_list): stack = stack() for element in input_list: if element == '*': second = stack.pop() first = stack.pop() output = first * second stack.push(output) elif element == '/': second = stack.pop() first = stack.pop() output = int(first / second) stack.push(output) elif element == '+': second = stack.pop() first = stack.pop() output = first + second stack.push(output) elif element == '-': second = stack.pop() first = stack.pop() output = first - second stack.push(output) else: stack.push(int(element)) return stack.pop() def test_function(test_case): output = evaluate_post_fix(test_case[0]) print(output) if output == test_case[1]: print('Pass') else: print('Fail') test_case_1 = [['3', '1', '+', '4', '*'], 16] test_function(test_case_1) test_case_2 = [['4', '13', '5', '/', '+'], 6] test_function(test_case_2) test_case_3 = [['10', '6', '9', '3', '+', '-11', '*', '/', '*', '17', '+', '5', '+'], 22] test_function(test_case_3)
# Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. # Example 1: # Input: "Hello" # Output: "hello" # Example 2: # Input: "here" # Output: "here" # Example 3: # Input: "LOVELY" # Output: "lovely" class Solution: def toLowerCase(self, str: str) -> str: for i in range (0, len(str)): asc = ord(str[i]) if 65 <= asc <= 90: str = str[:i] + chr(asc + 32) + str[i + 1 :] return str
class Solution: def to_lower_case(self, str: str) -> str: for i in range(0, len(str)): asc = ord(str[i]) if 65 <= asc <= 90: str = str[:i] + chr(asc + 32) + str[i + 1:] return str
class Graph(object): def __init__(self,*args,**kwargs): self.node_neighbors = {} # Define vertex and adjacent vertex set as dictionary structure self.visited = {} # Define the visited vertex set as a dictionary structure def add_nodes(self,nodelist): for node in nodelist: self.add_node(node) def add_node(self,node): if not node in self.nodes(): self.node_neighbors[node] = [] def add_edge(self,edge): u,v = edge if(v not in self.node_neighbors[u]) and ( u not in self.node_neighbors[v]): # Here you can add your own side pointing to yourself self.node_neighbors[u].append(v) if(u!=v): self.node_neighbors[v].append(u) def nodes(self): return self.node_neighbors.keys() def breadth_first_search(self,root=None): # Breadth first requires the queue structure queue = [] order = [] def bfs(): while len(queue)> 0: node = queue.pop(0) self.visited[node] = True self.node_neighbors[node].sort() for n in self.node_neighbors[node]: if (not n in self.visited) and (not n in queue): queue.append(n) order.append(n) if root: queue.append(root) order.append(root) bfs() for node in self.nodes(): if not node in self.visited: queue.append(node) order.append(node) bfs() # print(order) return order def bfs(graph, S, D): queue = [(S, [S])] while queue: (vertex, path) = queue.pop(0) for next in graph[vertex] - set(path): if next == D: yield path + [next] else: queue.append((next, path + [next])) def shortest(graph, S, D): try: return next(bfs(graph, S, D)) except StopIteration: return None if __name__ == '__main__': g = Graph() n = int(input()) g.add_nodes([i+1 for i in range( n )]) for i in range( n - 1 ): g.add_edge(tuple(input().split())) print(g.node_neighbors) # print(shortest(g, '1', '5'))
class Graph(object): def __init__(self, *args, **kwargs): self.node_neighbors = {} self.visited = {} def add_nodes(self, nodelist): for node in nodelist: self.add_node(node) def add_node(self, node): if not node in self.nodes(): self.node_neighbors[node] = [] def add_edge(self, edge): (u, v) = edge if v not in self.node_neighbors[u] and u not in self.node_neighbors[v]: self.node_neighbors[u].append(v) if u != v: self.node_neighbors[v].append(u) def nodes(self): return self.node_neighbors.keys() def breadth_first_search(self, root=None): queue = [] order = [] def bfs(): while len(queue) > 0: node = queue.pop(0) self.visited[node] = True self.node_neighbors[node].sort() for n in self.node_neighbors[node]: if not n in self.visited and (not n in queue): queue.append(n) order.append(n) if root: queue.append(root) order.append(root) bfs() for node in self.nodes(): if not node in self.visited: queue.append(node) order.append(node) bfs() return order def bfs(graph, S, D): queue = [(S, [S])] while queue: (vertex, path) = queue.pop(0) for next in graph[vertex] - set(path): if next == D: yield (path + [next]) else: queue.append((next, path + [next])) def shortest(graph, S, D): try: return next(bfs(graph, S, D)) except StopIteration: return None if __name__ == '__main__': g = graph() n = int(input()) g.add_nodes([i + 1 for i in range(n)]) for i in range(n - 1): g.add_edge(tuple(input().split())) print(g.node_neighbors)
# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. { 'includes': [ 'common_settings.gypi', ], 'targets': [ # Auto test - command line test for all platforms { 'target_name': 'voe_auto_test', 'type': 'executable', 'dependencies': [ 'voice_engine/main/source/voice_engine_core.gyp:voice_engine_core', 'system_wrappers/source/system_wrappers.gyp:system_wrappers', ], 'include_dirs': [ 'voice_engine/main/test/auto_test', ], 'sources': [ 'voice_engine/main/test/auto_test/voe_cpu_test.cc', 'voice_engine/main/test/auto_test/voe_cpu_test.h', 'voice_engine/main/test/auto_test/voe_extended_test.cc', 'voice_engine/main/test/auto_test/voe_extended_test.h', 'voice_engine/main/test/auto_test/voe_standard_test.cc', 'voice_engine/main/test/auto_test/voe_standard_test.h', 'voice_engine/main/test/auto_test/voe_stress_test.cc', 'voice_engine/main/test/auto_test/voe_stress_test.h', 'voice_engine/main/test/auto_test/voe_test_defines.h', 'voice_engine/main/test/auto_test/voe_test_interface.h', 'voice_engine/main/test/auto_test/voe_unit_test.cc', 'voice_engine/main/test/auto_test/voe_unit_test.h', ], 'conditions': [ ['OS=="linux" or OS=="mac"', { 'actions': [ { 'action_name': 'copy audio file', 'inputs': [ 'voice_engine/main/test/auto_test/audio_long16.pcm', ], 'outputs': [ '/tmp/audio_long16.pcm', ], 'action': [ '/bin/sh', '-c', 'cp -f voice_engine/main/test/auto_test/audio_* /tmp/;'\ 'cp -f voice_engine/main/test/auto_test/audio_short16.pcm /tmp/;', ], }, ], }], ['OS=="win"', { 'dependencies': [ 'voice_engine.gyp:voe_ui_win_test', ], }], ['OS=="win"', { 'actions': [ { 'action_name': 'copy audio file', 'inputs': [ 'voice_engine/main/test/auto_test/audio_long16.pcm', ], 'outputs': [ '/tmp/audio_long16.pcm', ], 'action': [ 'cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\auto_test\\audio_* \\tmp', ], }, { 'action_name': 'copy audio audio_short16.pcm', 'inputs': [ 'voice_engine/main/test/auto_test/audio_short16.pcm', ], 'outputs': [ '/tmp/audio_short16.pcm', ], 'action': [ 'cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\auto_test\\audio_short16.pcm \\tmp', ], }, ], }], ], }, { # command line test that should work on linux/mac/win 'target_name': 'voe_cmd_test', 'type': 'executable', 'dependencies': [ 'voice_engine/main/source/voice_engine_core.gyp:voice_engine_core', 'system_wrappers/source/system_wrappers.gyp:system_wrappers', ], 'sources': [ 'voice_engine/main/test/cmd_test/voe_cmd_test.cc', ], }, ], 'conditions': [ ['OS=="win"', { 'targets': [ # WinTest - GUI test for Windows { 'target_name': 'voe_ui_win_test', 'type': 'executable', 'dependencies': [ 'voice_engine/main/source/voice_engine_core.gyp:voice_engine_core', 'system_wrappers/source/system_wrappers.gyp:system_wrappers', ], 'include_dirs': [ 'voice_engine/main/test/win_test', ], 'sources': [ 'voice_engine/main/test/win_test/Resource.h', 'voice_engine/main/test/win_test/WinTest.cpp', 'voice_engine/main/test/win_test/WinTest.h', 'voice_engine/main/test/win_test/WinTest.rc', 'voice_engine/main/test/win_test/WinTestDlg.cpp', 'voice_engine/main/test/win_test/WinTestDlg.h', 'voice_engine/main/test/win_test/res/WinTest.ico', 'voice_engine/main/test/win_test/res/WinTest.rc2', 'voice_engine/main/test/win_test/stdafx.cpp', 'voice_engine/main/test/win_test/stdafx.h', ], 'actions': [ { 'action_name': 'copy audio file', 'inputs': [ 'voice_engine/main/test/win_test/audio_tiny11.wav', ], 'outputs': [ '/tmp/audio_tiny11.wav', ], 'action': [ 'cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\win_test\\audio_* \\tmp', ], }, { 'action_name': 'copy audio audio_short16.pcm', 'inputs': [ 'voice_engine/main/test/win_test/audio_short16.pcm', ], 'outputs': [ '/tmp/audio_short16.pcm', ], 'action': [ 'cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\win_test\\audio_short16.pcm \\tmp', ], }, { 'action_name': 'copy audio_long16noise.pcm', 'inputs': [ 'voice_engine/main/test/win_test/audio_long16noise.pcm', ], 'outputs': [ '/tmp/audio_long16noise.pcm', ], 'action': [ 'cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\win_test\\audio_long16noise.pcm \\tmp', ], }, ], 'configurations': { 'Common_Base': { 'msvs_configuration_attributes': { 'conditions': [ ['component=="shared_library"', { 'UseOfMFC': '2', # Shared DLL },{ 'UseOfMFC': '1', # Static }], ], }, }, }, 'msvs_settings': { 'VCLinkerTool': { 'SubSystem': '2', # Windows }, }, }, ], }], ], } # Local Variables: # tab-width:2 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=2 shiftwidth=2:
{'includes': ['common_settings.gypi'], 'targets': [{'target_name': 'voe_auto_test', 'type': 'executable', 'dependencies': ['voice_engine/main/source/voice_engine_core.gyp:voice_engine_core', 'system_wrappers/source/system_wrappers.gyp:system_wrappers'], 'include_dirs': ['voice_engine/main/test/auto_test'], 'sources': ['voice_engine/main/test/auto_test/voe_cpu_test.cc', 'voice_engine/main/test/auto_test/voe_cpu_test.h', 'voice_engine/main/test/auto_test/voe_extended_test.cc', 'voice_engine/main/test/auto_test/voe_extended_test.h', 'voice_engine/main/test/auto_test/voe_standard_test.cc', 'voice_engine/main/test/auto_test/voe_standard_test.h', 'voice_engine/main/test/auto_test/voe_stress_test.cc', 'voice_engine/main/test/auto_test/voe_stress_test.h', 'voice_engine/main/test/auto_test/voe_test_defines.h', 'voice_engine/main/test/auto_test/voe_test_interface.h', 'voice_engine/main/test/auto_test/voe_unit_test.cc', 'voice_engine/main/test/auto_test/voe_unit_test.h'], 'conditions': [['OS=="linux" or OS=="mac"', {'actions': [{'action_name': 'copy audio file', 'inputs': ['voice_engine/main/test/auto_test/audio_long16.pcm'], 'outputs': ['/tmp/audio_long16.pcm'], 'action': ['/bin/sh', '-c', 'cp -f voice_engine/main/test/auto_test/audio_* /tmp/;cp -f voice_engine/main/test/auto_test/audio_short16.pcm /tmp/;']}]}], ['OS=="win"', {'dependencies': ['voice_engine.gyp:voe_ui_win_test']}], ['OS=="win"', {'actions': [{'action_name': 'copy audio file', 'inputs': ['voice_engine/main/test/auto_test/audio_long16.pcm'], 'outputs': ['/tmp/audio_long16.pcm'], 'action': ['cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\auto_test\\audio_* \\tmp']}, {'action_name': 'copy audio audio_short16.pcm', 'inputs': ['voice_engine/main/test/auto_test/audio_short16.pcm'], 'outputs': ['/tmp/audio_short16.pcm'], 'action': ['cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\auto_test\\audio_short16.pcm \\tmp']}]}]]}, {'target_name': 'voe_cmd_test', 'type': 'executable', 'dependencies': ['voice_engine/main/source/voice_engine_core.gyp:voice_engine_core', 'system_wrappers/source/system_wrappers.gyp:system_wrappers'], 'sources': ['voice_engine/main/test/cmd_test/voe_cmd_test.cc']}], 'conditions': [['OS=="win"', {'targets': [{'target_name': 'voe_ui_win_test', 'type': 'executable', 'dependencies': ['voice_engine/main/source/voice_engine_core.gyp:voice_engine_core', 'system_wrappers/source/system_wrappers.gyp:system_wrappers'], 'include_dirs': ['voice_engine/main/test/win_test'], 'sources': ['voice_engine/main/test/win_test/Resource.h', 'voice_engine/main/test/win_test/WinTest.cpp', 'voice_engine/main/test/win_test/WinTest.h', 'voice_engine/main/test/win_test/WinTest.rc', 'voice_engine/main/test/win_test/WinTestDlg.cpp', 'voice_engine/main/test/win_test/WinTestDlg.h', 'voice_engine/main/test/win_test/res/WinTest.ico', 'voice_engine/main/test/win_test/res/WinTest.rc2', 'voice_engine/main/test/win_test/stdafx.cpp', 'voice_engine/main/test/win_test/stdafx.h'], 'actions': [{'action_name': 'copy audio file', 'inputs': ['voice_engine/main/test/win_test/audio_tiny11.wav'], 'outputs': ['/tmp/audio_tiny11.wav'], 'action': ['cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\win_test\\audio_* \\tmp']}, {'action_name': 'copy audio audio_short16.pcm', 'inputs': ['voice_engine/main/test/win_test/audio_short16.pcm'], 'outputs': ['/tmp/audio_short16.pcm'], 'action': ['cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\win_test\\audio_short16.pcm \\tmp']}, {'action_name': 'copy audio_long16noise.pcm', 'inputs': ['voice_engine/main/test/win_test/audio_long16noise.pcm'], 'outputs': ['/tmp/audio_long16noise.pcm'], 'action': ['cmd', '/c', 'xcopy /Y /R .\\voice_engine\\main\\test\\win_test\\audio_long16noise.pcm \\tmp']}], 'configurations': {'Common_Base': {'msvs_configuration_attributes': {'conditions': [['component=="shared_library"', {'UseOfMFC': '2'}, {'UseOfMFC': '1'}]]}}}, 'msvs_settings': {'VCLinkerTool': {'SubSystem': '2'}}}]}]]}
sample_rate=16000 #Provided in the paper n_mels = 80 frame_rate = 80 #Provided in the paper frame_length = 0.05 hop_length = int(sample_rate/frame_rate) win_length = int(sample_rate*frame_length) scaling_factor = 4 min_db_level = -100 bce_weights = 7 embed_dims = 512 hidden_dims = 256 heads = 4 forward_expansion = 4 num_layers = 4 dropout = 0.15 max_len = 1024 pad_idx = 0 Metadata = 'input/LJSpeech-1.1/metadata.csv' Audio_file_path = 'input/LJSpeech-1.1/wavs/' Model_Path = 'model/model.bin' checkpoint = 'model/checkpoint.bin' Batch_Size = 2 Epochs = 40 LR = 3e-4 warmup_steps = 0.2
sample_rate = 16000 n_mels = 80 frame_rate = 80 frame_length = 0.05 hop_length = int(sample_rate / frame_rate) win_length = int(sample_rate * frame_length) scaling_factor = 4 min_db_level = -100 bce_weights = 7 embed_dims = 512 hidden_dims = 256 heads = 4 forward_expansion = 4 num_layers = 4 dropout = 0.15 max_len = 1024 pad_idx = 0 metadata = 'input/LJSpeech-1.1/metadata.csv' audio_file_path = 'input/LJSpeech-1.1/wavs/' model__path = 'model/model.bin' checkpoint = 'model/checkpoint.bin' batch__size = 2 epochs = 40 lr = 0.0003 warmup_steps = 0.2
class node: def __init__(self, x): self.value = x self.next = None class LinkedList: def __init__(self, y): self.head = node(y)
class Node: def __init__(self, x): self.value = x self.next = None class Linkedlist: def __init__(self, y): self.head = node(y)
class Message(object): def __init__(self, args, kwargs=None, start_timestamp=None): ''' The Nomad Message type which is passed around clients. :param args: list of args for the next operator :type args: list :param kwargs: dict of kwargs for the next operator :type kwargs: dict ''' # if not isinstance(args, list): # args = [args] self.args = args if kwargs is None: self.kwargs = {} else: self.kwargs = kwargs self.start_timestamp = start_timestamp def get_args(self): return self.args def __str__(self): return str(self.args) + "_" + str(self.start_timestamp)
class Message(object): def __init__(self, args, kwargs=None, start_timestamp=None): """ The Nomad Message type which is passed around clients. :param args: list of args for the next operator :type args: list :param kwargs: dict of kwargs for the next operator :type kwargs: dict """ self.args = args if kwargs is None: self.kwargs = {} else: self.kwargs = kwargs self.start_timestamp = start_timestamp def get_args(self): return self.args def __str__(self): return str(self.args) + '_' + str(self.start_timestamp)
def subwaysFilter(dimension): def _filter(poi): if poi["id"] == "subways/" + dimension: return poi return _filter
def subways_filter(dimension): def _filter(poi): if poi['id'] == 'subways/' + dimension: return poi return _filter
''' TOTAL PATHS FROM (0, 0) to (m, n) The task is to calculate total possible moves we can make to reach (m, n) in a matrix, starting from origin, given that we can only take 1 step towards right or up in a single move. ''' def totalPaths(m, n): total = [] for i in range(0, m): temp = [] for j in range(0, n): temp.append(0) total.append(temp) for i in range(0, max(m, n)): if i < m: total[i][0] = 1 if i < n: total[0][i] = 1 for i in range(1, m): for j in range(1, n): total[i][j] = total[i - 1][j] + total[i][j - 1] return total[m-1][n-1] m = int(input()) n = int(input()) print("The total paths are", totalPaths(m, n)) ''' INPUT : n = 6 m = 5 OUTPUT : The total paths are 126 '''
""" TOTAL PATHS FROM (0, 0) to (m, n) The task is to calculate total possible moves we can make to reach (m, n) in a matrix, starting from origin, given that we can only take 1 step towards right or up in a single move. """ def total_paths(m, n): total = [] for i in range(0, m): temp = [] for j in range(0, n): temp.append(0) total.append(temp) for i in range(0, max(m, n)): if i < m: total[i][0] = 1 if i < n: total[0][i] = 1 for i in range(1, m): for j in range(1, n): total[i][j] = total[i - 1][j] + total[i][j - 1] return total[m - 1][n - 1] m = int(input()) n = int(input()) print('The total paths are', total_paths(m, n)) '\nINPUT :\nn = 6\nm = 5\nOUTPUT :\nThe total paths are 126\n'
with open("mystery.png", "rb") as f: buf1 = f.read()[-0x10:] with open("mystery2.png", "rb") as f: buf2 = f.read()[-2:] with open("mystery3.png", "rb") as f: buf3 = f.read()[-8:] flag = [0 for i in range(0x1a)] flag[1] = buf3[0] flag[0] = buf2[0] - ((0x2a + (0x2a >> 7)) >> 1) flag[2] = buf3[1] flag[4] = buf1[0] flag[5] = buf3[2] for i in range(4): flag[6 + i] = buf1[1 + i] flag[3] = buf2[1] - 4 for i in range(5): flag[0x0a + i] = buf3[3 + i] for i in range(0xf, 0x1a): flag[i] = buf1[1 + 4 + i - 0xf] for c in flag: print(chr(c), end="")
with open('mystery.png', 'rb') as f: buf1 = f.read()[-16:] with open('mystery2.png', 'rb') as f: buf2 = f.read()[-2:] with open('mystery3.png', 'rb') as f: buf3 = f.read()[-8:] flag = [0 for i in range(26)] flag[1] = buf3[0] flag[0] = buf2[0] - (42 + (42 >> 7) >> 1) flag[2] = buf3[1] flag[4] = buf1[0] flag[5] = buf3[2] for i in range(4): flag[6 + i] = buf1[1 + i] flag[3] = buf2[1] - 4 for i in range(5): flag[10 + i] = buf3[3 + i] for i in range(15, 26): flag[i] = buf1[1 + 4 + i - 15] for c in flag: print(chr(c), end='')
# Input exmaple and variable value assignment print('Yo nerd, waddup?') print('Tell me your name:') myName = input() # Assigns whatever you type to the myName variable print('Nice to meet you, ' + myName + '!') # Print text with a variable name print('Your name consists of this many characters: ') print(len(myName)) # len() counts the characters in the myName variable print('Now then, tell me your age in years: ') myAge = input() # A stupid dad-joke to show how arithmetic works. # Note the int() - This makes sure you can calculate a value # The calculation takes place inside a str() # - since we are trying to print a string, it should be a str() print("Well, " + myName + "... You will be " + str(int(myAge) + 1) + " in a year.." )
print('Yo nerd, waddup?') print('Tell me your name:') my_name = input() print('Nice to meet you, ' + myName + '!') print('Your name consists of this many characters: ') print(len(myName)) print('Now then, tell me your age in years: ') my_age = input() print('Well, ' + myName + '... You will be ' + str(int(myAge) + 1) + ' in a year..')
class Solution: def isRectangleCover(self, rectangles: List[List[int]]) -> bool: points={} for r in rectangles: vs=[tuple(r[:2]), (r[2],r[1]), tuple(r[2:]), (r[0],r[3])] for i in range(len(vs)): v=vs[i] if v not in points: points[v]=[False]*4 if points[v][i]: return False points[v][i]=True singleDirection=0 for k,v in points.items(): quadrant=sum(x for x in v if x==True) if quadrant==1: singleDirection+=1 elif quadrant==2 and v[0]==v[2]: return False elif quadrant==3: return False if singleDirection==4: return True return False
class Solution: def is_rectangle_cover(self, rectangles: List[List[int]]) -> bool: points = {} for r in rectangles: vs = [tuple(r[:2]), (r[2], r[1]), tuple(r[2:]), (r[0], r[3])] for i in range(len(vs)): v = vs[i] if v not in points: points[v] = [False] * 4 if points[v][i]: return False points[v][i] = True single_direction = 0 for (k, v) in points.items(): quadrant = sum((x for x in v if x == True)) if quadrant == 1: single_direction += 1 elif quadrant == 2 and v[0] == v[2]: return False elif quadrant == 3: return False if singleDirection == 4: return True return False
aUser = input("Please enter the first integer: ") bUser = input("Please enter the second integer: ") cUser = input("Please enter the third integer: ") # Compare Inputs def compareInput(aUser, bUser, cUser): aUser = integerCheck(aUser) bUser = integerCheck(bUser) cUser = integerCheck(cUser) if aUser >= bUser and bUser >= cUser: inputSorted = str(cUser) + " " + str(bUser) + " " + str(aUser) elif aUser >= cUser and cUser >= bUser: inputSorted = str(bUser) + " " + str(cUser) + " " + str(aUser) elif bUser >= aUser and aUser >= cUser: inputSorted = str(cUser) + " " + str(aUser) + " " + str(bUser) elif bUser >= cUser and cUser >= aUser: inputSorted = str(aUser) + " " + str(cUser) + " " + str(bUser) elif cUser >= bUser and bUser >= aUser: inputSorted = str(aUser) + " " + str(bUser) + " " + str(cUser) elif cUser >= aUser and aUser >= bUser: inputSorted = str(bUser) + " " + str(aUser) + " " + str(cUser) return inputSorted # Error Check def integerCheck(value): try: return int(value) except Exception: print("Please input a valid Integer!") quit() def printResults(inputSorted): print("Input three integer numbers in ascending order:\n" + inputSorted) inputSorted = compareInput(aUser, bUser, cUser) printResults(inputSorted)
a_user = input('Please enter the first integer: ') b_user = input('Please enter the second integer: ') c_user = input('Please enter the third integer: ') def compare_input(aUser, bUser, cUser): a_user = integer_check(aUser) b_user = integer_check(bUser) c_user = integer_check(cUser) if aUser >= bUser and bUser >= cUser: input_sorted = str(cUser) + ' ' + str(bUser) + ' ' + str(aUser) elif aUser >= cUser and cUser >= bUser: input_sorted = str(bUser) + ' ' + str(cUser) + ' ' + str(aUser) elif bUser >= aUser and aUser >= cUser: input_sorted = str(cUser) + ' ' + str(aUser) + ' ' + str(bUser) elif bUser >= cUser and cUser >= aUser: input_sorted = str(aUser) + ' ' + str(cUser) + ' ' + str(bUser) elif cUser >= bUser and bUser >= aUser: input_sorted = str(aUser) + ' ' + str(bUser) + ' ' + str(cUser) elif cUser >= aUser and aUser >= bUser: input_sorted = str(bUser) + ' ' + str(aUser) + ' ' + str(cUser) return inputSorted def integer_check(value): try: return int(value) except Exception: print('Please input a valid Integer!') quit() def print_results(inputSorted): print('Input three integer numbers in ascending order:\n' + inputSorted) input_sorted = compare_input(aUser, bUser, cUser) print_results(inputSorted)
class MgraphConnectoSiteMixin: def get_root_site(self): return self.get('/sites/root') def get_site(self, site_id): return self.get(f'/sites/{site_id}') def get_site_drive(self, site_id): return self.get(f'/sites/{site_id}/drive') def get_site_drives(self, site_id): res = self.get(f'/sites/{site_id}/drives') if 'value' in res: return res['value'] return [] def search_sites(self, site_name): res = self.get(f'/sites?search={site_name}') if 'value' in res: return res['value'] return [] def get_subsites(self, site_id): return self.get(f'/sites/{site_id}/sites') def walk_sites(self, site=None): # FIXME make this a generator if site is None: site = self.get_root_site() self.sites = {} self.sites[site['id']] = site subsites = self.get_subsites(site['id']) # jdump(subsites, caller=__file__) if 'value' in subsites: for subsite in subsites['value']: self.sites[subsite['id']] = subsite self.walk_sites(site=subsite) return self.sites
class Mgraphconnectositemixin: def get_root_site(self): return self.get('/sites/root') def get_site(self, site_id): return self.get(f'/sites/{site_id}') def get_site_drive(self, site_id): return self.get(f'/sites/{site_id}/drive') def get_site_drives(self, site_id): res = self.get(f'/sites/{site_id}/drives') if 'value' in res: return res['value'] return [] def search_sites(self, site_name): res = self.get(f'/sites?search={site_name}') if 'value' in res: return res['value'] return [] def get_subsites(self, site_id): return self.get(f'/sites/{site_id}/sites') def walk_sites(self, site=None): if site is None: site = self.get_root_site() self.sites = {} self.sites[site['id']] = site subsites = self.get_subsites(site['id']) if 'value' in subsites: for subsite in subsites['value']: self.sites[subsite['id']] = subsite self.walk_sites(site=subsite) return self.sites
game = { 'columns': 8, 'rows': 8, 'fps': 30, 'countdown': 5, 'interval': 800, 'score_increment': 1, 'level_increment': 8, 'interval_increment': 50 }
game = {'columns': 8, 'rows': 8, 'fps': 30, 'countdown': 5, 'interval': 800, 'score_increment': 1, 'level_increment': 8, 'interval_increment': 50}
''' Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order. Follow up: Your algorithm should run in linear runtime complexity. Could you implement it using only constant space complexity? Example: Input: nums = [1,2,1,3,2,5] Output: [3,5] Explanation: [5, 3] is also a valid answer. Example: Input: nums = [-1,0] Output: [-1,0] Example: Input: nums = [0,1] Output: [1,0] Constraints: - 2 <= nums.length <= 3 * 10^4 - -2^31 <= nums[i] <= 2^31 - 1 - Each integer in nums will appear twice, only two integers will appear once. ''' #Difficulty: Medium #32 / 32 test cases passed. #Runtime: 56 ms #Memory Usage: 16.2 MB #Runtime: 56 ms, faster than 82.01% of Python3 online submissions for Single Number III. #Memory Usage: 16.2 MB, less than 21.37% of Python3 online submissions for Single Number III. class Solution: def singleNumber(self, nums: List[int]) -> List[int]: single = set() for num in nums: if num not in single: single.add(num) else: single.remove(num) return single
""" Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order. Follow up: Your algorithm should run in linear runtime complexity. Could you implement it using only constant space complexity? Example: Input: nums = [1,2,1,3,2,5] Output: [3,5] Explanation: [5, 3] is also a valid answer. Example: Input: nums = [-1,0] Output: [-1,0] Example: Input: nums = [0,1] Output: [1,0] Constraints: - 2 <= nums.length <= 3 * 10^4 - -2^31 <= nums[i] <= 2^31 - 1 - Each integer in nums will appear twice, only two integers will appear once. """ class Solution: def single_number(self, nums: List[int]) -> List[int]: single = set() for num in nums: if num not in single: single.add(num) else: single.remove(num) return single
# Write a method to replace all spaces in a string s with '%20'. # You my assume that the string has sufficient space at the end to hold # the additional characters, and that you are given the "true" # length of the string. # Naive Solution (In this case the less beautiful solution) # Runtime O(n) def naiveURLify(s): outputString = "" for character in s: if character == " ": outputString += "%20" else: outputString += character return outputString # Efficient # Runtime O(n) def efficientUrlify(s): return s.replace(" ", "%20") inputString = "Hello world! How are we doing?" print(naiveURLify(inputString)) print(efficientUrlify(inputString))
def naive_ur_lify(s): output_string = '' for character in s: if character == ' ': output_string += '%20' else: output_string += character return outputString def efficient_urlify(s): return s.replace(' ', '%20') input_string = 'Hello world! How are we doing?' print(naive_ur_lify(inputString)) print(efficient_urlify(inputString))
StampManifestProvider = provider(fields = ["stamp_enabled"]) def _impl(ctx): return StampManifestProvider(stamp_enabled = ctx.build_setting_value) stamp_manifest = rule( implementation = _impl, build_setting = config.bool(flag = True), )
stamp_manifest_provider = provider(fields=['stamp_enabled']) def _impl(ctx): return stamp_manifest_provider(stamp_enabled=ctx.build_setting_value) stamp_manifest = rule(implementation=_impl, build_setting=config.bool(flag=True))
# -*- coding: utf-8 -*- # ------------- Comparaciones ------------- print (7 < 5) # Falso print (7 > 5) # Verdadero print ((11 * 3) + 2 == 36 - 1) # Verdadero print ((11 * 3) + 2 >= 36) # Falso print ("curso" != "CuRsO") # Verdadero print (5 and 4) #Operacion en binario print (5 or 4) print (not(4 > 3)) print (True) print (False)
print(7 < 5) print(7 > 5) print(11 * 3 + 2 == 36 - 1) print(11 * 3 + 2 >= 36) print('curso' != 'CuRsO') print(5 and 4) print(5 or 4) print(not 4 > 3) print(True) print(False)
# -*- coding: utf-8 -*- # Hpo terms represents data from the hpo web hpo_term = dict( _id = str, # Same as hpo_id hpo_id = str, # Required aliases = list, # List of aliases description = str, genes = list, # List with integers that are hgnc_ids ) # Disease terms represent diseases collected from omim, orphanet and decipher. # Collected from OMIM disease_term = dict( _id = str, # Same as disease_id disease_id = str, # required, like OMIM:600233 disase_nr = int, # The disease nr description = str, # required source = str, # required genes = list, # List with integers that are hgnc_ids ) # phenotype_term is a special object to hold information on case level # This one might be deprecated when we skip mongoengine phenotype_term = dict( phenotype_id = str, # Can be omim_id hpo_id feature = str, disease_models = list, # list of strings )
hpo_term = dict(_id=str, hpo_id=str, aliases=list, description=str, genes=list) disease_term = dict(_id=str, disease_id=str, disase_nr=int, description=str, source=str, genes=list) phenotype_term = dict(phenotype_id=str, feature=str, disease_models=list)
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-instance-attributes class OCEnv(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' container_path = {"pod": "spec.containers[0].env", "dc": "spec.template.spec.containers[0].env", "rc": "spec.template.spec.containers[0].env", } # pylint allows 5. we need 6 # pylint: disable=too-many-arguments def __init__(self, namespace, kind, env_vars, resource_name=None, kubeconfig='/etc/origin/master/admin.kubeconfig', verbose=False): ''' Constructor for OpenshiftOC ''' super(OCEnv, self).__init__(namespace, kubeconfig=kubeconfig, verbose=verbose) self.kind = kind self.name = resource_name self.env_vars = env_vars self._resource = None @property def resource(self): ''' property function for resource var''' if not self._resource: self.get() return self._resource @resource.setter def resource(self, data): ''' setter function for resource var''' self._resource = data def key_value_exists(self, key, value): ''' return whether a key, value pair exists ''' return self.resource.exists_env_value(key, value) def key_exists(self, key): ''' return whether a key exists ''' return self.resource.exists_env_key(key) def get(self): '''return environment variables ''' result = self._get(self.kind, self.name) if result['returncode'] == 0: if self.kind == 'dc': self.resource = DeploymentConfig(content=result['results'][0]) result['results'] = self.resource.get(OCEnv.container_path[self.kind]) or [] return result def delete(self): ''' delete environment variables ''' if self.resource.delete_env_var(self.env_vars.keys()): return self._replace_content(self.kind, self.name, self.resource.yaml_dict) return {'returncode': 0, 'changed': False} def put(self): '''place env vars into dc ''' for update_key, update_value in self.env_vars.items(): self.resource.update_env_var(update_key, update_value) return self._replace_content(self.kind, self.name, self.resource.yaml_dict) # pylint: disable=too-many-return-statements @staticmethod def run_ansible(params, check_mode): '''run the oc_env module''' ocenv = OCEnv(params['namespace'], params['kind'], params['env_vars'], resource_name=params['name'], kubeconfig=params['kubeconfig'], verbose=params['debug']) state = params['state'] api_rval = ocenv.get() ##### # Get ##### if state == 'list': return {'changed': False, 'results': api_rval['results'], 'state': "list"} ######## # Delete ######## if state == 'absent': for key in params.get('env_vars', {}).keys(): if ocenv.resource.exists_env_key(key): if check_mode: return {'changed': False, 'msg': 'CHECK_MODE: Would have performed a delete.'} api_rval = ocenv.delete() return {'changed': True, 'state': 'absent'} return {'changed': False, 'state': 'absent'} if state == 'present': ######## # Create ######## for key, value in params.get('env_vars', {}).items(): if not ocenv.key_value_exists(key, value): if check_mode: return {'changed': False, 'msg': 'CHECK_MODE: Would have performed a create.'} # Create it here api_rval = ocenv.put() if api_rval['returncode'] != 0: return {'failed': True, 'msg': api_rval} # return the created object api_rval = ocenv.get() if api_rval['returncode'] != 0: return {'failed': True, 'msg': api_rval} return {'changed': True, 'results': api_rval['results'], 'state': 'present'} return {'changed': False, 'results': api_rval['results'], 'state': 'present'} return {'failed': True, 'changed': False, 'msg': 'Unknown state passed. %s' % state}
class Ocenv(OpenShiftCLI): """ Class to wrap the oc command line tools """ container_path = {'pod': 'spec.containers[0].env', 'dc': 'spec.template.spec.containers[0].env', 'rc': 'spec.template.spec.containers[0].env'} def __init__(self, namespace, kind, env_vars, resource_name=None, kubeconfig='/etc/origin/master/admin.kubeconfig', verbose=False): """ Constructor for OpenshiftOC """ super(OCEnv, self).__init__(namespace, kubeconfig=kubeconfig, verbose=verbose) self.kind = kind self.name = resource_name self.env_vars = env_vars self._resource = None @property def resource(self): """ property function for resource var""" if not self._resource: self.get() return self._resource @resource.setter def resource(self, data): """ setter function for resource var""" self._resource = data def key_value_exists(self, key, value): """ return whether a key, value pair exists """ return self.resource.exists_env_value(key, value) def key_exists(self, key): """ return whether a key exists """ return self.resource.exists_env_key(key) def get(self): """return environment variables """ result = self._get(self.kind, self.name) if result['returncode'] == 0: if self.kind == 'dc': self.resource = deployment_config(content=result['results'][0]) result['results'] = self.resource.get(OCEnv.container_path[self.kind]) or [] return result def delete(self): """ delete environment variables """ if self.resource.delete_env_var(self.env_vars.keys()): return self._replace_content(self.kind, self.name, self.resource.yaml_dict) return {'returncode': 0, 'changed': False} def put(self): """place env vars into dc """ for (update_key, update_value) in self.env_vars.items(): self.resource.update_env_var(update_key, update_value) return self._replace_content(self.kind, self.name, self.resource.yaml_dict) @staticmethod def run_ansible(params, check_mode): """run the oc_env module""" ocenv = oc_env(params['namespace'], params['kind'], params['env_vars'], resource_name=params['name'], kubeconfig=params['kubeconfig'], verbose=params['debug']) state = params['state'] api_rval = ocenv.get() if state == 'list': return {'changed': False, 'results': api_rval['results'], 'state': 'list'} if state == 'absent': for key in params.get('env_vars', {}).keys(): if ocenv.resource.exists_env_key(key): if check_mode: return {'changed': False, 'msg': 'CHECK_MODE: Would have performed a delete.'} api_rval = ocenv.delete() return {'changed': True, 'state': 'absent'} return {'changed': False, 'state': 'absent'} if state == 'present': for (key, value) in params.get('env_vars', {}).items(): if not ocenv.key_value_exists(key, value): if check_mode: return {'changed': False, 'msg': 'CHECK_MODE: Would have performed a create.'} api_rval = ocenv.put() if api_rval['returncode'] != 0: return {'failed': True, 'msg': api_rval} api_rval = ocenv.get() if api_rval['returncode'] != 0: return {'failed': True, 'msg': api_rval} return {'changed': True, 'results': api_rval['results'], 'state': 'present'} return {'changed': False, 'results': api_rval['results'], 'state': 'present'} return {'failed': True, 'changed': False, 'msg': 'Unknown state passed. %s' % state}
class node: def __init__(self,key): self.left = None self.right = None self.val = key def PreOrder(root): if root: print(root.val, end = " ") PreOrder(root.left) PreOrder(root.right) root = node(1) root.left = node(2) root.right = node(3) root.left.left = node(4) root.left.right = node(5) root.right.left = node(6) root.right.right = node(7) print("Pre Order traversal of tree is", end = " ") PreOrder(root) ''' Output Pre Order traversal of tree is 1 2 4 5 3 6 7 '''
class Node: def __init__(self, key): self.left = None self.right = None self.val = key def pre_order(root): if root: print(root.val, end=' ') pre_order(root.left) pre_order(root.right) root = node(1) root.left = node(2) root.right = node(3) root.left.left = node(4) root.left.right = node(5) root.right.left = node(6) root.right.right = node(7) print('Pre Order traversal of tree is', end=' ') pre_order(root) ' Output\n\nPre Order traversal of tree is 1 2 4 5 3 6 7\n\n'
# O(N) time, N -> no. of people in the orgChart # O(d) time, d -> depth of the OrgChart/orgTree def getLowestCommonManager(topManager, reportOne, reportTwo): # Write your code here. return getOrgInfo(topManager, reportOne, reportTwo).lowestCommonManager def getOrgInfo(manager, reportOne, reportTwo): numberImpReports = 0 for directReport in manager.directReports: print(manager.name, directReport.name) orgInfo = getOrgInfo(directReport, reportOne, reportTwo) if orgInfo.lowestCommonManager is not None: # if this is our lowestCommonManager, then we return return orgInfo numberImpReports += orgInfo.numberImpReports # if we, as a manager, have any of the direct reports, then we increase the count since we have it if manager == reportOne or manager == reportTwo: # it is possible that the manager was one of the imp reports numberImpReports+=1 lowestCommonManager = manager if numberImpReports == 2 else None return OrgInfo(lowestCommonManager, numberImpReports) # pass this count to its parent/manager class OrgInfo: def __init__(self, lowestCommonManager, numberImpReports): self.lowestCommonManager = lowestCommonManager self.numberImpReports = numberImpReports # This is an input class. Do not edit. class OrgChart: def __init__(self, name): self.name = name self.directReports = []
def get_lowest_common_manager(topManager, reportOne, reportTwo): return get_org_info(topManager, reportOne, reportTwo).lowestCommonManager def get_org_info(manager, reportOne, reportTwo): number_imp_reports = 0 for direct_report in manager.directReports: print(manager.name, directReport.name) org_info = get_org_info(directReport, reportOne, reportTwo) if orgInfo.lowestCommonManager is not None: return orgInfo number_imp_reports += orgInfo.numberImpReports if manager == reportOne or manager == reportTwo: number_imp_reports += 1 lowest_common_manager = manager if numberImpReports == 2 else None return org_info(lowestCommonManager, numberImpReports) class Orginfo: def __init__(self, lowestCommonManager, numberImpReports): self.lowestCommonManager = lowestCommonManager self.numberImpReports = numberImpReports class Orgchart: def __init__(self, name): self.name = name self.directReports = []
class Endpoint: RESOURCE_MANAGEMENT = "https://management.azure.com" RESOURCE_LOG_API = "https://api.loganalytics.io" GET_AUTH_TOKEN = "https://login.microsoftonline.com/{}/oauth2/token" # nosec GET_SHARED_KEY = ( RESOURCE_MANAGEMENT + "/subscriptions/{}/resourcegroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/sharedKeys?api-version={}" ) GET_WORKSPACE_ID = ( RESOURCE_MANAGEMENT + "/subscriptions/{}/resourcegroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}?api-version={}" ) SEND_LOG_DATA = "https://{}.ods.opinsights.azure.com/api/logs?api-version={}" GET_LOG_DATA = RESOURCE_LOG_API + "/{}/workspaces/{}/query"
class Endpoint: resource_management = 'https://management.azure.com' resource_log_api = 'https://api.loganalytics.io' get_auth_token = 'https://login.microsoftonline.com/{}/oauth2/token' get_shared_key = RESOURCE_MANAGEMENT + '/subscriptions/{}/resourcegroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}/sharedKeys?api-version={}' get_workspace_id = RESOURCE_MANAGEMENT + '/subscriptions/{}/resourcegroups/{}/providers/Microsoft.OperationalInsights/workspaces/{}?api-version={}' send_log_data = 'https://{}.ods.opinsights.azure.com/api/logs?api-version={}' get_log_data = RESOURCE_LOG_API + '/{}/workspaces/{}/query'
class ContactHelper: def __init__(self, app): self.app = app def open_home_page(self): wd = self.app.wd self.app.open_home_page() def open_add_contact(self): wd = self.app.wd # open add contact page wd.find_element_by_link_text("add new").click() def create_new_contact(self, add_contact): wd = self.app.wd self.open_add_contact() # fill up new contact form wd.find_element_by_name("firstname").click() wd.find_element_by_name("firstname").clear() wd.find_element_by_name("firstname").send_keys(add_contact.name) wd.find_element_by_name("middlename").click() wd.find_element_by_name("middlename").clear() wd.find_element_by_name("middlename").send_keys("O") wd.find_element_by_name("lastname").click() wd.find_element_by_name("lastname").clear() wd.find_element_by_name("lastname").send_keys(add_contact.lastname) wd.find_element_by_name("nickname").click() wd.find_element_by_name("nickname").clear() wd.find_element_by_name("nickname").send_keys("Alex") wd.find_element_by_name("title").click() wd.find_element_by_name("title").clear() wd.find_element_by_name("title").send_keys("mr") wd.find_element_by_name("company").click() wd.find_element_by_name("company").clear() wd.find_element_by_name("company").send_keys("GS") wd.find_element_by_name("address").click() wd.find_element_by_name("address").clear() wd.find_element_by_name("address").send_keys(add_contact.address) wd.find_element_by_name("home").click() wd.find_element_by_name("home").clear() wd.find_element_by_name("home").send_keys("98347974824") wd.find_element_by_name("mobile").click() wd.find_element_by_name("mobile").clear() wd.find_element_by_name("mobile").send_keys("3498374328") wd.find_element_by_name("work").click() wd.find_element_by_name("work").clear() wd.find_element_by_name("work").send_keys("23649873289") wd.find_element_by_name("fax").click() wd.find_element_by_name("fax").clear() wd.find_element_by_name("fax").send_keys("3487932874832") wd.find_element_by_name("email").click() wd.find_element_by_name("email").clear() wd.find_element_by_name("email").send_keys("alex@mail.ru") wd.find_element_by_name("email2").click() wd.find_element_by_name("email2").clear() wd.find_element_by_name("email2").send_keys("alex1@mail.ru") wd.find_element_by_name("email3").click() wd.find_element_by_name("email3").clear() wd.find_element_by_name("email3").send_keys("alex3@mail.ru") wd.find_element_by_name("homepage").click() wd.find_element_by_name("homepage").clear() wd.find_element_by_name("homepage").send_keys("alex1.site.com") wd.find_element_by_name("bday").click() #Select(wd.find_element_by_name("bday")).select_by_visible_text("15") #wd.find_element_by_xpath("//option[@value='15']").click() #wd.find_element_by_name("bmonth").click() #Select(wd.find_element_by_name("bmonth")).select_by_visible_text("June") #wd.find_element_by_xpath("//option[@value='June']").click() #wd.find_element_by_name("byear").click() #wd.find_element_by_name("byear").clear() #wd.find_element_by_name("byear").send_keys("1969") #wd.find_element_by_name("aday").click() #Select(wd.find_element_by_name("aday")).select_by_visible_text("10") #wd.find_element_by_xpath("(//option[@value='10'])[2]").click() #wd.find_element_by_name("amonth").click() #Select(wd.find_element_by_name("amonth")).select_by_visible_text("November") #wd.find_element_by_xpath("(//option[@value='November'])[2]").click() wd.find_element_by_name("ayear").click() wd.find_element_by_name("ayear").clear() wd.find_element_by_name("ayear").send_keys("1970") wd.find_element_by_name("address2").click() wd.find_element_by_name("address2").clear() wd.find_element_by_name("address2").send_keys("12 road") wd.find_element_by_name("notes").click() wd.find_element_by_name("notes").clear() wd.find_element_by_name("notes").send_keys("notes 123") # submit contact creation wd.find_element_by_xpath("(//input[@name='submit'])[2]").click() def delete_first_contact(self): wd = self.app.wd self.open_home_page() # select first contact wd.find_element_by_name("selected[]").click() # submit deletion #wd.find_element_by_name("Delete").click() wd.find_element_by_xpath("//input[@value='Delete']").click() wd.switch_to_alert().accept() self.return_to_home_page() def return_to_home_page(self): wd = self.app.wd wd.find_element_by_link_text("groups").click()
class Contacthelper: def __init__(self, app): self.app = app def open_home_page(self): wd = self.app.wd self.app.open_home_page() def open_add_contact(self): wd = self.app.wd wd.find_element_by_link_text('add new').click() def create_new_contact(self, add_contact): wd = self.app.wd self.open_add_contact() wd.find_element_by_name('firstname').click() wd.find_element_by_name('firstname').clear() wd.find_element_by_name('firstname').send_keys(add_contact.name) wd.find_element_by_name('middlename').click() wd.find_element_by_name('middlename').clear() wd.find_element_by_name('middlename').send_keys('O') wd.find_element_by_name('lastname').click() wd.find_element_by_name('lastname').clear() wd.find_element_by_name('lastname').send_keys(add_contact.lastname) wd.find_element_by_name('nickname').click() wd.find_element_by_name('nickname').clear() wd.find_element_by_name('nickname').send_keys('Alex') wd.find_element_by_name('title').click() wd.find_element_by_name('title').clear() wd.find_element_by_name('title').send_keys('mr') wd.find_element_by_name('company').click() wd.find_element_by_name('company').clear() wd.find_element_by_name('company').send_keys('GS') wd.find_element_by_name('address').click() wd.find_element_by_name('address').clear() wd.find_element_by_name('address').send_keys(add_contact.address) wd.find_element_by_name('home').click() wd.find_element_by_name('home').clear() wd.find_element_by_name('home').send_keys('98347974824') wd.find_element_by_name('mobile').click() wd.find_element_by_name('mobile').clear() wd.find_element_by_name('mobile').send_keys('3498374328') wd.find_element_by_name('work').click() wd.find_element_by_name('work').clear() wd.find_element_by_name('work').send_keys('23649873289') wd.find_element_by_name('fax').click() wd.find_element_by_name('fax').clear() wd.find_element_by_name('fax').send_keys('3487932874832') wd.find_element_by_name('email').click() wd.find_element_by_name('email').clear() wd.find_element_by_name('email').send_keys('alex@mail.ru') wd.find_element_by_name('email2').click() wd.find_element_by_name('email2').clear() wd.find_element_by_name('email2').send_keys('alex1@mail.ru') wd.find_element_by_name('email3').click() wd.find_element_by_name('email3').clear() wd.find_element_by_name('email3').send_keys('alex3@mail.ru') wd.find_element_by_name('homepage').click() wd.find_element_by_name('homepage').clear() wd.find_element_by_name('homepage').send_keys('alex1.site.com') wd.find_element_by_name('bday').click() wd.find_element_by_name('ayear').click() wd.find_element_by_name('ayear').clear() wd.find_element_by_name('ayear').send_keys('1970') wd.find_element_by_name('address2').click() wd.find_element_by_name('address2').clear() wd.find_element_by_name('address2').send_keys('12 road') wd.find_element_by_name('notes').click() wd.find_element_by_name('notes').clear() wd.find_element_by_name('notes').send_keys('notes 123') wd.find_element_by_xpath("(//input[@name='submit'])[2]").click() def delete_first_contact(self): wd = self.app.wd self.open_home_page() wd.find_element_by_name('selected[]').click() wd.find_element_by_xpath("//input[@value='Delete']").click() wd.switch_to_alert().accept() self.return_to_home_page() def return_to_home_page(self): wd = self.app.wd wd.find_element_by_link_text('groups').click()
#******************************************************************************* # # Sentence pattern definitions # #******************************************************************************* sentencePatterns = [ [ 'nMass is the driver of nMass.', 'nMass is the nTheXOf of nMass, and of us.', 'You and I are nPersonPlural of the nCosmos.', 'We exist as fixedNP.', 'We viPerson, we viPerson, we are reborn.', 'Nothing is impossible.', 'This life is nothing short of a ing nOf of adj nMass.', 'Consciousness consists of fixedNP of quantum energy. "Quantum" means a ing of the adj.', 'The goal of fixedNP is to plant the seeds of nMass rather than nMassBad.', 'nMass is a constant.', 'By ing, we viPerson.', 'The nCosmos is adjWith fixedNP.', 'To vTraverse the nPath is to become one with it.', 'Today, science tells us that the essence of nature is nMass.', 'nMass requires exploration.' ], [ 'We can no longer afford to live with nMassBad.', 'Without nMass, one cannot viPerson.', 'Only a nPerson of the nCosmos may vtMass this nOf of nMass.', 'You must take a stand against nMassBad.', 'Yes, it is possible to vtDestroy the things that can vtDestroy us, but not without nMass on our side.', 'nMassBad is the antithesis of nMass.', 'You may be ruled by nMassBad without realizing it. Do not let it vtDestroy the nTheXOf of your nPath.', 'The complexity of the present time seems to demand a ing of our nOurPlural if we are going to survive.', 'nMassBad is born in the gap where nMass has been excluded.', 'Where there is nMassBad, nMass cannot thrive.' ], [ 'Soon there will be a ing of nMass the likes of which the nCosmos has never seen.', 'It is time to take nMass to the next level.', 'Imagine a ing of what could be.', 'Eons from now, we nPersonPlural will viPerson like never before as we are ppPerson by the nCosmos.', 'It is a sign of things to come.', 'The future will be a adj ing of nMass.', 'This nPath never ends.', 'We must learn how to lead adj lives in the face of nMassBad.', 'We must vtPerson ourselves and vtPerson others.', 'The nOf of nMass is now happening worldwide.', 'We are being called to explore the nCosmos itself as an interface between nMass and nMass.', 'It is in ing that we are ppPerson.', 'The nCosmos is approaching a tipping point.', 'nameOfGod will vOpenUp adj nMass.' ], [ 'Although you may not realize it, you are adj.', 'nPerson, look within and vtPerson yourself.', 'Have you found your nPath?', 'How should you navigate this adj nCosmos?', 'It can be difficult to know where to begin.', 'If you have never experienced this nOf fixedAdvP, it can be difficult to viPerson.', 'The nCosmos is calling to you via fixedNP. Can you hear it?' ], [ 'Throughout history, humans have been interacting with the nCosmos via fixedNP.', 'Reality has always been adjWith nPersonPlural whose nOurPlural are ppThingPrep nMass.', 'Our conversations with other nPersonPlural have led to a ing of adjPrefix adj consciousness.', 'Humankind has nothing to lose.', 'We are in the midst of a adj ing of nMass that will vOpenUp the nCosmos itself.', 'Who are we? Where on the great nPath will we be ppPerson?', 'We are at a crossroads of nMass and nMassBad.' ], [ 'Through nSubject, our nOurPlural are ppThingPrep nMass.', 'nSubject may be the solution to what\'s holding you back from a adjBig nOf of nMass.', 'You will soon be ppPerson by a power deep within yourself - a power that is adj, adj.', 'As you viPerson, you will enter into infinite nMass that transcends understanding.', 'This is the vision behind our 100% adjProduct, adjProduct nProduct.', 'With our adjProduct nProduct, nBenefits is only the beginning.' ] ]
sentence_patterns = [['nMass is the driver of nMass.', 'nMass is the nTheXOf of nMass, and of us.', 'You and I are nPersonPlural of the nCosmos.', 'We exist as fixedNP.', 'We viPerson, we viPerson, we are reborn.', 'Nothing is impossible.', 'This life is nothing short of a ing nOf of adj nMass.', 'Consciousness consists of fixedNP of quantum energy. "Quantum" means a ing of the adj.', 'The goal of fixedNP is to plant the seeds of nMass rather than nMassBad.', 'nMass is a constant.', 'By ing, we viPerson.', 'The nCosmos is adjWith fixedNP.', 'To vTraverse the nPath is to become one with it.', 'Today, science tells us that the essence of nature is nMass.', 'nMass requires exploration.'], ['We can no longer afford to live with nMassBad.', 'Without nMass, one cannot viPerson.', 'Only a nPerson of the nCosmos may vtMass this nOf of nMass.', 'You must take a stand against nMassBad.', 'Yes, it is possible to vtDestroy the things that can vtDestroy us, but not without nMass on our side.', 'nMassBad is the antithesis of nMass.', 'You may be ruled by nMassBad without realizing it. Do not let it vtDestroy the nTheXOf of your nPath.', 'The complexity of the present time seems to demand a ing of our nOurPlural if we are going to survive.', 'nMassBad is born in the gap where nMass has been excluded.', 'Where there is nMassBad, nMass cannot thrive.'], ['Soon there will be a ing of nMass the likes of which the nCosmos has never seen.', 'It is time to take nMass to the next level.', 'Imagine a ing of what could be.', 'Eons from now, we nPersonPlural will viPerson like never before as we are ppPerson by the nCosmos.', 'It is a sign of things to come.', 'The future will be a adj ing of nMass.', 'This nPath never ends.', 'We must learn how to lead adj lives in the face of nMassBad.', 'We must vtPerson ourselves and vtPerson others.', 'The nOf of nMass is now happening worldwide.', 'We are being called to explore the nCosmos itself as an interface between nMass and nMass.', 'It is in ing that we are ppPerson.', 'The nCosmos is approaching a tipping point.', 'nameOfGod will vOpenUp adj nMass.'], ['Although you may not realize it, you are adj.', 'nPerson, look within and vtPerson yourself.', 'Have you found your nPath?', 'How should you navigate this adj nCosmos?', 'It can be difficult to know where to begin.', 'If you have never experienced this nOf fixedAdvP, it can be difficult to viPerson.', 'The nCosmos is calling to you via fixedNP. Can you hear it?'], ['Throughout history, humans have been interacting with the nCosmos via fixedNP.', 'Reality has always been adjWith nPersonPlural whose nOurPlural are ppThingPrep nMass.', 'Our conversations with other nPersonPlural have led to a ing of adjPrefix adj consciousness.', 'Humankind has nothing to lose.', 'We are in the midst of a adj ing of nMass that will vOpenUp the nCosmos itself.', 'Who are we? Where on the great nPath will we be ppPerson?', 'We are at a crossroads of nMass and nMassBad.'], ['Through nSubject, our nOurPlural are ppThingPrep nMass.', "nSubject may be the solution to what's holding you back from a adjBig nOf of nMass.", 'You will soon be ppPerson by a power deep within yourself - a power that is adj, adj.', 'As you viPerson, you will enter into infinite nMass that transcends understanding.', 'This is the vision behind our 100% adjProduct, adjProduct nProduct.', 'With our adjProduct nProduct, nBenefits is only the beginning.']]
''' URL: https://leetcode.com/problems/count-largest-group/ Difficulty: Easy Description: Count Largest Group Given an integer n. Each number from 1 to n is grouped according to the sum of its digits. Return how many groups have the largest size. Example 1: Input: n = 13 Output: 4 Explanation: There are 9 groups in total, they are grouped according sum of its digits of numbers from 1 to 13: [1,10], [2,11], [3,12], [4,13], [5], [6], [7], [8], [9]. There are 4 groups with largest size. Example 2: Input: n = 2 Output: 2 Explanation: There are 2 groups [1], [2] of size 1. Example 3: Input: n = 15 Output: 6 Example 4: Input: n = 24 Output: 5 Constraints: 1 <= n <= 10^4 ''' class Solution: def sumOfDigits(self, n): sum = 0 while n > 0: sum += n % 10 n = n // 10 return sum def countLargestGroup(self, n): counts = {} for i in range(1, n+1): # sum of the digits of n sum = self.sumOfDigits(i) if sum in counts: counts[sum].append(i) else: # if sum is not in dict # store in format # key: sum # value: [ All the elements that sum to that size ] counts[sum] = [i] largestGroupSize = -float('inf') largestGroupCount = 0 for group in counts.values(): size = len(group) if size > largestGroupSize: largestGroupSize = size largestGroupCount = 1 elif size == largestGroupSize: largestGroupCount += 1 return largestGroupCount
""" URL: https://leetcode.com/problems/count-largest-group/ Difficulty: Easy Description: Count Largest Group Given an integer n. Each number from 1 to n is grouped according to the sum of its digits. Return how many groups have the largest size. Example 1: Input: n = 13 Output: 4 Explanation: There are 9 groups in total, they are grouped according sum of its digits of numbers from 1 to 13: [1,10], [2,11], [3,12], [4,13], [5], [6], [7], [8], [9]. There are 4 groups with largest size. Example 2: Input: n = 2 Output: 2 Explanation: There are 2 groups [1], [2] of size 1. Example 3: Input: n = 15 Output: 6 Example 4: Input: n = 24 Output: 5 Constraints: 1 <= n <= 10^4 """ class Solution: def sum_of_digits(self, n): sum = 0 while n > 0: sum += n % 10 n = n // 10 return sum def count_largest_group(self, n): counts = {} for i in range(1, n + 1): sum = self.sumOfDigits(i) if sum in counts: counts[sum].append(i) else: counts[sum] = [i] largest_group_size = -float('inf') largest_group_count = 0 for group in counts.values(): size = len(group) if size > largestGroupSize: largest_group_size = size largest_group_count = 1 elif size == largestGroupSize: largest_group_count += 1 return largestGroupCount
def BuscarCaja(p,q): global L mitad=(p+q)//2 if q==p+1 or q==p: if L[p]==1: return p else: return q elif 1 in L[mitad:q+1]: return BuscarCaja(mitad,q) else: return BuscarCaja(p,mitad-1) L=[0,0,0,0,1,0] print("Indice: "+str(BuscarCaja(0,len(L)-1))) L=[0,1,0,0,0,0,0,0,0] print("Indice: "+str(BuscarCaja(0,len(L)-1)))
def buscar_caja(p, q): global L mitad = (p + q) // 2 if q == p + 1 or q == p: if L[p] == 1: return p else: return q elif 1 in L[mitad:q + 1]: return buscar_caja(mitad, q) else: return buscar_caja(p, mitad - 1) l = [0, 0, 0, 0, 1, 0] print('Indice: ' + str(buscar_caja(0, len(L) - 1))) l = [0, 1, 0, 0, 0, 0, 0, 0, 0] print('Indice: ' + str(buscar_caja(0, len(L) - 1)))
def main(request, response): cookie = request.cookies.first(b"COOKIE_NAME", None) response_headers = [(b"Content-Type", b"text/javascript"), (b"Access-Control-Allow-Credentials", b"true")] origin = request.headers.get(b"Origin", None) if origin: response_headers.append((b"Access-Control-Allow-Origin", origin)) cookie_value = b''; if cookie: cookie_value = cookie.value; return (200, response_headers, b"export const cookie = '"+cookie_value+b"';")
def main(request, response): cookie = request.cookies.first(b'COOKIE_NAME', None) response_headers = [(b'Content-Type', b'text/javascript'), (b'Access-Control-Allow-Credentials', b'true')] origin = request.headers.get(b'Origin', None) if origin: response_headers.append((b'Access-Control-Allow-Origin', origin)) cookie_value = b'' if cookie: cookie_value = cookie.value return (200, response_headers, b"export const cookie = '" + cookie_value + b"';")
#!/usr/bin/env python # Copyright Contributors to the Open Shading Language project. # SPDX-License-Identifier: BSD-3-Clause # https://github.com/AcademySoftwareFoundation/OpenShadingLanguage command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_c_float_v_floatarray.tif test_spline_c_float_v_floatarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_c_float_u_floatarray.tif test_spline_c_float_u_floatarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_c_float_c_floatarray.tif test_spline_c_float_c_floatarray") outputs.append ("spline_c_float_v_floatarray.tif") outputs.append ("spline_c_float_u_floatarray.tif") outputs.append ("spline_c_float_c_floatarray.tif") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_u_float_v_floatarray.tif test_spline_u_float_v_floatarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_u_float_u_floatarray.tif test_spline_u_float_u_floatarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_u_float_c_floatarray.tif test_spline_u_float_c_floatarray") outputs.append ("spline_u_float_v_floatarray.tif") outputs.append ("spline_u_float_u_floatarray.tif") outputs.append ("spline_u_float_c_floatarray.tif") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_v_float_v_floatarray.tif test_spline_v_float_v_floatarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_v_float_u_floatarray.tif test_spline_v_float_u_floatarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Fout spline_v_float_c_floatarray.tif test_spline_v_float_c_floatarray") outputs.append ("spline_v_float_v_floatarray.tif") outputs.append ("spline_v_float_u_floatarray.tif") outputs.append ("spline_v_float_c_floatarray.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_c_float_v_floatarray.tif test_deriv_spline_c_float_v_floatarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_c_float_u_floatarray.tif test_deriv_spline_c_float_u_floatarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_c_float_c_floatarray.tif test_deriv_spline_c_float_c_floatarray") outputs.append ("deriv_spline_c_float_v_floatarray.tif") outputs.append ("deriv_spline_c_float_u_floatarray.tif") outputs.append ("deriv_spline_c_float_c_floatarray.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_u_float_v_floatarray.tif test_deriv_spline_u_float_v_floatarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_u_float_u_floatarray.tif test_deriv_spline_u_float_u_floatarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_u_float_c_floatarray.tif test_deriv_spline_u_float_c_floatarray") outputs.append ("deriv_spline_u_float_v_floatarray.tif") outputs.append ("deriv_spline_u_float_u_floatarray.tif") outputs.append ("deriv_spline_u_float_c_floatarray.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_v_float_v_floatarray.tif test_deriv_spline_v_float_v_floatarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_v_float_u_floatarray.tif test_deriv_spline_v_float_u_floatarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_v_float_c_floatarray.tif test_deriv_spline_v_float_c_floatarray") outputs.append ("deriv_spline_v_float_v_floatarray.tif") outputs.append ("deriv_spline_v_float_u_floatarray.tif") outputs.append ("deriv_spline_v_float_c_floatarray.tif") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_c_float_v_colorarray.tif test_spline_c_float_v_colorarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_c_float_u_colorarray.tif test_spline_c_float_u_colorarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_c_float_c_colorarray.tif test_spline_c_float_c_colorarray") outputs.append ("spline_c_float_v_colorarray.tif") outputs.append ("spline_c_float_u_colorarray.tif") outputs.append ("spline_c_float_c_colorarray.tif") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_u_float_v_colorarray.tif test_spline_u_float_v_colorarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_u_float_u_colorarray.tif test_spline_u_float_u_colorarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_u_float_c_colorarray.tif test_spline_u_float_c_colorarray") outputs.append ("spline_u_float_v_colorarray.tif") outputs.append ("spline_u_float_u_colorarray.tif") outputs.append ("spline_u_float_c_colorarray.tif") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_v_float_v_colorarray.tif test_spline_v_float_v_colorarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_v_float_u_colorarray.tif test_spline_v_float_u_colorarray") command += testshade("-t 1 -g 64 64 -od uint8 -o Cout spline_v_float_c_colorarray.tif test_spline_v_float_c_colorarray") outputs.append ("spline_v_float_v_colorarray.tif") outputs.append ("spline_v_float_u_colorarray.tif") outputs.append ("spline_v_float_c_colorarray.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_v_colorarray.tif -o DxOut deriv_spline_c_float_v_colorarrayDx.tif -o DyOut deriv_spline_c_float_v_colorarrayDy.tif test_deriv_spline_c_float_v_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_u_colorarray.tif -o DxOut deriv_spline_c_float_u_colorarrayDx.tif -o DyOut deriv_spline_c_float_u_colorarrayDy.tif test_deriv_spline_c_float_u_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_c_colorarray.tif -o DxOut deriv_spline_c_float_c_colorarrayDx.tif -o DyOut deriv_spline_c_float_c_colorarrayDy.tif test_deriv_spline_c_float_c_colorarray") outputs.append ("deriv_spline_c_float_v_colorarray.tif") outputs.append ("deriv_spline_c_float_v_colorarrayDx.tif") outputs.append ("deriv_spline_c_float_v_colorarrayDy.tif") outputs.append ("deriv_spline_c_float_u_colorarray.tif") outputs.append ("deriv_spline_c_float_u_colorarrayDx.tif") outputs.append ("deriv_spline_c_float_u_colorarrayDy.tif") outputs.append ("deriv_spline_c_float_c_colorarray.tif") outputs.append ("deriv_spline_c_float_c_colorarrayDx.tif") outputs.append ("deriv_spline_c_float_c_colorarrayDy.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_v_colorarray.tif -o DxOut deriv_spline_u_float_v_colorarrayDx.tif -o DyOut deriv_spline_u_float_v_colorarrayDy.tif test_deriv_spline_u_float_v_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_u_colorarray.tif -o DxOut deriv_spline_u_float_u_colorarrayDx.tif -o DyOut deriv_spline_u_float_u_colorarrayDy.tif test_deriv_spline_u_float_u_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_c_colorarray.tif -o DxOut deriv_spline_u_float_c_colorarrayDx.tif -o DyOut deriv_spline_u_float_c_colorarrayDy.tif test_deriv_spline_u_float_c_colorarray") outputs.append ("deriv_spline_u_float_v_colorarray.tif") outputs.append ("deriv_spline_u_float_v_colorarrayDx.tif") outputs.append ("deriv_spline_u_float_v_colorarrayDy.tif") outputs.append ("deriv_spline_u_float_u_colorarray.tif") outputs.append ("deriv_spline_u_float_u_colorarrayDx.tif") outputs.append ("deriv_spline_u_float_u_colorarrayDy.tif") outputs.append ("deriv_spline_u_float_c_colorarray.tif") outputs.append ("deriv_spline_u_float_c_colorarrayDx.tif") outputs.append ("deriv_spline_u_float_c_colorarrayDy.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_v_colorarray.tif -o DxOut deriv_spline_v_float_v_colorarrayDx.tif -o DyOut deriv_spline_v_float_v_colorarrayDy.tif test_deriv_spline_v_float_v_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_u_colorarray.tif -o DxOut deriv_spline_v_float_u_colorarrayDx.tif -o DyOut deriv_spline_v_float_u_colorarrayDy.tif test_deriv_spline_v_float_u_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_c_colorarray.tif -o DxOut deriv_spline_v_float_c_colorarrayDx.tif -o DyOut deriv_spline_v_float_c_colorarrayDy.tif test_deriv_spline_v_float_c_colorarray") outputs.append ("deriv_spline_v_float_v_colorarray.tif") outputs.append ("deriv_spline_v_float_v_colorarrayDx.tif") outputs.append ("deriv_spline_v_float_v_colorarrayDy.tif") outputs.append ("deriv_spline_v_float_u_colorarray.tif") outputs.append ("deriv_spline_v_float_u_colorarrayDx.tif") outputs.append ("deriv_spline_v_float_u_colorarrayDy.tif") outputs.append ("deriv_spline_v_float_c_colorarray.tif") outputs.append ("deriv_spline_v_float_c_colorarrayDx.tif") outputs.append ("deriv_spline_v_float_c_colorarrayDy.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_vNoDeriv_float_v_colorarray.tif -o DxOut deriv_spline_vNoDeriv_float_v_colorarrayDx.tif -o DyOut deriv_spline_vNoDeriv_float_v_colorarrayDy.tif test_deriv_spline_vNoDeriv_float_v_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_vNoDeriv_float_u_colorarray.tif -o DxOut deriv_spline_vNoDeriv_float_u_colorarrayDx.tif -o DyOut deriv_spline_vNoDeriv_float_u_colorarrayDy.tif test_deriv_spline_vNoDeriv_float_u_colorarray") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_vNoDeriv_float_c_colorarray.tif -o DxOut deriv_spline_vNoDeriv_float_c_colorarrayDx.tif -o DyOut deriv_spline_vNoDeriv_float_c_colorarrayDy.tif test_deriv_spline_vNoDeriv_float_c_colorarray") outputs.append ("deriv_spline_vNoDeriv_float_v_colorarray.tif") outputs.append ("deriv_spline_vNoDeriv_float_v_colorarrayDx.tif") outputs.append ("deriv_spline_vNoDeriv_float_v_colorarrayDy.tif") outputs.append ("deriv_spline_vNoDeriv_float_u_colorarray.tif") outputs.append ("deriv_spline_vNoDeriv_float_u_colorarrayDx.tif") outputs.append ("deriv_spline_vNoDeriv_float_u_colorarrayDy.tif") outputs.append ("deriv_spline_vNoDeriv_float_c_colorarray.tif") outputs.append ("deriv_spline_vNoDeriv_float_c_colorarrayDx.tif") outputs.append ("deriv_spline_vNoDeriv_float_c_colorarrayDy.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_vNoDeriv_colorarray.tif -o DxOut deriv_spline_v_float_vNoDeriv_colorarrayDx.tif -o DyOut deriv_spline_v_float_vNoDeriv_colorarrayDy.tif test_deriv_spline_v_float_vNoDeriv_colorarray") outputs.append ("deriv_spline_v_float_vNoDeriv_colorarray.tif") outputs.append ("deriv_spline_v_float_vNoDeriv_colorarrayDx.tif") outputs.append ("deriv_spline_v_float_vNoDeriv_colorarrayDy.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_vNoDeriv_colorarray.tif -o DxOut deriv_spline_u_float_vNoDeriv_colorarrayDx.tif -o DyOut deriv_spline_u_float_vNoDeriv_colorarrayDy.tif test_deriv_spline_u_float_vNoDeriv_colorarray") outputs.append ("deriv_spline_u_float_vNoDeriv_colorarray.tif") outputs.append ("deriv_spline_u_float_vNoDeriv_colorarrayDx.tif") outputs.append ("deriv_spline_u_float_vNoDeriv_colorarrayDy.tif") command += testshade("--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_vNoDeriv_colorarray.tif -o DxOut deriv_spline_c_float_vNoDeriv_colorarrayDx.tif -o DyOut deriv_spline_c_float_vNoDeriv_colorarrayDy.tif test_deriv_spline_c_float_vNoDeriv_colorarray") outputs.append ("deriv_spline_c_float_vNoDeriv_colorarray.tif") outputs.append ("deriv_spline_c_float_vNoDeriv_colorarrayDx.tif") outputs.append ("deriv_spline_c_float_vNoDeriv_colorarrayDy.tif") # expect a few LSB failures failthresh = 0.008 failpercent = 3
command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_c_float_v_floatarray.tif test_spline_c_float_v_floatarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_c_float_u_floatarray.tif test_spline_c_float_u_floatarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_c_float_c_floatarray.tif test_spline_c_float_c_floatarray') outputs.append('spline_c_float_v_floatarray.tif') outputs.append('spline_c_float_u_floatarray.tif') outputs.append('spline_c_float_c_floatarray.tif') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_u_float_v_floatarray.tif test_spline_u_float_v_floatarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_u_float_u_floatarray.tif test_spline_u_float_u_floatarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_u_float_c_floatarray.tif test_spline_u_float_c_floatarray') outputs.append('spline_u_float_v_floatarray.tif') outputs.append('spline_u_float_u_floatarray.tif') outputs.append('spline_u_float_c_floatarray.tif') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_v_float_v_floatarray.tif test_spline_v_float_v_floatarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_v_float_u_floatarray.tif test_spline_v_float_u_floatarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Fout spline_v_float_c_floatarray.tif test_spline_v_float_c_floatarray') outputs.append('spline_v_float_v_floatarray.tif') outputs.append('spline_v_float_u_floatarray.tif') outputs.append('spline_v_float_c_floatarray.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_c_float_v_floatarray.tif test_deriv_spline_c_float_v_floatarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_c_float_u_floatarray.tif test_deriv_spline_c_float_u_floatarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_c_float_c_floatarray.tif test_deriv_spline_c_float_c_floatarray') outputs.append('deriv_spline_c_float_v_floatarray.tif') outputs.append('deriv_spline_c_float_u_floatarray.tif') outputs.append('deriv_spline_c_float_c_floatarray.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_u_float_v_floatarray.tif test_deriv_spline_u_float_v_floatarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_u_float_u_floatarray.tif test_deriv_spline_u_float_u_floatarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_u_float_c_floatarray.tif test_deriv_spline_u_float_c_floatarray') outputs.append('deriv_spline_u_float_v_floatarray.tif') outputs.append('deriv_spline_u_float_u_floatarray.tif') outputs.append('deriv_spline_u_float_c_floatarray.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_v_float_v_floatarray.tif test_deriv_spline_v_float_v_floatarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_v_float_u_floatarray.tif test_deriv_spline_v_float_u_floatarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValDxDyOut deriv_spline_v_float_c_floatarray.tif test_deriv_spline_v_float_c_floatarray') outputs.append('deriv_spline_v_float_v_floatarray.tif') outputs.append('deriv_spline_v_float_u_floatarray.tif') outputs.append('deriv_spline_v_float_c_floatarray.tif') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_c_float_v_colorarray.tif test_spline_c_float_v_colorarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_c_float_u_colorarray.tif test_spline_c_float_u_colorarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_c_float_c_colorarray.tif test_spline_c_float_c_colorarray') outputs.append('spline_c_float_v_colorarray.tif') outputs.append('spline_c_float_u_colorarray.tif') outputs.append('spline_c_float_c_colorarray.tif') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_u_float_v_colorarray.tif test_spline_u_float_v_colorarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_u_float_u_colorarray.tif test_spline_u_float_u_colorarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_u_float_c_colorarray.tif test_spline_u_float_c_colorarray') outputs.append('spline_u_float_v_colorarray.tif') outputs.append('spline_u_float_u_colorarray.tif') outputs.append('spline_u_float_c_colorarray.tif') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_v_float_v_colorarray.tif test_spline_v_float_v_colorarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_v_float_u_colorarray.tif test_spline_v_float_u_colorarray') command += testshade('-t 1 -g 64 64 -od uint8 -o Cout spline_v_float_c_colorarray.tif test_spline_v_float_c_colorarray') outputs.append('spline_v_float_v_colorarray.tif') outputs.append('spline_v_float_u_colorarray.tif') outputs.append('spline_v_float_c_colorarray.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_v_colorarray.tif -o DxOut deriv_spline_c_float_v_colorarrayDx.tif -o DyOut deriv_spline_c_float_v_colorarrayDy.tif test_deriv_spline_c_float_v_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_u_colorarray.tif -o DxOut deriv_spline_c_float_u_colorarrayDx.tif -o DyOut deriv_spline_c_float_u_colorarrayDy.tif test_deriv_spline_c_float_u_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_c_colorarray.tif -o DxOut deriv_spline_c_float_c_colorarrayDx.tif -o DyOut deriv_spline_c_float_c_colorarrayDy.tif test_deriv_spline_c_float_c_colorarray') outputs.append('deriv_spline_c_float_v_colorarray.tif') outputs.append('deriv_spline_c_float_v_colorarrayDx.tif') outputs.append('deriv_spline_c_float_v_colorarrayDy.tif') outputs.append('deriv_spline_c_float_u_colorarray.tif') outputs.append('deriv_spline_c_float_u_colorarrayDx.tif') outputs.append('deriv_spline_c_float_u_colorarrayDy.tif') outputs.append('deriv_spline_c_float_c_colorarray.tif') outputs.append('deriv_spline_c_float_c_colorarrayDx.tif') outputs.append('deriv_spline_c_float_c_colorarrayDy.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_v_colorarray.tif -o DxOut deriv_spline_u_float_v_colorarrayDx.tif -o DyOut deriv_spline_u_float_v_colorarrayDy.tif test_deriv_spline_u_float_v_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_u_colorarray.tif -o DxOut deriv_spline_u_float_u_colorarrayDx.tif -o DyOut deriv_spline_u_float_u_colorarrayDy.tif test_deriv_spline_u_float_u_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_c_colorarray.tif -o DxOut deriv_spline_u_float_c_colorarrayDx.tif -o DyOut deriv_spline_u_float_c_colorarrayDy.tif test_deriv_spline_u_float_c_colorarray') outputs.append('deriv_spline_u_float_v_colorarray.tif') outputs.append('deriv_spline_u_float_v_colorarrayDx.tif') outputs.append('deriv_spline_u_float_v_colorarrayDy.tif') outputs.append('deriv_spline_u_float_u_colorarray.tif') outputs.append('deriv_spline_u_float_u_colorarrayDx.tif') outputs.append('deriv_spline_u_float_u_colorarrayDy.tif') outputs.append('deriv_spline_u_float_c_colorarray.tif') outputs.append('deriv_spline_u_float_c_colorarrayDx.tif') outputs.append('deriv_spline_u_float_c_colorarrayDy.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_v_colorarray.tif -o DxOut deriv_spline_v_float_v_colorarrayDx.tif -o DyOut deriv_spline_v_float_v_colorarrayDy.tif test_deriv_spline_v_float_v_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_u_colorarray.tif -o DxOut deriv_spline_v_float_u_colorarrayDx.tif -o DyOut deriv_spline_v_float_u_colorarrayDy.tif test_deriv_spline_v_float_u_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_c_colorarray.tif -o DxOut deriv_spline_v_float_c_colorarrayDx.tif -o DyOut deriv_spline_v_float_c_colorarrayDy.tif test_deriv_spline_v_float_c_colorarray') outputs.append('deriv_spline_v_float_v_colorarray.tif') outputs.append('deriv_spline_v_float_v_colorarrayDx.tif') outputs.append('deriv_spline_v_float_v_colorarrayDy.tif') outputs.append('deriv_spline_v_float_u_colorarray.tif') outputs.append('deriv_spline_v_float_u_colorarrayDx.tif') outputs.append('deriv_spline_v_float_u_colorarrayDy.tif') outputs.append('deriv_spline_v_float_c_colorarray.tif') outputs.append('deriv_spline_v_float_c_colorarrayDx.tif') outputs.append('deriv_spline_v_float_c_colorarrayDy.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_vNoDeriv_float_v_colorarray.tif -o DxOut deriv_spline_vNoDeriv_float_v_colorarrayDx.tif -o DyOut deriv_spline_vNoDeriv_float_v_colorarrayDy.tif test_deriv_spline_vNoDeriv_float_v_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_vNoDeriv_float_u_colorarray.tif -o DxOut deriv_spline_vNoDeriv_float_u_colorarrayDx.tif -o DyOut deriv_spline_vNoDeriv_float_u_colorarrayDy.tif test_deriv_spline_vNoDeriv_float_u_colorarray') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_vNoDeriv_float_c_colorarray.tif -o DxOut deriv_spline_vNoDeriv_float_c_colorarrayDx.tif -o DyOut deriv_spline_vNoDeriv_float_c_colorarrayDy.tif test_deriv_spline_vNoDeriv_float_c_colorarray') outputs.append('deriv_spline_vNoDeriv_float_v_colorarray.tif') outputs.append('deriv_spline_vNoDeriv_float_v_colorarrayDx.tif') outputs.append('deriv_spline_vNoDeriv_float_v_colorarrayDy.tif') outputs.append('deriv_spline_vNoDeriv_float_u_colorarray.tif') outputs.append('deriv_spline_vNoDeriv_float_u_colorarrayDx.tif') outputs.append('deriv_spline_vNoDeriv_float_u_colorarrayDy.tif') outputs.append('deriv_spline_vNoDeriv_float_c_colorarray.tif') outputs.append('deriv_spline_vNoDeriv_float_c_colorarrayDx.tif') outputs.append('deriv_spline_vNoDeriv_float_c_colorarrayDy.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_v_float_vNoDeriv_colorarray.tif -o DxOut deriv_spline_v_float_vNoDeriv_colorarrayDx.tif -o DyOut deriv_spline_v_float_vNoDeriv_colorarrayDy.tif test_deriv_spline_v_float_vNoDeriv_colorarray') outputs.append('deriv_spline_v_float_vNoDeriv_colorarray.tif') outputs.append('deriv_spline_v_float_vNoDeriv_colorarrayDx.tif') outputs.append('deriv_spline_v_float_vNoDeriv_colorarrayDy.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_u_float_vNoDeriv_colorarray.tif -o DxOut deriv_spline_u_float_vNoDeriv_colorarrayDx.tif -o DyOut deriv_spline_u_float_vNoDeriv_colorarrayDy.tif test_deriv_spline_u_float_vNoDeriv_colorarray') outputs.append('deriv_spline_u_float_vNoDeriv_colorarray.tif') outputs.append('deriv_spline_u_float_vNoDeriv_colorarrayDx.tif') outputs.append('deriv_spline_u_float_vNoDeriv_colorarrayDy.tif') command += testshade('--vary_udxdy --vary_vdxdy -t 1 -g 64 64 -od uint8 -o ValOut deriv_spline_c_float_vNoDeriv_colorarray.tif -o DxOut deriv_spline_c_float_vNoDeriv_colorarrayDx.tif -o DyOut deriv_spline_c_float_vNoDeriv_colorarrayDy.tif test_deriv_spline_c_float_vNoDeriv_colorarray') outputs.append('deriv_spline_c_float_vNoDeriv_colorarray.tif') outputs.append('deriv_spline_c_float_vNoDeriv_colorarrayDx.tif') outputs.append('deriv_spline_c_float_vNoDeriv_colorarrayDy.tif') failthresh = 0.008 failpercent = 3
# coding: utf-8 n, r, avg = [int(i) for i in input().split()] li = [] for i in range(n): tmp = [int(i) for i in input().split()] li.append([tmp[1],tmp[0]]) li.sort(reverse=True) dis = avg*n-sum([i[1] for i in li]) ans = 0 while dis > 0: exam = li.pop() if dis <= r-exam[1]: ans += exam[0]*dis dis = 0 else: ans += exam[0]*(r-exam[1]) dis -= r-exam[1] print(ans)
(n, r, avg) = [int(i) for i in input().split()] li = [] for i in range(n): tmp = [int(i) for i in input().split()] li.append([tmp[1], tmp[0]]) li.sort(reverse=True) dis = avg * n - sum([i[1] for i in li]) ans = 0 while dis > 0: exam = li.pop() if dis <= r - exam[1]: ans += exam[0] * dis dis = 0 else: ans += exam[0] * (r - exam[1]) dis -= r - exam[1] print(ans)
#elif basic a = 10 if(a < 1): print('benar') elif(a > 1): print('salah') elif(a == 1): print('input salah') else: print('input salah')
a = 10 if a < 1: print('benar') elif a > 1: print('salah') elif a == 1: print('input salah') else: print('input salah')
class Solution: def createTargetArray(self, nums, index): target = [] for n, i in zip(nums, index): target.insert(i, n) return target
class Solution: def create_target_array(self, nums, index): target = [] for (n, i) in zip(nums, index): target.insert(i, n) return target
cmd = [] with open('input.txt', 'r') as f: cmd = list(map(lambda l: l.strip().split(' '), f.readlines())) horizon_pos = 0 deep = 0 aim = 0 for c in cmd: if c[0] == 'forward': val = int(c[1]) horizon_pos += val deep += aim * val elif c[0] == 'down': aim += int(c[1]) elif c[0] == 'up': aim -= int(c[1]) print(horizon_pos*deep)
cmd = [] with open('input.txt', 'r') as f: cmd = list(map(lambda l: l.strip().split(' '), f.readlines())) horizon_pos = 0 deep = 0 aim = 0 for c in cmd: if c[0] == 'forward': val = int(c[1]) horizon_pos += val deep += aim * val elif c[0] == 'down': aim += int(c[1]) elif c[0] == 'up': aim -= int(c[1]) print(horizon_pos * deep)
class ChildObject: def __init__(self, sumo_client, meta_data): self.sumo = sumo_client self.__blob = None self.__png = None source = meta_data["_source"] fields = meta_data["fields"] self.tag_name = fields["tag_name"][0] self.sumo_id = meta_data["_id"] self.name = source["data"]["name"] self.iteration_id = source["fmu"]["iteration"]["id"] self.relative_path = source["file"]["relative_path"] self.meta_data = source self.object_type = source["class"] if "realization" in source["fmu"]: self.realization_id = source["fmu"]["realization"]["id"] else: self.realization_id = None if "aggregation" in source["fmu"]: self.aggregation = source["fmu"]["aggregation"]["operation"] else: self.aggregation = None @property def blob(self): if self.__blob is None: self.__blob = self.__get_blob() return self.__blob def __get_blob(self): blob = self.sumo.get(f"/objects('{self.sumo_id}')/blob") return blob @property def png(self): if self.__png is None: self.__png = self.__get_png() return self.__png def __get_png(self): png = self.sumo.get(f"/objects('{self.sumo_id}')/blob", encoder="png") return png
class Childobject: def __init__(self, sumo_client, meta_data): self.sumo = sumo_client self.__blob = None self.__png = None source = meta_data['_source'] fields = meta_data['fields'] self.tag_name = fields['tag_name'][0] self.sumo_id = meta_data['_id'] self.name = source['data']['name'] self.iteration_id = source['fmu']['iteration']['id'] self.relative_path = source['file']['relative_path'] self.meta_data = source self.object_type = source['class'] if 'realization' in source['fmu']: self.realization_id = source['fmu']['realization']['id'] else: self.realization_id = None if 'aggregation' in source['fmu']: self.aggregation = source['fmu']['aggregation']['operation'] else: self.aggregation = None @property def blob(self): if self.__blob is None: self.__blob = self.__get_blob() return self.__blob def __get_blob(self): blob = self.sumo.get(f"/objects('{self.sumo_id}')/blob") return blob @property def png(self): if self.__png is None: self.__png = self.__get_png() return self.__png def __get_png(self): png = self.sumo.get(f"/objects('{self.sumo_id}')/blob", encoder='png') return png
confusables = { u'\u2460': '1', u'\u2780': '1', u'\U0001D7D0': '2', u'\U0001D7DA': '2', u'\U0001D7E4': '2', u'\U0001D7EE': '2', u'\U0001D7F8': '2', u'\uA75A': '2', u'\u01A7': '2', u'\u03E8': '2', u'\uA644': '2', u'\u14BF': '2', u'\uA6EF': '2', u'\u2461': '2', u'\u2781': '2', u'\u01BB': '2', u'\U0001F103': '2.', u'\u2489': '2.', u'\U0001D206': '3', u'\U0001D7D1': '3', u'\U0001D7DB': '3', u'\U0001D7E5': '3', u'\U0001D7EF': '3', u'\U0001D7F9': '3', u'\U00016F3B': '3', u'\U000118CA': '3', u'\uA7AB': '3', u'\u021C': '3', u'\u01B7': '3', u'\uA76A': '3', u'\u2CCC': '3', u'\u0417': '3', u'\u04E0': '3', u'\u0AE9': '3', u'\u2462': '3', u'\u0498': '3', u'\U0001F104': '3.', u'\u248A': '3.', u'\U0001D7D2': '4', u'\U0001D7DC': '4', u'\U0001D7E6': '4', u'\U0001D7F0': '4', u'\U0001D7FA': '4', u'\U000118AF': '4', u'\u13CE': '4', u'\u2463': '4', u'\u2783': '4', u'\u1530': '4', u'\U0001F105': '4.', u'\u248B': '4.', u'\U0001D7D3': '5', u'\U0001D7DD': '5', u'\U0001D7E7': '5', u'\U0001D7F1': '5', u'\U0001D7FB': '5', u'\U000118BB': '5', u'\u01BC': '5', u'\u2464': '5', u'\u2784': '5', u'\U0001F106': '5.', u'\u248C': '5.', u'\U0001D7D4': '6', u'\U0001D7DE': '6', u'\U0001D7E8': '6', u'\U0001D7F2': '6', u'\U0001D7FC': '6', u'\U000118D5': '6', u'\u2CD2': '6', u'\u0431': '6', u'\u13EE': '6', u'\u2465': '6', u'\u2785': '6', u'\U0001F107': '6.', u'\u248D': '6.', u'\U0001D212': '7', u'\U0001D7D5': '7', u'\U0001D7DF': '7', u'\U0001D7E9': '7', u'\U0001D7F3': '7', u'\U0001D7FD': '7', u'\U000104D2': '7', u'\U000118C6': '7', u'\u2466': '7', u'\u2786': '7', u'\U0001F108': '7.', u'\u248E': '7.', u'\U0001E8CB': '8', u'\U0001D7D6': '8', u'\U0001D7E0': '8', u'\U0001D7EA': '8', u'\U0001D7F4': '8', u'\U0001D7FE': '8', u'\U0001031A': '8', u'\u0B03': '8', u'\u09EA': '8', u'\u0A6A': '8', u'\u0223': '8', u'\u0222': '8', u'\u2467': '8', u'\u2787': '8', u'\U0001F109': '8.', u'\u248F': '8.', u'\U0001D7D7': '9', u'\U0001D7E1': '9', u'\U0001D7E4': '9', u'\U0001D7EB': '9', u'\U0001D7F5': '9', u'\U0001D7FF': '9', u'\U000118CC': '9', u'\U000118AC': '9', u'\U000118D6': '9', u'\u0A67': '9', u'\u0B68': '9', u'\u09ED': '9', u'\u0D6D': '9', u'\uA76E': '9', u'\u2CCA': '9', u'\u0967': '9', u'\u06F9': '9', u'\u2468': '9', u'\u2788': '9', u'\U0001F10A': '9.', u'\u2490': '9.', u'\U0001D41A': 'a', u'\U0001D44E': 'a', u'\U0001D482': 'a', u'\U0001D4B6': 'a', u'\U0001D4EA': 'a', u'\U0001D51E': 'a', u'\U0001D552': 'a', u'\U0001D586': 'a', u'\U0001D5BA': 'a', u'\U0001D5EE': 'a', u'\U0001D622': 'a', u'\U0001D656': 'a', u'\U0001D68A': 'a', u'\U0001D6C2': 'a', u'\U0001D6FC': 'a', u'\U0001D736': 'a', u'\U0001D770': 'a', u'\U0001D7AA': 'a', u'\U0001D400': 'a', u'\U0001D434': 'a', u'\U0001D468': 'a', u'\U0001D49C': 'a', u'\U0001D4D0': 'a', u'\U0001D504': 'a', u'\U0001D538': 'a', u'\U0001D56C': 'a', u'\U0001D5A0': 'a', u'\U0001D5D4': 'a', u'\U0001D608': 'a', u'\U0001D63C': 'a', u'\U0001D670': 'a', u'\U0001D6A8': 'a', u'\U0001D6E2': 'a', u'\U0001D71C': 'a', u'\U0001D756': 'a', u'\U0001D790': 'a', u'\u237A': 'a', u'\uFF41': 'a', u'\u0251': 'a', u'\u03B1': 'a', u'\u0430': 'a', u'\u2DF6': 'a', u'\uFF21': 'a', u'\u0391': 'a', u'\u0410': 'a', u'\u13AA': 'a', u'\u15C5': 'a', u'\uA4EE': 'a', u'\u2376': 'a', u'\u01CE': 'a', u'\u0103': 'a', u'\u01CD': 'a', u'\u0102': 'a', u'\u0227': 'a', u'\u00E5': 'a', u'\u0226': 'a', u'\u00C5': 'a', u'\u1E9A': 'a', u'\u1EA3': 'a', u'\uAB7A': 'a', u'\u1D00': 'a', u'\uA733': 'aa', u'\uA732': 'aa', u'\u00E6': 'ae', u'\u04D5': 'ae', u'\u00C6': 'ae', u'\u04D4': 'ae', u'\uA735': 'ao', u'\uA734': 'ao', u'\U0001F707': 'ar', u'\uA737': 'au', u'\uA736': 'au', u'\uA738': 'av', u'\uA739': 'av', u'\uA73A': 'av', u'\uA73B': 'av', u'\uA73D': 'ay', u'\uA73C': 'ay', u'\U0001D41B': 'b', u'\U0001D44F': 'b', u'\U0001D483': 'b', u'\U0001D4B7': 'b', u'\U0001D4EB': 'b', u'\U0001D51F': 'b', u'\U0001D553': 'b', u'\U0001D587': 'b', u'\U0001D5BB': 'b', u'\U0001D5EF': 'b', u'\U0001D623': 'b', u'\U0001D657': 'b', u'\U0001D68B': 'b', u'\U0001D401': 'b', u'\U0001D435': 'b', u'\U0001D469': 'b', u'\U0001D4D1': 'b', u'\U0001D505': 'b', u'\U0001D539': 'b', u'\U0001D56D': 'b', u'\U0001D5A1': 'b', u'\U0001D5D5': 'b', u'\U0001D609': 'b', u'\U0001D63D': 'b', u'\U0001D671': 'b', u'\U0001D6A9': 'b', u'\U0001D6E3': 'b', u'\U0001D71D': 'b', u'\U0001D757': 'b', u'\U0001D791': 'b', u'\U00010282': 'b', u'\U000102A1': 'b', u'\U00010301': 'b', u'\U0001D6C3': 'b', u'\U0001D6FD': 'b', u'\U0001D737': 'b', u'\U0001D771': 'b', u'\U0001D7AB': 'b', u'\u0184': 'b', u'\u042C': 'b', u'\u13CF': 'b', u'\u15AF': 'b', u'\uFF22': 'b', u'\u212C': 'b', u'\uA7B4': 'b', u'\u0392': 'b', u'\u0412': 'b', u'\u13F4': 'b', u'\u15F7': 'b', u'\uA4D0': 'b', u'\u0253': 'b', u'\u0183': 'b', u'\u0182': 'b', u'\u0411': 'b', u'\u0180': 'b', u'\u048D': 'b', u'\u048C': 'b', u'\u0463': 'b', u'\u0462': 'b', u'\u0432': 'b', u'\u13FC': 'b', u'\u0299': 'b', u'\uA7B5': 'b', u'\u03B2': 'b', u'\u03D0': 'b', u'\u13F0': 'b', u'\u00DF': 'b', u'\u042B': 'bl', u'\U0001D41C': 'c', u'\U0001D450': 'c', u'\U0001D484': 'c', u'\U0001D4B8': 'c', u'\U0001D4EC': 'c', u'\U0001D520': 'c', u'\U0001D554': 'c', u'\U0001D588': 'c', u'\U0001D5BC': 'c', u'\U0001D5F0': 'c', u'\U0001D624': 'c', u'\U0001D658': 'c', u'\U0001D68C': 'c', u'\U0001043D': 'c', u'\U0001F74C': 'c', u'\U000118F2': 'c', u'\U000118E9': 'c', u'\U0001D402': 'c', u'\U0001D436': 'c', u'\U0001D46A': 'c', u'\U0001D49E': 'c', u'\U0001D4D2': 'c', u'\U0001D56E': 'c', u'\U0001D5A2': 'c', u'\U0001D5D6': 'c', u'\U0001D60A': 'c', u'\U0001D63E': 'c', u'\U0001D672': 'c', u'\U000102A2': 'c', u'\U00010302': 'c', u'\U00010415': 'c', u'\U0001051C': 'c', u'\uFF43': 'c', u'\u217D': 'c', u'\u1D04': 'c', u'\u03F2': 'c', u'\u2CA5': 'c', u'\u0441': 'c', u'\uABAF': 'c', u'\u2DED': 'c', u'\uFF23': 'c', u'\u216D': 'c', u'\u2102': 'c', u'\u212D': 'c', u'\u03F9': 'c', u'\u2CA4': 'c', u'\u0421': 'c', u'\u13DF': 'c', u'\uA4DA': 'c', u'\u00A2': 'c', u'\u023C': 'c', u'\u20A1': 'c', u'\u00E7': 'c', u'\u04AB': 'c', u'\u00C7': 'c', u'\u04AA': 'c', u'\u0187': 'c', u'\U0001D41D': 'd', u'\U0001D451': 'd', u'\U0001D485': 'd', u'\U0001D4B9': 'd', u'\U0001D4ED': 'd', u'\U0001D521': 'd', u'\U0001D555': 'd', u'\U0001D589': 'd', u'\U0001D5BD': 'd', u'\U0001D5F1': 'd', u'\U0001D625': 'd', u'\U0001D659': 'd', u'\U0001D68D': 'd', u'\U0001D403': 'd', u'\U0001D437': 'd', u'\U0001D46B': 'd', u'\U0001D49F': 'd', u'\U0001D4D3': 'd', u'\U0001D507': 'd', u'\U0001D53B': 'd', u'\U0001D56F': 'd', u'\U0001D5A3': 'd', u'\U0001D5D7': 'd', u'\U0001D60B': 'd', u'\U0001D63F': 'd', u'\U0001D673': 'd', u'\u217E': 'd', u'\u2146': 'd', u'\u0501': 'd', u'\u13E7': 'd', u'\u146F': 'd', u'\uA4D2': 'd', u'\u216E': 'd', u'\u2145': 'd', u'\u13A0': 'd', u'\u15DE': 'd', u'\u15EA': 'd', u'\uA4D3': 'd', u'\u0257': 'd', u'\u0256': 'd', u'\u018C': 'd', u'\u0111': 'd', u'\u0110': 'd', u'\u00D0': 'd', u'\u0189': 'd', u'\u20AB': 'd', u'\u147B': 'd', u'\u1487': 'd', u'\u0257': 'd', u'\u0256': 'd', u'\u018C': 'd', u'\u0111': 'd', u'\u0110': 'd', u'\u00D0': 'd', u'\u0189': 'd', u'\u20AB': 'd', u'\u147B': 'd', u'\u1487': 'd', u'\uAB70': 'd', u'\U0001D41E': 'e', u'\U0001D452': 'e', u'\U0001D486': 'e', u'\U0001D4EE': 'e', u'\U0001D522': 'e', u'\U0001D556': 'e', u'\U0001D58A': 'e', u'\U0001D5BE': 'e', u'\U0001D5F2': 'e', u'\U0001D626': 'e', u'\U0001D65A': 'e', u'\U0001D68E': 'e', u'\U0001D404': 'e', u'\U0001D438': 'e', u'\U0001D46C': 'e', u'\U0001D4D4': 'e', u'\U0001D508': 'e', u'\U0001D53C': 'e', u'\U0001D570': 'e', u'\U0001D5A4': 'e', u'\U0001D5D8': 'e', u'\U0001D60C': 'e', u'\U0001D640': 'e', u'\U0001D674': 'e', u'\U0001D6AC': 'e', u'\U0001D6E6': 'e', u'\U0001D720': 'e', u'\U0001D75A': 'e', u'\U0001D794': 'e', u'\U000118A6': 'e', u'\U000118AE': 'e', u'\U00010286': 'e', u'\U0001D221': 'e', u'\u212E': 'e', u'\uFF45': 'e', u'\u212F': 'e', u'\u2147': 'e', u'\uAB32': 'e', u'\u0435': 'e', u'\u04BD': 'e', u'\u2DF7': 'e', u'\u22FF': 'e', u'\uFF25': 'e', u'\u2130': 'e', u'\u0395': 'e', u'\u0415': 'e', u'\u2D39': 'e', u'\u13AC': 'e', u'\uA4F0': 'e', u'\u011B': 'e', u'\u011A': 'e', u'\u0247': 'e', u'\u0246': 'e', u'\u04BF': 'e', u'\uAB7C': 'e', u'\u1D07': 'e', u'\u0259': 'e', u'\u01DD': 'e', u'\u04D9': 'e', u'\u2107': 'e', u'\u0510': 'e', u'\u13CB': 'e', u'\U0001D41F': 'f', u'\U0001D453': 'f', u'\U0001D487': 'f', u'\U0001D4BB': 'f', u'\U0001D4EF': 'f', u'\U0001D523': 'f', u'\U0001D557': 'f', u'\U0001D58B': 'f', u'\U0001D5BF': 'f', u'\U0001D5F3': 'f', u'\U0001D627': 'f', u'\U0001D65B': 'f', u'\U0001D68F': 'f', u'\U0001D213': 'f', u'\U0001D405': 'f', u'\U0001D439': 'f', u'\U0001D46D': 'f', u'\U0001D4D5': 'f', u'\U0001D509': 'f', u'\U0001D53D': 'f', u'\U0001D571': 'f', u'\U0001D5A5': 'f', u'\U0001D5D9': 'f', u'\U0001D60D': 'f', u'\U0001D641': 'f', u'\U0001D675': 'f', u'\U0001D7CA': 'f', u'\U000118C2': 'f', u'\U000118A2': 'f', u'\U00010287': 'f', u'\U000102A5': 'f', u'\U00010525': 'f', u'\uAB35': 'f', u'\uA799': 'f', u'\u017F': 'f', u'\u1E9D': 'f', u'\u0584': 'f', u'\u2131': 'f', u'\uA798': 'f', u'\u03DC': 'f', u'\u15B4': 'f', u'\uA4DD': 'f', u'\u0192': 'f', u'\u0191': 'f', u'\u1D6E': 'f', u'\uFB00': 'ff', u'\uFB03': 'ffi', u'\uFB04': 'ffl', u'\uFB01': 'fi', u'\uFB02': 'fl', u'\u02A9': 'fn', u'\U0001D420': 'g', u'\U0001D454': 'g', u'\U0001D488': 'g', u'\U0001D4F0': 'g', u'\U0001D524': 'g', u'\U0001D558': 'g', u'\U0001D58C': 'g', u'\U0001D5C0': 'g', u'\U0001D5F4': 'g', u'\U0001D628': 'g', u'\U0001D65C': 'g', u'\U0001D690': 'g', u'\U0001D406': 'g', u'\U0001D43A': 'g', u'\U0001D46E': 'g', u'\U0001D4A2': 'g', u'\U0001D4D6': 'g', u'\U0001D50A': 'g', u'\U0001D53E': 'g', u'\U0001D572': 'g', u'\U0001D5A6': 'g', u'\U0001D5DA': 'g', u'\U0001D60E': 'g', u'\U0001D642': 'g', u'\U0001D676': 'g', u'\uFF47': 'g', u'\u210A': 'g', u'\u0261': 'g', u'\u1D83': 'g', u'\u018D': 'g', u'\u0581': 'g', u'\u050C': 'g', u'\u13C0': 'g', u'\u13F3': 'g', u'\uA4D6': 'g', u'\u1DA2': 'g', u'\u1D4D': 'g', u'\u0260': 'g', u'\u01E7': 'g', u'\u011F': 'g', u'\u01E6': 'g', u'\u011E': 'g', u'\u01F5': 'g', u'\u0123': 'g', u'\u01E5': 'g', u'\u01E4': 'g', u'\u0193': 'g', u'\u050D': 'g', u'\uAB90': 'g', u'\u13FB': 'g', u'\U0001D421': 'h', u'\U0001D489': 'h', u'\U0001D4BD': 'h', u'\U0001D4F1': 'h', u'\U0001D525': 'h', u'\U0001D559': 'h', u'\U0001D58D': 'h', u'\U0001D5C1': 'h', u'\U0001D5F5': 'h', u'\U0001D629': 'h', u'\U0001D65D': 'h', u'\U0001D691': 'h', u'\U0001D407': 'h', u'\U0001D43B': 'h', u'\U0001D46F': 'h', u'\U0001D4D7': 'h', u'\U0001D573': 'h', u'\U0001D5A7': 'h', u'\U0001D5DB': 'h', u'\U0001D60F': 'h', u'\U0001D643': 'h', u'\U0001D677': 'h', u'\U0001D6AE': 'h', u'\U0001D6E8': 'h', u'\U0001D722': 'h', u'\U0001D75C': 'h', u'\U0001D796': 'h', u'\U000102CF': 'h', u'\U00010199': 'h', u'\uFF48': 'h', u'\u210E': 'h', u'\u04BB': 'h', u'\u0570': 'h', u'\u13C2': 'h', u'\uFF28': 'h', u'\u210B': 'h', u'\u210C': 'h', u'\u210D': 'h', u'\u0397': 'h', u'\u2C8E': 'h', u'\u041D': 'h', u'\u13BB': 'h', u'\u157C': 'h', u'\uA4E7': 'h', u'\u1D78': 'h', u'\u1D34': 'h', u'\u0266': 'h', u'\uA695': 'h', u'\u13F2': 'h', u'\u2C67': 'h', u'\u04A2': 'h', u'\u0127': 'h', u'\u210F': 'h', u'\u045B': 'h', u'\u0126': 'h', u'\u04C9': 'h', u'\u04C7': 'h', u'\u043D': 'h', u'\u029C': 'h', u'\uAB8B': 'h', u'\u04A3': 'h', u'\u04CA': 'h', u'\u04C8': 'h', u'\U0001D422': 'i', u'\U0001D456': 'i', u'\U0001D48A': 'i', u'\U0001D4BE': 'i', u'\U0001D4F2': 'i', u'\U0001D526': 'i', u'\U0001D55A': 'i', u'\U0001D58E': 'i', u'\U0001D5C2': 'i', u'\U0001D5F6': 'i', u'\U0001D62A': 'i', u'\U0001D65E': 'i', u'\U0001D692': 'i', u'\U0001D6A4': 'i', u'\U0001D6CA': 'i', u'\U0001D704': 'i', u'\U0001D73E': 'i', u'\U0001D778': 'i', u'\U0001D7B2': 'i', u'\U000118C3': 'i', u'\u02DB': 'i', u'\u2373': 'i', u'\uFF49': 'i', u'\u2170': 'i', u'\u2139': 'i', u'\u2148': 'i', u'\u0131': 'i', u'\u026A': 'i', u'\u0269': 'i', u'\u03B9': 'i', u'\u1FBE': 'i', u'\u037A': 'i', u'\u0456': 'i', u'\uA647': 'i', u'\u04CF': 'i', u'\uAB75': 'i', u'\u13A5': 'i', u'\u24DB': 'i', u'\u2378': 'i', u'\u01D0': 'i', u'\u01CF': 'i', u'\u0268': 'i', u'\u1D7B': 'i', u'\u1D7C': 'i', u'\u2171': 'ii', u'\u2172': 'iii', u'\u0133': 'ij', u'\u2173': 'iv', u'\u2178': 'ix', u'\U0001D423': 'j', u'\U0001D457': 'j', u'\U0001D48B': 'j', u'\U0001D4BF': 'j', u'\U0001D4F3': 'j', u'\U0001D527': 'j', u'\U0001D55B': 'j', u'\U0001D58F': 'j', u'\U0001D5C3': 'j', u'\U0001D5F7': 'j', u'\U0001D62B': 'j', u'\U0001D65F': 'j', u'\U0001D693': 'j', u'\U0001D409': 'j', u'\U0001D43D': 'j', u'\U0001D471': 'j', u'\U0001D4A5': 'j', u'\U0001D4D9': 'j', u'\U0001D50D': 'j', u'\U0001D541': 'j', u'\U0001D575': 'j', u'\U0001D5A9': 'j', u'\U0001D5DD': 'j', u'\U0001D611': 'j', u'\U0001D645': 'j', u'\U0001D679': 'j', u'\U0001D6A5': 'j', u'\uFF4A': 'j', u'\u2149': 'j', u'\u03F3': 'j', u'\u0458': 'j', u'\uFF2A': 'j', u'\uA7B2': 'j', u'\u037F': 'j', u'\u0408': 'j', u'\u13AB': 'j', u'\u148D': 'j', u'\uA4D9': 'j', u'\u0249': 'j', u'\u0248': 'j', u'\u1499': 'j', u'\u0575': 'j', u'\uAB7B': 'j', u'\u1D0A': 'j', u'\U0001D424': 'k', u'\U0001D458': 'k', u'\U0001D48C': 'k', u'\U0001D4C0': 'k', u'\U0001D4F4': 'k', u'\U0001D528': 'k', u'\U0001D55C': 'k', u'\U0001D590': 'k', u'\U0001D5C4': 'k', u'\U0001D5F8': 'k', u'\U0001D62C': 'k', u'\U0001D660': 'k', u'\U0001D694': 'k', u'\U0001D40A': 'k', u'\U0001D43E': 'k', u'\U0001D472': 'k', u'\U0001D4A6': 'k', u'\U0001D4DA': 'k', u'\U0001D50E': 'k', u'\U0001D542': 'k', u'\U0001D576': 'k', u'\U0001D5AA': 'k', u'\U0001D5DE': 'k', u'\U0001D612': 'k', u'\U0001D646': 'k', u'\U0001D67A': 'k', u'\U0001D6B1': 'k', u'\U0001D6EB': 'k', u'\U0001D725': 'k', u'\U0001D75F': 'k', u'\U0001D799': 'k', u'\U0001D6CB': 'k', u'\U0001D6DE': 'k', u'\U0001D705': 'k', u'\U0001D718': 'k', u'\U0001D73F': 'k', u'\U0001D752': 'k', u'\U0001D779': 'k', u'\U0001D78C': 'k', u'\U0001D7B3': 'k', u'\U0001D7C6': 'k', u'\u212A': 'k', u'\uFF2B': 'k', u'\u039A': 'k', u'\u2C94': 'k', u'\u041A': 'k', u'\u13E6': 'k', u'\u16D5': 'k', u'\uA4D7': 'k', u'\u0199': 'k', u'\u2C69': 'k', u'\u049A': 'k', u'\u20AD': 'k', u'\uA740': 'k', u'\u049E': 'k', u'\u0198': 'k', u'\u1D0B': 'k', u'\u0138': 'k', u'\u03BA': 'k', u'\u03F0': 'k', u'\u2C95': 'k', u'\u043A': 'k', u'\uABB6': 'k', u'\u049B': 'k', u'\u049F': 'k', u'\U00010320': 'l', u'\U0001E8C7': 'l', u'\U0001D7CF': 'l', u'\U0001D7D9': 'l', u'\U0001D7E3': 'l', u'\U0001D7ED': 'l', u'\U0001D7F7': 'l', u'\U0001D408': 'l', u'\U0001D43C': 'l', u'\U0001D470': 'l', u'\U0001D4D8': 'l', u'\U0001D540': 'l', u'\U0001D574': 'l', u'\U0001D5A8': 'l', u'\U0001D5DC': 'l', u'\U0001D610': 'l', u'\U0001D644': 'l', u'\U0001D678': 'l', u'\U0001D425': 'l', u'\U0001D459': 'l', u'\U0001D48D': 'l', u'\U0001D4C1': 'l', u'\U0001D4F5': 'l', u'\U0001D529': 'l', u'\U0001D55D': 'l', u'\U0001D591': 'l', u'\U0001D5C5': 'l', u'\U0001D5F9': 'l', u'\U0001D62D': 'l', u'\U0001D661': 'l', u'\U0001D695': 'l', u'\U0001D6B0': 'l', u'\U0001D6EA': 'l', u'\U0001D724': 'l', u'\U0001D75E': 'l', u'\U0001D798': 'l', u'\U0001EE00': 'l', u'\U0001EE80': 'l', u'\U00016F28': 'l', u'\U0001028A': 'l', u'\U00010309': 'l', u'\U0001D22A': 'l', u'\U0001D40B': 'l', u'\U0001D43F': 'l', u'\U0001D473': 'l', u'\U0001D4DB': 'l', u'\U0001D50F': 'l', u'\U0001D543': 'l', u'\U0001D577': 'l', u'\U0001D5AB': 'l', u'\U0001D5DF': 'l', u'\U0001D613': 'l', u'\U0001D647': 'l', u'\U0001D67B': 'l', u'\U00016F16': 'l', u'\U000118A3': 'l', u'\U000118B2': 'l', u'\U0001041B': 'l', u'\U00010526': 'l', u'\U00010443': 'l', u'\u05C0': 'l', u'\u007C': 'l', u'\u2223': 'l', u'\u23FD': 'l', u'\uFFE8': 'l', u'\u0031': 'l', u'\u0661': 'l', u'\u06F1': 'l', u'\u0049': 'l', u'\uFF29': 'l', u'\u2160': 'l', u'\u2110': 'l', u'\u2111': 'l', u'\u0196': 'l', u'\uFF4C': 'l', u'\u217C': 'l', u'\u2113': 'l', u'\u01C0': 'l', u'\u0399': 'l', u'\u2C92': 'l', u'\u0406': 'l', u'\u04C0': 'l', u'\u05D5': 'l', u'\u05DF': 'l', u'\u0627': 'l', u'\uFE8E': 'l', u'\uFE8D': 'l', u'\u07CA': 'l', u'\u2D4F': 'l', u'\u16C1': 'l', u'\uA4F2': 'l', u'\u216C': 'l', u'\u2112': 'l', u'\u2CD0': 'l', u'\u13DE': 'l', u'\u14AA': 'l', u'\uA4E1': 'l', u'\uFD3C': 'l', u'\uFD3D': 'l', u'\u0142': 'l', u'\u0141': 'l', u'\u026D': 'l', u'\u0197': 'l', u'\u019A': 'l', u'\u026B': 'l', u'\u0625': 'l', u'\uFE88': 'l', u'\uFE87': 'l', u'\u0673': 'l', u'\u0140': 'l', u'\u013F': 'l', u'\u14B7': 'l', u'\u0623': 'l', u'\uFE84': 'l', u'\uFE83': 'l', u'\u0672': 'l', u'\u0675': 'l', u'\u2CD1': 'l', u'\uABAE': 'l', u'\U0001F102': 'l.', u'\u2488': 'l.', u'\u01C9': 'lj', u'\u0132': 'lj', u'\u01C8': 'lj', u'\u01C7': 'lj', u'\u2016': 'll', u'\u2225': 'll', u'\u2161': 'll', u'\u01C1': 'll', u'\u05F0': 'll', u'\u2162': 'lll', u'\u02AA': 'ls', u'\u20B6': 'lt', u'\u2163': 'lv', u'\u2168': 'lx', u'\u02AB': 'lz', u'\U0001D40C': 'm', u'\U0001D440': 'm', u'\U0001D474': 'm', u'\U0001D4DC': 'm', u'\U0001D510': 'm', u'\U0001D544': 'm', u'\U0001D578': 'm', u'\U0001D5AC': 'm', u'\U0001D5E0': 'm', u'\U0001D614': 'm', u'\U0001D648': 'm', u'\U0001D67C': 'm', u'\U0001D6B3': 'm', u'\U0001D6ED': 'm', u'\U0001D727': 'm', u'\U0001D761': 'm', u'\U0001D79B': 'm', u'\U000102B0': 'm', u'\U00010311': 'm', u'\uFF2D': 'm', u'\u216F': 'm', u'\u2133': 'm', u'\u039C': 'm', u'\u03FA': 'm', u'\u2C98': 'm', u'\u041C': 'm', u'\u13B7': 'm', u'\u15F0': 'm', u'\u16D6': 'm', u'\uA4DF': 'm', u'\u04CD': 'm', u'\u2DE8': 'm', u'\u1DDF': 'm', u'\u1E43': 'm', u'\U0001F76B': 'mb', u'\U0001D427': 'n', u'\U0001D45B': 'n', u'\U0001D48F': 'n', u'\U0001D4C3': 'n', u'\U0001D4F7': 'n', u'\U0001D52B': 'n', u'\U0001D55F': 'n', u'\U0001D593': 'n', u'\U0001D5C7': 'n', u'\U0001D5FB': 'n', u'\U0001D62F': 'n', u'\U0001D663': 'n', u'\U0001D697': 'n', u'\U0001D40D': 'n', u'\U0001D441': 'n', u'\U0001D475': 'n', u'\U0001D4A9': 'n', u'\U0001D4DD': 'n', u'\U0001D511': 'n', u'\U0001D579': 'n', u'\U0001D5AD': 'n', u'\U0001D5E1': 'n', u'\U0001D615': 'n', u'\U0001D649': 'n', u'\U0001D67D': 'n', u'\U0001D6B4': 'n', u'\U0001D6EE': 'n', u'\U0001D728': 'n', u'\U0001D762': 'n', u'\U0001D79C': 'n', u'\U00010513': 'n', u'\U0001018E': 'n', u'\U0001D6C8': 'n', u'\U0001D702': 'n', u'\U0001D73C': 'n', u'\U0001D776': 'n', u'\U0001D7B0': 'n', u'\U0001044D': 'n', u'\u0578': 'n', u'\u057C': 'n', u'\uFF2E': 'n', u'\u2115': 'n', u'\u039D': 'n', u'\u2C9A': 'n', u'\uA4E0': 'n', u'\u0273': 'n', u'\u019E': 'n', u'\u03B7': 'n', u'\u019D': 'n', u'\u1D70': 'n', u'\u0146': 'n', u'\u0272': 'n', u'\u01CC': 'nj', u'\u01CB': 'nj', u'\u01CA': 'nj', u'\u2116': 'no', u'\U0001D428': 'o', u'\U0001D45C': 'o', u'\U0001D490': 'o', u'\U0001D4F8': 'o', u'\U0001D52C': 'o', u'\U0001D560': 'o', u'\U0001D594': 'o', u'\U0001D5C8': 'o', u'\U0001D5FC': 'o', u'\U0001D630': 'o', u'\U0001D664': 'o', u'\U0001D698': 'o', u'\U0001D6D0': 'o', u'\U0001D70A': 'o', u'\U0001D744': 'o', u'\U0001D77E': 'o', u'\U0001D7B8': 'o', u'\U0001D6D4': 'o', u'\U0001D70E': 'o', u'\U0001D748': 'o', u'\U0001D782': 'o', u'\U0001D7BC': 'o', u'\U0001EE24': 'o', u'\U0001EE64': 'o', u'\U0001EE84': 'o', u'\U000104EA': 'o', u'\U000118C8': 'o', u'\U000118D7': 'o', u'\U0001042C': 'o', u'\U000114D0': 'o', u'\U000118E0': 'o', u'\U0001D7CE': 'o', u'\U0001D7D8': 'o', u'\U0001D7E2': 'o', u'\U0001D7EC': 'o', u'\U0001D7F6': 'o', u'\U0001D40E': 'o', u'\U0001D442': 'o', u'\U0001D476': 'o', u'\U0001D4AA': 'o', u'\U0001D4DE': 'o', u'\U0001D512': 'o', u'\U0001D546': 'o', u'\U0001D57A': 'o', u'\U0001D5AE': 'o', u'\U0001D5E2': 'o', u'\U0001D616': 'o', u'\U0001D64A': 'o', u'\U0001D67E': 'o', u'\U0001D6B6': 'o', u'\U0001D6F0': 'o', u'\U0001D72A': 'o', u'\U0001D764': 'o', u'\U0001D79E': 'o', u'\U000104C2': 'o', u'\U000118B5': 'o', u'\U00010292': 'o', u'\U000102AB': 'o', u'\U00010404': 'o', u'\U00010516': 'o', u'\U0001D21A': 'o', u'\U0001F714': 'o', u'\U0001D6C9': 'o', u'\U0001D6DD': 'o', u'\U0001D703': 'o', u'\U0001D717': 'o', u'\U0001D73D': 'o', u'\U0001D751': 'o', u'\U0001D777': 'o', u'\U0001D78B': 'o', u'\U0001D7B1': 'o', u'\U0001D7C5': 'o', u'\U0001D6AF': 'o', u'\U0001D6B9': 'o', u'\U0001D6E9': 'o', u'\U0001D6F3': 'o', u'\U0001D723': 'o', u'\U0001D72D': 'o', u'\U0001D75D': 'o', u'\U0001D767': 'o', u'\U0001D797': 'o', u'\U0001D7A1': 'o', u'\U0001F101': 'o', u'\U0001F100': 'o', u'\u0C02': 'o', u'\u0C82': 'o', u'\u0D02': 'o', u'\u0D82': 'o', u'\u0966': 'o', u'\u0A66': 'o', u'\u0AE6': 'o', u'\u0BE6': 'o', u'\u0C66': 'o', u'\u0CE6': 'o', u'\u0D66': 'o', u'\u0E50': 'o', u'\u0ED0': 'o', u'\u1040': 'o', u'\u0665': 'o', u'\u06F5': 'o', u'\uFF4F': 'o', u'\u2134': 'o', u'\u1D0F': 'o', u'\u1D11': 'o', u'\uAB3D': 'o', u'\u03BF': 'o', u'\u03C3': 'o', u'\u2C9F': 'o', u'\u043E': 'o', u'\u10FF': 'o', u'\u0585': 'o', u'\u05E1': 'o', u'\u0647': 'o', u'\uFEEB': 'o', u'\uFEEC': 'o', u'\uFEEA': 'o', u'\uFEE9': 'o', u'\u06BE': 'o', u'\uFBAC': 'o', u'\uFBAD': 'o', u'\uFBAB': 'o', u'\uFBAA': 'o', u'\u06C1': 'o', u'\uFBA8': 'o', u'\uFBA9': 'o', u'\uFBA7': 'o', u'\uFBA6': 'o', u'\u06D5': 'o', u'\u0D20': 'o', u'\u101D': 'o', u'\u07C0': 'o', u'\u09E6': 'o', u'\u0B66': 'o', u'\u3007': 'o', u'\uFF2F': 'o', u'\u039F': 'o', u'\u2C9E': 'o', u'\u041E': 'o', u'\u0555': 'o', u'\u2D54': 'o', u'\u12D0': 'o', u'\u0B20': 'o', u'\uA4F3': 'o', u'\u2070': 'o', u'\u00BA': 'o', u'\u1D52': 'o', u'\u01D2': 'o', u'\u014F': 'o', u'\u01D1': 'o', u'\u014E': 'o', u'\u06FF': 'o', u'\u00F8': 'o', u'\uAB3E': 'o', u'\u00D8': 'o', u'\u2D41': 'o', u'\u01FE': 'o', u'\u0275': 'o', u'\uA74B': 'o', u'\u04E9': 'o', u'\u0473': 'o', u'\uAB8E': 'o', u'\uABBB': 'o', u'\u2296': 'o', u'\u229D': 'o', u'\u236C': 'o', u'\u019F': 'o', u'\uA74A': 'o', u'\u03B8': 'o', u'\u03D1': 'o', u'\u0398': 'o', u'\u03F4': 'o', u'\u04E8': 'o', u'\u0472': 'o', u'\u2D31': 'o', u'\u13BE': 'o', u'\u13EB': 'o', u'\uAB74': 'o', u'\uFCD9': 'o', u'\u01A1': 'o', u'\u01A0': 'o', u'\u13A4': 'o', u'\U0001F101': 'o.', u'\U0001F100': 'o.', u'\u0153': 'oe', u'\u0152': 'oe', u'\u0276': 'oe', u'\u221E': 'oo', u'\uA74F': 'oo', u'\uA699': 'oo', u'\uA74E': 'oo', u'\uA698': 'oo', u'\u1010': 'oo', u'\U0001D429': 'p', u'\U0001D45D': 'p', u'\U0001D491': 'p', u'\U0001D4C5': 'p', u'\U0001D4F9': 'p', u'\U0001D52D': 'p', u'\U0001D561': 'p', u'\U0001D595': 'p', u'\U0001D5C9': 'p', u'\U0001D5FD': 'p', u'\U0001D631': 'p', u'\U0001D665': 'p', u'\U0001D699': 'p', u'\U0001D6D2': 'p', u'\U0001D6E0': 'p', u'\U0001D70C': 'p', u'\U0001D71A': 'p', u'\U0001D746': 'p', u'\U0001D754': 'p', u'\U0001D780': 'p', u'\U0001D78E': 'p', u'\U0001D7BA': 'p', u'\U0001D7C8': 'p', u'\U0001D40F': 'p', u'\U0001D443': 'p', u'\U0001D477': 'p', u'\U0001D4AB': 'p', u'\U0001D4DF': 'p', u'\U0001D513': 'p', u'\U0001D57B': 'p', u'\U0001D5AF': 'p', u'\U0001D5E3': 'p', u'\U0001D617': 'p', u'\U0001D64B': 'p', u'\U0001D67F': 'p', u'\U0001D6B8': 'p', u'\U0001D6F2': 'p', u'\U0001D72C': 'p', u'\U0001D766': 'p', u'\U0001D7A0': 'p', u'\U00010295': 'p', u'\u2374': 'p', u'\uFF50': 'p', u'\u03C1': 'p', u'\u03F1': 'p', u'\u2CA3': 'p', u'\u0440': 'p', u'\uFF30': 'p', u'\u2119': 'p', u'\u03A1': 'p', u'\u2CA2': 'p', u'\u0420': 'p', u'\u13E2': 'p', u'\u146D': 'p', u'\uA4D1': 'p', u'\u01A5': 'p', u'\u1D7D': 'p', u'\u1477': 'p', u'\u1486': 'p', u'\u1D29': 'p', u'\uABB2': 'p', u'\U0001D42A': 'q', u'\U0001D45E': 'q', u'\U0001D492': 'q', u'\U0001D4C6': 'q', u'\U0001D4FA': 'q', u'\U0001D52E': 'q', u'\U0001D562': 'q', u'\U0001D596': 'q', u'\U0001D5CA': 'q', u'\U0001D5FE': 'q', u'\U0001D632': 'q', u'\U0001D666': 'q', u'\U0001D69A': 'q', u'\U0001D410': 'q', u'\U0001D444': 'q', u'\U0001D478': 'q', u'\U0001D4AC': 'q', u'\U0001D4E0': 'q', u'\U0001D514': 'q', u'\U0001D57C': 'q', u'\U0001D5B0': 'q', u'\U0001D5E4': 'q', u'\U0001D618': 'q', u'\U0001D64C': 'q', u'\U0001D680': 'q', u'\u051B': 'q', u'\u0563': 'q', u'\u0566': 'q', u'\u211A': 'q', u'\u2D55': 'q', u'\u02A0': 'q', u'\u1D90': 'q', u'\u024B': 'q', u'\U0001D42B': 'r', u'\U0001D45F': 'r', u'\U0001D493': 'r', u'\U0001D4C7': 'r', u'\U0001D4FB': 'r', u'\U0001D52F': 'r', u'\U0001D563': 'r', u'\U0001D597': 'r', u'\U0001D5CB': 'r', u'\U0001D5FF': 'r', u'\U0001D633': 'r', u'\U0001D667': 'r', u'\U0001D69B': 'r', u'\U0001D216': 'r', u'\U0001D411': 'r', u'\U0001D445': 'r', u'\U0001D479': 'r', u'\U0001D4E1': 'r', u'\U0001D57D': 'r', u'\U0001D5B1': 'r', u'\U0001D5E5': 'r', u'\U0001D619': 'r', u'\U0001D64D': 'r', u'\U0001D681': 'r', u'\U000104B4': 'r', u'\uAB47': 'r', u'\uAB48': 'r', u'\u1D26': 'r', u'\u2C85': 'r', u'\u0433': 'r', u'\uAB81': 'r', u'\u211B': 'r', u'\u211C': 'r', u'\u211D': 'r', u'\u01A6': 'r', u'\u13A1': 'r', u'\u13D2': 'r', u'\u1587': 'r', u'\uA4E3': 'r', u'\u027D': 'r', u'\u027C': 'r', u'\u024D': 'r', u'\u0493': 'r', u'\u1D72': 'r', u'\u0491': 'r', u'\uAB71': 'r', u'\u0280': 'r', u'\uABA2': 'r', u'\u1D73': 'r', u'\U000118E3': 'rn', u'\U0001D426': 'rn', u'\U0001D45A': 'rn', u'\U0001D48E': 'rn', u'\U0001D4C2': 'rn', u'\U0001D4F6': 'rn', u'\U0001D52A': 'rn', u'\U0001D55E': 'rn', u'\U0001D592': 'rn', u'\U0001D5C6': 'rn', u'\U0001D5FA': 'rn', u'\U0001D62E': 'rn', u'\U0001D662': 'rn', u'\U0001D696': 'rn', u'\U00011700': 'rn', u'\u217F': 'rn', u'\u20A5': 'rn', u'\u0271': 'rn', u'\u1D6F': 'rn', u'\U0001D42C': 's', u'\U0001D460': 's', u'\U0001D494': 's', u'\U0001D4C8': 's', u'\U0001D4FC': 's', u'\U0001D530': 's', u'\U0001D564': 's', u'\U0001D598': 's', u'\U0001D5CC': 's', u'\U0001D600': 's', u'\U0001D634': 's', u'\U0001D668': 's', u'\U0001D69C': 's', u'\U000118C1': 's', u'\U00010448': 's', u'\U0001D412': 's', u'\U0001D446': 's', u'\U0001D47A': 's', u'\U0001D4AE': 's', u'\U0001D4E2': 's', u'\U0001D516': 's', u'\U0001D54A': 's', u'\U0001D57E': 's', u'\U0001D5B2': 's', u'\U0001D5E6': 's', u'\U0001D61A': 's', u'\U0001D64E': 's', u'\U0001D682': 's', u'\U00016F3A': 's', u'\U00010296': 's', u'\U00010420': 's', u'\uFF53': 's', u'\uA731': 's', u'\u01BD': 's', u'\u0455': 's', u'\uABAA': 's', u'\uFF33': 's', u'\u0405': 's', u'\u054F': 's', u'\u13D5': 's', u'\u13DA': 's', u'\uA4E2': 's', u'\u0282': 's', u'\u1D74': 's', u'\U0001F75C': 'sss', u'\uFB06': 'st', u'\U0001D42D': 't', u'\U0001D461': 't', u'\U0001D495': 't', u'\U0001D4C9': 't', u'\U0001D4FD': 't', u'\U0001D531': 't', u'\U0001D565': 't', u'\U0001D599': 't', u'\U0001D5CD': 't', u'\U0001D601': 't', u'\U0001D635': 't', u'\U0001D669': 't', u'\U0001D69D': 't', u'\U0001F768': 't', u'\U0001D413': 't', u'\U0001D447': 't', u'\U0001D47B': 't', u'\U0001D4AF': 't', u'\U0001D4E3': 't', u'\U0001D517': 't', u'\U0001D54B': 't', u'\U0001D57F': 't', u'\U0001D5B3': 't', u'\U0001D5E7': 't', u'\U0001D61B': 't', u'\U0001D64F': 't', u'\U0001D683': 't', u'\U0001D6BB': 't', u'\U0001D6F5': 't', u'\U0001D72F': 't', u'\U0001D769': 't', u'\U0001D7A3': 't', u'\U00016F0A': 't', u'\U000118BC': 't', u'\U00010297': 't', u'\U000102B1': 't', u'\U00010315': 't', u'\U0001D6D5': 't', u'\U0001D70F': 't', u'\U0001D749': 't', u'\U0001D783': 't', u'\U0001D7BD': 't', u'\u22A4': 't', u'\u27D9': 't', u'\uFF34': 't', u'\u03A4': 't', u'\u2CA6': 't', u'\u0422': 't', u'\u13A2': 't', u'\uA4D4': 't', u'\u2361': 't', u'\u023E': 't', u'\u021A': 't', u'\u0162': 't', u'\u01AE': 't', u'\u04AC': 't', u'\u20AE': 't', u'\u0167': 't', u'\u0166': 't', u'\u1D75': 't', u'\U0001D42E': 'u', u'\U0001D462': 'u', u'\U0001D496': 'u', u'\U0001D4CA': 'u', u'\U0001D4FE': 'u', u'\U0001D532': 'u', u'\U0001D566': 'u', u'\U0001D59A': 'u', u'\U0001D5CE': 'u', u'\U0001D602': 'u', u'\U0001D636': 'u', u'\U0001D66A': 'u', u'\U0001D69E': 'u', u'\U0001D6D6': 'u', u'\U0001D710': 'u', u'\U0001D74A': 'u', u'\U0001D784': 'u', u'\U0001D7BE': 'u', u'\U000104F6': 'u', u'\U000118D8': 'u', u'\U0001D414': 'u', u'\U0001D448': 'u', u'\U0001D47C': 'u', u'\U0001D4B0': 'u', u'\U0001D4E4': 'u', u'\U0001D518': 'u', u'\U0001D54C': 'u', u'\U0001D580': 'u', u'\U0001D5B4': 'u', u'\U0001D5E8': 'u', u'\U0001D61C': 'u', u'\U0001D650': 'u', u'\U0001D684': 'u', u'\U000104CE': 'u', u'\U00016F42': 'u', u'\U000118B8': 'u', u'\uA79F': 'u', u'\u1D1C': 'u', u'\uAB4E': 'u', u'\uAB52': 'u', u'\u028B': 'u', u'\u03C5': 'u', u'\u057D': 'u', u'\u222A': 'u', u'\u22C3': 'u', u'\u054D': 'u', u'\u1200': 'u', u'\u144C': 'u', u'\uA4F4': 'u', u'\u01D4': 'u', u'\u01D3': 'u', u'\u1D7E': 'u', u'\uAB9C': 'u', u'\u0244': 'u', u'\u13CC': 'u', u'\u1458': 'u', u'\u1467': 'u', u'\u2127': 'u', u'\u162E': 'u', u'\u1634': 'u', u'\u01B1': 'u', u'\u1D7F': 'u', u'\u1D6B': 'ue', u'\uAB63': 'uo', u'\U0001D42F': 'v', u'\U0001D463': 'v', u'\U0001D497': 'v', u'\U0001D4CB': 'v', u'\U0001D4FF': 'v', u'\U0001D533': 'v', u'\U0001D567': 'v', u'\U0001D59B': 'v', u'\U0001D5CF': 'v', u'\U0001D603': 'v', u'\U0001D637': 'v', u'\U0001D66B': 'v', u'\U0001D69F': 'v', u'\U0001D6CE': 'v', u'\U0001D708': 'v', u'\U0001D742': 'v', u'\U0001D77C': 'v', u'\U0001D7B6': 'v', u'\U00011706': 'v', u'\U000118C0': 'v', u'\U0001D20D': 'v', u'\U0001D415': 'v', u'\U0001D449': 'v', u'\U0001D47D': 'v', u'\U0001D4B1': 'v', u'\U0001D4E5': 'v', u'\U0001D519': 'v', u'\U0001D54D': 'v', u'\U0001D581': 'v', u'\U0001D5B5': 'v', u'\U0001D5E9': 'v', u'\U0001D61D': 'v', u'\U0001D651': 'v', u'\U0001D685': 'v', u'\U00016F08': 'v', u'\U000118A0': 'v', u'\U0001051D': 'v', u'\U00010197': 'v', u'\U0001F708': 'v', u'\u2228': 'v', u'\u22C1': 'v', u'\uFF56': 'v', u'\u2174': 'v', u'\u1D20': 'v', u'\u03BD': 'v', u'\u0475': 'v', u'\u05D8': 'v', u'\uABA9': 'v', u'\u0667': 'v', u'\u06F7': 'v', u'\u2164': 'v', u'\u0474': 'v', u'\u2D38': 'v', u'\u13D9': 'v', u'\u142F': 'v', u'\uA6DF': 'v', u'\uA4E6': 'v', u'\u143B': 'v', u'\U0001F76C': 'vb', u'\u2175': 'vi', u'\u2176': 'vii', u'\u2177': 'viii', u'\u2165': 'vl', u'\u2166': 'vll', u'\u2167': 'vlll', u'\U0001D430': 'w', u'\U0001D464': 'w', u'\U0001D498': 'w', u'\U0001D4CC': 'w', u'\U0001D500': 'w', u'\U0001D534': 'w', u'\U0001D568': 'w', u'\U0001D59C': 'w', u'\U0001D5D0': 'w', u'\U0001D604': 'w', u'\U0001D638': 'w', u'\U0001D66C': 'w', u'\U0001D6A0': 'w', u'\U0001170A': 'w', u'\U0001170E': 'w', u'\U0001170F': 'w', u'\U000118EF': 'w', u'\U000118E6': 'w', u'\U0001D416': 'w', u'\U0001D44A': 'w', u'\U0001D47E': 'w', u'\U0001D4B2': 'w', u'\U0001D4E6': 'w', u'\U0001D51A': 'w', u'\U0001D54E': 'w', u'\U0001D582': 'w', u'\U0001D5B6': 'w', u'\U0001D5EA': 'w', u'\U0001D61E': 'w', u'\U0001D652': 'w', u'\U0001D686': 'w', u'\U000114C5': 'w', u'\u026F': 'w', u'\u1D21': 'w', u'\u0461': 'w', u'\u051D': 'w', u'\u0561': 'w', u'\uAB83': 'w', u'\u051C': 'w', u'\u13B3': 'w', u'\u13D4': 'w', u'\uA4EA': 'w', u'\u047D': 'w', u'\u20A9': 'w', u'\uA761': 'w', u'\U0001D431': 'x', u'\U0001D465': 'x', u'\U0001D499': 'x', u'\U0001D4CD': 'x', u'\U0001D501': 'x', u'\U0001D535': 'x', u'\U0001D569': 'x', u'\U0001D59D': 'x', u'\U0001D5D1': 'x', u'\U0001D605': 'x', u'\U0001D639': 'x', u'\U0001D66D': 'x', u'\U0001D6A1': 'x', u'\U00010322': 'x', u'\U000118EC': 'x', u'\U0001D417': 'x', u'\U0001D44B': 'x', u'\U0001D47F': 'x', u'\U0001D4B3': 'x', u'\U0001D4E7': 'x', u'\U0001D51B': 'x', u'\U0001D54F': 'x', u'\U0001D583': 'x', u'\U0001D5B7': 'x', u'\U0001D5EB': 'x', u'\U0001D61F': 'x', u'\U0001D653': 'x', u'\U0001D687': 'x', u'\U0001D6BE': 'x', u'\U0001D6F8': 'x', u'\U0001D732': 'x', u'\U0001D76C': 'x', u'\U0001D7A6': 'x', u'\U00010290': 'x', u'\U000102B4': 'x', u'\U00010317': 'x', u'\U00010527': 'x', u'\U00010196': 'x', u'\u166E': 'x', u'\u00D7': 'x', u'\u292B': 'x', u'\u292C': 'x', u'\u2A2F': 'x', u'\uFF58': 'x', u'\u2179': 'x', u'\u0445': 'x', u'\u1541': 'x', u'\u157D': 'x', u'\u2DEF': 'x', u'\u036F': 'x', u'\u166D': 'x', u'\u2573': 'x', u'\uFF38': 'x', u'\u2169': 'x', u'\uA7B3': 'x', u'\u03A7': 'x', u'\u2CAC': 'x', u'\u0425': 'x', u'\u2D5D': 'x', u'\u16B7': 'x', u'\uA4EB': 'x', u'\u2A30': 'x', u'\u04B2': 'x', u'\u217A': 'xi', u'\u217B': 'xii', u'\u216A': 'xl', u'\u216B': 'xll', u'\U0001D432': 'y', u'\U0001D466': 'y', u'\U0001D49A': 'y', u'\U0001D4CE': 'y', u'\U0001D502': 'y', u'\U0001D536': 'y', u'\U0001D56A': 'y', u'\U0001D59E': 'y', u'\U0001D5D2': 'y', u'\U0001D606': 'y', u'\U0001D63A': 'y', u'\U0001D66E': 'y', u'\U0001D6A2': 'y', u'\U0001D6C4': 'y', u'\U0001D6FE': 'y', u'\U0001D738': 'y', u'\U0001D772': 'y', u'\U0001D7AC': 'y', u'\U000118DC': 'y', u'\U0001D418': 'y', u'\U0001D44C': 'y', u'\U0001D480': 'y', u'\U0001D4B4': 'y', u'\U0001D4E8': 'y', u'\U0001D51C': 'y', u'\U0001D550': 'y', u'\U0001D584': 'y', u'\U0001D5B8': 'y', u'\U0001D5EC': 'y', u'\U0001D620': 'y', u'\U0001D654': 'y', u'\U0001D688': 'y', u'\U0001D6BC': 'y', u'\U0001D6F6': 'y', u'\U0001D730': 'y', u'\U0001D76A': 'y', u'\U0001D7A4': 'y', u'\U00016F43': 'y', u'\U000118A4': 'y', u'\U000102B2': 'y', u'\u0263': 'y', u'\u1D8C': 'y', u'\uFF59': 'y', u'\u028F': 'y', u'\u1EFF': 'y', u'\uAB5A': 'y', u'\u03B3': 'y', u'\u213D': 'y', u'\u0443': 'y', u'\u04AF': 'y', u'\u10E7': 'y', u'\uFF39': 'y', u'\u03A5': 'y', u'\u03D2': 'y', u'\u2CA8': 'y', u'\u0423': 'y', u'\u04AE': 'y', u'\u13A9': 'y', u'\u13BD': 'y', u'\uA4EC': 'y', u'\u01B4': 'y', u'\u024F': 'y', u'\u04B1': 'y', u'\u00A5': 'y', u'\u024E': 'y', u'\u04B0': 'y', u'\U0001D433': 'z', u'\U0001D467': 'z', u'\U0001D49B': 'z', u'\U0001D4CF': 'z', u'\U0001D503': 'z', u'\U0001D537': 'z', u'\U0001D56B': 'z', u'\U0001D59F': 'z', u'\U0001D5D3': 'z', u'\U0001D607': 'z', u'\U0001D63B': 'z', u'\U0001D66F': 'z', u'\U0001D6A3': 'z', u'\U000118C4': 'z', u'\U000102F5': 'z', u'\U000118E5': 'z', u'\U0001D419': 'z', u'\U0001D44D': 'z', u'\U0001D481': 'z', u'\U0001D4B5': 'z', u'\U0001D4E9': 'z', u'\U0001D585': 'z', u'\U0001D5B9': 'z', u'\U0001D5ED': 'z', u'\U0001D621': 'z', u'\U0001D655': 'z', u'\U0001D689': 'z', u'\U0001D6AD': 'z', u'\U0001D6E7': 'z', u'\U0001D721': 'z', u'\U0001D75B': 'z', u'\U0001D795': 'z', u'\U000118A9': 'z', u'\u1D22': 'z', u'\uAB93': 'z', u'\uFF3A': 'z', u'\u2124': 'z', u'\u2128': 'z', u'\u0396': 'z', u'\u13C3': 'z', u'\uA4DC': 'z', u'\u0290': 'z', u'\u01B6': 'z', u'\u01B5': 'z', u'\u0225': 'z', u'\u0224': 'z', u'\u1D76': 'z', u'\u2010': '-', u'\u2011': '-', u'\u2012': '-', u'\u2013': '-', u'\uFE58': '-', u'\u06D4': '-', u'\u2043': '-', u'\u02D7': '-', u'\u2212': '-', u'\u2796': '-', u'\u2CBA': '-' } def unconfuse(domain): if domain.startswith('xn--'): domain = domain.encode('idna').decode('idna') unconfused = '' for i in range(len(domain)): if domain[i] in confusables: unconfused += confusables[domain[i]] else: unconfused += domain[i] return unconfused
confusables = {u'①': '1', u'➀': '1', u'𝟐': '2', u'𝟚': '2', u'𝟤': '2', u'𝟮': '2', u'𝟸': '2', u'Ꝛ': '2', u'Ƨ': '2', u'Ϩ': '2', u'Ꙅ': '2', u'ᒿ': '2', u'ꛯ': '2', u'②': '2', u'➁': '2', u'ƻ': '2', u'🄃': '2.', u'⒉': '2.', u'𝈆': '3', u'𝟑': '3', u'𝟛': '3', u'𝟥': '3', u'𝟯': '3', u'𝟹': '3', u'𖼻': '3', u'𑣊': '3', u'Ɜ': '3', u'Ȝ': '3', u'Ʒ': '3', u'Ꝫ': '3', u'Ⳍ': '3', u'З': '3', u'Ӡ': '3', u'૩': '3', u'③': '3', u'Ҙ': '3', u'🄄': '3.', u'⒊': '3.', u'𝟒': '4', u'𝟜': '4', u'𝟦': '4', u'𝟰': '4', u'𝟺': '4', u'𑢯': '4', u'Ꮞ': '4', u'④': '4', u'➃': '4', u'ᔰ': '4', u'🄅': '4.', u'⒋': '4.', u'𝟓': '5', u'𝟝': '5', u'𝟧': '5', u'𝟱': '5', u'𝟻': '5', u'𑢻': '5', u'Ƽ': '5', u'⑤': '5', u'➄': '5', u'🄆': '5.', u'⒌': '5.', u'𝟔': '6', u'𝟞': '6', u'𝟨': '6', u'𝟲': '6', u'𝟼': '6', u'𑣕': '6', u'Ⳓ': '6', u'б': '6', u'Ꮾ': '6', u'⑥': '6', u'➅': '6', u'🄇': '6.', u'⒍': '6.', u'𝈒': '7', u'𝟕': '7', u'𝟟': '7', u'𝟩': '7', u'𝟳': '7', u'𝟽': '7', u'𐓒': '7', u'𑣆': '7', u'⑦': '7', u'➆': '7', u'🄈': '7.', u'⒎': '7.', u'𞣋': '8', u'𝟖': '8', u'𝟠': '8', u'𝟪': '8', u'𝟴': '8', u'𝟾': '8', u'𐌚': '8', u'ଃ': '8', u'৪': '8', u'੪': '8', u'ȣ': '8', u'Ȣ': '8', u'⑧': '8', u'➇': '8', u'🄉': '8.', u'⒏': '8.', u'𝟗': '9', u'𝟡': '9', u'𝟤': '9', u'𝟫': '9', u'𝟵': '9', u'𝟿': '9', u'𑣌': '9', u'𑢬': '9', u'𑣖': '9', u'੧': '9', u'୨': '9', u'৭': '9', u'൭': '9', u'Ꝯ': '9', u'Ⳋ': '9', u'१': '9', u'۹': '9', u'⑨': '9', u'➈': '9', u'🄊': '9.', u'⒐': '9.', u'𝐚': 'a', u'𝑎': 'a', u'𝒂': 'a', u'𝒶': 'a', u'𝓪': 'a', u'𝔞': 'a', u'𝕒': 'a', u'𝖆': 'a', u'𝖺': 'a', u'𝗮': 'a', u'𝘢': 'a', u'𝙖': 'a', u'𝚊': 'a', u'𝛂': 'a', u'𝛼': 'a', u'𝜶': 'a', u'𝝰': 'a', u'𝞪': 'a', u'𝐀': 'a', u'𝐴': 'a', u'𝑨': 'a', u'𝒜': 'a', u'𝓐': 'a', u'𝔄': 'a', u'𝔸': 'a', u'𝕬': 'a', u'𝖠': 'a', u'𝗔': 'a', u'𝘈': 'a', u'𝘼': 'a', u'𝙰': 'a', u'𝚨': 'a', u'𝛢': 'a', u'𝜜': 'a', u'𝝖': 'a', u'𝞐': 'a', u'⍺': 'a', u'a': 'a', u'ɑ': 'a', u'α': 'a', u'а': 'a', u'ⷶ': 'a', u'A': 'a', u'Α': 'a', u'А': 'a', u'Ꭺ': 'a', u'ᗅ': 'a', u'ꓮ': 'a', u'⍶': 'a', u'ǎ': 'a', u'ă': 'a', u'Ǎ': 'a', u'Ă': 'a', u'ȧ': 'a', u'å': 'a', u'Ȧ': 'a', u'Å': 'a', u'ẚ': 'a', u'ả': 'a', u'ꭺ': 'a', u'ᴀ': 'a', u'ꜳ': 'aa', u'Ꜳ': 'aa', u'æ': 'ae', u'ӕ': 'ae', u'Æ': 'ae', u'Ӕ': 'ae', u'ꜵ': 'ao', u'Ꜵ': 'ao', u'🜇': 'ar', u'ꜷ': 'au', u'Ꜷ': 'au', u'Ꜹ': 'av', u'ꜹ': 'av', u'Ꜻ': 'av', u'ꜻ': 'av', u'ꜽ': 'ay', u'Ꜽ': 'ay', u'𝐛': 'b', u'𝑏': 'b', u'𝒃': 'b', u'𝒷': 'b', u'𝓫': 'b', u'𝔟': 'b', u'𝕓': 'b', u'𝖇': 'b', u'𝖻': 'b', u'𝗯': 'b', u'𝘣': 'b', u'𝙗': 'b', u'𝚋': 'b', u'𝐁': 'b', u'𝐵': 'b', u'𝑩': 'b', u'𝓑': 'b', u'𝔅': 'b', u'𝔹': 'b', u'𝕭': 'b', u'𝖡': 'b', u'𝗕': 'b', u'𝘉': 'b', u'𝘽': 'b', u'𝙱': 'b', u'𝚩': 'b', u'𝛣': 'b', u'𝜝': 'b', u'𝝗': 'b', u'𝞑': 'b', u'𐊂': 'b', u'𐊡': 'b', u'𐌁': 'b', u'𝛃': 'b', u'𝛽': 'b', u'𝜷': 'b', u'𝝱': 'b', u'𝞫': 'b', u'Ƅ': 'b', u'Ь': 'b', u'Ꮟ': 'b', u'ᖯ': 'b', u'B': 'b', u'ℬ': 'b', u'Ꞵ': 'b', u'Β': 'b', u'В': 'b', u'Ᏼ': 'b', u'ᗷ': 'b', u'ꓐ': 'b', u'ɓ': 'b', u'ƃ': 'b', u'Ƃ': 'b', u'Б': 'b', u'ƀ': 'b', u'ҍ': 'b', u'Ҍ': 'b', u'ѣ': 'b', u'Ѣ': 'b', u'в': 'b', u'ᏼ': 'b', u'ʙ': 'b', u'ꞵ': 'b', u'β': 'b', u'ϐ': 'b', u'Ᏸ': 'b', u'ß': 'b', u'Ы': 'bl', u'𝐜': 'c', u'𝑐': 'c', u'𝒄': 'c', u'𝒸': 'c', u'𝓬': 'c', u'𝔠': 'c', u'𝕔': 'c', u'𝖈': 'c', u'𝖼': 'c', u'𝗰': 'c', u'𝘤': 'c', u'𝙘': 'c', u'𝚌': 'c', u'𐐽': 'c', u'🝌': 'c', u'𑣲': 'c', u'𑣩': 'c', u'𝐂': 'c', u'𝐶': 'c', u'𝑪': 'c', u'𝒞': 'c', u'𝓒': 'c', u'𝕮': 'c', u'𝖢': 'c', u'𝗖': 'c', u'𝘊': 'c', u'𝘾': 'c', u'𝙲': 'c', u'𐊢': 'c', u'𐌂': 'c', u'𐐕': 'c', u'𐔜': 'c', u'c': 'c', u'ⅽ': 'c', u'ᴄ': 'c', u'ϲ': 'c', u'ⲥ': 'c', u'с': 'c', u'ꮯ': 'c', u'ⷭ': 'c', u'C': 'c', u'Ⅽ': 'c', u'ℂ': 'c', u'ℭ': 'c', u'Ϲ': 'c', u'Ⲥ': 'c', u'С': 'c', u'Ꮯ': 'c', u'ꓚ': 'c', u'¢': 'c', u'ȼ': 'c', u'₡': 'c', u'ç': 'c', u'ҫ': 'c', u'Ç': 'c', u'Ҫ': 'c', u'Ƈ': 'c', u'𝐝': 'd', u'𝑑': 'd', u'𝒅': 'd', u'𝒹': 'd', u'𝓭': 'd', u'𝔡': 'd', u'𝕕': 'd', u'𝖉': 'd', u'𝖽': 'd', u'𝗱': 'd', u'𝘥': 'd', u'𝙙': 'd', u'𝚍': 'd', u'𝐃': 'd', u'𝐷': 'd', u'𝑫': 'd', u'𝒟': 'd', u'𝓓': 'd', u'𝔇': 'd', u'𝔻': 'd', u'𝕯': 'd', u'𝖣': 'd', u'𝗗': 'd', u'𝘋': 'd', u'𝘿': 'd', u'𝙳': 'd', u'ⅾ': 'd', u'ⅆ': 'd', u'ԁ': 'd', u'Ꮷ': 'd', u'ᑯ': 'd', u'ꓒ': 'd', u'Ⅾ': 'd', u'ⅅ': 'd', u'Ꭰ': 'd', u'ᗞ': 'd', u'ᗪ': 'd', u'ꓓ': 'd', u'ɗ': 'd', u'ɖ': 'd', u'ƌ': 'd', u'đ': 'd', u'Đ': 'd', u'Ð': 'd', u'Ɖ': 'd', u'₫': 'd', u'ᑻ': 'd', u'ᒇ': 'd', u'ɗ': 'd', u'ɖ': 'd', u'ƌ': 'd', u'đ': 'd', u'Đ': 'd', u'Ð': 'd', u'Ɖ': 'd', u'₫': 'd', u'ᑻ': 'd', u'ᒇ': 'd', u'ꭰ': 'd', u'𝐞': 'e', u'𝑒': 'e', u'𝒆': 'e', u'𝓮': 'e', u'𝔢': 'e', u'𝕖': 'e', u'𝖊': 'e', u'𝖾': 'e', u'𝗲': 'e', u'𝘦': 'e', u'𝙚': 'e', u'𝚎': 'e', u'𝐄': 'e', u'𝐸': 'e', u'𝑬': 'e', u'𝓔': 'e', u'𝔈': 'e', u'𝔼': 'e', u'𝕰': 'e', u'𝖤': 'e', u'𝗘': 'e', u'𝘌': 'e', u'𝙀': 'e', u'𝙴': 'e', u'𝚬': 'e', u'𝛦': 'e', u'𝜠': 'e', u'𝝚': 'e', u'𝞔': 'e', u'𑢦': 'e', u'𑢮': 'e', u'𐊆': 'e', u'𝈡': 'e', u'℮': 'e', u'e': 'e', u'ℯ': 'e', u'ⅇ': 'e', u'ꬲ': 'e', u'е': 'e', u'ҽ': 'e', u'ⷷ': 'e', u'⋿': 'e', u'E': 'e', u'ℰ': 'e', u'Ε': 'e', u'Е': 'e', u'ⴹ': 'e', u'Ꭼ': 'e', u'ꓰ': 'e', u'ě': 'e', u'Ě': 'e', u'ɇ': 'e', u'Ɇ': 'e', u'ҿ': 'e', u'ꭼ': 'e', u'ᴇ': 'e', u'ə': 'e', u'ǝ': 'e', u'ә': 'e', u'ℇ': 'e', u'Ԑ': 'e', u'Ꮛ': 'e', u'𝐟': 'f', u'𝑓': 'f', u'𝒇': 'f', u'𝒻': 'f', u'𝓯': 'f', u'𝔣': 'f', u'𝕗': 'f', u'𝖋': 'f', u'𝖿': 'f', u'𝗳': 'f', u'𝘧': 'f', u'𝙛': 'f', u'𝚏': 'f', u'𝈓': 'f', u'𝐅': 'f', u'𝐹': 'f', u'𝑭': 'f', u'𝓕': 'f', u'𝔉': 'f', u'𝔽': 'f', u'𝕱': 'f', u'𝖥': 'f', u'𝗙': 'f', u'𝘍': 'f', u'𝙁': 'f', u'𝙵': 'f', u'𝟊': 'f', u'𑣂': 'f', u'𑢢': 'f', u'𐊇': 'f', u'𐊥': 'f', u'𐔥': 'f', u'ꬵ': 'f', u'ꞙ': 'f', u'ſ': 'f', u'ẝ': 'f', u'ք': 'f', u'ℱ': 'f', u'Ꞙ': 'f', u'Ϝ': 'f', u'ᖴ': 'f', u'ꓝ': 'f', u'ƒ': 'f', u'Ƒ': 'f', u'ᵮ': 'f', u'ff': 'ff', u'ffi': 'ffi', u'ffl': 'ffl', u'fi': 'fi', u'fl': 'fl', u'ʩ': 'fn', u'𝐠': 'g', u'𝑔': 'g', u'𝒈': 'g', u'𝓰': 'g', u'𝔤': 'g', u'𝕘': 'g', u'𝖌': 'g', u'𝗀': 'g', u'𝗴': 'g', u'𝘨': 'g', u'𝙜': 'g', u'𝚐': 'g', u'𝐆': 'g', u'𝐺': 'g', u'𝑮': 'g', u'𝒢': 'g', u'𝓖': 'g', u'𝔊': 'g', u'𝔾': 'g', u'𝕲': 'g', u'𝖦': 'g', u'𝗚': 'g', u'𝘎': 'g', u'𝙂': 'g', u'𝙶': 'g', u'g': 'g', u'ℊ': 'g', u'ɡ': 'g', u'ᶃ': 'g', u'ƍ': 'g', u'ց': 'g', u'Ԍ': 'g', u'Ꮐ': 'g', u'Ᏻ': 'g', u'ꓖ': 'g', u'ᶢ': 'g', u'ᵍ': 'g', u'ɠ': 'g', u'ǧ': 'g', u'ğ': 'g', u'Ǧ': 'g', u'Ğ': 'g', u'ǵ': 'g', u'ģ': 'g', u'ǥ': 'g', u'Ǥ': 'g', u'Ɠ': 'g', u'ԍ': 'g', u'ꮐ': 'g', u'ᏻ': 'g', u'𝐡': 'h', u'𝒉': 'h', u'𝒽': 'h', u'𝓱': 'h', u'𝔥': 'h', u'𝕙': 'h', u'𝖍': 'h', u'𝗁': 'h', u'𝗵': 'h', u'𝘩': 'h', u'𝙝': 'h', u'𝚑': 'h', u'𝐇': 'h', u'𝐻': 'h', u'𝑯': 'h', u'𝓗': 'h', u'𝕳': 'h', u'𝖧': 'h', u'𝗛': 'h', u'𝘏': 'h', u'𝙃': 'h', u'𝙷': 'h', u'𝚮': 'h', u'𝛨': 'h', u'𝜢': 'h', u'𝝜': 'h', u'𝞖': 'h', u'𐋏': 'h', u'𐆙': 'h', u'h': 'h', u'ℎ': 'h', u'һ': 'h', u'հ': 'h', u'Ꮒ': 'h', u'H': 'h', u'ℋ': 'h', u'ℌ': 'h', u'ℍ': 'h', u'Η': 'h', u'Ⲏ': 'h', u'Н': 'h', u'Ꮋ': 'h', u'ᕼ': 'h', u'ꓧ': 'h', u'ᵸ': 'h', u'ᴴ': 'h', u'ɦ': 'h', u'ꚕ': 'h', u'Ᏺ': 'h', u'Ⱨ': 'h', u'Ң': 'h', u'ħ': 'h', u'ℏ': 'h', u'ћ': 'h', u'Ħ': 'h', u'Ӊ': 'h', u'Ӈ': 'h', u'н': 'h', u'ʜ': 'h', u'ꮋ': 'h', u'ң': 'h', u'ӊ': 'h', u'ӈ': 'h', u'𝐢': 'i', u'𝑖': 'i', u'𝒊': 'i', u'𝒾': 'i', u'𝓲': 'i', u'𝔦': 'i', u'𝕚': 'i', u'𝖎': 'i', u'𝗂': 'i', u'𝗶': 'i', u'𝘪': 'i', u'𝙞': 'i', u'𝚒': 'i', u'𝚤': 'i', u'𝛊': 'i', u'𝜄': 'i', u'𝜾': 'i', u'𝝸': 'i', u'𝞲': 'i', u'𑣃': 'i', u'˛': 'i', u'⍳': 'i', u'i': 'i', u'ⅰ': 'i', u'ℹ': 'i', u'ⅈ': 'i', u'ı': 'i', u'ɪ': 'i', u'ɩ': 'i', u'ι': 'i', u'ι': 'i', u'ͺ': 'i', u'і': 'i', u'ꙇ': 'i', u'ӏ': 'i', u'ꭵ': 'i', u'Ꭵ': 'i', u'ⓛ': 'i', u'⍸': 'i', u'ǐ': 'i', u'Ǐ': 'i', u'ɨ': 'i', u'ᵻ': 'i', u'ᵼ': 'i', u'ⅱ': 'ii', u'ⅲ': 'iii', u'ij': 'ij', u'ⅳ': 'iv', u'ⅸ': 'ix', u'𝐣': 'j', u'𝑗': 'j', u'𝒋': 'j', u'𝒿': 'j', u'𝓳': 'j', u'𝔧': 'j', u'𝕛': 'j', u'𝖏': 'j', u'𝗃': 'j', u'𝗷': 'j', u'𝘫': 'j', u'𝙟': 'j', u'𝚓': 'j', u'𝐉': 'j', u'𝐽': 'j', u'𝑱': 'j', u'𝒥': 'j', u'𝓙': 'j', u'𝔍': 'j', u'𝕁': 'j', u'𝕵': 'j', u'𝖩': 'j', u'𝗝': 'j', u'𝘑': 'j', u'𝙅': 'j', u'𝙹': 'j', u'𝚥': 'j', u'j': 'j', u'ⅉ': 'j', u'ϳ': 'j', u'ј': 'j', u'J': 'j', u'Ʝ': 'j', u'Ϳ': 'j', u'Ј': 'j', u'Ꭻ': 'j', u'ᒍ': 'j', u'ꓙ': 'j', u'ɉ': 'j', u'Ɉ': 'j', u'ᒙ': 'j', u'յ': 'j', u'ꭻ': 'j', u'ᴊ': 'j', u'𝐤': 'k', u'𝑘': 'k', u'𝒌': 'k', u'𝓀': 'k', u'𝓴': 'k', u'𝔨': 'k', u'𝕜': 'k', u'𝖐': 'k', u'𝗄': 'k', u'𝗸': 'k', u'𝘬': 'k', u'𝙠': 'k', u'𝚔': 'k', u'𝐊': 'k', u'𝐾': 'k', u'𝑲': 'k', u'𝒦': 'k', u'𝓚': 'k', u'𝔎': 'k', u'𝕂': 'k', u'𝕶': 'k', u'𝖪': 'k', u'𝗞': 'k', u'𝘒': 'k', u'𝙆': 'k', u'𝙺': 'k', u'𝚱': 'k', u'𝛫': 'k', u'𝜥': 'k', u'𝝟': 'k', u'𝞙': 'k', u'𝛋': 'k', u'𝛞': 'k', u'𝜅': 'k', u'𝜘': 'k', u'𝜿': 'k', u'𝝒': 'k', u'𝝹': 'k', u'𝞌': 'k', u'𝞳': 'k', u'𝟆': 'k', u'K': 'k', u'K': 'k', u'Κ': 'k', u'Ⲕ': 'k', u'К': 'k', u'Ꮶ': 'k', u'ᛕ': 'k', u'ꓗ': 'k', u'ƙ': 'k', u'Ⱪ': 'k', u'Қ': 'k', u'₭': 'k', u'Ꝁ': 'k', u'Ҟ': 'k', u'Ƙ': 'k', u'ᴋ': 'k', u'ĸ': 'k', u'κ': 'k', u'ϰ': 'k', u'ⲕ': 'k', u'к': 'k', u'ꮶ': 'k', u'қ': 'k', u'ҟ': 'k', u'𐌠': 'l', u'𞣇': 'l', u'𝟏': 'l', u'𝟙': 'l', u'𝟣': 'l', u'𝟭': 'l', u'𝟷': 'l', u'𝐈': 'l', u'𝐼': 'l', u'𝑰': 'l', u'𝓘': 'l', u'𝕀': 'l', u'𝕴': 'l', u'𝖨': 'l', u'𝗜': 'l', u'𝘐': 'l', u'𝙄': 'l', u'𝙸': 'l', u'𝐥': 'l', u'𝑙': 'l', u'𝒍': 'l', u'𝓁': 'l', u'𝓵': 'l', u'𝔩': 'l', u'𝕝': 'l', u'𝖑': 'l', u'𝗅': 'l', u'𝗹': 'l', u'𝘭': 'l', u'𝙡': 'l', u'𝚕': 'l', u'𝚰': 'l', u'𝛪': 'l', u'𝜤': 'l', u'𝝞': 'l', u'𝞘': 'l', u'𞸀': 'l', u'𞺀': 'l', u'𖼨': 'l', u'𐊊': 'l', u'𐌉': 'l', u'𝈪': 'l', u'𝐋': 'l', u'𝐿': 'l', u'𝑳': 'l', u'𝓛': 'l', u'𝔏': 'l', u'𝕃': 'l', u'𝕷': 'l', u'𝖫': 'l', u'𝗟': 'l', u'𝘓': 'l', u'𝙇': 'l', u'𝙻': 'l', u'𖼖': 'l', u'𑢣': 'l', u'𑢲': 'l', u'𐐛': 'l', u'𐔦': 'l', u'𐑃': 'l', u'׀': 'l', u'|': 'l', u'∣': 'l', u'⏽': 'l', u'│': 'l', u'1': 'l', u'١': 'l', u'۱': 'l', u'I': 'l', u'I': 'l', u'Ⅰ': 'l', u'ℐ': 'l', u'ℑ': 'l', u'Ɩ': 'l', u'l': 'l', u'ⅼ': 'l', u'ℓ': 'l', u'ǀ': 'l', u'Ι': 'l', u'Ⲓ': 'l', u'І': 'l', u'Ӏ': 'l', u'ו': 'l', u'ן': 'l', u'ا': 'l', u'ﺎ': 'l', u'ﺍ': 'l', u'ߊ': 'l', u'ⵏ': 'l', u'ᛁ': 'l', u'ꓲ': 'l', u'Ⅼ': 'l', u'ℒ': 'l', u'Ⳑ': 'l', u'Ꮮ': 'l', u'ᒪ': 'l', u'ꓡ': 'l', u'ﴼ': 'l', u'ﴽ': 'l', u'ł': 'l', u'Ł': 'l', u'ɭ': 'l', u'Ɨ': 'l', u'ƚ': 'l', u'ɫ': 'l', u'إ': 'l', u'ﺈ': 'l', u'ﺇ': 'l', u'ٳ': 'l', u'ŀ': 'l', u'Ŀ': 'l', u'ᒷ': 'l', u'أ': 'l', u'ﺄ': 'l', u'ﺃ': 'l', u'ٲ': 'l', u'ٵ': 'l', u'ⳑ': 'l', u'ꮮ': 'l', u'🄂': 'l.', u'⒈': 'l.', u'lj': 'lj', u'IJ': 'lj', u'Lj': 'lj', u'LJ': 'lj', u'‖': 'll', u'∥': 'll', u'Ⅱ': 'll', u'ǁ': 'll', u'װ': 'll', u'Ⅲ': 'lll', u'ʪ': 'ls', u'₶': 'lt', u'Ⅳ': 'lv', u'Ⅸ': 'lx', u'ʫ': 'lz', u'𝐌': 'm', u'𝑀': 'm', u'𝑴': 'm', u'𝓜': 'm', u'𝔐': 'm', u'𝕄': 'm', u'𝕸': 'm', u'𝖬': 'm', u'𝗠': 'm', u'𝘔': 'm', u'𝙈': 'm', u'𝙼': 'm', u'𝚳': 'm', u'𝛭': 'm', u'𝜧': 'm', u'𝝡': 'm', u'𝞛': 'm', u'𐊰': 'm', u'𐌑': 'm', u'M': 'm', u'Ⅿ': 'm', u'ℳ': 'm', u'Μ': 'm', u'Ϻ': 'm', u'Ⲙ': 'm', u'М': 'm', u'Ꮇ': 'm', u'ᗰ': 'm', u'ᛖ': 'm', u'ꓟ': 'm', u'Ӎ': 'm', u'ⷨ': 'm', u'ᷟ': 'm', u'ṃ': 'm', u'🝫': 'mb', u'𝐧': 'n', u'𝑛': 'n', u'𝒏': 'n', u'𝓃': 'n', u'𝓷': 'n', u'𝔫': 'n', u'𝕟': 'n', u'𝖓': 'n', u'𝗇': 'n', u'𝗻': 'n', u'𝘯': 'n', u'𝙣': 'n', u'𝚗': 'n', u'𝐍': 'n', u'𝑁': 'n', u'𝑵': 'n', u'𝒩': 'n', u'𝓝': 'n', u'𝔑': 'n', u'𝕹': 'n', u'𝖭': 'n', u'𝗡': 'n', u'𝘕': 'n', u'𝙉': 'n', u'𝙽': 'n', u'𝚴': 'n', u'𝛮': 'n', u'𝜨': 'n', u'𝝢': 'n', u'𝞜': 'n', u'𐔓': 'n', u'𐆎': 'n', u'𝛈': 'n', u'𝜂': 'n', u'𝜼': 'n', u'𝝶': 'n', u'𝞰': 'n', u'𐑍': 'n', u'ո': 'n', u'ռ': 'n', u'N': 'n', u'ℕ': 'n', u'Ν': 'n', u'Ⲛ': 'n', u'ꓠ': 'n', u'ɳ': 'n', u'ƞ': 'n', u'η': 'n', u'Ɲ': 'n', u'ᵰ': 'n', u'ņ': 'n', u'ɲ': 'n', u'nj': 'nj', u'Nj': 'nj', u'NJ': 'nj', u'№': 'no', u'𝐨': 'o', u'𝑜': 'o', u'𝒐': 'o', u'𝓸': 'o', u'𝔬': 'o', u'𝕠': 'o', u'𝖔': 'o', u'𝗈': 'o', u'𝗼': 'o', u'𝘰': 'o', u'𝙤': 'o', u'𝚘': 'o', u'𝛐': 'o', u'𝜊': 'o', u'𝝄': 'o', u'𝝾': 'o', u'𝞸': 'o', u'𝛔': 'o', u'𝜎': 'o', u'𝝈': 'o', u'𝞂': 'o', u'𝞼': 'o', u'𞸤': 'o', u'𞹤': 'o', u'𞺄': 'o', u'𐓪': 'o', u'𑣈': 'o', u'𑣗': 'o', u'𐐬': 'o', u'𑓐': 'o', u'𑣠': 'o', u'𝟎': 'o', u'𝟘': 'o', u'𝟢': 'o', u'𝟬': 'o', u'𝟶': 'o', u'𝐎': 'o', u'𝑂': 'o', u'𝑶': 'o', u'𝒪': 'o', u'𝓞': 'o', u'𝔒': 'o', u'𝕆': 'o', u'𝕺': 'o', u'𝖮': 'o', u'𝗢': 'o', u'𝘖': 'o', u'𝙊': 'o', u'𝙾': 'o', u'𝚶': 'o', u'𝛰': 'o', u'𝜪': 'o', u'𝝤': 'o', u'𝞞': 'o', u'𐓂': 'o', u'𑢵': 'o', u'𐊒': 'o', u'𐊫': 'o', u'𐐄': 'o', u'𐔖': 'o', u'𝈚': 'o', u'🜔': 'o', u'𝛉': 'o', u'𝛝': 'o', u'𝜃': 'o', u'𝜗': 'o', u'𝜽': 'o', u'𝝑': 'o', u'𝝷': 'o', u'𝞋': 'o', u'𝞱': 'o', u'𝟅': 'o', u'𝚯': 'o', u'𝚹': 'o', u'𝛩': 'o', u'𝛳': 'o', u'𝜣': 'o', u'𝜭': 'o', u'𝝝': 'o', u'𝝧': 'o', u'𝞗': 'o', u'𝞡': 'o', u'🄁': 'o', u'🄀': 'o', u'ం': 'o', u'ಂ': 'o', u'ം': 'o', u'ං': 'o', u'०': 'o', u'੦': 'o', u'૦': 'o', u'௦': 'o', u'౦': 'o', u'೦': 'o', u'൦': 'o', u'๐': 'o', u'໐': 'o', u'၀': 'o', u'٥': 'o', u'۵': 'o', u'o': 'o', u'ℴ': 'o', u'ᴏ': 'o', u'ᴑ': 'o', u'ꬽ': 'o', u'ο': 'o', u'σ': 'o', u'ⲟ': 'o', u'о': 'o', u'ჿ': 'o', u'օ': 'o', u'ס': 'o', u'ه': 'o', u'ﻫ': 'o', u'ﻬ': 'o', u'ﻪ': 'o', u'ﻩ': 'o', u'ھ': 'o', u'ﮬ': 'o', u'ﮭ': 'o', u'ﮫ': 'o', u'ﮪ': 'o', u'ہ': 'o', u'ﮨ': 'o', u'ﮩ': 'o', u'ﮧ': 'o', u'ﮦ': 'o', u'ە': 'o', u'ഠ': 'o', u'ဝ': 'o', u'߀': 'o', u'০': 'o', u'୦': 'o', u'〇': 'o', u'O': 'o', u'Ο': 'o', u'Ⲟ': 'o', u'О': 'o', u'Օ': 'o', u'ⵔ': 'o', u'ዐ': 'o', u'ଠ': 'o', u'ꓳ': 'o', u'⁰': 'o', u'º': 'o', u'ᵒ': 'o', u'ǒ': 'o', u'ŏ': 'o', u'Ǒ': 'o', u'Ŏ': 'o', u'ۿ': 'o', u'ø': 'o', u'ꬾ': 'o', u'Ø': 'o', u'ⵁ': 'o', u'Ǿ': 'o', u'ɵ': 'o', u'ꝋ': 'o', u'ө': 'o', u'ѳ': 'o', u'ꮎ': 'o', u'ꮻ': 'o', u'⊖': 'o', u'⊝': 'o', u'⍬': 'o', u'Ɵ': 'o', u'Ꝋ': 'o', u'θ': 'o', u'ϑ': 'o', u'Θ': 'o', u'ϴ': 'o', u'Ө': 'o', u'Ѳ': 'o', u'ⴱ': 'o', u'Ꮎ': 'o', u'Ꮻ': 'o', u'ꭴ': 'o', u'ﳙ': 'o', u'ơ': 'o', u'Ơ': 'o', u'Ꭴ': 'o', u'🄁': 'o.', u'🄀': 'o.', u'œ': 'oe', u'Œ': 'oe', u'ɶ': 'oe', u'∞': 'oo', u'ꝏ': 'oo', u'ꚙ': 'oo', u'Ꝏ': 'oo', u'Ꚙ': 'oo', u'တ': 'oo', u'𝐩': 'p', u'𝑝': 'p', u'𝒑': 'p', u'𝓅': 'p', u'𝓹': 'p', u'𝔭': 'p', u'𝕡': 'p', u'𝖕': 'p', u'𝗉': 'p', u'𝗽': 'p', u'𝘱': 'p', u'𝙥': 'p', u'𝚙': 'p', u'𝛒': 'p', u'𝛠': 'p', u'𝜌': 'p', u'𝜚': 'p', u'𝝆': 'p', u'𝝔': 'p', u'𝞀': 'p', u'𝞎': 'p', u'𝞺': 'p', u'𝟈': 'p', u'𝐏': 'p', u'𝑃': 'p', u'𝑷': 'p', u'𝒫': 'p', u'𝓟': 'p', u'𝔓': 'p', u'𝕻': 'p', u'𝖯': 'p', u'𝗣': 'p', u'𝘗': 'p', u'𝙋': 'p', u'𝙿': 'p', u'𝚸': 'p', u'𝛲': 'p', u'𝜬': 'p', u'𝝦': 'p', u'𝞠': 'p', u'𐊕': 'p', u'⍴': 'p', u'p': 'p', u'ρ': 'p', u'ϱ': 'p', u'ⲣ': 'p', u'р': 'p', u'P': 'p', u'ℙ': 'p', u'Ρ': 'p', u'Ⲣ': 'p', u'Р': 'p', u'Ꮲ': 'p', u'ᑭ': 'p', u'ꓑ': 'p', u'ƥ': 'p', u'ᵽ': 'p', u'ᑷ': 'p', u'ᒆ': 'p', u'ᴩ': 'p', u'ꮲ': 'p', u'𝐪': 'q', u'𝑞': 'q', u'𝒒': 'q', u'𝓆': 'q', u'𝓺': 'q', u'𝔮': 'q', u'𝕢': 'q', u'𝖖': 'q', u'𝗊': 'q', u'𝗾': 'q', u'𝘲': 'q', u'𝙦': 'q', u'𝚚': 'q', u'𝐐': 'q', u'𝑄': 'q', u'𝑸': 'q', u'𝒬': 'q', u'𝓠': 'q', u'𝔔': 'q', u'𝕼': 'q', u'𝖰': 'q', u'𝗤': 'q', u'𝘘': 'q', u'𝙌': 'q', u'𝚀': 'q', u'ԛ': 'q', u'գ': 'q', u'զ': 'q', u'ℚ': 'q', u'ⵕ': 'q', u'ʠ': 'q', u'ᶐ': 'q', u'ɋ': 'q', u'𝐫': 'r', u'𝑟': 'r', u'𝒓': 'r', u'𝓇': 'r', u'𝓻': 'r', u'𝔯': 'r', u'𝕣': 'r', u'𝖗': 'r', u'𝗋': 'r', u'𝗿': 'r', u'𝘳': 'r', u'𝙧': 'r', u'𝚛': 'r', u'𝈖': 'r', u'𝐑': 'r', u'𝑅': 'r', u'𝑹': 'r', u'𝓡': 'r', u'𝕽': 'r', u'𝖱': 'r', u'𝗥': 'r', u'𝘙': 'r', u'𝙍': 'r', u'𝚁': 'r', u'𐒴': 'r', u'ꭇ': 'r', u'ꭈ': 'r', u'ᴦ': 'r', u'ⲅ': 'r', u'г': 'r', u'ꮁ': 'r', u'ℛ': 'r', u'ℜ': 'r', u'ℝ': 'r', u'Ʀ': 'r', u'Ꭱ': 'r', u'Ꮢ': 'r', u'ᖇ': 'r', u'ꓣ': 'r', u'ɽ': 'r', u'ɼ': 'r', u'ɍ': 'r', u'ғ': 'r', u'ᵲ': 'r', u'ґ': 'r', u'ꭱ': 'r', u'ʀ': 'r', u'ꮢ': 'r', u'ᵳ': 'r', u'𑣣': 'rn', u'𝐦': 'rn', u'𝑚': 'rn', u'𝒎': 'rn', u'𝓂': 'rn', u'𝓶': 'rn', u'𝔪': 'rn', u'𝕞': 'rn', u'𝖒': 'rn', u'𝗆': 'rn', u'𝗺': 'rn', u'𝘮': 'rn', u'𝙢': 'rn', u'𝚖': 'rn', u'𑜀': 'rn', u'ⅿ': 'rn', u'₥': 'rn', u'ɱ': 'rn', u'ᵯ': 'rn', u'𝐬': 's', u'𝑠': 's', u'𝒔': 's', u'𝓈': 's', u'𝓼': 's', u'𝔰': 's', u'𝕤': 's', u'𝖘': 's', u'𝗌': 's', u'𝘀': 's', u'𝘴': 's', u'𝙨': 's', u'𝚜': 's', u'𑣁': 's', u'𐑈': 's', u'𝐒': 's', u'𝑆': 's', u'𝑺': 's', u'𝒮': 's', u'𝓢': 's', u'𝔖': 's', u'𝕊': 's', u'𝕾': 's', u'𝖲': 's', u'𝗦': 's', u'𝘚': 's', u'𝙎': 's', u'𝚂': 's', u'𖼺': 's', u'𐊖': 's', u'𐐠': 's', u's': 's', u'ꜱ': 's', u'ƽ': 's', u'ѕ': 's', u'ꮪ': 's', u'S': 's', u'Ѕ': 's', u'Տ': 's', u'Ꮥ': 's', u'Ꮪ': 's', u'ꓢ': 's', u'ʂ': 's', u'ᵴ': 's', u'🝜': 'sss', u'st': 'st', u'𝐭': 't', u'𝑡': 't', u'𝒕': 't', u'𝓉': 't', u'𝓽': 't', u'𝔱': 't', u'𝕥': 't', u'𝖙': 't', u'𝗍': 't', u'𝘁': 't', u'𝘵': 't', u'𝙩': 't', u'𝚝': 't', u'🝨': 't', u'𝐓': 't', u'𝑇': 't', u'𝑻': 't', u'𝒯': 't', u'𝓣': 't', u'𝔗': 't', u'𝕋': 't', u'𝕿': 't', u'𝖳': 't', u'𝗧': 't', u'𝘛': 't', u'𝙏': 't', u'𝚃': 't', u'𝚻': 't', u'𝛵': 't', u'𝜯': 't', u'𝝩': 't', u'𝞣': 't', u'𖼊': 't', u'𑢼': 't', u'𐊗': 't', u'𐊱': 't', u'𐌕': 't', u'𝛕': 't', u'𝜏': 't', u'𝝉': 't', u'𝞃': 't', u'𝞽': 't', u'⊤': 't', u'⟙': 't', u'T': 't', u'Τ': 't', u'Ⲧ': 't', u'Т': 't', u'Ꭲ': 't', u'ꓔ': 't', u'⍡': 't', u'Ⱦ': 't', u'Ț': 't', u'Ţ': 't', u'Ʈ': 't', u'Ҭ': 't', u'₮': 't', u'ŧ': 't', u'Ŧ': 't', u'ᵵ': 't', u'𝐮': 'u', u'𝑢': 'u', u'𝒖': 'u', u'𝓊': 'u', u'𝓾': 'u', u'𝔲': 'u', u'𝕦': 'u', u'𝖚': 'u', u'𝗎': 'u', u'𝘂': 'u', u'𝘶': 'u', u'𝙪': 'u', u'𝚞': 'u', u'𝛖': 'u', u'𝜐': 'u', u'𝝊': 'u', u'𝞄': 'u', u'𝞾': 'u', u'𐓶': 'u', u'𑣘': 'u', u'𝐔': 'u', u'𝑈': 'u', u'𝑼': 'u', u'𝒰': 'u', u'𝓤': 'u', u'𝔘': 'u', u'𝕌': 'u', u'𝖀': 'u', u'𝖴': 'u', u'𝗨': 'u', u'𝘜': 'u', u'𝙐': 'u', u'𝚄': 'u', u'𐓎': 'u', u'𖽂': 'u', u'𑢸': 'u', u'ꞟ': 'u', u'ᴜ': 'u', u'ꭎ': 'u', u'ꭒ': 'u', u'ʋ': 'u', u'υ': 'u', u'ս': 'u', u'∪': 'u', u'⋃': 'u', u'Ս': 'u', u'ሀ': 'u', u'ᑌ': 'u', u'ꓴ': 'u', u'ǔ': 'u', u'Ǔ': 'u', u'ᵾ': 'u', u'ꮜ': 'u', u'Ʉ': 'u', u'Ꮜ': 'u', u'ᑘ': 'u', u'ᑧ': 'u', u'℧': 'u', u'ᘮ': 'u', u'ᘴ': 'u', u'Ʊ': 'u', u'ᵿ': 'u', u'ᵫ': 'ue', u'ꭣ': 'uo', u'𝐯': 'v', u'𝑣': 'v', u'𝒗': 'v', u'𝓋': 'v', u'𝓿': 'v', u'𝔳': 'v', u'𝕧': 'v', u'𝖛': 'v', u'𝗏': 'v', u'𝘃': 'v', u'𝘷': 'v', u'𝙫': 'v', u'𝚟': 'v', u'𝛎': 'v', u'𝜈': 'v', u'𝝂': 'v', u'𝝼': 'v', u'𝞶': 'v', u'𑜆': 'v', u'𑣀': 'v', u'𝈍': 'v', u'𝐕': 'v', u'𝑉': 'v', u'𝑽': 'v', u'𝒱': 'v', u'𝓥': 'v', u'𝔙': 'v', u'𝕍': 'v', u'𝖁': 'v', u'𝖵': 'v', u'𝗩': 'v', u'𝘝': 'v', u'𝙑': 'v', u'𝚅': 'v', u'𖼈': 'v', u'𑢠': 'v', u'𐔝': 'v', u'𐆗': 'v', u'🜈': 'v', u'∨': 'v', u'⋁': 'v', u'v': 'v', u'ⅴ': 'v', u'ᴠ': 'v', u'ν': 'v', u'ѵ': 'v', u'ט': 'v', u'ꮩ': 'v', u'٧': 'v', u'۷': 'v', u'Ⅴ': 'v', u'Ѵ': 'v', u'ⴸ': 'v', u'Ꮩ': 'v', u'ᐯ': 'v', u'ꛟ': 'v', u'ꓦ': 'v', u'ᐻ': 'v', u'🝬': 'vb', u'ⅵ': 'vi', u'ⅶ': 'vii', u'ⅷ': 'viii', u'Ⅵ': 'vl', u'Ⅶ': 'vll', u'Ⅷ': 'vlll', u'𝐰': 'w', u'𝑤': 'w', u'𝒘': 'w', u'𝓌': 'w', u'𝔀': 'w', u'𝔴': 'w', u'𝕨': 'w', u'𝖜': 'w', u'𝗐': 'w', u'𝘄': 'w', u'𝘸': 'w', u'𝙬': 'w', u'𝚠': 'w', u'𑜊': 'w', u'𑜎': 'w', u'𑜏': 'w', u'𑣯': 'w', u'𑣦': 'w', u'𝐖': 'w', u'𝑊': 'w', u'𝑾': 'w', u'𝒲': 'w', u'𝓦': 'w', u'𝔚': 'w', u'𝕎': 'w', u'𝖂': 'w', u'𝖶': 'w', u'𝗪': 'w', u'𝘞': 'w', u'𝙒': 'w', u'𝚆': 'w', u'𑓅': 'w', u'ɯ': 'w', u'ᴡ': 'w', u'ѡ': 'w', u'ԝ': 'w', u'ա': 'w', u'ꮃ': 'w', u'Ԝ': 'w', u'Ꮃ': 'w', u'Ꮤ': 'w', u'ꓪ': 'w', u'ѽ': 'w', u'₩': 'w', u'ꝡ': 'w', u'𝐱': 'x', u'𝑥': 'x', u'𝒙': 'x', u'𝓍': 'x', u'𝔁': 'x', u'𝔵': 'x', u'𝕩': 'x', u'𝖝': 'x', u'𝗑': 'x', u'𝘅': 'x', u'𝘹': 'x', u'𝙭': 'x', u'𝚡': 'x', u'𐌢': 'x', u'𑣬': 'x', u'𝐗': 'x', u'𝑋': 'x', u'𝑿': 'x', u'𝒳': 'x', u'𝓧': 'x', u'𝔛': 'x', u'𝕏': 'x', u'𝖃': 'x', u'𝖷': 'x', u'𝗫': 'x', u'𝘟': 'x', u'𝙓': 'x', u'𝚇': 'x', u'𝚾': 'x', u'𝛸': 'x', u'𝜲': 'x', u'𝝬': 'x', u'𝞦': 'x', u'𐊐': 'x', u'𐊴': 'x', u'𐌗': 'x', u'𐔧': 'x', u'𐆖': 'x', u'᙮': 'x', u'×': 'x', u'⤫': 'x', u'⤬': 'x', u'⨯': 'x', u'x': 'x', u'ⅹ': 'x', u'х': 'x', u'ᕁ': 'x', u'ᕽ': 'x', u'ⷯ': 'x', u'ͯ': 'x', u'᙭': 'x', u'╳': 'x', u'X': 'x', u'Ⅹ': 'x', u'Ꭓ': 'x', u'Χ': 'x', u'Ⲭ': 'x', u'Х': 'x', u'ⵝ': 'x', u'ᚷ': 'x', u'ꓫ': 'x', u'⨰': 'x', u'Ҳ': 'x', u'ⅺ': 'xi', u'ⅻ': 'xii', u'Ⅺ': 'xl', u'Ⅻ': 'xll', u'𝐲': 'y', u'𝑦': 'y', u'𝒚': 'y', u'𝓎': 'y', u'𝔂': 'y', u'𝔶': 'y', u'𝕪': 'y', u'𝖞': 'y', u'𝗒': 'y', u'𝘆': 'y', u'𝘺': 'y', u'𝙮': 'y', u'𝚢': 'y', u'𝛄': 'y', u'𝛾': 'y', u'𝜸': 'y', u'𝝲': 'y', u'𝞬': 'y', u'𑣜': 'y', u'𝐘': 'y', u'𝑌': 'y', u'𝒀': 'y', u'𝒴': 'y', u'𝓨': 'y', u'𝔜': 'y', u'𝕐': 'y', u'𝖄': 'y', u'𝖸': 'y', u'𝗬': 'y', u'𝘠': 'y', u'𝙔': 'y', u'𝚈': 'y', u'𝚼': 'y', u'𝛶': 'y', u'𝜰': 'y', u'𝝪': 'y', u'𝞤': 'y', u'𖽃': 'y', u'𑢤': 'y', u'𐊲': 'y', u'ɣ': 'y', u'ᶌ': 'y', u'y': 'y', u'ʏ': 'y', u'ỿ': 'y', u'ꭚ': 'y', u'γ': 'y', u'ℽ': 'y', u'у': 'y', u'ү': 'y', u'ყ': 'y', u'Y': 'y', u'Υ': 'y', u'ϒ': 'y', u'Ⲩ': 'y', u'У': 'y', u'Ү': 'y', u'Ꭹ': 'y', u'Ꮍ': 'y', u'ꓬ': 'y', u'ƴ': 'y', u'ɏ': 'y', u'ұ': 'y', u'¥': 'y', u'Ɏ': 'y', u'Ұ': 'y', u'𝐳': 'z', u'𝑧': 'z', u'𝒛': 'z', u'𝓏': 'z', u'𝔃': 'z', u'𝔷': 'z', u'𝕫': 'z', u'𝖟': 'z', u'𝗓': 'z', u'𝘇': 'z', u'𝘻': 'z', u'𝙯': 'z', u'𝚣': 'z', u'𑣄': 'z', u'𐋵': 'z', u'𑣥': 'z', u'𝐙': 'z', u'𝑍': 'z', u'𝒁': 'z', u'𝒵': 'z', u'𝓩': 'z', u'𝖅': 'z', u'𝖹': 'z', u'𝗭': 'z', u'𝘡': 'z', u'𝙕': 'z', u'𝚉': 'z', u'𝚭': 'z', u'𝛧': 'z', u'𝜡': 'z', u'𝝛': 'z', u'𝞕': 'z', u'𑢩': 'z', u'ᴢ': 'z', u'ꮓ': 'z', u'Z': 'z', u'ℤ': 'z', u'ℨ': 'z', u'Ζ': 'z', u'Ꮓ': 'z', u'ꓜ': 'z', u'ʐ': 'z', u'ƶ': 'z', u'Ƶ': 'z', u'ȥ': 'z', u'Ȥ': 'z', u'ᵶ': 'z', u'‐': '-', u'‑': '-', u'‒': '-', u'–': '-', u'﹘': '-', u'۔': '-', u'⁃': '-', u'˗': '-', u'−': '-', u'➖': '-', u'Ⲻ': '-'} def unconfuse(domain): if domain.startswith('xn--'): domain = domain.encode('idna').decode('idna') unconfused = '' for i in range(len(domain)): if domain[i] in confusables: unconfused += confusables[domain[i]] else: unconfused += domain[i] return unconfused
''' All tests for the Osscie Package ''' def test_1(): ''' Sample Test ''' assert True
""" All tests for the Osscie Package """ def test_1(): """ Sample Test """ assert True
config = dict( # Project settings project_name='MoA_feature_selection', batch_size=1024, num_workers=4, # Validation n_folds=5, # Preprocessing outlier_removal=True, # TODO # General training # Ensemble of models ensemble=[ dict( # Model type='Target', # Feature selection n_features=20, n_cutoff=20, # number of instances required, otherwise set prediction to 0 model=dict( model='MoaDenseNet', n_hidden_layer=2, dropout=0.5, hidden_dim=32, activation='prelu', # prelu, relu normalization='batch', # Training batch_size=512, num_workers=4, n_epochs=25, optimizer='adam', learning_rate=0.001, weight_decay=0.00001, scheduler='OneCycleLR', use_smart_init=True, use_smote=False, use_amp=False, verbose=True, # Augmentation augmentations=[], ) ), ], # Ensembling ensemble_method='mean', # TODO # Postprocessing surety=True, # TODO )
config = dict(project_name='MoA_feature_selection', batch_size=1024, num_workers=4, n_folds=5, outlier_removal=True, ensemble=[dict(type='Target', n_features=20, n_cutoff=20, model=dict(model='MoaDenseNet', n_hidden_layer=2, dropout=0.5, hidden_dim=32, activation='prelu', normalization='batch', batch_size=512, num_workers=4, n_epochs=25, optimizer='adam', learning_rate=0.001, weight_decay=1e-05, scheduler='OneCycleLR', use_smart_init=True, use_smote=False, use_amp=False, verbose=True, augmentations=[]))], ensemble_method='mean', surety=True)
class Par(object): def __init__(self,tokens): self.tokens=tokens def parse(self): self.count = 0 while self.count < len(self.tokens): tokens_type = self.tokens[self.count][0] tokens_value = self.tokens[self.count][1] #print(tokens_type , tokens_value) if tokens_type == 'VARIABLE' and tokens_value == 'var': self.par_var_dec(self.tokens[self.count:len(self.tokens)]) ask = (self.assignmentOpp(self.tokens[self.count:len(self.tokens)])) elif tokens_type == 'IDENTIFIRE' and tokens_value == 'showme': self.showme(self.tokens[self.count:len(self.tokens)],ask) elif tokens_type == 'INOUT' and tokens_value == '~': self.add(self.tokens[self.count:len(self.tokens)],ask) self.count += 1 def par_var_dec(self ,token_tip ): token_chk = 0 for token in range(0,len(token_tip)+1): tokens_type = token_tip[token_chk][0] tokens_value = token_tip[token_chk][1] il=[] for i in range(1,len(token_tip)+1,4): il.append(i) ol=[] for j in range(2,len(token_tip)+1,4): ol.append(j) vl=[] for h in range(3,len(token_tip)+1,4): vl.append(h) cl=[] for k in range(4,len(token_tip)+1,4): cl.append(k) if tokens_type == 'STATEMENT_END': break elif token in il: if tokens_type == "IDENTIFIRE": identifire = tokens_value else : print("Syntax ERROR : you must give a variable name after variable decliaration") break elif token in ol:#2 or token == 4 or token == 6 or token == 8: if tokens_type == "OPARETOR": tok =1 else : print("Syntax ERROR :you miss the assignment operator after VARIABLE name") break elif token in vl:#== 3 or token == 5 or token == 7 or token == 9: if tokens_type == 'STRING': strg = tokens_value elif tokens_type == 'INTEGER': initalization =1 else : print("Syntax ERROR : IT CAN BE A INTEGER, STRING OR IDEMTIFIRE I.E. variable") break elif token in cl: if tokens_type == 'COMMA': comma = tokens_value elif tokens_type == "STATEMENT_END": break else : print("Syntax ERROR : in this position you can used comma for multiple decliaration or u can used assignment operator for initalization") break token_chk = token_chk + 1 def showme(self,token_tip,toko): if token_tip[1][0] == "INOUT" : if token_tip[2][0] == "STRING": print(token_tip[2][1]) elif token_tip[3][0]=="EMPTY": print("Statement MISSING : you have to give '.' for debag") else: print("Syntax ERROR : you have to type string within parentisis or you have to give output operator") token_chk = 1 for i in range(0 ,len(toko)): tokens_id=toko[i][0] tokens_val=toko[i][1] if token_tip[1][0] == "INOUT" and token_tip[2][1] == tokens_id and token_tip[3][0] == 'STATEMENT_END': print(tokens_val) def assignmentOpp(self,token_tip): toko = [] token_chk = 1 for i in range(0 ,len(toko)): tokens_id=toko[i][0] tokens_val=toko[i][1] for token in range(0,len(token_tip)): if token_tip[token][1]== '=': #token_tip[token-1][1] = token_tip[token+1][1] toko.append([token_tip[token-1][1],token_tip[token +1][1]]) return (toko) def add(self,token_tip,toko): print(toko) if token_tip[0][0] == 'INOUT' and token_tip[1][0] == 'IDENTIFIRE' and token_tip[2][1] == "=" and token_tip[3][0] == toko[i][0] and token_tip[i+2][0] == toko[i+6][0] and token_tip[6][0] == "STATEMENT_END": for i in range(0,len(toko)): if toko[i][0] == token_tip[1][1]: print(i) #if token_tip[4][1] == "+": #toko[token_tip[1][0]] #return (tok)
class Par(object): def __init__(self, tokens): self.tokens = tokens def parse(self): self.count = 0 while self.count < len(self.tokens): tokens_type = self.tokens[self.count][0] tokens_value = self.tokens[self.count][1] if tokens_type == 'VARIABLE' and tokens_value == 'var': self.par_var_dec(self.tokens[self.count:len(self.tokens)]) ask = self.assignmentOpp(self.tokens[self.count:len(self.tokens)]) elif tokens_type == 'IDENTIFIRE' and tokens_value == 'showme': self.showme(self.tokens[self.count:len(self.tokens)], ask) elif tokens_type == 'INOUT' and tokens_value == '~': self.add(self.tokens[self.count:len(self.tokens)], ask) self.count += 1 def par_var_dec(self, token_tip): token_chk = 0 for token in range(0, len(token_tip) + 1): tokens_type = token_tip[token_chk][0] tokens_value = token_tip[token_chk][1] il = [] for i in range(1, len(token_tip) + 1, 4): il.append(i) ol = [] for j in range(2, len(token_tip) + 1, 4): ol.append(j) vl = [] for h in range(3, len(token_tip) + 1, 4): vl.append(h) cl = [] for k in range(4, len(token_tip) + 1, 4): cl.append(k) if tokens_type == 'STATEMENT_END': break elif token in il: if tokens_type == 'IDENTIFIRE': identifire = tokens_value else: print('Syntax ERROR : you must give a variable name after variable decliaration') break elif token in ol: if tokens_type == 'OPARETOR': tok = 1 else: print('Syntax ERROR :you miss the assignment operator after VARIABLE name') break elif token in vl: if tokens_type == 'STRING': strg = tokens_value elif tokens_type == 'INTEGER': initalization = 1 else: print('Syntax ERROR : IT CAN BE A INTEGER, STRING OR IDEMTIFIRE I.E. variable') break elif token in cl: if tokens_type == 'COMMA': comma = tokens_value elif tokens_type == 'STATEMENT_END': break else: print('Syntax ERROR : in this position you can used comma for multiple decliaration or u can used assignment operator for initalization') break token_chk = token_chk + 1 def showme(self, token_tip, toko): if token_tip[1][0] == 'INOUT': if token_tip[2][0] == 'STRING': print(token_tip[2][1]) elif token_tip[3][0] == 'EMPTY': print("Statement MISSING : you have to give '.' for debag") else: print('Syntax ERROR : you have to type string within parentisis or you have to give output operator') token_chk = 1 for i in range(0, len(toko)): tokens_id = toko[i][0] tokens_val = toko[i][1] if token_tip[1][0] == 'INOUT' and token_tip[2][1] == tokens_id and (token_tip[3][0] == 'STATEMENT_END'): print(tokens_val) def assignment_opp(self, token_tip): toko = [] token_chk = 1 for i in range(0, len(toko)): tokens_id = toko[i][0] tokens_val = toko[i][1] for token in range(0, len(token_tip)): if token_tip[token][1] == '=': toko.append([token_tip[token - 1][1], token_tip[token + 1][1]]) return toko def add(self, token_tip, toko): print(toko) if token_tip[0][0] == 'INOUT' and token_tip[1][0] == 'IDENTIFIRE' and (token_tip[2][1] == '=') and (token_tip[3][0] == toko[i][0]) and (token_tip[i + 2][0] == toko[i + 6][0]) and (token_tip[6][0] == 'STATEMENT_END'): for i in range(0, len(toko)): if toko[i][0] == token_tip[1][1]: print(i)
# Problem: https://docs.google.com/document/d/1tS-7_Z0VNpwO-8lgj6B3NWzIN9bHtQW7Pxqhy8U4HvQ/edit?usp=sharing message = input() rev = message[::-1] for a, b in zip(message, rev): print(a, b)
message = input() rev = message[::-1] for (a, b) in zip(message, rev): print(a, b)
class ConfigFromJSON(object): def __init__(self, filename): self.json_file = filename @property def json_file(self): print('set') return self.__json_file @json_file.setter def json_file(self, value): print('check') if value is not 0: raise ValueError("No !") else: print("OK") self.__json_file = value print('instance') myA = ConfigFromJSON(0) print('instance') myA = ConfigFromJSON(0) print(myA.json_file)
class Configfromjson(object): def __init__(self, filename): self.json_file = filename @property def json_file(self): print('set') return self.__json_file @json_file.setter def json_file(self, value): print('check') if value is not 0: raise value_error('No !') else: print('OK') self.__json_file = value print('instance') my_a = config_from_json(0) print('instance') my_a = config_from_json(0) print(myA.json_file)
class _GetAttrAccumulator: @staticmethod def apply(gaa, target): if not isinstance(gaa, _GetAttrAccumulator): if isinstance(gaa, dict): return { _GetAttrAccumulator.apply(k, target): _GetAttrAccumulator.apply(v, target) for k, v in gaa.items() } if isinstance(gaa, list): return [_GetAttrAccumulator.apply(v, target) for v in gaa] return gaa result = target for fn in gaa._gotten: result = fn(target, result) result = _GetAttrAccumulator.apply(result, target) return result def __init__(self, gotten=None, text=None): if gotten is None: gotten = [] self._gotten = gotten self._text = "" if text is None else text def __getitem__(self, item): gotten = [ *self._gotten, lambda t, o: o[item], ] return _GetAttrAccumulator(gotten, "%s[%s]" % (self._text, item)) def __getattr__(self, name): gotten = [ *self._gotten, lambda t, o: getattr(o, name), ] return _GetAttrAccumulator(gotten, "%s.%s" % (self._text, name)) def __call__(self, **kw): gotten = [ *self._gotten, lambda t, o: o(**{ k: _GetAttrAccumulator.apply(v, t) for k, v in kw.items() }), ] return _GetAttrAccumulator(gotten, "%s(...)" % self._text) def __str__(self): return "_GetAttrAccumulator<%s>" % self._text def _recursive_transform(o, fn): # First, a shallow tranform. o = fn(o) # Now a recursive one, if needed. if isinstance(o, dict): return { k: _recursive_transform(v, fn) for k, v in o.items() } elif isinstance(o, list): return [ _recursive_transform(e, fn) for e in o ] else: return o
class _Getattraccumulator: @staticmethod def apply(gaa, target): if not isinstance(gaa, _GetAttrAccumulator): if isinstance(gaa, dict): return {_GetAttrAccumulator.apply(k, target): _GetAttrAccumulator.apply(v, target) for (k, v) in gaa.items()} if isinstance(gaa, list): return [_GetAttrAccumulator.apply(v, target) for v in gaa] return gaa result = target for fn in gaa._gotten: result = fn(target, result) result = _GetAttrAccumulator.apply(result, target) return result def __init__(self, gotten=None, text=None): if gotten is None: gotten = [] self._gotten = gotten self._text = '' if text is None else text def __getitem__(self, item): gotten = [*self._gotten, lambda t, o: o[item]] return __get_attr_accumulator(gotten, '%s[%s]' % (self._text, item)) def __getattr__(self, name): gotten = [*self._gotten, lambda t, o: getattr(o, name)] return __get_attr_accumulator(gotten, '%s.%s' % (self._text, name)) def __call__(self, **kw): gotten = [*self._gotten, lambda t, o: o(**{k: _GetAttrAccumulator.apply(v, t) for (k, v) in kw.items()})] return __get_attr_accumulator(gotten, '%s(...)' % self._text) def __str__(self): return '_GetAttrAccumulator<%s>' % self._text def _recursive_transform(o, fn): o = fn(o) if isinstance(o, dict): return {k: _recursive_transform(v, fn) for (k, v) in o.items()} elif isinstance(o, list): return [_recursive_transform(e, fn) for e in o] else: return o
# Smallest Difference Problem : Two arrays are given and you have to find the # pair (i , j) such abs(i-j) is the smallest where i belongs to the first array and j belong to the second array respectively def smallestDifference(arr1 : list, arr2 : list) : arr1.sort();arr2.sort() i = 0;j = 0 smallest = float("inf");current=float("inf") smallestPair = list() while i < len(arr1) and j < len(arr2) : fnum = arr1[i];snum = arr2[j] if fnum < snum : current = snum - fnum i += 1 elif snum < fnum : current = snum - fnum j += 1 else : return [fnum, snum] if current < smallest : smallest = current smallestPair.append((fnum, snum)) if __name__ == '__main__' : print(smallestDifference([12,3,45,6], [2,4,3,5]))
def smallest_difference(arr1: list, arr2: list): arr1.sort() arr2.sort() i = 0 j = 0 smallest = float('inf') current = float('inf') smallest_pair = list() while i < len(arr1) and j < len(arr2): fnum = arr1[i] snum = arr2[j] if fnum < snum: current = snum - fnum i += 1 elif snum < fnum: current = snum - fnum j += 1 else: return [fnum, snum] if current < smallest: smallest = current smallestPair.append((fnum, snum)) if __name__ == '__main__': print(smallest_difference([12, 3, 45, 6], [2, 4, 3, 5]))
class CasHelper: def __init__(self, app): self.app = app def wrong_password(self, credentials): wd = self.app.wd #self.app.open_home_page() wd.find_element_by_css_selector("input.form-control").click() wd.find_element_by_css_selector("input.form-control").clear() wd.find_element_by_css_selector("input.form-control").send_keys(credentials.login) wd.find_element_by_css_selector("button.btn.btn-default").click() wd.find_element_by_css_selector("input.form-control").click() wd.find_element_by_css_selector("input.form-control").send_keys(credentials.password) wd.find_element_by_xpath("//section[@id='section-left']/section[2]/div/div[1]").click() wd.find_element_by_css_selector("button.btn.btn-default").click()
class Cashelper: def __init__(self, app): self.app = app def wrong_password(self, credentials): wd = self.app.wd wd.find_element_by_css_selector('input.form-control').click() wd.find_element_by_css_selector('input.form-control').clear() wd.find_element_by_css_selector('input.form-control').send_keys(credentials.login) wd.find_element_by_css_selector('button.btn.btn-default').click() wd.find_element_by_css_selector('input.form-control').click() wd.find_element_by_css_selector('input.form-control').send_keys(credentials.password) wd.find_element_by_xpath("//section[@id='section-left']/section[2]/div/div[1]").click() wd.find_element_by_css_selector('button.btn.btn-default').click()
''' Created on 2017. 8. 16. @author: jongyeob ''' _tlm0x8D2_image_size = 2048 tlm0x08D2_struct = [('I','frame_number'), ('I','frame_position'), ('{}B'.format(_tlm0x8D2_image_size),'data')]
""" Created on 2017. 8. 16. @author: jongyeob """ _tlm0x8_d2_image_size = 2048 tlm0x08_d2_struct = [('I', 'frame_number'), ('I', 'frame_position'), ('{}B'.format(_tlm0x8D2_image_size), 'data')]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- assert True; assert not False assert True assert not False
assert True assert not False assert True assert not False
# # PySNMP MIB module SNMP-USM-DH-OBJECTS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SNMP-USM-DH-OBJECTS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:00:30 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") usmUserEntry, = mibBuilder.importSymbols("SNMP-USER-BASED-SM-MIB", "usmUserEntry") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") Bits, ObjectIdentity, Counter64, MibIdentifier, ModuleIdentity, Gauge32, IpAddress, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, experimental, NotificationType, TimeTicks, Integer32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "ObjectIdentity", "Counter64", "MibIdentifier", "ModuleIdentity", "Gauge32", "IpAddress", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "experimental", "NotificationType", "TimeTicks", "Integer32", "Counter32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") snmpUsmDHObjectsMIB = ModuleIdentity((1, 3, 6, 1, 3, 101)) snmpUsmDHObjectsMIB.setRevisions(('2000-03-06 00:00',)) if mibBuilder.loadTexts: snmpUsmDHObjectsMIB.setLastUpdated('200003060000Z') if mibBuilder.loadTexts: snmpUsmDHObjectsMIB.setOrganization('Excite@Home') usmDHKeyObjects = MibIdentifier((1, 3, 6, 1, 3, 101, 1)) usmDHKeyConformance = MibIdentifier((1, 3, 6, 1, 3, 101, 2)) class DHKeyChange(TextualConvention, OctetString): reference = '-- Diffie-Hellman Key-Agreement Standard, PKCS #3; RSA Laboratories, November 1993' status = 'current' usmDHPublicObjects = MibIdentifier((1, 3, 6, 1, 3, 101, 1, 1)) usmDHParameters = MibScalar((1, 3, 6, 1, 3, 101, 1, 1, 1), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: usmDHParameters.setStatus('current') usmDHUserKeyTable = MibTable((1, 3, 6, 1, 3, 101, 1, 1, 2), ) if mibBuilder.loadTexts: usmDHUserKeyTable.setStatus('current') usmDHUserKeyEntry = MibTableRow((1, 3, 6, 1, 3, 101, 1, 1, 2, 1), ) usmUserEntry.registerAugmentions(("SNMP-USM-DH-OBJECTS-MIB", "usmDHUserKeyEntry")) usmDHUserKeyEntry.setIndexNames(*usmUserEntry.getIndexNames()) if mibBuilder.loadTexts: usmDHUserKeyEntry.setStatus('current') usmDHUserAuthKeyChange = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 1), DHKeyChange()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usmDHUserAuthKeyChange.setStatus('current') usmDHUserOwnAuthKeyChange = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 2), DHKeyChange()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usmDHUserOwnAuthKeyChange.setStatus('current') usmDHUserPrivKeyChange = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 3), DHKeyChange()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usmDHUserPrivKeyChange.setStatus('current') usmDHUserOwnPrivKeyChange = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 4), DHKeyChange()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usmDHUserOwnPrivKeyChange.setStatus('current') usmDHKickstartGroup = MibIdentifier((1, 3, 6, 1, 3, 101, 1, 2)) usmDHKickstartTable = MibTable((1, 3, 6, 1, 3, 101, 1, 2, 1), ) if mibBuilder.loadTexts: usmDHKickstartTable.setStatus('current') usmDHKickstartEntry = MibTableRow((1, 3, 6, 1, 3, 101, 1, 2, 1, 1), ).setIndexNames((0, "SNMP-USM-DH-OBJECTS-MIB", "usmDHKickstartIndex")) if mibBuilder.loadTexts: usmDHKickstartEntry.setStatus('current') usmDHKickstartIndex = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: usmDHKickstartIndex.setStatus('current') usmDHKickstartMyPublic = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: usmDHKickstartMyPublic.setStatus('current') usmDHKickstartMgrPublic = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: usmDHKickstartMgrPublic.setStatus('current') usmDHKickstartSecurityName = MibTableColumn((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 4), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: usmDHKickstartSecurityName.setStatus('current') usmDHKeyMIBCompliances = MibIdentifier((1, 3, 6, 1, 3, 101, 2, 1)) usmDHKeyMIBGroups = MibIdentifier((1, 3, 6, 1, 3, 101, 2, 2)) usmDHKeyMIBCompliance = ModuleCompliance((1, 3, 6, 1, 3, 101, 2, 1, 1)).setObjects(("SNMP-USM-DH-OBJECTS-MIB", "usmDHKeyMIBBasicGroup"), ("SNMP-USM-DH-OBJECTS-MIB", "usmDHKeyParamGroup"), ("SNMP-USM-DH-OBJECTS-MIB", "usmDHKeyKickstartGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usmDHKeyMIBCompliance = usmDHKeyMIBCompliance.setStatus('current') usmDHKeyMIBBasicGroup = ObjectGroup((1, 3, 6, 1, 3, 101, 2, 2, 1)).setObjects(("SNMP-USM-DH-OBJECTS-MIB", "usmDHUserAuthKeyChange"), ("SNMP-USM-DH-OBJECTS-MIB", "usmDHUserOwnAuthKeyChange"), ("SNMP-USM-DH-OBJECTS-MIB", "usmDHUserPrivKeyChange"), ("SNMP-USM-DH-OBJECTS-MIB", "usmDHUserOwnPrivKeyChange")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usmDHKeyMIBBasicGroup = usmDHKeyMIBBasicGroup.setStatus('current') usmDHKeyParamGroup = ObjectGroup((1, 3, 6, 1, 3, 101, 2, 2, 2)).setObjects(("SNMP-USM-DH-OBJECTS-MIB", "usmDHParameters")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usmDHKeyParamGroup = usmDHKeyParamGroup.setStatus('current') usmDHKeyKickstartGroup = ObjectGroup((1, 3, 6, 1, 3, 101, 2, 2, 3)).setObjects(("SNMP-USM-DH-OBJECTS-MIB", "usmDHKickstartMyPublic"), ("SNMP-USM-DH-OBJECTS-MIB", "usmDHKickstartMgrPublic"), ("SNMP-USM-DH-OBJECTS-MIB", "usmDHKickstartSecurityName")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usmDHKeyKickstartGroup = usmDHKeyKickstartGroup.setStatus('current') mibBuilder.exportSymbols("SNMP-USM-DH-OBJECTS-MIB", usmDHUserOwnPrivKeyChange=usmDHUserOwnPrivKeyChange, usmDHKeyMIBCompliance=usmDHKeyMIBCompliance, snmpUsmDHObjectsMIB=snmpUsmDHObjectsMIB, usmDHKickstartEntry=usmDHKickstartEntry, usmDHUserPrivKeyChange=usmDHUserPrivKeyChange, usmDHKeyObjects=usmDHKeyObjects, usmDHKickstartIndex=usmDHKickstartIndex, usmDHKickstartMgrPublic=usmDHKickstartMgrPublic, usmDHKickstartMyPublic=usmDHKickstartMyPublic, PYSNMP_MODULE_ID=snmpUsmDHObjectsMIB, usmDHKickstartTable=usmDHKickstartTable, DHKeyChange=DHKeyChange, usmDHUserKeyTable=usmDHUserKeyTable, usmDHKeyMIBCompliances=usmDHKeyMIBCompliances, usmDHUserOwnAuthKeyChange=usmDHUserOwnAuthKeyChange, usmDHKeyMIBBasicGroup=usmDHKeyMIBBasicGroup, usmDHUserKeyEntry=usmDHUserKeyEntry, usmDHKeyKickstartGroup=usmDHKeyKickstartGroup, usmDHUserAuthKeyChange=usmDHUserAuthKeyChange, usmDHKickstartGroup=usmDHKickstartGroup, usmDHPublicObjects=usmDHPublicObjects, usmDHKeyConformance=usmDHKeyConformance, usmDHKickstartSecurityName=usmDHKickstartSecurityName, usmDHKeyMIBGroups=usmDHKeyMIBGroups, usmDHParameters=usmDHParameters, usmDHKeyParamGroup=usmDHKeyParamGroup)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_union, value_size_constraint, single_value_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (usm_user_entry,) = mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmUserEntry') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (bits, object_identity, counter64, mib_identifier, module_identity, gauge32, ip_address, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, unsigned32, experimental, notification_type, time_ticks, integer32, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'ObjectIdentity', 'Counter64', 'MibIdentifier', 'ModuleIdentity', 'Gauge32', 'IpAddress', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Unsigned32', 'experimental', 'NotificationType', 'TimeTicks', 'Integer32', 'Counter32') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') snmp_usm_dh_objects_mib = module_identity((1, 3, 6, 1, 3, 101)) snmpUsmDHObjectsMIB.setRevisions(('2000-03-06 00:00',)) if mibBuilder.loadTexts: snmpUsmDHObjectsMIB.setLastUpdated('200003060000Z') if mibBuilder.loadTexts: snmpUsmDHObjectsMIB.setOrganization('Excite@Home') usm_dh_key_objects = mib_identifier((1, 3, 6, 1, 3, 101, 1)) usm_dh_key_conformance = mib_identifier((1, 3, 6, 1, 3, 101, 2)) class Dhkeychange(TextualConvention, OctetString): reference = '-- Diffie-Hellman Key-Agreement Standard, PKCS #3; RSA Laboratories, November 1993' status = 'current' usm_dh_public_objects = mib_identifier((1, 3, 6, 1, 3, 101, 1, 1)) usm_dh_parameters = mib_scalar((1, 3, 6, 1, 3, 101, 1, 1, 1), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: usmDHParameters.setStatus('current') usm_dh_user_key_table = mib_table((1, 3, 6, 1, 3, 101, 1, 1, 2)) if mibBuilder.loadTexts: usmDHUserKeyTable.setStatus('current') usm_dh_user_key_entry = mib_table_row((1, 3, 6, 1, 3, 101, 1, 1, 2, 1)) usmUserEntry.registerAugmentions(('SNMP-USM-DH-OBJECTS-MIB', 'usmDHUserKeyEntry')) usmDHUserKeyEntry.setIndexNames(*usmUserEntry.getIndexNames()) if mibBuilder.loadTexts: usmDHUserKeyEntry.setStatus('current') usm_dh_user_auth_key_change = mib_table_column((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 1), dh_key_change()).setMaxAccess('readcreate') if mibBuilder.loadTexts: usmDHUserAuthKeyChange.setStatus('current') usm_dh_user_own_auth_key_change = mib_table_column((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 2), dh_key_change()).setMaxAccess('readcreate') if mibBuilder.loadTexts: usmDHUserOwnAuthKeyChange.setStatus('current') usm_dh_user_priv_key_change = mib_table_column((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 3), dh_key_change()).setMaxAccess('readcreate') if mibBuilder.loadTexts: usmDHUserPrivKeyChange.setStatus('current') usm_dh_user_own_priv_key_change = mib_table_column((1, 3, 6, 1, 3, 101, 1, 1, 2, 1, 4), dh_key_change()).setMaxAccess('readcreate') if mibBuilder.loadTexts: usmDHUserOwnPrivKeyChange.setStatus('current') usm_dh_kickstart_group = mib_identifier((1, 3, 6, 1, 3, 101, 1, 2)) usm_dh_kickstart_table = mib_table((1, 3, 6, 1, 3, 101, 1, 2, 1)) if mibBuilder.loadTexts: usmDHKickstartTable.setStatus('current') usm_dh_kickstart_entry = mib_table_row((1, 3, 6, 1, 3, 101, 1, 2, 1, 1)).setIndexNames((0, 'SNMP-USM-DH-OBJECTS-MIB', 'usmDHKickstartIndex')) if mibBuilder.loadTexts: usmDHKickstartEntry.setStatus('current') usm_dh_kickstart_index = mib_table_column((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))) if mibBuilder.loadTexts: usmDHKickstartIndex.setStatus('current') usm_dh_kickstart_my_public = mib_table_column((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 2), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: usmDHKickstartMyPublic.setStatus('current') usm_dh_kickstart_mgr_public = mib_table_column((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 3), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: usmDHKickstartMgrPublic.setStatus('current') usm_dh_kickstart_security_name = mib_table_column((1, 3, 6, 1, 3, 101, 1, 2, 1, 1, 4), snmp_admin_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: usmDHKickstartSecurityName.setStatus('current') usm_dh_key_mib_compliances = mib_identifier((1, 3, 6, 1, 3, 101, 2, 1)) usm_dh_key_mib_groups = mib_identifier((1, 3, 6, 1, 3, 101, 2, 2)) usm_dh_key_mib_compliance = module_compliance((1, 3, 6, 1, 3, 101, 2, 1, 1)).setObjects(('SNMP-USM-DH-OBJECTS-MIB', 'usmDHKeyMIBBasicGroup'), ('SNMP-USM-DH-OBJECTS-MIB', 'usmDHKeyParamGroup'), ('SNMP-USM-DH-OBJECTS-MIB', 'usmDHKeyKickstartGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usm_dh_key_mib_compliance = usmDHKeyMIBCompliance.setStatus('current') usm_dh_key_mib_basic_group = object_group((1, 3, 6, 1, 3, 101, 2, 2, 1)).setObjects(('SNMP-USM-DH-OBJECTS-MIB', 'usmDHUserAuthKeyChange'), ('SNMP-USM-DH-OBJECTS-MIB', 'usmDHUserOwnAuthKeyChange'), ('SNMP-USM-DH-OBJECTS-MIB', 'usmDHUserPrivKeyChange'), ('SNMP-USM-DH-OBJECTS-MIB', 'usmDHUserOwnPrivKeyChange')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usm_dh_key_mib_basic_group = usmDHKeyMIBBasicGroup.setStatus('current') usm_dh_key_param_group = object_group((1, 3, 6, 1, 3, 101, 2, 2, 2)).setObjects(('SNMP-USM-DH-OBJECTS-MIB', 'usmDHParameters')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usm_dh_key_param_group = usmDHKeyParamGroup.setStatus('current') usm_dh_key_kickstart_group = object_group((1, 3, 6, 1, 3, 101, 2, 2, 3)).setObjects(('SNMP-USM-DH-OBJECTS-MIB', 'usmDHKickstartMyPublic'), ('SNMP-USM-DH-OBJECTS-MIB', 'usmDHKickstartMgrPublic'), ('SNMP-USM-DH-OBJECTS-MIB', 'usmDHKickstartSecurityName')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usm_dh_key_kickstart_group = usmDHKeyKickstartGroup.setStatus('current') mibBuilder.exportSymbols('SNMP-USM-DH-OBJECTS-MIB', usmDHUserOwnPrivKeyChange=usmDHUserOwnPrivKeyChange, usmDHKeyMIBCompliance=usmDHKeyMIBCompliance, snmpUsmDHObjectsMIB=snmpUsmDHObjectsMIB, usmDHKickstartEntry=usmDHKickstartEntry, usmDHUserPrivKeyChange=usmDHUserPrivKeyChange, usmDHKeyObjects=usmDHKeyObjects, usmDHKickstartIndex=usmDHKickstartIndex, usmDHKickstartMgrPublic=usmDHKickstartMgrPublic, usmDHKickstartMyPublic=usmDHKickstartMyPublic, PYSNMP_MODULE_ID=snmpUsmDHObjectsMIB, usmDHKickstartTable=usmDHKickstartTable, DHKeyChange=DHKeyChange, usmDHUserKeyTable=usmDHUserKeyTable, usmDHKeyMIBCompliances=usmDHKeyMIBCompliances, usmDHUserOwnAuthKeyChange=usmDHUserOwnAuthKeyChange, usmDHKeyMIBBasicGroup=usmDHKeyMIBBasicGroup, usmDHUserKeyEntry=usmDHUserKeyEntry, usmDHKeyKickstartGroup=usmDHKeyKickstartGroup, usmDHUserAuthKeyChange=usmDHUserAuthKeyChange, usmDHKickstartGroup=usmDHKickstartGroup, usmDHPublicObjects=usmDHPublicObjects, usmDHKeyConformance=usmDHKeyConformance, usmDHKickstartSecurityName=usmDHKickstartSecurityName, usmDHKeyMIBGroups=usmDHKeyMIBGroups, usmDHParameters=usmDHParameters, usmDHKeyParamGroup=usmDHKeyParamGroup)
def get_message_native_type(type): dictionary = { 'uint8': 'uint8_t', 'uint16': 'uint16_t', 'uint32': 'uint32_t', 'uint64': 'uint64_t', 'int8': 'int8_t', 'int16': 'int16_t', 'int32': 'int32_t', 'int64': 'int64_t', 'buffer': 'iota::vector<uint8_t>', 'list': 'iota::vector<uint64_t>', 'string': 'iota::string' } return dictionary.get(type) def get_message_default_initializer(type): dictionary = { 'uint8': '{}', 'uint16': '{}', 'uint32': '{}', 'uint64': '{}', 'int8': '{}', 'int16': '{}', 'int32': '{}', 'int64': '{}', 'buffer': 'iota::create_vector<uint8_t>()', 'list': 'iota::create_vector<uint64_t>()', 'string': 'iota::create_string()' } return dictionary.get(type) def generate_builder(file, message): class_name = f"{message.name}_builder" file.write(f"\tclass {class_name} {{\n") file.write(f"\tpublic:\n") file.write(f"\t\t{class_name}(): buf{{}} {{}}\n") for field in message.items: name = field.name native_type = get_message_native_type(field.type) index = field.index file.write(f"\t\tvoid add_{name}({native_type} {name}) {{\n") file.write(f"\t\t\tbuf.add<{native_type}>({index}, {name});\n") file.write(f"\t\t}}\n") file.write(f"\t\tuint8_t* serialize() {{\n") file.write(f"\t\t\tbuf.serialize();\n") file.write(f"\t\t\treturn buf.data();\n") file.write(f"\t\t}}\n") file.write(f"\t\tsize_t length() {{\n") file.write(f"\t\t\treturn buf.length();\n") file.write(f"\t\t}}\n") file.write(f"\tprivate:\n") file.write(f"\t\tiota::buffer_generator buf;\n") file.write(f"\t}};\n\n") def generate_parser(file, message): class_name = f"{message.name}_parser" file.write(f"\tclass {class_name} {{\n") file.write(f"\tpublic:\n") file.write(f"\t\t{class_name}(uint8_t* buf, size_t size) {{\n") file.write(f"\t\t\tfor(size_t i = 0; i < size;){{\n") file.write(f"\t\t\t\tiota::index_type index = buf[i];\n") file.write(f"\t\t\t\ti++;\n") file.write(f"\t\t\t\tswitch(index){{\n") for field in message.items: file.write(f"\t\t\t\t// {field.type}\n") file.write(f"\t\t\t\tcase {field.index}: {{\n") file.write(f"\t\t\t\t\tthis->_p_{field.name} = true;\n") file.write(f"\t\t\t\t\ti += iota::parse_item<{get_message_native_type(field.type)}>(&buf[i], this->_m_{field.name});\n") file.write(f"\t\t\t\t\tbreak;\n") file.write(f"\t\t\t\t}}\n") file.write(f"\t\t\t\t}}\n") file.write(f"\t\t\t}}\n") file.write(f"\t\t}}\n") for field in message.items: name = field.name native_type = get_message_native_type(field.type) file.write(f"\t\t{native_type}& get_{name}() {{\n") file.write(f"\t\t\treturn this->_m_{field.name};\n") file.write(f"\t\t}}\n") file.write(f"\t\tbool has_{name}() {{\n") file.write(f"\t\t\treturn this->_p_{field.name};\n") file.write(f"\t\t}}\n") file.write(f"\tprivate:\n") for field in message.items: name = field.name native_type = get_message_native_type(field.type) file.write(f"\t\t{native_type} _m_{name} = {get_message_default_initializer(field.type)}; bool _p_{name} = false;\n") file.write(f"\t}};\n\n") def get_enum_native_type(type): dictionary = { 'uint8': 'uint8_t', 'uint16': 'uint16_t', 'uint32': 'uint32_t', 'uint64': 'uint64_t', 'int8': 'int8_t', 'int16': 'int16_t', 'int32': 'int32_t', 'int64': 'int64_t' } return dictionary.get(type) def generate_enum(file, enum): file.write(f"\tenum class {enum.name} : {get_enum_native_type(enum.item_type)} {{\n") for entry in enum.items: file.write(f"\t\t{entry.name} = {entry.value},\n") file.write(f"\t}};\n\n") def copy_file_contents(file1, file2): for line in file1: file2.write(line) file2.write("\n\n") def generate(subgenerator, output, items, module): file = open(output, 'w') file.write("#pragma once\n\n") file.write("#include <stdint.h>\n") file.write("#include <stddef.h>\n") if not subgenerator: subgenerator = 'std' # use std as default subgen if subgenerator == 'std': lib_file = open('lib/cpp/lib-std.hpp', 'r') copy_file_contents(lib_file, file) lib_file.close() elif subgenerator == 'frigg': lib_file = open('lib/cpp/lib-frigg.hpp', 'r') copy_file_contents(lib_file, file) lib_file.close() elif subgenerator == 'sigma-kernel': lib_file = open('lib/cpp/lib-sigma-kernel.hpp', 'r') copy_file_contents(lib_file, file) lib_file.close() else: print(f"cpp: Unknown subgenerator: {subgenerator}") exit() buffer_builder_file = open('lib/cpp/buffer_builder.hpp', 'r') copy_file_contents(buffer_builder_file, file) buffer_builder_file.close() buffer_parser_file = open('lib/cpp/buffer_parser.hpp', 'r') copy_file_contents(buffer_parser_file, file) buffer_parser_file.close() module_parts = module.split('.') for part in module_parts: file.write(f"namespace [[gnu::visibility(\"hidden\")]] {part} {{ ") file.write("\n") for item in items: if(item.type == 'message'): generate_builder(file, item) generate_parser(file, item) elif(item.type == 'enum'): generate_enum(file, item) else: print(f"cpp: Unknown item type: {item.type}") exit() for part in module_parts: file.write("} ") file.close() print("Generated C++ header")
def get_message_native_type(type): dictionary = {'uint8': 'uint8_t', 'uint16': 'uint16_t', 'uint32': 'uint32_t', 'uint64': 'uint64_t', 'int8': 'int8_t', 'int16': 'int16_t', 'int32': 'int32_t', 'int64': 'int64_t', 'buffer': 'iota::vector<uint8_t>', 'list': 'iota::vector<uint64_t>', 'string': 'iota::string'} return dictionary.get(type) def get_message_default_initializer(type): dictionary = {'uint8': '{}', 'uint16': '{}', 'uint32': '{}', 'uint64': '{}', 'int8': '{}', 'int16': '{}', 'int32': '{}', 'int64': '{}', 'buffer': 'iota::create_vector<uint8_t>()', 'list': 'iota::create_vector<uint64_t>()', 'string': 'iota::create_string()'} return dictionary.get(type) def generate_builder(file, message): class_name = f'{message.name}_builder' file.write(f'\tclass {class_name} {{\n') file.write(f'\tpublic:\n') file.write(f'\t\t{class_name}(): buf{{}} {{}}\n') for field in message.items: name = field.name native_type = get_message_native_type(field.type) index = field.index file.write(f'\t\tvoid add_{name}({native_type} {name}) {{\n') file.write(f'\t\t\tbuf.add<{native_type}>({index}, {name});\n') file.write(f'\t\t}}\n') file.write(f'\t\tuint8_t* serialize() {{\n') file.write(f'\t\t\tbuf.serialize();\n') file.write(f'\t\t\treturn buf.data();\n') file.write(f'\t\t}}\n') file.write(f'\t\tsize_t length() {{\n') file.write(f'\t\t\treturn buf.length();\n') file.write(f'\t\t}}\n') file.write(f'\tprivate:\n') file.write(f'\t\tiota::buffer_generator buf;\n') file.write(f'\t}};\n\n') def generate_parser(file, message): class_name = f'{message.name}_parser' file.write(f'\tclass {class_name} {{\n') file.write(f'\tpublic:\n') file.write(f'\t\t{class_name}(uint8_t* buf, size_t size) {{\n') file.write(f'\t\t\tfor(size_t i = 0; i < size;){{\n') file.write(f'\t\t\t\tiota::index_type index = buf[i];\n') file.write(f'\t\t\t\ti++;\n') file.write(f'\t\t\t\tswitch(index){{\n') for field in message.items: file.write(f'\t\t\t\t// {field.type}\n') file.write(f'\t\t\t\tcase {field.index}: {{\n') file.write(f'\t\t\t\t\tthis->_p_{field.name} = true;\n') file.write(f'\t\t\t\t\ti += iota::parse_item<{get_message_native_type(field.type)}>(&buf[i], this->_m_{field.name});\n') file.write(f'\t\t\t\t\tbreak;\n') file.write(f'\t\t\t\t}}\n') file.write(f'\t\t\t\t}}\n') file.write(f'\t\t\t}}\n') file.write(f'\t\t}}\n') for field in message.items: name = field.name native_type = get_message_native_type(field.type) file.write(f'\t\t{native_type}& get_{name}() {{\n') file.write(f'\t\t\treturn this->_m_{field.name};\n') file.write(f'\t\t}}\n') file.write(f'\t\tbool has_{name}() {{\n') file.write(f'\t\t\treturn this->_p_{field.name};\n') file.write(f'\t\t}}\n') file.write(f'\tprivate:\n') for field in message.items: name = field.name native_type = get_message_native_type(field.type) file.write(f'\t\t{native_type} _m_{name} = {get_message_default_initializer(field.type)}; bool _p_{name} = false;\n') file.write(f'\t}};\n\n') def get_enum_native_type(type): dictionary = {'uint8': 'uint8_t', 'uint16': 'uint16_t', 'uint32': 'uint32_t', 'uint64': 'uint64_t', 'int8': 'int8_t', 'int16': 'int16_t', 'int32': 'int32_t', 'int64': 'int64_t'} return dictionary.get(type) def generate_enum(file, enum): file.write(f'\tenum class {enum.name} : {get_enum_native_type(enum.item_type)} {{\n') for entry in enum.items: file.write(f'\t\t{entry.name} = {entry.value},\n') file.write(f'\t}};\n\n') def copy_file_contents(file1, file2): for line in file1: file2.write(line) file2.write('\n\n') def generate(subgenerator, output, items, module): file = open(output, 'w') file.write('#pragma once\n\n') file.write('#include <stdint.h>\n') file.write('#include <stddef.h>\n') if not subgenerator: subgenerator = 'std' if subgenerator == 'std': lib_file = open('lib/cpp/lib-std.hpp', 'r') copy_file_contents(lib_file, file) lib_file.close() elif subgenerator == 'frigg': lib_file = open('lib/cpp/lib-frigg.hpp', 'r') copy_file_contents(lib_file, file) lib_file.close() elif subgenerator == 'sigma-kernel': lib_file = open('lib/cpp/lib-sigma-kernel.hpp', 'r') copy_file_contents(lib_file, file) lib_file.close() else: print(f'cpp: Unknown subgenerator: {subgenerator}') exit() buffer_builder_file = open('lib/cpp/buffer_builder.hpp', 'r') copy_file_contents(buffer_builder_file, file) buffer_builder_file.close() buffer_parser_file = open('lib/cpp/buffer_parser.hpp', 'r') copy_file_contents(buffer_parser_file, file) buffer_parser_file.close() module_parts = module.split('.') for part in module_parts: file.write(f'namespace [[gnu::visibility("hidden")]] {part} {{ ') file.write('\n') for item in items: if item.type == 'message': generate_builder(file, item) generate_parser(file, item) elif item.type == 'enum': generate_enum(file, item) else: print(f'cpp: Unknown item type: {item.type}') exit() for part in module_parts: file.write('} ') file.close() print('Generated C++ header')
''' @author: l4zyc0d3r People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt ''' class Solution: def triangleNumber(self, N: List[int]) -> int: cou = 0 N.sort(reverse=True) for k, x in enumerate(N): j = k+1 i = len(N)-1 while j<i: if N[i]+N[j]<=N[k]: i-=1 else: cou+=i-j j+=1 return cou
""" @author: l4zyc0d3r People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt """ class Solution: def triangle_number(self, N: List[int]) -> int: cou = 0 N.sort(reverse=True) for (k, x) in enumerate(N): j = k + 1 i = len(N) - 1 while j < i: if N[i] + N[j] <= N[k]: i -= 1 else: cou += i - j j += 1 return cou
m = [("chethan", 20, 30), ("john", 40, 50)] print(m[1]) file = open("writingintocsvfile.csv", "w") file.write("Name, Age, Weight") for n in range(len(m)): file.write('\n') for k in range(len(m[1])): file.write(str(m[n][k])) file.write(',') file.close()
m = [('chethan', 20, 30), ('john', 40, 50)] print(m[1]) file = open('writingintocsvfile.csv', 'w') file.write('Name, Age, Weight') for n in range(len(m)): file.write('\n') for k in range(len(m[1])): file.write(str(m[n][k])) file.write(',') file.close()
def add_numbers(num1 , num2): return num1 + num2 def subtract_numbers(num1 , num2): return num1 - num2 def multiply_numbers(num1 , num2): return num1 * num2 def divide_numbers(num1 , num2): return num1 / num2
def add_numbers(num1, num2): return num1 + num2 def subtract_numbers(num1, num2): return num1 - num2 def multiply_numbers(num1, num2): return num1 * num2 def divide_numbers(num1, num2): return num1 / num2
def solution(): data = open(r'inputs\day11.in').readlines() print('Part 1 result: ' + str(part1(data))) print('Part 2 result: ' + str(part2(data))) def part1(data): # 2d array of ints that represents the octopus' current value octomap = [] for line in data: octomap.append([int(x) for x in line.strip()]) adj = { # up one row all 3 spots (-1, 1), (-1, 0), (-1, -1), # same row, left and right spots (0, -1), (0, 1), # down 1 row, all 3 spots (1, -1), (1, 0), (1, 1) } # track the number of flashes flash_count = 0 rows = len(octomap) cols = len(octomap[0]) # 100 steps for p1 for step in range(100): # get the new octomap by adding 1 to each value octomap = [[x + 1 for x in row] for row in octomap] # our stack is a list which consists of a tuple of the row and column of each value that is greater than 9, a.k.a the spots a flash should occur at stack = [(row, col) for row in range(rows) for col in range(cols) if octomap[row][col] > 9] # while we have stuff in the stack while stack: # pop off the top value into our row and column variables row, col = stack.pop() # increment our flash count flash_count += 1 # loop through the neighbors of the popped value for dx, dy in adj: if 0 <= row + dx < rows and 0 <= col + dy < cols: # if its a valid neighbor, add 1 to it, and if it is now a 10, add it to the stack octomap[row + dx][col + dy] += 1 if octomap[row + dx][col + dy] == 10: stack.append((row + dx, col + dy)) # at the end of each step, set all values greater than 9 to 0, because they flashed that step octomap = [[0 if x > 9 else x for x in row] for row in octomap] return flash_count def part2(data): # 2d array of ints of the octopus' current value octomap = [] for line in data: octomap.append([int(x) for x in line.strip()]) adj = { # up one row all 3 spots (-1, 1), (-1, 0), (-1, -1), # same row, left and right spots (0, -1), (0, 1), # down 1 row, all 3 spots (1, -1), (1, 0), (1, 1) } rows = len(octomap) cols = len(octomap[0]) # similar setup to part 1, but now we track the number of steps outside the loop and use an infinite while loop, since we don't know when the synchronized flash will occur step = 0 while True: step += 1 octomap = [[x + 1 for x in row] for row in octomap] stack = [(row, col) for row in range(rows) for col in range(cols) if octomap[row][col] > 9] # count the number of flashes in the current step step_flashes = 0 while stack: row, col = stack.pop() # each time we pop off the stack, we are doing a flash, so increment our flash count step_flashes += 1 for dx, dy in adj: if 0 <= row + dx < rows and 0 <= col + dy < cols: octomap[row + dx][col + dy] += 1 if octomap[row + dx][col + dy] == 10: stack.append((row + dx, col + dy)) octomap = [[0 if x > 9 else x for x in row] for row in octomap] # if we have 100 flashes this step, then all of the octopi have flashed, because there is a 10x10 grid of octopi, and each octopus flashes at most once per step if step_flashes == 100: # so return the step we are on as they are synchronized here return step solution()
def solution(): data = open('inputs\\day11.in').readlines() print('Part 1 result: ' + str(part1(data))) print('Part 2 result: ' + str(part2(data))) def part1(data): octomap = [] for line in data: octomap.append([int(x) for x in line.strip()]) adj = {(-1, 1), (-1, 0), (-1, -1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)} flash_count = 0 rows = len(octomap) cols = len(octomap[0]) for step in range(100): octomap = [[x + 1 for x in row] for row in octomap] stack = [(row, col) for row in range(rows) for col in range(cols) if octomap[row][col] > 9] while stack: (row, col) = stack.pop() flash_count += 1 for (dx, dy) in adj: if 0 <= row + dx < rows and 0 <= col + dy < cols: octomap[row + dx][col + dy] += 1 if octomap[row + dx][col + dy] == 10: stack.append((row + dx, col + dy)) octomap = [[0 if x > 9 else x for x in row] for row in octomap] return flash_count def part2(data): octomap = [] for line in data: octomap.append([int(x) for x in line.strip()]) adj = {(-1, 1), (-1, 0), (-1, -1), (0, -1), (0, 1), (1, -1), (1, 0), (1, 1)} rows = len(octomap) cols = len(octomap[0]) step = 0 while True: step += 1 octomap = [[x + 1 for x in row] for row in octomap] stack = [(row, col) for row in range(rows) for col in range(cols) if octomap[row][col] > 9] step_flashes = 0 while stack: (row, col) = stack.pop() step_flashes += 1 for (dx, dy) in adj: if 0 <= row + dx < rows and 0 <= col + dy < cols: octomap[row + dx][col + dy] += 1 if octomap[row + dx][col + dy] == 10: stack.append((row + dx, col + dy)) octomap = [[0 if x > 9 else x for x in row] for row in octomap] if step_flashes == 100: return step solution()
{ "variables": { "boost_lib": "<!(node -p \"process.env.BOOST_LIB || '../../deps/boost/stage/lib'\")", "boost_dir": "<!(node -p \"process.env.BOOST_DIR || 'boost'\")", "conditions": [ ["target_arch=='x64'", { "arch": "x64", }], ["target_arch=='ia32'", { "arch": "x32", }], ], }, "target_defaults": { "libraries": [ "Shlwapi.lib", "Version.lib", "<(boost_lib)/libboost_atomic-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_atomic-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_chrono-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_chrono-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_context-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_context-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_coroutine-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_coroutine-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_date_time-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_date_time-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_filesystem-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_filesystem-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_locale-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_locale-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_log-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_log-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_log_setup-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_log_setup-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_regex-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_regex-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_system-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_system-vc141-mt-sgd-<(arch)-1_67.lib", "<(boost_lib)/libboost_thread-vc141-mt-s-<(arch)-1_67.lib", "<(boost_lib)/libboost_thread-vc141-mt-sgd-<(arch)-1_67.lib" ], }, "targets": [ # build shared { "target_name": "shared", "type": "static_library", "dependencies": [ "./usvfs_deps.gyp:fmt", "./usvfs_deps.gyp:spdlog" ], "defines": [ "_WIN64", "SPDLOG_NO_NAME", "SPDLOG_NO_REGISTRY_MUTEX", "NOMINMAX", "_WINDOWS", "NDEBUG", "BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE" ], "include_dirs": [ "usvfs/src/shared", "usvfs/include", "<(boost_dir)", "usvfs/fmt", "usvfs/spdlog/include/spdlog" ], "sources": [ "usvfs/src/shared/addrtools.cpp", "usvfs/src/shared/debug_monitor.cpp", "usvfs/src/shared/directory_tree.cpp", "usvfs/src/shared/exceptionex.cpp", "usvfs/src/shared/loghelpers.cpp", "usvfs/src/shared/ntdll_declarations.cpp", "usvfs/src/shared/scopeguard.cpp", "usvfs/src/shared/shmlogger.cpp", "usvfs/src/shared/stringcast_win.cpp", "usvfs/src/shared/stringutils.cpp", "usvfs/src/shared/test_helpers.cpp", "usvfs/src/shared/unicodestring.cpp", "usvfs/src/shared/wildcard.cpp", "usvfs/src/shared/winapi.cpp", "usvfs/src/shared/windows_error.cpp" ], "configurations": { "Release": { "msvs_settings": { "VCCLCompilerTool": { "ExceptionHandling": 1, "RuntimeTypeInfo": "true" } }, "msvs_configuration_attributes": { "CharacterSet": 1 }, "msbuild_toolset": "v141", "msvs_windows_target_platform_version": "10.0.16299.0" } } }, # build thooklib { "target_name": "thooklib", "type": "static_library", "dependencies": [ "./usvfs_deps.gyp:asmjit", "shared", "./usvfs_deps.gyp:spdlog" ], "defines": [ "_WIN64", "ASMJIT_STATIC", "SPDLOG_NO_NAME", "SPDLOG_NO_REGISTRY_MUTEX", "NOMINMAX", "_WINDOWS", "NDEBUG", "BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE" ], "include_dirs": [ "usvfs/src/thooklib", "usvfs/src/shared", "usvfs/src/tinjectlib", "usvfs/src/usvfs_helper", "usvfs/asmjit/src/asmjit", "usvfs/udis86", "usvfs/include", "<(boost_dir)", "usvfs/fmt", "usvfs/spdlog/include/spdlog" ], "sources": [ "usvfs/src/thooklib/hooklib.cpp", "usvfs/src/thooklib/ttrampolinepool.cpp", "usvfs/src/thooklib/udis86wrapper.cpp", "usvfs/src/thooklib/utility.cpp" ], "configurations": { "Release": { "msvs_settings": { "VCCLCompilerTool": { "ExceptionHandling": 1, "RuntimeTypeInfo": "true" } }, "msvs_configuration_attributes": { "CharacterSet": 1 }, "msbuild_toolset": "v141", "msvs_windows_target_platform_version": "10.0.16299.0" } } }, # build tinjectlib { "target_name": "tinjectlib", "type": "static_library", "dependencies": [ "./usvfs_deps.gyp:asmjit", "shared" ], "defines": [ "_WIN64", "ASMJIT_STATIC", "SPDLOG_NO_NAME", "SPDLOG_NO_REGISTRY_MUTEX", "NOMINMAX", "_WINDOWS", "NDEBUG", "BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE" ], "include_dirs": [ "usvfs/src/tinjectlib", "usvfs/src/shared", "usvfs/src/thooklib", "usvfs/src/usvfs_helper", "usvfs/asmjit/src/asmjit", "usvfs/udis86", "usvfs/include", "<(boost_dir)", "usvfs/fmt", "usvfs/spdlog/include/spdlog" ], "sources": [ "usvfs/src/tinjectlib/injectlib.cpp" ], "configurations": { "Release": { "msvs_settings": { "VCCLCompilerTool": { "ExceptionHandling": 1, "RuntimeTypeInfo": "true" } }, "msvs_configuration_attributes": { "CharacterSet": 1 }, "msbuild_toolset": "v141", "msvs_windows_target_platform_version": "10.0.16299.0" } } }, # usvfs_helper { "target_name": "usvfs_helper", "type": "static_library", "dependencies": [ "shared", "tinjectlib" ], "defines": [ "BUILDING_USVFS_DLL", "_WIN64", "ASMJIT_STATIC", "SPDLOG_NO_NAME", "SPDLOG_NO_REGISTRY_MUTEX", "NOMINMAX", "_WINDOWS", "NDEBUG", "BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE" ], "include_dirs": [ "usvfs/src/usvfs_helper", "usvfs/src/shared", "usvfs/src/thooklib", "usvfs/src/tinjectlib", "usvfs/asmjit/src/asmjit", "usvfs/udis86", "usvfs/include", "<(boost_dir)", "usvfs/fmt", "usvfs/spdlog/include/spdlog" ], "sources": [ "usvfs/src/usvfs_helper/inject.cpp" ], "configurations": { "Release": { "msvs_settings": { "VCCLCompilerTool": { "ExceptionHandling": 1, "RuntimeTypeInfo": "true" } }, "msvs_configuration_attributes": { "CharacterSet": 1 }, "msbuild_toolset": "v141", "msvs_windows_target_platform_version": "10.0.16299.0" } } }, # usvfs { "target_name": "usvfs", "type": "shared_library", "dependencies": [ "./usvfs_deps.gyp:asmjit", "./usvfs_deps.gyp:fmt", "shared", "./usvfs_deps.gyp:spdlog", "thooklib", "tinjectlib", "./usvfs_deps.gyp:udis86", "usvfs_helper" ], "defines": [ "BUILDING_USVFS_DLL", "ASMJIT_STATIC", "SPDLOG_NO_NAME", "SPDLOG_NO_REGISTRY_MUTEX", "NOMINMAX", "_WINDOWS", "NDEBUG", "BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE" ], "include_dirs": [ "usvfs/include", "usvfs/src/usvfs_dll", "usvfs/src/shared", "usvfs/src/thooklib", "usvfs/src/tinjectlib", "usvfs/src/usvfs_helper", "usvfs/asmjit/src/asmjit", "usvfs/udis86", "<(boost_dir)", "usvfs/fmt", "usvfs/spdlog/include/spdlog" ], "sources": [ "usvfs/src/usvfs_dll/hookcallcontext.cpp", "usvfs/src/usvfs_dll/hookcontext.cpp", "usvfs/src/usvfs_dll/hookmanager.cpp", "usvfs/src/usvfs_dll/hooks/kernel32.cpp", "usvfs/src/usvfs_dll/hooks/ntdll.cpp", "usvfs/src/usvfs_dll/redirectiontree.cpp", "usvfs/src/usvfs_dll/semaphore.cpp", "usvfs/src/usvfs_dll/stringcast_boost.cpp", "usvfs/src/usvfs_dll/usvfs.cpp" ], "configurations": { "Release": { "msvs_settings": { "VCCLCompilerTool": { "ExceptionHandling": 1, "RuntimeTypeInfo": "true" } }, "msvs_configuration_attributes": { "CharacterSet": 1 }, "msbuild_toolset": "v141", "msvs_windows_target_platform_version": "10.0.16299.0" } } }, # usvfs_proxy { "target_name": "usvfs_proxy", "type": "executable", "dependencies": [ "./usvfs_deps.gyp:asmjit", "shared", "tinjectlib", "usvfs", "usvfs_helper" ], "defines": [ "_WIN64", "ASMJIT_STATIC", "SPDLOG_NO_NAME", "SPDLOG_NO_REGISTRY_MUTEX", "NOMINMAX", "_WINDOWS", "NDEBUG", "BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE" ], "include_dirs": [ "usvfs/src/shared", "usvfs/src/thooklib", "usvfs/src/tinjectlib", "usvfs/src/usvfs_helper", "usvfs/asmjit/src/asmjit", "usvfs/udis86", "usvfs/include", "<(boost_dir)", "usvfs/fmt", "usvfs/spdlog/include/spdlog" ], "sources": [ "usvfs/src/usvfs_proxy/main.cpp" ], "configurations": { "Release": { "msvs_settings": { "VCCLCompilerTool": { "ExceptionHandling": 1, "RuntimeTypeInfo": "true" } }, "msvs_configuration_attributes": { "CharacterSet": 1 }, "msbuild_toolset": "v141", "msvs_windows_target_platform_version": "10.0.16299.0" } } }, ] }
{'variables': {'boost_lib': '<!(node -p "process.env.BOOST_LIB || \'../../deps/boost/stage/lib\'")', 'boost_dir': '<!(node -p "process.env.BOOST_DIR || \'boost\'")', 'conditions': [["target_arch=='x64'", {'arch': 'x64'}], ["target_arch=='ia32'", {'arch': 'x32'}]]}, 'target_defaults': {'libraries': ['Shlwapi.lib', 'Version.lib', '<(boost_lib)/libboost_atomic-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_atomic-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_chrono-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_chrono-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_context-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_context-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_coroutine-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_coroutine-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_date_time-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_date_time-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_filesystem-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_filesystem-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_locale-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_locale-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_log-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_log-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_log_setup-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_log_setup-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_regex-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_regex-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_system-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_system-vc141-mt-sgd-<(arch)-1_67.lib', '<(boost_lib)/libboost_thread-vc141-mt-s-<(arch)-1_67.lib', '<(boost_lib)/libboost_thread-vc141-mt-sgd-<(arch)-1_67.lib']}, 'targets': [{'target_name': 'shared', 'type': 'static_library', 'dependencies': ['./usvfs_deps.gyp:fmt', './usvfs_deps.gyp:spdlog'], 'defines': ['_WIN64', 'SPDLOG_NO_NAME', 'SPDLOG_NO_REGISTRY_MUTEX', 'NOMINMAX', '_WINDOWS', 'NDEBUG', 'BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE'], 'include_dirs': ['usvfs/src/shared', 'usvfs/include', '<(boost_dir)', 'usvfs/fmt', 'usvfs/spdlog/include/spdlog'], 'sources': ['usvfs/src/shared/addrtools.cpp', 'usvfs/src/shared/debug_monitor.cpp', 'usvfs/src/shared/directory_tree.cpp', 'usvfs/src/shared/exceptionex.cpp', 'usvfs/src/shared/loghelpers.cpp', 'usvfs/src/shared/ntdll_declarations.cpp', 'usvfs/src/shared/scopeguard.cpp', 'usvfs/src/shared/shmlogger.cpp', 'usvfs/src/shared/stringcast_win.cpp', 'usvfs/src/shared/stringutils.cpp', 'usvfs/src/shared/test_helpers.cpp', 'usvfs/src/shared/unicodestring.cpp', 'usvfs/src/shared/wildcard.cpp', 'usvfs/src/shared/winapi.cpp', 'usvfs/src/shared/windows_error.cpp'], 'configurations': {'Release': {'msvs_settings': {'VCCLCompilerTool': {'ExceptionHandling': 1, 'RuntimeTypeInfo': 'true'}}, 'msvs_configuration_attributes': {'CharacterSet': 1}, 'msbuild_toolset': 'v141', 'msvs_windows_target_platform_version': '10.0.16299.0'}}}, {'target_name': 'thooklib', 'type': 'static_library', 'dependencies': ['./usvfs_deps.gyp:asmjit', 'shared', './usvfs_deps.gyp:spdlog'], 'defines': ['_WIN64', 'ASMJIT_STATIC', 'SPDLOG_NO_NAME', 'SPDLOG_NO_REGISTRY_MUTEX', 'NOMINMAX', '_WINDOWS', 'NDEBUG', 'BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE'], 'include_dirs': ['usvfs/src/thooklib', 'usvfs/src/shared', 'usvfs/src/tinjectlib', 'usvfs/src/usvfs_helper', 'usvfs/asmjit/src/asmjit', 'usvfs/udis86', 'usvfs/include', '<(boost_dir)', 'usvfs/fmt', 'usvfs/spdlog/include/spdlog'], 'sources': ['usvfs/src/thooklib/hooklib.cpp', 'usvfs/src/thooklib/ttrampolinepool.cpp', 'usvfs/src/thooklib/udis86wrapper.cpp', 'usvfs/src/thooklib/utility.cpp'], 'configurations': {'Release': {'msvs_settings': {'VCCLCompilerTool': {'ExceptionHandling': 1, 'RuntimeTypeInfo': 'true'}}, 'msvs_configuration_attributes': {'CharacterSet': 1}, 'msbuild_toolset': 'v141', 'msvs_windows_target_platform_version': '10.0.16299.0'}}}, {'target_name': 'tinjectlib', 'type': 'static_library', 'dependencies': ['./usvfs_deps.gyp:asmjit', 'shared'], 'defines': ['_WIN64', 'ASMJIT_STATIC', 'SPDLOG_NO_NAME', 'SPDLOG_NO_REGISTRY_MUTEX', 'NOMINMAX', '_WINDOWS', 'NDEBUG', 'BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE'], 'include_dirs': ['usvfs/src/tinjectlib', 'usvfs/src/shared', 'usvfs/src/thooklib', 'usvfs/src/usvfs_helper', 'usvfs/asmjit/src/asmjit', 'usvfs/udis86', 'usvfs/include', '<(boost_dir)', 'usvfs/fmt', 'usvfs/spdlog/include/spdlog'], 'sources': ['usvfs/src/tinjectlib/injectlib.cpp'], 'configurations': {'Release': {'msvs_settings': {'VCCLCompilerTool': {'ExceptionHandling': 1, 'RuntimeTypeInfo': 'true'}}, 'msvs_configuration_attributes': {'CharacterSet': 1}, 'msbuild_toolset': 'v141', 'msvs_windows_target_platform_version': '10.0.16299.0'}}}, {'target_name': 'usvfs_helper', 'type': 'static_library', 'dependencies': ['shared', 'tinjectlib'], 'defines': ['BUILDING_USVFS_DLL', '_WIN64', 'ASMJIT_STATIC', 'SPDLOG_NO_NAME', 'SPDLOG_NO_REGISTRY_MUTEX', 'NOMINMAX', '_WINDOWS', 'NDEBUG', 'BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE'], 'include_dirs': ['usvfs/src/usvfs_helper', 'usvfs/src/shared', 'usvfs/src/thooklib', 'usvfs/src/tinjectlib', 'usvfs/asmjit/src/asmjit', 'usvfs/udis86', 'usvfs/include', '<(boost_dir)', 'usvfs/fmt', 'usvfs/spdlog/include/spdlog'], 'sources': ['usvfs/src/usvfs_helper/inject.cpp'], 'configurations': {'Release': {'msvs_settings': {'VCCLCompilerTool': {'ExceptionHandling': 1, 'RuntimeTypeInfo': 'true'}}, 'msvs_configuration_attributes': {'CharacterSet': 1}, 'msbuild_toolset': 'v141', 'msvs_windows_target_platform_version': '10.0.16299.0'}}}, {'target_name': 'usvfs', 'type': 'shared_library', 'dependencies': ['./usvfs_deps.gyp:asmjit', './usvfs_deps.gyp:fmt', 'shared', './usvfs_deps.gyp:spdlog', 'thooklib', 'tinjectlib', './usvfs_deps.gyp:udis86', 'usvfs_helper'], 'defines': ['BUILDING_USVFS_DLL', 'ASMJIT_STATIC', 'SPDLOG_NO_NAME', 'SPDLOG_NO_REGISTRY_MUTEX', 'NOMINMAX', '_WINDOWS', 'NDEBUG', 'BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE'], 'include_dirs': ['usvfs/include', 'usvfs/src/usvfs_dll', 'usvfs/src/shared', 'usvfs/src/thooklib', 'usvfs/src/tinjectlib', 'usvfs/src/usvfs_helper', 'usvfs/asmjit/src/asmjit', 'usvfs/udis86', '<(boost_dir)', 'usvfs/fmt', 'usvfs/spdlog/include/spdlog'], 'sources': ['usvfs/src/usvfs_dll/hookcallcontext.cpp', 'usvfs/src/usvfs_dll/hookcontext.cpp', 'usvfs/src/usvfs_dll/hookmanager.cpp', 'usvfs/src/usvfs_dll/hooks/kernel32.cpp', 'usvfs/src/usvfs_dll/hooks/ntdll.cpp', 'usvfs/src/usvfs_dll/redirectiontree.cpp', 'usvfs/src/usvfs_dll/semaphore.cpp', 'usvfs/src/usvfs_dll/stringcast_boost.cpp', 'usvfs/src/usvfs_dll/usvfs.cpp'], 'configurations': {'Release': {'msvs_settings': {'VCCLCompilerTool': {'ExceptionHandling': 1, 'RuntimeTypeInfo': 'true'}}, 'msvs_configuration_attributes': {'CharacterSet': 1}, 'msbuild_toolset': 'v141', 'msvs_windows_target_platform_version': '10.0.16299.0'}}}, {'target_name': 'usvfs_proxy', 'type': 'executable', 'dependencies': ['./usvfs_deps.gyp:asmjit', 'shared', 'tinjectlib', 'usvfs', 'usvfs_helper'], 'defines': ['_WIN64', 'ASMJIT_STATIC', 'SPDLOG_NO_NAME', 'SPDLOG_NO_REGISTRY_MUTEX', 'NOMINMAX', '_WINDOWS', 'NDEBUG', 'BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE'], 'include_dirs': ['usvfs/src/shared', 'usvfs/src/thooklib', 'usvfs/src/tinjectlib', 'usvfs/src/usvfs_helper', 'usvfs/asmjit/src/asmjit', 'usvfs/udis86', 'usvfs/include', '<(boost_dir)', 'usvfs/fmt', 'usvfs/spdlog/include/spdlog'], 'sources': ['usvfs/src/usvfs_proxy/main.cpp'], 'configurations': {'Release': {'msvs_settings': {'VCCLCompilerTool': {'ExceptionHandling': 1, 'RuntimeTypeInfo': 'true'}}, 'msvs_configuration_attributes': {'CharacterSet': 1}, 'msbuild_toolset': 'v141', 'msvs_windows_target_platform_version': '10.0.16299.0'}}}]}
class Solution: def solve(self, nums): setNums = set(nums) count = 0 for i in setNums: if i + 1 in setNums: count += nums.count(i) return count
class Solution: def solve(self, nums): set_nums = set(nums) count = 0 for i in setNums: if i + 1 in setNums: count += nums.count(i) return count
class Movie: def __init__(self, name): self.__name = name @property def name(self): return self.__name def __str__(self) -> str: return self.__name class Ticket: def __init__(self, movie=None, location=None): if movie is None: movie = Movie('Avengers') if location == None: location = 'PVR Cinemas' self.__movie = movie self.__location = location def __str__(self) -> str: return f"movie = {self.__movie}, location = {self.__location}" @property def movie(self): return self.__movie @property def location(self): return self.__location t1 = Ticket() print(t1) m1 = Movie('Justice League') t2 = Ticket(movie=m1) print(t2)
class Movie: def __init__(self, name): self.__name = name @property def name(self): return self.__name def __str__(self) -> str: return self.__name class Ticket: def __init__(self, movie=None, location=None): if movie is None: movie = movie('Avengers') if location == None: location = 'PVR Cinemas' self.__movie = movie self.__location = location def __str__(self) -> str: return f'movie = {self.__movie}, location = {self.__location}' @property def movie(self): return self.__movie @property def location(self): return self.__location t1 = ticket() print(t1) m1 = movie('Justice League') t2 = ticket(movie=m1) print(t2)
channel = "test-channel" feedtitle = "Discord Channel RSS" feedlink = "github.com/gmemstr/webbot" feeddescription = "Discord Channel RSS" flaskdebug = True flaskport = 5000
channel = 'test-channel' feedtitle = 'Discord Channel RSS' feedlink = 'github.com/gmemstr/webbot' feeddescription = 'Discord Channel RSS' flaskdebug = True flaskport = 5000
#: A dict contains permission's number as string and its corresponding meanings. PERM_MAP = { "1": "download and preview", "2": "upload", "3": "upload, download, preview, remove and move", "4": "upload, download, preview, remove, move and change acls of others", "5": "preview" } #: A set contains all available operation types. OPERATION_TYPE = { "SESSION_START", "DOWNLOAD", "UPLOAD", "SHARE", "MOVE", "DELETE", "RESTORE", "PREVIEW", "PURGE", "PWD_ATTACK", "VIRUS_INFECTED" }
perm_map = {'1': 'download and preview', '2': 'upload', '3': 'upload, download, preview, remove and move', '4': 'upload, download, preview, remove, move and change acls of others', '5': 'preview'} operation_type = {'SESSION_START', 'DOWNLOAD', 'UPLOAD', 'SHARE', 'MOVE', 'DELETE', 'RESTORE', 'PREVIEW', 'PURGE', 'PWD_ATTACK', 'VIRUS_INFECTED'}
def _reduced_string(s): if not s: return "Empty String" letters = list() counts = list() last = "" counts_index = -1 for ch in s: if last != ch: letters.append(ch) counts.append(1) counts_index += 1 last = ch else: counts[counts_index] += 1 ans = list() for i, val in enumerate(counts): ans.append(val % 2 * letters[i]) ans = "".join(ans) if not ans: ans = "Empty String" changed = s != ans return ans, changed def reduced_string(s): ans, changed = _reduced_string(s) while changed: ans, changed = _reduced_string(ans) return ans def test_solution1(): s = "aaabccddd" ans = "abd" assert ans == reduced_string(s) def test_solution2(): s = "baab" ans = "Empty String" assert ans == reduced_string(s) def test_solution3(): s = "aabbccdd" ans = "Empty String" assert ans == reduced_string(s)
def _reduced_string(s): if not s: return 'Empty String' letters = list() counts = list() last = '' counts_index = -1 for ch in s: if last != ch: letters.append(ch) counts.append(1) counts_index += 1 last = ch else: counts[counts_index] += 1 ans = list() for (i, val) in enumerate(counts): ans.append(val % 2 * letters[i]) ans = ''.join(ans) if not ans: ans = 'Empty String' changed = s != ans return (ans, changed) def reduced_string(s): (ans, changed) = _reduced_string(s) while changed: (ans, changed) = _reduced_string(ans) return ans def test_solution1(): s = 'aaabccddd' ans = 'abd' assert ans == reduced_string(s) def test_solution2(): s = 'baab' ans = 'Empty String' assert ans == reduced_string(s) def test_solution3(): s = 'aabbccdd' ans = 'Empty String' assert ans == reduced_string(s)
# Config file for user settings # Change anything as desired ''' Navigation Settings ''' PAN_DIST = 15 PAN_DIST_LARGE = 60 ZOOM_FACTOR = 1.35 '''Canvas Settings''' SUB_COLOR = (1, 0, 0, 1) PATH_COLOR = (0, 0, 0, 0.7) GRID_COLOR = (0.4, 0, 0, 0.3) TAG_COLOR = (0, 0, 1, 0.8) ELEMENT_COLOR = (0, .5, 0, 1.0) MAGNIFY = 40 #How many pixels correspond to 1 unit in shm PATH_RES = 0.15 #Path resolution SUB_SIZE = 8 TAG_SIZE = 5 PATH_LEN = -1 #neg. number indicates unbounded GRID_LINES = 50 GRID_SPACE = 1. #in meters SMOOTHING = True PERIOD = .01 # Period of smooth updates, smaller <=> faster smoothing ''' Key bindings ''' # You can bind the control key with the format 'ctrl [key]' # The same applies to the shift key: 'shift [key]' # NOTE: Do not use uppercase letters, use shift + letter # To include both control and shift, ctrl comes first: 'ctrl shift [key]' bindings_on = True key_binds = {} key_binds["quit"] = "shift q" key_binds["bindings toggle"] = "shift b" key_binds["help"] = "h" key_binds["follow sub"] = "shift f" key_binds["follow position only"] = "f" key_binds["reset path"] = "r" key_binds["zoom in"] = "i" key_binds["zoom out"] = "o" key_binds["pan left"] = "left" key_binds["pan left large"] = "shift left" key_binds["pan right"] = "right" key_binds["pan right large"] = "shift right" key_binds["pan up"] = "up" key_binds["pan up large"] = "shift up" key_binds["pan down"] = "down" key_binds["pan down large"] = "shift down" key_binds["center view"] = "c" key_binds["rotate cw"] = "ctrl left" key_binds["rotate ccw"] = "ctrl right"
""" Navigation Settings """ pan_dist = 15 pan_dist_large = 60 zoom_factor = 1.35 'Canvas Settings' sub_color = (1, 0, 0, 1) path_color = (0, 0, 0, 0.7) grid_color = (0.4, 0, 0, 0.3) tag_color = (0, 0, 1, 0.8) element_color = (0, 0.5, 0, 1.0) magnify = 40 path_res = 0.15 sub_size = 8 tag_size = 5 path_len = -1 grid_lines = 50 grid_space = 1.0 smoothing = True period = 0.01 ' Key bindings ' bindings_on = True key_binds = {} key_binds['quit'] = 'shift q' key_binds['bindings toggle'] = 'shift b' key_binds['help'] = 'h' key_binds['follow sub'] = 'shift f' key_binds['follow position only'] = 'f' key_binds['reset path'] = 'r' key_binds['zoom in'] = 'i' key_binds['zoom out'] = 'o' key_binds['pan left'] = 'left' key_binds['pan left large'] = 'shift left' key_binds['pan right'] = 'right' key_binds['pan right large'] = 'shift right' key_binds['pan up'] = 'up' key_binds['pan up large'] = 'shift up' key_binds['pan down'] = 'down' key_binds['pan down large'] = 'shift down' key_binds['center view'] = 'c' key_binds['rotate cw'] = 'ctrl left' key_binds['rotate ccw'] = 'ctrl right'
def find_peak(arr, begin=0, end=None, l=None): '''find_peak is a recursive function that uses divide and conquer methodolology (similar to binary search) to find the index of a peak element in O(log n) time complexity''' # initialize values on first iteration if end is None or l is None: l = len(arr) end = l-1 # find index of middle element mid = int(begin + (end - begin) / 2) # truncate result to an int try: # base case: first check if middle is a peak element # if it is, return it if arr[mid] > arr[mid+1] and arr[mid] > arr[mid-1]: return mid # if left element is greater than mid, left half must contain a peak; # run function again on left half of arr if arr[mid-1] > arr[mid]: return find_peak(arr, begin, mid-1, l) # if right element is greater than mid, right half must contain a peak; # run function again on right half of arr if arr[mid+1] > arr[mid]: return find_peak(arr, mid+1, end, l) except IndexError: # couldn't find a peak # return either 1st or last element index depending on which is bigger # peak will be equal to the corner case of begin or end if arr[0] > arr[l-1]: return 0 return l-1 ## TEST ## arr = [8, 9, 10, 11, 11, 12, 13, 14, 15, 18] print(arr) result = find_peak(arr) print("Peak Index:", result) print("Peak:", arr[result])
def find_peak(arr, begin=0, end=None, l=None): """find_peak is a recursive function that uses divide and conquer methodolology (similar to binary search) to find the index of a peak element in O(log n) time complexity""" if end is None or l is None: l = len(arr) end = l - 1 mid = int(begin + (end - begin) / 2) try: if arr[mid] > arr[mid + 1] and arr[mid] > arr[mid - 1]: return mid if arr[mid - 1] > arr[mid]: return find_peak(arr, begin, mid - 1, l) if arr[mid + 1] > arr[mid]: return find_peak(arr, mid + 1, end, l) except IndexError: if arr[0] > arr[l - 1]: return 0 return l - 1 arr = [8, 9, 10, 11, 11, 12, 13, 14, 15, 18] print(arr) result = find_peak(arr) print('Peak Index:', result) print('Peak:', arr[result])
ECG_CHAN_1 = 0 ECG_CHAN_2 = 1 ECG_CHAN_3 = 2 LEAD_05_CHAN_1_DATA_SIZE = 9 LEAD_12_CHAN_1_DATA_SIZE = 6 LEAD_12_CHAN_2_DATA_SIZE = 9 LEAD_12_CHAN_3_DATA_SIZE = 9 TI_ADS1293_CONFIG_REG = 0x00 #/* Main Configuration */ TI_ADS1293_FLEX_CH1_CN_REG = 0x01 #/* Flex Routing Swich Control for Channel 1 */ TI_ADS1293_FLEX_CH2_CN_REG = 0x02 #/* Flex Routing Swich Control for Channel 2 */ TI_ADS1293_FLEX_CH3_CN_REG = 0x03 #/* Flex Routing Swich Control for Channel 3 */ TI_ADS1293_FLEX_PACE_CN_REG = 0x04 #/* Flex Routing Swich Control for Pace Channel */ TI_ADS1293_FLEX_VBAT_CN_REG = 0x05 #/* Flex Routing Swich Control for Battery Monitoriing */ TI_ADS1293_LOD_CN_REG = 0x06 #/* Lead Off Detect Control */ TI_ADS1293_LOD_EN_REG = 0x07 #/* Lead Off Detect Enable */ TI_ADS1293_LOD_CURRENT_REG = 0x08 #/* Lead Off Detect Current */ TI_ADS1293_LOD_AC_CN_REG = 0x09 #/* AC Lead Off Detect Current */ TI_ADS1293_CMDET_EN_REG = 0x0A #/* Common Mode Detect Enable */ TI_ADS1293_CMDET_CN_REG = 0x0B #/* Commond Mode Detect Control */ TI_ADS1293_RLD_CN_REG = 0x0C #/* Right Leg Drive Control */ TI_ADS1293_WILSON_EN1_REG = 0x0D #/* Wilson Reference Input one Selection */ TI_ADS1293_WILSON_EN2_REG = 0x0E #/* Wilson Reference Input two Selection */ TI_ADS1293_WILSON_EN3_REG = 0x0F #/* Wilson Reference Input three Selection */ TI_ADS1293_WILSON_CN_REG = 0x10 #/* Wilson Reference Input Control */ TI_ADS1293_REF_CN_REG = 0x11 #/* Internal Reference Voltage Control */ TI_ADS1293_OSC_CN_REG = 0x12 #/* Clock Source and Output Clock Control */ TI_ADS1293_AFE_RES_REG = 0x13 #/* Analog Front-End Frequency and Resolution */ TI_ADS1293_AFE_SHDN_CN_REG = 0x14 #/* Analog Front-End Shutdown Control */ TI_ADS1293_AFE_FAULT_CN_REG = 0x15 #/* Analog Front-End Fault Detection Control */ TI_ADS1293_AFE_DITHER_EN_REG = 0x16 #/* Enable Dithering in Signma-Delta */ TI_ADS1293_AFE_PACE_CN_REG = 0x17 #/* Analog Pace Channel Output Routing Control */ TI_ADS1293_ERROR_LOD_REG = 0x18 #/* Lead Off Detect Error Status */ TI_ADS1293_ERROR_STATUS_REG = 0x19 #/* Other Error Status */ TI_ADS1293_ERROR_RANGE1_REG = 0x1A #/* Channel 1 Amplifier Out of Range Status */ TI_ADS1293_ERROR_RANGE2_REG = 0x1B #/* Channel 1 Amplifier Out of Range Status */ TI_ADS1293_ERROR_RANGE3_REG = 0x1C #/* Channel 1 Amplifier Out of Range Status */ TI_ADS1293_ERROR_SYNC_REG = 0x1D #/* Synchronization Error */ TI_ADS1293_R2_RATE_REG = 0x21 #/* R2 Decimation Rate */ TI_ADS1293_R3_RATE1_REG = 0x22 #/* R3 Decimation Rate for Channel 1 */ TI_ADS1293_R3_RATE2_REG = 0x23 #/* R3 Decimation Rate for Channel 2 */ TI_ADS1293_R3_RATE3_REG = 0x24 #/* R3 Decimation Rate for Channel 3 */ TI_ADS1293_P_DRATE_REG = 0x25 #/* 2x Pace Data Rate */ TI_ADS1293_DIS_EFILTER_REG = 0x26 #/* ECG Filter Disable */ TI_ADS1293_DRDYB_SRC_REG = 0x27 #/* Data Ready Pin Source */ TI_ADS1293_SYNCOUTB_SRC_REG = 0x28 #/* Sync Out Pin Source */ TI_ADS1293_MASK_DRDYB_REG = 0x29 #/* Optional Mask Control for DRDYB Output */ TI_ADS1293_MASK_ERR_REG = 0x2A #/* Mask Error on ALARMB Pin */ TI_ADS1293_ALARM_FILTER_REG = 0x2E #/* Digital Filter for Analog Alarm Signals */ TI_ADS1293_CH_CNFG_REG = 0x2F #/* Configure Channel for Loop Read Back Mode */ TI_ADS1293_DATA_STATUS_REG = 0x30 #/* ECG and Pace Data Ready Status */ TI_ADS1293_DATA_CH1_PACE_H_REG = 0x31 #/* Channel1 Pace Data High [15:8] */ TI_ADS1293_DATA_CH1_PACE_L_REG = 0x32 #/* Channel1 Pace Data Low [7:0] */ TI_ADS1293_DATA_CH2_PACE_H_REG = 0x33 #/* Channel2 Pace Data High [15:8] */ TI_ADS1293_DATA_CH2_PACE_L_REG = 0x34 #/* Channel2 Pace Data Low [7:0] */ TI_ADS1293_DATA_CH3_PACE_H_REG = 0x35 #/* Channel3 Pace Data High [15:8] */ TI_ADS1293_DATA_CH3_PACE_L_REG = 0x36 #/* Channel3 Pace Data Low [7:0] */ TI_ADS1293_DATA_CH1_ECG_H_REG = 0x37 #/* Channel1 ECG Data High [23:16] */ TI_ADS1293_DATA_CH1_ECG_M_REG = 0x38 #/* Channel1 ECG Data Medium [15:8] */ TI_ADS1293_DATA_CH1_ECG_L_REG = 0x39 #/* Channel1 ECG Data Low [7:0] */ TI_ADS1293_DATA_CH2_ECG_H_REG = 0x3A #/* Channel2 ECG Data High [23:16] */ TI_ADS1293_DATA_CH2_ECG_M_REG = 0x3B #/* Channel2 ECG Data Medium [15:8] */ TI_ADS1293_DATA_CH2_ECG_L_REG = 0x3C #/* Channel2 ECG Data Low [7:0] */ TI_ADS1293_DATA_CH3_ECG_H_REG = 0x3D #/* Channel3 ECG Data High [23:16] */ TI_ADS1293_DATA_CH3_ECG_M_REG = 0x3E #/* Channel3 ECG Data Medium [15:8] */ TI_ADS1293_DATA_CH3_ECG_L_REG = 0x3F #/* Channel3 ECG Data Low [7:0] */ TI_ADS1293_REVID_REG = 0x40 #/* Revision ID */ TI_ADS1293_DATA_LOOP_REG = 0x50 #/* Loop Read Back Address */ #Useful definitions ADS1293_READ_BIT = 0x80 ADS1293_WRITE_BIT = 0x7F
ecg_chan_1 = 0 ecg_chan_2 = 1 ecg_chan_3 = 2 lead_05_chan_1_data_size = 9 lead_12_chan_1_data_size = 6 lead_12_chan_2_data_size = 9 lead_12_chan_3_data_size = 9 ti_ads1293_config_reg = 0 ti_ads1293_flex_ch1_cn_reg = 1 ti_ads1293_flex_ch2_cn_reg = 2 ti_ads1293_flex_ch3_cn_reg = 3 ti_ads1293_flex_pace_cn_reg = 4 ti_ads1293_flex_vbat_cn_reg = 5 ti_ads1293_lod_cn_reg = 6 ti_ads1293_lod_en_reg = 7 ti_ads1293_lod_current_reg = 8 ti_ads1293_lod_ac_cn_reg = 9 ti_ads1293_cmdet_en_reg = 10 ti_ads1293_cmdet_cn_reg = 11 ti_ads1293_rld_cn_reg = 12 ti_ads1293_wilson_en1_reg = 13 ti_ads1293_wilson_en2_reg = 14 ti_ads1293_wilson_en3_reg = 15 ti_ads1293_wilson_cn_reg = 16 ti_ads1293_ref_cn_reg = 17 ti_ads1293_osc_cn_reg = 18 ti_ads1293_afe_res_reg = 19 ti_ads1293_afe_shdn_cn_reg = 20 ti_ads1293_afe_fault_cn_reg = 21 ti_ads1293_afe_dither_en_reg = 22 ti_ads1293_afe_pace_cn_reg = 23 ti_ads1293_error_lod_reg = 24 ti_ads1293_error_status_reg = 25 ti_ads1293_error_range1_reg = 26 ti_ads1293_error_range2_reg = 27 ti_ads1293_error_range3_reg = 28 ti_ads1293_error_sync_reg = 29 ti_ads1293_r2_rate_reg = 33 ti_ads1293_r3_rate1_reg = 34 ti_ads1293_r3_rate2_reg = 35 ti_ads1293_r3_rate3_reg = 36 ti_ads1293_p_drate_reg = 37 ti_ads1293_dis_efilter_reg = 38 ti_ads1293_drdyb_src_reg = 39 ti_ads1293_syncoutb_src_reg = 40 ti_ads1293_mask_drdyb_reg = 41 ti_ads1293_mask_err_reg = 42 ti_ads1293_alarm_filter_reg = 46 ti_ads1293_ch_cnfg_reg = 47 ti_ads1293_data_status_reg = 48 ti_ads1293_data_ch1_pace_h_reg = 49 ti_ads1293_data_ch1_pace_l_reg = 50 ti_ads1293_data_ch2_pace_h_reg = 51 ti_ads1293_data_ch2_pace_l_reg = 52 ti_ads1293_data_ch3_pace_h_reg = 53 ti_ads1293_data_ch3_pace_l_reg = 54 ti_ads1293_data_ch1_ecg_h_reg = 55 ti_ads1293_data_ch1_ecg_m_reg = 56 ti_ads1293_data_ch1_ecg_l_reg = 57 ti_ads1293_data_ch2_ecg_h_reg = 58 ti_ads1293_data_ch2_ecg_m_reg = 59 ti_ads1293_data_ch2_ecg_l_reg = 60 ti_ads1293_data_ch3_ecg_h_reg = 61 ti_ads1293_data_ch3_ecg_m_reg = 62 ti_ads1293_data_ch3_ecg_l_reg = 63 ti_ads1293_revid_reg = 64 ti_ads1293_data_loop_reg = 80 ads1293_read_bit = 128 ads1293_write_bit = 127
# field_subject on islandora 8 is configured to map to the following vocabs: Corporate, Family, Geographic Location, # Person, Subject class MemberOf: def __init__(self): self.drupal_fieldnames = {'memberof': 'field_member_of'} self.memberof = 'Repository Item' def get_memberof(self): return self.memberof def get_memberoffieldname(self): return self.drupal_fieldnames['memberof']
class Memberof: def __init__(self): self.drupal_fieldnames = {'memberof': 'field_member_of'} self.memberof = 'Repository Item' def get_memberof(self): return self.memberof def get_memberoffieldname(self): return self.drupal_fieldnames['memberof']
a = [1, 2, 3, 4, 5] b = [4, 5, 6, 7, 8] diff = [] for item in a: if item not in b: diff.append(item) for item in b: if item not in a: diff.append(item) print(diff)
a = [1, 2, 3, 4, 5] b = [4, 5, 6, 7, 8] diff = [] for item in a: if item not in b: diff.append(item) for item in b: if item not in a: diff.append(item) print(diff)
# # PySNMP MIB module ZYXEL-CPU-PROTECTION-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZYXEL-CPU-PROTECTION-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:49:18 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") NotificationType, Integer32, Bits, ObjectIdentity, Gauge32, IpAddress, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, iso, Counter32, Unsigned32, Counter64, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Integer32", "Bits", "ObjectIdentity", "Gauge32", "IpAddress", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "iso", "Counter32", "Unsigned32", "Counter64", "MibIdentifier") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") esMgmt, = mibBuilder.importSymbols("ZYXEL-ES-SMI", "esMgmt") zyxelCpuProtection = ModuleIdentity((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16)) if mibBuilder.loadTexts: zyxelCpuProtection.setLastUpdated('201207010000Z') if mibBuilder.loadTexts: zyxelCpuProtection.setOrganization('Enterprise Solution ZyXEL') if mibBuilder.loadTexts: zyxelCpuProtection.setContactInfo('') if mibBuilder.loadTexts: zyxelCpuProtection.setDescription('The subtree for cpu protection') zyxelCpuProtectionSetup = MibIdentifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1)) zyxelCpuProtectionTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1), ) if mibBuilder.loadTexts: zyxelCpuProtectionTable.setStatus('current') if mibBuilder.loadTexts: zyxelCpuProtectionTable.setDescription('The table contains CPU protection configuration.') zyxelCpuProtectionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1), ).setIndexNames((0, "ZYXEL-CPU-PROTECTION-MIB", "zyCpuProtectionPort"), (0, "ZYXEL-CPU-PROTECTION-MIB", "zyCpuProtectionReasonType")) if mibBuilder.loadTexts: zyxelCpuProtectionEntry.setStatus('current') if mibBuilder.loadTexts: zyxelCpuProtectionEntry.setDescription('An entry contains CPU protection configuration.') zyCpuProtectionPort = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: zyCpuProtectionPort.setStatus('current') if mibBuilder.loadTexts: zyCpuProtectionPort.setDescription('This field displays the port number.') zyCpuProtectionReasonType = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("arp", 1), ("bpdu", 2), ("igmp", 3)))) if mibBuilder.loadTexts: zyCpuProtectionReasonType.setStatus('current') if mibBuilder.loadTexts: zyCpuProtectionReasonType.setDescription('This field displays which type of control packets on the specified port.') zyCpuProtectionRateLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 256))).setMaxAccess("readwrite") if mibBuilder.loadTexts: zyCpuProtectionRateLimit.setStatus('current') if mibBuilder.loadTexts: zyCpuProtectionRateLimit.setDescription('Enter a number from 0 to 256 to specified how many control packets this port can receive or transmit per second. 0 means no rate limit.') mibBuilder.exportSymbols("ZYXEL-CPU-PROTECTION-MIB", zyxelCpuProtectionEntry=zyxelCpuProtectionEntry, zyCpuProtectionReasonType=zyCpuProtectionReasonType, zyxelCpuProtectionSetup=zyxelCpuProtectionSetup, zyxelCpuProtectionTable=zyxelCpuProtectionTable, zyCpuProtectionPort=zyCpuProtectionPort, zyxelCpuProtection=zyxelCpuProtection, zyCpuProtectionRateLimit=zyCpuProtectionRateLimit, PYSNMP_MODULE_ID=zyxelCpuProtection)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, single_value_constraint, value_size_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (notification_type, integer32, bits, object_identity, gauge32, ip_address, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, iso, counter32, unsigned32, counter64, mib_identifier) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'Integer32', 'Bits', 'ObjectIdentity', 'Gauge32', 'IpAddress', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'iso', 'Counter32', 'Unsigned32', 'Counter64', 'MibIdentifier') (textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString') (es_mgmt,) = mibBuilder.importSymbols('ZYXEL-ES-SMI', 'esMgmt') zyxel_cpu_protection = module_identity((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16)) if mibBuilder.loadTexts: zyxelCpuProtection.setLastUpdated('201207010000Z') if mibBuilder.loadTexts: zyxelCpuProtection.setOrganization('Enterprise Solution ZyXEL') if mibBuilder.loadTexts: zyxelCpuProtection.setContactInfo('') if mibBuilder.loadTexts: zyxelCpuProtection.setDescription('The subtree for cpu protection') zyxel_cpu_protection_setup = mib_identifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1)) zyxel_cpu_protection_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1)) if mibBuilder.loadTexts: zyxelCpuProtectionTable.setStatus('current') if mibBuilder.loadTexts: zyxelCpuProtectionTable.setDescription('The table contains CPU protection configuration.') zyxel_cpu_protection_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1)).setIndexNames((0, 'ZYXEL-CPU-PROTECTION-MIB', 'zyCpuProtectionPort'), (0, 'ZYXEL-CPU-PROTECTION-MIB', 'zyCpuProtectionReasonType')) if mibBuilder.loadTexts: zyxelCpuProtectionEntry.setStatus('current') if mibBuilder.loadTexts: zyxelCpuProtectionEntry.setDescription('An entry contains CPU protection configuration.') zy_cpu_protection_port = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1, 1), integer32()) if mibBuilder.loadTexts: zyCpuProtectionPort.setStatus('current') if mibBuilder.loadTexts: zyCpuProtectionPort.setDescription('This field displays the port number.') zy_cpu_protection_reason_type = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('arp', 1), ('bpdu', 2), ('igmp', 3)))) if mibBuilder.loadTexts: zyCpuProtectionReasonType.setStatus('current') if mibBuilder.loadTexts: zyCpuProtectionReasonType.setDescription('This field displays which type of control packets on the specified port.') zy_cpu_protection_rate_limit = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 16, 1, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 256))).setMaxAccess('readwrite') if mibBuilder.loadTexts: zyCpuProtectionRateLimit.setStatus('current') if mibBuilder.loadTexts: zyCpuProtectionRateLimit.setDescription('Enter a number from 0 to 256 to specified how many control packets this port can receive or transmit per second. 0 means no rate limit.') mibBuilder.exportSymbols('ZYXEL-CPU-PROTECTION-MIB', zyxelCpuProtectionEntry=zyxelCpuProtectionEntry, zyCpuProtectionReasonType=zyCpuProtectionReasonType, zyxelCpuProtectionSetup=zyxelCpuProtectionSetup, zyxelCpuProtectionTable=zyxelCpuProtectionTable, zyCpuProtectionPort=zyCpuProtectionPort, zyxelCpuProtection=zyxelCpuProtection, zyCpuProtectionRateLimit=zyCpuProtectionRateLimit, PYSNMP_MODULE_ID=zyxelCpuProtection)
# GENERATED VERSION FILE # TIME: Tue Oct 6 17:46:50 2020 __version__ = "0.3.0+0e6315d" short_version = "0.3.0"
__version__ = '0.3.0+0e6315d' short_version = '0.3.0'
class RequestLog: def __init__(self): self.url = None self.request_headers = None self.request_body = None self.request_method = None self.request_timestamp = None self.status_code = None self.response_headers = None self.response_body = None self.response_timestamp = None self.error = None
class Requestlog: def __init__(self): self.url = None self.request_headers = None self.request_body = None self.request_method = None self.request_timestamp = None self.status_code = None self.response_headers = None self.response_body = None self.response_timestamp = None self.error = None
#is_hot = True #is_cold = False #if is_hot: #print("it's a hot day wear a vest") #elif is_cold: #print("its cold") #else: #print("die"1111111111111) #good_credit = True #price = 1000000 #if good_credit: #print("you need to put down 10%") #print("payment is " + "$" + str(0.1*price)) #else: #print("you need to put down 20%") #print("payment is " + "$" + str(0.2*price)) #good_credit = True #price = 1000000 #if good_credit: #down_payment = 0.1 * price #else: #down_payment = 0.2 * price #print(f"the down payment: ${down_payment}") # temperature = 30 # if temperature > 30: # print ("it is hot") # elif temperature < 20: # print("it is kinda cold") # else: # print("aight i am not sure what temperature it is") name = input() name_character = len(name) if name_character < 3: print("your name character is too short") elif name_character > 20: print("your name character is too long") else: print("your name character are perfect")
name = input() name_character = len(name) if name_character < 3: print('your name character is too short') elif name_character > 20: print('your name character is too long') else: print('your name character are perfect')
def media_digitos(n): num = list(map(int,str(n))) return sum(num) / len(num) n = int(input("digite o valor: ")) print(f"a media dos valores e: {media_digitos(n)}")
def media_digitos(n): num = list(map(int, str(n))) return sum(num) / len(num) n = int(input('digite o valor: ')) print(f'a media dos valores e: {media_digitos(n)}')
__title__ = "asent" __version__ = "0.3.0" # the ONLY source of version ID __download_url__ = "https://github.com/kennethenevoldsen/asent" __documentation__ = "https://kennethenevoldsen.github.io/asent"
__title__ = 'asent' __version__ = '0.3.0' __download_url__ = 'https://github.com/kennethenevoldsen/asent' __documentation__ = 'https://kennethenevoldsen.github.io/asent'
N = int(input()) T = [int(input()) for _ in range(N)] total = sum(T) ans = 1e10 for i in range(2 ** N): tmp = 0 for j in range(N): if i & (1 << j): tmp += T[j] ans = min(ans, max(tmp, total - tmp)) print(ans)
n = int(input()) t = [int(input()) for _ in range(N)] total = sum(T) ans = 10000000000.0 for i in range(2 ** N): tmp = 0 for j in range(N): if i & 1 << j: tmp += T[j] ans = min(ans, max(tmp, total - tmp)) print(ans)
x=int(input()) y=int(input()) i=int(1) fact=int(1) while i<=x : fact=((fact%y)*(i%y))%y i=i+1 print(fact)
x = int(input()) y = int(input()) i = int(1) fact = int(1) while i <= x: fact = fact % y * (i % y) % y i = i + 1 print(fact)
class DLinkedNode(): def __init__(self, key: int = None, value: int = None, prev: 'DLinkedList' = None, next: 'DLinkedList' = None): self.key = key self.value = value self.prev = prev self.next = next class DLinkedList(): def __init__(self): self.head = DLinkedNode() self.tail = DLinkedNode() self.head.next = self.tail self.tail.prev = self.head def pop_tail(self) -> 'DLinkedList': res = self.tail.prev self.remove_node(res) return res def move_to_head(self, node: 'DLinkedList') -> None: self.remove_node(node) self.add_node(node) def remove_node(self, node: 'DLinkedList') -> None: prev = node.prev new = node.next prev.next = new new.prev = prev def add_node(self, node: 'DLinkedList') -> None: node.prev = self.head node.next = self.head.next self.head.next.prev = node self.head.next = node class LRUCache(): def __init__(self, capacity: int): self.size = 0 self.capacity = capacity self.cache = {} self.list = DLinkedList() def get(self, key: int) -> int: node = self.cache.get(key) if not node: return -1 self.list.move_to_head(node) return node.value def put(self, key: int, value: int) -> None: node = self.cache.get(key) if not node: node = DLinkedNode(key=key, value=value) self.cache[key] = node self.list.add_node(node) self.size += 1 if self.size > self.capacity: tail = self.list.pop_tail() del self.cache[tail.key] self.size -= 1 else: node.value = value self.list.move_to_head(node) # Your LRUCache object will be instantiated and called as such: # obj = LRUCache(capacity) # param_1 = obj.get(key) # obj.put(key,value)
class Dlinkednode: def __init__(self, key: int=None, value: int=None, prev: 'DLinkedList'=None, next: 'DLinkedList'=None): self.key = key self.value = value self.prev = prev self.next = next class Dlinkedlist: def __init__(self): self.head = d_linked_node() self.tail = d_linked_node() self.head.next = self.tail self.tail.prev = self.head def pop_tail(self) -> 'DLinkedList': res = self.tail.prev self.remove_node(res) return res def move_to_head(self, node: 'DLinkedList') -> None: self.remove_node(node) self.add_node(node) def remove_node(self, node: 'DLinkedList') -> None: prev = node.prev new = node.next prev.next = new new.prev = prev def add_node(self, node: 'DLinkedList') -> None: node.prev = self.head node.next = self.head.next self.head.next.prev = node self.head.next = node class Lrucache: def __init__(self, capacity: int): self.size = 0 self.capacity = capacity self.cache = {} self.list = d_linked_list() def get(self, key: int) -> int: node = self.cache.get(key) if not node: return -1 self.list.move_to_head(node) return node.value def put(self, key: int, value: int) -> None: node = self.cache.get(key) if not node: node = d_linked_node(key=key, value=value) self.cache[key] = node self.list.add_node(node) self.size += 1 if self.size > self.capacity: tail = self.list.pop_tail() del self.cache[tail.key] self.size -= 1 else: node.value = value self.list.move_to_head(node)
class TokenStream: def __init__(self, tokens): self.tokens = tokens def lookahead(self, index): return self.tokens[index] def peek(self): return self.tokens[0] def advance(self): return self.tokens.pop(0) def defer(self, token): self.tokens.insert(0, token)
class Tokenstream: def __init__(self, tokens): self.tokens = tokens def lookahead(self, index): return self.tokens[index] def peek(self): return self.tokens[0] def advance(self): return self.tokens.pop(0) def defer(self, token): self.tokens.insert(0, token)
# Definitions for Machine.Status MACHINE_STATUS_BROKEN = 0 MACHINE_STATUS_ALIVE = 1 # The "prebaked" downage categories PREBAKED_DOWNAGE_CATEGORY_TEXTS = [ 'Software Problem', 'Hardware Problem', 'Machine Problem' ] # TODO: remove this and actually query locations after basic demo # x should be within [0-3] and y should be within [0-8] STUB_LOCATION_DICT = { '1': { 'x': 1, 'y': 2 }, '2': { 'x': 0, 'y': 3 }, '3': { 'x': 0, 'y': 4 }, '4': { 'x': 0, 'y': 5 }, '5': { 'x': 1, 'y': 6 }, '6': { 'x': 3, 'y': 6 }, '7': { 'x': 3, 'y': 5 }, '8': { 'x': 3, 'y': 4 }, '9': { 'x': 3, 'y': 3 }, '10': { 'x': 3, 'y': 2 }, }
machine_status_broken = 0 machine_status_alive = 1 prebaked_downage_category_texts = ['Software Problem', 'Hardware Problem', 'Machine Problem'] stub_location_dict = {'1': {'x': 1, 'y': 2}, '2': {'x': 0, 'y': 3}, '3': {'x': 0, 'y': 4}, '4': {'x': 0, 'y': 5}, '5': {'x': 1, 'y': 6}, '6': {'x': 3, 'y': 6}, '7': {'x': 3, 'y': 5}, '8': {'x': 3, 'y': 4}, '9': {'x': 3, 'y': 3}, '10': {'x': 3, 'y': 2}}
#CODE ARENA PLAYER #Problem Link : https://www.hackerearth.com/practice/algorithms/searching/ternary-search/practice-problems/algorithm/small-factorials/ f = [1] * 105 for i in range(2,105): f[i] = f[i-1] * i t = int(input()) while t: t-=1 n = int(input()) print(f[n])
f = [1] * 105 for i in range(2, 105): f[i] = f[i - 1] * i t = int(input()) while t: t -= 1 n = int(input()) print(f[n])