content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
def search(list, platform):
for i in range(len(list)):
if list[i] == platform:
return True
return False
fruit = ['banana', 'grape', 'apple', 'plam']
print(fruit)
frut = input('input to see if it exists: ')
if search(fruit, frut):
print("fruit is found")
else:
print("fruiit does not found") | def search(list, platform):
for i in range(len(list)):
if list[i] == platform:
return True
return False
fruit = ['banana', 'grape', 'apple', 'plam']
print(fruit)
frut = input('input to see if it exists: ')
if search(fruit, frut):
print('fruit is found')
else:
print('fruiit does not found') |
# -*- coding: utf-8 -*-
def theaudiodb_albumdetails(data):
if data.get('album'):
item = data['album'][0]
albumdata = {}
albumdata['album'] = item['strAlbum']
if item.get('intYearReleased',''):
albumdata['year'] = item['intYearReleased']
if item.get('strStyle',''):
albumdata['styles'] = item['strStyle']
if item.get('strGenre',''):
albumdata['genre'] = item['strGenre']
if item.get('strLabel',''):
albumdata['label'] = item['strLabel']
if item.get('strReleaseFormat',''):
albumdata['type'] = item['strReleaseFormat']
if item.get('intScore',''):
albumdata['rating'] = str(int(float(item['intScore']) + 0.5))
if item.get('intScoreVotes',''):
albumdata['votes'] = item['intScoreVotes']
if item.get('strMood',''):
albumdata['moods'] = item['strMood']
if item.get('strTheme',''):
albumdata['themes'] = item['strTheme']
if item.get('strMusicBrainzID',''):
albumdata['mbreleasegroupid'] = item['strMusicBrainzID']
# api inconsistent
if item.get('strDescription',''):
albumdata['descriptionEN'] = item['strDescription']
elif item.get('strDescriptionEN',''):
albumdata['descriptionEN'] = item['strDescriptionEN']
if item.get('strDescriptionDE',''):
albumdata['descriptionDE'] = item['strDescriptionDE']
if item.get('strDescriptionFR',''):
albumdata['descriptionFR'] = item['strDescriptionFR']
if item.get('strDescriptionCN',''):
albumdata['descriptionCN'] = item['strDescriptionCN']
if item.get('strDescriptionIT',''):
albumdata['descriptionIT'] = item['strDescriptionIT']
if item.get('strDescriptionJP',''):
albumdata['descriptionJP'] = item['strDescriptionJP']
if item.get('strDescriptionRU',''):
albumdata['descriptionRU'] = item['strDescriptionRU']
if item.get('strDescriptionES',''):
albumdata['descriptionES'] = item['strDescriptionES']
if item.get('strDescriptionPT',''):
albumdata['descriptionPT'] = item['strDescriptionPT']
if item.get('strDescriptionSE',''):
albumdata['descriptionSE'] = item['strDescriptionSE']
if item.get('strDescriptionNL',''):
albumdata['descriptionNL'] = item['strDescriptionNL']
if item.get('strDescriptionHU',''):
albumdata['descriptionHU'] = item['strDescriptionHU']
if item.get('strDescriptionNO',''):
albumdata['descriptionNO'] = item['strDescriptionNO']
if item.get('strDescriptionIL',''):
albumdata['descriptionIL'] = item['strDescriptionIL']
if item.get('strDescriptionPL',''):
albumdata['descriptionPL'] = item['strDescriptionPL']
if item.get('strArtist',''):
albumdata['artist_description'] = item['strArtist']
artists = []
artistdata = {}
artistdata['artist'] = item['strArtist']
if item.get('strMusicBrainzArtistID',''):
artistdata['mbartistid'] = item['strMusicBrainzArtistID']
artists.append(artistdata)
albumdata['artist'] = artists
thumbs = []
extras = []
if item.get('strAlbumThumb',''):
thumbdata = {}
thumbdata['image'] = item['strAlbumThumb']
thumbdata['preview'] = item['strAlbumThumb'] + '/preview'
thumbdata['aspect'] = 'thumb'
thumbs.append(thumbdata)
if item.get('strAlbumThumbBack',''):
extradata = {}
extradata['image'] = item['strAlbumThumbBack']
extradata['preview'] = item['strAlbumThumbBack'] + '/preview'
extradata['aspect'] = 'back'
extras.append(extradata)
if item.get('strAlbumSpine',''):
extradata = {}
extradata['image'] = item['strAlbumSpine']
extradata['preview'] = item['strAlbumSpine'] + '/preview'
extradata['aspect'] = 'spine'
extras.append(extradata)
if item.get('strAlbumCDart',''):
extradata = {}
extradata['image'] = item['strAlbumCDart']
extradata['preview'] = item['strAlbumCDart'] + '/preview'
extradata['aspect'] = 'discart'
extras.append(extradata)
if item.get('strAlbum3DCase',''):
extradata = {}
extradata['image'] = item['strAlbum3DCase']
extradata['preview'] = item['strAlbum3DCase'] + '/preview'
extradata['aspect'] = '3dcase'
extras.append(extradata)
if item.get('strAlbum3DFlat',''):
extradata = {}
extradata['image'] = item['strAlbum3DFlat']
extradata['preview'] = item['strAlbum3DFlat'] + '/preview'
extradata['aspect'] = '3dflat'
extras.append(extradata)
if item.get('strAlbum3DFace',''):
extradata = {}
extradata['image'] = item['strAlbum3DFace']
extradata['preview'] = item['strAlbum3DFace'] + '/preview'
extradata['aspect'] = '3dface'
extras.append(extradata)
if thumbs:
albumdata['thumb'] = thumbs
if extras:
albumdata['extras'] = extras
return albumdata
| def theaudiodb_albumdetails(data):
if data.get('album'):
item = data['album'][0]
albumdata = {}
albumdata['album'] = item['strAlbum']
if item.get('intYearReleased', ''):
albumdata['year'] = item['intYearReleased']
if item.get('strStyle', ''):
albumdata['styles'] = item['strStyle']
if item.get('strGenre', ''):
albumdata['genre'] = item['strGenre']
if item.get('strLabel', ''):
albumdata['label'] = item['strLabel']
if item.get('strReleaseFormat', ''):
albumdata['type'] = item['strReleaseFormat']
if item.get('intScore', ''):
albumdata['rating'] = str(int(float(item['intScore']) + 0.5))
if item.get('intScoreVotes', ''):
albumdata['votes'] = item['intScoreVotes']
if item.get('strMood', ''):
albumdata['moods'] = item['strMood']
if item.get('strTheme', ''):
albumdata['themes'] = item['strTheme']
if item.get('strMusicBrainzID', ''):
albumdata['mbreleasegroupid'] = item['strMusicBrainzID']
if item.get('strDescription', ''):
albumdata['descriptionEN'] = item['strDescription']
elif item.get('strDescriptionEN', ''):
albumdata['descriptionEN'] = item['strDescriptionEN']
if item.get('strDescriptionDE', ''):
albumdata['descriptionDE'] = item['strDescriptionDE']
if item.get('strDescriptionFR', ''):
albumdata['descriptionFR'] = item['strDescriptionFR']
if item.get('strDescriptionCN', ''):
albumdata['descriptionCN'] = item['strDescriptionCN']
if item.get('strDescriptionIT', ''):
albumdata['descriptionIT'] = item['strDescriptionIT']
if item.get('strDescriptionJP', ''):
albumdata['descriptionJP'] = item['strDescriptionJP']
if item.get('strDescriptionRU', ''):
albumdata['descriptionRU'] = item['strDescriptionRU']
if item.get('strDescriptionES', ''):
albumdata['descriptionES'] = item['strDescriptionES']
if item.get('strDescriptionPT', ''):
albumdata['descriptionPT'] = item['strDescriptionPT']
if item.get('strDescriptionSE', ''):
albumdata['descriptionSE'] = item['strDescriptionSE']
if item.get('strDescriptionNL', ''):
albumdata['descriptionNL'] = item['strDescriptionNL']
if item.get('strDescriptionHU', ''):
albumdata['descriptionHU'] = item['strDescriptionHU']
if item.get('strDescriptionNO', ''):
albumdata['descriptionNO'] = item['strDescriptionNO']
if item.get('strDescriptionIL', ''):
albumdata['descriptionIL'] = item['strDescriptionIL']
if item.get('strDescriptionPL', ''):
albumdata['descriptionPL'] = item['strDescriptionPL']
if item.get('strArtist', ''):
albumdata['artist_description'] = item['strArtist']
artists = []
artistdata = {}
artistdata['artist'] = item['strArtist']
if item.get('strMusicBrainzArtistID', ''):
artistdata['mbartistid'] = item['strMusicBrainzArtistID']
artists.append(artistdata)
albumdata['artist'] = artists
thumbs = []
extras = []
if item.get('strAlbumThumb', ''):
thumbdata = {}
thumbdata['image'] = item['strAlbumThumb']
thumbdata['preview'] = item['strAlbumThumb'] + '/preview'
thumbdata['aspect'] = 'thumb'
thumbs.append(thumbdata)
if item.get('strAlbumThumbBack', ''):
extradata = {}
extradata['image'] = item['strAlbumThumbBack']
extradata['preview'] = item['strAlbumThumbBack'] + '/preview'
extradata['aspect'] = 'back'
extras.append(extradata)
if item.get('strAlbumSpine', ''):
extradata = {}
extradata['image'] = item['strAlbumSpine']
extradata['preview'] = item['strAlbumSpine'] + '/preview'
extradata['aspect'] = 'spine'
extras.append(extradata)
if item.get('strAlbumCDart', ''):
extradata = {}
extradata['image'] = item['strAlbumCDart']
extradata['preview'] = item['strAlbumCDart'] + '/preview'
extradata['aspect'] = 'discart'
extras.append(extradata)
if item.get('strAlbum3DCase', ''):
extradata = {}
extradata['image'] = item['strAlbum3DCase']
extradata['preview'] = item['strAlbum3DCase'] + '/preview'
extradata['aspect'] = '3dcase'
extras.append(extradata)
if item.get('strAlbum3DFlat', ''):
extradata = {}
extradata['image'] = item['strAlbum3DFlat']
extradata['preview'] = item['strAlbum3DFlat'] + '/preview'
extradata['aspect'] = '3dflat'
extras.append(extradata)
if item.get('strAlbum3DFace', ''):
extradata = {}
extradata['image'] = item['strAlbum3DFace']
extradata['preview'] = item['strAlbum3DFace'] + '/preview'
extradata['aspect'] = '3dface'
extras.append(extradata)
if thumbs:
albumdata['thumb'] = thumbs
if extras:
albumdata['extras'] = extras
return albumdata |
class State:
state = {}
@staticmethod
def init():
State.state = {
"lowres_frames": None,
"highres_frames": None,
"photopath": "",
"frame": 0,
"current_photo": None,
"share_code": "",
"preview_image_width": 0,
"photo_countdown": 0,
"reset_time": 0,
"upload_url": "",
"photo_url": "",
"api_key": ""
}
return State.state
@staticmethod
def set(value):
State.state[value[0]] = value[1]
return State.state
@staticmethod
def set_dict(value):
State.state = {**State.state, **value}
return State.state
@staticmethod
def get(key):
try:
return State.state.get(key)
except KeyError:
print("No key found")
return None
@staticmethod
def print():
print(State.state)
| class State:
state = {}
@staticmethod
def init():
State.state = {'lowres_frames': None, 'highres_frames': None, 'photopath': '', 'frame': 0, 'current_photo': None, 'share_code': '', 'preview_image_width': 0, 'photo_countdown': 0, 'reset_time': 0, 'upload_url': '', 'photo_url': '', 'api_key': ''}
return State.state
@staticmethod
def set(value):
State.state[value[0]] = value[1]
return State.state
@staticmethod
def set_dict(value):
State.state = {**State.state, **value}
return State.state
@staticmethod
def get(key):
try:
return State.state.get(key)
except KeyError:
print('No key found')
return None
@staticmethod
def print():
print(State.state) |
expected_output = {
'tracker_name': {
'tcp-10001': {
'status': 'UP',
'rtt_in_msec': 2,
'probe_id': 2
},
'udp-10001': {
'status': 'UP',
'rtt_in_msec': 1,
'probe_id': 3
}
}
}
| expected_output = {'tracker_name': {'tcp-10001': {'status': 'UP', 'rtt_in_msec': 2, 'probe_id': 2}, 'udp-10001': {'status': 'UP', 'rtt_in_msec': 1, 'probe_id': 3}}} |
def is_funny(string):
data = list(zip(string, reversed(string)))
for i in range(len(string)-1):
if abs(ord(data[i+1][0]) - ord(data[i][0])) != \
abs(ord(data[i+1][1]) - ord(data[i][1])):
return "Not Funny"
return "Funny"
N = int(input())
for i in range(N):
print(is_funny(input()))
| def is_funny(string):
data = list(zip(string, reversed(string)))
for i in range(len(string) - 1):
if abs(ord(data[i + 1][0]) - ord(data[i][0])) != abs(ord(data[i + 1][1]) - ord(data[i][1])):
return 'Not Funny'
return 'Funny'
n = int(input())
for i in range(N):
print(is_funny(input())) |
#!/usr/bin/env python
def mtx_pivot(mtx) -> list:
piv=[]
pivr=[[] for c in mtx[0]]
for r,row in enumerate(mtx):
for c,col in enumerate(row):
pivr[c]+=[col]
piv+=pivr
return piv | def mtx_pivot(mtx) -> list:
piv = []
pivr = [[] for c in mtx[0]]
for (r, row) in enumerate(mtx):
for (c, col) in enumerate(row):
pivr[c] += [col]
piv += pivr
return piv |
def add_native_methods(clazz):
def floatToRawIntBits__float__(a0):
raise NotImplementedError()
def intBitsToFloat__int__(a0):
raise NotImplementedError()
clazz.floatToRawIntBits__float__ = staticmethod(floatToRawIntBits__float__)
clazz.intBitsToFloat__int__ = staticmethod(intBitsToFloat__int__)
| def add_native_methods(clazz):
def float_to_raw_int_bits__float__(a0):
raise not_implemented_error()
def int_bits_to_float__int__(a0):
raise not_implemented_error()
clazz.floatToRawIntBits__float__ = staticmethod(floatToRawIntBits__float__)
clazz.intBitsToFloat__int__ = staticmethod(intBitsToFloat__int__) |
# AUTOGENERATED! DO NOT EDIT! File to edit: 04_device.ipynb (unless otherwise specified).
__all__ = ['versions']
# Cell
def versions():
"Checks if GPU enabled and if so displays device details with cuda, pytorch, fastai versions"
print("GPU: ", torch.cuda.is_available())
if torch.cuda.is_available() == True:
print("Device = ", torch.device(torch.cuda.current_device()))
print("Cuda version - ", torch.version.cuda)
print("cuDNN version - ", torch.backends.cudnn.version())
print("PyTorch version - ", torch.__version__)
print("fastai version", fastai.__version__) | __all__ = ['versions']
def versions():
"""Checks if GPU enabled and if so displays device details with cuda, pytorch, fastai versions"""
print('GPU: ', torch.cuda.is_available())
if torch.cuda.is_available() == True:
print('Device = ', torch.device(torch.cuda.current_device()))
print('Cuda version - ', torch.version.cuda)
print('cuDNN version - ', torch.backends.cudnn.version())
print('PyTorch version - ', torch.__version__)
print('fastai version', fastai.__version__) |
class PDB_container:
'''
Use to read a pdb file from a cocrystal structure and parse
it for further use
Note this class cannot write any files and we do not want any
files to be added by this class
This is good for IO management although the code might be hard to
understand
'''
def __init__(self):
'''
parse a pdb from file
'''
pass
def register_a_ligand(self):
pass
def Is_pure_protein(self):
pass
def Is_pure_nucleic(self):
pass
def Is_protein_nucleic_complex(self):
pass
def Bundle_ligand_result_dict(self):
pass
def Bundle_ligand_result_list(self):
pass
def list_ligand_ResId(self):
pass
def get_ligand_dict(self):
pass
class ligand_container:
pass
| class Pdb_Container:
"""
Use to read a pdb file from a cocrystal structure and parse
it for further use
Note this class cannot write any files and we do not want any
files to be added by this class
This is good for IO management although the code might be hard to
understand
"""
def __init__(self):
"""
parse a pdb from file
"""
pass
def register_a_ligand(self):
pass
def is_pure_protein(self):
pass
def is_pure_nucleic(self):
pass
def is_protein_nucleic_complex(self):
pass
def bundle_ligand_result_dict(self):
pass
def bundle_ligand_result_list(self):
pass
def list_ligand__res_id(self):
pass
def get_ligand_dict(self):
pass
class Ligand_Container:
pass |
def method():
if True:
return 1
else:
return 2
def method2():
x = 2
if x:
y = 3
z = 1
| def method():
if True:
return 1
else:
return 2
def method2():
x = 2
if x:
y = 3
z = 1 |
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Module authors:
# [email protected]
#
# *****************************************************************************
name = 'SINQ Double Monochromator'
includes = ['stdsystem']
description = 'Test setup for the SINQ double monochromator'
devices = dict(
mth1 = device('nicos.devices.generic.VirtualMotor',
unit = 'degree',
description = 'First blade rotation',
abslimits = (-180, 180),
precision = 0.01
),
mth2 = device('nicos.devices.generic.VirtualMotor',
unit = 'degree',
description = 'Second blade rotation',
abslimits = (-180, 180),
precision = 0.01
),
mtx = device('nicos.devices.generic.VirtualMotor',
unit = 'mm',
description = 'Blade translation',
abslimits = (-1000, 1000),
precision = 0.01
),
wavelength = device('nicos_sinq.devices.doublemono.DoubleMonochromator',
description = 'SINQ Double Monochromator',
unit = 'A',
safe_position = 20.,
dvalue = 3.335,
distance = 100.,
abslimits = (2.4, 6.2),
mth1 = 'mth1',
mth2 = 'mth2',
mtx = 'mtx'
),
)
| name = 'SINQ Double Monochromator'
includes = ['stdsystem']
description = 'Test setup for the SINQ double monochromator'
devices = dict(mth1=device('nicos.devices.generic.VirtualMotor', unit='degree', description='First blade rotation', abslimits=(-180, 180), precision=0.01), mth2=device('nicos.devices.generic.VirtualMotor', unit='degree', description='Second blade rotation', abslimits=(-180, 180), precision=0.01), mtx=device('nicos.devices.generic.VirtualMotor', unit='mm', description='Blade translation', abslimits=(-1000, 1000), precision=0.01), wavelength=device('nicos_sinq.devices.doublemono.DoubleMonochromator', description='SINQ Double Monochromator', unit='A', safe_position=20.0, dvalue=3.335, distance=100.0, abslimits=(2.4, 6.2), mth1='mth1', mth2='mth2', mtx='mtx')) |
class Fluorescence:
def __init__(self, user_input, input_ceon):
self.user_input = user_input
self.input_ceons = [input_ceon]
self.number_trajectories = user_input.n_snapshots_ex
self.child_root = 'nasqm_fluorescence_'
self.job_suffix = 'fluorescence'
self.parent_restart_root = 'nasqm_qmexcited'
self.number_frames_in_parent = user_input.n_mcrd_frames_per_run_qmexcited * user_input.n_exc_runs
self.n_snapshots_per_trajectory = self.snaps_per_trajectory()
self.amber_restart = False
def __str__(self):
print_value = ""\
f"Traj_Data Info:\n"\
f"Class: Fluorescence:\n"\
f"Number input_ceons: {len(self.input_ceons)}\n"\
f"Number trajectories: {self.number_trajectories}\n"
return print_value
def snaps_per_trajectory(self):
n_frames = self.number_frames_in_parent
run_time = self.user_input.exc_run_time
time_delay = self.user_input.fluorescence_time_delay/1000
return int(n_frames * ( 1 - time_delay/run_time))
| class Fluorescence:
def __init__(self, user_input, input_ceon):
self.user_input = user_input
self.input_ceons = [input_ceon]
self.number_trajectories = user_input.n_snapshots_ex
self.child_root = 'nasqm_fluorescence_'
self.job_suffix = 'fluorescence'
self.parent_restart_root = 'nasqm_qmexcited'
self.number_frames_in_parent = user_input.n_mcrd_frames_per_run_qmexcited * user_input.n_exc_runs
self.n_snapshots_per_trajectory = self.snaps_per_trajectory()
self.amber_restart = False
def __str__(self):
print_value = f'Traj_Data Info:\nClass: Fluorescence:\nNumber input_ceons: {len(self.input_ceons)}\nNumber trajectories: {self.number_trajectories}\n'
return print_value
def snaps_per_trajectory(self):
n_frames = self.number_frames_in_parent
run_time = self.user_input.exc_run_time
time_delay = self.user_input.fluorescence_time_delay / 1000
return int(n_frames * (1 - time_delay / run_time)) |
#
# PySNMP MIB module COMPANY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/COMPANY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:26:32 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, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Bits, TimeTicks, Counter64, IpAddress, MibIdentifier, Counter32, Gauge32, NotificationType, ObjectIdentity, enterprises, Unsigned32, Integer32, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Bits", "TimeTicks", "Counter64", "IpAddress", "MibIdentifier", "Counter32", "Gauge32", "NotificationType", "ObjectIdentity", "enterprises", "Unsigned32", "Integer32", "ModuleIdentity")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
allotCom = ModuleIdentity((1, 3, 6, 1, 4, 1, 2603))
if mibBuilder.loadTexts: allotCom.setLastUpdated('0103120000Z')
if mibBuilder.loadTexts: allotCom.setOrganization('Allot Communications')
if mibBuilder.loadTexts: allotCom.setContactInfo('Allot Communications postal: 5 Hanagar St. Industrial Zone Neve Neeman Hod Hasharon 45800 Israel phone: +972-(0)9-761-9200 fax: +972-(0)9-744-3626 email: [email protected]')
if mibBuilder.loadTexts: allotCom.setDescription('This file defines the private Allot SNMP MIB extensions.')
neTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2603, 2))
nePrimaryActive = NotificationType((1, 3, 6, 1, 4, 1, 2603, 2, 11))
if mibBuilder.loadTexts: nePrimaryActive.setStatus('current')
if mibBuilder.loadTexts: nePrimaryActive.setDescription('This trap is sent when the primary NE changes to Active mode')
nePrimaryBypass = NotificationType((1, 3, 6, 1, 4, 1, 2603, 2, 12))
if mibBuilder.loadTexts: nePrimaryBypass.setStatus('current')
if mibBuilder.loadTexts: nePrimaryBypass.setDescription('This trap is sent when the primary NE changes to Bypass mode')
neSecondaryActive = NotificationType((1, 3, 6, 1, 4, 1, 2603, 2, 13))
if mibBuilder.loadTexts: neSecondaryActive.setStatus('current')
if mibBuilder.loadTexts: neSecondaryActive.setDescription('This trap is sent when the secondary NE changes to Active mode')
neSecondaryStandBy = NotificationType((1, 3, 6, 1, 4, 1, 2603, 2, 14))
if mibBuilder.loadTexts: neSecondaryStandBy.setStatus('current')
if mibBuilder.loadTexts: neSecondaryStandBy.setDescription('This trap is sent when the secondary NE changes to StandBy mode')
neSecondaryBypass = NotificationType((1, 3, 6, 1, 4, 1, 2603, 2, 15))
if mibBuilder.loadTexts: neSecondaryBypass.setStatus('current')
if mibBuilder.loadTexts: neSecondaryBypass.setDescription('This trap is sent when the secondary NE changes to Bypass mode')
collTableOverFlow = NotificationType((1, 3, 6, 1, 4, 1, 2603, 2, 21))
if mibBuilder.loadTexts: collTableOverFlow.setStatus('current')
if mibBuilder.loadTexts: collTableOverFlow.setDescription('This trap is sent when acounting is not reading from the collector which causes the collector table to exceeds limits')
neAlertEvent = NotificationType((1, 3, 6, 1, 4, 1, 2603, 2, 22))
if mibBuilder.loadTexts: neAlertEvent.setStatus('current')
if mibBuilder.loadTexts: neAlertEvent.setDescription('This trap is sent when user defined event occurs')
neNotificationsGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 2603, 3)).setObjects(("COMPANY-MIB", "nePrimaryActive"), ("COMPANY-MIB", "nePrimaryBypass"), ("COMPANY-MIB", "neSecondaryActive"), ("COMPANY-MIB", "neSecondaryStandBy"), ("COMPANY-MIB", "neSecondaryBypass"), ("COMPANY-MIB", "collTableOverFlow"), ("COMPANY-MIB", "neAlertEvent"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
neNotificationsGroup = neNotificationsGroup.setStatus('current')
if mibBuilder.loadTexts: neNotificationsGroup.setDescription('The notifications which indicate specific changes of the NE state.')
mibBuilder.exportSymbols("COMPANY-MIB", nePrimaryBypass=nePrimaryBypass, nePrimaryActive=nePrimaryActive, neSecondaryBypass=neSecondaryBypass, PYSNMP_MODULE_ID=allotCom, neSecondaryActive=neSecondaryActive, allotCom=allotCom, collTableOverFlow=collTableOverFlow, neNotificationsGroup=neNotificationsGroup, neTraps=neTraps, neSecondaryStandBy=neSecondaryStandBy, neAlertEvent=neAlertEvent)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(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')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_scalar, mib_table, mib_table_row, mib_table_column, iso, bits, time_ticks, counter64, ip_address, mib_identifier, counter32, gauge32, notification_type, object_identity, enterprises, unsigned32, integer32, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Bits', 'TimeTicks', 'Counter64', 'IpAddress', 'MibIdentifier', 'Counter32', 'Gauge32', 'NotificationType', 'ObjectIdentity', 'enterprises', 'Unsigned32', 'Integer32', 'ModuleIdentity')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
allot_com = module_identity((1, 3, 6, 1, 4, 1, 2603))
if mibBuilder.loadTexts:
allotCom.setLastUpdated('0103120000Z')
if mibBuilder.loadTexts:
allotCom.setOrganization('Allot Communications')
if mibBuilder.loadTexts:
allotCom.setContactInfo('Allot Communications postal: 5 Hanagar St. Industrial Zone Neve Neeman Hod Hasharon 45800 Israel phone: +972-(0)9-761-9200 fax: +972-(0)9-744-3626 email: [email protected]')
if mibBuilder.loadTexts:
allotCom.setDescription('This file defines the private Allot SNMP MIB extensions.')
ne_traps = mib_identifier((1, 3, 6, 1, 4, 1, 2603, 2))
ne_primary_active = notification_type((1, 3, 6, 1, 4, 1, 2603, 2, 11))
if mibBuilder.loadTexts:
nePrimaryActive.setStatus('current')
if mibBuilder.loadTexts:
nePrimaryActive.setDescription('This trap is sent when the primary NE changes to Active mode')
ne_primary_bypass = notification_type((1, 3, 6, 1, 4, 1, 2603, 2, 12))
if mibBuilder.loadTexts:
nePrimaryBypass.setStatus('current')
if mibBuilder.loadTexts:
nePrimaryBypass.setDescription('This trap is sent when the primary NE changes to Bypass mode')
ne_secondary_active = notification_type((1, 3, 6, 1, 4, 1, 2603, 2, 13))
if mibBuilder.loadTexts:
neSecondaryActive.setStatus('current')
if mibBuilder.loadTexts:
neSecondaryActive.setDescription('This trap is sent when the secondary NE changes to Active mode')
ne_secondary_stand_by = notification_type((1, 3, 6, 1, 4, 1, 2603, 2, 14))
if mibBuilder.loadTexts:
neSecondaryStandBy.setStatus('current')
if mibBuilder.loadTexts:
neSecondaryStandBy.setDescription('This trap is sent when the secondary NE changes to StandBy mode')
ne_secondary_bypass = notification_type((1, 3, 6, 1, 4, 1, 2603, 2, 15))
if mibBuilder.loadTexts:
neSecondaryBypass.setStatus('current')
if mibBuilder.loadTexts:
neSecondaryBypass.setDescription('This trap is sent when the secondary NE changes to Bypass mode')
coll_table_over_flow = notification_type((1, 3, 6, 1, 4, 1, 2603, 2, 21))
if mibBuilder.loadTexts:
collTableOverFlow.setStatus('current')
if mibBuilder.loadTexts:
collTableOverFlow.setDescription('This trap is sent when acounting is not reading from the collector which causes the collector table to exceeds limits')
ne_alert_event = notification_type((1, 3, 6, 1, 4, 1, 2603, 2, 22))
if mibBuilder.loadTexts:
neAlertEvent.setStatus('current')
if mibBuilder.loadTexts:
neAlertEvent.setDescription('This trap is sent when user defined event occurs')
ne_notifications_group = notification_group((1, 3, 6, 1, 4, 1, 2603, 3)).setObjects(('COMPANY-MIB', 'nePrimaryActive'), ('COMPANY-MIB', 'nePrimaryBypass'), ('COMPANY-MIB', 'neSecondaryActive'), ('COMPANY-MIB', 'neSecondaryStandBy'), ('COMPANY-MIB', 'neSecondaryBypass'), ('COMPANY-MIB', 'collTableOverFlow'), ('COMPANY-MIB', 'neAlertEvent'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ne_notifications_group = neNotificationsGroup.setStatus('current')
if mibBuilder.loadTexts:
neNotificationsGroup.setDescription('The notifications which indicate specific changes of the NE state.')
mibBuilder.exportSymbols('COMPANY-MIB', nePrimaryBypass=nePrimaryBypass, nePrimaryActive=nePrimaryActive, neSecondaryBypass=neSecondaryBypass, PYSNMP_MODULE_ID=allotCom, neSecondaryActive=neSecondaryActive, allotCom=allotCom, collTableOverFlow=collTableOverFlow, neNotificationsGroup=neNotificationsGroup, neTraps=neTraps, neSecondaryStandBy=neSecondaryStandBy, neAlertEvent=neAlertEvent) |
input_tokenizer = {}
input_tokenizer['en-bg'] = '-l en -a'
input_tokenizer['en-cs'] = '-l en -a'
input_tokenizer['en-de'] = '-l en -a'
input_tokenizer['en-el'] = '-l en -a'
input_tokenizer['en-hr'] = '-l en -a'
input_tokenizer['en-it'] = '-l en -a'
input_tokenizer['en-nl'] = '-l en -a'
input_tokenizer['en-pl'] = '-l en -a'
input_tokenizer['en-pt'] = '-l en -a'
input_tokenizer['en-ru'] = '-l en -a'
input_tokenizer['en-zh'] = '-l en -a'
| input_tokenizer = {}
input_tokenizer['en-bg'] = '-l en -a'
input_tokenizer['en-cs'] = '-l en -a'
input_tokenizer['en-de'] = '-l en -a'
input_tokenizer['en-el'] = '-l en -a'
input_tokenizer['en-hr'] = '-l en -a'
input_tokenizer['en-it'] = '-l en -a'
input_tokenizer['en-nl'] = '-l en -a'
input_tokenizer['en-pl'] = '-l en -a'
input_tokenizer['en-pt'] = '-l en -a'
input_tokenizer['en-ru'] = '-l en -a'
input_tokenizer['en-zh'] = '-l en -a' |
#Task No. 3
def FindPath(graph,start,end,path=[]):
path = path + [start];
if (start == end):
return path
if (start not in graph):
return None
for node in graph[start]:
if node not in path:
path = FindPath(graph,node,end,path)
if path:
return path
return None
graph_1 = {1:[2,5],2:[1,3,5],3:[2,4],4:[3,5,6],5:[1,2,4],6:[4]}
print(FindPath(graph_1,6,1,[])) | def find_path(graph, start, end, path=[]):
path = path + [start]
if start == end:
return path
if start not in graph:
return None
for node in graph[start]:
if node not in path:
path = find_path(graph, node, end, path)
if path:
return path
return None
graph_1 = {1: [2, 5], 2: [1, 3, 5], 3: [2, 4], 4: [3, 5, 6], 5: [1, 2, 4], 6: [4]}
print(find_path(graph_1, 6, 1, [])) |
class Node:
def __init__(self, value=None):
self.value = value
self.next = None
class linkedList:
def __init__(self):
self.head=None
self.tail=None
def __iter__ (self):
curNode = self.head
while curNode:
yield curNode
curNode=curNode.next
class Stack:
def __init__(self):
self.linkedList=linkedList()
def __str__(self):
if self.isEmpty():
return "Empty Stack"
else:
cal = [str(x.value) for x in self.linkedList]
return '\n'.join(cal)
def isEmpty(self):
if self.linkedList.head==None:
return True
else:
return False
def push(self,value):
node = Node(value)
node.next=self.linkedList.head
self.linkedList.head=node
def pop(self):
if self.isEmpty():
return "Empty Stack"
else:
nV=self.linkedList.head.value
self.linkedList.head = self.linkedList.head.next
return nV
def peek(self): #show the top element
if self.isEmpty():
return "Empty Stack"
else:
nV=self.linkedList.head.value
return nV
def deleteL(self):
self.linkedList.head=None
cStack = Stack()
print(cStack.isEmpty())
print(cStack.push(1))
print(cStack.push(2))
print(cStack.push(3))
print(cStack.push(4))
print(cStack)
print("0----")
print(cStack.pop())
print(cStack.peek()) | class Node:
def __init__(self, value=None):
self.value = value
self.next = None
class Linkedlist:
def __init__(self):
self.head = None
self.tail = None
def __iter__(self):
cur_node = self.head
while curNode:
yield curNode
cur_node = curNode.next
class Stack:
def __init__(self):
self.linkedList = linked_list()
def __str__(self):
if self.isEmpty():
return 'Empty Stack'
else:
cal = [str(x.value) for x in self.linkedList]
return '\n'.join(cal)
def is_empty(self):
if self.linkedList.head == None:
return True
else:
return False
def push(self, value):
node = node(value)
node.next = self.linkedList.head
self.linkedList.head = node
def pop(self):
if self.isEmpty():
return 'Empty Stack'
else:
n_v = self.linkedList.head.value
self.linkedList.head = self.linkedList.head.next
return nV
def peek(self):
if self.isEmpty():
return 'Empty Stack'
else:
n_v = self.linkedList.head.value
return nV
def delete_l(self):
self.linkedList.head = None
c_stack = stack()
print(cStack.isEmpty())
print(cStack.push(1))
print(cStack.push(2))
print(cStack.push(3))
print(cStack.push(4))
print(cStack)
print('0----')
print(cStack.pop())
print(cStack.peek()) |
#!/usr/bin/python
def is_member(item_to_check, list_to_check):
'''
Checks if an item is in a list
'''
for list_item in list_to_check:
if item_to_check == list_item:
return(True)
return(False)
| def is_member(item_to_check, list_to_check):
"""
Checks if an item is in a list
"""
for list_item in list_to_check:
if item_to_check == list_item:
return True
return False |
def includeme(config):
# config.add_static_view('static', 'static', cache_max_age=3600)
config.add_route('home', '/')
config.add_route('hitori_boards', r'/hitori_boards')
config.add_route('hitori_board', r'/hitori_boards/{board_id:\d+}')
config.add_route('hitori_board_solve', r'/hitori_boards/{board_id:\d+}/solve')
config.add_route('hitori_board_clone', r'/hitori_boards/{board_id:\d+}/clone')
config.add_route('hitori_solves', r'/hitori_solves')
config.add_route('hitori_solve', r'/hitori_solves/{solve_id:\d+}')
config.add_route('hitori_cell_value', r'/hitori_cells/{cell_id:\d+}/value')
| def includeme(config):
config.add_route('home', '/')
config.add_route('hitori_boards', '/hitori_boards')
config.add_route('hitori_board', '/hitori_boards/{board_id:\\d+}')
config.add_route('hitori_board_solve', '/hitori_boards/{board_id:\\d+}/solve')
config.add_route('hitori_board_clone', '/hitori_boards/{board_id:\\d+}/clone')
config.add_route('hitori_solves', '/hitori_solves')
config.add_route('hitori_solve', '/hitori_solves/{solve_id:\\d+}')
config.add_route('hitori_cell_value', '/hitori_cells/{cell_id:\\d+}/value') |
vetor = []
i = 1
while(i <= 100):
valor = int(input())
vetor.append(valor)
i = i + 1
print(max(vetor))
print(vetor.index(max(vetor)) + 1) | vetor = []
i = 1
while i <= 100:
valor = int(input())
vetor.append(valor)
i = i + 1
print(max(vetor))
print(vetor.index(max(vetor)) + 1) |
class BasePairType:
def __init__( self, nt1, nt2, Kd, match_lowercase = False ):
'''
Two sequence characters that get matched to base pair, e.g., 'C' and 'G';
and the dissociation constant K_d (in M) associated with initial pair formation.
match_lowercase means match 'x' to 'x', 'y' to 'y', etc.
TODO: also store chemical modification info.
'''
self.nt1 = nt1
self.nt2 = nt2
self.Kd = Kd
self.match_lowercase = ( nt1 == '*' and nt2 == '*' and match_lowercase )
self.flipped = self # needs up be updated later.
def is_match( self, s1, s2 ):
if self.match_lowercase: return ( s1.islower() and s2.islower() and s1 == s2 )
return ( s1 == self.nt1 and s2 == self.nt2 )
def get_tag( self ):
if self.match_lowercase: return 'matchlowercase'
return self.nt1+self.nt2
def setup_base_pair_type( params, nt1, nt2, Kd, match_lowercase = False ):
if not hasattr( params, 'base_pair_types' ): params.base_pair_types = []
bpt1 = BasePairType( nt1, nt2, Kd, match_lowercase = match_lowercase )
params.base_pair_types.append( bpt1 )
if not match_lowercase:
bpt2 = BasePairType( nt2, nt1, Kd, match_lowercase = match_lowercase )
bpt1.flipped = bpt2
bpt2.flipped = bpt1
params.base_pair_types.append( bpt2 )
def get_base_pair_type_for_tag( params, tag ):
if not hasattr( params, 'base_pair_types' ): return None
for base_pair_type in params.base_pair_types:
if (tag == 'matchlowercase' and base_pair_type.match_lowercase) or \
(tag == base_pair_type.nt1 + base_pair_type.nt2 ):
return base_pair_type
#print( 'Could not figure out base_pair_type for ', tag )
return None
def get_base_pair_types_for_tag( params, tag ):
if not hasattr( params, 'base_pair_types' ): return None
if tag == 'WC':
WC_nts = [('C','G'),('G','C'),('A','U'),('U','A')] # ,('G','U'),('U','G')]
base_pair_types = []
for base_pair_type in params.base_pair_types:
if (base_pair_type.nt1,base_pair_type.nt2) in WC_nts:
base_pair_types.append( base_pair_type )
return base_pair_types
else:
return [ get_base_pair_type_for_tag( params, tag ) ]
return None
def initialize_base_pair_types( self ):
self.base_pair_types = []
| class Basepairtype:
def __init__(self, nt1, nt2, Kd, match_lowercase=False):
"""
Two sequence characters that get matched to base pair, e.g., 'C' and 'G';
and the dissociation constant K_d (in M) associated with initial pair formation.
match_lowercase means match 'x' to 'x', 'y' to 'y', etc.
TODO: also store chemical modification info.
"""
self.nt1 = nt1
self.nt2 = nt2
self.Kd = Kd
self.match_lowercase = nt1 == '*' and nt2 == '*' and match_lowercase
self.flipped = self
def is_match(self, s1, s2):
if self.match_lowercase:
return s1.islower() and s2.islower() and (s1 == s2)
return s1 == self.nt1 and s2 == self.nt2
def get_tag(self):
if self.match_lowercase:
return 'matchlowercase'
return self.nt1 + self.nt2
def setup_base_pair_type(params, nt1, nt2, Kd, match_lowercase=False):
if not hasattr(params, 'base_pair_types'):
params.base_pair_types = []
bpt1 = base_pair_type(nt1, nt2, Kd, match_lowercase=match_lowercase)
params.base_pair_types.append(bpt1)
if not match_lowercase:
bpt2 = base_pair_type(nt2, nt1, Kd, match_lowercase=match_lowercase)
bpt1.flipped = bpt2
bpt2.flipped = bpt1
params.base_pair_types.append(bpt2)
def get_base_pair_type_for_tag(params, tag):
if not hasattr(params, 'base_pair_types'):
return None
for base_pair_type in params.base_pair_types:
if tag == 'matchlowercase' and base_pair_type.match_lowercase or tag == base_pair_type.nt1 + base_pair_type.nt2:
return base_pair_type
return None
def get_base_pair_types_for_tag(params, tag):
if not hasattr(params, 'base_pair_types'):
return None
if tag == 'WC':
wc_nts = [('C', 'G'), ('G', 'C'), ('A', 'U'), ('U', 'A')]
base_pair_types = []
for base_pair_type in params.base_pair_types:
if (base_pair_type.nt1, base_pair_type.nt2) in WC_nts:
base_pair_types.append(base_pair_type)
return base_pair_types
else:
return [get_base_pair_type_for_tag(params, tag)]
return None
def initialize_base_pair_types(self):
self.base_pair_types = [] |
#lista de cores para menu:
#cor da letra
limpa = '\033[m'
Lbranco = '\033[30m'
Lvermelho = '\033[31m'
Lverde = '\033[32m'
Lamarelo = '\033[33m'
Lazul = '\033[34m'
Lroxo = '\033[35m'
Lazulclaro = '\033[36'
Lcinza = '\033[37'
#Fundo
Fbranco = '\033[40m'
Fvermelho = '\033[41m'
Fverde = '\033[42m'
Famarelo = '\033[43m'
Fazul = '\033[44m'
Froxo = '\033[45m'
Fazulclaro = '\033[46m'
Fcinza = '\033[46m'
| limpa = '\x1b[m'
lbranco = '\x1b[30m'
lvermelho = '\x1b[31m'
lverde = '\x1b[32m'
lamarelo = '\x1b[33m'
lazul = '\x1b[34m'
lroxo = '\x1b[35m'
lazulclaro = '\x1b[36'
lcinza = '\x1b[37'
fbranco = '\x1b[40m'
fvermelho = '\x1b[41m'
fverde = '\x1b[42m'
famarelo = '\x1b[43m'
fazul = '\x1b[44m'
froxo = '\x1b[45m'
fazulclaro = '\x1b[46m'
fcinza = '\x1b[46m' |
def get_user_id(user_or_id):
if type(user_or_id) is str or type(user_or_id) is int:
return str(user_or_id)
elif hasattr(user_or_id, '__getitem__') and 'user_id' in user_or_id:
return str(user_or_id['user_id'])
elif hasattr(user_or_id, 'user_id'):
return str(user_or_id.user_id)
return None
def truncate_list_length(lst, length, *, add_per_element=0):
total_length = 0
for i, elem in enumerate(lst):
total_length += len(elem) + add_per_element
if total_length > length:
return lst[0:i]
return lst
def mention_users(users, max_count, max_length, *, join="\n", prefix=" - "):
trunc_users = users[0:max_count]
trunc_message = '_...and {} more._'
max_trunc_len = len(str(len(users)))
max_message_len = len(trunc_message.format(' ' * max_trunc_len))
final_max_len = max(0, max_length-max_message_len)
user_strs = truncate_list_length(
[f"{prefix}<@{get_user_id(user)}>" for user in trunc_users],
final_max_len,
add_per_element=len(join)
)
trunc_count = (len(users) - len(trunc_users)) + (len(trunc_users) - len(user_strs))
out_msg = join.join(user_strs) + (trunc_message and join + trunc_message.format(trunc_count) or '')
if (len(out_msg) > max_length) and final_max_len >= 3:
return '...'
elif len(out_msg) > max_length:
return ''
else:
return out_msg
def id_from_mention(mention):
try:
return int(mention.replace('<', '').replace('!', '').replace('>', '').replace('@', ''))
except:
return False
| def get_user_id(user_or_id):
if type(user_or_id) is str or type(user_or_id) is int:
return str(user_or_id)
elif hasattr(user_or_id, '__getitem__') and 'user_id' in user_or_id:
return str(user_or_id['user_id'])
elif hasattr(user_or_id, 'user_id'):
return str(user_or_id.user_id)
return None
def truncate_list_length(lst, length, *, add_per_element=0):
total_length = 0
for (i, elem) in enumerate(lst):
total_length += len(elem) + add_per_element
if total_length > length:
return lst[0:i]
return lst
def mention_users(users, max_count, max_length, *, join='\n', prefix=' - '):
trunc_users = users[0:max_count]
trunc_message = '_...and {} more._'
max_trunc_len = len(str(len(users)))
max_message_len = len(trunc_message.format(' ' * max_trunc_len))
final_max_len = max(0, max_length - max_message_len)
user_strs = truncate_list_length([f'{prefix}<@{get_user_id(user)}>' for user in trunc_users], final_max_len, add_per_element=len(join))
trunc_count = len(users) - len(trunc_users) + (len(trunc_users) - len(user_strs))
out_msg = join.join(user_strs) + (trunc_message and join + trunc_message.format(trunc_count) or '')
if len(out_msg) > max_length and final_max_len >= 3:
return '...'
elif len(out_msg) > max_length:
return ''
else:
return out_msg
def id_from_mention(mention):
try:
return int(mention.replace('<', '').replace('!', '').replace('>', '').replace('@', ''))
except:
return False |
#
# PySNMP MIB module PROXY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PROXY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:33:35 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")
ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Unsigned32, Counter32, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Integer32, iso, Counter64, ObjectIdentity, MibIdentifier, IpAddress, NotificationType, TimeTicks, Bits, experimental = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Counter32", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Integer32", "iso", "Counter64", "ObjectIdentity", "MibIdentifier", "IpAddress", "NotificationType", "TimeTicks", "Bits", "experimental")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
nsfnet = MibIdentifier((1, 3, 6, 1, 3, 25))
proxy = ModuleIdentity((1, 3, 6, 1, 3, 25, 17))
proxy.setRevisions(('1998-08-26 00:00',))
if mibBuilder.loadTexts: proxy.setLastUpdated('9809010000Z')
if mibBuilder.loadTexts: proxy.setOrganization('National Laboratory for Applied Network Research')
proxySystem = MibIdentifier((1, 3, 6, 1, 3, 25, 17, 1))
proxyConfig = MibIdentifier((1, 3, 6, 1, 3, 25, 17, 2))
proxyPerf = MibIdentifier((1, 3, 6, 1, 3, 25, 17, 3))
proxyMemUsage = MibScalar((1, 3, 6, 1, 3, 25, 17, 1, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyMemUsage.setStatus('current')
proxyStorage = MibScalar((1, 3, 6, 1, 3, 25, 17, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyStorage.setStatus('current')
proxyCpuUsage = MibScalar((1, 3, 6, 1, 3, 25, 17, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyCpuUsage.setStatus('current')
proxyUpTime = MibScalar((1, 3, 6, 1, 3, 25, 17, 1, 4), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyUpTime.setStatus('current')
proxyAdmin = MibScalar((1, 3, 6, 1, 3, 25, 17, 2, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyAdmin.setStatus('current')
proxySoftware = MibScalar((1, 3, 6, 1, 3, 25, 17, 2, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxySoftware.setStatus('current')
proxyVersion = MibScalar((1, 3, 6, 1, 3, 25, 17, 2, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyVersion.setStatus('current')
proxySysPerf = MibIdentifier((1, 3, 6, 1, 3, 25, 17, 3, 1))
proxyProtoPerf = MibIdentifier((1, 3, 6, 1, 3, 25, 17, 3, 2))
proxyCpuLoad = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 1, 1), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyCpuLoad.setStatus('current')
proxyNumObjects = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyNumObjects.setStatus('current')
proxyProtoClient = MibIdentifier((1, 3, 6, 1, 3, 25, 17, 3, 2, 1))
proxyProtoServer = MibIdentifier((1, 3, 6, 1, 3, 25, 17, 3, 2, 2))
proxyClientHttpRequests = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyClientHttpRequests.setStatus('current')
proxyClientHttpHits = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyClientHttpHits.setStatus('current')
proxyClientHttpErrors = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyClientHttpErrors.setStatus('current')
proxyClientHttpInKbs = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyClientHttpInKbs.setStatus('current')
proxyClientHttpOutKbs = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyClientHttpOutKbs.setStatus('current')
proxyServerHttpRequests = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyServerHttpRequests.setStatus('current')
proxyServerHttpErrors = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyServerHttpErrors.setStatus('current')
proxyServerHttpInKbs = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyServerHttpInKbs.setStatus('current')
proxyServerHttpOutKbs = MibScalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyServerHttpOutKbs.setStatus('current')
proxyMedianSvcTable = MibTable((1, 3, 6, 1, 3, 25, 17, 3, 3), )
if mibBuilder.loadTexts: proxyMedianSvcTable.setStatus('current')
proxyMedianSvcEntry = MibTableRow((1, 3, 6, 1, 3, 25, 17, 3, 3, 1), ).setIndexNames((0, "PROXY-MIB", "proxyMedianTime"))
if mibBuilder.loadTexts: proxyMedianSvcEntry.setStatus('current')
proxyMedianTime = MibTableColumn((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyMedianTime.setStatus('current')
proxyHTTPAllSvcTime = MibTableColumn((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyHTTPAllSvcTime.setStatus('current')
proxyHTTPMissSvcTime = MibTableColumn((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyHTTPMissSvcTime.setStatus('current')
proxyHTTPHitSvcTime = MibTableColumn((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyHTTPHitSvcTime.setStatus('current')
proxyHTTPNhSvcTime = MibTableColumn((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyHTTPNhSvcTime.setStatus('current')
proxyDnsSvcTime = MibTableColumn((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: proxyDnsSvcTime.setStatus('current')
mibBuilder.exportSymbols("PROXY-MIB", proxyStorage=proxyStorage, proxyMemUsage=proxyMemUsage, proxyServerHttpInKbs=proxyServerHttpInKbs, proxySystem=proxySystem, proxyAdmin=proxyAdmin, nsfnet=nsfnet, proxyHTTPHitSvcTime=proxyHTTPHitSvcTime, proxyUpTime=proxyUpTime, proxySoftware=proxySoftware, proxyClientHttpRequests=proxyClientHttpRequests, proxyServerHttpOutKbs=proxyServerHttpOutKbs, proxy=proxy, proxyPerf=proxyPerf, proxyProtoServer=proxyProtoServer, proxyProtoPerf=proxyProtoPerf, proxyNumObjects=proxyNumObjects, proxyDnsSvcTime=proxyDnsSvcTime, proxyMedianSvcEntry=proxyMedianSvcEntry, proxyHTTPAllSvcTime=proxyHTTPAllSvcTime, proxyConfig=proxyConfig, proxyMedianSvcTable=proxyMedianSvcTable, proxySysPerf=proxySysPerf, PYSNMP_MODULE_ID=proxy, proxyMedianTime=proxyMedianTime, proxyHTTPMissSvcTime=proxyHTTPMissSvcTime, proxyClientHttpOutKbs=proxyClientHttpOutKbs, proxyClientHttpInKbs=proxyClientHttpInKbs, proxyClientHttpErrors=proxyClientHttpErrors, proxyProtoClient=proxyProtoClient, proxyServerHttpErrors=proxyServerHttpErrors, proxyCpuLoad=proxyCpuLoad, proxyCpuUsage=proxyCpuUsage, proxyClientHttpHits=proxyClientHttpHits, proxyServerHttpRequests=proxyServerHttpRequests, proxyVersion=proxyVersion, proxyHTTPNhSvcTime=proxyHTTPNhSvcTime)
| (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, single_value_constraint, value_size_constraint, value_range_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(unsigned32, counter32, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, integer32, iso, counter64, object_identity, mib_identifier, ip_address, notification_type, time_ticks, bits, experimental) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'Counter32', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'Integer32', 'iso', 'Counter64', 'ObjectIdentity', 'MibIdentifier', 'IpAddress', 'NotificationType', 'TimeTicks', 'Bits', 'experimental')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
nsfnet = mib_identifier((1, 3, 6, 1, 3, 25))
proxy = module_identity((1, 3, 6, 1, 3, 25, 17))
proxy.setRevisions(('1998-08-26 00:00',))
if mibBuilder.loadTexts:
proxy.setLastUpdated('9809010000Z')
if mibBuilder.loadTexts:
proxy.setOrganization('National Laboratory for Applied Network Research')
proxy_system = mib_identifier((1, 3, 6, 1, 3, 25, 17, 1))
proxy_config = mib_identifier((1, 3, 6, 1, 3, 25, 17, 2))
proxy_perf = mib_identifier((1, 3, 6, 1, 3, 25, 17, 3))
proxy_mem_usage = mib_scalar((1, 3, 6, 1, 3, 25, 17, 1, 1), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyMemUsage.setStatus('current')
proxy_storage = mib_scalar((1, 3, 6, 1, 3, 25, 17, 1, 2), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyStorage.setStatus('current')
proxy_cpu_usage = mib_scalar((1, 3, 6, 1, 3, 25, 17, 1, 3), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyCpuUsage.setStatus('current')
proxy_up_time = mib_scalar((1, 3, 6, 1, 3, 25, 17, 1, 4), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyUpTime.setStatus('current')
proxy_admin = mib_scalar((1, 3, 6, 1, 3, 25, 17, 2, 1), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyAdmin.setStatus('current')
proxy_software = mib_scalar((1, 3, 6, 1, 3, 25, 17, 2, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxySoftware.setStatus('current')
proxy_version = mib_scalar((1, 3, 6, 1, 3, 25, 17, 2, 3), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyVersion.setStatus('current')
proxy_sys_perf = mib_identifier((1, 3, 6, 1, 3, 25, 17, 3, 1))
proxy_proto_perf = mib_identifier((1, 3, 6, 1, 3, 25, 17, 3, 2))
proxy_cpu_load = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 1, 1), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyCpuLoad.setStatus('current')
proxy_num_objects = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyNumObjects.setStatus('current')
proxy_proto_client = mib_identifier((1, 3, 6, 1, 3, 25, 17, 3, 2, 1))
proxy_proto_server = mib_identifier((1, 3, 6, 1, 3, 25, 17, 3, 2, 2))
proxy_client_http_requests = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 1), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyClientHttpRequests.setStatus('current')
proxy_client_http_hits = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyClientHttpHits.setStatus('current')
proxy_client_http_errors = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyClientHttpErrors.setStatus('current')
proxy_client_http_in_kbs = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyClientHttpInKbs.setStatus('current')
proxy_client_http_out_kbs = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyClientHttpOutKbs.setStatus('current')
proxy_server_http_requests = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 1), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyServerHttpRequests.setStatus('current')
proxy_server_http_errors = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyServerHttpErrors.setStatus('current')
proxy_server_http_in_kbs = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyServerHttpInKbs.setStatus('current')
proxy_server_http_out_kbs = mib_scalar((1, 3, 6, 1, 3, 25, 17, 3, 2, 2, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyServerHttpOutKbs.setStatus('current')
proxy_median_svc_table = mib_table((1, 3, 6, 1, 3, 25, 17, 3, 3))
if mibBuilder.loadTexts:
proxyMedianSvcTable.setStatus('current')
proxy_median_svc_entry = mib_table_row((1, 3, 6, 1, 3, 25, 17, 3, 3, 1)).setIndexNames((0, 'PROXY-MIB', 'proxyMedianTime'))
if mibBuilder.loadTexts:
proxyMedianSvcEntry.setStatus('current')
proxy_median_time = mib_table_column((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyMedianTime.setStatus('current')
proxy_http_all_svc_time = mib_table_column((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyHTTPAllSvcTime.setStatus('current')
proxy_http_miss_svc_time = mib_table_column((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyHTTPMissSvcTime.setStatus('current')
proxy_http_hit_svc_time = mib_table_column((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyHTTPHitSvcTime.setStatus('current')
proxy_http_nh_svc_time = mib_table_column((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyHTTPNhSvcTime.setStatus('current')
proxy_dns_svc_time = mib_table_column((1, 3, 6, 1, 3, 25, 17, 3, 3, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
proxyDnsSvcTime.setStatus('current')
mibBuilder.exportSymbols('PROXY-MIB', proxyStorage=proxyStorage, proxyMemUsage=proxyMemUsage, proxyServerHttpInKbs=proxyServerHttpInKbs, proxySystem=proxySystem, proxyAdmin=proxyAdmin, nsfnet=nsfnet, proxyHTTPHitSvcTime=proxyHTTPHitSvcTime, proxyUpTime=proxyUpTime, proxySoftware=proxySoftware, proxyClientHttpRequests=proxyClientHttpRequests, proxyServerHttpOutKbs=proxyServerHttpOutKbs, proxy=proxy, proxyPerf=proxyPerf, proxyProtoServer=proxyProtoServer, proxyProtoPerf=proxyProtoPerf, proxyNumObjects=proxyNumObjects, proxyDnsSvcTime=proxyDnsSvcTime, proxyMedianSvcEntry=proxyMedianSvcEntry, proxyHTTPAllSvcTime=proxyHTTPAllSvcTime, proxyConfig=proxyConfig, proxyMedianSvcTable=proxyMedianSvcTable, proxySysPerf=proxySysPerf, PYSNMP_MODULE_ID=proxy, proxyMedianTime=proxyMedianTime, proxyHTTPMissSvcTime=proxyHTTPMissSvcTime, proxyClientHttpOutKbs=proxyClientHttpOutKbs, proxyClientHttpInKbs=proxyClientHttpInKbs, proxyClientHttpErrors=proxyClientHttpErrors, proxyProtoClient=proxyProtoClient, proxyServerHttpErrors=proxyServerHttpErrors, proxyCpuLoad=proxyCpuLoad, proxyCpuUsage=proxyCpuUsage, proxyClientHttpHits=proxyClientHttpHits, proxyServerHttpRequests=proxyServerHttpRequests, proxyVersion=proxyVersion, proxyHTTPNhSvcTime=proxyHTTPNhSvcTime) |
def removcaract(cnpj):
documento = []
for x in cnpj:
if x.isnumeric():
documento.append(x)
documento = ''.join(documento)
return documento
| def removcaract(cnpj):
documento = []
for x in cnpj:
if x.isnumeric():
documento.append(x)
documento = ''.join(documento)
return documento |
class Solution:
def smallestDivisor(self, nums: List[int], threshold: int) -> int:
def condition(divisor) -> bool:
return sum((num - 1) // divisor + 1 for num in nums) <= threshold
lo, hi = 1, max(nums)
while lo < hi:
mid = lo + (hi - lo) // 2
if condition(mid):
hi = mid
else:
lo = mid + 1
return lo
| class Solution:
def smallest_divisor(self, nums: List[int], threshold: int) -> int:
def condition(divisor) -> bool:
return sum(((num - 1) // divisor + 1 for num in nums)) <= threshold
(lo, hi) = (1, max(nums))
while lo < hi:
mid = lo + (hi - lo) // 2
if condition(mid):
hi = mid
else:
lo = mid + 1
return lo |
def parse_eval_info(cur_eval_video_info):
length_eval_info = len(cur_eval_video_info)
cur_epoch = int(cur_eval_video_info[0].split(' ')[2].split('-')[1])
cur_video_auc = float(cur_eval_video_info[-1].split(' ')[-3].split('-')[1].split(',')[0])
return cur_epoch, cur_video_auc
file = '/home/mry/Desktop/seed-23197-time-31-Aug-at-07-35-19.log'
fr = open(file, 'r')
a = fr.readlines()
real_result_files_line = a[232:]
train_log_length_first = 11
train_log_length_common = 9
eval_log_length_list = [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
total_nme_print_length = 1
deliema_line_length = 1
final_block_line_list = []
per_num_length_first = (train_log_length_first + total_nme_print_length + deliema_line_length + sum(eval_log_length_list))
per_num_length_common = (train_log_length_common + total_nme_print_length + deliema_line_length + sum(eval_log_length_list))
epoch_num = 1 + (len(real_result_files_line)-per_num_length_first) // per_num_length_common
log_eval_info_list = []
model_count = 0
for epoch in range(epoch_num):
if epoch % 10 ==0:
start = per_num_length_first*model_count + per_num_length_common*(epoch-model_count)
end = start + per_num_length_first
all_info_of_curepoch = real_result_files_line[start : end]
#all_info_of_curepoch = real_result_files_line[epoch * per_num_length_first:epoch * per_num_length_first + per_num_length_first]
eval_info = all_info_of_curepoch[train_log_length_first:]
model_count += 1
else:
start = per_num_length_first*model_count + per_num_length_common*(epoch-model_count)
end = start + per_num_length_common
all_info_of_curepoch = real_result_files_line[start : end]
eval_info = all_info_of_curepoch[train_log_length_common:]
cur_epoch_dict = {}
cur_auc_list = []
video_info_dict = {}
vd_epoch = -1
for eval_video_id in range(len(eval_log_length_list)):
cur_eval_video_info = eval_info[eval_video_id*eval_log_length_list[eval_video_id]:(eval_video_id+1)*eval_log_length_list[eval_video_id]]
cur_epoch, cur_auc = parse_eval_info(cur_eval_video_info)
cur_auc_list.append(cur_auc)
vd_epoch = cur_epoch
cur_nme_list = [float(i) for i in eval_info[-2].strip().split(':')[1].split(',')]
video_info_dict['NME_total'] = cur_nme_list
video_info_dict['AUC0.08error'] = cur_auc_list
cur_epoch_dict[vd_epoch] = video_info_dict
log_eval_info_list.append(cur_epoch_dict)
pass
| def parse_eval_info(cur_eval_video_info):
length_eval_info = len(cur_eval_video_info)
cur_epoch = int(cur_eval_video_info[0].split(' ')[2].split('-')[1])
cur_video_auc = float(cur_eval_video_info[-1].split(' ')[-3].split('-')[1].split(',')[0])
return (cur_epoch, cur_video_auc)
file = '/home/mry/Desktop/seed-23197-time-31-Aug-at-07-35-19.log'
fr = open(file, 'r')
a = fr.readlines()
real_result_files_line = a[232:]
train_log_length_first = 11
train_log_length_common = 9
eval_log_length_list = [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
total_nme_print_length = 1
deliema_line_length = 1
final_block_line_list = []
per_num_length_first = train_log_length_first + total_nme_print_length + deliema_line_length + sum(eval_log_length_list)
per_num_length_common = train_log_length_common + total_nme_print_length + deliema_line_length + sum(eval_log_length_list)
epoch_num = 1 + (len(real_result_files_line) - per_num_length_first) // per_num_length_common
log_eval_info_list = []
model_count = 0
for epoch in range(epoch_num):
if epoch % 10 == 0:
start = per_num_length_first * model_count + per_num_length_common * (epoch - model_count)
end = start + per_num_length_first
all_info_of_curepoch = real_result_files_line[start:end]
eval_info = all_info_of_curepoch[train_log_length_first:]
model_count += 1
else:
start = per_num_length_first * model_count + per_num_length_common * (epoch - model_count)
end = start + per_num_length_common
all_info_of_curepoch = real_result_files_line[start:end]
eval_info = all_info_of_curepoch[train_log_length_common:]
cur_epoch_dict = {}
cur_auc_list = []
video_info_dict = {}
vd_epoch = -1
for eval_video_id in range(len(eval_log_length_list)):
cur_eval_video_info = eval_info[eval_video_id * eval_log_length_list[eval_video_id]:(eval_video_id + 1) * eval_log_length_list[eval_video_id]]
(cur_epoch, cur_auc) = parse_eval_info(cur_eval_video_info)
cur_auc_list.append(cur_auc)
vd_epoch = cur_epoch
cur_nme_list = [float(i) for i in eval_info[-2].strip().split(':')[1].split(',')]
video_info_dict['NME_total'] = cur_nme_list
video_info_dict['AUC0.08error'] = cur_auc_list
cur_epoch_dict[vd_epoch] = video_info_dict
log_eval_info_list.append(cur_epoch_dict)
pass |
class ExitMixin():
def do_exit(self, _):
'''
Exit the shell.
'''
print(self._exit_msg)
return True
def do_EOF(self, params):
print()
return self.do_exit(params)
| class Exitmixin:
def do_exit(self, _):
"""
Exit the shell.
"""
print(self._exit_msg)
return True
def do_eof(self, params):
print()
return self.do_exit(params) |
class Solution:
def calculateSum(self, N, A, B):
A_count = N//A
B_count = N//B
result = A*A_count*(1+A_count)//2 + B*B_count*(1+B_count)//2
a = min(A,B)
b = max(A,B)
while a > 0:
b, a= a, b%a
lcm = (A*B)//b
AB_count = (N - N%lcm)//lcm
return result - lcm*AB_count*(1+AB_count)//2
if __name__ == '__main__':
t = int(input())
for _ in range(t):
N,A,B = map(int,input().strip().split())
ob = Solution()
ans = ob.calculateSum(N, A, B)
print(ans) | class Solution:
def calculate_sum(self, N, A, B):
a_count = N // A
b_count = N // B
result = A * A_count * (1 + A_count) // 2 + B * B_count * (1 + B_count) // 2
a = min(A, B)
b = max(A, B)
while a > 0:
(b, a) = (a, b % a)
lcm = A * B // b
ab_count = (N - N % lcm) // lcm
return result - lcm * AB_count * (1 + AB_count) // 2
if __name__ == '__main__':
t = int(input())
for _ in range(t):
(n, a, b) = map(int, input().strip().split())
ob = solution()
ans = ob.calculateSum(N, A, B)
print(ans) |
def findDecision(obj): #obj[0]: Passanger, obj[1]: Weather, obj[2]: Time, obj[3]: Coupon, obj[4]: Coupon_validity, obj[5]: Gender, obj[6]: Age, obj[7]: Children, obj[8]: Education, obj[9]: Occupation, obj[10]: Income, obj[11]: Bar, obj[12]: Coffeehouse, obj[13]: Restaurant20to50, obj[14]: Direction_same, obj[15]: Distance
# {"feature": "Education", "instances": 85, "metric_value": 0.9774, "depth": 1}
if obj[8]<=2:
# {"feature": "Age", "instances": 68, "metric_value": 0.9944, "depth": 2}
if obj[6]<=5:
# {"feature": "Passanger", "instances": 60, "metric_value": 1.0, "depth": 3}
if obj[0]<=2:
# {"feature": "Occupation", "instances": 45, "metric_value": 0.9825, "depth": 4}
if obj[9]<=17:
# {"feature": "Bar", "instances": 42, "metric_value": 0.9587, "depth": 5}
if obj[11]<=3.0:
# {"feature": "Time", "instances": 40, "metric_value": 0.9341, "depth": 6}
if obj[2]<=3:
# {"feature": "Coupon_validity", "instances": 32, "metric_value": 0.8571, "depth": 7}
if obj[4]<=0:
# {"feature": "Coupon", "instances": 17, "metric_value": 0.9774, "depth": 8}
if obj[3]<=2:
# {"feature": "Children", "instances": 10, "metric_value": 0.7219, "depth": 9}
if obj[7]<=0:
return 'False'
elif obj[7]>0:
# {"feature": "Weather", "instances": 4, "metric_value": 1.0, "depth": 10}
if obj[1]<=0:
return 'False'
elif obj[1]>0:
return 'True'
else: return 'True'
else: return 'False'
elif obj[3]>2:
# {"feature": "Weather", "instances": 7, "metric_value": 0.8631, "depth": 9}
if obj[1]<=0:
# {"feature": "Coffeehouse", "instances": 5, "metric_value": 0.971, "depth": 10}
if obj[12]<=1.0:
# {"feature": "Income", "instances": 4, "metric_value": 0.8113, "depth": 11}
if obj[10]>2:
return 'True'
elif obj[10]<=2:
# {"feature": "Direction_same", "instances": 2, "metric_value": 1.0, "depth": 12}
if obj[14]<=0:
return 'False'
elif obj[14]>0:
return 'True'
else: return 'True'
else: return 'False'
elif obj[12]>1.0:
return 'False'
else: return 'False'
elif obj[1]>0:
return 'True'
else: return 'True'
else: return 'True'
elif obj[4]>0:
# {"feature": "Income", "instances": 15, "metric_value": 0.5665, "depth": 8}
if obj[10]<=5:
return 'False'
elif obj[10]>5:
# {"feature": "Coupon", "instances": 6, "metric_value": 0.9183, "depth": 9}
if obj[3]>2:
return 'False'
elif obj[3]<=2:
return 'True'
else: return 'True'
else: return 'False'
else: return 'False'
elif obj[2]>3:
# {"feature": "Restaurant20to50", "instances": 8, "metric_value": 0.9544, "depth": 7}
if obj[13]<=1.0:
# {"feature": "Coffeehouse", "instances": 5, "metric_value": 0.971, "depth": 8}
if obj[12]<=1.0:
return 'False'
elif obj[12]>1.0:
return 'True'
else: return 'True'
elif obj[13]>1.0:
return 'True'
else: return 'True'
else: return 'True'
elif obj[11]>3.0:
return 'True'
else: return 'True'
elif obj[9]>17:
return 'True'
else: return 'True'
elif obj[0]>2:
# {"feature": "Occupation", "instances": 15, "metric_value": 0.8366, "depth": 4}
if obj[9]<=10:
# {"feature": "Income", "instances": 13, "metric_value": 0.6194, "depth": 5}
if obj[10]>0:
return 'True'
elif obj[10]<=0:
# {"feature": "Coupon_validity", "instances": 3, "metric_value": 0.9183, "depth": 6}
if obj[4]>0:
return 'False'
elif obj[4]<=0:
return 'True'
else: return 'True'
else: return 'False'
elif obj[9]>10:
return 'False'
else: return 'False'
else: return 'True'
elif obj[6]>5:
# {"feature": "Time", "instances": 8, "metric_value": 0.5436, "depth": 3}
if obj[2]<=1:
return 'True'
elif obj[2]>1:
return 'False'
else: return 'False'
else: return 'True'
elif obj[8]>2:
# {"feature": "Occupation", "instances": 17, "metric_value": 0.7871, "depth": 2}
if obj[9]<=20:
# {"feature": "Coupon_validity", "instances": 16, "metric_value": 0.6962, "depth": 3}
if obj[4]<=0:
return 'True'
elif obj[4]>0:
# {"feature": "Time", "instances": 8, "metric_value": 0.9544, "depth": 4}
if obj[2]<=1:
# {"feature": "Coffeehouse", "instances": 5, "metric_value": 0.971, "depth": 5}
if obj[12]>1.0:
# {"feature": "Passanger", "instances": 3, "metric_value": 0.9183, "depth": 6}
if obj[0]<=1:
return 'True'
elif obj[0]>1:
return 'False'
else: return 'False'
elif obj[12]<=1.0:
return 'False'
else: return 'False'
elif obj[2]>1:
return 'True'
else: return 'True'
else: return 'True'
elif obj[9]>20:
return 'False'
else: return 'False'
else: return 'True'
| def find_decision(obj):
if obj[8] <= 2:
if obj[6] <= 5:
if obj[0] <= 2:
if obj[9] <= 17:
if obj[11] <= 3.0:
if obj[2] <= 3:
if obj[4] <= 0:
if obj[3] <= 2:
if obj[7] <= 0:
return 'False'
elif obj[7] > 0:
if obj[1] <= 0:
return 'False'
elif obj[1] > 0:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[3] > 2:
if obj[1] <= 0:
if obj[12] <= 1.0:
if obj[10] > 2:
return 'True'
elif obj[10] <= 2:
if obj[14] <= 0:
return 'False'
elif obj[14] > 0:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[12] > 1.0:
return 'False'
else:
return 'False'
elif obj[1] > 0:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[4] > 0:
if obj[10] <= 5:
return 'False'
elif obj[10] > 5:
if obj[3] > 2:
return 'False'
elif obj[3] <= 2:
return 'True'
else:
return 'True'
else:
return 'False'
else:
return 'False'
elif obj[2] > 3:
if obj[13] <= 1.0:
if obj[12] <= 1.0:
return 'False'
elif obj[12] > 1.0:
return 'True'
else:
return 'True'
elif obj[13] > 1.0:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[11] > 3.0:
return 'True'
else:
return 'True'
elif obj[9] > 17:
return 'True'
else:
return 'True'
elif obj[0] > 2:
if obj[9] <= 10:
if obj[10] > 0:
return 'True'
elif obj[10] <= 0:
if obj[4] > 0:
return 'False'
elif obj[4] <= 0:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[9] > 10:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[6] > 5:
if obj[2] <= 1:
return 'True'
elif obj[2] > 1:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[8] > 2:
if obj[9] <= 20:
if obj[4] <= 0:
return 'True'
elif obj[4] > 0:
if obj[2] <= 1:
if obj[12] > 1.0:
if obj[0] <= 1:
return 'True'
elif obj[0] > 1:
return 'False'
else:
return 'False'
elif obj[12] <= 1.0:
return 'False'
else:
return 'False'
elif obj[2] > 1:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[9] > 20:
return 'False'
else:
return 'False'
else:
return 'True' |
class Cup:
def __init__(self,size,quantity):
self.size = size
self.quantity = quantity
def status(self):
return self.size-self.quantity
def fill(self, quantity):
if self.quantity<=self.status():
self.quantity+=quantity
cup = Cup(100, 50)
print(cup.status())
cup.fill(40)
cup.fill(20)
print(cup.status())
| class Cup:
def __init__(self, size, quantity):
self.size = size
self.quantity = quantity
def status(self):
return self.size - self.quantity
def fill(self, quantity):
if self.quantity <= self.status():
self.quantity += quantity
cup = cup(100, 50)
print(cup.status())
cup.fill(40)
cup.fill(20)
print(cup.status()) |
class BinaryConfusionMatrix:
def __init__(self, pos_tag="SPAM", neg_tag="OK"):
self.pos_tag = pos_tag
self.neg_tag = neg_tag
self.tp = 0
self.tn = 0
self.fp = 0
self.fn = 0
def as_dict(self):
return {"tp": self.tp, "tn": self.tn, "fp": self.fp, "fn": self.fn}
def _is_correct_values(self, value1, value2):
correct_values = [self.pos_tag, self.neg_tag]
return value1 in correct_values and value2 in correct_values
def update(self, truth, prediction):
if not self._is_correct_values(truth, prediction):
raise ValueError()
if truth == self.pos_tag:
if prediction == self.pos_tag:
self.tp += 1
else:
self.fn += 1
else:
if prediction == self.neg_tag:
self.tn += 1
else:
self.fp += 1
def compute_from_dicts(self, truth_dict, pred_dict):
for filename, truth in truth_dict.items():
self.update(truth, pred_dict[filename])
def quality_score(self, tp, tn, fp, fn):
return (tp + tn) / (tp + tn + 10 * fp + fn)
| class Binaryconfusionmatrix:
def __init__(self, pos_tag='SPAM', neg_tag='OK'):
self.pos_tag = pos_tag
self.neg_tag = neg_tag
self.tp = 0
self.tn = 0
self.fp = 0
self.fn = 0
def as_dict(self):
return {'tp': self.tp, 'tn': self.tn, 'fp': self.fp, 'fn': self.fn}
def _is_correct_values(self, value1, value2):
correct_values = [self.pos_tag, self.neg_tag]
return value1 in correct_values and value2 in correct_values
def update(self, truth, prediction):
if not self._is_correct_values(truth, prediction):
raise value_error()
if truth == self.pos_tag:
if prediction == self.pos_tag:
self.tp += 1
else:
self.fn += 1
elif prediction == self.neg_tag:
self.tn += 1
else:
self.fp += 1
def compute_from_dicts(self, truth_dict, pred_dict):
for (filename, truth) in truth_dict.items():
self.update(truth, pred_dict[filename])
def quality_score(self, tp, tn, fp, fn):
return (tp + tn) / (tp + tn + 10 * fp + fn) |
def karp_rabin(text, word, n, m):
MOD = 257
A = random.randint(2, MOD - 1)
Am = pow(A, m, MOD)
def generate(t):
return sum(ord(c) * pow(A, i, MOD) for i, c in enumerate(t[::-1])) % MOD
text += '$'
hash_text, hash_word = generate(text[1:m + 1]), generate(word[1:])
for i in range(1, n - m + 2):
if hash_text == hash_word and text[i:i + m] == word[1:]:
yield i
hash_text = (A * hash_text + ord(text[i + m]) - Am * ord(text[i])) % MOD
| def karp_rabin(text, word, n, m):
mod = 257
a = random.randint(2, MOD - 1)
am = pow(A, m, MOD)
def generate(t):
return sum((ord(c) * pow(A, i, MOD) for (i, c) in enumerate(t[::-1]))) % MOD
text += '$'
(hash_text, hash_word) = (generate(text[1:m + 1]), generate(word[1:]))
for i in range(1, n - m + 2):
if hash_text == hash_word and text[i:i + m] == word[1:]:
yield i
hash_text = (A * hash_text + ord(text[i + m]) - Am * ord(text[i])) % MOD |
n = 1000000
# n = 100
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * p, n+1, p):
prime[i] = False
p += 1
primes = []
for i in range(2,n+1):
if prime[i]:
primes.append(i)
count = 0
ans = 0
for index,elem in enumerate(primes):
sum = 0
temp = 0
for i in range(index,len(primes)):
sum += primes[i]
temp +=1
if sum > n:
break
if prime[sum]:
if count < temp:
ans = sum
count = temp
print(ans,count) | n = 1000000
prime = [True for i in range(n + 1)]
p = 2
while p * p <= n:
if prime[p] == True:
for i in range(p * p, n + 1, p):
prime[i] = False
p += 1
primes = []
for i in range(2, n + 1):
if prime[i]:
primes.append(i)
count = 0
ans = 0
for (index, elem) in enumerate(primes):
sum = 0
temp = 0
for i in range(index, len(primes)):
sum += primes[i]
temp += 1
if sum > n:
break
if prime[sum]:
if count < temp:
ans = sum
count = temp
print(ans, count) |
STARLARK_BINARY_PATH = {
"java": "external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark",
"go": "external/net_starlark_go/cmd/starlark/*/starlark",
"rust": "external/starlark-rust/target/debug/starlark-repl",
}
STARLARK_TESTDATA_PATH = "test_suite/"
| starlark_binary_path = {'java': 'external/io_bazel/src/main/java/net/starlark/java/cmd/Starlark', 'go': 'external/net_starlark_go/cmd/starlark/*/starlark', 'rust': 'external/starlark-rust/target/debug/starlark-repl'}
starlark_testdata_path = 'test_suite/' |
#
# @lc app=leetcode id=868 lang=python3
#
# [868] Binary Gap
#
# @lc code=start
class Solution:
def binaryGap(self, N: int) -> int:
s = bin(N)
res = 0
i = float('inf')
for j, n in enumerate(s[2:]):
if n == '1':
res = max(res, j - i)
i = j
return res
# @lc code=end
| class Solution:
def binary_gap(self, N: int) -> int:
s = bin(N)
res = 0
i = float('inf')
for (j, n) in enumerate(s[2:]):
if n == '1':
res = max(res, j - i)
i = j
return res |
class Solution:
def convertToBase7(self, num: int) -> str:
result = ''
n = abs(num)
while n:
n, curr = divmod(n, 7)
result = str(curr) + result
return '-' * (num < 0) + result or '0'
| class Solution:
def convert_to_base7(self, num: int) -> str:
result = ''
n = abs(num)
while n:
(n, curr) = divmod(n, 7)
result = str(curr) + result
return '-' * (num < 0) + result or '0' |
start = int(input())
stop = int(input())
result = ""
for number in range(start, stop + 1):
print(chr(number), end=" ")
| start = int(input())
stop = int(input())
result = ''
for number in range(start, stop + 1):
print(chr(number), end=' ') |
H, W = map(int, input().split())
field = [[str(i) for i in input()] for _ in range(H)]
count = 0
for x in range(W-1):
for y in range(H-1):
black_num = 0
for x1, y1 in [(x, y), (x+1, y), (x, y+1), (x+1, y+1)]:
if field[y1][x1] == '#':
black_num += 1
if black_num % 2 == 1:
count += 1
print(count)
| (h, w) = map(int, input().split())
field = [[str(i) for i in input()] for _ in range(H)]
count = 0
for x in range(W - 1):
for y in range(H - 1):
black_num = 0
for (x1, y1) in [(x, y), (x + 1, y), (x, y + 1), (x + 1, y + 1)]:
if field[y1][x1] == '#':
black_num += 1
if black_num % 2 == 1:
count += 1
print(count) |
GET_REPOS = [
{
'name': 'sample_repo',
'nameWithOwner': 'example_org/sample_repo',
'primaryLanguage': {
'name': 'Python',
},
'url': 'https://github.com/example_org/sample_repo',
'sshUrl': '[email protected]:example_org/sample_repo.git',
'createdAt': '2011-02-15T18:40:15Z',
'description': 'My description',
'updatedAt': '2020-01-02T20:10:09Z',
'homepageUrl': '',
'languages': {
'totalCount': 1,
'nodes': [
{'name': 'Python'},
],
},
'defaultBranchRef': {
'name': 'master',
'id': 'branch_ref_id==',
},
'isPrivate': True,
'isArchived': False,
'isDisabled': False,
'isLocked': True,
'owner': {
'url': 'https://github.com/example_org',
'login': 'example_org',
'__typename': 'Organization',
},
'collaborators': {'edges': [], 'nodes': []},
'requirements': {'text': 'cartography\nhttplib2<0.7.0\njinja2\nlxml\n-e git+https://example.com#egg=foobar\nhttps://example.com/foobar.tar.gz\npip @ https://github.com/pypa/pip/archive/1.3.1.zip#sha1=da9234ee9982d4bbb3c72346a6de940a148ea686\n'}, # noqa
}, {
'name': 'SampleRepo2',
'nameWithOwner': 'example_org/SampleRepo2',
'primaryLanguage': {
'name': 'Python',
},
'url': 'https://github.com/example_org/SampleRepo2',
'sshUrl': '[email protected]:example_org/SampleRepo2.git',
'createdAt': '2011-09-21T18:55:16Z',
'description': 'Some other description',
'updatedAt': '2020-07-03T00:25:25Z',
'homepageUrl': 'http://example.com/',
'languages': {
'totalCount': 1,
'nodes': [
{'name': 'Python'},
],
},
'defaultBranchRef': {
'name': 'master',
'id': 'other_branch_ref_id==',
},
'isPrivate': False,
'isArchived': False,
'isDisabled': False,
'isLocked': False,
'owner': {
'url': 'https://github.com/example_org',
'login': 'example_org', '__typename': 'Organization',
},
'collaborators': None,
'requirements': None,
},
{
'name': 'cartography',
'nameWithOwner': 'lyft/cartography',
'primaryLanguage': {'name': 'Python'},
'url': 'https://github.com/lyft/cartography',
'sshUrl': '[email protected]:lyft/cartography.git',
'createdAt': '2019-02-27T00:16:29Z',
'description': 'One graph to rule them all',
'updatedAt': '2020-09-02T18:35:17Z',
'homepageUrl': '',
'languages': {
'totalCount': 2,
'nodes': [{'name': 'Python'}, {'name': 'Makefile'}],
},
'defaultBranchRef': {
'name': 'master',
'id': 'putsomethinghere',
},
'isPrivate': False,
'isArchived': False,
'isDisabled': False,
'isLocked': False,
'owner': {
'url': 'https://github.com/example_org',
'login': 'example_org',
'__typename': 'Organization',
},
'collaborators': {
'edges': [
{'permission': 'WRITE'},
{'permission': 'WRITE'},
{'permission': 'WRITE'},
{'permission': 'WRITE'},
{'permission': 'WRITE'},
],
'nodes': [
{
'url': 'https://github.com/marco-lancini',
'login': 'marco-lancini',
'name': 'Marco Lancini',
'email': '[email protected]',
'company': 'ExampleCo',
},
{
'url': 'https://github.com/sachafaust',
'login': 'sachafaust',
'name': 'Sacha Faust',
'email': '[email protected]',
'company': 'ExampleCo',
},
{
'url': 'https://github.com/SecPrez',
'login': 'SecPrez',
'name': 'SecPrez',
'email': '[email protected]',
'company': 'ExampleCo',
},
{
'url': 'https://github.com/ramonpetgrave64',
'login': 'ramonpetgrave64',
'name': 'Ramon Petgrave',
'email': '[email protected]',
'company': 'ExampleCo',
},
{
'url': 'https://github.com/roshinis78',
'login': 'roshinis78',
'name': 'Roshini Saravanakumar',
'email': '[email protected]',
'company': 'ExampleCo',
},
],
},
'requirements': {
'text': 'cartography==0.1.0\nhttplib2>=0.7.0\njinja2\nlxml\n# This is a comment line to be ignored\n',
},
},
]
| get_repos = [{'name': 'sample_repo', 'nameWithOwner': 'example_org/sample_repo', 'primaryLanguage': {'name': 'Python'}, 'url': 'https://github.com/example_org/sample_repo', 'sshUrl': '[email protected]:example_org/sample_repo.git', 'createdAt': '2011-02-15T18:40:15Z', 'description': 'My description', 'updatedAt': '2020-01-02T20:10:09Z', 'homepageUrl': '', 'languages': {'totalCount': 1, 'nodes': [{'name': 'Python'}]}, 'defaultBranchRef': {'name': 'master', 'id': 'branch_ref_id=='}, 'isPrivate': True, 'isArchived': False, 'isDisabled': False, 'isLocked': True, 'owner': {'url': 'https://github.com/example_org', 'login': 'example_org', '__typename': 'Organization'}, 'collaborators': {'edges': [], 'nodes': []}, 'requirements': {'text': 'cartography\nhttplib2<0.7.0\njinja2\nlxml\n-e git+https://example.com#egg=foobar\nhttps://example.com/foobar.tar.gz\npip @ https://github.com/pypa/pip/archive/1.3.1.zip#sha1=da9234ee9982d4bbb3c72346a6de940a148ea686\n'}}, {'name': 'SampleRepo2', 'nameWithOwner': 'example_org/SampleRepo2', 'primaryLanguage': {'name': 'Python'}, 'url': 'https://github.com/example_org/SampleRepo2', 'sshUrl': '[email protected]:example_org/SampleRepo2.git', 'createdAt': '2011-09-21T18:55:16Z', 'description': 'Some other description', 'updatedAt': '2020-07-03T00:25:25Z', 'homepageUrl': 'http://example.com/', 'languages': {'totalCount': 1, 'nodes': [{'name': 'Python'}]}, 'defaultBranchRef': {'name': 'master', 'id': 'other_branch_ref_id=='}, 'isPrivate': False, 'isArchived': False, 'isDisabled': False, 'isLocked': False, 'owner': {'url': 'https://github.com/example_org', 'login': 'example_org', '__typename': 'Organization'}, 'collaborators': None, 'requirements': None}, {'name': 'cartography', 'nameWithOwner': 'lyft/cartography', 'primaryLanguage': {'name': 'Python'}, 'url': 'https://github.com/lyft/cartography', 'sshUrl': '[email protected]:lyft/cartography.git', 'createdAt': '2019-02-27T00:16:29Z', 'description': 'One graph to rule them all', 'updatedAt': '2020-09-02T18:35:17Z', 'homepageUrl': '', 'languages': {'totalCount': 2, 'nodes': [{'name': 'Python'}, {'name': 'Makefile'}]}, 'defaultBranchRef': {'name': 'master', 'id': 'putsomethinghere'}, 'isPrivate': False, 'isArchived': False, 'isDisabled': False, 'isLocked': False, 'owner': {'url': 'https://github.com/example_org', 'login': 'example_org', '__typename': 'Organization'}, 'collaborators': {'edges': [{'permission': 'WRITE'}, {'permission': 'WRITE'}, {'permission': 'WRITE'}, {'permission': 'WRITE'}, {'permission': 'WRITE'}], 'nodes': [{'url': 'https://github.com/marco-lancini', 'login': 'marco-lancini', 'name': 'Marco Lancini', 'email': '[email protected]', 'company': 'ExampleCo'}, {'url': 'https://github.com/sachafaust', 'login': 'sachafaust', 'name': 'Sacha Faust', 'email': '[email protected]', 'company': 'ExampleCo'}, {'url': 'https://github.com/SecPrez', 'login': 'SecPrez', 'name': 'SecPrez', 'email': '[email protected]', 'company': 'ExampleCo'}, {'url': 'https://github.com/ramonpetgrave64', 'login': 'ramonpetgrave64', 'name': 'Ramon Petgrave', 'email': '[email protected]', 'company': 'ExampleCo'}, {'url': 'https://github.com/roshinis78', 'login': 'roshinis78', 'name': 'Roshini Saravanakumar', 'email': '[email protected]', 'company': 'ExampleCo'}]}, 'requirements': {'text': 'cartography==0.1.0\nhttplib2>=0.7.0\njinja2\nlxml\n# This is a comment line to be ignored\n'}}] |
class Node():
def __init__(self, valor):
self.valor = valor
self.next = None
class Stack:
def __init__(self):
self.head = Node("head")
self.size = 0
def __str__(self):
actual = self.head.next
str1 = "["
while actual:
str1 += str(actual.valor) + ", "
actual = actual.next
str1 = str1[:-2] + "]"
if(self.size == 0):
return "[]"
return str1
def lenght(self):
return self.size
def isEmpty(self):
return self.size == 0
def push(self, valor):
node = Node(valor)
node.next = self.head.next
self.head.next = node
self.size += 1
def peek(self):
if self.isEmpty():
raise Exception("Error la pila esta vacia...")
return self.head.next.valor
def pop(self):
if self.isEmpty():
raise Exception("Error la pila esta vacia...")
remove = self.head.next
self.head.next = self.head.next.next
self.size -= 1
return remove.valor | class Node:
def __init__(self, valor):
self.valor = valor
self.next = None
class Stack:
def __init__(self):
self.head = node('head')
self.size = 0
def __str__(self):
actual = self.head.next
str1 = '['
while actual:
str1 += str(actual.valor) + ', '
actual = actual.next
str1 = str1[:-2] + ']'
if self.size == 0:
return '[]'
return str1
def lenght(self):
return self.size
def is_empty(self):
return self.size == 0
def push(self, valor):
node = node(valor)
node.next = self.head.next
self.head.next = node
self.size += 1
def peek(self):
if self.isEmpty():
raise exception('Error la pila esta vacia...')
return self.head.next.valor
def pop(self):
if self.isEmpty():
raise exception('Error la pila esta vacia...')
remove = self.head.next
self.head.next = self.head.next.next
self.size -= 1
return remove.valor |
# Databricks notebook source
# MAGIC %run ./includes/utils
# COMMAND ----------
mountDataLake(clientId="64492359-3450-4f1e-be01-8717789fd01e",
clientSecret=dbutils.secrets.get(scope="dpdatalake",key="adappsecret"),
tokenEndPoint="https://login.microsoftonline.com/0b55e01a-573a-4060-b656-d1a3d5815791/oauth2/token",
storageAccountName="dpdatalake",
containerName="data")
# COMMAND ----------
# MAGIC %sql
# MAGIC CREATE DATABASE IF NOT EXISTS nyctaxi;
# MAGIC USE nyctaxi;
# MAGIC CREATE TABLE IF NOT EXISTS fact_zone_summary
# MAGIC USING DELTA
# MAGIC LOCATION '/mnt/data/curated/fact_zone_summary';
# MAGIC CREATE TABLE IF NOT EXISTS dim_zone_lookup
# MAGIC USING DELTA
# MAGIC LOCATION '/mnt/data/curated/dim_zone_lookup'; | mount_data_lake(clientId='64492359-3450-4f1e-be01-8717789fd01e', clientSecret=dbutils.secrets.get(scope='dpdatalake', key='adappsecret'), tokenEndPoint='https://login.microsoftonline.com/0b55e01a-573a-4060-b656-d1a3d5815791/oauth2/token', storageAccountName='dpdatalake', containerName='data') |
class Artist:
def __init__(self, artist_id, uri, title):
self.id = artist_id
self.uri = uri
self.title = title
def __str__(self):
return '{} (id={})'.format(self.title, self.id)
def to_tuple(self):
return (self.id, self.uri, self.title)
| class Artist:
def __init__(self, artist_id, uri, title):
self.id = artist_id
self.uri = uri
self.title = title
def __str__(self):
return '{} (id={})'.format(self.title, self.id)
def to_tuple(self):
return (self.id, self.uri, self.title) |
description = 'Actuators and feedback of the shutter, detector, and valves'
group = 'lowlevel'
excludes = ['IOcard']
devices = dict(
I1_pnCCD_Active = device('nicos.devices.generic.ManualSwitch',
description = 'high: Detector is turned on',
states = [0, 1],
),
I2_Shutter_safe = device('nicos.devices.generic.ManualSwitch',
description = 'high: Detector is turned on',
states = [0, 1],
),
I3_Det_chamber_vent_open = device('nicos.devices.generic.ManualSwitch',
description = 'high: Detector Chamber venting gauge open',
states = [0, 1],
),
I4_Exp_ch_vent_open = device('nicos.devices.generic.ManualSwitch',
description = 'high: Experiment Chamber venting gauge open',
states = [0, 1],
),
I5_Det_ch_pump_open = device('nicos.devices.generic.ManualSwitch',
description = 'high: Detector Chamber pumping gauge open',
states = [0, 1],
),
I6_Exp_ch_pump_open = device('nicos.devices.generic.ManualSwitch',
description = 'high: Experiment Chamber pumping gauge open',
states = [0, 1],
),
I7_Exp_ch_vent_gas_selection = device('nicos.devices.generic.ManualSwitch',
description = 'Venting either with air or nitrogen',
states = [0, 1],
),
I8_unused = device('nicos.devices.generic.ManualSwitch',
description = '1 Bit wide digital input starting at E8',
states = [0, 1],
),
O1_pnCCD_Trigger = device('nicos.devices.generic.ManualSwitch',
description = 'Send Trigger to detector to start collecting data',
states = [0, 1],
),
O2_Shutter_open = device('nicos.devices.generic.ManualSwitch',
description = 'Open the shutter from LMJ',
states = [0, 1],
),
O3_Det_ch_vent = device('nicos.devices.generic.ManualSwitch',
description = 'Vent Detector Chamber',
states = [0, 1],
),
O4_Exp_ch_vent= device('nicos.devices.generic.ManualSwitch',
description = 'Vent Experiment Chamber',
states = [0, 1],
),
O5_Det_ch_pump = device('nicos.devices.generic.ManualSwitch',
description = 'Open gauge from pump to Detector Chamber',
states = [0, 1],
),
O6_Exp_ch_pump = device('nicos.devices.generic.ManualSwitch',
description = 'Open gauge from pump to Experiment Chamber',
states = [0, 1],
),
O7_Exp_ch_vent_gas = device('nicos.devices.generic.ManualSwitch',
description = 'Choose either air or Nitrogen for venting',
states = [0, 1],
),
O8_unused = device('nicos.devices.generic.ManualSwitch',
description = '1 Bit wide digital output starting at A8',
states = [0, 1],
),
)
| description = 'Actuators and feedback of the shutter, detector, and valves'
group = 'lowlevel'
excludes = ['IOcard']
devices = dict(I1_pnCCD_Active=device('nicos.devices.generic.ManualSwitch', description='high: Detector is turned on', states=[0, 1]), I2_Shutter_safe=device('nicos.devices.generic.ManualSwitch', description='high: Detector is turned on', states=[0, 1]), I3_Det_chamber_vent_open=device('nicos.devices.generic.ManualSwitch', description='high: Detector Chamber venting gauge open', states=[0, 1]), I4_Exp_ch_vent_open=device('nicos.devices.generic.ManualSwitch', description='high: Experiment Chamber venting gauge open', states=[0, 1]), I5_Det_ch_pump_open=device('nicos.devices.generic.ManualSwitch', description='high: Detector Chamber pumping gauge open', states=[0, 1]), I6_Exp_ch_pump_open=device('nicos.devices.generic.ManualSwitch', description='high: Experiment Chamber pumping gauge open', states=[0, 1]), I7_Exp_ch_vent_gas_selection=device('nicos.devices.generic.ManualSwitch', description='Venting either with air or nitrogen', states=[0, 1]), I8_unused=device('nicos.devices.generic.ManualSwitch', description='1 Bit wide digital input starting at E8', states=[0, 1]), O1_pnCCD_Trigger=device('nicos.devices.generic.ManualSwitch', description='Send Trigger to detector to start collecting data', states=[0, 1]), O2_Shutter_open=device('nicos.devices.generic.ManualSwitch', description='Open the shutter from LMJ', states=[0, 1]), O3_Det_ch_vent=device('nicos.devices.generic.ManualSwitch', description='Vent Detector Chamber', states=[0, 1]), O4_Exp_ch_vent=device('nicos.devices.generic.ManualSwitch', description='Vent Experiment Chamber', states=[0, 1]), O5_Det_ch_pump=device('nicos.devices.generic.ManualSwitch', description='Open gauge from pump to Detector Chamber', states=[0, 1]), O6_Exp_ch_pump=device('nicos.devices.generic.ManualSwitch', description='Open gauge from pump to Experiment Chamber', states=[0, 1]), O7_Exp_ch_vent_gas=device('nicos.devices.generic.ManualSwitch', description='Choose either air or Nitrogen for venting', states=[0, 1]), O8_unused=device('nicos.devices.generic.ManualSwitch', description='1 Bit wide digital output starting at A8', states=[0, 1])) |
def multiple_of(num, multiple):
return num % multiple == 0
def sum_of_multiples(limit):
return sum(x for x in range(limit) if multiple_of(x, 3) or multiple_of(x, 5))
if __name__ == "__main__":
print(sum_of_multiples(1000)) | def multiple_of(num, multiple):
return num % multiple == 0
def sum_of_multiples(limit):
return sum((x for x in range(limit) if multiple_of(x, 3) or multiple_of(x, 5)))
if __name__ == '__main__':
print(sum_of_multiples(1000)) |
# nobully.py
# Metadata
NAME = 'nobully'
ENABLE = True
PATTERN = r'^!nobully (?P<nick>[^\s]+)'
USAGE = '''Usage: !nobully <nick>
This informs the user identified by nick that they should no longer bully other (innocent) users.
'''
# Constants
NOBULLY_URL = 'https://www.stop-irc-bullying.info/'
# Command
async def nobully(bot, message, nick):
if nick not in bot.users:
return message.with_body(f'Unknown nick: {nick}')
else:
return message.with_body(f'{message.nick} thinks that you should stop bullying other users, {nick}. Please refer to {NOBULLY_URL} for more information.')
# Register
def register(bot):
return (
('command', PATTERN, nobully),
)
# vim: set sts=4 sw=4 ts=8 expandtab ft=python:
| name = 'nobully'
enable = True
pattern = '^!nobully (?P<nick>[^\\s]+)'
usage = 'Usage: !nobully <nick>\nThis informs the user identified by nick that they should no longer bully other (innocent) users.\n'
nobully_url = 'https://www.stop-irc-bullying.info/'
async def nobully(bot, message, nick):
if nick not in bot.users:
return message.with_body(f'Unknown nick: {nick}')
else:
return message.with_body(f'{message.nick} thinks that you should stop bullying other users, {nick}. Please refer to {NOBULLY_URL} for more information.')
def register(bot):
return (('command', PATTERN, nobully),) |
# Copyright (c) 2018, WSO2 Inc. (http://wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
NS = {'d': 'http://maven.apache.org/POM/4.0.0'}
ZIP_FILE_EXTENSION = ".zip"
CARBON_NAME = "carbon.zip"
VALUE_TAG = "{http://maven.apache.org/POM/4.0.0}value"
SURFACE_PLUGIN_ARTIFACT_ID = "maven-surefire-plugin"
DATASOURCE_PATHS = {"product-iots": {
"CORE": ["conf/datasources/master-datasources.xml", "conf/datasources/cdm-datasources.xml",
"conf/datasources/android-datasources.xml"],
"BROKER": [],
"ANALYTICS": []},
}
M2_PATH = {"product-iots": "iot/wso2iot"}
DIST_POM_PATH = {"product-is": "modules/distribution/pom.xml", "product-apim": "modules/distribution/product/pom.xml",
"product-ei": "distribution/pom.xml"}
LIB_PATH = "lib"
DISTRIBUTION_PATH = {"product-apim": "modules/distribution/product/target",
"product-is": "modules/distribution/target",
"product-ei": "distribution/target"}
PRODUCT_STORAGE_DIR_NAME = "product"
TEST_PLAN_PROPERTY_FILE_NAME = "testplan-props.properties"
INFRA_PROPERTY_FILE_NAME = "infrastructure.properties"
LOG_FILE_NAME = "integration.log"
ORACLE_DB_ENGINE = "ORACLE-SE2"
MSSQL_DB_ENGINE = "SQLSERVER-SE"
MYSQL_DB_ENGINE = "MYSQL"
DEFAULT_ORACLE_SID = "orcl"
DEFAULT_DB_USERNAME = "wso2carbon"
LOG_STORAGE = "logs"
LOG_FILE_PATHS = {"product-apim": [],
"product-is": [],
"product-ei": []}
DB_META_DATA = {
"MYSQL": {"prefix": "jdbc:mysql://", "driverClassName": "com.mysql.jdbc.Driver", "jarName": "mysql.jar",
"DB_SETUP": {
"product-apim": {},
"product-is": {},
"product-ei": {},
"product-iots": {"WSO2_CARBON_DB_CORE": ['dbscripts/mysql5.7.sql'],
"WSO2APPM_DB_CORE": ['dbscripts/appmgt/mysql5.7.sql'],
"WSO2AM_DB_CORE": ['dbscripts/apimgt/mysql5.7.sql'],
"WSO2_MB_STORE_DB_CORE": ['wso2/broker/dbscripts/mb-store/mysql-mb.sql'],
"JAGH2_CORE": ['dbscripts/mysql5.7.sql'],
"WSO2_SOCIAL_DB_CORE": ['dbscripts/social/mysql/resource.sql'],
"DM_DS_CORE": ['dbscripts/cdm/mysql.sql'],
"DM_ARCHIVAL_DS_CORE": ['dbscripts/cdm/mysql.sql'],
"Android_DB_CORE": ['dbscripts/cdm/plugins/android/mysql.sql']}}},
"SQLSERVER-SE": {"prefix": "jdbc:sqlserver://",
"driverClassName": "com.microsoft.sqlserver.jdbc.SQLServerDriver", "jarName": "sqlserver-ex.jar",
"DB_SETUP": {
"product-apim": {},
"product-is": {},
"product-ei": {"WSO2_CARBON_DB_CORE": ['dbscripts/mssql.sql'],
"WSO2_CARBON_DB_BROKER": ['wso2/broker/dbscripts/mssql.sql'],
"WSO2_CARBON_DB_BPS": ['wso2/business-process/dbscripts/mssql.sql'],
"WSO2_MB_STORE_DB_BROKER": ['wso2/broker/dbscripts/mb-store/mssql-mb.sql'],
"WSO2_METRICS_DB_BROKER": ['wso2/broker/dbscripts/metrics/mssql.sql'],
"BPS_DS_BPS": ['wso2/business-process/dbscripts/bps/bpel/create/mssql.sql'],
"ACTIVITI_DB_BPS": [
'wso2/business-process/dbscripts/bps/bpmn/create/activiti.mssql.create.identity.sql']}}},
"ORACLE-SE2": {"prefix": "jdbc:oracle:thin:@", "driverClassName": "oracle.jdbc.OracleDriver",
"jarName": "oracle-se.jar",
"DB_SETUP": {
"product-apim": {},
"product-is": {},
"product-ei": {"WSO2_CARBON_DB_CORE": ['dbscripts/oracle.sql'],
"WSO2_CARBON_DB_BROKER": ['wso2/broker/dbscripts/oracle.sql'],
"WSO2_CARBON_DB_BPS": ['wso2/business-process/dbscripts/oracle.sql'],
"WSO2_MB_STORE_DB_BROKER": ['wso2/broker/dbscripts/mb-store/oracle-mb.sql'],
"WSO2_METRICS_DB_BROKER": ['wso2/broker/dbscripts/metrics/oracle.sql'],
"BPS_DS_BPS": ['wso2/business-process/dbscripts/bps/bpel/create/oracle.sql'],
"ACTIVITI_DB_BPS": [
'wso2/business-process/dbscripts/bps/bpmn/create/activiti.oracle.create.identity.sql']}}},
"POSTGRESQL": {"prefix": "jdbc:postgresql://", "driverClassName": "org.postgresql.Driver",
"jarName": "postgres.jar",
"DB_SETUP": {"product-apim": {},
"product-is": {},
"product-ei": {}}
}}
| ns = {'d': 'http://maven.apache.org/POM/4.0.0'}
zip_file_extension = '.zip'
carbon_name = 'carbon.zip'
value_tag = '{http://maven.apache.org/POM/4.0.0}value'
surface_plugin_artifact_id = 'maven-surefire-plugin'
datasource_paths = {'product-iots': {'CORE': ['conf/datasources/master-datasources.xml', 'conf/datasources/cdm-datasources.xml', 'conf/datasources/android-datasources.xml'], 'BROKER': [], 'ANALYTICS': []}}
m2_path = {'product-iots': 'iot/wso2iot'}
dist_pom_path = {'product-is': 'modules/distribution/pom.xml', 'product-apim': 'modules/distribution/product/pom.xml', 'product-ei': 'distribution/pom.xml'}
lib_path = 'lib'
distribution_path = {'product-apim': 'modules/distribution/product/target', 'product-is': 'modules/distribution/target', 'product-ei': 'distribution/target'}
product_storage_dir_name = 'product'
test_plan_property_file_name = 'testplan-props.properties'
infra_property_file_name = 'infrastructure.properties'
log_file_name = 'integration.log'
oracle_db_engine = 'ORACLE-SE2'
mssql_db_engine = 'SQLSERVER-SE'
mysql_db_engine = 'MYSQL'
default_oracle_sid = 'orcl'
default_db_username = 'wso2carbon'
log_storage = 'logs'
log_file_paths = {'product-apim': [], 'product-is': [], 'product-ei': []}
db_meta_data = {'MYSQL': {'prefix': 'jdbc:mysql://', 'driverClassName': 'com.mysql.jdbc.Driver', 'jarName': 'mysql.jar', 'DB_SETUP': {'product-apim': {}, 'product-is': {}, 'product-ei': {}, 'product-iots': {'WSO2_CARBON_DB_CORE': ['dbscripts/mysql5.7.sql'], 'WSO2APPM_DB_CORE': ['dbscripts/appmgt/mysql5.7.sql'], 'WSO2AM_DB_CORE': ['dbscripts/apimgt/mysql5.7.sql'], 'WSO2_MB_STORE_DB_CORE': ['wso2/broker/dbscripts/mb-store/mysql-mb.sql'], 'JAGH2_CORE': ['dbscripts/mysql5.7.sql'], 'WSO2_SOCIAL_DB_CORE': ['dbscripts/social/mysql/resource.sql'], 'DM_DS_CORE': ['dbscripts/cdm/mysql.sql'], 'DM_ARCHIVAL_DS_CORE': ['dbscripts/cdm/mysql.sql'], 'Android_DB_CORE': ['dbscripts/cdm/plugins/android/mysql.sql']}}}, 'SQLSERVER-SE': {'prefix': 'jdbc:sqlserver://', 'driverClassName': 'com.microsoft.sqlserver.jdbc.SQLServerDriver', 'jarName': 'sqlserver-ex.jar', 'DB_SETUP': {'product-apim': {}, 'product-is': {}, 'product-ei': {'WSO2_CARBON_DB_CORE': ['dbscripts/mssql.sql'], 'WSO2_CARBON_DB_BROKER': ['wso2/broker/dbscripts/mssql.sql'], 'WSO2_CARBON_DB_BPS': ['wso2/business-process/dbscripts/mssql.sql'], 'WSO2_MB_STORE_DB_BROKER': ['wso2/broker/dbscripts/mb-store/mssql-mb.sql'], 'WSO2_METRICS_DB_BROKER': ['wso2/broker/dbscripts/metrics/mssql.sql'], 'BPS_DS_BPS': ['wso2/business-process/dbscripts/bps/bpel/create/mssql.sql'], 'ACTIVITI_DB_BPS': ['wso2/business-process/dbscripts/bps/bpmn/create/activiti.mssql.create.identity.sql']}}}, 'ORACLE-SE2': {'prefix': 'jdbc:oracle:thin:@', 'driverClassName': 'oracle.jdbc.OracleDriver', 'jarName': 'oracle-se.jar', 'DB_SETUP': {'product-apim': {}, 'product-is': {}, 'product-ei': {'WSO2_CARBON_DB_CORE': ['dbscripts/oracle.sql'], 'WSO2_CARBON_DB_BROKER': ['wso2/broker/dbscripts/oracle.sql'], 'WSO2_CARBON_DB_BPS': ['wso2/business-process/dbscripts/oracle.sql'], 'WSO2_MB_STORE_DB_BROKER': ['wso2/broker/dbscripts/mb-store/oracle-mb.sql'], 'WSO2_METRICS_DB_BROKER': ['wso2/broker/dbscripts/metrics/oracle.sql'], 'BPS_DS_BPS': ['wso2/business-process/dbscripts/bps/bpel/create/oracle.sql'], 'ACTIVITI_DB_BPS': ['wso2/business-process/dbscripts/bps/bpmn/create/activiti.oracle.create.identity.sql']}}}, 'POSTGRESQL': {'prefix': 'jdbc:postgresql://', 'driverClassName': 'org.postgresql.Driver', 'jarName': 'postgres.jar', 'DB_SETUP': {'product-apim': {}, 'product-is': {}, 'product-ei': {}}}} |
name = "Angela"
letters_list = [x for x in name]
print(letters_list)
doubled = [x * 2 for x in range(1, 5)]
print(doubled)
maybe_tripled = [x * 3 for x in range(1, 10) if x > 5]
print(maybe_tripled)
def foo(value):
if value > 5:
return True
return False
with_fn = [x * 3 for x in range(1, 10) if foo(x)]
print(with_fn)
squared = [x * x for x in range(1, 51)]
print(squared)
even = [x for x in [1, 1, 2, 3, 5, 8, 13, 21, 34, 55] if x % 2 == 0]
print(even)
| name = 'Angela'
letters_list = [x for x in name]
print(letters_list)
doubled = [x * 2 for x in range(1, 5)]
print(doubled)
maybe_tripled = [x * 3 for x in range(1, 10) if x > 5]
print(maybe_tripled)
def foo(value):
if value > 5:
return True
return False
with_fn = [x * 3 for x in range(1, 10) if foo(x)]
print(with_fn)
squared = [x * x for x in range(1, 51)]
print(squared)
even = [x for x in [1, 1, 2, 3, 5, 8, 13, 21, 34, 55] if x % 2 == 0]
print(even) |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def reverseBetween(self, head: ListNode, left: int, right: int) -> ListNode:
left -= 1
right -= 1
newHead = ListNode(-1)
newHead.next = head
deque = collections.deque()
current = newHead.next
for index in range(right + 1):
if left <= index <= right:
deque.append(current)
current = current.next
while len(deque) >= 2:
front = deque.popleft()
back = deque.pop()
front.val, back.val = back.val, front.val
return newHead.next
| class Solution:
def reverse_between(self, head: ListNode, left: int, right: int) -> ListNode:
left -= 1
right -= 1
new_head = list_node(-1)
newHead.next = head
deque = collections.deque()
current = newHead.next
for index in range(right + 1):
if left <= index <= right:
deque.append(current)
current = current.next
while len(deque) >= 2:
front = deque.popleft()
back = deque.pop()
(front.val, back.val) = (back.val, front.val)
return newHead.next |
# entrada 3 float
A = float(input())
B = float(input())
C = float(input())
# variaveis (pesos)
P1 = 2
P2 = 3
P3 = 5
# calculo da media
MEDIA = ((A * P1) + (B*P2) + (C*P3)) / (P1+P2+P3)
print('MEDIA = {:.1f}'.format(MEDIA))
| a = float(input())
b = float(input())
c = float(input())
p1 = 2
p2 = 3
p3 = 5
media = (A * P1 + B * P2 + C * P3) / (P1 + P2 + P3)
print('MEDIA = {:.1f}'.format(MEDIA)) |
def get_CUDA(vectorSize = 10, func = "sin(2*pi*X/Lx)", px = "0.", py = "0.", pz = "0.", **kwargs):
return '''__global__ void initialize(dcmplx *QField, int* lattice, int* gpu_params){
int deviceNum = gpu_params[0];
int numGPUs = gpu_params[2];
int xSize = lattice[0]*numGPUs;
int ySize = lattice[2];
int zSize = lattice[4];
int vectorSize = ''' + str(vectorSize) + ''';
int x = blockIdx.x * blockDim.x + threadIdx.x;
int y = blockIdx.y * blockDim.y + threadIdx.y;
int z = blockIdx.z * blockDim.z + threadIdx.z;
double this_x = double(x+deviceNum*lattice[0]);
int n;
dcmplx i(0.,1.);
double X = (double)(this_x);
double Y = (double)(y);
double Z = (double)(z);
double Lx = (double) xSize;
double Ly = (double) ySize;
double Lz = (double) zSize;
dcmplx phaseKickX = exp(i*(-('''+str(px)+''')*2.*pi)*(X)/Lx);
dcmplx phaseKickY = exp(i*(-('''+str(py)+''')*2.*pi)*(Y)/Ly);
dcmplx phaseKickZ = exp(i*(-('''+str(pz)+''')*2.*pi)*(Z)/Lz);
dcmplx field = ''' + func + '''*phaseKickX*phaseKickY*phaseKickZ;
for (n=0; n<vectorSize; n=n+1){
QField[n+z*vectorSize+y*vectorSize*zSize+x*zSize*ySize*vectorSize] = field/2.;
}
}'''
| def get_cuda(vectorSize=10, func='sin(2*pi*X/Lx)', px='0.', py='0.', pz='0.', **kwargs):
return '__global__ void initialize(dcmplx *QField, int* lattice, int* gpu_params){\n\tint deviceNum = gpu_params[0];\n\tint numGPUs = gpu_params[2];\n\tint xSize = lattice[0]*numGPUs;\n\tint ySize = lattice[2];\n\tint zSize = lattice[4];\n\tint vectorSize = ' + str(vectorSize) + ';\n\tint x = blockIdx.x * blockDim.x + threadIdx.x;\n\tint y = blockIdx.y * blockDim.y + threadIdx.y;\n\tint z = blockIdx.z * blockDim.z + threadIdx.z;\n\tdouble this_x = double(x+deviceNum*lattice[0]);\n\tint n;\n\tdcmplx i(0.,1.);\n\tdouble X = (double)(this_x);\n\tdouble Y = (double)(y);\n\tdouble Z = (double)(z);\n\tdouble Lx = (double) xSize;\n\tdouble Ly = (double) ySize;\n\tdouble Lz = (double) zSize;\n\tdcmplx phaseKickX = exp(i*(-(' + str(px) + ')*2.*pi)*(X)/Lx);\n\tdcmplx phaseKickY = exp(i*(-(' + str(py) + ')*2.*pi)*(Y)/Ly);\n\tdcmplx phaseKickZ = exp(i*(-(' + str(pz) + ')*2.*pi)*(Z)/Lz);\n\tdcmplx field = ' + func + '*phaseKickX*phaseKickY*phaseKickZ;\n\t\n \n\tfor (n=0; n<vectorSize; n=n+1){\n\t\tQField[n+z*vectorSize+y*vectorSize*zSize+x*zSize*ySize*vectorSize] = field/2.;\n\t} \n}' |
answer1 = widget_inputs["radio1"]
answer2 = widget_inputs["radio2"]
answer3 = widget_inputs["radio3"]
answer4 = widget_inputs["radio4"]
is_correct = False
comments = []
def commentizer(new):
if new not in comments:
comments.append(new)
if answer2 == True:
is_correct = True
else:
is_correct = is_correct and False
commentizer("Open the site and try changing `cover` to `contain` in DevTools to see the difference.")
commentizer("Check the first one.")
if answer3 == True:
is_correct = is_correct and True
else:
is_correct = is_correct and False
commentizer("Open the site and try changing `cover` to `contain` in DevTools to see the difference.")
commentizer("Check the second one.")
if is_correct:
commentizer("Great job! You're starting to learn how to decide between raster and vector options.")
grade_result["comment"] = "\n\n".join(comments)
grade_result["correct"] = is_correct | answer1 = widget_inputs['radio1']
answer2 = widget_inputs['radio2']
answer3 = widget_inputs['radio3']
answer4 = widget_inputs['radio4']
is_correct = False
comments = []
def commentizer(new):
if new not in comments:
comments.append(new)
if answer2 == True:
is_correct = True
else:
is_correct = is_correct and False
commentizer('Open the site and try changing `cover` to `contain` in DevTools to see the difference.')
commentizer('Check the first one.')
if answer3 == True:
is_correct = is_correct and True
else:
is_correct = is_correct and False
commentizer('Open the site and try changing `cover` to `contain` in DevTools to see the difference.')
commentizer('Check the second one.')
if is_correct:
commentizer("Great job! You're starting to learn how to decide between raster and vector options.")
grade_result['comment'] = '\n\n'.join(comments)
grade_result['correct'] = is_correct |
#
# Copyright (c) 2016, Prometheus Research, LLC
#
__import__('pkg_resources').declare_namespace(__name__)
| __import__('pkg_resources').declare_namespace(__name__) |
#task1: print the \\ double backslash
print("This is \\\\ double backslash")
#task2: print the mountains
print ("this is /\\/\\/\\/\\/\\ mountain")
#task3:he is awesome(using escape sequence)
print ("he is \t awesome")
#task4: \" \n \t \'
print ("\\\" \\n \\t \\\'") | print('This is \\\\ double backslash')
print('this is /\\/\\/\\/\\/\\ mountain')
print('he is \t awesome')
print('\\" \\n \\t \\\'') |
class TaskError(Exception):
pass
class StrategyError(Exception):
pass
| class Taskerror(Exception):
pass
class Strategyerror(Exception):
pass |
class Controller:
def __init__(self, period, init_cores, st=0.8):
self.period = period
self.init_cores = init_cores
self.st = st
self.name = type(self).__name__
def setName(self, name):
self.name = name
def setSLA(self, sla):
self.sla = sla
self.setpoint = sla*self.st
def setMonitoring(self, monitoring):
self.monitoring = monitoring
def setGenerator(self, generator):
self.generator = generator
def tick(self, t):
if not t:
self.reset()
if t and not (t % self.period):
self.control(t)
return self.cores
def control(self, t):
pass
def reset(self):
self.cores = self.init_cores
def __str__(self):
return "%s - period: %d init_cores: %.2f" % (self.name, self.period, self.init_cores)
| class Controller:
def __init__(self, period, init_cores, st=0.8):
self.period = period
self.init_cores = init_cores
self.st = st
self.name = type(self).__name__
def set_name(self, name):
self.name = name
def set_sla(self, sla):
self.sla = sla
self.setpoint = sla * self.st
def set_monitoring(self, monitoring):
self.monitoring = monitoring
def set_generator(self, generator):
self.generator = generator
def tick(self, t):
if not t:
self.reset()
if t and (not t % self.period):
self.control(t)
return self.cores
def control(self, t):
pass
def reset(self):
self.cores = self.init_cores
def __str__(self):
return '%s - period: %d init_cores: %.2f' % (self.name, self.period, self.init_cores) |
# ***************************************************************************************
# ***************************************************************************************
#
# Name : democodegenerator.py
# Author : Paul Robson ([email protected])
# Date : 17th December 2018
# Purpose : Imaginary language code generator.
#
# ***************************************************************************************
# ***************************************************************************************
# ***************************************************************************************
#
# Code generator for an imaginary CPU, for testing
#
# ***************************************************************************************
class DemoCodeGenerator(object):
def __init__(self,optimise = False):
self.addr = 0x1000 # code space
self.memoryAddr = 0x3000 # uninitialised data
self.opNames = {}
for op in "+add;-sub;*mult;/div;%mod;∧|or;^xor".split(";"):
self.opNames[op[0]] = op[1:]
self.jumpTypes = { "":"jmp","#":"jnz","=":"jz","+":"jpe","-":"jmi" }
#
# Get current address in code space.
#
def getAddress(self):
return self.addr
#
# Allocate memory for a variable.
#
def allocate(self,count = 1):
address = self.memoryAddr
for i in range(0,count):
print("${0:06x} : dw 0".format(self.memoryAddr))
self.memoryAddr += 2
return address
#
# Place an ASCIIZ string constant ... somewhere .... return its address
#
def stringConstant(self,str):
print("${0:06x} : db '{1}',0".format(self.addr,str)) # can be inline, or elsewhere
addr = self.addr
self.addr = self.addr + len(str) + 1
return addr
#
# Load Accumulator with constant or term.
#
def loadARegister(self,term):
if term[0]:
print("${0:06x} : ldr a,(${1:04x})".format(self.addr,term[1]))
else:
print("${0:06x} : ldr a,#${1:04x}".format(self.addr,term[1]))
self.addr += 1
#
# Perform a binary operation with a constant/term on the accumulator.
#
def binaryOperation(self,operator,term):
if operator == "!" or operator == "?": # indirect, we do add then read
self.binaryOperation("+",term) # add will optimise a bit
print("${0:06x} : ldr.{1} a,[a]".format(self.addr,"w" if operator == "!" else "b"))
self.addr += 1
return
operator = self.opNames[operator] # convert op to opcode name
if term[0]:
print("${0:06x} : {1:4} a,(${2:04x})".format(self.addr,operator,term[1]))
self.addr += 1
else:
print("${0:06x} : {1:4} a,#${2:04x}".format(self.addr,operator,term[1]))
self.addr += 1
#
# Save A at the address given
#
def saveDirect(self,address):
print("${0:06x} : str a,(${1:04x})".format(self.addr,address))
self.addr += 1
#
# Save temp register indirect through A, byte or word, and put temp back in A
#
def saveTempIndirect(self,isWord):
print("${0:06x} : str.{1} b,[a]".format(self.addr," " if isWord else "b"))
print("${0:06x} : tba".format(self.addr+1))
self.addr += 2
#
# Copy A to the temp register, A value unknown after this.
#
def copyToTemp(self):
print("${0:06x} : tab".format(self.addr))
self.addr += 1
#
# Compile a call to a procedure (call should protect 'A')
#
def callProcedure(self,address):
print("${0:06x} : call ${1:06x}".format(self.addr,address))
self.addr += 1
#
# Return from procedure (should protect A)
#
def returnProcedure(self):
print("${0:06x} : ret".format(self.addr))
self.addr += 1
#
# Compile a jump with the given condition ( "", "=", "#", "+" "-""). The
# target address is not known yet.
#
def compileJump(self,condition):
assert condition in self.jumpTypes
print("${0:06x} : {1:3} ?????".format(self.addr,self.jumpTypes[condition]))
jumpAddr = self.addr
self.addr += 1
return jumpAddr
#
# Patch a jump given its base addres
#
def patchJump(self,jumpAddr,target):
print("${0:06x} : (Set target to ${1:06x})".format(jumpAddr,target))
#
# Compile the top of a for loop.
#
def forTopCode(self,indexVar):
loop = self.getAddress()
print("${0:06x} : dec a".format(self.addr)) # decrement count
print("${0:06x} : push a".format(self.addr+1)) # push on stack
self.addr += 2
if indexVar is not None: # if index exists put it there
self.saveDirect(indexVar.getValue())
return loop
#
# Compile the bottom of a for loop
#
def forBottomCode(self,loopAddress):
print("${0:06x} : pop a".format(self.addr)) # pop off stack, jump if not done
print("${0:06x} : jnz ${1:06x}".format(self.addr+1,loopAddress))
self.addr += 2
| class Democodegenerator(object):
def __init__(self, optimise=False):
self.addr = 4096
self.memoryAddr = 12288
self.opNames = {}
for op in '+add;-sub;*mult;/div;%mod;∧|or;^xor'.split(';'):
self.opNames[op[0]] = op[1:]
self.jumpTypes = {'': 'jmp', '#': 'jnz', '=': 'jz', '+': 'jpe', '-': 'jmi'}
def get_address(self):
return self.addr
def allocate(self, count=1):
address = self.memoryAddr
for i in range(0, count):
print('${0:06x} : dw 0'.format(self.memoryAddr))
self.memoryAddr += 2
return address
def string_constant(self, str):
print("${0:06x} : db '{1}',0".format(self.addr, str))
addr = self.addr
self.addr = self.addr + len(str) + 1
return addr
def load_a_register(self, term):
if term[0]:
print('${0:06x} : ldr a,(${1:04x})'.format(self.addr, term[1]))
else:
print('${0:06x} : ldr a,#${1:04x}'.format(self.addr, term[1]))
self.addr += 1
def binary_operation(self, operator, term):
if operator == '!' or operator == '?':
self.binaryOperation('+', term)
print('${0:06x} : ldr.{1} a,[a]'.format(self.addr, 'w' if operator == '!' else 'b'))
self.addr += 1
return
operator = self.opNames[operator]
if term[0]:
print('${0:06x} : {1:4} a,(${2:04x})'.format(self.addr, operator, term[1]))
self.addr += 1
else:
print('${0:06x} : {1:4} a,#${2:04x}'.format(self.addr, operator, term[1]))
self.addr += 1
def save_direct(self, address):
print('${0:06x} : str a,(${1:04x})'.format(self.addr, address))
self.addr += 1
def save_temp_indirect(self, isWord):
print('${0:06x} : str.{1} b,[a]'.format(self.addr, ' ' if isWord else 'b'))
print('${0:06x} : tba'.format(self.addr + 1))
self.addr += 2
def copy_to_temp(self):
print('${0:06x} : tab'.format(self.addr))
self.addr += 1
def call_procedure(self, address):
print('${0:06x} : call ${1:06x}'.format(self.addr, address))
self.addr += 1
def return_procedure(self):
print('${0:06x} : ret'.format(self.addr))
self.addr += 1
def compile_jump(self, condition):
assert condition in self.jumpTypes
print('${0:06x} : {1:3} ?????'.format(self.addr, self.jumpTypes[condition]))
jump_addr = self.addr
self.addr += 1
return jumpAddr
def patch_jump(self, jumpAddr, target):
print('${0:06x} : (Set target to ${1:06x})'.format(jumpAddr, target))
def for_top_code(self, indexVar):
loop = self.getAddress()
print('${0:06x} : dec a'.format(self.addr))
print('${0:06x} : push a'.format(self.addr + 1))
self.addr += 2
if indexVar is not None:
self.saveDirect(indexVar.getValue())
return loop
def for_bottom_code(self, loopAddress):
print('${0:06x} : pop a'.format(self.addr))
print('${0:06x} : jnz ${1:06x}'.format(self.addr + 1, loopAddress))
self.addr += 2 |
# Sphinx helper for Django-specific references
def setup(app):
app.add_crossref_type(
directivename = "label",
rolename = "djterm",
indextemplate = "pair: %s; label",
)
app.add_crossref_type(
directivename = "setting",
rolename = "setting",
indextemplate = "pair: %s; setting",
)
app.add_crossref_type(
directivename = "templatetag",
rolename = "ttag",
indextemplate = "pair: %s; template tag",
)
app.add_crossref_type(
directivename = "templatefilter",
rolename = "tfilter",
indextemplate = "pair: %s; template filter",
)
app.add_crossref_type(
directivename = "fieldlookup",
rolename = "lookup",
indextemplate = "pair: %s; field lookup type",
)
| def setup(app):
app.add_crossref_type(directivename='label', rolename='djterm', indextemplate='pair: %s; label')
app.add_crossref_type(directivename='setting', rolename='setting', indextemplate='pair: %s; setting')
app.add_crossref_type(directivename='templatetag', rolename='ttag', indextemplate='pair: %s; template tag')
app.add_crossref_type(directivename='templatefilter', rolename='tfilter', indextemplate='pair: %s; template filter')
app.add_crossref_type(directivename='fieldlookup', rolename='lookup', indextemplate='pair: %s; field lookup type') |
#
# PySNMP MIB module SMON2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SMON2-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:59:43 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)
#
smon, = mibBuilder.importSymbols("APPLIC-MIB", "smon")
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint")
OwnerString, = mibBuilder.importSymbols("RMON-MIB", "OwnerString")
DataSource, LastCreateTime, TimeFilter, hlMatrixControlIndex, ZeroBasedCounter32, protocolDirLocalIndex = mibBuilder.importSymbols("RMON2-MIB", "DataSource", "LastCreateTime", "TimeFilter", "hlMatrixControlIndex", "ZeroBasedCounter32", "protocolDirLocalIndex")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Counter32, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, ObjectIdentity, MibIdentifier, Integer32, TimeTicks, iso, NotificationType, Counter64, Bits, ModuleIdentity, Gauge32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "ObjectIdentity", "MibIdentifier", "Integer32", "TimeTicks", "iso", "NotificationType", "Counter64", "Bits", "ModuleIdentity", "Gauge32")
TimeStamp, TextualConvention, RowStatus, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TimeStamp", "TextualConvention", "RowStatus", "DisplayString")
xsSmon = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 2))
xsSmonResourceAllocation = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSmonResourceAllocation.setStatus('current')
xsHostTopN = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 2))
xsHostTopNControlTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1), )
if mibBuilder.loadTexts: xsHostTopNControlTable.setStatus('current')
xsHostTopNControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1), ).setIndexNames((0, "SMON2-MIB", "xsHostTopNControlIndex"))
if mibBuilder.loadTexts: xsHostTopNControlEntry.setStatus('current')
xsHostTopNControlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: xsHostTopNControlIndex.setStatus('current')
xsHostTopNControlHostIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsHostTopNControlHostIndex.setStatus('current')
xsHostTopNControlRateBase = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("xsHostTopNInPkts", 1), ("xsHostTopNOutPkts", 2), ("xsHostTopNInOctets", 3), ("xsHostTopNOutOctets", 4)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsHostTopNControlRateBase.setStatus('current')
xsHostTopNControlTimeRemaining = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsHostTopNControlTimeRemaining.setStatus('current')
xsHostTopNControlDuration = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsHostTopNControlDuration.setStatus('current')
xsHostTopNControlRequestedSize = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647)).clone(150)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsHostTopNControlRequestedSize.setStatus('current')
xsHostTopNControlGrantedSize = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsHostTopNControlGrantedSize.setStatus('current')
xsHostTopNControlStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 8), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsHostTopNControlStartTime.setStatus('current')
xsHostTopNControlOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 9), OwnerString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsHostTopNControlOwner.setStatus('current')
xsHostTopNControlStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 10), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsHostTopNControlStatus.setStatus('current')
xsHostTopNTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2), )
if mibBuilder.loadTexts: xsHostTopNTable.setStatus('current')
xsHostTopNEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1), ).setIndexNames((0, "SMON2-MIB", "xsHostTopNControlIndex"), (0, "SMON2-MIB", "xsHostTopNIndex"))
if mibBuilder.loadTexts: xsHostTopNEntry.setStatus('current')
xsHostTopNIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: xsHostTopNIndex.setStatus('current')
xsHostTopNProtocolDirLocalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsHostTopNProtocolDirLocalIndex.setStatus('current')
xsHostTopNNlAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 3), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsHostTopNNlAddress.setStatus('current')
xsHostTopNRate = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsHostTopNRate.setStatus('current')
xsFilter = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 3))
xsHostFilterTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1), )
if mibBuilder.loadTexts: xsHostFilterTable.setStatus('current')
xsHostFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1), ).setIndexNames((0, "SMON2-MIB", "xsHostFilterIpAddress"))
if mibBuilder.loadTexts: xsHostFilterEntry.setStatus('current')
xsHostFilterType = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ipHost", 1), ("ipSubnet", 2), ("ipxNet", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsHostFilterType.setStatus('current')
xsHostFilterIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 2), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsHostFilterIpAddress.setStatus('current')
xsHostFilterIpSubnet = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 3), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsHostFilterIpSubnet.setStatus('current')
xsHostFilterIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 4), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsHostFilterIpMask.setStatus('current')
xsHostFilterIpxAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 5), OctetString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsHostFilterIpxAddress.setStatus('current')
xsHostFilterStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsHostFilterStatus.setStatus('current')
xsHostFilterTableClear = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("idle", 1), ("clear", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsHostFilterTableClear.setStatus('current')
xsSubnet = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 4))
xsSubnetControlTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1), )
if mibBuilder.loadTexts: xsSubnetControlTable.setStatus('current')
xsSubnetControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1), ).setIndexNames((0, "SMON2-MIB", "xsSubnetControlIndex"))
if mibBuilder.loadTexts: xsSubnetControlEntry.setStatus('current')
xsSubnetControlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: xsSubnetControlIndex.setStatus('current')
xsSubnetControlDataSource = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 2), DataSource()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetControlDataSource.setStatus('current')
xsSubnetControlInserts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetControlInserts.setStatus('current')
xsSubnetControlDeletes = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetControlDeletes.setStatus('current')
xsSubnetControlMaxDesiredEntries = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetControlMaxDesiredEntries.setStatus('current')
xsSubnetControlOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 6), OwnerString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetControlOwner.setStatus('current')
xsSubnetControlStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 7), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetControlStatus.setStatus('current')
xsSubnetTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2), )
if mibBuilder.loadTexts: xsSubnetTable.setStatus('current')
xsSubnetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1), ).setIndexNames((0, "SMON2-MIB", "xsSubnetControlIndex"), (0, "SMON2-MIB", "xsSubnetTimeMark"), (0, "RMON2-MIB", "protocolDirLocalIndex"), (0, "SMON2-MIB", "xsSubnetAddress"), (0, "SMON2-MIB", "xsSubnetMask"), (0, "RMON2-MIB", "protocolDirLocalIndex"))
if mibBuilder.loadTexts: xsSubnetEntry.setStatus('current')
xsSubnetTimeMark = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 1), TimeFilter())
if mibBuilder.loadTexts: xsSubnetTimeMark.setStatus('current')
xsSubnetAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 2), OctetString())
if mibBuilder.loadTexts: xsSubnetAddress.setStatus('current')
xsSubnetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 3), OctetString())
if mibBuilder.loadTexts: xsSubnetMask.setStatus('current')
xsSubnetInPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 4), ZeroBasedCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetInPkts.setStatus('current')
xsSubnetOutPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 5), ZeroBasedCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetOutPkts.setStatus('current')
xsSubnetCreateTime = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 6), LastCreateTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetCreateTime.setStatus('current')
xsSubnetMatrixControlTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3), )
if mibBuilder.loadTexts: xsSubnetMatrixControlTable.setStatus('current')
xsSubnetMatrixControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1), ).setIndexNames((0, "SMON2-MIB", "xsSubnetMatrixControlIndex"))
if mibBuilder.loadTexts: xsSubnetMatrixControlEntry.setStatus('current')
xsSubnetMatrixControlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: xsSubnetMatrixControlIndex.setStatus('current')
xsSubnetMatrixControlDataSource = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 2), DataSource()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetMatrixControlDataSource.setStatus('current')
xsSubnetMatrixControlInserts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetMatrixControlInserts.setStatus('current')
xsSubnetMatrixControlDeletes = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetMatrixControlDeletes.setStatus('current')
xsSubnetMatrixControlMaxDesiredEntries = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetMatrixControlMaxDesiredEntries.setStatus('current')
xsSubnetMatrixControlOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 7), OwnerString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetMatrixControlOwner.setStatus('current')
xsSubnetMatrixControlStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 8), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: xsSubnetMatrixControlStatus.setStatus('current')
xsSubnetMatrixSDTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4), )
if mibBuilder.loadTexts: xsSubnetMatrixSDTable.setStatus('current')
xsSubnetMatrixSDEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1), ).setIndexNames((0, "SMON2-MIB", "xsSubnetMatrixControlIndex"), (0, "SMON2-MIB", "xsSubnetMatrixSDTimeMark"), (0, "RMON2-MIB", "protocolDirLocalIndex"), (0, "SMON2-MIB", "xsSubnetMatrixSDSourceAddress"), (0, "SMON2-MIB", "xsSubnetMatrixSDSourceMask"), (0, "SMON2-MIB", "xsSubnetMatrixSDDestAddress"), (0, "SMON2-MIB", "xsSubnetMatrixSDDestMask"), (0, "RMON2-MIB", "protocolDirLocalIndex"))
if mibBuilder.loadTexts: xsSubnetMatrixSDEntry.setStatus('current')
xsSubnetMatrixSDTimeMark = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 1), TimeFilter())
if mibBuilder.loadTexts: xsSubnetMatrixSDTimeMark.setStatus('current')
xsSubnetMatrixSDSourceAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 2), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixSDSourceAddress.setStatus('current')
xsSubnetMatrixSDSourceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 3), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixSDSourceMask.setStatus('current')
xsSubnetMatrixSDDestAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 4), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixSDDestAddress.setStatus('current')
xsSubnetMatrixSDDestMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 5), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixSDDestMask.setStatus('current')
xsSubnetMatrixSDPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 6), ZeroBasedCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetMatrixSDPkts.setStatus('current')
xsSubnetMatrixSDCreateTime = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 7), LastCreateTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetMatrixSDCreateTime.setStatus('current')
xsSubnetMatrixDSTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5), )
if mibBuilder.loadTexts: xsSubnetMatrixDSTable.setStatus('current')
xsSubnetMatrixDSEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1), ).setIndexNames((0, "RMON2-MIB", "hlMatrixControlIndex"), (0, "SMON2-MIB", "xsSubnetMatrixDSTimeMark"), (0, "RMON2-MIB", "protocolDirLocalIndex"), (0, "SMON2-MIB", "xsSubnetMatrixDSDestAddress"), (0, "SMON2-MIB", "xsSubnetMatrixDSDestMask"), (0, "SMON2-MIB", "xsSubnetMatrixDSSourceAddress"), (0, "SMON2-MIB", "xsSubnetMatrixDSSourceMask"), (0, "RMON2-MIB", "protocolDirLocalIndex"))
if mibBuilder.loadTexts: xsSubnetMatrixDSEntry.setStatus('current')
xsSubnetMatrixDSTimeMark = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 1), TimeFilter())
if mibBuilder.loadTexts: xsSubnetMatrixDSTimeMark.setStatus('current')
xsSubnetMatrixDSSourceAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 2), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixDSSourceAddress.setStatus('current')
xsSubnetMatrixDSSourceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 3), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixDSSourceMask.setStatus('current')
xsSubnetMatrixDSDestAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 4), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixDSDestAddress.setStatus('current')
xsSubnetMatrixDSDestMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 5), OctetString())
if mibBuilder.loadTexts: xsSubnetMatrixDSDestMask.setStatus('current')
xsSubnetMatrixDSPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 6), ZeroBasedCounter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetMatrixDSPkts.setStatus('current')
xsSubnetMatrixDSCreateTime = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 7), LastCreateTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetMatrixDSCreateTime.setStatus('current')
xsNumberOfProtocols = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsNumberOfProtocols.setStatus('current')
xsProtocolDistStatsTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 6), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsProtocolDistStatsTimeStamp.setStatus('current')
xsNlHostTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 7), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsNlHostTimeStamp.setStatus('current')
xsSubnetStatsTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 8), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsSubnetStatsTimeStamp.setStatus('current')
xsActiveApplications = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 9))
xsActiveApplicationsBitMask = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(128, 128)).setFixedLength(128)).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsActiveApplicationsBitMask.setStatus('current')
xsActiveApplicationsTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2), )
if mibBuilder.loadTexts: xsActiveApplicationsTable.setStatus('current')
xsActiveApplicationsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2, 1), ).setIndexNames((0, "SMON2-MIB", "xsActiveApplicationsIndex"))
if mibBuilder.loadTexts: xsActiveApplicationsEntry.setStatus('current')
xsActiveApplicationsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2, 1, 1), Integer32())
if mibBuilder.loadTexts: xsActiveApplicationsIndex.setStatus('current')
xsActiveApplicationsPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: xsActiveApplicationsPkts.setStatus('current')
xsSmonStatus = MibScalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("operate", 1), ("paused", 2))).clone('paused')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: xsSmonStatus.setStatus('current')
drSmon = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 4))
drSmonConfiguration = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 1))
drSmonControlTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1), )
if mibBuilder.loadTexts: drSmonControlTable.setStatus('current')
drSmonControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1), ).setIndexNames((0, "SMON2-MIB", "drSmonControlModuleID"))
if mibBuilder.loadTexts: drSmonControlEntry.setStatus('current')
drSmonControlModuleID = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: drSmonControlModuleID.setStatus('current')
drSmonControlRowAddressAutoLearnMode = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 255))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("notSupported", 255)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: drSmonControlRowAddressAutoLearnMode.setStatus('current')
drSmonControlRoutedPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonControlRoutedPackets.setStatus('current')
drSmonControlProtocolDistStatsTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 4), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonControlProtocolDistStatsTimeStamp.setStatus('current')
drSmonControlMatrixRows = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonControlMatrixRows.setStatus('current')
drSmonControlMatrixCols = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonControlMatrixCols.setStatus('current')
drSmonEntityPlacementTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2), )
if mibBuilder.loadTexts: drSmonEntityPlacementTable.setStatus('current')
drSmonEntityPlacementEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1), ).setIndexNames((0, "SMON2-MIB", "drSmonEntityPlacementModuleID"), (0, "SMON2-MIB", "drSmonEntityPlacementIndex"))
if mibBuilder.loadTexts: drSmonEntityPlacementEntry.setStatus('current')
drSmonEntityPlacementModuleID = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: drSmonEntityPlacementModuleID.setStatus('current')
drSmonEntityPlacementIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: drSmonEntityPlacementIndex.setStatus('current')
drSmonEntityPlacementAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonEntityPlacementAddress.setStatus('current')
drSmonEntityPlacementMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 4), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonEntityPlacementMask.setStatus('current')
drSmonEntityPlacementType = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("empty", 1), ("autoLearn", 2), ("filter", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonEntityPlacementType.setStatus('current')
drSmonProtocolDir = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 2))
drSmonProtocolDirLCTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1), )
if mibBuilder.loadTexts: drSmonProtocolDirLCTable.setStatus('current')
drSmonProtocolDirLCEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1, 1), ).setIndexNames((0, "SMON2-MIB", "drSmonProtocolDirLCModuleID"))
if mibBuilder.loadTexts: drSmonProtocolDirLCEntry.setStatus('current')
drSmonProtocolDirLCModuleID = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: drSmonProtocolDirLCModuleID.setStatus('current')
drSmonProtocolDirLCLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1, 1, 2), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonProtocolDirLCLastChange.setStatus('current')
drSmonProtocolDirTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2), )
if mibBuilder.loadTexts: drSmonProtocolDirTable.setStatus('current')
drSmonProtocolDirEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1), ).setIndexNames((0, "SMON2-MIB", "drSmonProtocolDirModuleID"), (0, "SMON2-MIB", "drSmonProtocolDirID"), (0, "SMON2-MIB", "drSmonProtocolDirParameters"))
if mibBuilder.loadTexts: drSmonProtocolDirEntry.setStatus('current')
drSmonProtocolDirModuleID = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: drSmonProtocolDirModuleID.setStatus('current')
drSmonProtocolDirID = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 2), OctetString())
if mibBuilder.loadTexts: drSmonProtocolDirID.setStatus('current')
drSmonProtocolDirParameters = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 3), OctetString())
if mibBuilder.loadTexts: drSmonProtocolDirParameters.setStatus('current')
drSmonProtocolDirLocalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonProtocolDirLocalIndex.setStatus('current')
drSmonProtocolDirDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonProtocolDirDescr.setStatus('current')
drSmonProtocolDirType = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 6), Bits().clone(namedValues=NamedValues(("extensible", 0), ("addressRecognitionCapable", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonProtocolDirType.setStatus('current')
drSmonProtocolDirAddressMapConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notSupported", 1), ("supportedOff", 2), ("supportedOn", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonProtocolDirAddressMapConfig.setStatus('current')
drSmonProtocolDirHostConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notSupported", 1), ("supportedOff", 2), ("supportedOn", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonProtocolDirHostConfig.setStatus('current')
drSmonProtocolDirMatrixConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notSupported", 1), ("supportedOff", 2), ("supportedOn", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonProtocolDirMatrixConfig.setStatus('current')
drSmonProtocolDirOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 10), OwnerString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonProtocolDirOwner.setStatus('current')
drSmonProtocolDirStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 11), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonProtocolDirStatus.setStatus('current')
drSmonFilter = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 3))
drSmonFilterTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1), )
if mibBuilder.loadTexts: drSmonFilterTable.setStatus('current')
drSmonFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1), ).setIndexNames((0, "SMON2-MIB", "drSmonFilterModuleID"), (0, "SMON2-MIB", "drSmonFilterIndex"))
if mibBuilder.loadTexts: drSmonFilterEntry.setStatus('current')
drSmonFilterModuleID = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: drSmonFilterModuleID.setStatus('current')
drSmonFilterIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: drSmonFilterIndex.setStatus('current')
drSmonFilterAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 3), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonFilterAddress.setStatus('current')
drSmonFilterMask = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 4), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonFilterMask.setStatus('current')
drSmonFilterStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: drSmonFilterStatus.setStatus('current')
drSmonActiveApplications = MibIdentifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 4))
drSmonActiveApplicationsTable = MibTable((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1), )
if mibBuilder.loadTexts: drSmonActiveApplicationsTable.setStatus('current')
drSmonActiveApplicationsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1), ).setIndexNames((0, "SMON2-MIB", "drSmonActiveApplicationsModuleID"), (0, "SMON2-MIB", "drSmonActiveApplicationsType"), (0, "SMON2-MIB", "drSmonActiveApplicationsSubType"))
if mibBuilder.loadTexts: drSmonActiveApplicationsEntry.setStatus('current')
drSmonActiveApplicationsModuleID = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: drSmonActiveApplicationsModuleID.setStatus('current')
drSmonActiveApplicationsType = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("ethertype", 1), ("ipProtocol", 2), ("udpProtocol", 3), ("tcpProtocol", 4))))
if mibBuilder.loadTexts: drSmonActiveApplicationsType.setStatus('current')
drSmonActiveApplicationsSubType = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 3), Integer32())
if mibBuilder.loadTexts: drSmonActiveApplicationsSubType.setStatus('current')
drSmonActiveApplicationsPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: drSmonActiveApplicationsPkts.setStatus('current')
mibBuilder.exportSymbols("SMON2-MIB", xsSubnetMatrixDSSourceAddress=xsSubnetMatrixDSSourceAddress, xsActiveApplications=xsActiveApplications, drSmonProtocolDir=drSmonProtocolDir, drSmonControlRoutedPackets=drSmonControlRoutedPackets, xsFilter=xsFilter, xsHostTopNControlStatus=xsHostTopNControlStatus, xsSmon=xsSmon, drSmonProtocolDirHostConfig=drSmonProtocolDirHostConfig, drSmonFilter=drSmonFilter, xsSubnetMatrixControlMaxDesiredEntries=xsSubnetMatrixControlMaxDesiredEntries, xsSubnetMatrixDSSourceMask=xsSubnetMatrixDSSourceMask, xsSubnetControlEntry=xsSubnetControlEntry, xsSubnetEntry=xsSubnetEntry, xsSubnetMatrixSDTable=xsSubnetMatrixSDTable, drSmonConfiguration=drSmonConfiguration, drSmonControlMatrixRows=drSmonControlMatrixRows, drSmonProtocolDirStatus=drSmonProtocolDirStatus, xsHostFilterEntry=xsHostFilterEntry, drSmonControlModuleID=drSmonControlModuleID, drSmonEntityPlacementEntry=drSmonEntityPlacementEntry, xsSubnetControlTable=xsSubnetControlTable, drSmonProtocolDirAddressMapConfig=drSmonProtocolDirAddressMapConfig, drSmonActiveApplications=drSmonActiveApplications, drSmonEntityPlacementAddress=drSmonEntityPlacementAddress, xsSubnetControlMaxDesiredEntries=xsSubnetControlMaxDesiredEntries, xsSubnetAddress=xsSubnetAddress, xsSubnetMask=xsSubnetMask, drSmonProtocolDirID=drSmonProtocolDirID, drSmonProtocolDirModuleID=drSmonProtocolDirModuleID, drSmonControlEntry=drSmonControlEntry, drSmonActiveApplicationsSubType=drSmonActiveApplicationsSubType, drSmonEntityPlacementIndex=drSmonEntityPlacementIndex, drSmonProtocolDirMatrixConfig=drSmonProtocolDirMatrixConfig, xsHostTopNControlEntry=xsHostTopNControlEntry, drSmonActiveApplicationsEntry=drSmonActiveApplicationsEntry, drSmonProtocolDirParameters=drSmonProtocolDirParameters, xsSubnetControlOwner=xsSubnetControlOwner, xsSubnetMatrixSDPkts=xsSubnetMatrixSDPkts, drSmonProtocolDirLCLastChange=drSmonProtocolDirLCLastChange, drSmonEntityPlacementTable=drSmonEntityPlacementTable, drSmonControlProtocolDistStatsTimeStamp=drSmonControlProtocolDistStatsTimeStamp, drSmonEntityPlacementModuleID=drSmonEntityPlacementModuleID, xsHostTopNControlTimeRemaining=xsHostTopNControlTimeRemaining, drSmonFilterTable=drSmonFilterTable, drSmonEntityPlacementType=drSmonEntityPlacementType, xsSubnetMatrixControlInserts=xsSubnetMatrixControlInserts, xsHostFilterIpSubnet=xsHostFilterIpSubnet, xsHostTopNControlHostIndex=xsHostTopNControlHostIndex, xsSubnetControlInserts=xsSubnetControlInserts, xsSubnetMatrixSDTimeMark=xsSubnetMatrixSDTimeMark, xsHostFilterTableClear=xsHostFilterTableClear, xsSubnetInPkts=xsSubnetInPkts, xsHostFilterType=xsHostFilterType, drSmon=drSmon, xsHostTopNControlGrantedSize=xsHostTopNControlGrantedSize, xsHostTopNControlRequestedSize=xsHostTopNControlRequestedSize, xsActiveApplicationsEntry=xsActiveApplicationsEntry, drSmonActiveApplicationsTable=drSmonActiveApplicationsTable, drSmonFilterAddress=drSmonFilterAddress, xsHostTopNProtocolDirLocalIndex=xsHostTopNProtocolDirLocalIndex, xsProtocolDistStatsTimeStamp=xsProtocolDistStatsTimeStamp, drSmonFilterModuleID=drSmonFilterModuleID, drSmonControlMatrixCols=drSmonControlMatrixCols, xsSubnetMatrixDSTable=xsSubnetMatrixDSTable, xsHostTopNControlIndex=xsHostTopNControlIndex, xsSubnet=xsSubnet, xsHostTopNControlOwner=xsHostTopNControlOwner, xsSubnetMatrixDSCreateTime=xsSubnetMatrixDSCreateTime, xsHostTopNIndex=xsHostTopNIndex, xsSubnetTimeMark=xsSubnetTimeMark, xsSubnetMatrixDSPkts=xsSubnetMatrixDSPkts, drSmonProtocolDirLCModuleID=drSmonProtocolDirLCModuleID, xsSubnetMatrixSDSourceMask=xsSubnetMatrixSDSourceMask, drSmonProtocolDirLCEntry=drSmonProtocolDirLCEntry, xsHostTopNControlDuration=xsHostTopNControlDuration, drSmonControlRowAddressAutoLearnMode=drSmonControlRowAddressAutoLearnMode, xsSubnetMatrixSDDestAddress=xsSubnetMatrixSDDestAddress, xsSubnetMatrixSDDestMask=xsSubnetMatrixSDDestMask, xsHostTopNNlAddress=xsHostTopNNlAddress, xsSubnetMatrixDSTimeMark=xsSubnetMatrixDSTimeMark, drSmonActiveApplicationsPkts=drSmonActiveApplicationsPkts, drSmonProtocolDirDescr=drSmonProtocolDirDescr, xsHostFilterIpMask=xsHostFilterIpMask, drSmonProtocolDirLocalIndex=drSmonProtocolDirLocalIndex, xsHostFilterStatus=xsHostFilterStatus, xsSubnetMatrixControlEntry=xsSubnetMatrixControlEntry, drSmonEntityPlacementMask=drSmonEntityPlacementMask, xsHostFilterIpxAddress=xsHostFilterIpxAddress, drSmonActiveApplicationsType=drSmonActiveApplicationsType, xsNlHostTimeStamp=xsNlHostTimeStamp, xsSubnetMatrixControlStatus=xsSubnetMatrixControlStatus, xsSubnetMatrixControlDataSource=xsSubnetMatrixControlDataSource, xsHostTopNControlStartTime=xsHostTopNControlStartTime, xsSubnetMatrixControlIndex=xsSubnetMatrixControlIndex, xsSubnetMatrixDSDestMask=xsSubnetMatrixDSDestMask, xsNumberOfProtocols=xsNumberOfProtocols, xsActiveApplicationsBitMask=xsActiveApplicationsBitMask, xsActiveApplicationsIndex=xsActiveApplicationsIndex, xsHostTopNEntry=xsHostTopNEntry, drSmonProtocolDirTable=drSmonProtocolDirTable, xsSubnetControlStatus=xsSubnetControlStatus, xsSubnetMatrixControlOwner=xsSubnetMatrixControlOwner, xsSubnetMatrixControlTable=xsSubnetMatrixControlTable, xsSmonStatus=xsSmonStatus, xsSubnetControlIndex=xsSubnetControlIndex, drSmonFilterEntry=drSmonFilterEntry, drSmonProtocolDirEntry=drSmonProtocolDirEntry, drSmonFilterStatus=drSmonFilterStatus, xsHostTopN=xsHostTopN, xsSubnetControlDataSource=xsSubnetControlDataSource, xsSmonResourceAllocation=xsSmonResourceAllocation, drSmonProtocolDirLCTable=drSmonProtocolDirLCTable, drSmonFilterIndex=drSmonFilterIndex, xsSubnetMatrixSDSourceAddress=xsSubnetMatrixSDSourceAddress, xsSubnetMatrixSDCreateTime=xsSubnetMatrixSDCreateTime, xsHostTopNRate=xsHostTopNRate, xsHostFilterIpAddress=xsHostFilterIpAddress, xsSubnetOutPkts=xsSubnetOutPkts, xsSubnetMatrixControlDeletes=xsSubnetMatrixControlDeletes, drSmonProtocolDirOwner=drSmonProtocolDirOwner, xsSubnetMatrixDSDestAddress=xsSubnetMatrixDSDestAddress, xsSubnetControlDeletes=xsSubnetControlDeletes, xsSubnetCreateTime=xsSubnetCreateTime, xsActiveApplicationsTable=xsActiveApplicationsTable, drSmonControlTable=drSmonControlTable, xsHostTopNTable=xsHostTopNTable, drSmonProtocolDirType=drSmonProtocolDirType, drSmonActiveApplicationsModuleID=drSmonActiveApplicationsModuleID, xsSubnetTable=xsSubnetTable, drSmonFilterMask=drSmonFilterMask, xsActiveApplicationsPkts=xsActiveApplicationsPkts, xsSubnetStatsTimeStamp=xsSubnetStatsTimeStamp, xsSubnetMatrixDSEntry=xsSubnetMatrixDSEntry, xsHostTopNControlRateBase=xsHostTopNControlRateBase, xsSubnetMatrixSDEntry=xsSubnetMatrixSDEntry, xsHostFilterTable=xsHostFilterTable, xsHostTopNControlTable=xsHostTopNControlTable)
| (smon,) = mibBuilder.importSymbols('APPLIC-MIB', 'smon')
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, value_size_constraint, constraints_union, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint')
(owner_string,) = mibBuilder.importSymbols('RMON-MIB', 'OwnerString')
(data_source, last_create_time, time_filter, hl_matrix_control_index, zero_based_counter32, protocol_dir_local_index) = mibBuilder.importSymbols('RMON2-MIB', 'DataSource', 'LastCreateTime', 'TimeFilter', 'hlMatrixControlIndex', 'ZeroBasedCounter32', 'protocolDirLocalIndex')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(counter32, unsigned32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, object_identity, mib_identifier, integer32, time_ticks, iso, notification_type, counter64, bits, module_identity, gauge32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Unsigned32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'ObjectIdentity', 'MibIdentifier', 'Integer32', 'TimeTicks', 'iso', 'NotificationType', 'Counter64', 'Bits', 'ModuleIdentity', 'Gauge32')
(time_stamp, textual_convention, row_status, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TimeStamp', 'TextualConvention', 'RowStatus', 'DisplayString')
xs_smon = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 2))
xs_smon_resource_allocation = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 1), octet_string().subtype(subtypeSpec=value_size_constraint(4, 4)).setFixedLength(4)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSmonResourceAllocation.setStatus('current')
xs_host_top_n = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 2))
xs_host_top_n_control_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1))
if mibBuilder.loadTexts:
xsHostTopNControlTable.setStatus('current')
xs_host_top_n_control_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1)).setIndexNames((0, 'SMON2-MIB', 'xsHostTopNControlIndex'))
if mibBuilder.loadTexts:
xsHostTopNControlEntry.setStatus('current')
xs_host_top_n_control_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
xsHostTopNControlIndex.setStatus('current')
xs_host_top_n_control_host_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsHostTopNControlHostIndex.setStatus('current')
xs_host_top_n_control_rate_base = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('xsHostTopNInPkts', 1), ('xsHostTopNOutPkts', 2), ('xsHostTopNInOctets', 3), ('xsHostTopNOutOctets', 4)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsHostTopNControlRateBase.setStatus('current')
xs_host_top_n_control_time_remaining = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsHostTopNControlTimeRemaining.setStatus('current')
xs_host_top_n_control_duration = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsHostTopNControlDuration.setStatus('current')
xs_host_top_n_control_requested_size = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647)).clone(150)).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsHostTopNControlRequestedSize.setStatus('current')
xs_host_top_n_control_granted_size = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsHostTopNControlGrantedSize.setStatus('current')
xs_host_top_n_control_start_time = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 8), time_stamp()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsHostTopNControlStartTime.setStatus('current')
xs_host_top_n_control_owner = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 9), owner_string()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsHostTopNControlOwner.setStatus('current')
xs_host_top_n_control_status = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 1, 1, 10), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsHostTopNControlStatus.setStatus('current')
xs_host_top_n_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2))
if mibBuilder.loadTexts:
xsHostTopNTable.setStatus('current')
xs_host_top_n_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1)).setIndexNames((0, 'SMON2-MIB', 'xsHostTopNControlIndex'), (0, 'SMON2-MIB', 'xsHostTopNIndex'))
if mibBuilder.loadTexts:
xsHostTopNEntry.setStatus('current')
xs_host_top_n_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
xsHostTopNIndex.setStatus('current')
xs_host_top_n_protocol_dir_local_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsHostTopNProtocolDirLocalIndex.setStatus('current')
xs_host_top_n_nl_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 3), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsHostTopNNlAddress.setStatus('current')
xs_host_top_n_rate = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 2, 2, 1, 4), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsHostTopNRate.setStatus('current')
xs_filter = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 3))
xs_host_filter_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1))
if mibBuilder.loadTexts:
xsHostFilterTable.setStatus('current')
xs_host_filter_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1)).setIndexNames((0, 'SMON2-MIB', 'xsHostFilterIpAddress'))
if mibBuilder.loadTexts:
xsHostFilterEntry.setStatus('current')
xs_host_filter_type = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('ipHost', 1), ('ipSubnet', 2), ('ipxNet', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsHostFilterType.setStatus('current')
xs_host_filter_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 2), octet_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsHostFilterIpAddress.setStatus('current')
xs_host_filter_ip_subnet = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 3), octet_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsHostFilterIpSubnet.setStatus('current')
xs_host_filter_ip_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 4), octet_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsHostFilterIpMask.setStatus('current')
xs_host_filter_ipx_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 5), octet_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsHostFilterIpxAddress.setStatus('current')
xs_host_filter_status = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 4))).clone(namedValues=named_values(('valid', 1), ('invalid', 4)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsHostFilterStatus.setStatus('current')
xs_host_filter_table_clear = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 3, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('idle', 1), ('clear', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsHostFilterTableClear.setStatus('current')
xs_subnet = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 4))
xs_subnet_control_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1))
if mibBuilder.loadTexts:
xsSubnetControlTable.setStatus('current')
xs_subnet_control_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1)).setIndexNames((0, 'SMON2-MIB', 'xsSubnetControlIndex'))
if mibBuilder.loadTexts:
xsSubnetControlEntry.setStatus('current')
xs_subnet_control_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
xsSubnetControlIndex.setStatus('current')
xs_subnet_control_data_source = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 2), data_source()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetControlDataSource.setStatus('current')
xs_subnet_control_inserts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetControlInserts.setStatus('current')
xs_subnet_control_deletes = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetControlDeletes.setStatus('current')
xs_subnet_control_max_desired_entries = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2147483647))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetControlMaxDesiredEntries.setStatus('current')
xs_subnet_control_owner = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 6), owner_string()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetControlOwner.setStatus('current')
xs_subnet_control_status = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 1, 1, 7), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetControlStatus.setStatus('current')
xs_subnet_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2))
if mibBuilder.loadTexts:
xsSubnetTable.setStatus('current')
xs_subnet_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1)).setIndexNames((0, 'SMON2-MIB', 'xsSubnetControlIndex'), (0, 'SMON2-MIB', 'xsSubnetTimeMark'), (0, 'RMON2-MIB', 'protocolDirLocalIndex'), (0, 'SMON2-MIB', 'xsSubnetAddress'), (0, 'SMON2-MIB', 'xsSubnetMask'), (0, 'RMON2-MIB', 'protocolDirLocalIndex'))
if mibBuilder.loadTexts:
xsSubnetEntry.setStatus('current')
xs_subnet_time_mark = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 1), time_filter())
if mibBuilder.loadTexts:
xsSubnetTimeMark.setStatus('current')
xs_subnet_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 2), octet_string())
if mibBuilder.loadTexts:
xsSubnetAddress.setStatus('current')
xs_subnet_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 3), octet_string())
if mibBuilder.loadTexts:
xsSubnetMask.setStatus('current')
xs_subnet_in_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 4), zero_based_counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetInPkts.setStatus('current')
xs_subnet_out_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 5), zero_based_counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetOutPkts.setStatus('current')
xs_subnet_create_time = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 2, 1, 6), last_create_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetCreateTime.setStatus('current')
xs_subnet_matrix_control_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3))
if mibBuilder.loadTexts:
xsSubnetMatrixControlTable.setStatus('current')
xs_subnet_matrix_control_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1)).setIndexNames((0, 'SMON2-MIB', 'xsSubnetMatrixControlIndex'))
if mibBuilder.loadTexts:
xsSubnetMatrixControlEntry.setStatus('current')
xs_subnet_matrix_control_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
xsSubnetMatrixControlIndex.setStatus('current')
xs_subnet_matrix_control_data_source = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 2), data_source()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetMatrixControlDataSource.setStatus('current')
xs_subnet_matrix_control_inserts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetMatrixControlInserts.setStatus('current')
xs_subnet_matrix_control_deletes = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetMatrixControlDeletes.setStatus('current')
xs_subnet_matrix_control_max_desired_entries = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(-1, 2147483647))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetMatrixControlMaxDesiredEntries.setStatus('current')
xs_subnet_matrix_control_owner = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 7), owner_string()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetMatrixControlOwner.setStatus('current')
xs_subnet_matrix_control_status = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 3, 1, 8), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
xsSubnetMatrixControlStatus.setStatus('current')
xs_subnet_matrix_sd_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4))
if mibBuilder.loadTexts:
xsSubnetMatrixSDTable.setStatus('current')
xs_subnet_matrix_sd_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1)).setIndexNames((0, 'SMON2-MIB', 'xsSubnetMatrixControlIndex'), (0, 'SMON2-MIB', 'xsSubnetMatrixSDTimeMark'), (0, 'RMON2-MIB', 'protocolDirLocalIndex'), (0, 'SMON2-MIB', 'xsSubnetMatrixSDSourceAddress'), (0, 'SMON2-MIB', 'xsSubnetMatrixSDSourceMask'), (0, 'SMON2-MIB', 'xsSubnetMatrixSDDestAddress'), (0, 'SMON2-MIB', 'xsSubnetMatrixSDDestMask'), (0, 'RMON2-MIB', 'protocolDirLocalIndex'))
if mibBuilder.loadTexts:
xsSubnetMatrixSDEntry.setStatus('current')
xs_subnet_matrix_sd_time_mark = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 1), time_filter())
if mibBuilder.loadTexts:
xsSubnetMatrixSDTimeMark.setStatus('current')
xs_subnet_matrix_sd_source_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 2), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixSDSourceAddress.setStatus('current')
xs_subnet_matrix_sd_source_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 3), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixSDSourceMask.setStatus('current')
xs_subnet_matrix_sd_dest_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 4), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixSDDestAddress.setStatus('current')
xs_subnet_matrix_sd_dest_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 5), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixSDDestMask.setStatus('current')
xs_subnet_matrix_sd_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 6), zero_based_counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetMatrixSDPkts.setStatus('current')
xs_subnet_matrix_sd_create_time = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 4, 1, 7), last_create_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetMatrixSDCreateTime.setStatus('current')
xs_subnet_matrix_ds_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5))
if mibBuilder.loadTexts:
xsSubnetMatrixDSTable.setStatus('current')
xs_subnet_matrix_ds_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1)).setIndexNames((0, 'RMON2-MIB', 'hlMatrixControlIndex'), (0, 'SMON2-MIB', 'xsSubnetMatrixDSTimeMark'), (0, 'RMON2-MIB', 'protocolDirLocalIndex'), (0, 'SMON2-MIB', 'xsSubnetMatrixDSDestAddress'), (0, 'SMON2-MIB', 'xsSubnetMatrixDSDestMask'), (0, 'SMON2-MIB', 'xsSubnetMatrixDSSourceAddress'), (0, 'SMON2-MIB', 'xsSubnetMatrixDSSourceMask'), (0, 'RMON2-MIB', 'protocolDirLocalIndex'))
if mibBuilder.loadTexts:
xsSubnetMatrixDSEntry.setStatus('current')
xs_subnet_matrix_ds_time_mark = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 1), time_filter())
if mibBuilder.loadTexts:
xsSubnetMatrixDSTimeMark.setStatus('current')
xs_subnet_matrix_ds_source_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 2), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixDSSourceAddress.setStatus('current')
xs_subnet_matrix_ds_source_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 3), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixDSSourceMask.setStatus('current')
xs_subnet_matrix_ds_dest_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 4), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixDSDestAddress.setStatus('current')
xs_subnet_matrix_ds_dest_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 5), octet_string())
if mibBuilder.loadTexts:
xsSubnetMatrixDSDestMask.setStatus('current')
xs_subnet_matrix_ds_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 6), zero_based_counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetMatrixDSPkts.setStatus('current')
xs_subnet_matrix_ds_create_time = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 4, 5, 1, 7), last_create_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetMatrixDSCreateTime.setStatus('current')
xs_number_of_protocols = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsNumberOfProtocols.setStatus('current')
xs_protocol_dist_stats_time_stamp = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 6), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsProtocolDistStatsTimeStamp.setStatus('current')
xs_nl_host_time_stamp = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 7), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsNlHostTimeStamp.setStatus('current')
xs_subnet_stats_time_stamp = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 8), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsSubnetStatsTimeStamp.setStatus('current')
xs_active_applications = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 2, 9))
xs_active_applications_bit_mask = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 1), octet_string().subtype(subtypeSpec=value_size_constraint(128, 128)).setFixedLength(128)).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsActiveApplicationsBitMask.setStatus('current')
xs_active_applications_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2))
if mibBuilder.loadTexts:
xsActiveApplicationsTable.setStatus('current')
xs_active_applications_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2, 1)).setIndexNames((0, 'SMON2-MIB', 'xsActiveApplicationsIndex'))
if mibBuilder.loadTexts:
xsActiveApplicationsEntry.setStatus('current')
xs_active_applications_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2, 1, 1), integer32())
if mibBuilder.loadTexts:
xsActiveApplicationsIndex.setStatus('current')
xs_active_applications_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 2, 9, 2, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
xsActiveApplicationsPkts.setStatus('current')
xs_smon_status = mib_scalar((1, 3, 6, 1, 4, 1, 81, 30, 2, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('operate', 1), ('paused', 2))).clone('paused')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
xsSmonStatus.setStatus('current')
dr_smon = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 4))
dr_smon_configuration = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 1))
dr_smon_control_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1))
if mibBuilder.loadTexts:
drSmonControlTable.setStatus('current')
dr_smon_control_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1)).setIndexNames((0, 'SMON2-MIB', 'drSmonControlModuleID'))
if mibBuilder.loadTexts:
drSmonControlEntry.setStatus('current')
dr_smon_control_module_id = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)))
if mibBuilder.loadTexts:
drSmonControlModuleID.setStatus('current')
dr_smon_control_row_address_auto_learn_mode = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 255))).clone(namedValues=named_values(('enable', 1), ('disable', 2), ('notSupported', 255)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
drSmonControlRowAddressAutoLearnMode.setStatus('current')
dr_smon_control_routed_packets = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonControlRoutedPackets.setStatus('current')
dr_smon_control_protocol_dist_stats_time_stamp = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 4), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonControlProtocolDistStatsTimeStamp.setStatus('current')
dr_smon_control_matrix_rows = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonControlMatrixRows.setStatus('current')
dr_smon_control_matrix_cols = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonControlMatrixCols.setStatus('current')
dr_smon_entity_placement_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2))
if mibBuilder.loadTexts:
drSmonEntityPlacementTable.setStatus('current')
dr_smon_entity_placement_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1)).setIndexNames((0, 'SMON2-MIB', 'drSmonEntityPlacementModuleID'), (0, 'SMON2-MIB', 'drSmonEntityPlacementIndex'))
if mibBuilder.loadTexts:
drSmonEntityPlacementEntry.setStatus('current')
dr_smon_entity_placement_module_id = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)))
if mibBuilder.loadTexts:
drSmonEntityPlacementModuleID.setStatus('current')
dr_smon_entity_placement_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
drSmonEntityPlacementIndex.setStatus('current')
dr_smon_entity_placement_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 3), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonEntityPlacementAddress.setStatus('current')
dr_smon_entity_placement_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 4), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonEntityPlacementMask.setStatus('current')
dr_smon_entity_placement_type = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 1, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('empty', 1), ('autoLearn', 2), ('filter', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonEntityPlacementType.setStatus('current')
dr_smon_protocol_dir = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 2))
dr_smon_protocol_dir_lc_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1))
if mibBuilder.loadTexts:
drSmonProtocolDirLCTable.setStatus('current')
dr_smon_protocol_dir_lc_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1, 1)).setIndexNames((0, 'SMON2-MIB', 'drSmonProtocolDirLCModuleID'))
if mibBuilder.loadTexts:
drSmonProtocolDirLCEntry.setStatus('current')
dr_smon_protocol_dir_lc_module_id = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)))
if mibBuilder.loadTexts:
drSmonProtocolDirLCModuleID.setStatus('current')
dr_smon_protocol_dir_lc_last_change = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 1, 1, 2), time_stamp()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonProtocolDirLCLastChange.setStatus('current')
dr_smon_protocol_dir_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2))
if mibBuilder.loadTexts:
drSmonProtocolDirTable.setStatus('current')
dr_smon_protocol_dir_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1)).setIndexNames((0, 'SMON2-MIB', 'drSmonProtocolDirModuleID'), (0, 'SMON2-MIB', 'drSmonProtocolDirID'), (0, 'SMON2-MIB', 'drSmonProtocolDirParameters'))
if mibBuilder.loadTexts:
drSmonProtocolDirEntry.setStatus('current')
dr_smon_protocol_dir_module_id = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)))
if mibBuilder.loadTexts:
drSmonProtocolDirModuleID.setStatus('current')
dr_smon_protocol_dir_id = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 2), octet_string())
if mibBuilder.loadTexts:
drSmonProtocolDirID.setStatus('current')
dr_smon_protocol_dir_parameters = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 3), octet_string())
if mibBuilder.loadTexts:
drSmonProtocolDirParameters.setStatus('current')
dr_smon_protocol_dir_local_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonProtocolDirLocalIndex.setStatus('current')
dr_smon_protocol_dir_descr = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(1, 64))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonProtocolDirDescr.setStatus('current')
dr_smon_protocol_dir_type = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 6), bits().clone(namedValues=named_values(('extensible', 0), ('addressRecognitionCapable', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonProtocolDirType.setStatus('current')
dr_smon_protocol_dir_address_map_config = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('notSupported', 1), ('supportedOff', 2), ('supportedOn', 3)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonProtocolDirAddressMapConfig.setStatus('current')
dr_smon_protocol_dir_host_config = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('notSupported', 1), ('supportedOff', 2), ('supportedOn', 3)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonProtocolDirHostConfig.setStatus('current')
dr_smon_protocol_dir_matrix_config = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('notSupported', 1), ('supportedOff', 2), ('supportedOn', 3)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonProtocolDirMatrixConfig.setStatus('current')
dr_smon_protocol_dir_owner = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 10), owner_string()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonProtocolDirOwner.setStatus('current')
dr_smon_protocol_dir_status = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 2, 2, 1, 11), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonProtocolDirStatus.setStatus('current')
dr_smon_filter = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 3))
dr_smon_filter_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1))
if mibBuilder.loadTexts:
drSmonFilterTable.setStatus('current')
dr_smon_filter_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1)).setIndexNames((0, 'SMON2-MIB', 'drSmonFilterModuleID'), (0, 'SMON2-MIB', 'drSmonFilterIndex'))
if mibBuilder.loadTexts:
drSmonFilterEntry.setStatus('current')
dr_smon_filter_module_id = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)))
if mibBuilder.loadTexts:
drSmonFilterModuleID.setStatus('current')
dr_smon_filter_index = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
drSmonFilterIndex.setStatus('current')
dr_smon_filter_address = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 3), ip_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonFilterAddress.setStatus('current')
dr_smon_filter_mask = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 4), ip_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonFilterMask.setStatus('current')
dr_smon_filter_status = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 3, 1, 1, 5), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
drSmonFilterStatus.setStatus('current')
dr_smon_active_applications = mib_identifier((1, 3, 6, 1, 4, 1, 81, 30, 4, 4))
dr_smon_active_applications_table = mib_table((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1))
if mibBuilder.loadTexts:
drSmonActiveApplicationsTable.setStatus('current')
dr_smon_active_applications_entry = mib_table_row((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1)).setIndexNames((0, 'SMON2-MIB', 'drSmonActiveApplicationsModuleID'), (0, 'SMON2-MIB', 'drSmonActiveApplicationsType'), (0, 'SMON2-MIB', 'drSmonActiveApplicationsSubType'))
if mibBuilder.loadTexts:
drSmonActiveApplicationsEntry.setStatus('current')
dr_smon_active_applications_module_id = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)))
if mibBuilder.loadTexts:
drSmonActiveApplicationsModuleID.setStatus('current')
dr_smon_active_applications_type = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('ethertype', 1), ('ipProtocol', 2), ('udpProtocol', 3), ('tcpProtocol', 4))))
if mibBuilder.loadTexts:
drSmonActiveApplicationsType.setStatus('current')
dr_smon_active_applications_sub_type = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 3), integer32())
if mibBuilder.loadTexts:
drSmonActiveApplicationsSubType.setStatus('current')
dr_smon_active_applications_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 81, 30, 4, 4, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
drSmonActiveApplicationsPkts.setStatus('current')
mibBuilder.exportSymbols('SMON2-MIB', xsSubnetMatrixDSSourceAddress=xsSubnetMatrixDSSourceAddress, xsActiveApplications=xsActiveApplications, drSmonProtocolDir=drSmonProtocolDir, drSmonControlRoutedPackets=drSmonControlRoutedPackets, xsFilter=xsFilter, xsHostTopNControlStatus=xsHostTopNControlStatus, xsSmon=xsSmon, drSmonProtocolDirHostConfig=drSmonProtocolDirHostConfig, drSmonFilter=drSmonFilter, xsSubnetMatrixControlMaxDesiredEntries=xsSubnetMatrixControlMaxDesiredEntries, xsSubnetMatrixDSSourceMask=xsSubnetMatrixDSSourceMask, xsSubnetControlEntry=xsSubnetControlEntry, xsSubnetEntry=xsSubnetEntry, xsSubnetMatrixSDTable=xsSubnetMatrixSDTable, drSmonConfiguration=drSmonConfiguration, drSmonControlMatrixRows=drSmonControlMatrixRows, drSmonProtocolDirStatus=drSmonProtocolDirStatus, xsHostFilterEntry=xsHostFilterEntry, drSmonControlModuleID=drSmonControlModuleID, drSmonEntityPlacementEntry=drSmonEntityPlacementEntry, xsSubnetControlTable=xsSubnetControlTable, drSmonProtocolDirAddressMapConfig=drSmonProtocolDirAddressMapConfig, drSmonActiveApplications=drSmonActiveApplications, drSmonEntityPlacementAddress=drSmonEntityPlacementAddress, xsSubnetControlMaxDesiredEntries=xsSubnetControlMaxDesiredEntries, xsSubnetAddress=xsSubnetAddress, xsSubnetMask=xsSubnetMask, drSmonProtocolDirID=drSmonProtocolDirID, drSmonProtocolDirModuleID=drSmonProtocolDirModuleID, drSmonControlEntry=drSmonControlEntry, drSmonActiveApplicationsSubType=drSmonActiveApplicationsSubType, drSmonEntityPlacementIndex=drSmonEntityPlacementIndex, drSmonProtocolDirMatrixConfig=drSmonProtocolDirMatrixConfig, xsHostTopNControlEntry=xsHostTopNControlEntry, drSmonActiveApplicationsEntry=drSmonActiveApplicationsEntry, drSmonProtocolDirParameters=drSmonProtocolDirParameters, xsSubnetControlOwner=xsSubnetControlOwner, xsSubnetMatrixSDPkts=xsSubnetMatrixSDPkts, drSmonProtocolDirLCLastChange=drSmonProtocolDirLCLastChange, drSmonEntityPlacementTable=drSmonEntityPlacementTable, drSmonControlProtocolDistStatsTimeStamp=drSmonControlProtocolDistStatsTimeStamp, drSmonEntityPlacementModuleID=drSmonEntityPlacementModuleID, xsHostTopNControlTimeRemaining=xsHostTopNControlTimeRemaining, drSmonFilterTable=drSmonFilterTable, drSmonEntityPlacementType=drSmonEntityPlacementType, xsSubnetMatrixControlInserts=xsSubnetMatrixControlInserts, xsHostFilterIpSubnet=xsHostFilterIpSubnet, xsHostTopNControlHostIndex=xsHostTopNControlHostIndex, xsSubnetControlInserts=xsSubnetControlInserts, xsSubnetMatrixSDTimeMark=xsSubnetMatrixSDTimeMark, xsHostFilterTableClear=xsHostFilterTableClear, xsSubnetInPkts=xsSubnetInPkts, xsHostFilterType=xsHostFilterType, drSmon=drSmon, xsHostTopNControlGrantedSize=xsHostTopNControlGrantedSize, xsHostTopNControlRequestedSize=xsHostTopNControlRequestedSize, xsActiveApplicationsEntry=xsActiveApplicationsEntry, drSmonActiveApplicationsTable=drSmonActiveApplicationsTable, drSmonFilterAddress=drSmonFilterAddress, xsHostTopNProtocolDirLocalIndex=xsHostTopNProtocolDirLocalIndex, xsProtocolDistStatsTimeStamp=xsProtocolDistStatsTimeStamp, drSmonFilterModuleID=drSmonFilterModuleID, drSmonControlMatrixCols=drSmonControlMatrixCols, xsSubnetMatrixDSTable=xsSubnetMatrixDSTable, xsHostTopNControlIndex=xsHostTopNControlIndex, xsSubnet=xsSubnet, xsHostTopNControlOwner=xsHostTopNControlOwner, xsSubnetMatrixDSCreateTime=xsSubnetMatrixDSCreateTime, xsHostTopNIndex=xsHostTopNIndex, xsSubnetTimeMark=xsSubnetTimeMark, xsSubnetMatrixDSPkts=xsSubnetMatrixDSPkts, drSmonProtocolDirLCModuleID=drSmonProtocolDirLCModuleID, xsSubnetMatrixSDSourceMask=xsSubnetMatrixSDSourceMask, drSmonProtocolDirLCEntry=drSmonProtocolDirLCEntry, xsHostTopNControlDuration=xsHostTopNControlDuration, drSmonControlRowAddressAutoLearnMode=drSmonControlRowAddressAutoLearnMode, xsSubnetMatrixSDDestAddress=xsSubnetMatrixSDDestAddress, xsSubnetMatrixSDDestMask=xsSubnetMatrixSDDestMask, xsHostTopNNlAddress=xsHostTopNNlAddress, xsSubnetMatrixDSTimeMark=xsSubnetMatrixDSTimeMark, drSmonActiveApplicationsPkts=drSmonActiveApplicationsPkts, drSmonProtocolDirDescr=drSmonProtocolDirDescr, xsHostFilterIpMask=xsHostFilterIpMask, drSmonProtocolDirLocalIndex=drSmonProtocolDirLocalIndex, xsHostFilterStatus=xsHostFilterStatus, xsSubnetMatrixControlEntry=xsSubnetMatrixControlEntry, drSmonEntityPlacementMask=drSmonEntityPlacementMask, xsHostFilterIpxAddress=xsHostFilterIpxAddress, drSmonActiveApplicationsType=drSmonActiveApplicationsType, xsNlHostTimeStamp=xsNlHostTimeStamp, xsSubnetMatrixControlStatus=xsSubnetMatrixControlStatus, xsSubnetMatrixControlDataSource=xsSubnetMatrixControlDataSource, xsHostTopNControlStartTime=xsHostTopNControlStartTime, xsSubnetMatrixControlIndex=xsSubnetMatrixControlIndex, xsSubnetMatrixDSDestMask=xsSubnetMatrixDSDestMask, xsNumberOfProtocols=xsNumberOfProtocols, xsActiveApplicationsBitMask=xsActiveApplicationsBitMask, xsActiveApplicationsIndex=xsActiveApplicationsIndex, xsHostTopNEntry=xsHostTopNEntry, drSmonProtocolDirTable=drSmonProtocolDirTable, xsSubnetControlStatus=xsSubnetControlStatus, xsSubnetMatrixControlOwner=xsSubnetMatrixControlOwner, xsSubnetMatrixControlTable=xsSubnetMatrixControlTable, xsSmonStatus=xsSmonStatus, xsSubnetControlIndex=xsSubnetControlIndex, drSmonFilterEntry=drSmonFilterEntry, drSmonProtocolDirEntry=drSmonProtocolDirEntry, drSmonFilterStatus=drSmonFilterStatus, xsHostTopN=xsHostTopN, xsSubnetControlDataSource=xsSubnetControlDataSource, xsSmonResourceAllocation=xsSmonResourceAllocation, drSmonProtocolDirLCTable=drSmonProtocolDirLCTable, drSmonFilterIndex=drSmonFilterIndex, xsSubnetMatrixSDSourceAddress=xsSubnetMatrixSDSourceAddress, xsSubnetMatrixSDCreateTime=xsSubnetMatrixSDCreateTime, xsHostTopNRate=xsHostTopNRate, xsHostFilterIpAddress=xsHostFilterIpAddress, xsSubnetOutPkts=xsSubnetOutPkts, xsSubnetMatrixControlDeletes=xsSubnetMatrixControlDeletes, drSmonProtocolDirOwner=drSmonProtocolDirOwner, xsSubnetMatrixDSDestAddress=xsSubnetMatrixDSDestAddress, xsSubnetControlDeletes=xsSubnetControlDeletes, xsSubnetCreateTime=xsSubnetCreateTime, xsActiveApplicationsTable=xsActiveApplicationsTable, drSmonControlTable=drSmonControlTable, xsHostTopNTable=xsHostTopNTable, drSmonProtocolDirType=drSmonProtocolDirType, drSmonActiveApplicationsModuleID=drSmonActiveApplicationsModuleID, xsSubnetTable=xsSubnetTable, drSmonFilterMask=drSmonFilterMask, xsActiveApplicationsPkts=xsActiveApplicationsPkts, xsSubnetStatsTimeStamp=xsSubnetStatsTimeStamp, xsSubnetMatrixDSEntry=xsSubnetMatrixDSEntry, xsHostTopNControlRateBase=xsHostTopNControlRateBase, xsSubnetMatrixSDEntry=xsSubnetMatrixSDEntry, xsHostFilterTable=xsHostFilterTable, xsHostTopNControlTable=xsHostTopNControlTable) |
delta_vector = [(1, 0), (0, -1), (-1, 0), (0, 1)]
current_east_pos = 0
current_north_pos = 0
current_delta = 0
for _ in range(747):
instruction = input()
movement = instruction[0]
value = int(instruction[1:])
if movement == 'N':
current_north_pos += value
if movement == 'S':
current_north_pos -= value
if movement == 'E':
current_east_pos += value
if movement == 'W':
current_east_pos -= value
if movement == 'L':
current_delta = (current_delta - (value // 90)) % 4
if movement == 'R':
current_delta = (current_delta + (value // 90)) % 4
if movement == 'F':
current_east_pos += delta_vector[current_delta][0] * value
current_north_pos += delta_vector[current_delta][1] * value
manhattan_distance = abs(current_east_pos) + abs(current_north_pos)
print(manhattan_distance)
| delta_vector = [(1, 0), (0, -1), (-1, 0), (0, 1)]
current_east_pos = 0
current_north_pos = 0
current_delta = 0
for _ in range(747):
instruction = input()
movement = instruction[0]
value = int(instruction[1:])
if movement == 'N':
current_north_pos += value
if movement == 'S':
current_north_pos -= value
if movement == 'E':
current_east_pos += value
if movement == 'W':
current_east_pos -= value
if movement == 'L':
current_delta = (current_delta - value // 90) % 4
if movement == 'R':
current_delta = (current_delta + value // 90) % 4
if movement == 'F':
current_east_pos += delta_vector[current_delta][0] * value
current_north_pos += delta_vector[current_delta][1] * value
manhattan_distance = abs(current_east_pos) + abs(current_north_pos)
print(manhattan_distance) |
# input
n = int(input())
cont1 = int(input())
conttot = 1
# grafo
contador = 0
g = [[0 for i in range(n)] for j in range(n)]
lista = input().split()
for col in range(n):
for linha in range(n):
g[col][linha] = int(lista[contador])
contador += 1
if col == linha:
g[col][linha] = 0
# Lista De Contaminados
contaminados = []
contaminados.append(cont1)
# Descobrindo Contaminados
for linha in range(n):
if g[cont1][linha] == 1:
contaminados.append(linha)
g[cont1][linha] = 0
conttot += 1
while True:
for y in range(n):
if g[linha][y] == 1 and y != cont1 and linha not in contaminados:
contaminados.append(linha)
conttot += 1
print(conttot)
| n = int(input())
cont1 = int(input())
conttot = 1
contador = 0
g = [[0 for i in range(n)] for j in range(n)]
lista = input().split()
for col in range(n):
for linha in range(n):
g[col][linha] = int(lista[contador])
contador += 1
if col == linha:
g[col][linha] = 0
contaminados = []
contaminados.append(cont1)
for linha in range(n):
if g[cont1][linha] == 1:
contaminados.append(linha)
g[cont1][linha] = 0
conttot += 1
while True:
for y in range(n):
if g[linha][y] == 1 and y != cont1 and (linha not in contaminados):
contaminados.append(linha)
conttot += 1
print(conttot) |
with open("Actions.txt") as f:
print(f)
lines = f.readlines()
trim_list = list(map(lambda line: line.strip(), lines))
sig = "-- HERE --"
sig_indx = trim_list.index(sig)
pure_inst = trim_list[sig_indx:]
print(pure_inst)
res = []
for p in pure_inst:
split = p.split(" ", 1)
if split[0].isdigit():
res.append(split[1])
print(res)
| with open('Actions.txt') as f:
print(f)
lines = f.readlines()
trim_list = list(map(lambda line: line.strip(), lines))
sig = '-- HERE --'
sig_indx = trim_list.index(sig)
pure_inst = trim_list[sig_indx:]
print(pure_inst)
res = []
for p in pure_inst:
split = p.split(' ', 1)
if split[0].isdigit():
res.append(split[1])
print(res) |
c = int()
def hanoi(discs, main, target, aux):
global c
if discs >= 1:
c = c + 1
hanoi(discs - 1, main, aux, target)
print("[{}] -> Move disc {} from {} to {}".format(c, discs, main, target))
hanoi(discs - 1, aux, target, main)
if __name__ == "__main__":
discs = int(input())
hanoi(discs, "main", "target", "aux") | c = int()
def hanoi(discs, main, target, aux):
global c
if discs >= 1:
c = c + 1
hanoi(discs - 1, main, aux, target)
print('[{}] -> Move disc {} from {} to {}'.format(c, discs, main, target))
hanoi(discs - 1, aux, target, main)
if __name__ == '__main__':
discs = int(input())
hanoi(discs, 'main', 'target', 'aux') |
def f():
def g():
pass
if __name__ == '__main__':
g()
print(1)
f()
| def f():
def g():
pass
if __name__ == '__main__':
g()
print(1)
f() |
lst = [int(x) for x in input().split()]
k = int(input())
lst.sort()
print(lst[-k], end="") | lst = [int(x) for x in input().split()]
k = int(input())
lst.sort()
print(lst[-k], end='') |
n,k=map(int,input().split());a=[int(i) for i in input().split()];m=sum(a[:k]);s=m
for i in range(k,n):
s+=(a[i]-a[i-k])
if s>m:m=s
print(m)
| (n, k) = map(int, input().split())
a = [int(i) for i in input().split()]
m = sum(a[:k])
s = m
for i in range(k, n):
s += a[i] - a[i - k]
if s > m:
m = s
print(m) |
with open("day-02/input.txt", "r") as file:
puzzle_input = [i.split() for i in file.readlines()]
def part_1(puzzle_input):
depth = 0
horizontal = 0
for command, value in puzzle_input:
value = int(value)
if command == "forward":
horizontal += value
elif command == "up":
depth -= value
elif command == "down":
depth += value
return depth * horizontal
def part_2(puzzle_input):
aim = 0
depth = 0
horizontal = 0
for command, value in puzzle_input:
value = int(value)
if command == "forward":
horizontal += value
depth += aim * value
elif command == "up":
aim -= value
elif command == "down":
aim += value
return depth * horizontal
print(part_1(puzzle_input))
print(part_2(puzzle_input))
| with open('day-02/input.txt', 'r') as file:
puzzle_input = [i.split() for i in file.readlines()]
def part_1(puzzle_input):
depth = 0
horizontal = 0
for (command, value) in puzzle_input:
value = int(value)
if command == 'forward':
horizontal += value
elif command == 'up':
depth -= value
elif command == 'down':
depth += value
return depth * horizontal
def part_2(puzzle_input):
aim = 0
depth = 0
horizontal = 0
for (command, value) in puzzle_input:
value = int(value)
if command == 'forward':
horizontal += value
depth += aim * value
elif command == 'up':
aim -= value
elif command == 'down':
aim += value
return depth * horizontal
print(part_1(puzzle_input))
print(part_2(puzzle_input)) |
obj = {
'Profiles' : [ {
'Source' : 'sfmc_sg10004_programmes_genrelevel1fan548day_oc_uas_dae',
'Media': ['audio','video'],
'Preferences' : [ {
'Score' : 1,
'Label' : 'Religion & Ethics'
}, {
'Score' : 4,
'Label' : 'Entertainment'
}, {
'Score' : 5,
'Label' : 'Music'
}, {
'Score' : 5,
'Label' : 'Comedy'
}, {
'Score' : 5,
'Label' : 'News'
}, {
'Score' : 4,
'Label' : 'Drama'
}, {
'Score' : 1,
'Label' : 'Learning'
}, {
'Score' : 5,
'Label' : 'Factual'
}, {
'Score' : 5,
'Label' : 'Sport'
} ]
}, {
'Source' : 'sfmc_sg10004a_programmes_genrelevel1fan548day_oc_uas_dae',
'Media': ['audio'],
'Preferences' : [ {
'Score' : 4,
'Label' : 'News'
}, {
'Score' : 2,
'Label' : 'Sport'
}, {
'Score' : 1,
'Label' : 'Religion & Ethics'
}, {
'Score' : 1,
'Label' : 'Learning'
}, {
'Score' : 5,
'Label' : 'Music'
}, {
'Score' : 5,
'Label' : 'Comedy'
}, {
'Score' : 1,
'Label' : 'Entertainment'
}, {
'Score' : 5,
'Label' : 'Factual'
}, {
'Score' : 2,
'Label' : 'Drama'
} ]
}, {
'Source' : 'sfmc_sg10004v_programmes_genrelevel1fan548day_oc_uas_dae',
'Media': ['video'],
'Preferences' : [ {
'Score' : 2,
'Label' : 'Entertainment'
}, {
'Score' : 5,
'Label' : 'Music'
}, {
'Score' : 1,
'Label' : 'Comedy'
}, {
'Score' : 4,
'Label' : 'Drama'
}, {
'Score' : 2,
'Label' : 'News'
}, {
'Score' : 5,
'Label' : 'Factual'
}, {
'Score' : 5,
'Label' : 'Sport'
} ]
}, {
'Source' : 'sfmc_sg10005_programmes_genrelevel2fan548day_oc_uas_dae',
'Media': ['audio','video'],
'Preferences' : [ {
'Score' : 2,
'Label' : 'Comedy-Sitcoms'
}, {
'Score' : 2,
'Label' : 'Comedy-Music'
}, {
'Score' : 5,
'Label' : 'Factual-null'
}, {
'Score' : 5,
'Label' : 'Factual-Politics'
}, {
'Score' : 1,
'Label' : 'Music-Dance & Electronica'
}, {
'Score' : 1,
'Label' : 'Entertainment-null'
}, {
'Score' : 5,
'Label' : 'Music-Easy Listening, Soundtracks & Musicals'
}, {
'Score' : 1,
'Label' : 'Music-Folk'
}, {
'Score' : 5,
'Label' : 'Factual-Arts, Culture & the Media'
}, {
'Score' : 1,
'Label' : 'Religion & Ethics-null'
}, {
'Score' : 5,
'Label' : 'Music-Pop & Chart'
}, {
'Score' : 2,
'Label' : 'Sport-Cricket'
}, {
'Score' : 5,
'Label' : 'Music-Classical'
}, {
'Score' : 4,
'Label' : 'News-null'
}, {
'Score' : 5,
'Label' : 'Music-null'
}, {
'Score' : 2,
'Label' : 'Comedy-Standup'
}, {
'Score' : 5,
'Label' : 'Factual-Life Stories'
}, {
'Score' : 4,
'Label' : 'Music-Rock & Indie'
}, {
'Score' : 1,
'Label' : 'Comedy-Satire'
}, {
'Score' : 1,
'Label' : 'Factual-Science & Nature'
}, {
'Score' : 1,
'Label' : 'Music-Hip Hop, RnB & Dancehall'
}, {
'Score' : 5,
'Label' : 'Music-Classic Pop & Rock'
}, {
'Score' : 1,
'Label' : 'Drama-Biographical'
}, {
'Score' : 2,
'Label' : 'Factual-History'
}, {
'Score' : 1,
'Label' : 'Factual-Rock & Indie'
}, {
'Score' : 1,
'Label' : 'Drama-null'
}, {
'Score' : 4,
'Label' : 'Comedy-null'
}, {
'Score' : 2,
'Label' : 'Drama-Soaps'
}, {
'Score' : 1,
'Label' : 'Drama-SciFi & Fantasy'
}, {
'Score' : 1,
'Label' : 'Factual-Health & Wellbeing'
}, {
'Score' : 2,
'Label' : 'Comedy-Impressionists'
}, {
'Score' : 1,
'Label' : 'Comedy-Character'
}, {
'Score' : 1,
'Label' : 'Factual-Travel'
}, {
'Score' : 1,
'Label' : 'Learning-Adults'
} ]
}, {
'Source' : 'sfmc_sg10006_products_productfanpageviews548day_oc_cs_dae',
'Media': [],
'Preferences' : [ {
'Score' : 5,
'Label' : 'iplayerradio'
}, {
'Score' : 5,
'Label' : 'ideas'
}, {
'Score' : 5,
'Label' : 'aboutthebbc'
}, {
'Score' : 1,
'Label' : 'newsbeat'
}, {
'Score' : 4,
'Label' : 'kl-bitesize'
}, {
'Score' : 3,
'Label' : 'cbeebies'
}, {
'Score' : 5,
'Label' : 'news-v2-nonws'
}, {
'Score' : 5,
'Label' : 'weather'
}, {
'Score' : 5,
'Label' : 'homepageandsearch'
}, {
'Score' : 3,
'Label' : 'news-v2-ws'
}, {
'Score' : 5,
'Label' : 'tvandiplayer'
}, {
'Score' : 5,
'Label' : 'sport'
}, {
'Score' : 3,
'Label' : 'bbcthree'
}, {
'Score' : 5,
'Label' : 'music'
}, {
'Score' : 5,
'Label' : 'kl-iwonder'
}, {
'Score' : 5,
'Label' : 'news'
}, {
'Score' : 4,
'Label' : 'cbbc'
} ]
} ]
}
| obj = {'Profiles': [{'Source': 'sfmc_sg10004_programmes_genrelevel1fan548day_oc_uas_dae', 'Media': ['audio', 'video'], 'Preferences': [{'Score': 1, 'Label': 'Religion & Ethics'}, {'Score': 4, 'Label': 'Entertainment'}, {'Score': 5, 'Label': 'Music'}, {'Score': 5, 'Label': 'Comedy'}, {'Score': 5, 'Label': 'News'}, {'Score': 4, 'Label': 'Drama'}, {'Score': 1, 'Label': 'Learning'}, {'Score': 5, 'Label': 'Factual'}, {'Score': 5, 'Label': 'Sport'}]}, {'Source': 'sfmc_sg10004a_programmes_genrelevel1fan548day_oc_uas_dae', 'Media': ['audio'], 'Preferences': [{'Score': 4, 'Label': 'News'}, {'Score': 2, 'Label': 'Sport'}, {'Score': 1, 'Label': 'Religion & Ethics'}, {'Score': 1, 'Label': 'Learning'}, {'Score': 5, 'Label': 'Music'}, {'Score': 5, 'Label': 'Comedy'}, {'Score': 1, 'Label': 'Entertainment'}, {'Score': 5, 'Label': 'Factual'}, {'Score': 2, 'Label': 'Drama'}]}, {'Source': 'sfmc_sg10004v_programmes_genrelevel1fan548day_oc_uas_dae', 'Media': ['video'], 'Preferences': [{'Score': 2, 'Label': 'Entertainment'}, {'Score': 5, 'Label': 'Music'}, {'Score': 1, 'Label': 'Comedy'}, {'Score': 4, 'Label': 'Drama'}, {'Score': 2, 'Label': 'News'}, {'Score': 5, 'Label': 'Factual'}, {'Score': 5, 'Label': 'Sport'}]}, {'Source': 'sfmc_sg10005_programmes_genrelevel2fan548day_oc_uas_dae', 'Media': ['audio', 'video'], 'Preferences': [{'Score': 2, 'Label': 'Comedy-Sitcoms'}, {'Score': 2, 'Label': 'Comedy-Music'}, {'Score': 5, 'Label': 'Factual-null'}, {'Score': 5, 'Label': 'Factual-Politics'}, {'Score': 1, 'Label': 'Music-Dance & Electronica'}, {'Score': 1, 'Label': 'Entertainment-null'}, {'Score': 5, 'Label': 'Music-Easy Listening, Soundtracks & Musicals'}, {'Score': 1, 'Label': 'Music-Folk'}, {'Score': 5, 'Label': 'Factual-Arts, Culture & the Media'}, {'Score': 1, 'Label': 'Religion & Ethics-null'}, {'Score': 5, 'Label': 'Music-Pop & Chart'}, {'Score': 2, 'Label': 'Sport-Cricket'}, {'Score': 5, 'Label': 'Music-Classical'}, {'Score': 4, 'Label': 'News-null'}, {'Score': 5, 'Label': 'Music-null'}, {'Score': 2, 'Label': 'Comedy-Standup'}, {'Score': 5, 'Label': 'Factual-Life Stories'}, {'Score': 4, 'Label': 'Music-Rock & Indie'}, {'Score': 1, 'Label': 'Comedy-Satire'}, {'Score': 1, 'Label': 'Factual-Science & Nature'}, {'Score': 1, 'Label': 'Music-Hip Hop, RnB & Dancehall'}, {'Score': 5, 'Label': 'Music-Classic Pop & Rock'}, {'Score': 1, 'Label': 'Drama-Biographical'}, {'Score': 2, 'Label': 'Factual-History'}, {'Score': 1, 'Label': 'Factual-Rock & Indie'}, {'Score': 1, 'Label': 'Drama-null'}, {'Score': 4, 'Label': 'Comedy-null'}, {'Score': 2, 'Label': 'Drama-Soaps'}, {'Score': 1, 'Label': 'Drama-SciFi & Fantasy'}, {'Score': 1, 'Label': 'Factual-Health & Wellbeing'}, {'Score': 2, 'Label': 'Comedy-Impressionists'}, {'Score': 1, 'Label': 'Comedy-Character'}, {'Score': 1, 'Label': 'Factual-Travel'}, {'Score': 1, 'Label': 'Learning-Adults'}]}, {'Source': 'sfmc_sg10006_products_productfanpageviews548day_oc_cs_dae', 'Media': [], 'Preferences': [{'Score': 5, 'Label': 'iplayerradio'}, {'Score': 5, 'Label': 'ideas'}, {'Score': 5, 'Label': 'aboutthebbc'}, {'Score': 1, 'Label': 'newsbeat'}, {'Score': 4, 'Label': 'kl-bitesize'}, {'Score': 3, 'Label': 'cbeebies'}, {'Score': 5, 'Label': 'news-v2-nonws'}, {'Score': 5, 'Label': 'weather'}, {'Score': 5, 'Label': 'homepageandsearch'}, {'Score': 3, 'Label': 'news-v2-ws'}, {'Score': 5, 'Label': 'tvandiplayer'}, {'Score': 5, 'Label': 'sport'}, {'Score': 3, 'Label': 'bbcthree'}, {'Score': 5, 'Label': 'music'}, {'Score': 5, 'Label': 'kl-iwonder'}, {'Score': 5, 'Label': 'news'}, {'Score': 4, 'Label': 'cbbc'}]}]} |
'''
Created on 05.03.2018
@author: Alex
'''
class ImageSorterException(Exception):
pass
| """
Created on 05.03.2018
@author: Alex
"""
class Imagesorterexception(Exception):
pass |
# Copyright 2017 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Define supported virtual NIC types. VNIC_TYPE_DIRECT and VNIC_TYPE_MACVTAP
# are used for SR-IOV ports
VNIC_TYPE_NORMAL = 'normal'
VNIC_TYPE_DIRECT = 'direct'
VNIC_TYPE_MACVTAP = 'macvtap'
VNIC_TYPE_DIRECT_PHYSICAL = 'direct-physical'
VNIC_TYPE_BAREMETAL = 'baremetal'
VNIC_TYPE_VIRTIO_FORWARDER = 'virtio-forwarder'
# Define list of ports which needs pci request.
# Note: The macvtap port needs a PCI request as it is a tap interface
# with VF as the lower physical interface.
# Note: Currently, VNIC_TYPE_VIRTIO_FORWARDER assumes a 1:1
# relationship with a VF. This is expected to change in the future.
VNIC_TYPES_SRIOV = (VNIC_TYPE_DIRECT, VNIC_TYPE_MACVTAP,
VNIC_TYPE_DIRECT_PHYSICAL, VNIC_TYPE_VIRTIO_FORWARDER)
# Define list of ports which are passthrough to the guest
# and need a special treatment on snapshot and suspend/resume
VNIC_TYPES_DIRECT_PASSTHROUGH = (VNIC_TYPE_DIRECT,
VNIC_TYPE_DIRECT_PHYSICAL)
| vnic_type_normal = 'normal'
vnic_type_direct = 'direct'
vnic_type_macvtap = 'macvtap'
vnic_type_direct_physical = 'direct-physical'
vnic_type_baremetal = 'baremetal'
vnic_type_virtio_forwarder = 'virtio-forwarder'
vnic_types_sriov = (VNIC_TYPE_DIRECT, VNIC_TYPE_MACVTAP, VNIC_TYPE_DIRECT_PHYSICAL, VNIC_TYPE_VIRTIO_FORWARDER)
vnic_types_direct_passthrough = (VNIC_TYPE_DIRECT, VNIC_TYPE_DIRECT_PHYSICAL) |
class Animal:
nombre: str
edad: int
nPatas: int
raza: str
ruido: str
color: str
def __init__(self, nombre, edad, nPatas, raza, ruido, color):
self.nombre = nombre
self.edad = edad
self.nPatas = nPatas
self.raza = raza
self.ruido = ruido
self.color = color
def hacerRuido(self):
print(self.ruido)
def comer(self):
print(f'El animal va a comer') | class Animal:
nombre: str
edad: int
n_patas: int
raza: str
ruido: str
color: str
def __init__(self, nombre, edad, nPatas, raza, ruido, color):
self.nombre = nombre
self.edad = edad
self.nPatas = nPatas
self.raza = raza
self.ruido = ruido
self.color = color
def hacer_ruido(self):
print(self.ruido)
def comer(self):
print(f'El animal va a comer') |
#A function to show the list of trait with categorial data
def categorial_trait(dataframe):
numeric, categorial = classifying_column(dataframe)
print('Traits with categorial data : ','\n',categorial, '\n')
print('Total count : ' ,len(categorial) , 'Traits')
| def categorial_trait(dataframe):
(numeric, categorial) = classifying_column(dataframe)
print('Traits with categorial data : ', '\n', categorial, '\n')
print('Total count : ', len(categorial), 'Traits') |
ENDC = '\033[0m'
OKGREEN = '\033[92m'
def print_play_my_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print("\033[F"*13)
print(
f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}',
f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}',
f'',
f'p : Pause',
f'l : Play',
f'+ / - : Volume',
f's : Shuffle',
f'n : Next Song',
f'b : Previous Song',
f'x : exit',
f'',
f'',
sep="\n"
)
def print_play_one_song(name_song, artist, total_time, prefix, bar, percent, suffix):
print("\033[F"*13)
print(
f'{name_song} | {artist} | {total_time[:7]}',
f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}',
f'',
f'p : Pause',
f'l : Play',
f'+ : Up Volume',
f'- : Down Volume',
f'r : Add to a playlist',
f'x : exit',
f'',
f'',
f'',
sep="\n"
)
def print_play_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print("\033[F"*13)
print(
f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}',
f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}',
f'',
f'p : Pause',
f'l : Play',
f'+ / - : Volume',
f's : Shuffle',
f'n : Next Song',
f'b : Previous Song',
f'a : Follow this playlist',
f'x : exit',
f'',
sep="\n"
) | endc = '\x1b[0m'
okgreen = '\x1b[92m'
def print_play_my_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print('\x1b[F' * 13)
print(f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}', f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}', f'', f'p : Pause', f'l : Play', f'+ / - : Volume', f's : Shuffle', f'n : Next Song', f'b : Previous Song', f'x : exit', f'', f'', sep='\n')
def print_play_one_song(name_song, artist, total_time, prefix, bar, percent, suffix):
print('\x1b[F' * 13)
print(f'{name_song} | {artist} | {total_time[:7]}', f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}', f'', f'p : Pause', f'l : Play', f'+ : Up Volume', f'- : Down Volume', f'r : Add to a playlist', f'x : exit', f'', f'', f'', sep='\n')
def print_play_playlist(playlist_name, name_song, artist, total_time, prefix, bar, percent, suffix):
print('\x1b[F' * 13)
print(f'{playlist_name} | {name_song} | {artist} | {total_time[:7]}', f'{prefix}|{OKGREEN}{bar}{ENDC}|{percent[:7]} {suffix}', f'', f'p : Pause', f'l : Play', f'+ / - : Volume', f's : Shuffle', f'n : Next Song', f'b : Previous Song', f'a : Follow this playlist', f'x : exit', f'', sep='\n') |
class Stock():
def __init__(self,code,name,price):
self.code = code
self.name = name
self.price = price
def __str__(self):
return 'code{},name{},price{}'.format(self.code,self.name,self.price) | class Stock:
def __init__(self, code, name, price):
self.code = code
self.name = name
self.price = price
def __str__(self):
return 'code{},name{},price{}'.format(self.code, self.name, self.price) |
line = input().split()
a = int(line[0])
b = int(line[1])
hour = 0
total = a
burned = 0
while(total > 0):
total -= 1
burned += 1
if(burned % b == 0):
total += 1
hour += 1
print(str(hour))
| line = input().split()
a = int(line[0])
b = int(line[1])
hour = 0
total = a
burned = 0
while total > 0:
total -= 1
burned += 1
if burned % b == 0:
total += 1
hour += 1
print(str(hour)) |
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
class Export:
def __init__(self, export: dict):
self.id = export.get("id")
self.display_name = export.get("displayName")
self.enabled = export.get("enabled")
self.source = export.get("source")
self.filter = export.get("filter")
self.destinations = export.get("destinations")
self.errors = export.get("errors")
self.status = export.get("status")
self.enrichment = export.get("enrichments")
| class Export:
def __init__(self, export: dict):
self.id = export.get('id')
self.display_name = export.get('displayName')
self.enabled = export.get('enabled')
self.source = export.get('source')
self.filter = export.get('filter')
self.destinations = export.get('destinations')
self.errors = export.get('errors')
self.status = export.get('status')
self.enrichment = export.get('enrichments') |
__package__ = 'tkgeom'
__title__ = 'tkgeom'
__description__ = '2D geometry module as an example for the TK workshop'
__copyright__ = '2019, Zs. Elter'
__version__ = '1.0.0'
| __package__ = 'tkgeom'
__title__ = 'tkgeom'
__description__ = '2D geometry module as an example for the TK workshop'
__copyright__ = '2019, Zs. Elter'
__version__ = '1.0.0' |
'''
Copyright (c) 2014, Aaron Westendorf All rights reserved.
https://github.com/agoragames/pluto/blob/master/LICENSE.txt
'''
| """
Copyright (c) 2014, Aaron Westendorf All rights reserved.
https://github.com/agoragames/pluto/blob/master/LICENSE.txt
""" |
def id(message):
# Define empty variables
fu_userid = False
rt_userid = False
rf_userid = False
gp_groupid = False
# the 'From User' data
fu_username = message.from_user.username
fu_userid = message.from_user.id
fu_fullname = message.from_user.first_name.encode("utf-8")
# check for 'Replied to' message
if message.reply_to_message:
# the 'Replied To' data
rt_userid = message.reply_to_message.from_user.id
rt_fullname = message.reply_to_message.from_user.first_name.encode("utf-8")
rt_username = message.reply_to_message.from_user.username
if message.reply_to_message.forward_from:
# the 'Replied to, Forwarded' data
rf_userid = message.reply_to_message.forward_from.id
rf_fullname = message.reply_to_message.forward_from.first_name.encode("utf-8")
rf_username = message.reply_to_message.forward_from.username
if "group" in message.chat.type:
# the 'Group' data
gp_groupid = message.chat.id
gp_fullname = message.chat.title.encode("utf-8")
# Send message
text = "<code>Your data:</code> \n- <b>Username:</b> @{0}\n- <b>Full name:</b> {1}\n- <b>UserID:</b> {2}".format(fu_username, fu_fullname, fu_userid)
if rt_userid:
text = text + "\n\n<code>Replied-to-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rt_username, rt_fullname, rt_userid)
if rf_userid:
text = text + "\n\n<code>Replied-to-forwarded-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rf_username, rf_fullname, rf_userid)
if gp_groupid:
text = text + "\n\n<code>Group data:</code> \n- <b>Group's title:</b> {1}\n- <b>Group's ID:</b> {0}".format(gp_groupid, gp_fullname)
bot.send_message(message.chat.id, text, parse_mode="HTML")
class plid:
patterns=["^[/!]id(.*)$"]
| def id(message):
fu_userid = False
rt_userid = False
rf_userid = False
gp_groupid = False
fu_username = message.from_user.username
fu_userid = message.from_user.id
fu_fullname = message.from_user.first_name.encode('utf-8')
if message.reply_to_message:
rt_userid = message.reply_to_message.from_user.id
rt_fullname = message.reply_to_message.from_user.first_name.encode('utf-8')
rt_username = message.reply_to_message.from_user.username
if message.reply_to_message.forward_from:
rf_userid = message.reply_to_message.forward_from.id
rf_fullname = message.reply_to_message.forward_from.first_name.encode('utf-8')
rf_username = message.reply_to_message.forward_from.username
if 'group' in message.chat.type:
gp_groupid = message.chat.id
gp_fullname = message.chat.title.encode('utf-8')
text = '<code>Your data:</code> \n- <b>Username:</b> @{0}\n- <b>Full name:</b> {1}\n- <b>UserID:</b> {2}'.format(fu_username, fu_fullname, fu_userid)
if rt_userid:
text = text + "\n\n<code>Replied-to-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rt_username, rt_fullname, rt_userid)
if rf_userid:
text = text + "\n\n<code>Replied-to-forwarded-message data:</code> \n- <b>It's username:</b> @{0}\n- <b>It's fullname:</b> {1}\n- <b>Its userID:</b> {2}".format(rf_username, rf_fullname, rf_userid)
if gp_groupid:
text = text + "\n\n<code>Group data:</code> \n- <b>Group's title:</b> {1}\n- <b>Group's ID:</b> {0}".format(gp_groupid, gp_fullname)
bot.send_message(message.chat.id, text, parse_mode='HTML')
class Plid:
patterns = ['^[/!]id(.*)$'] |
txt = "banana"
x = txt.ljust(20)
print(x, "is my favorite fruit.")
| txt = 'banana'
x = txt.ljust(20)
print(x, 'is my favorite fruit.') |
pkgname = "gnome-menus"
pkgver = "3.36.0"
pkgrel = 0
build_style = "gnu_configure"
configure_args = ["--disable-static"]
make_cmd = "gmake"
hostmakedepends = [
"gmake", "pkgconf", "gobject-introspection", "glib-devel", "gettext-tiny"
]
makedepends = ["libglib-devel"]
pkgdesc = "GNOME menu definitions"
maintainer = "q66 <[email protected]>"
license = "GPL-2.0-or-later AND LGPL-2.0-or-later"
url = "https://gitlab.gnome.org/GNOME/gnome-menus"
source = f"$(GNOME_SITE)/{pkgname}/{pkgver[:-2]}/{pkgname}-{pkgver}.tar.xz"
sha256 = "d9348f38bde956fc32753b28c1cde19c175bfdbf1f4d5b06003b3aa09153bb1f"
@subpackage("gnome-menus-devel")
def _devel(self):
return self.default_devel()
| pkgname = 'gnome-menus'
pkgver = '3.36.0'
pkgrel = 0
build_style = 'gnu_configure'
configure_args = ['--disable-static']
make_cmd = 'gmake'
hostmakedepends = ['gmake', 'pkgconf', 'gobject-introspection', 'glib-devel', 'gettext-tiny']
makedepends = ['libglib-devel']
pkgdesc = 'GNOME menu definitions'
maintainer = 'q66 <[email protected]>'
license = 'GPL-2.0-or-later AND LGPL-2.0-or-later'
url = 'https://gitlab.gnome.org/GNOME/gnome-menus'
source = f'$(GNOME_SITE)/{pkgname}/{pkgver[:-2]}/{pkgname}-{pkgver}.tar.xz'
sha256 = 'd9348f38bde956fc32753b28c1cde19c175bfdbf1f4d5b06003b3aa09153bb1f'
@subpackage('gnome-menus-devel')
def _devel(self):
return self.default_devel() |
#!/usr/bin/env python3
class BaseError(Exception):
def __init__(self, message):
self.message = message
class LoggedOutError(BaseError):
def __init__(self):
super(LoggedOutError, self).__init__("User is currently not logged In")
# self.message = "User is currently not logged In"
class LoginExpiredError(BaseError):
def __init__(self):
super(LoginExpiredError, self).__init__("User's logged has expired")
class LoginRevokedError(BaseError):
def __init__(self):
super(LoginRevokedError, self).__init__(
"User's logged access has been revoked")
class InvalidReviewerPositionError(BaseError):
def __init__(self):
message = (
"The position of the reviewer you provided is not "
"allowed to review payment voucher at this review stage"
)
super(InvalidReviewerPositionError, self).__init__(message)
class DeletedReviewerError(BaseError):
def __init__(self):
message = (
"The reviewer you selected has been deleted so they can't be "
"selected as a reviewer for any payment vouchers"
)
super(DeletedReviewerError, self).__init__(message)
class ReviewerNotFoundError(BaseError):
def __init__(self):
message = (
"The reviewer you selected doesn't exist check and try again"
)
super(ReviewerNotFoundError, self).__init__(message)
class InvalidReviewerError(BaseError):
def __init__(self):
message = (
"Reviewer is not authorized to review this payment voucher"
)
super(InvalidReviewerError, self).__init__(message)
class EndPaymentReviewProcessError(BaseError):
def __init__(self):
message = (
"Payment voucher has reach the end of the review process. "
"So you might want to pay or reject the payment"
)
super(EndPaymentReviewProcessError, self).__init__(message)
class InvalidVoucherStageError(BaseError):
def __init__(self, message):
super(InvalidVoucherStageError, self).__init__(message)
class InvalidPayingOfficer(BaseError):
def __init__(self):
super(InvalidPayingOfficer, self).__init__(
'You are not the authorized cashier for this transaction')
| class Baseerror(Exception):
def __init__(self, message):
self.message = message
class Loggedouterror(BaseError):
def __init__(self):
super(LoggedOutError, self).__init__('User is currently not logged In')
class Loginexpirederror(BaseError):
def __init__(self):
super(LoginExpiredError, self).__init__("User's logged has expired")
class Loginrevokederror(BaseError):
def __init__(self):
super(LoginRevokedError, self).__init__("User's logged access has been revoked")
class Invalidreviewerpositionerror(BaseError):
def __init__(self):
message = 'The position of the reviewer you provided is not allowed to review payment voucher at this review stage'
super(InvalidReviewerPositionError, self).__init__(message)
class Deletedreviewererror(BaseError):
def __init__(self):
message = "The reviewer you selected has been deleted so they can't be selected as a reviewer for any payment vouchers"
super(DeletedReviewerError, self).__init__(message)
class Reviewernotfounderror(BaseError):
def __init__(self):
message = "The reviewer you selected doesn't exist check and try again"
super(ReviewerNotFoundError, self).__init__(message)
class Invalidreviewererror(BaseError):
def __init__(self):
message = 'Reviewer is not authorized to review this payment voucher'
super(InvalidReviewerError, self).__init__(message)
class Endpaymentreviewprocesserror(BaseError):
def __init__(self):
message = 'Payment voucher has reach the end of the review process. So you might want to pay or reject the payment'
super(EndPaymentReviewProcessError, self).__init__(message)
class Invalidvoucherstageerror(BaseError):
def __init__(self, message):
super(InvalidVoucherStageError, self).__init__(message)
class Invalidpayingofficer(BaseError):
def __init__(self):
super(InvalidPayingOfficer, self).__init__('You are not the authorized cashier for this transaction') |
pkgname = "python-py"
pkgver = "1.11.0"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools_scm"]
checkdepends = ["python-pytest"]
depends = ["python"]
pkgdesc = "Python development support library"
maintainer = "q66 <[email protected]>"
license = "MIT"
url = "https://github.com/pytest-dev/py"
source = f"$(PYPI_SITE)/p/py/py-{pkgver}.tar.gz"
sha256 = "51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"
# dependency of pytest
options = ["!check"]
def post_install(self):
self.install_license("LICENSE")
| pkgname = 'python-py'
pkgver = '1.11.0'
pkgrel = 0
build_style = 'python_module'
hostmakedepends = ['python-setuptools_scm']
checkdepends = ['python-pytest']
depends = ['python']
pkgdesc = 'Python development support library'
maintainer = 'q66 <[email protected]>'
license = 'MIT'
url = 'https://github.com/pytest-dev/py'
source = f'$(PYPI_SITE)/p/py/py-{pkgver}.tar.gz'
sha256 = '51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719'
options = ['!check']
def post_install(self):
self.install_license('LICENSE') |
n = int(input())
nums = list(map(int, input().strip().split()))
print(min(nums) * max(nums))
| n = int(input())
nums = list(map(int, input().strip().split()))
print(min(nums) * max(nums)) |
line = Line()
line.xValues = [2, 1, 3, 4, 0]
line.yValues = [2, 1, 3, 4, 0]
plot = Plot()
plot.add(line)
plot.save("unordered.png")
| line = line()
line.xValues = [2, 1, 3, 4, 0]
line.yValues = [2, 1, 3, 4, 0]
plot = plot()
plot.add(line)
plot.save('unordered.png') |
'''
Created on Oct 31, 2013/.>"
@author: rgeorgi
'''
class TextParser(object):
'''
classdocs
'''
def parse(self):
pass
def __init__(self):
'''
Constructor
'''
class ParserException(Exception):
pass | """
Created on Oct 31, 2013/.>"
@author: rgeorgi
"""
class Textparser(object):
"""
classdocs
"""
def parse(self):
pass
def __init__(self):
"""
Constructor
"""
class Parserexception(Exception):
pass |
class UIColors:
"color indices for UI (c64 original) palette"
white = 2
lightgrey = 16
medgrey = 13
darkgrey = 12
black = 1
yellow = 8
red = 3
brightred = 11
| class Uicolors:
"""color indices for UI (c64 original) palette"""
white = 2
lightgrey = 16
medgrey = 13
darkgrey = 12
black = 1
yellow = 8
red = 3
brightred = 11 |
# Time: O (N ^ 2) | Space: O(N)
def arrayOfProducts(array):
output = []
for i in range(len(array)):
product = 1
for j in range(len(array)):
if i != j:
product = product * array[j]
output.append(product)
return output
# Time: O(N) | Space: O(N)
def arrayOfProductsN(array):
left = [1 for i in range(len(array))]
right = [1 for i in range(len(array))]
output = [1 for i in range(len(array))]
prodL = 1
prodR = 1
idx = len(array) - 1
# Make left product array
for i in range(len(array)):
left[i] = prodL
prodL = prodL * array[i]
# Make right product array
while idx >= 0:
right[idx] = prodR
prodR = prodR * array[idx]
idx -= 1
# Merge
for i in range(len(array)):
output[i] = left[i] * right[i]
return output
| def array_of_products(array):
output = []
for i in range(len(array)):
product = 1
for j in range(len(array)):
if i != j:
product = product * array[j]
output.append(product)
return output
def array_of_products_n(array):
left = [1 for i in range(len(array))]
right = [1 for i in range(len(array))]
output = [1 for i in range(len(array))]
prod_l = 1
prod_r = 1
idx = len(array) - 1
for i in range(len(array)):
left[i] = prodL
prod_l = prodL * array[i]
while idx >= 0:
right[idx] = prodR
prod_r = prodR * array[idx]
idx -= 1
for i in range(len(array)):
output[i] = left[i] * right[i]
return output |
# -*- coding = utf-8 -*-
# @Time:2021/2/2821:58
# @Author:Linyu
# @Software:PyCharm
def response(flow):
print(flow.request.url)
print(flow.response.text) | def response(flow):
print(flow.request.url)
print(flow.response.text) |
# example of how to display octal and hexa values
a = 0o25
b = 0x1af
print('Value of a in decimal is ', a)
c = 19
print('19 in octal is %o and in hex is %x' % (c, c))
d = oct(c)
e = hex(c)
print('19 in octal is', d, ' and in hex is ', e)
| a = 21
b = 431
print('Value of a in decimal is ', a)
c = 19
print('19 in octal is %o and in hex is %x' % (c, c))
d = oct(c)
e = hex(c)
print('19 in octal is', d, ' and in hex is ', e) |
states_in_order_of_founding = ("Delaware", "Pennsylvania", "New Jersey", "Georgia")
# You use parentheses instead of square brackets.
print(states_in_order_of_founding)
second_state_founded = states_in_order_of_founding[1]
print("The second state founded was " + second_state_founded) | states_in_order_of_founding = ('Delaware', 'Pennsylvania', 'New Jersey', 'Georgia')
print(states_in_order_of_founding)
second_state_founded = states_in_order_of_founding[1]
print('The second state founded was ' + second_state_founded) |
#!/usr/bin/python
# -*- coding: utf-8 -*-
nitram_micro_mono_CP437 = [
0, 0, 0, 0, 0,
10, 0, 4, 17, 14,
10, 0, 0, 14, 17,
27, 31, 31, 14, 4,
0, 0, 0, 0, 0,
0, 4, 10, 4, 14,
4, 14, 14, 4, 14,
0, 14, 14, 14, 0,
0, 0, 0, 0, 0,
0, 4, 10, 4, 0,
0, 0, 0, 0, 0,
30, 28, 31, 21, 7,
5, 13, 31, 12, 4,
20, 22, 31, 6, 4,
15, 10, 10, 10, 5,
21, 14, 27, 14, 21,
4, 12, 28, 12, 4,
4, 6, 7, 6, 4,
4, 14, 4, 14, 4,
10, 10, 10, 0, 10,
12, 11, 10, 10, 10,
0, 0, 0, 0, 0,
0, 0, 0, 31, 31,
0, 0, 0, 0, 0,
4, 14, 21, 4, 4,
4, 4, 21, 14, 4,
4, 8, 31, 8, 4,
4, 2, 31, 2, 4,
0, 2, 2, 30, 0,
0, 14, 14, 14, 0,
4, 14, 31, 0, 0,
0, 0, 31, 14, 4,
0, 0, 0, 0, 0,
4, 4, 4, 0, 4,
10, 10, 0, 0, 0,
10, 31, 10, 31, 10,
31, 5, 31, 20, 31,
17, 8, 4, 2, 17,
6, 9, 22, 9, 22,
8, 4, 0, 0, 0,
8, 4, 4, 4, 8,
2, 4, 4, 4, 2,
21, 14, 31, 14, 21,
0, 4, 14, 4, 0,
0, 0, 0, 4, 2,
0, 0, 14, 0, 0,
0, 0, 0, 0, 2,
8, 4, 4, 4, 2,
14, 25, 21, 19, 14,
4, 6, 4, 4, 14,
14, 8, 14, 2, 14,
14, 8, 12, 8, 14,
2, 2, 10, 14, 8,
14, 2, 14, 8, 14,
6, 2, 14, 10, 14,
14, 8, 12, 8, 8,
14, 10, 14, 10, 14,
14, 10, 14, 8, 14,
0, 4, 0, 4, 0,
0, 4, 0, 4, 2,
8, 4, 2, 4, 8,
0, 14, 0, 14, 0,
2, 4, 8, 4, 2,
14, 17, 12, 0, 4,
14, 9, 5, 1, 14,
6, 9, 17, 31, 17,
7, 9, 15, 17, 15,
14, 17, 1, 17, 14,
15, 25, 17, 17, 15,
31, 1, 15, 1, 31,
31, 1, 15, 1, 1,
14, 1, 25, 17, 14,
9, 17, 31, 17, 17,
14, 4, 4, 4, 14,
12, 8, 8, 10, 14,
9, 5, 3, 5, 9,
1, 1, 1, 1, 15,
17, 27, 21, 17, 17,
17, 19, 21, 25, 17,
14, 25, 17, 17, 14,
7, 9, 7, 1, 1,
14, 17, 17, 25, 30,
7, 9, 7, 5, 9,
30, 1, 14, 16, 15,
31, 4, 4, 4, 4,
9, 17, 17, 17, 14,
10, 10, 10, 10, 4,
9, 17, 21, 21, 10,
17, 10, 4, 10, 17,
17, 10, 4, 4, 4,
31, 8, 4, 2, 31,
12, 4, 4, 4, 12,
2, 4, 4, 4, 8,
6, 4, 4, 4, 6,
4, 10, 0, 0, 0,
0, 0, 0, 0, 14,
4, 8, 0, 0, 0,
6, 9, 17, 31, 17,
7, 9, 15, 17, 15,
14, 17, 1, 17, 14,
15, 25, 17, 17, 15,
31, 1, 15, 1, 31,
31, 1, 15, 1, 1,
14, 1, 25, 17, 14,
9, 17, 31, 17, 17,
14, 4, 4, 4, 14,
12, 8, 8, 10, 14,
18, 10, 6, 10, 18,
1, 1, 1, 1, 15,
17, 27, 21, 17, 17,
17, 19, 21, 25, 17,
14, 25, 17, 17, 14,
7, 9, 7, 1, 1,
14, 17, 17, 25, 30,
7, 9, 7, 5, 9,
30, 1, 14, 16, 15,
31, 4, 4, 4, 4,
9, 17, 17, 17, 14,
10, 10, 10, 10, 4,
9, 17, 21, 21, 10,
17, 10, 4, 10, 17,
17, 10, 4, 4, 4,
31, 8, 4, 2, 31,
12, 4, 2, 4, 12,
4, 4, 4, 4, 4,
6, 4, 8, 4, 6,
10, 5, 0, 0, 0,
0, 4, 10, 10, 14,
0, 0, 0, 0, 0,
10, 0, 10, 10, 14,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
10, 0, 14, 10, 30,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
31, 17, 17, 17, 31,
0, 14, 10, 14, 0,
0, 0, 4, 0, 0,
0, 0, 0, 0, 0,
0, 0, 4, 0, 0,
0, 14, 10, 14, 0,
0, 0, 0, 0, 0,
10, 0, 14, 10, 30,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
10, 0, 14, 10, 14,
0, 0, 0, 0, 0,
3, 25, 11, 9, 11,
28, 23, 21, 21, 29,
0, 3, 1, 1, 1,
10, 0, 14, 10, 14,
10, 0, 10, 10, 14,
0, 0, 0, 0, 31,
0, 0, 0, 0, 0,
0, 0, 0, 0, 31,
0, 0, 0, 0, 0,
0, 0, 0, 0, 31,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
4, 0, 6, 17, 14,
0, 0, 28, 4, 4,
0, 0, 7, 4, 4,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
4, 0, 4, 4, 4,
4, 18, 9, 18, 4,
4, 9, 18, 9, 4,
0, 10, 0, 10, 0,
10, 21, 10, 21, 10,
21, 10, 21, 10, 21,
4, 4, 4, 4, 4,
4, 4, 7, 4, 4,
4, 7, 4, 7, 4,
10, 10, 11, 10, 10,
0, 0, 15, 10, 10,
0, 7, 4, 7, 4,
10, 11, 8, 11, 10,
10, 10, 10, 10, 10,
0, 15, 8, 11, 10,
10, 11, 8, 15, 0,
10, 10, 15, 0, 0,
4, 7, 4, 7, 0,
0, 0, 7, 4, 4,
4, 4, 28, 0, 0,
4, 4, 31, 0, 0,
0, 0, 31, 4, 4,
4, 4, 28, 4, 4,
0, 0, 31, 0, 0,
4, 4, 31, 4, 4,
4, 28, 4, 28, 4,
10, 10, 26, 10, 10,
10, 26, 2, 30, 0,
0, 30, 2, 26, 10,
10, 27, 0, 31, 0,
0, 31, 0, 27, 10,
10, 26, 2, 26, 10,
0, 31, 0, 31, 0,
10, 27, 0, 27, 10,
4, 31, 0, 31, 0,
10, 10, 31, 0, 0,
0, 31, 0, 31, 4,
0, 0, 31, 10, 10,
10, 10, 30, 0, 0,
4, 28, 4, 28, 0,
0, 28, 4, 28, 4,
0, 0, 30, 10, 10,
10, 10, 31, 10, 10,
4, 31, 4, 31, 4,
4, 4, 7, 0, 0,
0, 0, 28, 4, 4,
31, 31, 31, 31, 31,
0, 0, 31, 31, 31,
3, 3, 3, 3, 3,
24, 24, 24, 24, 24,
31, 31, 31, 0, 0,
0, 0, 0, 0, 0,
6, 9, 13, 17, 13,
0, 0, 0, 0, 0,
14, 17, 17, 17, 14,
0, 4, 10, 4, 0,
0, 0, 4, 0, 0,
0, 0, 0, 0, 0,
0, 0, 4, 0, 0,
0, 4, 10, 4, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 14, 31, 14, 0,
16, 14, 10, 14, 1,
12, 2, 14, 2, 12,
6, 9, 9, 9, 9,
14, 0, 14, 0, 14,
4, 14, 4, 0, 14,
2, 4, 8, 4, 14,
8, 4, 2, 4, 14,
8, 20, 4, 4, 4,
4, 4, 4, 5, 2,
4, 0, 14, 0, 4,
10, 5, 0, 10, 5,
4, 14, 4, 0, 0,
0, 14, 14, 14, 0,
0, 0, 4, 0, 0,
24, 8, 11, 10, 4,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0
] | nitram_micro_mono_cp437 = [0, 0, 0, 0, 0, 10, 0, 4, 17, 14, 10, 0, 0, 14, 17, 27, 31, 31, 14, 4, 0, 0, 0, 0, 0, 0, 4, 10, 4, 14, 4, 14, 14, 4, 14, 0, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 4, 10, 4, 0, 0, 0, 0, 0, 0, 30, 28, 31, 21, 7, 5, 13, 31, 12, 4, 20, 22, 31, 6, 4, 15, 10, 10, 10, 5, 21, 14, 27, 14, 21, 4, 12, 28, 12, 4, 4, 6, 7, 6, 4, 4, 14, 4, 14, 4, 10, 10, 10, 0, 10, 12, 11, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 31, 31, 0, 0, 0, 0, 0, 4, 14, 21, 4, 4, 4, 4, 21, 14, 4, 4, 8, 31, 8, 4, 4, 2, 31, 2, 4, 0, 2, 2, 30, 0, 0, 14, 14, 14, 0, 4, 14, 31, 0, 0, 0, 0, 31, 14, 4, 0, 0, 0, 0, 0, 4, 4, 4, 0, 4, 10, 10, 0, 0, 0, 10, 31, 10, 31, 10, 31, 5, 31, 20, 31, 17, 8, 4, 2, 17, 6, 9, 22, 9, 22, 8, 4, 0, 0, 0, 8, 4, 4, 4, 8, 2, 4, 4, 4, 2, 21, 14, 31, 14, 21, 0, 4, 14, 4, 0, 0, 0, 0, 4, 2, 0, 0, 14, 0, 0, 0, 0, 0, 0, 2, 8, 4, 4, 4, 2, 14, 25, 21, 19, 14, 4, 6, 4, 4, 14, 14, 8, 14, 2, 14, 14, 8, 12, 8, 14, 2, 2, 10, 14, 8, 14, 2, 14, 8, 14, 6, 2, 14, 10, 14, 14, 8, 12, 8, 8, 14, 10, 14, 10, 14, 14, 10, 14, 8, 14, 0, 4, 0, 4, 0, 0, 4, 0, 4, 2, 8, 4, 2, 4, 8, 0, 14, 0, 14, 0, 2, 4, 8, 4, 2, 14, 17, 12, 0, 4, 14, 9, 5, 1, 14, 6, 9, 17, 31, 17, 7, 9, 15, 17, 15, 14, 17, 1, 17, 14, 15, 25, 17, 17, 15, 31, 1, 15, 1, 31, 31, 1, 15, 1, 1, 14, 1, 25, 17, 14, 9, 17, 31, 17, 17, 14, 4, 4, 4, 14, 12, 8, 8, 10, 14, 9, 5, 3, 5, 9, 1, 1, 1, 1, 15, 17, 27, 21, 17, 17, 17, 19, 21, 25, 17, 14, 25, 17, 17, 14, 7, 9, 7, 1, 1, 14, 17, 17, 25, 30, 7, 9, 7, 5, 9, 30, 1, 14, 16, 15, 31, 4, 4, 4, 4, 9, 17, 17, 17, 14, 10, 10, 10, 10, 4, 9, 17, 21, 21, 10, 17, 10, 4, 10, 17, 17, 10, 4, 4, 4, 31, 8, 4, 2, 31, 12, 4, 4, 4, 12, 2, 4, 4, 4, 8, 6, 4, 4, 4, 6, 4, 10, 0, 0, 0, 0, 0, 0, 0, 14, 4, 8, 0, 0, 0, 6, 9, 17, 31, 17, 7, 9, 15, 17, 15, 14, 17, 1, 17, 14, 15, 25, 17, 17, 15, 31, 1, 15, 1, 31, 31, 1, 15, 1, 1, 14, 1, 25, 17, 14, 9, 17, 31, 17, 17, 14, 4, 4, 4, 14, 12, 8, 8, 10, 14, 18, 10, 6, 10, 18, 1, 1, 1, 1, 15, 17, 27, 21, 17, 17, 17, 19, 21, 25, 17, 14, 25, 17, 17, 14, 7, 9, 7, 1, 1, 14, 17, 17, 25, 30, 7, 9, 7, 5, 9, 30, 1, 14, 16, 15, 31, 4, 4, 4, 4, 9, 17, 17, 17, 14, 10, 10, 10, 10, 4, 9, 17, 21, 21, 10, 17, 10, 4, 10, 17, 17, 10, 4, 4, 4, 31, 8, 4, 2, 31, 12, 4, 2, 4, 12, 4, 4, 4, 4, 4, 6, 4, 8, 4, 6, 10, 5, 0, 0, 0, 0, 4, 10, 10, 14, 0, 0, 0, 0, 0, 10, 0, 10, 10, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 10, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 17, 17, 17, 31, 0, 14, 10, 14, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 14, 10, 14, 0, 0, 0, 0, 0, 0, 10, 0, 14, 10, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 14, 10, 14, 0, 0, 0, 0, 0, 3, 25, 11, 9, 11, 28, 23, 21, 21, 29, 0, 3, 1, 1, 1, 10, 0, 14, 10, 14, 10, 0, 10, 10, 14, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6, 17, 14, 0, 0, 28, 4, 4, 0, 0, 7, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 4, 18, 9, 18, 4, 4, 9, 18, 9, 4, 0, 10, 0, 10, 0, 10, 21, 10, 21, 10, 21, 10, 21, 10, 21, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 7, 4, 7, 4, 10, 10, 11, 10, 10, 0, 0, 15, 10, 10, 0, 7, 4, 7, 4, 10, 11, 8, 11, 10, 10, 10, 10, 10, 10, 0, 15, 8, 11, 10, 10, 11, 8, 15, 0, 10, 10, 15, 0, 0, 4, 7, 4, 7, 0, 0, 0, 7, 4, 4, 4, 4, 28, 0, 0, 4, 4, 31, 0, 0, 0, 0, 31, 4, 4, 4, 4, 28, 4, 4, 0, 0, 31, 0, 0, 4, 4, 31, 4, 4, 4, 28, 4, 28, 4, 10, 10, 26, 10, 10, 10, 26, 2, 30, 0, 0, 30, 2, 26, 10, 10, 27, 0, 31, 0, 0, 31, 0, 27, 10, 10, 26, 2, 26, 10, 0, 31, 0, 31, 0, 10, 27, 0, 27, 10, 4, 31, 0, 31, 0, 10, 10, 31, 0, 0, 0, 31, 0, 31, 4, 0, 0, 31, 10, 10, 10, 10, 30, 0, 0, 4, 28, 4, 28, 0, 0, 28, 4, 28, 4, 0, 0, 30, 10, 10, 10, 10, 31, 10, 10, 4, 31, 4, 31, 4, 4, 4, 7, 0, 0, 0, 0, 28, 4, 4, 31, 31, 31, 31, 31, 0, 0, 31, 31, 31, 3, 3, 3, 3, 3, 24, 24, 24, 24, 24, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 6, 9, 13, 17, 13, 0, 0, 0, 0, 0, 14, 17, 17, 17, 14, 0, 4, 10, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 31, 14, 0, 16, 14, 10, 14, 1, 12, 2, 14, 2, 12, 6, 9, 9, 9, 9, 14, 0, 14, 0, 14, 4, 14, 4, 0, 14, 2, 4, 8, 4, 14, 8, 4, 2, 4, 14, 8, 20, 4, 4, 4, 4, 4, 4, 5, 2, 4, 0, 14, 0, 4, 10, 5, 0, 10, 5, 4, 14, 4, 0, 0, 0, 14, 14, 14, 0, 0, 0, 4, 0, 0, 24, 8, 11, 10, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
def is_same_string(string1, string2):
if len(string1) != len(string2):
return False
else:
for i in range(len(string1)):
if string1[i] != string2[i]:
return False
return True
def reverse_string(string):
gnirts = ''
for i in range(len(string)):
gnirts += string[-1-i]
return gnirts
def is_palindrome(string):
gnirts = reverse_string(string)
return(is_same_string(string, gnirts))
n = 0
for i in range(100, 1000):
for j in range(i, 1000):
if is_palindrome(str(i*j)) and i*j > n:
n = i*j
print(n)
| def is_same_string(string1, string2):
if len(string1) != len(string2):
return False
else:
for i in range(len(string1)):
if string1[i] != string2[i]:
return False
return True
def reverse_string(string):
gnirts = ''
for i in range(len(string)):
gnirts += string[-1 - i]
return gnirts
def is_palindrome(string):
gnirts = reverse_string(string)
return is_same_string(string, gnirts)
n = 0
for i in range(100, 1000):
for j in range(i, 1000):
if is_palindrome(str(i * j)) and i * j > n:
n = i * j
print(n) |
class PretreatedQuery:
'''
DBpedia resultat
'''
def __init__(self, mentions_list, detected_ne):
'''
Constructor
'''
self.mentions_list=mentions_list
self.detected_ne=detected_ne
| class Pretreatedquery:
"""
DBpedia resultat
"""
def __init__(self, mentions_list, detected_ne):
"""
Constructor
"""
self.mentions_list = mentions_list
self.detected_ne = detected_ne |
def even_odd(*args):
if "even" in args:
return list(filter(lambda x: x % 2 == 0, [args[i] for i in range(len(args) - 1)]))
return list(filter(lambda x: x % 2 == 1, [args[i] for i in range(len(args) - 1)]))
# print(even_odd(1, 2, 3, 4, 5, 6, "even"))
# print(even_odd(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "odd"))
| def even_odd(*args):
if 'even' in args:
return list(filter(lambda x: x % 2 == 0, [args[i] for i in range(len(args) - 1)]))
return list(filter(lambda x: x % 2 == 1, [args[i] for i in range(len(args) - 1)])) |
pkgname = "python-sphinxcontrib-serializinghtml"
pkgver = "1.1.5"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools"]
checkdepends = ["python-sphinx"]
depends = ["python"]
pkgdesc = "Sphinx extension which outputs serialized HTML document"
maintainer = "q66 <[email protected]>"
license = "BSD-2-Clause"
url = "http://sphinx-doc.org"
source = f"$(PYPI_SITE)/s/sphinxcontrib-serializinghtml/sphinxcontrib-serializinghtml-{pkgver}.tar.gz"
sha256 = "aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"
# circular checkdepends
options = ["!check"]
def post_install(self):
self.install_license("LICENSE")
| pkgname = 'python-sphinxcontrib-serializinghtml'
pkgver = '1.1.5'
pkgrel = 0
build_style = 'python_module'
hostmakedepends = ['python-setuptools']
checkdepends = ['python-sphinx']
depends = ['python']
pkgdesc = 'Sphinx extension which outputs serialized HTML document'
maintainer = 'q66 <[email protected]>'
license = 'BSD-2-Clause'
url = 'http://sphinx-doc.org'
source = f'$(PYPI_SITE)/s/sphinxcontrib-serializinghtml/sphinxcontrib-serializinghtml-{pkgver}.tar.gz'
sha256 = 'aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952'
options = ['!check']
def post_install(self):
self.install_license('LICENSE') |
lis = [1, 2, 3, 4, 2, 6, 7, 8, 9]
without_duplicates = []
ok = True
for i in range(0,len(lis)):
if lis[i] in without_duplicates:
ok = False
break
else:
without_duplicates.append(lis[i])
if ok:
print("There are no duplicates")
else:
print("Things are not ok") | lis = [1, 2, 3, 4, 2, 6, 7, 8, 9]
without_duplicates = []
ok = True
for i in range(0, len(lis)):
if lis[i] in without_duplicates:
ok = False
break
else:
without_duplicates.append(lis[i])
if ok:
print('There are no duplicates')
else:
print('Things are not ok') |
# model settings
model = dict(
type='CenterNet2',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch',
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
start_level=1,
add_extra_convs='on_output', # use P5
num_outs=5,
relu_before_extra_convs=True),
rpn_head=dict(
type='CenterNet2Head',
num_classes=80,
in_channels=256,
stacked_convs=4,
feat_channels=256,
not_norm_reg=True,
dcn_on_last_conv=False,
strides=[8, 16, 32, 64, 128],
regress_ranges=((0, 64), (64, 128), (128, 256), (256, 512), (512,
1e8)),
loss_hm=dict(
type='BinaryFocalLoss',
alpha=0.25,
beta=4,
gamma=2,
weight=0.5,
sigmoid_clamp=1e-4,
ignore_high_fp=0.85),
loss_bbox=dict(type='GIoULoss', reduction='mean', loss_weight=1.0)),
roi_head=dict(
type='CascadeRoIHead',
num_stages=3,
stage_loss_weights=[1, 0.5, 0.25],
mult_proposal_score=True,
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
out_channels=256,
featmap_strides=[8, 16, 32, 64, 128],
finest_scale=112),
bbox_head=[
dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=80,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0., 0., 0., 0.],
target_stds=[0.1, 0.1, 0.2, 0.2]),
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
loss_weight=1.0)),
dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=80,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0., 0., 0., 0.],
target_stds=[0.05, 0.05, 0.1, 0.1]),
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
loss_weight=1.0)),
dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=80,
mult_proposal_score=True,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0., 0., 0., 0.],
target_stds=[0.033, 0.033, 0.067, 0.067]),
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=False,
loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))
]),
# training and testing settings
train_cfg=dict(
rpn=dict(
nms_pre=4000,
score_thr=0.0001,
min_bbox_size=0,
nms=dict(type='nms', iou_threshold=0.9),
max_per_img=2000),
rcnn=[
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.6,
neg_iou_thr=0.6,
min_pos_iou=0.6,
match_low_quality=False,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False),
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.7,
neg_iou_thr=0.7,
min_pos_iou=0.7,
match_low_quality=False,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False),
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.8,
neg_iou_thr=0.8,
min_pos_iou=0.8,
match_low_quality=False,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False)
]),
test_cfg=dict(
rpn=dict(
nms_pre=1000,
score_thr=0.0001,
min_bbox_size=0,
nms=dict(type='nms', iou_threshold=0.9),
max_per_img=256),
rcnn=dict(
score_thr=0.05,
nms=dict(type='nms', iou_threshold=0.7),
max_per_img=100)))
# dataset settings
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(
type='Resize',
img_scale=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
(1333, 768), (1333, 800)],
multiscale_mode='value',
keep_ratio=True),
dict(type='RandomFlip', flip_ratio=0.5),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='ImageToTensor', keys=['img']),
dict(type='Collect', keys=['img']),
])
]
data = dict(
samples_per_gpu=2,
workers_per_gpu=2,
train=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_train2017.json',
img_prefix=data_root + 'train2017/',
pipeline=train_pipeline),
val=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline),
test=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
pipeline=test_pipeline))
evaluation = dict(interval=9000, metric='bbox')
# optimizer
optimizer = dict(type='SGD', lr=0.02 / 8, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# learning policy
lr_config = dict(
policy='step', warmup='linear', warmup_iters=500, step=[60000, 80000])
runner = dict(type='IterBasedRunner', max_iters=90000)
# runtime
checkpoint_config = dict(interval=9000)
# yapf:disable
log_config = dict(
interval=100,
hooks=[
dict(type='TextLoggerHook'),
# dict(type='TensorboardLoggerHook')
])
# yapf:enable
custom_hooks = [dict(type='NumClassCheckHook')]
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
work_dir = 'outputs/CN2R50FPN'
seed = 0
gpu_ids = range(1)
| model = dict(type='CenterNet2', backbone=dict(type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, style='pytorch', init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), neck=dict(type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, start_level=1, add_extra_convs='on_output', num_outs=5, relu_before_extra_convs=True), rpn_head=dict(type='CenterNet2Head', num_classes=80, in_channels=256, stacked_convs=4, feat_channels=256, not_norm_reg=True, dcn_on_last_conv=False, strides=[8, 16, 32, 64, 128], regress_ranges=((0, 64), (64, 128), (128, 256), (256, 512), (512, 100000000.0)), loss_hm=dict(type='BinaryFocalLoss', alpha=0.25, beta=4, gamma=2, weight=0.5, sigmoid_clamp=0.0001, ignore_high_fp=0.85), loss_bbox=dict(type='GIoULoss', reduction='mean', loss_weight=1.0)), roi_head=dict(type='CascadeRoIHead', num_stages=3, stage_loss_weights=[1, 0.5, 0.25], mult_proposal_score=True, bbox_roi_extractor=dict(type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0), out_channels=256, featmap_strides=[8, 16, 32, 64, 128], finest_scale=112), bbox_head=[dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=80, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.1, 0.1, 0.2, 0.2]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=80, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.05, 0.05, 0.1, 0.1]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)), dict(type='Shared2FCBBoxHead', in_channels=256, fc_out_channels=1024, roi_feat_size=7, num_classes=80, mult_proposal_score=True, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.033, 0.033, 0.067, 0.067]), reg_class_agnostic=True, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))]), train_cfg=dict(rpn=dict(nms_pre=4000, score_thr=0.0001, min_bbox_size=0, nms=dict(type='nms', iou_threshold=0.9), max_per_img=2000), rcnn=[dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.6, neg_iou_thr=0.6, min_pos_iou=0.6, match_low_quality=False, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), pos_weight=-1, debug=False), dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.7, min_pos_iou=0.7, match_low_quality=False, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), pos_weight=-1, debug=False), dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.8, neg_iou_thr=0.8, min_pos_iou=0.8, match_low_quality=False, ignore_iof_thr=-1), sampler=dict(type='RandomSampler', num=512, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), pos_weight=-1, debug=False)]), test_cfg=dict(rpn=dict(nms_pre=1000, score_thr=0.0001, min_bbox_size=0, nms=dict(type='nms', iou_threshold=0.9), max_per_img=256), rcnn=dict(score_thr=0.05, nms=dict(type='nms', iou_threshold=0.7), max_per_img=100)))
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True), dict(type='Resize', img_scale=[(1333, 640), (1333, 672), (1333, 704), (1333, 736), (1333, 768), (1333, 800)], multiscale_mode='value', keep_ratio=True), dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])]
test_pipeline = [dict(type='LoadImageFromFile'), dict(type='MultiScaleFlipAug', img_scale=(1333, 800), flip=False, transforms=[dict(type='Resize', keep_ratio=True), dict(type='RandomFlip'), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='ImageToTensor', keys=['img']), dict(type='Collect', keys=['img'])])]
data = dict(samples_per_gpu=2, workers_per_gpu=2, train=dict(type=dataset_type, ann_file=data_root + 'annotations/instances_train2017.json', img_prefix=data_root + 'train2017/', pipeline=train_pipeline), val=dict(type=dataset_type, ann_file=data_root + 'annotations/instances_val2017.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline), test=dict(type=dataset_type, ann_file=data_root + 'annotations/instances_val2017.json', img_prefix=data_root + 'val2017/', pipeline=test_pipeline))
evaluation = dict(interval=9000, metric='bbox')
optimizer = dict(type='SGD', lr=0.02 / 8, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
lr_config = dict(policy='step', warmup='linear', warmup_iters=500, step=[60000, 80000])
runner = dict(type='IterBasedRunner', max_iters=90000)
checkpoint_config = dict(interval=9000)
log_config = dict(interval=100, hooks=[dict(type='TextLoggerHook')])
custom_hooks = [dict(type='NumClassCheckHook')]
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
work_dir = 'outputs/CN2R50FPN'
seed = 0
gpu_ids = range(1) |
aux = 0
num = int(input("Ingrese un numero entero positivo: "))
opc = int(input("1- Sumatoria, 2-Factorial: "))
if opc == 1:
for x in range(0,num+1):
aux = aux + x
print (aux)
elif opc == 2:
if num == 0:
print("1")
elif num > 0:
aux = 1
for x in range(1,num+1):
aux = aux*x
print (aux)
elif num < 0:
print("Se deberia haber ingresado un numero valido") | aux = 0
num = int(input('Ingrese un numero entero positivo: '))
opc = int(input('1- Sumatoria, 2-Factorial: '))
if opc == 1:
for x in range(0, num + 1):
aux = aux + x
print(aux)
elif opc == 2:
if num == 0:
print('1')
elif num > 0:
aux = 1
for x in range(1, num + 1):
aux = aux * x
print(aux)
elif num < 0:
print('Se deberia haber ingresado un numero valido') |
#Give a single command that computes the sum from Exercise R-1.6,relying
#on Python's comprehension syntax and the built-in sum function
n = int(input('please input an positive integer:'))
result = sum(i**2 for i in range(1,n) if i&1!=0)
print(result) | n = int(input('please input an positive integer:'))
result = sum((i ** 2 for i in range(1, n) if i & 1 != 0))
print(result) |
def twoSum(self, n: List[int], target: int) -> List[int]:
N = len(n)
l = 0
r = N-1
while l<r:
s = n[l] + n[r]
if s == target:
return [l+1,r+1]
elif s < target:
l += 1
else:
r -= 1
| def two_sum(self, n: List[int], target: int) -> List[int]:
n = len(n)
l = 0
r = N - 1
while l < r:
s = n[l] + n[r]
if s == target:
return [l + 1, r + 1]
elif s < target:
l += 1
else:
r -= 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.