content stringlengths 7 1.05M |
|---|
"""
Copyright (c) 2021 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance with the terms of
the License. All rights not expressly granted by the License are
reserved. Unless required by applicable law or agreed to separately 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.
"""
# Step 1: Specify the commands that you would like to test on the access devices
access_commands = [
"show ip arp",
"show ip interface brief",
"show mac address-table",
"show version",
"show inventory",
"show running-config",
"show boot",
"show ip route",
"show ip ospf neighbor",
"show ip ospf database"
]
# Step 2: Specify the commands that you would like to test on the core devices
core_commands = [
"show ip arp",
"show ip interface brief",
"show mac address-table",
"show version",
"show inventory",
"show running-config",
"show boot",
"show ip route",
"show ip ospf neighbor",
"show ip bgp summary",
"show ip bgp neighbors",
"show ip ospf database"
]
# Step 3: Create a dictionary with the devices as a key and the commands as the value
device_commands = {}
device_commands['access1'] = access_commands
device_commands['access2'] = access_commands
device_commands['core1'] = core_commands
device_commands['core2'] = core_commands
# Step 4: Specify all the devices that you would like to test in your topology
devices = ["access1", "access2", "core1", "core2"]
# Step 5: Specify the destinations that you would like to test for reachability
destinations = [
[""], #access1
[""], #access2
[""], #core1
[""] #core2
]
# Step 6: Specify the testbed filename
testbed_filename = ''
|
def dight(n):
sum=0
while n>0:
sum=sum+n%10
n=n//10
return sum
k=0
l=[]
for i in range(2,100):
for j in range(2,100):
t=i**j
d=dight(t)
if d==i:
k+=1
l.append(t)
l=sorted(l)
print(l[29]) |
load("//cuda:providers.bzl", "CudaInfo")
def is_dynamic_input(src):
return src.extension in ["so", "dll", "dylib"]
def is_object_file(src):
return src.extension in ["obj", "o"]
def is_static_input(src):
return src.extension in ["a", "lib", "lo"]
def is_source_file(src):
return src.extension in ["c", "cc", "cpp", "cxx", "c++", "C", "cu"]
def is_header_file(src):
return src.extension in ["h", "hh", "hpp", "hxx", "inc", "inl", "H", "cuh"]
def _process_srcs(srcs, source_files, header_files, object_files, static_inputs, dynamic_inputs):
for src in srcs:
if is_source_file(src):
source_files.append(src)
if is_header_file(src):
header_files.append(src)
if is_static_input(src):
static_inputs.append(src)
if is_dynamic_input(src):
dynamic_inputs.append(src)
if is_object_file(src):
object_files.append(src)
def _resolve_include_prefixes(
ctx,
rule_kind,
input_private_header_files,
output_private_header_files,
input_public_header_files,
output_public_header_files,
strip_include_prefix,
include_prefix,
local_include_paths,
include_paths,
):
if strip_include_prefix == "" and include_prefix == "":
# Private headers
for header_file in input_private_header_files:
output_private_header_files.append(header_file)
# Public headers
for header_file in input_public_header_files:
output_public_header_files.append(header_file)
# Public include path
if input_public_header_files:
include_paths.append(ctx.build_file_path.replace('/BUILD.bazel', ''))
return
if strip_include_prefix != "":
strip_include_prefix = strip_include_prefix[1:] if strip_include_prefix[0] == "/" else strip_include_prefix
strip_include_prefix = strip_include_prefix[:-1] if strip_include_prefix[-1] == "/" else strip_include_prefix
strip_path = ctx.build_file_path.replace('BUILD.bazel', strip_include_prefix)
if include_prefix != "":
include_prefix = include_prefix[1:] if include_prefix[0] == "/" else include_prefix
include_prefix = include_prefix[:-1] if include_prefix[-1] == "/" else include_prefix
add_path = "_virtual_includes/{}/{}".format(ctx.attr.name, include_prefix)
# Calculate new include path
include_path = ctx.bin_dir.path + "/" + ctx.build_file_path.replace('BUILD.bazel', add_path)
# Add include path to private includes
local_include_paths.append(include_path)
# Add include path to public includes
if input_public_header_files:
include_paths.append(include_path)
# Private headers
for header_file in input_private_header_files:
if strip_path not in header_file.path:
fail("in {} rule {}: header {} is not under the specified strip prefix {}".format(
rule_kind, ctx.label, header_file.path, strip_path
))
new_header_file = ctx.actions.declare_file(header_file.path.replace(strip_path, add_path))
ctx.actions.symlink(
output = new_header_file,
target_file = header_file,
)
output_private_header_files.append(new_header_file)
# Public headers
for header_file in input_public_header_files:
if strip_path not in header_file.path:
fail("in {} rule {}: header {} is not under the specified strip prefix {}".format(
ctx.rule.kind, ctx.label, header_file.path, strip_path
))
new_header_file = ctx.actions.declare_file(header_file.path.replace(strip_path, add_path))
ctx.actions.symlink(
output = new_header_file,
target_file = header_file,
)
output_public_header_files.append(new_header_file)
def _process_deps(
deps,
object_files,
static_inputs,
dynamic_inputs,
private_header_files,
local_include_paths,
local_quote_include_paths,
local_system_include_paths,
local_defines,
):
for dep in deps:
if CcInfo in dep:
ctx = dep[CcInfo].compilation_context
private_header_files.extend(
ctx.direct_public_headers +
ctx.direct_textual_headers +
ctx.headers.to_list()
)
local_include_paths.extend(ctx.includes.to_list())
local_quote_include_paths.extend(ctx.quote_includes.to_list())
local_system_include_paths.extend(ctx.system_includes.to_list())
local_defines.extend(ctx.defines.to_list())
if CudaInfo in dep:
object_files.extend(dep[CudaInfo].linking_context.object_files)
static_inputs.extend(dep[CudaInfo].linking_context.static_libraries)
dynamic_inputs.extend(dep[CudaInfo].linking_context.dynamic_libraries)
def preprocess_inputs(ctx, rule_kind):
source_files = []
private_header_files = []
public_header_files = []
object_files = []
static_inputs = []
dynamic_inputs = []
# Include paths
local_include_paths = []
local_quote_include_paths = [
".",
ctx.bin_dir.path,
]
local_system_include_paths = []
include_paths = []
quote_include_paths = []
system_include_paths = list(ctx.attr.includes)
# Defines
local_defines = list(ctx.attr.local_defines)
defines = list(ctx.attr.defines)
# Extract different types of inputs from srcs
private_header_files_tmp = []
_process_srcs(
ctx.files.srcs,
source_files,
private_header_files_tmp,
object_files,
static_inputs,
dynamic_inputs
)
# Resolve source header paths
_resolve_include_prefixes(
ctx,
rule_kind,
private_header_files_tmp,
private_header_files,
ctx.files.hdrs,
public_header_files,
ctx.attr.strip_include_prefix,
ctx.attr.include_prefix,
local_include_paths,
include_paths,
)
# Resolve compile depenedecies
_process_deps(
ctx.attr.deps,
object_files,
static_inputs,
dynamic_inputs,
private_header_files,
local_include_paths,
local_quote_include_paths,
local_system_include_paths,
local_defines,
)
return struct(
source_files = source_files,
private_header_files = private_header_files,
public_header_files = public_header_files,
object_files = object_files,
static_inputs = static_inputs,
dynamic_inputs = dynamic_inputs,
local_include_paths = local_include_paths,
local_quote_include_paths = local_quote_include_paths,
local_system_include_paths = local_system_include_paths,
include_paths = include_paths,
quote_include_paths = quote_include_paths,
system_include_paths = system_include_paths,
local_defines = local_defines,
defines = defines,
)
def process_features(features):
requested_features = []
unsupported_features = []
for feature in features:
if feature[0] == '-':
unsupported_features.append(feature[1:])
else:
requested_features.append(feature)
return struct(
requested_features = requested_features,
unsupported_features = unsupported_features,
)
def combine_env(ctx, host_env, device_env):
host_path = host_env.get("PATH", "").split(ctx.configuration.host_path_separator)
host_ld_library_path = host_env.get("LD_LIBRARY_PATH", "").split(ctx.configuration.host_path_separator)
device_path = host_env.get("PATH", "").split(ctx.configuration.host_path_separator)
device_ld_library_path = host_env.get("LD_LIBRARY_PATH", "").split(ctx.configuration.host_path_separator)
update_values = dict(device_env)
env = dict(host_env)
if host_path or device_path:
path = host_path
for value in device_path:
if value not in path:
path.append(value)
update_values["PATH"] = ctx.configuration.host_path_separator.join(path)
if host_ld_library_path or device_ld_library_path:
ld_library_path = host_ld_library_path
for value in device_ld_library_path:
if value not in ld_library_path:
ld_library_path.append(value)
update_values["LD_LIBRARY_PATH"] = ctx.configuration.host_path_separator.join(ld_library_path)
env.update(update_values)
return env
def expand_make_variables(ctx, value):
for key, value in ctx.var.items():
value = value.replace('$({})'.format(key), value)
return value
|
def custMin(paramList):
n = len(paramList)-1
for pos in range(n):
if paramList[pos] < paramList[pos+1]:
paramList[pos], paramList[pos+1] = paramList[pos+1], paramList[pos]
return paramList[n]
print(custMin([5, 2, 9, 10, -2, 90]))
|
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# 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.
"""
Module to store space related url names.
"""
# Spaces
SPACE_ADD = 'create-space'
SPACE_EDIT = 'edit-space'
SPACE_DELETE = 'delete-space'
SPACE_INDEX = 'space-index'
SPACE_FEED = 'space-feed'
SPACE_LIST = 'list-spaces'
GOTO_SPACE = 'goto-space'
EDIT_ROLES = 'edit-roles'
SEARCH_USER = 'search-user'
# News
# Notes: SPACE_NEWS is held only for backwards compatibility, it should be
# removed when every reverse is cleaned
SPACE_NEWS = 'list-space-news'
NEWS_ARCHIVE = 'post-archive'
NEWS_MONTH = 'post-archive-month'
NEWS_YEAR = 'post-archive-year'
# Documents
DOCUMENT_ADD = 'add-document'
DOCUMENT_EDIT = 'edit-document'
DOCUMENT_DELETE = 'delete-document'
DOCUMENT_LIST = 'list-documents'
# Events
EVENT_ADD = 'add-event'
EVENT_EDIT = 'edit-event'
EVENT_DELETE = 'delete-event'
EVENT_LIST = 'list-events'
EVENT_VIEW = 'view-event'
# Intents
INTENT_ADD = 'add-intent'
INTENT_VALIDATE = 'validate-intent'
|
# 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.
INTEGRATOR = "bin/integrator"
ANALYTICS = "wso2/analytics/wso2/worker/bin/carbon"
BROKER = "wso2/broker/bin/wso2server"
BP = "wso2/business-process/bin/wso2server"
MICRO_INTG = "wso2/micro-integrator/bin/wso2server"
DATASOURCE_PATHS = {"product-apim": {},
"product-is": {},
"product-ei": {"CORE": ["conf/datasources/master-datasources.xml"],
"BROKER": ["wso2/broker/conf/datasources/master-datasources.xml",
"wso2/broker/conf/datasources/metrics-datasources.xml"],
"BPS": ["wso2/business-process/conf/datasources/master-datasources.xml",
"wso2/business-process/conf/datasources/bps-datasources.xml",
"wso2/business-process/conf/datasources/activiti-datasources.xml"]},
}
M2_PATH = {"product-is": "is/wso2is",
"product-apim": "am/wso2am",
"product-ei": "ei/wso2ei"}
DIST_POM_PATH = {"product-is": "modules/distribution/pom.xml",
"product-apim": "modules/distribution/product/pom.xml",
"product-ei": "distribution/pom.xml"}
LIB_PATH = {"product-apim": "",
"product-is": "",
"product-ei": "lib"}
DISTRIBUTION_PATH = {"product-apim": "modules/distribution/product/target",
"product-is": "modules/distribution/target",
"product-ei": "distribution/target"}
INTEGRATION_PATH = {"product-apim": "modules/integration",
"product-is": "modules/integration",
"product-ei": "integration/mediation-tests/tests-mediator-1/"}
POM_FILE_PATHS = {"product-is": "",
"product-apim": "",
"product-ei": ""}
# Add testng files to be replaced. E.g "integration/mediation-tests/tests-mediator-1/src/test/resources/testng.xml"
TESTNG_DIST_XML_PATHS = {"integration/business-process-tests/pom.xml",
"integration/business-process-tests/tests-integration/bpel/src/test/resources/testng-server-mgt.xml",
"integration/business-process-tests/tests-integration/bpel/src/test/resources/testng.xml",
"integration/business-process-tests/tests-integration/bpmn/src/test/resources/testng.xml",
"integration/business-process-tests/tests-integration/humantasks/src/test/resources/testng.xml",
"integration/business-process-tests/tests-integration/pom.xml",
"integration/mediation-tests/pom.xml",
"integration/mediation-tests/tests-mediator-2/src/test/resources/testng.xml",
"integration/mediation-tests/tests-patches/src/test/resources/testng.xml",
"integration/mediation-tests/tests-service/src/test/resources/testng.xml",
"integration/mediation-tests/tests-transport/src/test/resources/testng.xml",
"integration/pom.xml"}
ARTIFACT_REPORTS_PATHS = {"product-apim": [],
"product-is": [],
"product-ei": {"mediation-tests-mediator-1": ["integration/mediation-tests/tests-mediator-1/target/surefire-reports",
"integration/mediation-tests/tests-mediator-1/target/logs/automation.log"]
}
}
IGNORE_DIR_TYPES = {"product-apim": [],
"product-is": [],
"product-ei": ["ESBTestSuite","junitreports","BPS Test Suite","bps-server-startup","BPS HumanTask TestSuite","BPS HumanTask Coordination TestSuite","DssTestSuite"]
}
DB_META_DATA = {
"MYSQL": {"prefix": "jdbc:mysql://", "driverClassName": "com.mysql.jdbc.Driver", "jarName": "mysql.jar",
"DB_SETUP": {
"product-apim": {},
"product-is": {},
"product-ei": {"WSO2_CARBON_DB_CORE": ['dbscripts/mysql5.7.sql'],
"WSO2_CARBON_DB_BROKER": ['wso2/broker/dbscripts/mysql5.7.sql'],
"WSO2_CARBON_DB_BPS": ['wso2/business-process/dbscripts/mysql5.7.sql'],
"WSO2_MB_STORE_DB_BROKER": ['wso2/broker/dbscripts/mb-store/mysql-mb.sql'],
"WSO2_METRICS_DB_BROKER": ['wso2/broker/dbscripts/metrics/mysql.sql'],
"BPS_DS_BPS": ['wso2/business-process/dbscripts/bps/bpel/create/mysql.sql'],
"ACTIVITI_DB_BPS": [
'wso2/business-process/dbscripts/bps/bpmn/create/activiti.mysql.create.identity.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": {}}
}} |
def get_digit(num):
root = num ** 0.5
if root % 1 == 0:
return
counting = []
b = (root // 1)
c = 1
while True:
d = (c / (root - b)) // 1
e = num - b ** 2
if e % c == 0:
c = e / c
else:
c = e
b = (c * d - b)
if [b, c] in counting:
return counting
else:
counting.append([b, c])
result = 0
for i in range(10001):
token = get_digit(i)
if token != None and len(token) % 2 == 1:
result += 1
print(result) |
"""
Generate a JSON file for pre-configuration
.. only:: development_administrator
Created on Jul. 6, 2020
@author: jgossage
"""
def genpre(file: str = 'preconfig.json'):
pass |
# https://youtu.be/wNVCJj642n4?list=PLAB1DA9F452D9466C
def binary_search(items, target):
low = 0
high = len(items)
while (high - low) > 1:
middle = (low + high) // 2
if target < items[middle]:
high = middle
if target >= items[middle]:
low = middle
if items[low] == target:
return low
raise ValueError("{} was not found in the list".format(target))
|
# https://www.hackerrank.com/challenges/count-luck/problem
def findMove(matrix,now,gone):
x,y = now
moves = list()
moves.append((x+1,y)) if(x!=len(matrix)-1 and matrix[x+1][y]!='X' ) else None
moves.append((x,y+1)) if(y!=len(matrix[0])-1 and matrix[x][y+1]!='X') else None
moves.append((x-1,y)) if(x!=0 and matrix[x-1][y]!='X') else None
moves.append((x,y-1)) if(y!=0 and matrix[x][y-1]!='X') else None
for move in moves:
if(move in gone):
moves.remove(move)
return moves
def findPath(matrix,now):
wave=0
gone = [now]
stack= []
moves =[now]
while(True):
gone.append(moves[0])
if(matrix[moves[0][0]][moves[0][1]]=='*'):
return wave
moves = findMove(matrix,moves[0],gone)
if(len(moves)>1):
wave +=1
for i in range(1,len(moves)):
stack.append(moves[i])
elif(len(moves)<1):
moves = [stack.pop()]
def countLuck(matrix, k):
for m in range(len(matrix)):
if('M' in matrix[m]):
start = (m,matrix[m].index('M'))
print('Impressed' if findPath(matrix,start)==k else 'Oops!')
def main():
t = int(input())
for t_itr in range(t):
nm = input().split()
n = int(nm[0])
m = int(nm[1])
matrix = []
for _ in range(n):
matrix_item = input()
matrix.append(matrix_item)
k = int(input())
countLuck(matrix, k)
if __name__ == '__main__':
main()
|
"""
future: clean single-source support for Python 3 and 2
======================================================
The ``future`` module helps run Python 3.x-compatible code under Python 2
with minimal code cruft.
The goal is to allow you to write clean, modern, forward-compatible
Python 3 code today and to run it with minimal effort under Python 2
alongside a Python 2 stack that may contain dependencies that have not
yet been ported to Python 3.
It is designed to be used as follows::
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future import standard_library
from future.builtins import *
followed by clean Python 3 code (with a few restrictions) that can run
unchanged on Python 2.7.
On Python 3, the import lines have zero effect (and zero namespace
pollution).
On Python 2, ``from future import standard_library`` installs
import hooks to allow renamed and moved standard library modules to be
imported from their new Py3 locations.
On Python 2, the ``from future.builtins import *`` line shadows builtins
to provide their Python 3 semantics. (See below for the explicit import
form.)
Documentation
-------------
See: http://python-future.org
Also see the docstrings for each of these modules for more info::
- future.standard_library
- future.builtins
- future.utils
Automatic conversion
--------------------
An experimental script called ``futurize`` is included to aid in making
either Python 2 code or Python 3 code compatible with both platforms
using the ``future`` module. See `<http://python-future.org/automatic_conversion.html>`_.
Credits
-------
:Author: Ed Schofield
:Sponsor: Python Charmers Pty Ltd, Australia, and Python Charmers Pte
Ltd, Singapore. http://pythoncharmers.com
:Others: - The backported ``super()`` and ``range()`` functions are
derived from Ryan Kelly's ``magicsuper`` module and Dan
Crosta's ``xrange`` module.
- The ``futurize`` script uses ``lib2to3``, ``lib3to2``, and
parts of Armin Ronacher's ``python-modernize`` code.
- The ``python_2_unicode_compatible`` decorator is from
Django. The ``implements_iterator`` and ``with_metaclass``
decorators are from Jinja2.
- ``future`` incorporates the ``six`` module by Benjamin
Peterson as ``future.utils.six``.
- Documentation is generated using ``sphinx`` using an
adaptation of Armin Ronacher's stylesheets from Jinja2.
Licensing
---------
Copyright 2013 Python Charmers Pty Ltd, Australia.
The software is distributed under an MIT licence. See LICENSE.txt.
"""
# No namespace pollution
__all__ = []
__ver_major__ = 0
__ver_minor__ = 9
__ver_patch__ = 0
__ver_sub__ = ''
__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
__ver_patch__, __ver_sub__)
|
#
# PySNMP MIB module CISCO-LWAPP-DOT11-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-DOT11-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:47:47 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection")
CLDot11ChannelBandwidth, CLDot11Band = mibBuilder.importSymbols("CISCO-LWAPP-TC-MIB", "CLDot11ChannelBandwidth", "CLDot11Band")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, ModuleIdentity, NotificationType, Integer32, iso, TimeTicks, Counter32, Counter64, ObjectIdentity, IpAddress, MibIdentifier, Gauge32, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "ModuleIdentity", "NotificationType", "Integer32", "iso", "TimeTicks", "Counter32", "Counter64", "ObjectIdentity", "IpAddress", "MibIdentifier", "Gauge32", "Unsigned32")
DisplayString, TextualConvention, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "TruthValue")
ciscoLwappDot11MIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 612))
ciscoLwappDot11MIB.setRevisions(('2010-05-06 00:00', '2007-01-04 00:00',))
if mibBuilder.loadTexts: ciscoLwappDot11MIB.setLastUpdated('201005060000Z')
if mibBuilder.loadTexts: ciscoLwappDot11MIB.setOrganization('Cisco Systems Inc.')
ciscoLwappDot11MIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 0))
ciscoLwappDot11MIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 1))
ciscoLwappDot11MIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 2))
cldConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1))
cldStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2))
cldHtMacOperationsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1), )
if mibBuilder.loadTexts: cldHtMacOperationsTable.setStatus('current')
cldHtMacOperationsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-MIB", "cldHtDot11nBand"))
if mibBuilder.loadTexts: cldHtMacOperationsEntry.setStatus('current')
cldHtDot11nBand = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1, 1), CLDot11Band())
if mibBuilder.loadTexts: cldHtDot11nBand.setStatus('current')
cldHtDot11nChannelBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1, 2), CLDot11ChannelBandwidth().clone('twenty')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldHtDot11nChannelBandwidth.setStatus('current')
cldHtDot11nRifsEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1, 3), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldHtDot11nRifsEnable.setStatus('current')
cldHtDot11nAmsduEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1, 4), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldHtDot11nAmsduEnable.setStatus('current')
cldHtDot11nAmpduEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1, 5), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldHtDot11nAmpduEnable.setStatus('current')
cldHtDot11nGuardIntervalEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1, 6), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldHtDot11nGuardIntervalEnable.setStatus('current')
cldHtDot11nEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 1, 1, 7), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldHtDot11nEnable.setStatus('current')
cldMultipleCountryCode = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldMultipleCountryCode.setStatus('current')
cldRegulatoryDomain = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldRegulatoryDomain.setStatus('current')
cld11nMcsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4), )
if mibBuilder.loadTexts: cld11nMcsTable.setStatus('current')
cld11nMcsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-MIB", "cld11nMcsBand"), (0, "CISCO-LWAPP-DOT11-MIB", "cld11nMcsDataRateIndex"))
if mibBuilder.loadTexts: cld11nMcsEntry.setStatus('current')
cld11nMcsBand = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1, 1), CLDot11Band())
if mibBuilder.loadTexts: cld11nMcsBand.setStatus('current')
cld11nMcsDataRateIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1, 2), Unsigned32())
if mibBuilder.loadTexts: cld11nMcsDataRateIndex.setStatus('current')
cld11nMcsDataRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cld11nMcsDataRate.setStatus('current')
cld11nMcsSupportEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1, 4), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cld11nMcsSupportEnable.setStatus('current')
cld11nMcsChannelWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1, 5), Unsigned32()).setUnits('MHz').setMaxAccess("readonly")
if mibBuilder.loadTexts: cld11nMcsChannelWidth.setStatus('current')
cld11nMcsGuardInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1, 6), Unsigned32()).setUnits('ns').setMaxAccess("readonly")
if mibBuilder.loadTexts: cld11nMcsGuardInterval.setStatus('current')
cld11nMcsModulation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 4, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cld11nMcsModulation.setStatus('current')
cld11acMcsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 6), )
if mibBuilder.loadTexts: cld11acMcsTable.setStatus('current')
cld11acMcsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 6, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-MIB", "cld11acMcsSpatialStreamIndex"), (0, "CISCO-LWAPP-DOT11-MIB", "cld11acMcsDataRateIndex"))
if mibBuilder.loadTexts: cld11acMcsEntry.setStatus('current')
cld11acMcsSpatialStreamIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 6, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cld11acMcsSpatialStreamIndex.setStatus('current')
cld11acMcsDataRateIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 6, 1, 2), Unsigned32())
if mibBuilder.loadTexts: cld11acMcsDataRateIndex.setStatus('current')
cld11acMcsSupportEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 6, 1, 3), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cld11acMcsSupportEnable.setStatus('current')
cld11acConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 5))
cldVhtDot11acEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 5, 1), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldVhtDot11acEnable.setStatus('current')
cldLoadBalancing = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 8))
cldLoadBalancingEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldLoadBalancingEnable.setStatus('current')
cldLoadBalancingWindowSize = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 8, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 20)).clone(5)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldLoadBalancingWindowSize.setStatus('current')
cldLoadBalancingDenialCount = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 8, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldLoadBalancingDenialCount.setStatus('current')
cldLoadBalancingTrafficThreshold = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 8, 4), Unsigned32().clone(50)).setUnits('Percent').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldLoadBalancingTrafficThreshold.setStatus('current')
cldBandSelect = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 9))
cldBandSelectEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 9, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldBandSelectEnable.setStatus('current')
cldBandSelectCycleCount = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 9, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(3)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldBandSelectCycleCount.setStatus('current')
cldBandSelectCycleThreshold = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 9, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)).clone(200)).setUnits('milliseconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldBandSelectCycleThreshold.setStatus('current')
cldBandSelectAgeOutSuppression = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 9, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 200)).clone(20)).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldBandSelectAgeOutSuppression.setStatus('current')
cldBandSelectAgeOutDualBand = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 9, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 300)).clone(60)).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldBandSelectAgeOutDualBand.setStatus('current')
cldBandSelectClientRssi = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 9, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-90, -20)).clone(-80)).setUnits('dBm').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldBandSelectClientRssi.setStatus('current')
cldCountryTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1), )
if mibBuilder.loadTexts: cldCountryTable.setStatus('current')
cldCountryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-LWAPP-DOT11-MIB", "cldCountryCode"))
if mibBuilder.loadTexts: cldCountryEntry.setStatus('current')
cldCountryCode = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 255)))
if mibBuilder.loadTexts: cldCountryCode.setStatus('current')
cldCountryName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1, 1, 2), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldCountryName.setStatus('current')
cldCountryDot11aChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldCountryDot11aChannels.setStatus('current')
cldCountryDot11bChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1, 1, 4), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldCountryDot11bChannels.setStatus('current')
cldCountryDot11aDcaChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1, 1, 5), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldCountryDot11aDcaChannels.setStatus('current')
cldCountryDot11bDcaChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 2, 1, 1, 6), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cldCountryDot11bDcaChannels.setStatus('current')
cldCountryChangeNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 612, 1, 1, 7), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cldCountryChangeNotifEnable.setStatus('current')
ciscoLwappDot11CountryChangeNotif = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 612, 0, 1)).setObjects(("CISCO-LWAPP-DOT11-MIB", "cldMultipleCountryCode"))
if mibBuilder.loadTexts: ciscoLwappDot11CountryChangeNotif.setStatus('current')
ciscoLwappDot11MIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 1))
ciscoLwappDot11MIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 2))
ciscoLwappDot11MIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 1, 1)).setObjects(("CISCO-LWAPP-DOT11-MIB", "ciscoLwappDot11MIBMacOperGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappDot11MIBCompliance = ciscoLwappDot11MIBCompliance.setStatus('deprecated')
ciscoLwappDot11MIBComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 1, 2)).setObjects(("CISCO-LWAPP-DOT11-MIB", "ciscoLwappDot11MIBMacOperGroup"), ("CISCO-LWAPP-DOT11-MIB", "ciscoLwappDot11MIBConfigGroup"), ("CISCO-LWAPP-DOT11-MIB", "ciscoLwappDot11MIBNotifsGroup"), ("CISCO-LWAPP-DOT11-MIB", "ciscoLwappDot11MIBStatusGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappDot11MIBComplianceRev1 = ciscoLwappDot11MIBComplianceRev1.setStatus('current')
ciscoLwappDot11MIBMacOperGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 2, 1)).setObjects(("CISCO-LWAPP-DOT11-MIB", "cldHtDot11nChannelBandwidth"), ("CISCO-LWAPP-DOT11-MIB", "cldHtDot11nRifsEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldHtDot11nAmsduEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldHtDot11nAmpduEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldHtDot11nGuardIntervalEnable"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappDot11MIBMacOperGroup = ciscoLwappDot11MIBMacOperGroup.setStatus('current')
ciscoLwappDot11MIBConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 2, 2)).setObjects(("CISCO-LWAPP-DOT11-MIB", "cldHtDot11nEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldMultipleCountryCode"), ("CISCO-LWAPP-DOT11-MIB", "cldRegulatoryDomain"), ("CISCO-LWAPP-DOT11-MIB", "cld11nMcsDataRate"), ("CISCO-LWAPP-DOT11-MIB", "cld11nMcsSupportEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldCountryChangeNotifEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldLoadBalancingEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldLoadBalancingWindowSize"), ("CISCO-LWAPP-DOT11-MIB", "cldLoadBalancingDenialCount"), ("CISCO-LWAPP-DOT11-MIB", "cldBandSelectEnable"), ("CISCO-LWAPP-DOT11-MIB", "cldBandSelectCycleCount"), ("CISCO-LWAPP-DOT11-MIB", "cldBandSelectCycleThreshold"), ("CISCO-LWAPP-DOT11-MIB", "cldBandSelectAgeOutSuppression"), ("CISCO-LWAPP-DOT11-MIB", "cldBandSelectAgeOutDualBand"), ("CISCO-LWAPP-DOT11-MIB", "cldBandSelectClientRssi"), ("CISCO-LWAPP-DOT11-MIB", "cld11nMcsChannelWidth"), ("CISCO-LWAPP-DOT11-MIB", "cld11nMcsGuardInterval"), ("CISCO-LWAPP-DOT11-MIB", "cld11nMcsModulation"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappDot11MIBConfigGroup = ciscoLwappDot11MIBConfigGroup.setStatus('current')
ciscoLwappDot11MIBNotifsGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 2, 3)).setObjects(("CISCO-LWAPP-DOT11-MIB", "ciscoLwappDot11CountryChangeNotif"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappDot11MIBNotifsGroup = ciscoLwappDot11MIBNotifsGroup.setStatus('current')
ciscoLwappDot11MIBStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 612, 2, 2, 4)).setObjects(("CISCO-LWAPP-DOT11-MIB", "cldCountryName"), ("CISCO-LWAPP-DOT11-MIB", "cldCountryDot11aChannels"), ("CISCO-LWAPP-DOT11-MIB", "cldCountryDot11bChannels"), ("CISCO-LWAPP-DOT11-MIB", "cldCountryDot11aDcaChannels"), ("CISCO-LWAPP-DOT11-MIB", "cldCountryDot11bDcaChannels"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappDot11MIBStatusGroup = ciscoLwappDot11MIBStatusGroup.setStatus('current')
mibBuilder.exportSymbols("CISCO-LWAPP-DOT11-MIB", cld11nMcsGuardInterval=cld11nMcsGuardInterval, cld11nMcsEntry=cld11nMcsEntry, cldBandSelectCycleThreshold=cldBandSelectCycleThreshold, cldBandSelectEnable=cldBandSelectEnable, cldConfig=cldConfig, cldMultipleCountryCode=cldMultipleCountryCode, cld11acMcsSpatialStreamIndex=cld11acMcsSpatialStreamIndex, ciscoLwappDot11MIBCompliances=ciscoLwappDot11MIBCompliances, ciscoLwappDot11MIBMacOperGroup=ciscoLwappDot11MIBMacOperGroup, ciscoLwappDot11MIBConfigGroup=ciscoLwappDot11MIBConfigGroup, cldBandSelectAgeOutSuppression=cldBandSelectAgeOutSuppression, ciscoLwappDot11MIBNotifs=ciscoLwappDot11MIBNotifs, cldHtDot11nEnable=cldHtDot11nEnable, cldLoadBalancingEnable=cldLoadBalancingEnable, cldHtDot11nRifsEnable=cldHtDot11nRifsEnable, cld11acMcsSupportEnable=cld11acMcsSupportEnable, ciscoLwappDot11MIBConform=ciscoLwappDot11MIBConform, ciscoLwappDot11MIBComplianceRev1=ciscoLwappDot11MIBComplianceRev1, ciscoLwappDot11CountryChangeNotif=ciscoLwappDot11CountryChangeNotif, cldHtMacOperationsTable=cldHtMacOperationsTable, ciscoLwappDot11MIBObjects=ciscoLwappDot11MIBObjects, cld11acConfig=cld11acConfig, ciscoLwappDot11MIBCompliance=ciscoLwappDot11MIBCompliance, cld11acMcsTable=cld11acMcsTable, cld11acMcsEntry=cld11acMcsEntry, cldCountryCode=cldCountryCode, cld11acMcsDataRateIndex=cld11acMcsDataRateIndex, ciscoLwappDot11MIBGroups=ciscoLwappDot11MIBGroups, cldRegulatoryDomain=cldRegulatoryDomain, cldStatus=cldStatus, cldLoadBalancingWindowSize=cldLoadBalancingWindowSize, cld11nMcsModulation=cld11nMcsModulation, cldBandSelect=cldBandSelect, cldLoadBalancing=cldLoadBalancing, cldVhtDot11acEnable=cldVhtDot11acEnable, cldBandSelectCycleCount=cldBandSelectCycleCount, cldBandSelectAgeOutDualBand=cldBandSelectAgeOutDualBand, cldCountryDot11aChannels=cldCountryDot11aChannels, cldCountryDot11aDcaChannels=cldCountryDot11aDcaChannels, cldCountryChangeNotifEnable=cldCountryChangeNotifEnable, cldBandSelectClientRssi=cldBandSelectClientRssi, cldHtDot11nBand=cldHtDot11nBand, cld11nMcsDataRateIndex=cld11nMcsDataRateIndex, cldCountryTable=cldCountryTable, cldHtMacOperationsEntry=cldHtMacOperationsEntry, cldHtDot11nAmsduEnable=cldHtDot11nAmsduEnable, PYSNMP_MODULE_ID=ciscoLwappDot11MIB, cldHtDot11nGuardIntervalEnable=cldHtDot11nGuardIntervalEnable, cldCountryName=cldCountryName, cldCountryEntry=cldCountryEntry, cldLoadBalancingTrafficThreshold=cldLoadBalancingTrafficThreshold, cld11nMcsTable=cld11nMcsTable, cldCountryDot11bChannels=cldCountryDot11bChannels, cld11nMcsDataRate=cld11nMcsDataRate, cldHtDot11nAmpduEnable=cldHtDot11nAmpduEnable, cld11nMcsBand=cld11nMcsBand, cldCountryDot11bDcaChannels=cldCountryDot11bDcaChannels, cld11nMcsSupportEnable=cld11nMcsSupportEnable, ciscoLwappDot11MIBNotifsGroup=ciscoLwappDot11MIBNotifsGroup, ciscoLwappDot11MIBStatusGroup=ciscoLwappDot11MIBStatusGroup, ciscoLwappDot11MIB=ciscoLwappDot11MIB, cld11nMcsChannelWidth=cld11nMcsChannelWidth, cldLoadBalancingDenialCount=cldLoadBalancingDenialCount, cldHtDot11nChannelBandwidth=cldHtDot11nChannelBandwidth)
|
#!/usr/bin/env python3
__version__ = (0, 5, 2)
__version_info__ = ".".join(map(str, __version__))
APP_NAME = 'pseudo-interpreter'
APP_AUTHOR = 'bell345'
APP_VERSION = __version_info__
|
class DiagonalDisproportion:
def getDisproportion(self, matrix):
r = 0
for i, s in enumerate(matrix):
r += int(s[i]) - int(s[-i-1])
return r
|
for num in range(101):
div = 0
for x in range(1, num+1):
resto = num % x
if resto == 0:
div += 1
if div == 2:
print(num) |
#weight = 50
State.PS_veliki=_State(False,name='PS_veliki',shared=True)
State.PS_mali=_State(False,name='PS_mali',shared=True)
def run():
r.setpos(-1500+155+125+10,-1000+600+220,90) #bocno absrot90
r.conf_set('send_status_interval', 10)
State.color = 'ljubicasta'
# init servos
llift(0)
rlift(0)
rfliper(0)
lfliper(0)
return
|
def join_dictionaries(
dictionaries: list) -> dict:
joined_dictionary = \
dict()
for dictionary in dictionaries:
joined_dictionary.update(
dictionary)
return \
joined_dictionary |
"""Version file."""
# __ __
# ______ _/ /_ / /
# /_ __/__ /_ __/_________ / /______,- ___ __ _____ __
# / / / _ \/ / / ___/ /_/_/ // / __ // _ '_ \/ ___/ _ \
# __/ /_/ / / / /_/ ___/ _ \/ _' / /_/ // // // / ___/ / / /
# /_____/_/ /_/\__/____/_/ /_/_/ \_\_____/_//_//_/____/_/ /_/
VERSION = (1, 18, 9)
__version__ = '.'.join(map(str, VERSION))
|
APIAE_PARAMS = dict(
n_x=90, # dimension of x; observation
n_z=3, # dimension of z; latent space
n_u=1, # dimension of u; control
K=10, # the number of time steps
R=1, # the number of adaptations
L=32, # the number of trajectory sampled
dt=.1, # time interval
ur=.1, # update rate
lr=1e-3, # learning
)
TRAINING_EPOCHS = 3000
OFFSET_STD = 1e-5
|
class Computer:
def __init__(self):
self.__maxprice = 900
def sell(self):
print("Selling Price: {}".format(self.__maxprice))
def setMaxPrice(self, price):
self.__maxprice = price
c = Computer()
c.sell()
# change the price
c.__maxprice = 1000
c.sell()
# using setter function
c.setMaxPrice(1000)
c.sell() |
if __name__ == "__main__":
ant_map = """
------a------------------------------------
------------------o----------------------
-----------------o-----------------------
------------------------------------------
------------------------------------------
------------------------------------------
------------------------------------------#
"""
print(ant_map)
|
# 15 - Faça um Programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês.
# Calcule e mostre o total do seu salário no referido mês, sabendo-se que são descontados 11% para o Imposto de Renda,
# 8% para o INSS e 5% para o sindicato, faça um programa que nos dê:
# A. salário bruto.
# B. quanto pagou ao INSS.
# C. quanto pagou ao sindicato.
# D. o salário líquido.
# E. calcule os descontos e o salário líquido, conforme a tabela abaixo:
# + Salário Bruto : R$
# - IR (11%) : R$
# - INSS (8%) : R$
# - Sindicato ( 5%) : R$
# = Salário Liquido : R$
salarioHora = float(input('Quanto você ganha por hora? '))
horasTrabalhadasMes = float(input('Quantas horas foi trabalhada no mês corrente? '))
salarioBruto = salarioHora * horasTrabalhadasMes
valorIR = salarioBruto * 0.11
valorINSS = salarioBruto * 0.08
valorSindicato = salarioBruto * 0.05
salarioLiquido = salarioBruto - valorIR - valorINSS - valorSindicato
print(f'Salário Bruto R$:{salarioBruto:.2f} ')
print(f'Desconto IR R$:{valorIR:.2f} ')
print(f'Desconto INSS R$:{valorINSS:.2f}')
print(f'Desconto Sindicato R$:{valorSindicato:.2f} ')
print(f'Total de Descontos R$:{valorIR + valorINSS + valorSindicato:.2f} ')
print(f'Salário Liquido R$:{salarioLiquido:.2f} ') |
COMPANY_PRESENTATION = "company_presentation"
LUNCH_PRESENTATION = "lunch_presentation"
ALTERNATIVE_PRESENTATION = "alternative_presentation"
COURSE = "course"
KID_EVENT = "kid_event"
PARTY = "party"
SOCIAL = "social"
OTHER = "other"
EVENT = "event"
EVENT_TYPES = (
(COMPANY_PRESENTATION, COMPANY_PRESENTATION),
(LUNCH_PRESENTATION, LUNCH_PRESENTATION),
(ALTERNATIVE_PRESENTATION, ALTERNATIVE_PRESENTATION),
(COURSE, COURSE),
(KID_EVENT, KID_EVENT),
(PARTY, PARTY),
(SOCIAL, SOCIAL),
(OTHER, OTHER),
(EVENT, EVENT),
)
"""
Events marked as NORMAL are events that can have infinite pools.
This even status type should be used for most events.
"""
NORMAL = "NORMAL"
"""
Events marked as INFINITE should have exactly 1 pool, with capacity set to 0.
A user _should_ be able to sign up to the event.
There are no permissions (except Abakom).
This even status type should be used for events such as Abakom Works, etc.
"""
INFINITE = "INFINITE"
"""
Events marked as OPEN should have 0 pools, like TBA. Location is required.
A user should _not_ be able to sign up to the event.
There are no permissions (except Abakom).
This even status type should be used for events hosted by LaBamba, etc.
"""
OPEN = "OPEN"
"""
Events marked as TBA should have 0 pools, location will be set to TBA.
A user should _not_ be able to sign up to the event.
There are no permissions (except Abakom).
TBA should be used for events that need additional information, as a placeholder.
This is the default even status type.
"""
TBA = "TBA"
EVENT_STATUS_TYPES = ((NORMAL, NORMAL), (INFINITE, INFINITE), (OPEN, OPEN), (TBA, TBA))
UNKNOWN = "UNKNOWN"
PRESENT = "PRESENT"
NOT_PRESENT = "NOT_PRESENT"
PRESENCE_CHOICES = ((UNKNOWN, UNKNOWN), (PRESENT, PRESENT), (NOT_PRESENT, NOT_PRESENT))
PHOTO_CONSENT = "PHOTO_CONSENT"
PHOTO_NOT_CONSENT = "PHOTO_NOT_CONSENT"
PHOTO_CONSENT_CHOICES = (
(UNKNOWN, UNKNOWN),
(PHOTO_CONSENT, PHOTO_CONSENT),
(PHOTO_NOT_CONSENT, PHOTO_NOT_CONSENT),
)
PENDING_REGISTER = "PENDING_REGISTER"
SUCCESS_REGISTER = "SUCCESS_REGISTER"
FAILURE_REGISTER = "FAILURE_REGISTER"
PENDING_UNREGISTER = "PENDING_UNREGISTER"
SUCCESS_UNREGISTER = "SUCCESS_UNREGISTER"
FAILURE_UNREGISTER = "FAILURE_UNREGISTER"
STATUSES = (
(PENDING_REGISTER, PENDING_REGISTER),
(SUCCESS_REGISTER, SUCCESS_REGISTER),
(FAILURE_REGISTER, FAILURE_REGISTER),
(PENDING_UNREGISTER, PENDING_UNREGISTER),
(SUCCESS_UNREGISTER, SUCCESS_UNREGISTER),
(FAILURE_UNREGISTER, FAILURE_UNREGISTER),
)
PAYMENT_PENDING = "pending"
PAYMENT_SUCCESS = "succeeded"
PAYMENT_FAILURE = "failed"
PAYMENT_MANUAL = "manual"
PAYMENT_CANCELED = "canceled"
PAYMENT_STATUS_CHOICES = (
(PAYMENT_MANUAL, PAYMENT_MANUAL),
(PAYMENT_SUCCESS, PAYMENT_SUCCESS),
(PAYMENT_FAILURE, PAYMENT_FAILURE),
(PAYMENT_PENDING, PAYMENT_PENDING),
)
STRIPE_EVENT_INTENT_SUCCESS = "payment_intent.succeeded"
STRIPE_EVENT_INTENT_PAYMENT_FAILED = "payment_intent.payment_failed"
STRIPE_EVENT_INTENT_PAYMENT_CANCELED = "payment_intent.canceled"
STRIPE_EVENT_CHARGE_REFUNDED = "charge.refunded"
# See https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status
STRIPE_INTENT_REQUIRES_PAYMENT = "requires_payment_method"
STRIPE_INTENT_REQUIRES_CONFIRMATION = "requires_confirmaion"
STRIPE_INTENT_SUCCEEDED = "succeeded"
STRIPE_INTENT_PROCESSING = "processing"
STRIPE_INTENT_CANCELED = "canceled"
STRIPE_INTENT_REQUIRES_ACTION = "requires_action"
STRIPE_INTENT_REQUIRES_CAPTURE = "requires_capture"
SOCKET_INITIATE_PAYMENT_SUCCESS = "Event.SOCKET_INITIATE_PAYMENT.SUCCESS"
SOCKET_INITIATE_PAYMENT_FAILURE = "Event.SOCKET_INITIATE_PAYMENT.FAILURE"
SOCKET_PAYMENT_SUCCESS = "Event.SOCKET_PAYMENT.SUCCESS"
SOCKET_PAYMENT_FAILURE = "Event.SOCKET_PAYMENT.FAILURE"
SOCKET_REGISTRATION_SUCCESS = "Event.SOCKET_REGISTRATION.SUCCESS"
SOCKET_REGISTRATION_FAILURE = "Event.SOCKET_REGISTRATION.FAILURE"
SOCKET_UNREGISTRATION_SUCCESS = "Event.SOCKET_UNREGISTRATION.SUCCESS"
SOCKET_UNREGISTRATION_FAILURE = "Event.SOCKET_UNREGISTRATION.FAILURE"
DAYS_BETWEEN_NOTIFY = 1
# Event registration and unregistration closes a certain amount of hours before the start time
REGISTRATION_CLOSE_TIME = 2
UNREGISTRATION_CLOSE_TIME = 2
|
class FilteredElementIdIterator(object,IEnumerator[ElementId],IDisposable,IEnumerator):
""" An iterator to a set of element ids filtered by the settings of a FilteredElementCollector. """
def Dispose(self):
""" Dispose(self: FilteredElementIdIterator) """
pass
def GetCurrent(self):
"""
GetCurrent(self: FilteredElementIdIterator) -> ElementId
The current element id found by the iterator.
Returns: The element id.
"""
pass
def IsDone(self):
"""
IsDone(self: FilteredElementIdIterator) -> bool
Identifies if the iteration has completed.
Returns: True if the iteration has no more matching elements. False if there are more
element ids to be iterated.
"""
pass
def MoveNext(self):
"""
MoveNext(self: FilteredElementIdIterator) -> bool
Increments the iterator to the next element id passing the filter.
Returns: True if there is another available element id passing the filter in this
iterator.
False if the iterator has completed all available element ids.
"""
pass
def next(self,*args):
""" next(self: object) -> object """
pass
def ReleaseUnmanagedResources(self,*args):
""" ReleaseUnmanagedResources(self: FilteredElementIdIterator,disposing: bool) """
pass
def Reset(self):
"""
Reset(self: FilteredElementIdIterator)
Resets the iterator to the beginning.
"""
pass
def __contains__(self,*args):
""" __contains__[ElementId](enumerator: IEnumerator[ElementId],value: ElementId) -> bool """
pass
def __enter__(self,*args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self,*args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self,*args):
""" __iter__(self: IEnumerator) -> object """
pass
def __repr__(self,*args):
""" __repr__(self: object) -> str """
pass
Current=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the item at the current position of the iterator.
Get: Current(self: FilteredElementIdIterator) -> ElementId
"""
IsValidObject=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Specifies whether the .NET object represents a valid Revit entity.
Get: IsValidObject(self: FilteredElementIdIterator) -> bool
"""
|
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 6 10:26:35 2020
@author: ruy
Automation of German Lloyd 2012 High Speed Craft strucutural rules calculation
"""
|
n,m = input().split(' ')
my_array = list(input().split(' '))
A = set(input().split(' '))
B = set(input().split(' '))
happiness = 0
for i in my_array:
happiness += (i in A) - (i in B)
print(happiness) |
buf = ""
buf += "\xdb\xdd\xd9\x74\x24\xf4\x58\xbf\x63\x6e\x69\x90\x33"
buf += "\xc9\xb1\x52\x83\xe8\xfc\x31\x78\x13\x03\x1b\x7d\x8b"
buf += "\x65\x27\x69\xc9\x86\xd7\x6a\xae\x0f\x32\x5b\xee\x74"
buf += "\x37\xcc\xde\xff\x15\xe1\x95\x52\x8d\x72\xdb\x7a\xa2"
buf += "\x33\x56\x5d\x8d\xc4\xcb\x9d\x8c\x46\x16\xf2\x6e\x76"
buf += "\xd9\x07\x6f\xbf\x04\xe5\x3d\x68\x42\x58\xd1\x1d\x1e"
buf += "\x61\x5a\x6d\x8e\xe1\xbf\x26\xb1\xc0\x6e\x3c\xe8\xc2"
buf += "\x91\x91\x80\x4a\x89\xf6\xad\x05\x22\xcc\x5a\x94\xe2"
buf += "\x1c\xa2\x3b\xcb\x90\x51\x45\x0c\x16\x8a\x30\x64\x64"
buf += "\x37\x43\xb3\x16\xe3\xc6\x27\xb0\x60\x70\x83\x40\xa4"
buf += "\xe7\x40\x4e\x01\x63\x0e\x53\x94\xa0\x25\x6f\x1d\x47"
buf += "\xe9\xf9\x65\x6c\x2d\xa1\x3e\x0d\x74\x0f\x90\x32\x66"
buf += "\xf0\x4d\x97\xed\x1d\x99\xaa\xac\x49\x6e\x87\x4e\x8a"
buf += "\xf8\x90\x3d\xb8\xa7\x0a\xa9\xf0\x20\x95\x2e\xf6\x1a"
buf += "\x61\xa0\x09\xa5\x92\xe9\xcd\xf1\xc2\x81\xe4\x79\x89"
buf += "\x51\x08\xac\x1e\x01\xa6\x1f\xdf\xf1\x06\xf0\xb7\x1b"
buf += "\x89\x2f\xa7\x24\x43\x58\x42\xdf\x04\xa7\x3b\xde\xac"
buf += "\x4f\x3e\xe0\x57\xa9\xb7\x06\x0d\xd9\x91\x91\xba\x40"
buf += "\xb8\x69\x5a\x8c\x16\x14\x5c\x06\x95\xe9\x13\xef\xd0"
buf += "\xf9\xc4\x1f\xaf\xa3\x43\x1f\x05\xcb\x08\xb2\xc2\x0b"
buf += "\x46\xaf\x5c\x5c\x0f\x01\x95\x08\xbd\x38\x0f\x2e\x3c"
buf += "\xdc\x68\xea\x9b\x1d\x76\xf3\x6e\x19\x5c\xe3\xb6\xa2"
buf += "\xd8\x57\x67\xf5\xb6\x01\xc1\xaf\x78\xfb\x9b\x1c\xd3"
buf += "\x6b\x5d\x6f\xe4\xed\x62\xba\x92\x11\xd2\x13\xe3\x2e"
buf += "\xdb\xf3\xe3\x57\x01\x64\x0b\x82\x81\x84\xee\x06\xfc"
buf += "\x2c\xb7\xc3\xbd\x30\x48\x3e\x81\x4c\xcb\xca\x7a\xab"
buf += "\xd3\xbf\x7f\xf7\x53\x2c\xf2\x68\x36\x52\xa1\x89\x13"
|
print(" "*7 + "A")
print(" "*6 + "B B")
print(" "*5 + "C C")
print(" "*4 + "D" + " "*5 + "D")
print(" "*3 + "E" + " "*7 + "E")
print(" "*4 + "D" + " "*5 + "D")
print(" "*5 + "C C")
print(" "*6 + "B B")
print(" "*7 + "A")
|
subscription_service = paymill_context.get_subscription_service()
subscription_with_offer_and_different_values = subscription_service.create_with_offer_id(
payment_id='pay_5e078197cde8a39e4908f8aa',
offer_id='offer_b33253c73ae0dae84ff4',
name='Example Subscription',
period_of_validity='2 YEAR',
start_at=1400575533
)
|
"""
Primim numere și ponderile lor asociate.
Practic, acestea definesc o histogramă.
Fiecare pondere este în intervalul [0, 1]
Suma ponderilor este 1.
Pe exemplul:
v = 5 1 3 2 9 6 11
w = 0.1 0.12 0.05 0.1 0.2 0.13 0.3
Avem 6 ca mediană ponderată.
Putem rezolva în O(n log n):
sortăm vectorul, și apoi facem sumele parțiale pentru ponderi
până ce în stânga avem < 0.5, și în dreapta <= 0.5
Putem rezolva în O(n) cu ideea de la algoritmul de mediană bazat
pe QuickSort:
- luăm primul element ca pivot și partiționăm vectorul
- verificăm dacă este mediană ponderată
- dacă nu este mediană ponderată mergem recursiv în
jumătatea în care avem ponderi mai mari
- în apelul recursiv se păstrează suma extra din stânga/dreapta
Complexitate: O(n), deoarece când fac sumele de ponderi trebuie
să parcurg tot vectorul, chiar dacă la fiecare apel înjumătățesc problema.
"""
def partition(v):
"""Partitions a given array using the first element as the pivot."""
pivot = v[0]
smaller = [elem for elem in v[1:] if elem < pivot]
larger = [elem for elem in v[1:] if elem >= pivot]
return len(smaller), smaller + [pivot] + larger
def extract_weights(pairs):
"""Extracts the weight component of an array of pairs"""
return (weight for _, weight in pairs)
def find_median(pairs, left_acc, right_acc):
pivot_idx, part = partition(pairs)
pivot_num, pivot_w = pairs[pivot_idx]
left_sum = left_acc + sum(extract_weights(part[:pivot_idx]))
right_sum = right_acc + sum(extract_weights(part[pivot_idx + 1:]))
if left_sum < 0.5:
if right_sum <= 0.5:
return pivot_num
else:
return find_median(part[pivot_idx + 1:], left_sum + pivot_w, 0)
else:
return find_median(part[:pivot_idx], 0, right_sum + pivot_w)
fin = open('medpond.txt')
n = int(next(fin))
nums = [int(x) for x in next(fin).split()]
weights = [float(x) for x in next(fin).split()]
values = list(zip(nums, weights))
print(find_median(values, 0, 0))
|
class Monkey(object):
'''Store data of placed monkey'''
def __init__(self, position=None, name=None, mtype=None) -> None:
'''
:arg position: position, list
:arg name: name
:arg mtype: type of monkey (get from action.action)
'''
self.position = position
self.upgrades = [0,0,0]
self.name = name
self.mtype = mtype
def upgrade(self, path):
'''
Increase the stored paths of a monkey when upgrading.
:arg path: Path of upgrade taking place.
<1, 2, 3> (1 being the top path)
'''
if path == 1:
self.upgrades[0] += 1
if self.upgrades[0] > 5 and (self.mtype != 'Dart Monkey' or self.mtype != 'Boomerang Monkey'):
print('invalid upgrade (higher than 5)')
if path == 2:
self.upgrades[1] += 1
if self.upgrades[1] > 5 and (self.mtype != 'Dart Monkey' or self.mtype != 'Boomerang Monkey'):
print('invalid upgrade (higher than 5)')
if path == 3:
self.upgrades[2] += 1
if self.upgrades[2] > 5 and (self.mtype != 'Dart Monkey' or self.mtype != 'Boomerang Monkey'):
print('invalid upgrade (higher than 5)')
|
print('Diamante Negro Viagens! Consulte preços abaixo: ')
distancia = float(input('Quantos quilômetros de distância tem seu destino? '))
if distancia <= 200:
print('Você pagará R${:.2f} reais por {} Km!'.format(distancia * 0.50, distancia))
else:
print('Você pagará R${:.2f} reais por {} Km!'.format(distancia * 0.45, distancia)) |
labelClassification = """
border-style: none;
font-weight: bold;
font-size: 40px;
color: white;
"""
mainWindowFrame = """
border: 2px solid rgb(40, 40, 40);
border-radius: 4px;
background-color: rgb(70,70,73);
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(70,70,70),
stop: 0.8 rgb(54,54,54));
"""
labelComboBox = """
border-style: none;
background-color: rgba(0, 0, 0, 0);
font-weight: bold;
font-size: 25px;
color: rgb(200, 200, 200);
"""
comboBox = """
QComboBox{
border: 2px solid rgb(40, 40, 40);
background: rgba(0, 0, 0, 0);
font-weight: bold;
font-size: 30px;
color: grey;
}
QComboBox:hover{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(90,90,90),
stop: 0.8 rgb(80,80,80));
color: rgb(200, 200, 200);;
}
"""
frame = """
border-style: outset;
border-width: 2px;
border-color: rgb(30, 30, 30);
border-radius: 4px;
background-color: rgb(70,70,73);
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(40,40,40),
stop: 0.8 rgb(43,43,43));
"""
objectNameLabel = """
border-style: none;
font-weight: bold;
font-size:30px;
color: rgb(200, 200, 200);
background-color: rgba(0,0,0,0);
"""
objectNameLabel_highlighted = """
border-style: inset;
border-width: 3px;
font-weight: bold;
font-size:30px;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(100,100,100),
stop: 0.8 rgb(110,110,110));
"""
calibrateButton = """
QPushButton{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(80,80,80),
stop: 0.8 rgb(70,70,70));
font-weight: bold;
font-size:20px;
color: rgb(200, 200, 200);
border-style: outset;
border-color: rgb(40, 40, 40);
border-width: 2px;
border-radius: 5px;
}
QPushButton:hover{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(90,90,90),
stop: 0.8 rgb(80,80,80));
}
"""
calibrateButton_highlighted = """
QPushButton{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(110,110,110),
stop: 0.8 rgb(100,100,100));
font-weight: bold;
font-size:20px;
color: rgb(200, 200, 200);
border-style: outset;
border-color: rgb(40, 40, 40);
border-width: 2px;
border-radius: 5px;
}
QPushButton:hover{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(130,130,130),
stop: 0.8 rgb(120,120,120));
}
"""
calibrateButton_calibrated = """
QPushButton{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(40,80,40),
stop: 0.8 rgb(35,70,35));
font-weight: bold;
font-size:20px;
color: rgb(200, 200, 200);
border-style: outset;
border-color: rgb(40, 40, 40);
border-width: 2px;
border-radius: 5px;
}
QPushButton:hover{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(45,90,45),
stop: 0.8 rgb(40,80,40));
}
"""
calibrateButton_calibrated_highlighted = """
QPushButton{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(70,110,70),
stop: 0.8 rgb(65,100,65));
font-weight: bold;
font-size:20px;
color: rgb(200, 200, 200);
border-style: outset;
border-color: rgb(40, 40, 40);
border-width: 2px;
border-radius: 5px;
}
QPushButton:hover{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(45,90,45),
stop: 0.8 rgb(40,80,40));
}
"""
addObjectButton = """
QPushButton{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(80,80,80),
stop: 0.8 rgb(70,70,70));
font-weight: bold;
font-size:20px;
color: rgb(200, 200, 200);
border-style: outset;
border-color: rgb(40, 40, 40);
border-width: 2px;
border-radius: 5px;
}
QPushButton:hover{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(90,90,90),
stop: 0.8 rgb(80,80,80));
}
"""
labelMyObjects = """
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(100,100,100),
stop: 0.8 rgb(90,90,90));
font-weight: bold;
font-size:30px;
color: rgb(230, 230, 230);
border-style: solid;
border-color: rgba(0, 0, 0, 0);
border-width: 2px;
border-radius: 0px;
"""
statusBar = """
border-style: none;
font-weight: bold;
font-size: 20px;
color: rgb(250, 250, 250);
min-height: 50;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(100,100,100),
stop: 0.8 rgb(90,90,90));
"""
statusBarError = """
border-style: none;
font-weight: bold;
font-size: 20px;
color: rgb(40, 20, 20);
min-height: 50;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(200,100,100),
stop: 0.8 rgb(180,90,90));
"""
toolbar = """
QToolBar{
border-style: none;
font-weight: bold;
font-size: 20px;
color: rgb(40, 20, 20);
min-height: 50;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(100,100,100),
stop: 0.8 rgb(90,90,90));
}
QToolButton:hover{
border-style: none;
font-weight: bold;
font-size: 20px;
color: rgb(40, 20, 20);
min-height: 50;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(130,130,130),
stop: 0.8 rgb(120,120,120));
}
"""
menuBar = """
QMenuBar{
border-style: none;
font-weight: bold;
font-size: 20px;
color: rgb(200, 200, 200);
min-height: 50;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(80,80,80),
stop: 0.8 rgb(70,70,70));
}
QMenuBar:item:selected{
border-style: none;
font-weight: bold;
font-size: 20px;
color: rgb(230, 230, 230);
min-height: 50;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(110,110,110),
stop: 0.8 rgb(100,100,100));
}
"""
|
'''
Created on 2015年12月15日
@author: Darren
'''
def inOrder(root):
res=[]
stack=[]
while root or stack:
if root:
stack.append(root)
root=root.left
else:
root=stack.pop()
res.append(root.val)
root=root.right
return res
def preOrder(root):
res=[]
stack=[]
while root or stack:
if root:
res.append(root.val)
stack.append(root)
root=root.left
else:
root=stack.pop()
root=root.right
return res
def postOrder(root):
res=[]
stack=[]
preNode=None
while root or stack:
if root:
stack.append(root)
root=root.Left
else:
peekNode=stack[-1]
if peekNode.right and preNode!=peekNode.right:
root=peekNode.right
else:
stack.pop()
res.append(peekNode.val)
preNode=peekNode
return res
def count_digits(num):
res=0
flag=False
if num<0:
num=-num
flag=True
while num>=10:
res+=num%10
num//=10
if flag:
res-=num
else:
res+=num
return res
print(count_digits(-101))
def preOrder2(root):
if not root:
return
print(root.val)
preOrder(root.left)
preOrder(root.right)
def inOrder2(root):
if not root:
return
inOrder(root.left)
print(root.val)
inOrder(root.right)
def postOrder2(root):
if not root:
return
postOrder(root.left)
postOrder(root.right)
print(root.val)
|
# Desenvolva um programa que leia a média dos 4 bimestres de um aluno e diga se ele já passou de ano ou não.
média_1s = 0
média_2s = 0
for n in range (1,5):
nota_ = input(f'Digite a nota de sua média no {n}° bimestre (caso ainda não saiba a nota, digite "0"): ').strip()
nota = float(nota_)
if n == 1 or n == 2:
nota_p = nota * 2
média_1s += nota_p
elif n == 3 or n == 4:
nota_p = nota * 3
média_2s += nota_p
else:
print('ERRO! DE ALGUMA FORMA, O NÚMERO DO LAÇO É DIFERENTE DE 1-4!')
media_t = média_1s + média_2s
if media_t >= 60:
print(f'Parabéns! Você já passou de ano nesta matéria! '
f'\nIsso porque no 1° semestre você obteve um total de {média_1s}, e no 2° Semestre você obteve um total de '
f'{média_2s}!'
f'\nAo realizar a soma, a nota total foi {media_t}(>=60!)')
else:
print(f'Infelizmente, você ainda não passou de ano nesta matéria... '
f'\nIsto porque no 1° semestre você obteve um total de {média_1s}, e no 2° Semestre você obteve um total '
f'de {média_2s}.'
f'\nAo realizar a soma, a nota total foi {media_t} ( < 60).')
print(' ' * 40)
_resto = 60 - media_t
x = _resto / 3
print(f'Mas nada de tristeza! Para passar de ano, basta tirar {x} pontos como nota!')
|
matched = [[0, 450], [1, 466], [2, 566], [3, 974], [4, 1000], [5, 1222], [6, 1298], [7, 1322], [8, 1340], [9, 1704],
[10, 1752], [11, 2022], [12, 2114], [13, 2332], [14, 2360], [15, 2380], [16, 2388], [17, 2596],
[18, 2662], [19, 2706], [20, 2842], [21, 2914], [22, 3132], [23, 3148], [24, 3158], [25, 3164],
[26, 3244], [27, 3360], [28, 3386], [29, 3626], [30, 3726], [31, 3832], [32, 3912], [33, 3944],
[34, 4063], [35, 4084], [36, 4146], [37, 4162], [38, 4240], [39, 4356], [40, 4398], [41, 4408],
[42, 4470], [43, 4646], [44, 4692], [45, 4852], [46, 4930], [47, 5122], [48, 5126], [49, 5216],
[50, 5222], [51, 5310], [52, 5400], [53, 5408], [54, 5422], [55, 5482], [56, 5490], [57, 5504],
[58, 5546], [59, 5720], [60, 5744], [61, 5766], [62, 5800], [63, 5826], [64, 5950], [65, 5964],
[66, 5970], [67, 5986], [68, 6010], [69, 6038], [70, 6124], [71, 6166], [72, 6167], [73, 6169],
[74, 6215], [75, 6261], [76, 6275], [77, 6279], [78, 6283], [79, 6289], [80, 6293], [81, 6294],
[82, 6295], [83, 6296], [84, 6304], [85, 6418], [86, 6419], [87, 6454], [88, 6458], [89, 6472],
[90, 6484], [91, 6504], [92, 6506], [93, 6508], [94, 6540], [95, 6541], [96, 6561], [97, 6615],
[98, 6662], [99, 6663], [100, 6676], [101, 6750], [102, 6756], [103, 6758], [104, 6772], [105, 6784],
[106, 6785], [107, 6789], [108, 6887], [109, 6906], [110, 6907], [111, 6921], [112, 6947], [113, 6957],
[114, 6995], [115, 6997], [116, 6999], [117, 7001], [118, 7027], [119, 7028], [120, 7036], [121, 7056],
[122, 7102], [123, 7118], [124, 7147], [125, 7148], [126, 7165], [127, 7229], [128, 7233], [129, 7237],
[130, 7239], [131, 7243], [132, 7267], [133, 7268], [134, 7272], [135, 7358], [136, 7360], [137, 7387],
[138, 7388], [139, 7401], [140, 7427], [141, 7451], [142, 7469], [143, 7475], [144, 7477], [145, 7479],
[146, 7481], [147, 7501], [148, 7505], [149, 7507], [150, 7508], [151, 7512], [152, 7516], [153, 7598],
[154, 7600], [155, 7627], [156, 7628], [157, 7639], [158, 7655], [159, 7665], [160, 7683], [161, 7701],
[162, 7707], [163, 7711], [164, 7717], [165, 7719], [166, 7721], [167, 7725], [168, 7731], [169, 7747],
[170, 7748], [171, 7867], [172, 7868], [173, 7883], [174, 7933], [175, 7947], [176, 7949], [177, 7951],
[178, 7953], [179, 7955], [180, 7957], [181, 7961], [182, 7975], [183, 7987], [184, 7988], [185, 7992],
[186, 7994], [187, 8107], [188, 8108], [189, 8153], [190, 8163], [191, 8181], [192, 8187], [193, 8189],
[194, 8191], [195, 8193], [196, 8195], [197, 8221], [198, 8227], [199, 8228], [200, 8236], [201, 8239],
[202, 8347], [203, 8348], [204, 8363], [205, 8375], [206, 8385], [207, 8397], [208, 8409], [209, 8427],
[210, 8429], [211, 8431], [212, 8433], [213, 8435], [214, 8441], [215, 8457], [216, 8467], [217, 8468],
[218, 8472], [219, 8587], [220, 8588], [221, 8649], [222, 8661], [223, 8667], [224, 8669], [225, 8671],
[226, 8673], [227, 8677], [228, 8679], [229, 8681], [230, 8685], [231, 8705], [232, 8707], [233, 8708],
[234, 8716], [235, 8798], [236, 8800], [237, 8827], [238, 8828], [239, 8841], [240, 8843], [241, 8875],
[242, 8891], [243, 8907], [244, 8915], [245, 8917], [246, 8919], [247, 8921], [248, 8931], [249, 8934],
[250, 8947], [251, 8948], [252, 8954], [253, 8956], [254, 8984], [255, 9038], [256, 9040], [257, 9067],
[258, 9068], [259, 9157], [260, 9159], [261, 9161], [262, 9187], [263, 9188], [264, 9192], [265, 9206],
[266, 9278], [267, 9286], [268, 9299], [269, 9307], [270, 9308], [271, 9321], [272, 9349], [273, 9383],
[274, 9397], [275, 9399], [276, 9427], [277, 9428], [278, 9436], [279, 9522], [280, 9547], [281, 9548],
[282, 9561], [283, 9567], [284, 9583], [285, 9587], [286, 9601], [287, 9633], [288, 9635], [289, 9637],
[290, 9655], [291, 9665], [292, 9667], [293, 9668], [294, 9670], [295, 9787], [296, 9788], [297, 9876],
[298, 9882], [299, 9884], [300, 9908], [301, 9909], [302, 9919], [303, 10030], [304, 10031],
[305, 10065], [306, 10087], [307, 10105], [308, 10135], [309, 10153], [310, 10154], [311, 10155],
[312, 10175], [313, 10239], [314, 10277], [315, 10278], [316, 10280], [317, 10304], [318, 10330],
[319, 10342], [320, 10350], [321, 10392], [322, 10396], [323, 10400], [324, 10404], [325, 10405],
[326, 10407], [327, 10533], [328, 10613], [329, 10623], [330, 10651], [331, 10671], [332, 10709],
[333, 10807], [334, 10849], [335, 10855], [336, 10885], [337, 10891], [338, 10893], [339, 10955],
[340, 11047], [341, 11073], [342, 11143], [343, 11149], [344, 11159], [345, 11321], [346, 11337],
[347, 11353], [348, 11379], [349, 11395], [350, 11425], [351, 11431], [352, 11625], [353, 11823],
[354, 11885], [355, 11923], [356, 11933], [357, 12109], [358, 12125], [359, 12133], [360, 12329],
[361, 12345], [362, 12357], [363, 12373], [364, 12385], [365, 12397], [366, 12401], [367, 12409],
[368, 12441], [369, 12639], [370, 12821], [371, 13125], [372, 13181], [373, 13195], [374, 13211],
[375, 13297], [376, 13351], [377, 13403], [378, 13689], [379, 13713], [380, 13853], [381, 13931],
[382, 14117], [383, 14163], [384, 14181], [385, 14217], [386, 14227], [387, 14306], [388, 14339],
[389, 14381], [390, 14455], [391, 14881], [392, 15127], [393, 15167], [394, 15405], [395, 15909],
[396, 16133], [397, 16203], [398, 16237], [399, 16238], [400, 16239], [401, 16240], [402, 16241],
[403, 16242], [404, 16243], [405, 16244], [406, 16245], [407, 16246], [408, 16247], [409, 16248],
[410, 16249], [411, 16250], [412, 16251], [413, 16252], [414, 16266], [415, 16267], [416, 16268],
[417, 16269], [418, 16270], [419, 16271], [420, 16272], [421, 16273], [422, 16274], [423, 16275],
[424, 16276], [425, 16277], [426, 16301], [427, 16302], [428, 16303], [429, 16304], [430, 16305],
[431, 16306], [432, 16307], [433, 16308], [434, 16340], [435, 16341], [436, 16342], [437, 16343],
[438, 16344], [439, 16364], [440, 16383], [441, 16425], [442, 16459], [443, 16468], [444, 16482],
[445, 16512], [446, 16556], [447, 16557], [448, 16558], [449, 16559], [450, 16605], [451, 16654],
[452, 16704], [453, 16705], [454, 16706], [455, 16710], [456, 16740], [457, 16757], [458, 16811],
[459, 16861], [460, 16866], [461, 16922], [462, 16979], [463, 17037], [464, 17096], [465, 17156],
[466, 17217], [467, 17279], [468, 17299], [469, 17311], [470, 17342], [471, 17343], [472, 17344],
[473, 17408], [474, 17460], [475, 17475], [476, 17541], [477, 17543], [478, 17557], [479, 17612],
[480, 17682], [481, 17688], [482, 17753], [483, 17825], [484, 17841], [485, 17898], [486, 17928],
[487, 17972], [488, 17976], [489, 18047], [490, 18123], [491, 18185], [492, 18200], [493, 18278],
[494, 18286], [495, 18357], [496, 18437], [497, 18467], [498, 18518], [499, 18562], [500, 18600],
[501, 18606], [502, 18612], [503, 18620], [504, 18626], [505, 18632], [506, 18638], [507, 18683],
[508, 18767], [509, 18787], [510, 18789], [511, 18793], [512, 18799], [513, 18803], [514, 18852],
[515, 18938], [516, 18956], [517, 18958], [518, 18962], [519, 18966], [520, 18980], [521, 19025],
[522, 19109], [523, 19113], [524, 19127], [525, 19131], [526, 19147], [527, 19153], [528, 19157],
[529, 19163], [530, 19202], [531, 19292], [532, 19308], [533, 19312], [534, 19330], [535, 19383],
[536, 19475], [537, 19483], [538, 19491], [539, 19501], [540, 19503], [541, 19505], [542, 19509],
[543, 19519], [544, 19523], [545, 19568], [546, 19569], [547, 19570], [548, 19664], [549, 19665],
[550, 19666], [551, 19690], [552, 19694], [553, 19696], [554, 19700], [555, 19706], [556, 19716],
[557, 19720], [558, 19763], [559, 19764], [560, 19765], [561, 19865], [562, 19866], [563, 19867],
[564, 19868], [565, 19869], [566, 19891], [567, 19895], [568, 19901], [569, 19903], [570, 19907],
[571, 19909], [572, 19913], [573, 19919], [574, 19929], [575, 19972], [576, 19973], [577, 19974],
[578, 20022], [579, 20082], [580, 20083], [581, 20084], [582, 20098], [583, 20122], [584, 20124],
[585, 20126], [586, 20128], [587, 20132], [588, 20142], [589, 20195], [590, 20196], [591, 20197],
[592, 20245], [593, 20253], [594, 20311], [595, 20353], [596, 20355], [597, 20361], [598, 20363],
[599, 20365], [600, 20367], [601, 20371], [602, 20381], [603, 20389], [604, 20428], [605, 20429],
[606, 20430], [607, 20548], [608, 20549], [609, 20550], [610, 20560], [611, 20580], [612, 20582],
[613, 20590], [614, 20594], [615, 20598], [616, 20600], [617, 20604], [618, 20606], [619, 20608],
[620, 20610], [621, 20612], [622, 20671], [623, 20795], [624, 20796], [625, 20797], [626, 20849],
[627, 20855], [628, 20859], [629, 20861], [630, 20863], [631, 20865], [632, 20922], [633, 20923],
[634, 21101], [635, 21105], [636, 21117], [637, 21119], [638, 21121], [639, 21125], [640, 21137],
[641, 21223], [642, 21315], [643, 21369], [644, 21371], [645, 21375], [646, 21381], [647, 21389],
[648, 21499], [649, 21593], [650, 21609], [651, 21613], [652, 21633], [653, 21635], [654, 21657],
[655, 21881], [656, 21889], [657, 22077], [658, 22087], [659, 22117], [660, 22137], [661, 22153],
[662, 22285], [663, 22403], [664, 22795], [665, 22893], [666, 22905], [667, 22964], [668, 23145],
[669, 23187], [670, 23387], [671, 23885], [672, 23941], [673, 24299], [674, 24334], [675, 24379],
[676, 24541], [677, 24577], [678, 24845], [679, 24855], [680, 24907], [681, 25073], [682, 25355],
[683, 25659], [684, 26109], [685, 26141], [686, 26191], [687, 26405], [688, 26653], [689, 26671],
[690, 26885], [691, 26907], [692, 27423], [693, 27927], [694, 27943], [695, 27957], [696, 28171],
[697, 28441], [698, 28515], [699, 28709], [700, 28745], [701, 29199], [702, 29241], [703, 29606],
[704, 29745], [705, 29799], [706, 29809], [707, 30138], [708, 30221], [709, 30285], [710, 30829],
[711, 30869], [712, 31147], [713, 31169], [714, 31411], [715, 31618], [716, 31699], [717, 32061],
[718, 32175], [719, 32347], [720, 32455], [721, 32461], [722, 32467], [723, 32669], [724, 32699],
[725, 32709], [726, 32715], [727, 32729], [728, 32969], [729, 32977], [730, 32983], [731, 33117],
[732, 33177], [733, 33215], [734, 33237], [735, 33239], [736, 33243], [737, 33253], [738, 33349],
[739, 33455], [740, 33491], [741, 33503], [742, 33507], [743, 33515], [744, 33559], [745, 33564],
[746, 33565], [747, 33577], [748, 33629], [749, 33663], [750, 33693], [751, 33694], [752, 33695],
[753, 33721], [754, 33739], [755, 33751], [756, 33755], [757, 33757], [758, 33759], [759, 33761],
[760, 33765], [761, 33820], [762, 33944], [763, 33945], [764, 33946], [765, 33990], [766, 33994],
[767, 33996], [768, 33998], [769, 34002], [770, 34004], [771, 34006], [772, 34008], [773, 34067],
[774, 34068], [775, 34069], [776, 34187], [777, 34213], [778, 34221], [779, 34231], [780, 34233],
[781, 34237], [782, 34239], [783, 34241], [784, 34243], [785, 34247], [786, 34304], [787, 34305],
[788, 34306], [789, 34420], [790, 34421], [791, 34422], [792, 34456], [793, 34460], [794, 34466],
[795, 34468], [796, 34470], [797, 34474], [798, 34482], [799, 34488], [800, 34533], [801, 34534],
[802, 34535], [803, 34573], [804, 34583], [805, 34643], [806, 34644], [807, 34645], [808, 34646],
[809, 34647], [810, 34669], [811, 34671], [812, 34675], [813, 34679], [814, 34681], [815, 34683],
[816, 34685], [817, 34687], [818, 34691], [819, 34699], [820, 34703], [821, 34750], [822, 34751],
[823, 34752], [824, 34852], [825, 34853], [826, 34854], [827, 34874], [828, 34882], [829, 34884],
[830, 34888], [831, 34894], [832, 34908], [833, 34910], [834, 34951], [835, 34952], [836, 34953],
[837, 35047], [838, 35055], [839, 35067], [840, 35071], [841, 35073], [842, 35075], [843, 35077],
[844, 35091], [845, 35135], [846, 35140], [847, 35210], [848, 35232], [849, 35248], [850, 35252],
[851, 35256], [852, 35266], [853, 35270], [854, 35323], [855, 35413], [856, 35427], [857, 35431],
[858, 35453], [859, 35455], [860, 35457], [861, 35502], [862, 35590], [863, 35608], [864, 35612],
[865, 35616], [866, 35622], [867, 35632], [868, 35677], [869, 35763], [870, 35767], [871, 35775],
[872, 35781], [873, 35785], [874, 35789], [875, 35797], [876, 35801], [877, 35848], [878, 35932],
[879, 35950], [880, 35954], [881, 35962], [882, 35964], [883, 35970], [884, 36015], [885, 36097],
[886, 36127], [887, 36143], [888, 36163], [889, 36178], [890, 36258], [891, 36316], [892, 36337],
[893, 36413], [894, 36415], [895, 36421], [896, 36492], [897, 36528], [898, 36568], [899, 36578],
[900, 36643], [901, 36717], [902, 36733], [903, 36790], [904, 36862], [905, 36886], [906, 36916],
[907, 36933], [908, 37003], [909, 37015], [910, 37072], [911, 37140], [912, 37207], [913, 37208],
[914, 37209], [915, 37273], [916, 37336], [917, 37398], [918, 37459], [919, 37519], [920, 37561],
[921, 37578], [922, 37636], [923, 37693], [924, 37749], [925, 37759], [926, 37799], [927, 37804],
[928, 37858], [929, 37859], [930, 37860], [931, 37911], [932, 37961], [933, 38010], [934, 38011],
[935, 38012], [936, 38056], [937, 38058], [938, 38084], [939, 38103], [940, 38119], [941, 38147],
[942, 38190], [943, 38232], [944, 38233], [945, 38234], [946, 38273], [947, 38274], [948, 38275],
[949, 38276], [950, 38277], [951, 38309], [952, 38310], [953, 38311], [954, 38312], [955, 38313],
[956, 38314], [957, 38315], [958, 38339], [959, 38340], [960, 38341], [961, 38342], [962, 38343],
[963, 38344], [964, 38358], [965, 38359], [966, 38360], [967, 38361], [968, 38362], [969, 38363],
[970, 38364], [971, 38365], [972, 38366], [973, 38367], [974, 38368], [975, 38369], [976, 38370],
[977, 38371], [978, 38372], [979, 38373], [980, 38374], [981, 38375], [982, 38376], [983, 38377],
[984, 38378], [985, 38427], [986, 38431], [987, 38472], [988, 38475], [989, 38522], [990, 38534],
[991, 38568], [992, 38613], [993, 38657], [994, 38688], [995, 38701], [996, 38745], [997, 38788],
[998, 38790], [999, 38830], [1000, 38871], [1001, 38878], [1002, 38912], [1003, 38953], [1004, 38993],
[1005, 39032], [1006, 39069], [1007, 39070], [1008, 39108], [1009, 39146], [1010, 39168], [1011, 39183],
[1012, 39186], [1013, 39220], [1014, 39257], [1015, 39267], [1016, 39291], [1017, 39293], [1018, 39328],
[1019, 39333], [1020, 39363], [1021, 39398], [1022, 39430], [1023, 39432], [1024, 39466], [1025, 39500],
[1026, 39533], [1027, 39536], [1028, 39544], [1029, 39554], [1030, 39566], [1031, 39599], [1032, 39631],
[1033, 39663], [1034, 39693], [1035, 39695], [1036, 39726], [1037, 39747], [1038, 39757], [1039, 39788],
[1040, 39790], [1041, 39818], [1042, 39848], [1043, 39854], [1044, 39870], [1045, 39876], [1046, 39878],
[1047, 39907], [1048, 39910], [1049, 39920], [1050, 39936], [1051, 39965], [1052, 39971], [1053, 39985],
[1054, 39993], [1055, 40021], [1056, 40023], [1057, 40033], [1058, 40037], [1059, 40049], [1060, 40074],
[1061, 40077], [1062, 40105], [1063, 40125], [1064, 40132], [1065, 40135], [1066, 40137], [1067, 40159],
[1068, 40174], [1069, 40177], [1070, 40183], [1071, 40186], [1072, 40189], [1073, 40193], [1074, 40198],
[1075, 40213], [1076, 40240], [1077, 40267], [1078, 40283], [1079, 40285], [1080, 40294], [1081, 40296],
[1082, 40320], [1083, 40343], [1084, 40346], [1085, 40348], [1086, 40372], [1087, 40379], [1088, 40387],
[1089, 40398], [1090, 40424], [1091, 40441], [1092, 40450], [1093, 40452], [1094, 40458], [1095, 40476],
[1096, 40502], [1097, 40506], [1098, 40528], [1099, 40553], [1100, 40554], [1101, 40556], [1102, 40580],
[1103, 40595], [1104, 40606], [1105, 40610], [1106, 40614], [1107, 40632], [1108, 40658], [1109, 40660],
[1110, 40684], [1111, 40699], [1112, 40707], [1113, 40710], [1114, 40736], [1115, 40748], [1116, 40754],
[1117, 40763], [1118, 40766], [1119, 40768], [1120, 40790], [1121, 40810], [1122, 40817], [1123, 40828],
[1124, 40844], [1125, 40862], [1126, 40871], [1127, 40872], [1128, 40886], [1129, 40898], [1130, 40925],
[1131, 40927], [1132, 40931], [1133, 40953], [1134, 40977], [1135, 40981], [1136, 40983], [1137, 40993],
[1138, 41001], [1139, 41009], [1140, 41037], [1141, 41065], [1142, 41094], [1143, 41095], [1144, 41099],
[1145, 41123], [1146, 41152], [1147, 41166], [1148, 41182], [1149, 41212], [1150, 41214], [1151, 41234],
[1152, 41240], [1153, 41242], [1154, 41273], [1155, 41280], [1156, 41304], [1157, 41335], [1158, 41367],
[1159, 41384], [1160, 41399], [1161, 41403], [1162, 41431], [1163, 41464], [1164, 41493], [1165, 41497],
[1166, 41530], [1167, 41534], [1168, 41538], [1169, 41564], [1170, 41583], [1171, 41598], [1172, 41632],
[1173, 41667], [1174, 41700], [1175, 41702], [1176, 41737], [1177, 41773], [1178, 41810], [1179, 41817],
[1180, 41821], [1181, 41847], [1182, 41884], [1183, 41922], [1184, 41949], [1185, 41960], [1186, 41962],
[1187, 41998], [1188, 42034], [1189, 42037], [1190, 42077], [1191, 42118], [1192, 42133], [1193, 42159],
[1194, 42200], [1195, 42242], [1196, 42282], [1197, 42285], [1198, 42329], [1199, 42362], [1200, 42373],
[1201, 42379], [1202, 42417], [1203, 42462], [1204, 42508], [1205, 42555], [1206, 42567], [1207, 42603],
[1208, 42670], [1209, 42760], [1210, 42836], [1211, 42868], [1212, 42879], [1213, 42976], [1214, 43084],
[1215, 43191], [1216, 43253], [1217, 43297], [1218, 43334], [1219, 43402], [1220, 43506], [1221, 43607],
[1222, 43610], [1223, 43714], [1224, 43767], [1225, 43817], [1226, 43919], [1227, 43938], [1228, 43980],
[1229, 44020], [1230, 44056], [1231, 44108], [1232, 44120], [1233, 44219], [1234, 44311], [1235, 44317],
[1236, 44414], [1237, 44442], [1238, 44494], [1239, 44510], [1240, 44555], [1241, 44563], [1242, 44575],
[1243, 44605], [1244, 44699], [1245, 44712], [1246, 44792], [1247, 44878], [1248, 44884], [1249, 44975],
[1250, 45033], [1251, 45065], [1252, 45136], [1253, 45154], [1254, 45179], [1255, 45242], [1256, 45291],
[1257, 45305], [1258, 45329], [1259, 45409], [1260, 45415], [1261, 45468], [1262, 45500], [1263, 45584],
[1264, 45625], [1265, 45660], [1266, 45667], [1267, 45683], [1268, 45689], [1269, 45749], [1270, 45822],
[1271, 45830], [1272, 45840], [1273, 45876], [1274, 45910], [1275, 45969], [1276, 45979], [1277, 45989],
[1278, 46015], [1279, 46067], [1280, 46144], [1281, 46220], [1282, 46227], [1283, 46285], [1284, 46295],
[1285, 46313], [1286, 46369], [1287, 46438], [1288, 46442], [1289, 46514], [1290, 46561], [1291, 46573],
[1292, 46585], [1293, 46617], [1294, 46647], [1295, 46655], [1296, 46658], [1297, 46722], [1298, 46724],
[1299, 46742], [1300, 46746], [1301, 46762], [1302, 46792], [1303, 46843], [1304, 46853], [1305, 46859],
[1306, 46871], [1307, 46901], [1308, 46925], [1309, 46990], [1310, 47000], [1311, 47004], [1312, 47048],
[1313, 47055], [1314, 47118], [1315, 47120], [1316, 47128], [1317, 47132], [1318, 47144], [1319, 47168],
[1320, 47185], [1321, 47246], [1322, 47250], [1323, 47256], [1324, 47260], [1325, 47266], [1326, 47272],
[1327, 47286], [1328, 47315], [1329, 47378], [1330, 47380], [1331, 47384], [1332, 47392], [1333, 47394],
[1334, 47412], [1335, 47422], [1336, 47434], [1337, 47445], [1338, 47510], [1339, 47515], [1340, 47518],
[1341, 47520], [1342, 47526], [1343, 47562], [1344, 47575], [1345, 47578], [1346, 47634], [1347, 47640],
[1348, 47646], [1349, 47650], [1350, 47652], [1351, 47654], [1352, 47662], [1353, 47676], [1354, 47705],
[1355, 47708], [1356, 47760], [1357, 47770], [1358, 47778], [1359, 47780], [1360, 47786], [1361, 47802],
[1362, 47808], [1363, 47816], [1364, 47835], [1365, 47836], [1366, 47840], [1367, 47888], [1368, 47897],
[1369, 47900], [1370, 47912], [1371, 47914], [1372, 47922], [1373, 47965], [1374, 47968], [1375, 48028],
[1376, 48030], [1377, 48035], [1378, 48038], [1379, 48040], [1380, 48046], [1381, 48078], [1382, 48095],
[1383, 48098], [1384, 48152], [1385, 48160], [1386, 48166], [1387, 48168], [1388, 48170], [1389, 48172],
[1390, 48174], [1391, 48186], [1392, 48194], [1393, 48202], [1394, 48225], [1395, 48279], [1396, 48290],
[1397, 48294], [1398, 48298], [1399, 48306], [1400, 48312], [1401, 48326], [1402, 48354], [1403, 48355],
[1404, 48420], [1405, 48434], [1406, 48468], [1407, 48485], [1408, 48546], [1409, 48548], [1410, 48550],
[1411, 48554], [1412, 48556], [1413, 48558], [1414, 48560], [1415, 48562], [1416, 48572], [1417, 48590],
[1418, 48604], [1419, 48615], [1420, 48616], [1421, 48680], [1422, 48694], [1423, 48698], [1424, 48716],
[1425, 48724], [1426, 48745], [1427, 48753], [1428, 48810], [1429, 48822], [1430, 48828], [1431, 48870],
[1432, 48872], [1433, 48875], [1434, 48940], [1435, 48950], [1436, 48962], [1437, 48976], [1438, 49006],
[1439, 49061], [1440, 49068], [1441, 49073], [1442, 49123], [1443, 49139], [1444, 49141], [1445, 49146],
[1446, 49210], [1447, 49256], [1448, 49270], [1449, 49280], [1450, 49347], [1451, 49351], [1452, 49373],
[1453, 49383], [1454, 49393], [1455, 49423], [1456, 49430], [1457, 49486], [1458, 49496], [1459, 49498],
[1460, 49570], [1461, 49621], [1462, 49639], [1463, 49641], [1464, 49645], [1465, 49721], [1466, 49780],
[1467, 49798], [1468, 49814], [1469, 49820], [1470, 49876], [1471, 49949], [1472, 49955], [1473, 49983],
[1474, 50019], [1475, 50035], [1476, 50044], [1477, 50116], [1478, 50158], [1479, 50172], [1480, 50192],
[1481, 50198], [1482, 50245], [1483, 50249], [1484, 50281], [1485, 50347], [1486, 50365], [1487, 50450],
[1488, 50530], [1489, 50536], [1490, 50547], [1491, 50623], [1492, 50647], [1493, 50655], [1494, 50707],
[1495, 50711], [1496, 50800], [1497, 50868], [1498, 50874], [1499, 50890], [1500, 50939], [1501, 50953],
[1502, 50981], [1503, 51073], [1504, 51132], [1505, 51166], [1506, 51246], [1507, 51256], [1508, 51260],
[1509, 51275], [1510, 51286], [1511, 51294], [1512, 51355], [1513, 51451], [1514, 51548], [1515, 51602],
[1516, 51646], [1517, 51715], [1518, 51745], [1519, 51845], [1520, 51946], [1521, 52026], [1522, 52032],
[1523, 52040], [1524, 52048], [1525, 52077], [1526, 52151], [1527, 52255], [1528, 52314], [1529, 52356],
[1530, 52359], [1531, 52463], [1532, 52480], [1533, 52530], [1534, 52568], [1535, 52630], [1536, 52674],
[1537, 52781], [1538, 52788], [1539, 52889], [1540, 52918], [1541, 52997], [1542, 53035], [1543, 53105],
[1544, 53214]]
simple_tri = [[3, 691, 8], [688, 1, 2], [7, 691, 988], [692, 3, 1], [687, 2, 5], [687, 5, 1213], [1, 3, 6],
[2, 1, 4], [1, 6, 4], [2, 4, 5], [691, 7, 14], [14, 10, 691], [3, 9, 6], [1213, 5, 20], [691, 10, 8],
[4, 12, 5], [1007, 7, 988], [3, 8, 15], [10, 14, 18], [3, 15, 9], [4, 6, 11], [4, 11, 12],
[15, 13, 9], [9, 13, 16], [9, 16, 6], [1007, 21, 7], [16, 17, 6], [6, 17, 11], [11, 17, 19],
[11, 19, 12], [12, 31, 5], [1007, 1017, 21], [8, 10, 15], [5, 31, 20], [7, 21, 14], [13, 25, 16],
[17, 16, 26], [17, 22, 19], [18, 27, 10], [15, 10, 23], [12, 19, 31], [27, 29, 10], [13, 15, 24],
[13, 24, 25], [16, 25, 26], [21, 28, 14], [10, 29, 23], [18, 14, 30], [18, 30, 27], [17, 26, 22],
[24, 35, 25], [19, 22, 32], [28, 30, 14], [23, 33, 15], [26, 34, 22], [22, 36, 32], [29, 38, 23],
[15, 33, 24], [22, 34, 36], [30, 37, 27], [27, 37, 29], [23, 38, 33], [24, 33, 45], [19, 32, 31],
[31, 1283, 20], [28, 1035, 44], [28, 44, 30], [25, 35, 26], [26, 35, 34], [31, 32, 39], [29, 37, 42],
[44, 41, 30], [30, 41, 37], [24, 50, 35], [32, 36, 48], [32, 40, 39], [39, 1283, 31], [35, 46, 34],
[34, 46, 43], [34, 43, 36], [32, 48, 40], [29, 42, 38], [45, 50, 24], [39, 59, 1283], [37, 41, 52],
[42, 47, 38], [38, 47, 33], [35, 51, 46], [36, 43, 48], [1035, 1046, 44], [35, 50, 51], [40, 49, 53],
[40, 53, 39], [39, 53, 54], [39, 54, 59], [44, 55, 41], [48, 49, 40], [42, 37, 52], [42, 52, 47],
[43, 46, 58], [59, 54, 63], [41, 65, 52], [47, 66, 67], [51, 57, 46], [52, 66, 47], [47, 67, 33],
[33, 67, 45], [45, 60, 50], [57, 69, 46], [43, 58, 62], [43, 62, 48], [48, 62, 49], [55, 65, 41],
[50, 60, 68], [56, 57, 51], [58, 46, 77], [52, 64, 66], [50, 68, 51], [51, 68, 56], [56, 61, 57],
[52, 65, 64], [45, 67, 60], [69, 77, 46], [58, 78, 62], [49, 74, 53], [53, 101, 54], [65, 55, 88],
[68, 60, 91], [56, 71, 61], [61, 76, 57], [77, 78, 58], [49, 62, 80], [49, 80, 74], [53, 74, 85],
[64, 89, 75], [64, 75, 66], [62, 79, 80], [53, 85, 101], [101, 63, 54], [64, 65, 89], [66, 90, 67],
[68, 98, 56], [71, 93, 61], [61, 94, 76], [74, 72, 70], [70, 73, 74], [66, 75, 90], [60, 67, 91],
[98, 71, 56], [61, 93, 94], [76, 104, 57], [57, 104, 69], [77, 69, 109], [62, 78, 79], [74, 80, 81],
[74, 81, 72], [73, 82, 74], [74, 82, 83], [74, 84, 85], [74, 83, 84], [85, 121, 101], [55, 1061, 88],
[93, 71, 92], [69, 104, 132], [80, 86, 81], [84, 87, 85], [65, 88, 89], [67, 90, 91], [69, 132, 109],
[80, 95, 86], [87, 96, 85], [85, 96, 108], [71, 98, 123], [71, 128, 92], [94, 103, 76], [78, 77, 105],
[79, 78, 148], [95, 80, 99], [96, 100, 108], [63, 101, 112], [63, 112, 97], [71, 123, 128],
[92, 102, 93], [93, 102, 94], [94, 102, 115], [94, 115, 103], [76, 103, 104], [80, 106, 99],
[100, 107, 108], [1061, 1071, 122], [1061, 122, 88], [88, 122, 89], [89, 122, 113], [89, 113, 75],
[75, 114, 90], [90, 114, 91], [91, 142, 68], [103, 118, 104], [78, 105, 148], [80, 79, 149],
[80, 149, 106], [106, 149, 110], [107, 111, 108], [112, 127, 97], [75, 113, 114], [91, 114, 142],
[68, 142, 98], [115, 116, 103], [103, 116, 117], [103, 117, 118], [104, 118, 132], [79, 148, 149],
[149, 119, 110], [111, 120, 108], [85, 108, 121], [1071, 159, 122], [113, 122, 141], [113, 141, 114],
[114, 161, 142], [92, 128, 102], [102, 129, 115], [115, 130, 116], [116, 130, 124], [116, 124, 117],
[77, 109, 105], [119, 149, 125], [120, 135, 108], [120, 126, 135], [108, 135, 121], [101, 121, 153],
[101, 153, 112], [115, 129, 144], [115, 144, 130], [124, 130, 131], [124, 131, 117], [117, 131, 137],
[117, 137, 118], [105, 183, 148], [149, 133, 125], [126, 134, 135], [153, 140, 112], [112, 140, 127],
[122, 159, 141], [141, 161, 114], [142, 162, 98], [98, 162, 123], [123, 162, 143], [123, 143, 128],
[128, 143, 102], [102, 164, 129], [130, 136, 131], [109, 183, 105], [109, 169, 183], [133, 149, 138],
[134, 139, 135], [135, 152, 121], [143, 164, 102], [144, 145, 130], [130, 145, 136], [136, 146, 131],
[136, 145, 146], [131, 146, 137], [137, 146, 147], [137, 147, 118], [118, 147, 132], [132, 147, 167],
[132, 167, 168], [132, 168, 109], [109, 168, 169], [149, 150, 138], [139, 151, 135], [135, 151, 152],
[121, 152, 153], [141, 160, 161], [162, 163, 143], [144, 165, 145], [145, 165, 154], [145, 154, 146],
[146, 154, 166], [146, 155, 147], [146, 166, 155], [147, 155, 167], [150, 149, 156], [151, 157, 152],
[153, 158, 140], [140, 174, 127], [141, 159, 160], [142, 161, 162], [143, 163, 164], [129, 165, 144],
[154, 165, 166], [155, 166, 167], [149, 170, 156], [157, 171, 152], [152, 171, 186], [186, 187, 152],
[152, 187, 153], [163, 176, 177], [163, 177, 164], [164, 177, 178], [164, 178, 179], [164, 179, 129],
[129, 179, 165], [165, 179, 180], [165, 181, 166], [166, 181, 167], [167, 181, 182], [167, 182, 168],
[148, 198, 149], [170, 149, 172], [171, 173, 186], [1100, 206, 159], [161, 160, 191], [161, 191, 175],
[161, 175, 162], [162, 175, 176], [162, 176, 163], [165, 180, 181], [149, 184, 172], [173, 185, 186],
[187, 201, 153], [153, 201, 158], [158, 202, 140], [140, 202, 205], [140, 205, 174], [159, 190, 160],
[159, 206, 190], [160, 190, 191], [175, 191, 192], [175, 192, 176], [176, 192, 193], [176, 193, 194],
[176, 194, 177], [177, 194, 178], [181, 197, 182], [168, 231, 169], [148, 183, 198], [198, 232, 149],
[149, 232, 184], [184, 232, 188], [185, 189, 186], [178, 194, 195], [178, 195, 196], [178, 196, 179],
[179, 196, 197], [179, 197, 180], [180, 197, 181], [183, 169, 250], [232, 199, 188], [189, 200, 186],
[158, 201, 202], [206, 207, 190], [190, 208, 191], [193, 192, 210], [193, 210, 194], [194, 212, 195],
[195, 212, 196], [197, 215, 182], [199, 232, 203], [200, 219, 186], [200, 204, 219], [186, 219, 187],
[174, 205, 1366], [190, 207, 208], [191, 208, 209], [191, 209, 192], [192, 209, 210], [194, 210, 211],
[194, 211, 212], [212, 213, 196], [196, 213, 197], [197, 213, 214], [197, 214, 215], [182, 215, 168],
[168, 215, 231], [231, 249, 169], [183, 250, 216], [183, 216, 198], [232, 217, 203], [204, 218, 219],
[187, 219, 201], [202, 240, 205], [205, 241, 1366], [210, 224, 211], [169, 249, 250], [217, 232, 220],
[218, 221, 219], [201, 235, 202], [202, 235, 240], [207, 242, 208], [209, 208, 222], [209, 222, 223],
[209, 223, 210], [210, 223, 224], [211, 224, 225], [211, 225, 212], [212, 225, 226], [212, 226, 213],
[213, 226, 227], [213, 227, 214], [214, 228, 229], [214, 229, 215], [215, 229, 230], [232, 233, 220],
[221, 234, 219], [219, 253, 201], [201, 253, 235], [240, 241, 205], [206, 284, 207], [208, 242, 222],
[222, 243, 223], [223, 244, 224], [224, 244, 225], [214, 227, 245], [214, 245, 228], [228, 236, 229],
[229, 237, 230], [215, 230, 231], [233, 232, 238], [234, 265, 219], [234, 239, 265], [207, 255, 242],
[222, 242, 243], [228, 245, 246], [228, 246, 236], [236, 247, 229], [236, 246, 247], [229, 247, 237],
[237, 248, 230], [237, 247, 248], [230, 248, 231], [232, 251, 238], [239, 252, 265], [219, 265, 253],
[235, 253, 254], [226, 225, 288], [245, 227, 289], [246, 245, 260], [246, 260, 256], [246, 256, 247],
[247, 256, 261], [247, 261, 257], [247, 257, 248], [248, 262, 231], [231, 262, 268], [249, 291, 250],
[216, 269, 198], [251, 232, 258], [252, 259, 265], [235, 272, 240], [235, 254, 272], [240, 272, 241],
[207, 285, 255], [207, 284, 285], [255, 273, 242], [242, 273, 287], [242, 287, 243], [223, 243, 274],
[223, 274, 244], [225, 244, 288], [226, 288, 227], [245, 289, 260], [256, 260, 261], [257, 262, 248],
[231, 268, 249], [249, 268, 291], [232, 263, 258], [232, 292, 263], [259, 264, 265], [265, 279, 253],
[253, 279, 254], [241, 272, 266], [206, 1113, 284], [284, 306, 285], [227, 288, 289], [260, 267, 261],
[261, 267, 276], [261, 276, 257], [257, 276, 262], [262, 280, 268], [250, 291, 216], [216, 291, 269],
[198, 269, 323], [198, 323, 232], [263, 292, 270], [264, 271, 265], [254, 279, 272], [255, 285, 273],
[274, 314, 244], [289, 275, 260], [260, 275, 267], [267, 275, 276], [232, 323, 292], [292, 277, 270],
[271, 278, 265], [265, 278, 295], [265, 295, 279], [273, 307, 287], [275, 290, 276], [276, 280, 262],
[280, 300, 268], [277, 292, 281], [278, 282, 295], [279, 283, 272], [272, 283, 266], [285, 286, 273],
[273, 286, 307], [243, 308, 274], [244, 314, 288], [275, 289, 290], [276, 290, 280], [268, 309, 291],
[292, 293, 281], [282, 294, 295], [295, 303, 279], [279, 303, 283], [286, 319, 307], [287, 307, 321],
[287, 321, 243], [289, 298, 290], [290, 299, 280], [280, 299, 300], [291, 322, 269], [293, 292, 296],
[294, 297, 332], [294, 332, 295], [266, 283, 1421], [284, 318, 306], [274, 308, 314], [289, 288, 298],
[290, 298, 299], [292, 301, 296], [297, 302, 332], [283, 313, 1421], [285, 306, 286], [286, 306, 333],
[307, 320, 321], [243, 321, 308], [288, 314, 337], [288, 337, 298], [268, 300, 309], [323, 324, 292],
[301, 292, 304], [302, 305, 332], [283, 303, 313], [286, 333, 319], [308, 330, 314], [291, 309, 322],
[292, 310, 304], [305, 312, 332], [295, 332, 303], [319, 336, 307], [319, 335, 336], [299, 298, 338],
[300, 339, 309], [309, 345, 322], [269, 322, 323], [292, 324, 315], [292, 315, 310], [311, 316, 327],
[311, 327, 317], [312, 317, 327], [312, 327, 332], [1421, 313, 342], [299, 339, 300], [315, 324, 325],
[316, 326, 327], [307, 336, 320], [321, 329, 308], [308, 329, 330], [314, 330, 337], [299, 338, 339],
[325, 324, 328], [326, 328, 341], [326, 341, 327], [303, 334, 313], [306, 318, 340], [306, 340, 333],
[319, 333, 335], [320, 329, 321], [298, 337, 338], [322, 331, 323], [328, 324, 341], [332, 334, 303],
[320, 336, 349], [320, 349, 329], [322, 345, 331], [327, 354, 332], [318, 347, 340], [340, 348, 333],
[339, 345, 309], [331, 352, 323], [323, 341, 324], [327, 341, 354], [335, 353, 336], [329, 350, 330],
[337, 330, 343], [337, 343, 338], [338, 344, 339], [331, 351, 352], [323, 352, 341], [313, 346, 342],
[329, 349, 350], [343, 344, 338], [332, 346, 334], [334, 346, 313], [333, 348, 335], [335, 348, 353],
[331, 345, 351], [330, 350, 343], [343, 356, 344], [339, 344, 345], [341, 352, 354], [354, 346, 332],
[348, 340, 359], [353, 355, 336], [343, 350, 356], [345, 357, 351], [340, 347, 359], [344, 357, 345],
[348, 359, 365], [349, 336, 368], [351, 354, 352], [346, 1460, 342], [348, 365, 360], [348, 360, 353],
[336, 355, 368], [351, 357, 361], [1153, 364, 347], [344, 356, 357], [351, 361, 354], [346, 354, 362],
[347, 364, 359], [360, 366, 353], [350, 349, 374], [356, 369, 357], [361, 362, 354], [346, 362, 1460],
[358, 364, 1153], [353, 367, 355], [353, 366, 367], [355, 367, 368], [349, 368, 374], [350, 371, 356],
[357, 369, 361], [1460, 362, 363], [364, 370, 359], [359, 370, 365], [356, 371, 369], [362, 372, 363],
[367, 373, 368], [361, 377, 362], [358, 378, 364], [360, 376, 366], [365, 376, 360], [366, 376, 367],
[350, 374, 371], [1477, 363, 384], [1477, 384, 1491], [358, 1175, 378], [371, 375, 369],
[369, 375, 361], [363, 372, 384], [376, 379, 367], [375, 377, 361], [378, 385, 364], [364, 385, 382],
[364, 382, 370], [365, 370, 382], [368, 380, 374], [374, 380, 371], [371, 381, 375], [367, 379, 373],
[368, 373, 386], [380, 381, 371], [375, 381, 377], [377, 390, 362], [362, 390, 372], [382, 391, 365],
[365, 391, 376], [368, 386, 380], [381, 383, 377], [378, 1175, 388], [378, 388, 385], [376, 391, 379],
[379, 389, 373], [383, 390, 377], [380, 387, 381], [386, 387, 380], [373, 389, 386], [381, 392, 383],
[390, 384, 372], [381, 387, 392], [379, 391, 389], [388, 397, 385], [387, 393, 392], [383, 395, 390],
[391, 694, 389], [386, 389, 393], [386, 393, 387], [390, 395, 394], [390, 394, 384],
[1491, 384, 1539], [385, 397, 382], [392, 395, 383], [382, 397, 391], [393, 396, 392],
[392, 396, 395], [384, 394, 1539], [1197, 697, 388], [388, 697, 397], [389, 694, 393],
[393, 693, 396], [391, 397, 694], [395, 398, 394], [396, 696, 395], [394, 398, 1539], [694, 693, 393],
[395, 696, 398], [399, 414, 440], [399, 440, 400], [400, 440, 401], [401, 440, 402], [402, 440, 403],
[403, 440, 404], [404, 440, 405], [405, 440, 406], [406, 440, 407], [407, 440, 408], [408, 440, 409],
[409, 440, 443], [409, 443, 410], [410, 443, 411], [411, 443, 415], [412, 426, 445], [412, 445, 413],
[413, 445, 414], [414, 445, 440], [415, 443, 416], [416, 443, 417], [417, 443, 418], [418, 443, 419],
[419, 443, 420], [420, 443, 421], [421, 443, 427], [422, 434, 445], [422, 445, 423], [423, 445, 424],
[424, 445, 425], [425, 445, 426], [427, 443, 428], [428, 443, 429], [429, 443, 435], [430, 439, 456],
[430, 456, 431], [431, 456, 432], [432, 456, 433], [433, 456, 434], [434, 456, 445], [440, 445, 457],
[435, 447, 436], [435, 443, 447], [437, 441, 456], [437, 456, 438], [438, 456, 439], [441, 442, 456],
[442, 444, 456], [440, 457, 443], [444, 446, 456], [446, 450, 456], [448, 451, 456], [448, 456, 449],
[449, 456, 450], [456, 469, 445], [445, 469, 457], [451, 452, 456], [443, 457, 447], [447, 457, 460],
[452, 455, 456], [453, 458, 479], [453, 479, 454], [454, 479, 455], [455, 479, 456], [458, 459, 479],
[459, 461, 479], [461, 462, 479], [457, 469, 470], [457, 475, 460], [460, 475, 477], [462, 463, 479],
[463, 464, 479], [464, 465, 479], [460, 477, 1232], [465, 466, 479], [466, 467, 482], [466, 482, 479],
[456, 479, 469], [457, 470, 475], [467, 468, 482], [468, 473, 482], [471, 474, 482], [471, 482, 472],
[472, 482, 473], [474, 476, 482], [469, 487, 470], [475, 492, 477], [476, 478, 482], [479, 487, 469],
[478, 480, 489], [478, 489, 482], [482, 489, 479], [479, 485, 487], [480, 481, 489], [481, 483, 489],
[489, 485, 479], [477, 492, 1211], [483, 484, 489], [484, 486, 489], [487, 507, 470], [486, 488, 489],
[488, 490, 489], [489, 504, 485], [485, 498, 487], [490, 491, 489], [489, 495, 504], [504, 498, 485],
[470, 492, 475], [491, 493, 502], [491, 502, 489], [504, 495, 503], [493, 494, 502], [470, 507, 500],
[494, 496, 502], [496, 497, 502], [489, 502, 495], [498, 507, 487], [470, 500, 604], [497, 499, 502],
[502, 503, 495], [504, 505, 498], [498, 506, 507], [499, 501, 502], [503, 517, 504], [498, 505, 506],
[507, 521, 500], [492, 523, 1211], [501, 508, 502], [503, 526, 517], [517, 510, 504], [504, 512, 505],
[506, 505, 513], [506, 514, 507], [508, 509, 502], [502, 525, 503], [504, 510, 511], [504, 511, 512],
[505, 512, 513], [506, 513, 514], [514, 521, 507], [509, 515, 538], [509, 538, 502], [503, 525, 526],
[511, 510, 519], [521, 529, 500], [515, 516, 538], [517, 518, 510], [510, 518, 519], [511, 519, 512],
[512, 519, 520], [512, 520, 513], [513, 527, 514], [529, 530, 500], [500, 530, 604], [516, 522, 538],
[520, 527, 513], [514, 528, 521], [470, 604, 492], [522, 524, 538], [514, 527, 528], [521, 528, 529],
[523, 1217, 1211], [524, 531, 538], [502, 538, 525], [525, 533, 526], [526, 533, 534],
[526, 534, 517], [517, 534, 518], [519, 518, 542], [519, 542, 520], [520, 542, 543], [520, 543, 527],
[529, 558, 530], [531, 532, 538], [525, 539, 533], [527, 543, 535], [527, 535, 528], [528, 535, 544],
[528, 544, 545], [528, 545, 529], [532, 536, 538], [518, 540, 541], [518, 541, 542], [529, 545, 558],
[536, 537, 538], [538, 539, 525], [533, 539, 552], [533, 552, 534], [518, 534, 540], [545, 544, 557],
[537, 548, 612], [537, 612, 538], [534, 553, 540], [540, 554, 541], [542, 541, 555], [543, 573, 556],
[543, 556, 535], [545, 575, 558], [546, 551, 612], [546, 612, 547], [547, 612, 548], [539, 568, 552],
[534, 552, 553], [540, 553, 554], [542, 555, 543], [545, 557, 575], [530, 558, 604], [604, 523, 492],
[549, 561, 583], [549, 583, 550], [550, 583, 551], [551, 583, 612], [538, 567, 539], [539, 567, 568],
[552, 569, 553], [553, 569, 570], [553, 570, 554], [554, 571, 541], [541, 571, 555], [555, 572, 543],
[543, 572, 573], [556, 574, 535], [535, 574, 544], [559, 566, 583], [559, 583, 560], [560, 583, 561],
[552, 568, 584], [552, 584, 569], [570, 571, 554], [555, 571, 572], [544, 574, 557], [562, 578, 611],
[562, 611, 563], [563, 611, 564], [564, 611, 565], [565, 611, 566], [566, 611, 583], [538, 612, 613],
[538, 613, 567], [568, 567, 614], [568, 596, 584], [584, 585, 569], [569, 585, 570], [570, 585, 586],
[570, 586, 571], [572, 588, 573], [573, 588, 579], [573, 594, 556], [556, 594, 574], [574, 589, 557],
[557, 589, 603], [557, 603, 575], [558, 575, 604], [576, 582, 611], [576, 611, 577], [577, 611, 578],
[568, 614, 596], [571, 586, 587], [587, 593, 571], [571, 593, 572], [572, 593, 588], [579, 594, 573],
[574, 594, 602], [574, 602, 589], [604, 655, 523], [580, 592, 611], [580, 611, 581], [581, 611, 582],
[614, 615, 596], [584, 597, 585], [585, 617, 586], [593, 599, 588], [588, 599, 600], [588, 600, 579],
[579, 600, 601], [579, 601, 594], [594, 601, 622], [575, 641, 604], [590, 595, 611], [590, 611, 591],
[591, 611, 592], [613, 614, 567], [584, 596, 597], [597, 617, 585], [586, 598, 587], [587, 598, 593],
[593, 598, 599], [594, 622, 602], [603, 641, 575], [595, 607, 643], [595, 643, 611], [596, 616, 597],
[598, 618, 599], [599, 620, 600], [600, 620, 601], [601, 621, 622], [602, 622, 632], [523, 658, 1217],
[605, 610, 643], [605, 643, 606], [606, 643, 607], [596, 615, 616], [597, 616, 617], [586, 617, 598],
[598, 617, 618], [618, 619, 599], [599, 619, 620], [601, 620, 621], [608, 623, 643], [608, 643, 609],
[609, 643, 610], [611, 643, 650], [611, 650, 583], [614, 613, 642], [616, 627, 617], [617, 628, 618],
[618, 628, 619], [619, 629, 620], [620, 629, 621], [621, 629, 630], [622, 621, 631], [622, 631, 632],
[602, 632, 640], [602, 640, 589], [603, 589, 648], [603, 648, 641], [623, 626, 643], [614, 642, 635],
[614, 635, 615], [616, 615, 627], [617, 627, 628], [619, 628, 629], [621, 630, 631], [589, 640, 648],
[523, 655, 658], [624, 634, 643], [624, 643, 625], [625, 643, 626], [615, 636, 627], [627, 636, 628],
[629, 628, 645], [629, 645, 637], [629, 637, 630], [630, 638, 631], [640, 647, 648], [604, 641, 655],
[633, 987, 634], [634, 987, 643], [628, 636, 644], [630, 637, 638], [631, 638, 639], [631, 639, 632],
[613, 612, 642], [628, 644, 645], [645, 646, 637], [638, 646, 639], [632, 639, 647], [632, 647, 640],
[641, 648, 655], [642, 652, 635], [615, 635, 636], [636, 635, 644], [637, 646, 638], [987, 659, 643],
[612, 583, 651], [612, 651, 642], [644, 635, 656], [644, 656, 649], [644, 649, 645], [646, 654, 639],
[642, 651, 652], [645, 649, 653], [645, 653, 646], [646, 653, 654], [639, 654, 647], [647, 654, 648],
[583, 660, 651], [652, 651, 635], [635, 651, 656], [649, 657, 653], [643, 659, 650], [583, 650, 660],
[649, 656, 664], [649, 664, 657], [653, 657, 654], [654, 662, 648], [655, 668, 658], [651, 661, 656],
[656, 661, 664], [654, 657, 662], [648, 663, 655], [651, 660, 661], [648, 662, 663], [659, 671, 650],
[650, 671, 660], [657, 664, 665], [657, 665, 662], [662, 665, 663], [655, 663, 668], [660, 667, 661],
[661, 667, 664], [659, 677, 671], [658, 672, 1219], [671, 669, 660], [660, 666, 667], [665, 670, 663],
[660, 669, 666], [664, 667, 665], [663, 670, 676], [658, 668, 672], [666, 673, 667], [667, 673, 665],
[663, 676, 668], [666, 669, 678], [666, 678, 673], [665, 673, 670], [673, 675, 670], [671, 674, 669],
[669, 674, 678], [670, 680, 676], [672, 668, 681], [675, 680, 670], [681, 1209, 672], [678, 679, 673],
[680, 684, 676], [671, 677, 674], [673, 679, 675], [668, 676, 681], [677, 682, 674], [678, 683, 679],
[679, 686, 675], [675, 686, 680], [676, 684, 681], [678, 674, 683], [995, 988, 677], [682, 683, 674],
[683, 686, 679], [677, 988, 682], [683, 689, 686], [684, 687, 681], [681, 1213, 1209],
[682, 689, 683], [682, 685, 689], [680, 686, 688], [680, 688, 684], [684, 688, 690], [681, 687, 1213],
[685, 692, 689], [682, 988, 685], [685, 988, 691], [684, 690, 687], [685, 691, 692], [689, 1, 686],
[686, 1, 688], [691, 3, 692], [688, 2, 690], [690, 2, 687], [689, 692, 1], [396, 693, 695],
[398, 699, 1539], [694, 397, 697], [396, 695, 696], [398, 696, 699], [697, 698, 694], [694, 698, 693],
[693, 698, 695], [696, 701, 699], [697, 1197, 702], [698, 700, 695], [695, 703, 696], [697, 702, 698],
[695, 705, 703], [703, 701, 696], [701, 706, 699], [1539, 699, 1533], [702, 700, 698],
[700, 705, 695], [1197, 1200, 702], [700, 702, 704], [700, 704, 705], [706, 707, 699],
[699, 707, 1533], [701, 710, 706], [1200, 709, 702], [703, 705, 708], [703, 708, 701],
[702, 709, 704], [701, 708, 710], [1533, 707, 1541], [710, 711, 706], [705, 704, 715],
[705, 714, 708], [708, 714, 717], [708, 717, 710], [709, 1207, 712], [709, 713, 704], [715, 714, 705],
[706, 711, 716], [706, 716, 707], [704, 713, 715], [710, 717, 711], [716, 1541, 707], [709, 712, 713],
[715, 718, 714], [712, 719, 713], [718, 722, 714], [717, 720, 711], [716, 1543, 1541],
[713, 719, 715], [712, 1207, 719], [719, 718, 715], [714, 722, 717], [722, 723, 717], [717, 723, 720],
[711, 720, 716], [1207, 724, 719], [718, 725, 721], [718, 721, 722], [719, 725, 718],
[716, 745, 1543], [725, 726, 721], [721, 727, 722], [723, 728, 720], [720, 750, 716],
[1207, 733, 724], [719, 754, 725], [721, 726, 727], [722, 731, 723], [723, 731, 728], [754, 734, 725],
[727, 730, 722], [722, 730, 735], [728, 731, 732], [725, 734, 726], [726, 729, 727], [722, 735, 731],
[720, 728, 738], [720, 738, 750], [716, 750, 745], [726, 734, 739], [731, 736, 737], [731, 737, 732],
[728, 732, 743], [724, 733, 748], [724, 740, 719], [726, 739, 729], [729, 730, 727], [735, 736, 731],
[732, 737, 742], [728, 743, 738], [724, 748, 740], [740, 754, 719], [730, 741, 735], [736, 749, 737],
[743, 761, 738], [738, 744, 750], [739, 755, 729], [729, 755, 730], [742, 760, 732], [732, 760, 743],
[733, 746, 747], [730, 755, 766], [730, 766, 741], [741, 756, 735], [735, 756, 736], [736, 756, 757],
[736, 757, 749], [737, 749, 758], [737, 758, 759], [737, 759, 742], [738, 761, 744], [750, 846, 745],
[747, 751, 733], [733, 751, 752], [733, 753, 748], [733, 752, 753], [741, 767, 756], [749, 757, 758],
[742, 759, 760], [760, 786, 743], [743, 786, 761], [744, 800, 750], [745, 846, 1536], [753, 762, 748],
[739, 734, 778], [767, 769, 756], [756, 770, 757], [756, 769, 770], [758, 757, 771], [759, 758, 772],
[759, 773, 760], [759, 772, 773], [760, 773, 786], [744, 761, 799], [762, 763, 748], [748, 763, 764],
[748, 764, 765], [766, 767, 741], [767, 768, 769], [757, 770, 771], [758, 771, 772], [750, 800, 834],
[765, 774, 748], [748, 774, 775], [748, 775, 776], [739, 779, 755], [766, 780, 767], [766, 793, 780],
[767, 780, 768], [768, 781, 769], [769, 781, 782], [769, 783, 770], [769, 782, 783], [771, 784, 772],
[772, 784, 785], [761, 786, 799], [744, 799, 800], [776, 777, 748], [778, 839, 739], [739, 839, 779],
[755, 793, 766], [768, 780, 781], [770, 783, 771], [771, 783, 784], [772, 785, 773], [777, 787, 748],
[748, 787, 788], [748, 788, 789], [748, 789, 740], [734, 754, 778], [755, 779, 793], [793, 779, 812],
[782, 795, 783], [783, 796, 797], [783, 797, 784], [773, 785, 798], [773, 798, 786], [800, 799, 821],
[789, 790, 740], [740, 790, 791], [740, 791, 792], [780, 793, 794], [780, 794, 781], [781, 804, 782],
[782, 804, 795], [783, 795, 796], [784, 805, 785], [784, 797, 805], [785, 805, 798], [750, 848, 846],
[792, 801, 740], [740, 801, 802], [740, 802, 803], [779, 839, 811], [779, 811, 812], [793, 813, 794],
[781, 794, 814], [781, 814, 804], [804, 816, 795], [804, 815, 816], [798, 805, 819], [786, 820, 799],
[799, 820, 821], [803, 806, 740], [740, 806, 807], [740, 807, 808], [740, 808, 809], [740, 809, 810],
[740, 810, 754], [793, 812, 813], [794, 813, 814], [804, 814, 815], [795, 816, 817], [795, 817, 796],
[796, 817, 818], [796, 818, 797], [797, 819, 805], [797, 818, 819], [798, 819, 832], [798, 832, 786],
[786, 832, 820], [800, 821, 834], [750, 834, 848], [810, 822, 754], [754, 822, 823], [754, 823, 824],
[812, 828, 813], [815, 814, 829], [816, 815, 830], [816, 830, 817], [817, 830, 843], [818, 817, 831],
[821, 833, 834], [824, 825, 754], [754, 825, 826], [754, 826, 827], [754, 827, 778], [812, 811, 828],
[815, 829, 830], [817, 843, 831], [818, 831, 819], [819, 831, 853], [819, 853, 832], [820, 845, 821],
[827, 835, 778], [778, 835, 836], [778, 836, 837], [813, 840, 814], [814, 841, 829], [829, 841, 842],
[829, 842, 830], [830, 842, 843], [821, 845, 833], [837, 838, 778], [811, 850, 828], [828, 840, 813],
[840, 851, 814], [814, 851, 841], [831, 843, 844], [831, 844, 853], [838, 847, 778], [828, 850, 840],
[853, 854, 832], [820, 832, 854], [845, 860, 833], [847, 849, 778], [778, 849, 839], [811, 839, 850],
[840, 850, 851], [841, 852, 842], [841, 851, 852], [842, 852, 865], [842, 865, 843], [843, 865, 844],
[820, 854, 845], [849, 855, 839], [851, 850, 858], [854, 859, 845], [860, 861, 833], [833, 861, 834],
[848, 834, 888], [846, 848, 889], [855, 856, 839], [839, 871, 850], [850, 857, 858], [858, 864, 851],
[851, 864, 852], [844, 865, 866], [844, 866, 853], [845, 859, 860], [834, 861, 888], [856, 862, 839],
[853, 867, 854], [860, 859, 868], [860, 868, 861], [861, 868, 888], [848, 888, 892], [1536, 846, 894],
[862, 863, 839], [857, 872, 858], [864, 873, 852], [852, 873, 865], [853, 866, 867], [863, 869, 839],
[865, 874, 866], [866, 874, 875], [866, 875, 867], [867, 875, 882], [867, 876, 854], [854, 876, 859],
[859, 877, 868], [869, 870, 839], [839, 870, 871], [850, 871, 857], [857, 871, 872], [865, 873, 874],
[867, 882, 876], [859, 876, 877], [846, 889, 894], [870, 878, 871], [858, 872, 864], [873, 880, 874],
[874, 881, 875], [875, 881, 882], [876, 883, 877], [868, 877, 884], [878, 879, 871], [864, 872, 873],
[873, 872, 880], [876, 882, 883], [877, 883, 884], [879, 885, 871], [874, 880, 881], [868, 884, 898],
[885, 886, 871], [872, 871, 896], [882, 881, 887], [882, 887, 883], [883, 887, 884], [868, 898, 888],
[848, 892, 889], [886, 890, 871], [890, 891, 871], [871, 891, 896], [872, 896, 900], [872, 900, 880],
[880, 900, 881], [891, 893, 896], [884, 887, 906], [893, 895, 896], [881, 903, 887], [887, 903, 906],
[888, 898, 892], [889, 892, 907], [895, 897, 896], [881, 900, 903], [897, 899, 896], [884, 906, 898],
[899, 901, 896], [901, 902, 896], [900, 896, 903], [902, 904, 896], [889, 907, 894], [904, 905, 896],
[896, 910, 903], [905, 908, 896], [908, 909, 896], [892, 921, 907], [909, 911, 896], [898, 921, 892],
[911, 912, 896], [910, 906, 903], [906, 921, 898], [894, 907, 927], [912, 913, 896], [896, 913, 914],
[896, 915, 910], [896, 914, 915], [915, 916, 910], [916, 917, 910], [906, 926, 921], [907, 921, 927],
[917, 918, 910], [906, 910, 926], [918, 919, 910], [919, 920, 910], [920, 922, 910], [922, 923, 910],
[923, 924, 910], [924, 925, 910], [921, 926, 941], [925, 928, 910], [921, 941, 939], [928, 929, 910],
[910, 929, 930], [910, 930, 931], [931, 932, 910], [932, 933, 910], [933, 934, 910], [910, 934, 935],
[910, 936, 926], [910, 935, 936], [939, 927, 921], [936, 938, 926], [938, 940, 926], [940, 942, 926],
[927, 939, 937], [942, 943, 926], [943, 944, 926], [926, 944, 945], [926, 945, 946], [946, 947, 926],
[926, 947, 948], [926, 948, 949], [926, 949, 950], [926, 950, 951], [926, 951, 941], [937, 952, 953],
[951, 954, 941], [941, 954, 955], [941, 955, 956], [941, 956, 957], [941, 957, 958], [939, 959, 937],
[937, 959, 960], [937, 960, 961], [937, 961, 952], [958, 962, 941], [941, 962, 963], [941, 963, 964],
[939, 965, 966], [939, 966, 967], [939, 967, 968], [939, 968, 969], [939, 969, 970], [939, 970, 971],
[939, 971, 959], [964, 972, 941], [941, 972, 973], [941, 973, 974], [941, 974, 975], [941, 975, 976],
[941, 976, 977], [941, 978, 939], [941, 977, 978], [939, 978, 979], [939, 979, 980], [939, 980, 981],
[939, 981, 982], [939, 982, 983], [939, 983, 984], [939, 984, 965], [633, 985, 987], [991, 995, 677],
[985, 986, 987], [659, 987, 991], [659, 991, 677], [986, 989, 987], [989, 990, 987], [990, 992, 987],
[987, 999, 991], [992, 993, 987], [987, 993, 999], [993, 994, 999], [994, 996, 999], [996, 997, 999],
[999, 1002, 991], [997, 998, 999], [991, 1002, 995], [995, 1007, 988], [998, 1000, 999],
[1000, 1002, 999], [1000, 1001, 1002], [1001, 1003, 1002], [995, 1011, 1007], [1003, 1004, 1002],
[1004, 1005, 1002], [1002, 1016, 995], [995, 1016, 1011], [1005, 1006, 1002], [1002, 1006, 1013],
[1006, 1008, 1013], [1008, 1009, 1013], [1002, 1013, 1016], [1009, 1010, 1013], [1010, 1012, 1013],
[1012, 1014, 1013], [1013, 1020, 1016], [1011, 1023, 1007], [1007, 1023, 1017], [1014, 1015, 1013],
[1015, 1018, 1013], [1011, 1016, 1029], [1018, 1020, 1013], [1018, 1019, 1020], [1029, 1030, 1011],
[1011, 1030, 1023], [1019, 1021, 1020], [1017, 1023, 21], [21, 1023, 28], [1021, 1022, 1020],
[1022, 1028, 1020], [1022, 1024, 1028], [1020, 1028, 1016], [1024, 1025, 1028], [1028, 1029, 1016],
[1025, 1026, 1028], [1023, 1035, 28], [1026, 1027, 1028], [1023, 1038, 1035], [1027, 1031, 1028],
[1030, 1038, 1023], [1031, 1032, 1028], [1032, 1033, 1028], [1029, 1028, 1041], [1029, 1044, 1030],
[1033, 1034, 1028], [1038, 1045, 1035], [1034, 1036, 1028], [1028, 1036, 1041], [1029, 1041, 1044],
[1036, 1037, 1041], [1037, 1039, 1041], [1039, 1040, 1041], [1040, 1042, 1041], [1038, 1030, 1050],
[44, 1046, 55], [1042, 1043, 1041], [1038, 1050, 1045], [1043, 1047, 1041], [1041, 1047, 1049],
[1041, 1049, 1044], [1044, 1053, 1030], [1030, 1053, 1050], [1047, 1048, 1049], [1045, 1054, 1035],
[1035, 1054, 1046], [1048, 1051, 1049], [1044, 1049, 1053], [1045, 1059, 1054], [1051, 1052, 1049],
[1050, 1053, 1058], [1050, 1058, 1045], [1045, 1058, 1059], [1054, 1064, 1046], [1052, 1057, 1049],
[1052, 1055, 1057], [1049, 1057, 1053], [1055, 1056, 1057], [1046, 1061, 55], [1056, 1060, 1057],
[1046, 1064, 1061], [1060, 1062, 1057], [1057, 1066, 1053], [1066, 1067, 1053], [1053, 1067, 1058],
[1062, 1063, 1057], [1057, 1063, 1066], [1059, 1069, 1054], [1054, 1069, 1070], [1054, 1070, 1064],
[1064, 1071, 1061], [1063, 1065, 1066], [1067, 1074, 1058], [1059, 1058, 1069], [1065, 1068, 1066],
[1058, 1074, 1075], [1058, 1075, 1069], [1068, 1073, 1066], [1068, 1072, 1073], [1066, 1073, 1067],
[1067, 1073, 1074], [1064, 1070, 1080], [1064, 1080, 1071], [1072, 1076, 1073], [1075, 1079, 1069],
[1069, 1079, 1070], [1070, 1079, 1080], [1076, 1077, 1073], [1073, 1082, 1074], [1071, 1080, 1084],
[1077, 1078, 1073], [1078, 1081, 1073], [1073, 1081, 1082], [1075, 1089, 1079], [1081, 1086, 1082],
[1081, 1083, 1086], [1082, 1088, 1074], [1074, 1088, 1075], [1075, 1088, 1089], [1083, 1085, 1086],
[1082, 1086, 1088], [1079, 1089, 1080], [1080, 1100, 1084], [1084, 159, 1071], [1085, 1087, 1086],
[1086, 1094, 1088], [1080, 1089, 1092], [1087, 1090, 1086], [1088, 1094, 1095], [1084, 1100, 159],
[1090, 1091, 1086], [1088, 1095, 1089], [1080, 1092, 1100], [1091, 1093, 1086], [1086, 1093, 1094],
[1089, 1104, 1092], [1093, 1096, 1094], [1094, 1098, 1095], [1096, 1097, 1094], [1095, 1098, 1104],
[1095, 1104, 1089], [1097, 1102, 1094], [1097, 1099, 1102], [1099, 1101, 1102], [1094, 1102, 1098],
[1098, 1107, 1104], [1101, 1103, 1102], [1102, 1106, 1098], [1098, 1106, 1107], [1103, 1105, 1102],
[1107, 1112, 1104], [1105, 1110, 1102], [1105, 1108, 1110], [1104, 1117, 1092], [1092, 1117, 1100],
[1100, 1117, 1113], [1100, 1113, 206], [1108, 1109, 1110], [1102, 1110, 1106], [1107, 1106, 1116],
[1107, 1116, 1112], [1109, 1111, 1110], [1106, 1120, 1116], [1104, 1112, 1117], [1111, 1114, 1110],
[1110, 1114, 1119], [1110, 1119, 1106], [1106, 1119, 1120], [1114, 1115, 1119], [1115, 1118, 1119],
[1120, 1124, 1116], [1116, 1126, 1112], [1113, 1117, 1122], [1118, 1121, 1119], [1116, 1129, 1126],
[1112, 1126, 1117], [1121, 1128, 1119], [1121, 1123, 1128], [1116, 1124, 1129], [1117, 1126, 1122],
[1113, 1122, 1135], [1123, 1125, 1128], [1119, 1128, 1132], [1125, 1127, 1128], [1119, 1132, 1133],
[1119, 1133, 1120], [1120, 1133, 1124], [1113, 1135, 284], [1127, 1130, 1128], [1130, 1131, 1132],
[1130, 1132, 1128], [1124, 1133, 1138], [1124, 1138, 1129], [1126, 1129, 1139], [1126, 1139, 1122],
[1131, 1134, 1132], [1132, 1137, 1133], [1122, 1139, 1135], [1135, 318, 284], [1134, 1136, 1132],
[1132, 1136, 1137], [1135, 1139, 1153], [1136, 1140, 1137], [1140, 1141, 1137], [1137, 1145, 1133],
[1133, 1145, 1148], [1133, 1148, 1138], [1129, 1138, 1139], [1141, 1142, 1144], [1141, 1144, 1137],
[1138, 1152, 1139], [1135, 347, 318], [1142, 1143, 1144], [1137, 1144, 1145], [1135, 1153, 347],
[1143, 1146, 1144], [1144, 1146, 1151], [1145, 1160, 1148], [1146, 1147, 1151], [1138, 1148, 1152],
[1139, 1152, 1153], [1147, 1149, 1151], [1144, 1156, 1145], [1145, 1156, 1160], [1149, 1150, 1151],
[1144, 1151, 1156], [1150, 1154, 1151], [1148, 1160, 1152], [1154, 1155, 1151], [1160, 1165, 1152],
[1155, 1157, 1151], [1151, 1157, 1162], [1152, 358, 1153], [1157, 1158, 1162], [1152, 1165, 358],
[1158, 1159, 1162], [1151, 1162, 1156], [1159, 1161, 1162], [1156, 1171, 1160], [1156, 1162, 1171],
[1161, 1163, 1168], [1161, 1168, 1162], [1163, 1164, 1168], [1162, 1168, 1169], [1164, 1166, 1168],
[1166, 1167, 1168], [1167, 1170, 1168], [1162, 1169, 1171], [1160, 1171, 1175], [1160, 1175, 1165],
[1170, 1172, 1168], [358, 1165, 1175], [1172, 1173, 1180], [1172, 1180, 1168], [1168, 1180, 1169],
[1173, 1174, 1180], [1174, 1176, 1180], [1169, 1185, 1171], [1171, 1185, 1175], [1175, 1185, 1189],
[1176, 1177, 1180], [1180, 1181, 1169], [1169, 1181, 1185], [1177, 1178, 1180], [1178, 1179, 1180],
[1179, 1182, 1180], [1180, 1182, 1187], [1182, 1183, 1187], [1183, 1184, 1187], [1184, 1186, 1187],
[1187, 1193, 1180], [1180, 1193, 1181], [1186, 1188, 1187], [1188, 1190, 1187], [1181, 1193, 1185],
[1185, 1200, 1189], [1175, 1189, 388], [1190, 1191, 1187], [1191, 1192, 1187], [1185, 1193, 1200],
[1189, 1197, 388], [1192, 1194, 1187], [1187, 1194, 1202], [1187, 1202, 1193], [1194, 1195, 1202],
[1195, 1196, 1202], [1202, 1207, 1193], [1189, 1200, 1197], [1196, 1198, 1202], [1198, 1199, 1202],
[1199, 1201, 1202], [1193, 1207, 1200], [1201, 1203, 733], [1201, 733, 1202], [1203, 1204, 733],
[1204, 1205, 733], [1205, 1206, 733], [1206, 1208, 733], [1202, 733, 1207], [1208, 746, 733],
[1200, 1207, 709], [447, 1210, 436], [658, 1225, 1217], [460, 1222, 447], [447, 1212, 1210],
[658, 1219, 1225], [1212, 447, 1214], [447, 1215, 1214], [447, 1216, 1215], [447, 1218, 1216],
[477, 1239, 1232], [447, 1220, 1218], [1213, 1228, 1209], [672, 1231, 1219], [460, 1232, 1222],
[1222, 1221, 447], [447, 1221, 1220], [1209, 1231, 672], [1225, 1229, 1217], [1221, 1222, 1223],
[1217, 1229, 1211], [1232, 1235, 1222], [1222, 1224, 1223], [1211, 1229, 1243], [1211, 1239, 477],
[1222, 1226, 1224], [1222, 1235, 1227], [1222, 1227, 1226], [1219, 1241, 1225], [1235, 1230, 1227],
[1209, 1228, 1238], [1209, 1238, 1231], [1235, 1233, 1230], [1213, 20, 1246], [1213, 1246, 1228],
[1243, 1239, 1211], [1235, 1234, 1233], [1219, 1231, 1241], [1225, 1242, 1229], [1243, 1253, 1239],
[1235, 1236, 1234], [1235, 1237, 1236], [1229, 1242, 1243], [1235, 1240, 1237], [1241, 1242, 1225],
[1232, 1248, 1235], [1235, 1244, 1240], [1231, 1238, 1241], [1232, 1239, 1248], [1235, 1245, 1244],
[1242, 1251, 1243], [1235, 1247, 1245], [1228, 1246, 1255], [1228, 1255, 1238], [1241, 1257, 1242],
[1248, 1249, 1235], [1235, 1249, 1247], [1241, 1238, 1265], [1243, 1258, 1253], [1248, 1250, 1249],
[1251, 1258, 1243], [1248, 1252, 1250], [1238, 1255, 1265], [1242, 1262, 1251], [1239, 1260, 1248],
[1248, 1254, 1252], [20, 1273, 1246], [1246, 1268, 1255], [1248, 1256, 1254], [1246, 1273, 1268],
[1257, 1262, 1242], [1253, 1266, 1239], [1248, 1259, 1256], [1241, 1265, 1257], [1248, 1261, 1259],
[1239, 1266, 1260], [1248, 1263, 1261], [20, 1283, 1273], [1268, 1269, 1255], [1255, 1269, 1279],
[1255, 1279, 1265], [1248, 1260, 1264], [1248, 1264, 1263], [1265, 1274, 1257], [1257, 1274, 1262],
[1251, 1262, 1258], [1258, 1277, 1253], [1253, 1271, 1266], [1260, 1267, 1264], [1262, 1276, 1258],
[1260, 1270, 1267], [1268, 1273, 1307], [1253, 1277, 1271], [1260, 1272, 1270], [1286, 1269, 1268],
[1260, 1275, 1272], [1258, 1284, 1277], [1258, 1276, 1284], [1266, 1278, 1260], [1260, 1278, 1275],
[1307, 1286, 1268], [1274, 1291, 1262], [1266, 1280, 1278], [1279, 1294, 1265], [1266, 1281, 1280],
[1283, 1311, 1273], [1273, 1311, 1307], [1286, 1300, 1269], [1265, 1291, 1274], [1277, 1284, 1288],
[1266, 1282, 1281], [1269, 1300, 1279], [1294, 1302, 1265], [1262, 1291, 1276], [1276, 1291, 1304],
[1271, 1285, 1266], [1266, 1285, 1282], [1300, 1301, 1279], [1265, 1302, 1291], [1276, 1292, 1284],
[1271, 1287, 1285], [1283, 59, 1297], [1301, 1294, 1279], [1277, 1289, 1271], [1271, 1289, 1287],
[1284, 1292, 1295], [1277, 1290, 1289], [1283, 1317, 1311], [1284, 1298, 1288], [1288, 1293, 1277],
[1277, 1293, 1290], [1297, 1317, 1283], [1292, 1305, 1295], [1284, 1295, 1298], [1288, 1296, 1293],
[59, 63, 1297], [1276, 1304, 1292], [1298, 1299, 1288], [1288, 1299, 1296], [1302, 1308, 1291],
[1298, 1303, 1299], [1307, 1312, 1286], [1286, 1312, 1300], [1291, 1308, 1304], [1295, 1306, 1298],
[1298, 1306, 1303], [1304, 1308, 1320], [1304, 1313, 1292], [1295, 1305, 1309], [1295, 1309, 1306],
[63, 97, 1297], [1300, 1312, 1326], [1300, 1326, 1301], [1301, 1326, 1319], [1301, 1319, 1294],
[1302, 1294, 1328], [1305, 1310, 1309], [1297, 97, 1324], [1307, 1311, 1318], [1307, 1318, 1312],
[1328, 1308, 1302], [1304, 1320, 1313], [1292, 1313, 1305], [1305, 1313, 1322], [1305, 1322, 1315],
[1305, 1315, 1310], [1310, 1315, 1314], [1315, 1316, 1314], [97, 1332, 1324], [1297, 1324, 1317],
[1311, 1317, 1325], [1311, 1325, 1318], [1312, 1318, 1326], [1294, 1319, 1328], [1316, 1315, 1321],
[1326, 1327, 1319], [1308, 1336, 1320], [1320, 1337, 1313], [1313, 1337, 1322], [1322, 1330, 1315],
[1315, 1323, 1321], [1318, 1325, 1333], [1319, 1327, 1335], [1319, 1335, 1328], [1315, 1330, 1323],
[1323, 1330, 1329], [1317, 1324, 1341], [1317, 1341, 1325], [1318, 1334, 1326], [1326, 1334, 1327],
[1328, 1336, 1308], [1328, 1354, 1336], [1336, 1344, 1320], [1320, 1344, 1337], [1322, 1337, 1330],
[1330, 1331, 1329], [97, 1346, 1332], [1318, 1333, 1334], [1331, 1330, 1338], [127, 1346, 97],
[1332, 1346, 1340], [1332, 1340, 1324], [1324, 1340, 1341], [1325, 1341, 1342], [1325, 1342, 1333],
[1333, 1351, 1334], [1334, 1352, 1343], [1334, 1343, 1327], [1327, 1353, 1335], [1337, 1347, 1330],
[1330, 1339, 1338], [127, 174, 1346], [1333, 1342, 1351], [1334, 1351, 1352], [1327, 1343, 1353],
[1328, 1335, 1354], [1330, 1347, 1339], [1339, 1347, 1345], [1340, 1349, 1341], [1341, 1349, 1350],
[1341, 1350, 1342], [1337, 1344, 1347], [1347, 1348, 1345], [1346, 1356, 1340], [1340, 1356, 1349],
[1342, 1350, 1351], [1353, 1362, 1335], [1335, 1362, 1354], [1347, 1344, 1357], [1348, 1347, 1355],
[1346, 174, 1356], [1349, 1367, 1359], [1349, 1359, 1350], [1350, 1359, 1360], [1343, 1352, 1361],
[1343, 1361, 1353], [1354, 1363, 1336], [1336, 1364, 1344], [1347, 1358, 1355], [1347, 1357, 1358],
[174, 1366, 1356], [1350, 1371, 1351], [1350, 1360, 1371], [1351, 1371, 1352], [1352, 1371, 1372],
[1352, 1372, 1361], [1353, 1361, 1373], [1353, 1373, 1362], [1336, 1363, 1364], [1344, 1364, 1368],
[1344, 1368, 1357], [1357, 1369, 1358], [1358, 1369, 1365], [1366, 1375, 1356], [1356, 1375, 1367],
[1356, 1367, 1349], [1357, 1368, 1369], [1369, 1370, 1365], [1359, 1367, 1379], [1360, 1359, 1380],
[1360, 1380, 1371], [1372, 1381, 1361], [1361, 1381, 1373], [1362, 1363, 1354], [1364, 1382, 1368],
[1369, 1376, 1370], [1370, 1376, 1374], [1367, 1375, 1378], [1367, 1378, 1379], [1359, 1379, 1380],
[1373, 1392, 1362], [1362, 1393, 1363], [1363, 1394, 1364], [1368, 1382, 1376], [1368, 1376, 1369],
[1376, 1377, 1374], [1366, 1384, 1375], [1366, 241, 1384], [1375, 1384, 1378], [1371, 1380, 1390],
[1371, 1390, 1391], [1371, 1391, 1372], [1372, 1391, 1381], [1373, 1381, 1392], [1362, 1392, 1393],
[1363, 1393, 1402], [1363, 1402, 1394], [1364, 1394, 1382], [1376, 1382, 1385], [1377, 1376, 1383],
[1380, 1379, 1389], [1380, 1389, 1390], [1392, 1381, 1401], [1376, 1386, 1383], [1376, 1385, 1386],
[1378, 1384, 1387], [1378, 1388, 1379], [1378, 1387, 1388], [1379, 1388, 1389], [1381, 1391, 1401],
[1382, 1396, 1385], [1386, 1385, 1395], [241, 266, 1384], [1391, 1400, 1401], [1394, 1407, 1382],
[1382, 1407, 1396], [1396, 1403, 1385], [1385, 1397, 1395], [1385, 1403, 1397], [1384, 266, 1398],
[1384, 1398, 1387], [1387, 1398, 1399], [1387, 1399, 1388], [1388, 1399, 1389], [1390, 1406, 1391],
[1391, 1406, 1400], [1392, 1401, 1393], [1397, 1403, 1404], [266, 1421, 1398], [1389, 1399, 1415],
[1390, 1389, 1416], [1390, 1416, 1406], [1400, 1417, 1401], [1401, 1417, 1393], [1393, 1425, 1402],
[1402, 1425, 1394], [1396, 1419, 1409], [1396, 1409, 1403], [1403, 1409, 1410], [1403, 1405, 1404],
[1403, 1410, 1405], [1398, 1421, 1412], [1398, 1412, 1413], [1398, 1413, 1399], [1399, 1413, 1414],
[1399, 1414, 1415], [1389, 1415, 1416], [1393, 1417, 1425], [1394, 1418, 1407], [1396, 1407, 1419],
[1405, 1410, 1408], [1400, 1406, 1424], [1400, 1424, 1417], [1425, 1418, 1394], [1410, 1411, 1408],
[1416, 1423, 1406], [1406, 1423, 1424], [1407, 1418, 1426], [1411, 1410, 1420], [1414, 1428, 1415],
[1417, 1438, 1425], [1407, 1426, 1419], [1409, 1432, 1410], [1410, 1422, 1420], [1410, 1433, 1422],
[1414, 1413, 1428], [1423, 1431, 1424], [1419, 1432, 1409], [1422, 1433, 1427], [1424, 1437, 1417],
[1432, 1433, 1410], [1433, 1429, 1427], [1413, 1412, 1446], [1413, 1446, 1428], [1415, 1428, 1436],
[1415, 1430, 1416], [1415, 1436, 1430], [1416, 1430, 1423], [1417, 1437, 1438], [1418, 1425, 1426],
[1426, 1440, 1419], [1419, 1440, 1432], [1429, 1433, 1434], [1412, 1421, 1446], [1426, 1425, 1448],
[1426, 1448, 1443], [1426, 1443, 1440], [1433, 1435, 1434], [1433, 1441, 1435], [1446, 1457, 1428],
[1428, 1457, 1436], [1424, 1431, 1437], [1435, 1441, 1439], [1441, 1444, 1439], [1439, 1444, 1442],
[1421, 342, 1446], [1425, 1438, 1448], [1432, 1449, 1433], [1433, 1449, 1441], [1442, 1444, 1445],
[1423, 1453, 1431], [1431, 1453, 1437], [1437, 1454, 1438], [1445, 1444, 1451], [1445, 1451, 1447],
[1436, 1469, 1430], [1423, 1430, 1453], [1437, 1453, 1454], [1438, 1455, 1448], [1447, 1451, 1463],
[1447, 1463, 1450], [1436, 1457, 1469], [1443, 1448, 1462], [1432, 1440, 1449], [1441, 1458, 1444],
[1441, 1449, 1458], [1450, 1463, 1452], [342, 1460, 1446], [1454, 1455, 1438], [1444, 1458, 1451],
[1452, 1463, 1464], [1452, 1464, 1456], [1446, 1460, 1457], [1456, 1464, 1459], [1448, 1483, 1462],
[1451, 1475, 1463], [1459, 1464, 1461], [1457, 1477, 1469], [1430, 1469, 1453], [1453, 1469, 1470],
[1453, 1474, 1454], [1448, 1455, 1483], [1440, 1467, 1449], [1449, 1467, 1458], [1461, 1464, 1472],
[1461, 1472, 1465], [1453, 1470, 1474], [1454, 1474, 1455], [1443, 1462, 1440], [1458, 1467, 1475],
[1465, 1472, 1481], [1465, 1481, 1466], [1462, 1480, 1440], [1458, 1475, 1451], [1466, 1481, 1468],
[1455, 1474, 1479], [1455, 1479, 1483], [1468, 1481, 1471], [1460, 363, 1457], [1469, 1493, 1470],
[1440, 1480, 1467], [1463, 1486, 1464], [1464, 1486, 1472], [1471, 1481, 1473], [1457, 363, 1477],
[1473, 1481, 1476], [1483, 1484, 1462], [1475, 1467, 1480], [1475, 1486, 1463], [1476, 1481, 1489],
[1476, 1489, 1478], [1462, 1484, 1480], [1478, 1489, 1482], [1469, 1477, 1491], [1470, 1494, 1474],
[1474, 1494, 1479], [1480, 1486, 1475], [1486, 1498, 1472], [1482, 1489, 1485], [1472, 1499, 1481],
[1485, 1489, 1487], [1470, 1493, 1494], [1486, 1480, 1502], [1498, 1499, 1472], [1489, 1495, 1487],
[1487, 1495, 1488], [1491, 1510, 1469], [1486, 1502, 1498], [1488, 1495, 1490], [1479, 1494, 1501],
[1479, 1501, 1483], [1483, 1501, 1484], [1490, 1495, 1492], [1469, 1510, 1493], [1492, 1495, 1496],
[1494, 1512, 1501], [1480, 1484, 1502], [1496, 1495, 1497], [1484, 1505, 1502], [1481, 1507, 1489],
[1497, 1495, 1500], [1484, 1501, 1505], [1499, 1507, 1481], [1495, 1508, 1500], [1500, 1508, 1503],
[1493, 1511, 1494], [1494, 1511, 1512], [1489, 1507, 1495], [1503, 1508, 1504], [1504, 1508, 1506],
[1505, 1501, 1516], [1502, 1518, 1498], [1498, 1518, 1499], [1506, 1508, 1509], [1491, 1539, 1510],
[1509, 1508, 1513], [1510, 1511, 1493], [1502, 1505, 1518], [1495, 1524, 1508], [1513, 1508, 1514],
[1514, 1508, 1524], [1514, 1524, 1515], [1512, 1516, 1501], [1505, 1516, 1518], [1507, 1523, 1495],
[1495, 1523, 1524], [1515, 1524, 1517], [1517, 1524, 1519], [1511, 1526, 1512], [1512, 1526, 1516],
[1499, 1518, 1507], [1519, 1524, 1520], [1516, 1534, 1518], [1507, 1518, 1522], [1507, 1522, 1523],
[1520, 1524, 1521], [1516, 1529, 1534], [1518, 1534, 1522], [1521, 1524, 1525], [1510, 1533, 1511],
[1525, 1524, 1530], [1525, 1530, 1527], [1511, 1533, 1526], [1527, 1530, 1528], [1529, 1536, 1534],
[1528, 1530, 1531], [1510, 1539, 1533], [1524, 1523, 927], [1524, 927, 1530], [1530, 1532, 1531],
[1532, 1530, 1535], [1526, 1543, 1516], [1516, 1543, 1529], [1535, 1530, 1537], [1526, 1541, 1543],
[1522, 1534, 894], [1530, 937, 1537], [1537, 937, 1538], [1529, 1543, 1536], [1534, 1536, 894],
[1522, 894, 1523], [1538, 937, 1540], [927, 937, 1530], [1540, 937, 1542], [1526, 1533, 1541],
[1523, 894, 927], [937, 1544, 1542], [1544, 937, 1545], [1543, 745, 1536], [1545, 937, 953]]
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def levelOrder(self, root):
"""
:type root: TreeNode
:rtype: List[List[int]]
"""
if root == None:
return []
l = [[]]
level = 0
stack = [(root, level)]
while len(stack) > 0:
r, level = stack[0]
stack = stack[1:]
if len(l) == level:
l.append([])
l[level] += [r.val]
level += 1
if r.left:
stack += [(r.left, level)]
if r.right:
stack += [(r.right, level)]
return l |
#==============================================================================
##
## Copyright Jim Carty © 2020
##
## This file is subject to the terms and conditions defined in file
## 'LICENSE.txt', which is part of this source code package.
##
#==============================================================================
cells = []
stack = []
wall = "|"
ceiling = "--"
corner = "*"
gap = " "
m = 31
a = 17
c = 13
seed = 1234
cell_length = 7
def build(width, height) :
for i in range(height) :
for j in range(width) :
cells.append(i) #y = i
cells.append(j) #x = j
cells.append(0) #visited = 2
cells.append(0) #N = 3
cells.append(0) #E = 4
cells.append(0) #S = 5
cells.append(0) #W = 6
def print_cells() :
for i in range(height) :
for j in range(width) :
if cells[(i * cell_length * width) + j * cell_length + 3] == 0 :
if cells[(i * cell_length * width) + j * cell_length + 1] == 0 :
print(corner, end="")
print(ceiling + corner, end="")
else :
if cells[(i * cell_length * width) + j * cell_length + 1] == 0 :
print(corner, end="")
print(gap + corner, end="")
print("")
for j in range(width) :
if cells[(i * cell_length * width) + j * cell_length + 6] == 0 :
print(wall + gap, end="")
else :
print(" " + gap, end="")
if cells[(i * cell_length * width) + j * cell_length + 1] == width - 1 :
if cells[(i * cell_length * width) + j * cell_length + 4] == 0 :
print(wall, end="")
else :
print(" ", end="")
for j in range(width) :
if cells[(i * cell_length * width) + j * cell_length] == height - 1 :
if j == 0 :
print("")
if cells[(i * cell_length * width) + j * cell_length + 5] == 0 :
if cells[(i * cell_length * width) + j * cell_length + 1] == 0 :
print(corner, end="")
print(ceiling + corner, end="")
else :
if cells[(i * cell_length * width) + j * cell_length + 1] == 0 :
print(corner, end="")
print(gap + corner, end="")
else :
break
print("")
def random_num() :
global seed
seed = (seed * a + c) % m
def generateMaze(cell_y, cell_x, first=False):
# base case
if len(stack) == 0 and not first :
return None
# recusive step
else :
cells[(cell_y * cell_length * width) + cell_x * cell_length + 2] = 1
chosen_cell = None
while True :
# random generator
random_num()
random_int = seed % 4
chosen_cell_y, chosen_cell_x = choose_cell(cell_y, cell_x, random_int)
if chosen_cell_y < height and chosen_cell_y > -1 :
stack.append(cell_y)
stack.append(cell_x)
return generateMaze(chosen_cell_y, chosen_cell_x)
else :
if chosen_cell_y == -1 :
prev_cell_x = stack.pop()
prev_cell_y = stack.pop()
return generateMaze(prev_cell_y, prev_cell_x)
def choose_cell(cell_y, cell_x, random_int) :
bad = True
if cell_y > 0 and not cells[(((cell_y - 1) * cell_length) * width) + cell_x * cell_length + 2] :
bad = False
if random_int == 0 :
cells[(cell_y * cell_length * width) + cell_x * cell_length + 3] = 1
cells[(((cell_y - 1) * cell_length) * width) + cell_x * cell_length + 5] = 1
return (cell_y - 1, cell_x)
if cell_x < width - 1 and not cells[(cell_y * cell_length * width) + ((cell_x + 1) * cell_length) + 2] :
bad = False
if random_int == 1 :
cells[(cell_y * cell_length * width) + cell_x * cell_length + 4] = 1
cells[(cell_y * cell_length * width) + ((cell_x + 1) * cell_length) + 6] = 1
return (cell_y, cell_x + 1)
if cell_y < height - 1 and not cells[(((cell_y + 1) * cell_length) * width) + cell_x * cell_length + 2] :
bad = False
if random_int == 2 :
cells[(cell_y * cell_length * width) + cell_x * cell_length + 5] = 1
cells[(((cell_y + 1) * cell_length) * width) + cell_x * cell_length + 3] = 1
return (cell_y + 1, cell_x)
if cell_x > 0 and not cells[(cell_y * cell_length * width) + ((cell_x - 1) * cell_length) + 2] :
bad = False
if random_int == 3 :
cells[(cell_y * cell_length * width) + cell_x * cell_length + 6] = 1
cells[(cell_y * cell_length * width) + ((cell_x - 1) * cell_length) + 4] = 1
return (cell_y, cell_x - 1)
if bad == False :
return (height + 1, width + 1)
else :
return (-1, -1)
if __name__ == "__main__" :
width = 4
height = 4
build(width, height)
generateMaze(0, 0, True)
print_cells()
|
#!/usr/bin/env python
# Mainly for use in stubconnections/kubectl.yml
print('PID: 1')
|
# START LAB EXERCISE 03
print('Lab Exercise 03 \n')
# PROBLEM 1 (5 Points)
inventors = None
# PROBLEM 2 (4 Points)
#SETUP
invention = 'Heating, ventilation, and air conditioning'
#END SETUP
# PROBLEM 3 (4 Points)
# SETUP
new_inventor = {'Alexander Miles': 'Automatic electric elevator doors'}
# END SETUP
# PROBLEM 4 (4 Points)
# PROBLEM 5 (4 Points)
# SETUP
gastroscope_inventor = 'Leonidas Berry'
# END SETUP
tuple_gastroscope_inventor = None
# PROBLEM 6 (4 Points)
medical_inventors = None
# END LAB EXERCISE
|
class handshake:
def clientside(Socket_Object):
"""This must be called with the main object from the socket"""
pass#Socket_Object.
|
#!/usr/bin/python3
# Can user retrieve reward after a time cycle?
def test_get_reward(multi, base_token, reward_token, alice, issue, chain):
amount = 10 ** 10
init_reward_balance = reward_token.balanceOf(alice)
base_token.approve(multi, amount, {"from": alice})
multi.stake(amount, {"from": alice})
chain.mine(timedelta=60)
earnings = multi.earned(alice, reward_token)
assert earnings > 0
multi.getReward({"from": alice})
final_reward_balance = reward_token.balanceOf(alice)
assert final_reward_balance - init_reward_balance == earnings
# Reward per token over many cycles?
def test_multiuser_reward_per_token_paid(multi, reward_token, alice, chain):
reward_token._mint_for_testing(alice, 10 ** 18, {"from": alice})
reward_token.approve(multi, 10 ** 18, {"from": alice})
multi.setRewardsDistributor(reward_token, alice, {"from": alice})
multi.stake(10 ** 10, {"from": alice})
for i in range(5):
last_val = multi.userRewardPerTokenPaid(alice, reward_token)
multi.notifyRewardAmount(reward_token, 10 ** 10, {"from": alice})
chain.mine(timedelta=60)
earnings = multi.earned(alice, reward_token)
tx = multi.getReward()
assert multi.userRewardPerTokenPaid(alice, reward_token) > last_val
assert tx.events["RewardPaid"].values()[2] == earnings
# User should not be able to withdraw a reward if empty
def test_cannot_get_empty_reward(multi, reward_token, alice, chain):
init_amount = reward_token.balanceOf(alice)
chain.mine(timedelta=60)
multi.getReward({"from": alice})
final_amount = reward_token.balanceOf(alice)
assert init_amount == final_amount
# User should not be able to withdraw a reward if empty
def test_no_action_on_empty_reward(multi, reward_token, charlie):
tx = multi.getReward({"from": charlie})
assert "RewardPaid" not in tx.events
# Call from a user who is staked should receive the correct amount of tokens
def test_staked_token_value(multi, reward_token, base_token, alice, charlie, issue, chain):
amount = base_token.balanceOf(charlie)
reward_init_bal = reward_token.balanceOf(charlie)
base_token.approve(multi, amount, {"from": charlie})
multi.stake(amount, {"from": charlie})
assert base_token.balanceOf(charlie) == 0
assert multi.balanceOf(charlie) == amount
chain.mine(timedelta=60)
reward_per_token = multi.rewardPerToken(reward_token)
earned_calc = reward_per_token * amount // 10 ** 18
assert earned_calc == multi.earned(charlie, reward_token)
tx = multi.getReward({"from": charlie})
assert tx.events["RewardPaid"].values()[2] == earned_calc
assert reward_token.balanceOf(charlie) - reward_init_bal == earned_calc
# User at outset has no earnings
def test_fresh_user_no_earnings(multi, reward_token, charlie, issue):
assert multi.earned(charlie, reward_token) == 0
# User has no earnings after staking
def test_no_earnings_upon_staking(multi, reward_token, base_token, charlie, issue):
amount = base_token.balanceOf(charlie)
base_token.approve(multi, amount, {"from": charlie})
multi.stake(amount, {"from": charlie})
assert multi.earned(charlie, reward_token) == 0
# User has earnings after staking and waiting
def test_user_accrues_rewards(multi, reward_token, base_token, charlie, issue, chain):
amount = base_token.balanceOf(charlie)
base_token.approve(multi, amount, {"from": charlie})
multi.stake(amount, {"from": charlie})
chain.mine(timedelta=60)
period = (
multi.lastTimeRewardApplicable(reward_token)
- multi.rewardData(reward_token)["lastUpdateTime"]
)
calc_earn = period * (10 ** 18 / 60)
assert calc_earn * 0.99 <= multi.earned(charlie, reward_token) <= calc_earn * 1.01
# User has no earnings after withdrawing
def test_no_earnings_post_withdrawal(
multi, reward_token, slow_token, base_token, alice, charlie, issue, chain
):
amount = base_token.balanceOf(charlie)
base_token.approve(multi, amount, {"from": charlie})
multi.stake(amount, {"from": charlie})
chain.mine(timedelta=30)
assert multi.earned(charlie, reward_token) > 0
multi.getReward({"from": charlie})
multi.withdraw(multi.balanceOf(charlie), {"from": charlie})
chain.mine(timedelta=30)
assert multi.earned(charlie, reward_token) == 0
# Call from a user who is staked should receive the correct amount of tokens
# Also confirm earnings at various stages
def test_staked_tokens_multi_durations(
multi, reward_token, slow_token, base_token, alice, charlie, issue, chain
):
reward_init_bal = reward_token.balanceOf(charlie)
slow_init_bal = slow_token.balanceOf(charlie)
amount = base_token.balanceOf(charlie)
base_token.approve(multi, amount, {"from": charlie})
multi.stake(amount, {"from": charlie})
for i in range(1):
reward_init_bal = reward_token.balanceOf(charlie)
slow_init_bal = slow_token.balanceOf(charlie)
charlie_paid_reward = multi.userRewardPerTokenPaid(charlie, reward_token)
charlie_paid_slow = multi.userRewardPerTokenPaid(charlie, slow_token)
chain.mine(timedelta=30)
reward_per = multi.rewardPerToken(reward_token)
slow_per = multi.rewardPerToken(slow_token)
reward_calc = (amount * (reward_per - charlie_paid_reward)) // 10 ** 18
slow_calc = (amount * (slow_per - charlie_paid_slow)) // 10 ** 18
assert reward_calc == multi.earned(charlie, reward_token)
assert slow_calc == multi.earned(charlie, slow_token)
multi.getReward({"from": charlie})
# Reward may have changed in the second it takes to getReward
reward_per_act = multi.rewardPerToken(reward_token)
slow_per_act = multi.rewardPerToken(slow_token)
reward_calc_act = (amount * (reward_per_act - charlie_paid_reward)) // 10 ** 18
slow_calc_act = (amount * (slow_per_act - charlie_paid_slow)) // 10 ** 18
assert reward_token.balanceOf(charlie) - reward_init_bal == reward_calc_act
assert slow_token.balanceOf(charlie) - slow_init_bal == slow_calc_act
# A user that has withdrawn should still be able to claim their rewards
def test_withdrawn_user_can_claim(multi, slow_token, base_token, alice, charlie, issue, chain):
amount = base_token.balanceOf(charlie)
reward_init_bal = slow_token.balanceOf(charlie)
base_token.approve(multi, amount, {"from": charlie})
multi.stake(amount, {"from": charlie})
# Confirm charlie staked
assert base_token.balanceOf(charlie) == 0
assert multi.balanceOf(charlie) == amount
chain.mine(timedelta=60)
multi.withdraw(amount, {"from": charlie})
# Confirm Charlie withdrew as expected
reward_per_token = multi.rewardPerToken(slow_token)
earned_calc = reward_per_token * amount // 10 ** 18
assert multi.balanceOf(charlie) == 0
assert reward_per_token > 0
assert earned_calc == multi.earned(charlie, slow_token)
# Does Charlie still get rewarded?
tx = multi.getReward({"from": charlie})
for e in tx.events["RewardPaid"]:
if e["user"] == charlie and e["rewardsToken"] == slow_token:
token_log = e
assert token_log["reward"] == earned_calc
assert slow_token.balanceOf(charlie) - reward_init_bal == earned_calc
|
data = (
'ddwim', # 0x00
'ddwib', # 0x01
'ddwibs', # 0x02
'ddwis', # 0x03
'ddwiss', # 0x04
'ddwing', # 0x05
'ddwij', # 0x06
'ddwic', # 0x07
'ddwik', # 0x08
'ddwit', # 0x09
'ddwip', # 0x0a
'ddwih', # 0x0b
'ddyu', # 0x0c
'ddyug', # 0x0d
'ddyugg', # 0x0e
'ddyugs', # 0x0f
'ddyun', # 0x10
'ddyunj', # 0x11
'ddyunh', # 0x12
'ddyud', # 0x13
'ddyul', # 0x14
'ddyulg', # 0x15
'ddyulm', # 0x16
'ddyulb', # 0x17
'ddyuls', # 0x18
'ddyult', # 0x19
'ddyulp', # 0x1a
'ddyulh', # 0x1b
'ddyum', # 0x1c
'ddyub', # 0x1d
'ddyubs', # 0x1e
'ddyus', # 0x1f
'ddyuss', # 0x20
'ddyung', # 0x21
'ddyuj', # 0x22
'ddyuc', # 0x23
'ddyuk', # 0x24
'ddyut', # 0x25
'ddyup', # 0x26
'ddyuh', # 0x27
'ddeu', # 0x28
'ddeug', # 0x29
'ddeugg', # 0x2a
'ddeugs', # 0x2b
'ddeun', # 0x2c
'ddeunj', # 0x2d
'ddeunh', # 0x2e
'ddeud', # 0x2f
'ddeul', # 0x30
'ddeulg', # 0x31
'ddeulm', # 0x32
'ddeulb', # 0x33
'ddeuls', # 0x34
'ddeult', # 0x35
'ddeulp', # 0x36
'ddeulh', # 0x37
'ddeum', # 0x38
'ddeub', # 0x39
'ddeubs', # 0x3a
'ddeus', # 0x3b
'ddeuss', # 0x3c
'ddeung', # 0x3d
'ddeuj', # 0x3e
'ddeuc', # 0x3f
'ddeuk', # 0x40
'ddeut', # 0x41
'ddeup', # 0x42
'ddeuh', # 0x43
'ddyi', # 0x44
'ddyig', # 0x45
'ddyigg', # 0x46
'ddyigs', # 0x47
'ddyin', # 0x48
'ddyinj', # 0x49
'ddyinh', # 0x4a
'ddyid', # 0x4b
'ddyil', # 0x4c
'ddyilg', # 0x4d
'ddyilm', # 0x4e
'ddyilb', # 0x4f
'ddyils', # 0x50
'ddyilt', # 0x51
'ddyilp', # 0x52
'ddyilh', # 0x53
'ddyim', # 0x54
'ddyib', # 0x55
'ddyibs', # 0x56
'ddyis', # 0x57
'ddyiss', # 0x58
'ddying', # 0x59
'ddyij', # 0x5a
'ddyic', # 0x5b
'ddyik', # 0x5c
'ddyit', # 0x5d
'ddyip', # 0x5e
'ddyih', # 0x5f
'ddi', # 0x60
'ddig', # 0x61
'ddigg', # 0x62
'ddigs', # 0x63
'ddin', # 0x64
'ddinj', # 0x65
'ddinh', # 0x66
'ddid', # 0x67
'ddil', # 0x68
'ddilg', # 0x69
'ddilm', # 0x6a
'ddilb', # 0x6b
'ddils', # 0x6c
'ddilt', # 0x6d
'ddilp', # 0x6e
'ddilh', # 0x6f
'ddim', # 0x70
'ddib', # 0x71
'ddibs', # 0x72
'ddis', # 0x73
'ddiss', # 0x74
'dding', # 0x75
'ddij', # 0x76
'ddic', # 0x77
'ddik', # 0x78
'ddit', # 0x79
'ddip', # 0x7a
'ddih', # 0x7b
'ra', # 0x7c
'rag', # 0x7d
'ragg', # 0x7e
'rags', # 0x7f
'ran', # 0x80
'ranj', # 0x81
'ranh', # 0x82
'rad', # 0x83
'ral', # 0x84
'ralg', # 0x85
'ralm', # 0x86
'ralb', # 0x87
'rals', # 0x88
'ralt', # 0x89
'ralp', # 0x8a
'ralh', # 0x8b
'ram', # 0x8c
'rab', # 0x8d
'rabs', # 0x8e
'ras', # 0x8f
'rass', # 0x90
'rang', # 0x91
'raj', # 0x92
'rac', # 0x93
'rak', # 0x94
'rat', # 0x95
'rap', # 0x96
'rah', # 0x97
'rae', # 0x98
'raeg', # 0x99
'raegg', # 0x9a
'raegs', # 0x9b
'raen', # 0x9c
'raenj', # 0x9d
'raenh', # 0x9e
'raed', # 0x9f
'rael', # 0xa0
'raelg', # 0xa1
'raelm', # 0xa2
'raelb', # 0xa3
'raels', # 0xa4
'raelt', # 0xa5
'raelp', # 0xa6
'raelh', # 0xa7
'raem', # 0xa8
'raeb', # 0xa9
'raebs', # 0xaa
'raes', # 0xab
'raess', # 0xac
'raeng', # 0xad
'raej', # 0xae
'raec', # 0xaf
'raek', # 0xb0
'raet', # 0xb1
'raep', # 0xb2
'raeh', # 0xb3
'rya', # 0xb4
'ryag', # 0xb5
'ryagg', # 0xb6
'ryags', # 0xb7
'ryan', # 0xb8
'ryanj', # 0xb9
'ryanh', # 0xba
'ryad', # 0xbb
'ryal', # 0xbc
'ryalg', # 0xbd
'ryalm', # 0xbe
'ryalb', # 0xbf
'ryals', # 0xc0
'ryalt', # 0xc1
'ryalp', # 0xc2
'ryalh', # 0xc3
'ryam', # 0xc4
'ryab', # 0xc5
'ryabs', # 0xc6
'ryas', # 0xc7
'ryass', # 0xc8
'ryang', # 0xc9
'ryaj', # 0xca
'ryac', # 0xcb
'ryak', # 0xcc
'ryat', # 0xcd
'ryap', # 0xce
'ryah', # 0xcf
'ryae', # 0xd0
'ryaeg', # 0xd1
'ryaegg', # 0xd2
'ryaegs', # 0xd3
'ryaen', # 0xd4
'ryaenj', # 0xd5
'ryaenh', # 0xd6
'ryaed', # 0xd7
'ryael', # 0xd8
'ryaelg', # 0xd9
'ryaelm', # 0xda
'ryaelb', # 0xdb
'ryaels', # 0xdc
'ryaelt', # 0xdd
'ryaelp', # 0xde
'ryaelh', # 0xdf
'ryaem', # 0xe0
'ryaeb', # 0xe1
'ryaebs', # 0xe2
'ryaes', # 0xe3
'ryaess', # 0xe4
'ryaeng', # 0xe5
'ryaej', # 0xe6
'ryaec', # 0xe7
'ryaek', # 0xe8
'ryaet', # 0xe9
'ryaep', # 0xea
'ryaeh', # 0xeb
'reo', # 0xec
'reog', # 0xed
'reogg', # 0xee
'reogs', # 0xef
'reon', # 0xf0
'reonj', # 0xf1
'reonh', # 0xf2
'reod', # 0xf3
'reol', # 0xf4
'reolg', # 0xf5
'reolm', # 0xf6
'reolb', # 0xf7
'reols', # 0xf8
'reolt', # 0xf9
'reolp', # 0xfa
'reolh', # 0xfb
'reom', # 0xfc
'reob', # 0xfd
'reobs', # 0xfe
'reos', # 0xff
)
|
"""Static key/seed for keystream generation"""
ACP_STATIC_KEY = "5b6faf5d9d5b0e1351f2da1de7e8d673".decode("hex")
def generate_acp_keystream(length):
"""Get key used to encrypt the header key (and some message data?)
Args:
length (int): length of keystream to generate
Returns:
String of requested length
Note:
Keystream repeats every 256 bytes
"""
key = ""
key_idx = 0
while (key_idx < length):
key += chr((key_idx + 0x55 & 0xFF) ^ ord(ACP_STATIC_KEY[key_idx % len(ACP_STATIC_KEY)]))
key_idx += 1
return key
|
# Este es un módulo con funciones que saludan
def despedir():
print("Adiós, me estoy despidiendo desde la función despedir() del módulo despedidas")
class Despedida():
def __init__(self):
print("Adiós, me estoy despidiendo desde el __init__ de la clase Despedida") |
"""RCON exceptions."""
__all__ = ['InvalidPacketStructure', 'RequestIdMismatch', 'InvalidCredentials']
class InvalidPacketStructure(Exception):
"""Indicates an invalid packet structure."""
class RequestIdMismatch(Exception):
"""Indicates that the sent and received request IDs do not match."""
def __init__(self, sent, received):
"""Sets the sent and received request IDs."""
super().__init__(sent, received)
self.sent = sent
self.received = received
class InvalidCredentials(Exception):
"""Indicates invalid RCON password."""
|
def build_mx(n, m):
grid = []
for i in range(n):
grid.append([' '] * m)
return grid
def EMPTY_SHAPE():
return [[]]
class Shape(object):
_name = None
grid = EMPTY_SHAPE()
rotate_grid = []
def __init__(self, grid):
# align each row and column is same
n = len(grid)
m = max([len(row) for row in grid])
self.grid = build_mx(n, m)
for i, row in enumerate(grid):
for j, col in enumerate(row):
self.grid[i][j] = col
self.rotate_grid = [self.grid]
@property
def name(self):
if self._name is None:
for row in self.grid:
for col in row:
if col != ' ':
self._name = col
return col
return self._name
def all_shapes(self):
visited = {self}
yield self
for i in range(4):
out = Shape(self.rotate(i))
if out not in visited:
yield out
visited.add(out)
h_out = Shape(self.h_mirror())
if h_out not in visited:
yield h_out
visited.add(h_out)
for i in range(4):
out = Shape(h_out.rotate(i))
if out not in visited:
yield out
visited.add(out)
v_out = Shape(self.v_mirror())
if v_out not in visited:
yield v_out
visited.add(v_out)
for i in range(4):
out = Shape(v_out.rotate(i))
if out not in visited:
yield out
visited.add(out)
return
def rotate(self, tim=1):
if len(self.grid) == 0:
return EMPTY_SHAPE
tim = tim % 4
last_grid = self.rotate_grid[-1]
for t in range(len(self.rotate_grid), tim+1):
n, m = len(last_grid), len(last_grid[0])
new_grid = build_mx(m, n) # swap n and m
for i in range(n):
for j in range(m):
new_grid[m-j-1][i] = last_grid[i][j]
self.rotate_grid.append(new_grid)
last_grid = new_grid
return self.rotate_grid[tim]
def v_mirror(self):
if len(self.grid) == 0:
return [[]]
n, m = len(self.grid), len(self.grid[0])
new_grid = build_mx(n, m)
for i in range(n):
for j in range(m):
new_grid[i][j], new_grid[n-i-1][j] = self.grid[n-i-1][j], self.grid[i][j]
return new_grid
def h_mirror(self):
if len(self.grid) == 0:
return EMPTY_SHAPE()
n, m = len(self.grid), len(self.grid[0])
new_grid = build_mx(n, m)
for j in range(m):
for i in range(n):
new_grid[i][j], new_grid[i][m-j-1] = self.grid[i][m-j-1], self.grid[i][j]
return new_grid
def __str__(self) -> str:
return '\n'.join([''.join(row) for row in self.grid])
def __hash__(self) -> int:
return hash(self.__str__())
def __eq__(self, other):
if not isinstance(other, type(self)): return NotImplemented
return self.__str__() == other.__str__()
def __lt__(self, rhs):
return self.name < rhs.name
class ShapeAO(Shape):
def __init__(self):
grid = [
'AA',
'A',
'AA'
]
super().__init__(grid)
class ShapeG(Shape):
def __init__(self):
grid = [
'GGG',
'G',
'G'
]
super().__init__(grid)
class ShapeI(Shape):
def __init__(self):
grid = [
'IIII',
]
super().__init__(grid)
class ShapeL(Shape):
def __init__(self):
grid = [
'LLLL',
'L',
]
super().__init__(grid)
class Shapel(Shape):
def __init__(self):
grid = [
'lll',
'l',
]
super().__init__(grid)
class ShapeO(Shape):
def __init__(self):
grid = [
'O',
'OO',
'OO',
]
super().__init__(grid)
class ShapeS(Shape):
def __init__(self):
grid = [
' SS',
'SS',
]
super().__init__(grid)
class ShapeSS(Shape):
def __init__(self):
grid = [
' DD',
'DDD',
]
super().__init__(grid)
class ShapeT(Shape):
def __init__(self):
grid = [
'TTT',
' T',
' T',
]
super().__init__(grid)
class ShapeZ(Shape):
def __init__(self):
grid = [
' ZZ',
' Z',
'ZZ',
]
super().__init__(grid)
|
def test():
assert (
"from spacy.tokens import Doc" in __solution__
), "Importierst du die Klasse Doc?"
assert (
len(words) == 5
), "Es sieht so aus, als ob du eine falsche Anzahl an Wörtern hast."
assert (
len(spaces) == 5
), "Es sieht so aus, als ob du eine falsche Anzahl an Leerzeichen hast."
assert words == ["Was", ",", "echt", "?", "!"], "Schau dir nochmal die Wörter an!"
assert all(
isinstance(s, bool) for s in spaces
), "Die Leerzeichen-Werte müssen boolesche Werte sein."
assert [int(s) for s in spaces] == [0, 1, 0, 0, 0], "Sind die Leerzeichen korrekt?"
assert (
doc.text == "Was, echt?!"
), "Bist du dir sicher, dass du das Doc richtig erstellt hast?"
__msg__.good("Gut gemacht! Lass uns als nächstes ein paar Entitäten erstellen.")
|
def cal_average(num):
i = 0
for x in num:
i += x
avg = i / len(num)
return avg
cal_average([1,2,3,4]) |
preciocompu= float(input("Ingrese el valor del computador pago de contado:"))
valorcuotas= float (input("Ingrese el valor de las cuotas en caso de pagarlo a 12 cuotas:"))
pagofinalintereses=(valorcuotas*12)
print("Se pagaría:", str(pagofinalintereses), "por el computador")
cuotasininteres=(preciocompu/12)
print("El valor de cada cuota sin nungun interes sería de:", str(cuotasininteres))
diferencia=(valorcuotas-cuotasininteres)
porcentaje=((diferencia*100)/preciocompu)
print("El porcentaje de intereses por cuota es de:",str(porcentaje), "%") |
#!/use/bin/python3
__author__ = 'yangdd'
'''
example 024
'''
a = 2
b =1
total = 0.0
for i in range(1,21):
total += a/b
a,b=a+b,a
print(total)
|
#
# PySNMP MIB module RFC1285-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RFC1285-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:48:17 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")
ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, transmission, Counter32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, NotificationType, MibIdentifier, TimeTicks, Unsigned32, ModuleIdentity, Counter64, Integer32, Gauge32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "transmission", "Counter32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "NotificationType", "MibIdentifier", "TimeTicks", "Unsigned32", "ModuleIdentity", "Counter64", "Integer32", "Gauge32", "Bits")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
fddi = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15))
class FddiTime(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647)
class FddiResourceId(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535)
class FddiSMTStationIdType(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8)
fixedLength = 8
class FddiMACLongAddressType(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6)
fixedLength = 6
snmpFddiSMT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 1))
snmpFddiMAC = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 2))
snmpFddiPATH = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 3))
snmpFddiPORT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 4))
snmpFddiATTACHMENT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 5))
snmpFddiChipSets = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 6))
snmpFddiSMTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTNumber.setStatus('mandatory')
snmpFddiSMTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 1, 2), )
if mibBuilder.loadTexts: snmpFddiSMTTable.setStatus('mandatory')
snmpFddiSMTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1), ).setIndexNames((0, "RFC1285-MIB", "snmpFddiSMTIndex"))
if mibBuilder.loadTexts: snmpFddiSMTEntry.setStatus('mandatory')
snmpFddiSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTIndex.setStatus('mandatory')
snmpFddiSMTStationId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 2), FddiSMTStationIdType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTStationId.setStatus('mandatory')
snmpFddiSMTOpVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiSMTOpVersionId.setStatus('mandatory')
snmpFddiSMTHiVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTHiVersionId.setStatus('mandatory')
snmpFddiSMTLoVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTLoVersionId.setStatus('mandatory')
snmpFddiSMTMACCt = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTMACCt.setStatus('mandatory')
snmpFddiSMTNonMasterCt = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTNonMasterCt.setStatus('mandatory')
snmpFddiSMTMasterCt = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTMasterCt.setStatus('mandatory')
snmpFddiSMTPathsAvailable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTPathsAvailable.setStatus('mandatory')
snmpFddiSMTConfigCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTConfigCapabilities.setStatus('mandatory')
snmpFddiSMTConfigPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiSMTConfigPolicy.setStatus('mandatory')
snmpFddiSMTConnectionPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiSMTConnectionPolicy.setStatus('mandatory')
snmpFddiSMTTNotify = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 30))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiSMTTNotify.setStatus('mandatory')
snmpFddiSMTStatusReporting = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTStatusReporting.setStatus('mandatory')
snmpFddiSMTECMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("ec0", 1), ("ec1", 2), ("ec2", 3), ("ec3", 4), ("ec4", 5), ("ec5", 6), ("ec6", 7), ("ec7", 8)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTECMState.setStatus('mandatory')
snmpFddiSMTCFState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("cf0", 1), ("cf1", 2), ("cf2", 3), ("cf3", 4), ("cf4", 5), ("cf5", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTCFState.setStatus('mandatory')
snmpFddiSMTHoldState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("not-implemented", 1), ("not-holding", 2), ("holding-prm", 3), ("holding-sec", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTHoldState.setStatus('mandatory')
snmpFddiSMTRemoteDisconnectFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiSMTRemoteDisconnectFlag.setStatus('mandatory')
snmpFddiSMTStationAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 1, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("connect", 2), ("disconnect", 3), ("path-Test", 4), ("self-Test", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiSMTStationAction.setStatus('mandatory')
snmpFddiMACNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACNumber.setStatus('mandatory')
snmpFddiMACTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 2, 2), )
if mibBuilder.loadTexts: snmpFddiMACTable.setStatus('mandatory')
snmpFddiMACEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1), ).setIndexNames((0, "RFC1285-MIB", "snmpFddiMACSMTIndex"), (0, "RFC1285-MIB", "snmpFddiMACIndex"))
if mibBuilder.loadTexts: snmpFddiMACEntry.setStatus('mandatory')
snmpFddiMACSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACSMTIndex.setStatus('mandatory')
snmpFddiMACIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACIndex.setStatus('mandatory')
snmpFddiMACFrameStatusCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1799))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACFrameStatusCapabilities.setStatus('mandatory')
snmpFddiMACTMaxGreatestLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 4), FddiTime()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiMACTMaxGreatestLowerBound.setStatus('mandatory')
snmpFddiMACTVXGreatestLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 5), FddiTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACTVXGreatestLowerBound.setStatus('mandatory')
snmpFddiMACPathsAvailable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACPathsAvailable.setStatus('mandatory')
snmpFddiMACCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16))).clone(namedValues=NamedValues(("unknown", 1), ("primary", 2), ("secondary", 4), ("local", 8), ("isolated", 16)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACCurrentPath.setStatus('mandatory')
snmpFddiMACUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 8), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACUpstreamNbr.setStatus('mandatory')
snmpFddiMACOldUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 9), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACOldUpstreamNbr.setStatus('mandatory')
snmpFddiMACDupAddrTest = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("pass", 2), ("fail", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACDupAddrTest.setStatus('mandatory')
snmpFddiMACPathsRequested = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 11), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiMACPathsRequested.setStatus('mandatory')
snmpFddiMACDownstreamPORTType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("unknown", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACDownstreamPORTType.setStatus('mandatory')
snmpFddiMACSMTAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 13), FddiMACLongAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACSMTAddress.setStatus('mandatory')
snmpFddiMACTReq = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 14), FddiTime()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiMACTReq.setStatus('mandatory')
snmpFddiMACTNeg = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 15), FddiTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACTNeg.setStatus('mandatory')
snmpFddiMACTMax = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 16), FddiTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACTMax.setStatus('mandatory')
snmpFddiMACTvxValue = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 17), FddiTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACTvxValue.setStatus('mandatory')
snmpFddiMACTMin = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 18), FddiTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACTMin.setStatus('mandatory')
snmpFddiMACCurrentFrameStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiMACCurrentFrameStatus.setStatus('mandatory')
snmpFddiMACFrameCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 20), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACFrameCts.setStatus('mandatory')
snmpFddiMACErrorCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 21), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACErrorCts.setStatus('mandatory')
snmpFddiMACLostCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 22), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACLostCts.setStatus('mandatory')
snmpFddiMACFrameErrorThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACFrameErrorThreshold.setStatus('mandatory')
snmpFddiMACFrameErrorRatio = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACFrameErrorRatio.setStatus('mandatory')
snmpFddiMACRMTState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("rm0", 1), ("rm1", 2), ("rm2", 3), ("rm3", 4), ("rm4", 5), ("rm5", 6), ("rm6", 7), ("rm7", 8)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACRMTState.setStatus('mandatory')
snmpFddiMACDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACDaFlag.setStatus('mandatory')
snmpFddiMACUnaDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACUnaDaFlag.setStatus('mandatory')
snmpFddiMACFrameCondition = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACFrameCondition.setStatus('mandatory')
snmpFddiMACChipSet = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 29), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiMACChipSet.setStatus('mandatory')
snmpFddiMACAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 2, 2, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("enableLLCService", 2), ("disableLLCService", 3), ("connectMAC", 4), ("disconnectMAC", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiMACAction.setStatus('mandatory')
snmpFddiPORTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTNumber.setStatus('mandatory')
snmpFddiPORTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 4, 2), )
if mibBuilder.loadTexts: snmpFddiPORTTable.setStatus('mandatory')
snmpFddiPORTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1), ).setIndexNames((0, "RFC1285-MIB", "snmpFddiPORTSMTIndex"), (0, "RFC1285-MIB", "snmpFddiPORTIndex"))
if mibBuilder.loadTexts: snmpFddiPORTEntry.setStatus('mandatory')
snmpFddiPORTSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTSMTIndex.setStatus('mandatory')
snmpFddiPORTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTIndex.setStatus('mandatory')
snmpFddiPORTPCType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTPCType.setStatus('mandatory')
snmpFddiPORTPCNeighbor = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("unknown", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTPCNeighbor.setStatus('mandatory')
snmpFddiPORTConnectionPolicies = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiPORTConnectionPolicies.setStatus('mandatory')
snmpFddiPORTRemoteMACIndicated = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTRemoteMACIndicated.setStatus('mandatory')
snmpFddiPORTCEState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("ce0", 1), ("ce1", 2), ("ce2", 3), ("ce3", 4), ("ce4", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTCEState.setStatus('mandatory')
snmpFddiPORTPathsRequested = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiPORTPathsRequested.setStatus('mandatory')
snmpFddiPORTMACPlacement = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 9), FddiResourceId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTMACPlacement.setStatus('mandatory')
snmpFddiPORTAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTAvailablePaths.setStatus('mandatory')
snmpFddiPORTMACLoopTime = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 11), FddiTime()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiPORTMACLoopTime.setStatus('mandatory')
snmpFddiPORTTBMax = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 12), FddiTime()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiPORTTBMax.setStatus('mandatory')
snmpFddiPORTBSFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTBSFlag.setStatus('mandatory')
snmpFddiPORTLCTFailCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTLCTFailCts.setStatus('mandatory')
snmpFddiPORTLerEstimate = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 15))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTLerEstimate.setStatus('mandatory')
snmpFddiPORTLemRejectCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 16), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTLemRejectCts.setStatus('mandatory')
snmpFddiPORTLemCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 17), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTLemCts.setStatus('mandatory')
snmpFddiPORTLerCutoff = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiPORTLerCutoff.setStatus('mandatory')
snmpFddiPORTLerAlarm = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 15))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiPORTLerAlarm.setStatus('mandatory')
snmpFddiPORTConnectState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("disabled", 1), ("connecting", 2), ("standby", 3), ("active", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTConnectState.setStatus('mandatory')
snmpFddiPORTPCMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("pc0", 1), ("pc1", 2), ("pc2", 3), ("pc3", 4), ("pc4", 5), ("pc5", 6), ("pc6", 7), ("pc7", 8), ("pc8", 9), ("pc9", 10)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTPCMState.setStatus('mandatory')
snmpFddiPORTPCWithhold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("m-m", 2), ("other", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTPCWithhold.setStatus('mandatory')
snmpFddiPORTLerCondition = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTLerCondition.setStatus('mandatory')
snmpFddiPORTChipSet = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 24), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiPORTChipSet.setStatus('mandatory')
snmpFddiPORTAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 4, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("other", 1), ("maintPORT", 2), ("enablePORT", 3), ("disablePORT", 4), ("startPORT", 5), ("stopPORT", 6)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiPORTAction.setStatus('mandatory')
snmpFddiATTACHMENTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiATTACHMENTNumber.setStatus('mandatory')
snmpFddiATTACHMENTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 5, 2), )
if mibBuilder.loadTexts: snmpFddiATTACHMENTTable.setStatus('mandatory')
snmpFddiATTACHMENTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1), ).setIndexNames((0, "RFC1285-MIB", "snmpFddiATTACHMENTSMTIndex"), (0, "RFC1285-MIB", "snmpFddiATTACHMENTIndex"))
if mibBuilder.loadTexts: snmpFddiATTACHMENTEntry.setStatus('mandatory')
snmpFddiATTACHMENTSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiATTACHMENTSMTIndex.setStatus('mandatory')
snmpFddiATTACHMENTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiATTACHMENTIndex.setStatus('mandatory')
snmpFddiATTACHMENTClass = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("single-attachment", 1), ("dual-attachment", 2), ("concentrator", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiATTACHMENTClass.setStatus('mandatory')
snmpFddiATTACHMENTOpticalBypassPresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiATTACHMENTOpticalBypassPresent.setStatus('mandatory')
snmpFddiATTACHMENTIMaxExpiration = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1, 5), FddiTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiATTACHMENTIMaxExpiration.setStatus('mandatory')
snmpFddiATTACHMENTInsertedStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("unimplemented", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: snmpFddiATTACHMENTInsertedStatus.setStatus('mandatory')
snmpFddiATTACHMENTInsertPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 5, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("unimplemented", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: snmpFddiATTACHMENTInsertPolicy.setStatus('mandatory')
snmpFddiPHYChipSets = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 6, 1))
snmpFddiMACChipSets = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 6, 2))
snmpFddiPHYMACChipSets = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 6, 3))
mibBuilder.exportSymbols("RFC1285-MIB", snmpFddiMACTvxValue=snmpFddiMACTvxValue, FddiSMTStationIdType=FddiSMTStationIdType, snmpFddiSMTCFState=snmpFddiSMTCFState, snmpFddiSMTNumber=snmpFddiSMTNumber, snmpFddiPORTSMTIndex=snmpFddiPORTSMTIndex, snmpFddiPORTBSFlag=snmpFddiPORTBSFlag, snmpFddiMACAction=snmpFddiMACAction, snmpFddiPATH=snmpFddiPATH, snmpFddiPORTNumber=snmpFddiPORTNumber, snmpFddiMACLostCts=snmpFddiMACLostCts, snmpFddiPORTChipSet=snmpFddiPORTChipSet, snmpFddiPORTPCType=snmpFddiPORTPCType, snmpFddiPORTIndex=snmpFddiPORTIndex, snmpFddiSMTStationId=snmpFddiSMTStationId, snmpFddiPORTLerAlarm=snmpFddiPORTLerAlarm, snmpFddiSMTLoVersionId=snmpFddiSMTLoVersionId, snmpFddiPORTRemoteMACIndicated=snmpFddiPORTRemoteMACIndicated, snmpFddiPORTPathsRequested=snmpFddiPORTPathsRequested, snmpFddiMACFrameCondition=snmpFddiMACFrameCondition, snmpFddiPORTConnectionPolicies=snmpFddiPORTConnectionPolicies, snmpFddiPORTTBMax=snmpFddiPORTTBMax, snmpFddiSMTTable=snmpFddiSMTTable, snmpFddiPORTAvailablePaths=snmpFddiPORTAvailablePaths, fddi=fddi, snmpFddiPORTPCWithhold=snmpFddiPORTPCWithhold, snmpFddiPORTPCMState=snmpFddiPORTPCMState, FddiResourceId=FddiResourceId, snmpFddiPORTLerCondition=snmpFddiPORTLerCondition, snmpFddiSMTIndex=snmpFddiSMTIndex, snmpFddiMACSMTAddress=snmpFddiMACSMTAddress, snmpFddiATTACHMENTInsertPolicy=snmpFddiATTACHMENTInsertPolicy, snmpFddiATTACHMENTSMTIndex=snmpFddiATTACHMENTSMTIndex, snmpFddiMACSMTIndex=snmpFddiMACSMTIndex, snmpFddiMACTMax=snmpFddiMACTMax, snmpFddiPHYMACChipSets=snmpFddiPHYMACChipSets, snmpFddiSMT=snmpFddiSMT, snmpFddiMACTVXGreatestLowerBound=snmpFddiMACTVXGreatestLowerBound, snmpFddiATTACHMENT=snmpFddiATTACHMENT, FddiTime=FddiTime, snmpFddiSMTConnectionPolicy=snmpFddiSMTConnectionPolicy, snmpFddiMACOldUpstreamNbr=snmpFddiMACOldUpstreamNbr, snmpFddiMACUnaDaFlag=snmpFddiMACUnaDaFlag, snmpFddiSMTTNotify=snmpFddiSMTTNotify, FddiMACLongAddressType=FddiMACLongAddressType, snmpFddiMACFrameStatusCapabilities=snmpFddiMACFrameStatusCapabilities, snmpFddiATTACHMENTTable=snmpFddiATTACHMENTTable, snmpFddiSMTEntry=snmpFddiSMTEntry, snmpFddiPORT=snmpFddiPORT, snmpFddiSMTMasterCt=snmpFddiSMTMasterCt, snmpFddiMACUpstreamNbr=snmpFddiMACUpstreamNbr, snmpFddiPORTLerCutoff=snmpFddiPORTLerCutoff, snmpFddiMACCurrentPath=snmpFddiMACCurrentPath, snmpFddiMACErrorCts=snmpFddiMACErrorCts, snmpFddiMACChipSet=snmpFddiMACChipSet, snmpFddiSMTStatusReporting=snmpFddiSMTStatusReporting, snmpFddiMACIndex=snmpFddiMACIndex, snmpFddiATTACHMENTIMaxExpiration=snmpFddiATTACHMENTIMaxExpiration, snmpFddiSMTPathsAvailable=snmpFddiSMTPathsAvailable, snmpFddiATTACHMENTNumber=snmpFddiATTACHMENTNumber, snmpFddiMACRMTState=snmpFddiMACRMTState, snmpFddiPORTAction=snmpFddiPORTAction, snmpFddiMACFrameErrorRatio=snmpFddiMACFrameErrorRatio, snmpFddiSMTConfigCapabilities=snmpFddiSMTConfigCapabilities, snmpFddiPORTConnectState=snmpFddiPORTConnectState, snmpFddiMACDownstreamPORTType=snmpFddiMACDownstreamPORTType, snmpFddiPHYChipSets=snmpFddiPHYChipSets, snmpFddiPORTLemRejectCts=snmpFddiPORTLemRejectCts, snmpFddiSMTOpVersionId=snmpFddiSMTOpVersionId, snmpFddiMACChipSets=snmpFddiMACChipSets, snmpFddiPORTTable=snmpFddiPORTTable, snmpFddiPORTLemCts=snmpFddiPORTLemCts, snmpFddiMACPathsRequested=snmpFddiMACPathsRequested, snmpFddiMACFrameCts=snmpFddiMACFrameCts, snmpFddiSMTECMState=snmpFddiSMTECMState, snmpFddiMACDupAddrTest=snmpFddiMACDupAddrTest, snmpFddiMACTNeg=snmpFddiMACTNeg, snmpFddiMACDaFlag=snmpFddiMACDaFlag, snmpFddiATTACHMENTClass=snmpFddiATTACHMENTClass, snmpFddiMACPathsAvailable=snmpFddiMACPathsAvailable, snmpFddiSMTMACCt=snmpFddiSMTMACCt, snmpFddiATTACHMENTEntry=snmpFddiATTACHMENTEntry, snmpFddiMACTReq=snmpFddiMACTReq, snmpFddiPORTLerEstimate=snmpFddiPORTLerEstimate, snmpFddiMACFrameErrorThreshold=snmpFddiMACFrameErrorThreshold, snmpFddiPORTPCNeighbor=snmpFddiPORTPCNeighbor, snmpFddiMACTMin=snmpFddiMACTMin, snmpFddiMACNumber=snmpFddiMACNumber, snmpFddiPORTLCTFailCts=snmpFddiPORTLCTFailCts, snmpFddiChipSets=snmpFddiChipSets, snmpFddiPORTEntry=snmpFddiPORTEntry, snmpFddiMACTMaxGreatestLowerBound=snmpFddiMACTMaxGreatestLowerBound, snmpFddiMACTable=snmpFddiMACTable, snmpFddiMAC=snmpFddiMAC, snmpFddiSMTNonMasterCt=snmpFddiSMTNonMasterCt, snmpFddiSMTRemoteDisconnectFlag=snmpFddiSMTRemoteDisconnectFlag, snmpFddiPORTMACLoopTime=snmpFddiPORTMACLoopTime, snmpFddiSMTHiVersionId=snmpFddiSMTHiVersionId, snmpFddiSMTHoldState=snmpFddiSMTHoldState, snmpFddiSMTStationAction=snmpFddiSMTStationAction, snmpFddiATTACHMENTOpticalBypassPresent=snmpFddiATTACHMENTOpticalBypassPresent, snmpFddiMACEntry=snmpFddiMACEntry, snmpFddiPORTMACPlacement=snmpFddiPORTMACPlacement, snmpFddiATTACHMENTInsertedStatus=snmpFddiATTACHMENTInsertedStatus, snmpFddiATTACHMENTIndex=snmpFddiATTACHMENTIndex, snmpFddiSMTConfigPolicy=snmpFddiSMTConfigPolicy, snmpFddiPORTCEState=snmpFddiPORTCEState, snmpFddiMACCurrentFrameStatus=snmpFddiMACCurrentFrameStatus)
|
grey_image = np.mean(image, axis=-1)
print("Shape: {}".format(grey_image.shape))
print("Type: {}".format(grey_image.dtype))
print("image size: {:0.3} MB".format(grey_image.nbytes / 1e6))
print("Min: {}; Max: {}".format(grey_image.min(), grey_image.max()))
plt.imshow(grey_image, cmap=plt.cm.Greys_r)
|
def start_HotSpot(ssid="Hovercraft",encrypted=False,passd="1234",iface="wlan0"):
print("HotSpot %s encrypt %s with Pass %s on Interface %s",ssid,encrypted,passd,iface)
def stop_HotSpot():
print("HotSpot stopped")
|
'''
Autor: Pedro Augusto
Objetivo: implemente um programa em Python que recebe um número real e informe se é igual a zero,
número positivo ou negativo.
Nível Básico
'''
def propsNum(var1):
if var1 == 0: return "O valor dado é igual a 0!"
elif var1 > 0: return str(var1)+" é positivo!"
else: return str(var1) + " é negativo!"
print(propsNum(-56.3)) |
n = int(input())
left_side = 0
right_side = 0
for i in range(n):
num = int(input())
left_side += num
for i in range(n):
num = int(input())
right_side += num
if left_side == right_side:
print(f"Yes, sum = {left_side}")
else:
print(f"No, diff = {abs(left_side - right_side)}")
|
#
# PySNMP MIB module CTRON-PRIORITY-CLASSIFY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CTRON-PRIORITY-CLASSIFY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:30:31 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
ctPriorityExt, = mibBuilder.importSymbols("CTRON-MIB-NAMES", "ctPriorityExt")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
iso, IpAddress, Counter64, Bits, MibIdentifier, NotificationType, ModuleIdentity, Integer32, ObjectIdentity, Unsigned32, Gauge32, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "IpAddress", "Counter64", "Bits", "MibIdentifier", "NotificationType", "ModuleIdentity", "Integer32", "ObjectIdentity", "Unsigned32", "Gauge32", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks")
RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention")
ctPriClassify = ModuleIdentity((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6))
if mibBuilder.loadTexts: ctPriClassify.setLastUpdated('200203121855Z')
if mibBuilder.loadTexts: ctPriClassify.setOrganization('Cabletron Systems, Inc')
if mibBuilder.loadTexts: ctPriClassify.setContactInfo(' Cabletron Systems, Inc. Postal: 35 Industrial Way, P.O. Box 5005 Rochester, NH 03867-0505 Phone: (603) 332-9400 Email: support@cabletron.com Web: http://www.cabletron.com')
if mibBuilder.loadTexts: ctPriClassify.setDescription('The Cabletron Priority Classify MIB module for controlling Cabletron specific priority classification criteria based on packet content.')
ctPriClassifyObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1))
class CtPriClassifyType(TextualConvention, Integer32):
description = 'Each enumerated value represents a unique classification type. Different types have different rules regarding how data is interpreted during classification. These rules are spelled out in the comments preceding each type.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25))
namedValues = NamedValues(("etherType", 1), ("llcDsapSsap", 2), ("ipTypeOfService", 3), ("ipProtocolType", 4), ("ipxClassOfService", 5), ("ipxPacketType", 6), ("ipAddressSource", 7), ("ipAddressDestination", 8), ("ipAddressBilateral", 9), ("ipxNetworkSource", 10), ("ipxNetworkDestination", 11), ("ipxNetworkBilateral", 12), ("ipUdpPortSource", 13), ("ipUdpPortDestination", 14), ("ipUdpPortBilateral", 15), ("ipTcpPortSource", 16), ("ipTcpPortDestination", 17), ("ipTcpPortBilateral", 18), ("ipxSocketSource", 19), ("ipxSocketDestination", 20), ("ipxSocketBilateral", 21), ("macAddressSource", 22), ("macAddressDestination", 23), ("macAddressBilateral", 24), ("ipFragments", 25))
class PortList(TextualConvention, OctetString):
description = "Each octet within this value specifies a set of eight ports, with the first octet specifying ports 1 through 8, the second octet specifying ports 9 through 16, etc. Within each octet, the most significant bit represents the lowest numbered port, and the least significant bit represents the highest numbered port. Thus, each port of the bridge is represented by a single bit within the value of this object. If that bit has a value of '1' then that port is included in the set of ports; the port is not included if its bit has a value of '0'."
status = 'current'
ctPriClassifyStatus = MibScalar((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctPriClassifyStatus.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyStatus.setDescription('Allows the Priority Classification feature to be globally enabled/disabled. A value of disable(2), functionally supersedes the RowStatus of individual entries in the ctPriClassifyTable, but does not change their actual RowStatus value.')
ctPriClassifyMaxEntries = MibScalar((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctPriClassifyMaxEntries.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyMaxEntries.setDescription('The maximum number of entries allowed in the ctPriClassifyTable.')
ctPriClassifyNumEntries = MibScalar((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctPriClassifyNumEntries.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyNumEntries.setDescription('The current number of entries in the ctPriClassifyTable.')
ctPriClassifyTable = MibTable((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4), )
if mibBuilder.loadTexts: ctPriClassifyTable.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyTable.setDescription('A table containing configuration information for each Priority classification configured into the device by (local or network) management. All entries are permanent and will be restored after the device is reset.')
ctPriClassifyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1), ).setIndexNames((0, "CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyPriority"), (0, "CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyDataMeaning"), (0, "CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyDataVal"), (0, "CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyDataMask"))
if mibBuilder.loadTexts: ctPriClassifyEntry.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyEntry.setDescription('Describes a particular entry of ctPriClassifyTable.')
ctPriClassifyPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7)))
if mibBuilder.loadTexts: ctPriClassifyPriority.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyPriority.setDescription('The priority for this entry. Any packet meeting the classification criteria specified by this conceptual row will be given the priority indicated by this object.')
ctPriClassifyDataMeaning = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 2), CtPriClassifyType())
if mibBuilder.loadTexts: ctPriClassifyDataMeaning.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyDataMeaning.setDescription('The meaning of the ctPriClassifyDataVal leaf for this conceptual row. The ctPriClassifyDataVal specifies a particular value which, when compared to packet data, is used to classify that packet to a particular priority. The part of the packet (if any), to which this data comparison applies, is determined by this object. For example, the value ipAddressBilateral(8) means that the value ctPriClassifyDataVal for this entry is an IP address. It further means that the given IP address will be compared against both source and destination IP address fields in a packet. Such an entry obviously would not not match against any non-IP packets. Additionally, the value of this leaf will impose certain implicit ranges and interpretations of data contained within the ctPriClassifyDataVal leaf for this entry. The specific limitations of each type should be spelled out in the comments for that type.')
ctPriClassifyDataVal = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 3), Unsigned32())
if mibBuilder.loadTexts: ctPriClassifyDataVal.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyDataVal.setDescription('The data value associated with ctPriClassifyDataMeaning. The explicit range of this value is any unsigned 32-bit integer(0..4294967295). This range may vary, however, depending upon the value of ctPriClassifyDataMeaning. Illegal values should not be allowed.')
ctPriClassifyDataMask = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 4), Unsigned32())
if mibBuilder.loadTexts: ctPriClassifyDataMask.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyDataMask.setDescription("This object is the one's complement of a 32-bit mask. This mask is applicable to the data comparison of ctPriClassifyDataVal. The mask is applied to the actual packet data under consideration through a logical bitwise AND operation. This result is then compared to the data. For example, we want to classify according to a bilateral IP address of 134.141.0.0 with a mask of 255.255.240.0. This would be reflected by the following values: ctPriClassifyDataMeaning: ipAddressBilateral(8) ctPriClassifyDataVal: 0x868d0000 ctPriClassifyDataMask: 0x00000fff Again there are contextual implications for this leaf depending upon the value of ctPriClassifyDataMeaning. Not all types will use the mask, and others will impose restrictions. This value should however be a true indication of the masking operation. In other words, data types that don't use a mask should only allow a value of zero, indicating that all data bits are significant in the comparison. The specific restrictions of each type should be spelled out in the comments for that type. Illegal values should not be allowed.")
ctPriClassifyIngressList = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 5), PortList().clone(hexValue="0000")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctPriClassifyIngressList.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyIngressList.setDescription('The set of ports on which this classification rule applies. Classification occurs on ingress. An agent implementation should allow a set operation of this object to create a row if it does not exist.')
ctPriClassifyRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctPriClassifyRowStatus.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyRowStatus.setDescription("This object provides both control and status for the associated conceptual row in the table. Rows can be created in two ways. createAndGo - The specified row will be created and activated if the instance is allowable. If not, an inconsistentValue exception will be returned and the row will not be created. This provides the most optimal method of creating an active row, but provides the user no explanation if the row cannot be created. createAndWait - The specified row will be created and put in the notInService state if the instance is allowable. A subsequent activation of this row will bring it into the active state. If the instance is not allowable, the row will be created and put in the notReady state. A subsequent activation of this row will fail. Since the inappropriate information is always contained in the indexing leaves, activation will never succeed and the row should be removed by the management station. When a row is in the notReady state, the ctPriClassifyRowInfo may be retrieved to obtain a plain English explanation of why this row cannot be activated. createAndWait is the preferred method for this reason. Both methods described above leave ctPriClassifyIngressList in it's default state, requiring an additional set operation in order to modify it. An even more optimal twist on the createAndWait method is to set the ctPriClassifyIngressList to it's desired value as a method for row creation. This will essentially cause an implicit createAndWait since it too will leave the row in either the notInService or notReady state. This leaves only activation or error analysis as the last step. Any rows left in the notReady or notInService state for more than 5 minutes should be automatically removed by the agent implementation.")
ctPriClassifyRowInfo = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctPriClassifyRowInfo.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyRowInfo.setDescription("This object provides info about this row in the form of an ASCII string, suitable for display purposes. The intended purpose of this object is to provide an 'agent-specific' explanation as to why the ctPriClassifyRowStatus for this conceptual row is in the 'notReady' state. A management station should read this object and display it to the user in this case. A conceptual row that does not fall into this category may simply return a single NULL, but may also provide any useful info of its choice. A management station may attempt to display such info if it so chooses, but is under no burden to do so.")
ctPriClassifyTOSStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctPriClassifyTOSStatus.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyTOSStatus.setDescription('This object indicates whether an IP Type Of Service (TOS) value, defined by ctPriClassifyTOSValue, should be written into the TOS field of the IP header for any packet matching the classification specified by this conceptual row. This object may be set to enable only for the conceptual rows whose ctPriClassifyDataMeaning and ctPriClassifyDataVal have the following values: ctPriClassifyDataMeaning ctPriClassifyDataVal ------------------------ -------------------- etherType(1) 0x0800 (IP) llcDsapSsap(2) 0x0606 (IP) ipTypeOfService(3) any ipProtocolType(4) any ipAddressSource(7) any ipAddressDestination(8) any ipAddressBilateral(9) any ipUdpPortSource(13) any ipUdpPortDestination(14) any ipUdpPortBilateral(15) any ipTdpPortSource(16) any ipTdpPortDestination(17) any ipTdpPortBilateral(18) any ipFrag(25) not applicable A conceptual row that does not fall into these categories may be set to disable(2) and will return disable(2).')
ctPriClassifyTOSValue = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 4, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctPriClassifyTOSValue.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyTOSValue.setDescription('The value to be written into the IP TOS field of the IP header of any packet that matches the classification specified by the conceptual row.')
ctPriClassifyAbilityTable = MibTable((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 5), )
if mibBuilder.loadTexts: ctPriClassifyAbilityTable.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyAbilityTable.setDescription('A table containing information for each of the priority classification types. Types for which there is no corresponding row are not supported by this device.')
ctPriClassifyAbilityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 5, 1), ).setIndexNames((0, "CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyAbility"))
if mibBuilder.loadTexts: ctPriClassifyAbilityEntry.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyAbilityEntry.setDescription('Describes a particular entry of ctPriClassifyAbilityTable.')
ctPriClassifyAbility = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 5, 1, 1), CtPriClassifyType())
if mibBuilder.loadTexts: ctPriClassifyAbility.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyAbility.setDescription('The priority classification type associated with this entry.')
ctPriClassifyPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 5, 1, 2), PortList()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctPriClassifyPorts.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyPorts.setDescription('The set of ports on which the classification type specified by ctPriClassifyAbility is supported.')
ctPriClassifyTableLastChange = MibScalar((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 1, 6), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctPriClassifyTableLastChange.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyTableLastChange.setDescription('Indicates the sysUpTime at which the last change was made to the ctPriClassifyTable.')
ctPriClassifyConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 2))
ctPriClassifyGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 2, 1))
ctPriClassifyCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 2, 2))
ctPriClassifyBaseGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 2, 1, 1)).setObjects(("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyStatus"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyMaxEntries"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyNumEntries"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyIngressList"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyRowStatus"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyRowInfo"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyTOSStatus"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyTOSValue"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyPorts"), ("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyTableLastChange"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctPriClassifyBaseGroup = ctPriClassifyBaseGroup.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyBaseGroup.setDescription('A collection of objects providing device level control and status information for Priority classification.')
ctPriClassifyCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 52, 4, 1, 2, 14, 6, 2, 2, 1)).setObjects(("CTRON-PRIORITY-CLASSIFY-MIB", "ctPriClassifyBaseGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctPriClassifyCompliance = ctPriClassifyCompliance.setStatus('current')
if mibBuilder.loadTexts: ctPriClassifyCompliance.setDescription('The compliance statement for devices that support Priority classification.')
mibBuilder.exportSymbols("CTRON-PRIORITY-CLASSIFY-MIB", ctPriClassifyTOSValue=ctPriClassifyTOSValue, ctPriClassify=ctPriClassify, ctPriClassifyRowStatus=ctPriClassifyRowStatus, ctPriClassifyAbilityTable=ctPriClassifyAbilityTable, PortList=PortList, ctPriClassifyRowInfo=ctPriClassifyRowInfo, ctPriClassifyCompliances=ctPriClassifyCompliances, ctPriClassifyBaseGroup=ctPriClassifyBaseGroup, ctPriClassifyEntry=ctPriClassifyEntry, ctPriClassifyMaxEntries=ctPriClassifyMaxEntries, ctPriClassifyPorts=ctPriClassifyPorts, CtPriClassifyType=CtPriClassifyType, ctPriClassifyStatus=ctPriClassifyStatus, ctPriClassifyTableLastChange=ctPriClassifyTableLastChange, ctPriClassifyDataVal=ctPriClassifyDataVal, ctPriClassifyIngressList=ctPriClassifyIngressList, ctPriClassifyDataMeaning=ctPriClassifyDataMeaning, ctPriClassifyPriority=ctPriClassifyPriority, ctPriClassifyGroups=ctPriClassifyGroups, PYSNMP_MODULE_ID=ctPriClassify, ctPriClassifyDataMask=ctPriClassifyDataMask, ctPriClassifyAbilityEntry=ctPriClassifyAbilityEntry, ctPriClassifyAbility=ctPriClassifyAbility, ctPriClassifyTable=ctPriClassifyTable, ctPriClassifyTOSStatus=ctPriClassifyTOSStatus, ctPriClassifyConformance=ctPriClassifyConformance, ctPriClassifyCompliance=ctPriClassifyCompliance, ctPriClassifyObjects=ctPriClassifyObjects, ctPriClassifyNumEntries=ctPriClassifyNumEntries)
|
DESCRIPTION = "switch to a different module"
def autocomplete(shell, line, text, state):
# todo: make this show shorter paths at a time
# should never go this big...
if len(line.split()) > 2 and line.split()[0] != "set":
return None
options = [x + " " for x in shell.plugins if x.startswith(text)]
try:
return options[state]
except:
return None
def help(shell):
pass
def execute(shell, cmd):
splitted = cmd.split()
if len(splitted) > 1:
module = splitted[1]
if module not in shell.plugins:
shell.print_error("No module named %s" % (module))
return
shell.previous = shell.state
shell.state = module
|
# test builtin issubclass
class A:
pass
print(issubclass(A, A))
print(issubclass(A, (A,)))
try:
issubclass(A, 1)
except TypeError:
print('TypeError')
try:
issubclass('a', 1)
except TypeError:
print('TypeError')
|
def install(job):
prefab = job.service.executor.prefab
# For now we download FS from there. when we have proper VM image it will be installed already
if not prefab.core.command_check('fs'):
prefab.core.dir_ensure('$BINDIR')
prefab.core.file_download('https://stor.jumpscale.org/public/fs', '$BINDIR/fs')
prefab.core.file_attribs('$BINDIR/fs', '0550')
def start(job):
prefab = job.service.executor.prefab
service = job.service
actor = service.aysrepo.actorGet(name=service.model.dbobj.actorName)
prefab.core.dir_ensure('$JSCFGDIR/fs/flists')
for flist in actor.model.dbobj.flists:
args = {}
args['flist_path'] = prefab.core.replace('$JSCFGDIR/fs/flists/%s' % flist.name)
prefab.core.file_write(args['flist_path'], flist.content)
args['mountpoint'] = flist.mountpoint
args['mode'] = flist.mode.__str__().upper()
args['namespace'] = flist.namespace
args['store_url'] = flist.storeUrl
prefab.core.dir_ensure(args['mountpoint'])
config = """
[[mount]]
path="{mountpoint}"
flist="{flist_path}"
backend="main"
mode = "{mode}"
trim_base = true
[backend.main]
path="/storage/fs_backend"
stor="stor1"
namespace="{namespace}"
upload=false
encrypted=false
# encrypted=true
# user_rsa="user.rsa"
# store_rsa="store.rsa"
aydostor_push_cron="@every 1m"
cleanup_cron="@every 1m"
cleanup_older_than=1 #in hours
[aydostor.stor1]
addr="{store_url}"
""".format(**args)
config_path = prefab.core.replace('$JSCFGDIR/fs/%s.toml' % flist.name)
prefab.core.file_write(config_path, config)
pm = prefab.processmanager.get('tmux')
cmd = '$BINDIR/fs -config %s' % config_path
pm.ensure("fs_%s" % flist.name, cmd=cmd, env={}, path='$JSCFGDIR/fs', descr='G8OS FS')
def stop(job):
prefab = job.service.executor.prefab
service = job.service
actor = service.aysrepo.actorGet(name=service.model.dbobj.actorName)
for flist in actor.model.dbobj.flists:
config_path = prefab.core.replace('$JSCFGDIR/fs/%s.toml' % flist.name)
flist_config = prefab.core.file_read(config_path)
flist_config = j.data.serializer.toml.loads(flist_config)
pm = prefab.processmanager.get('tmux')
pm.stop('fs_%s' % flist.name)
for mount in flist_config['mount']:
cmd = 'umount -fl %s' % mount['path']
prefab.core.run(cmd)
def processChange(job):
service = job.service
category = job.model.args.get('changeCategory', None)
if category == 'config':
service.runAction('stop')
service.runAction('start')
def start_flist(job):
args = job.model.args
prefab = job.service.executor.prefab
prefab.core.dir_ensure('$JSCFGDIR/fs/flists')
flist_content = j.sal.fs.fileGetContents(args['flist'])
flist_name = j.sal.fs.getBaseName(args['flist'])
args['flist_path'] = prefab.core.replace('$JSCFGDIR/fs/flists/%s' % flist_name)
prefab.core.file_write(args['flist_path'], flist_content)
prefab.core.dir_ensure(args['mount_path'])
config = """
[[mount]]
path="{mount_path}"
flist="{flist_path}"
backend="main"
mode = "{mode}"
trim_base = true
[backend.main]
path="/storage/fs_backend"
stor="stor1"
namespace="{namespace}"
upload=false
encrypted=false
# encrypted=true
# user_rsa="user.rsa"
# store_rsa="store.rsa"
aydostor_push_cron="@every 1m"
cleanup_cron="@every 1m"
cleanup_older_than=1 #in hours
[aydostor.stor1]
addr="{store_addr}"
""".format(**args)
config_path = prefab.core.replace('$JSCFGDIR/fs/%s.toml' % flist_name)
prefab.core.file_write(config_path, config)
pm = prefab.processmanager.get('tmux')
cmd = '$BINDIR/fs -config %s' % config_path
pm.ensure("fs_%s" % flist_name, cmd=cmd, env={}, path='$JSCFGDIR/fs', descr='G8OS FS')
def stop_flist(job):
prefab = job.service.executor.prefab
args = job.model.args
flist_name = j.sal.fs.getBaseName(args['flist'])
config_path = prefab.core.replace('$JSCFGDIR/fs/%s.toml' % flist_name)
flist_config = prefab.core.file_read(config_path)
flist_config = j.data.serializer.toml.loads(flist_config)
pm = prefab.processmanager.get('tmux')
pm.stop('fs_%s' % flist_name)
for mount in flist_config['mount']:
cmd = 'umount -fl %s' % mount['path']
prefab.core.run(cmd)
|
# Gianna-Carina Gruen
# 05/23/2016
# Homework 1
# 1. Prompt the user for their year of birth, and tell them (approximately):
year_of_birth = input ("Hello! I'm not interested in your name, but I would like to know your age. In what year were you born?")
# Additionally, if someone gives you a year in the future, try asking them again (assume they'll do it right the second time)
if int(year_of_birth) >=2016:
year_of_birth = input ("I seriously doubt that - you get another chance. Tell me the truth this time. In what year where you born?")
# 2. How old they are
age = 2016 - int(year_of_birth)
print ("So you are roughly", age, "years old.")
# 3. How many times their heart has beaten
#human heartbeat: 70bpm; source: https://answers.yahoo.com/question/index?qid=20070907185006AAo85XE
human_heartbeat_since = age * 365 * 70 * 60 * 24
print ("Since you were born your heart has beaten roughly", human_heartbeat_since, "times. Plus one, two, three...")
# 4. How many times a blue whale's heart has beaten
#bluewhale heartbeat: 9 bpm; source: http://www.whalefacts.org/blue-whale-heart/
whale_heartbeat_since = age * 365 * 9 * 60 * 24
print ("In the same time, a blue whale's heart has beaten approximately", whale_heartbeat_since, "times." )
# 5. How many times a rabbit's heart has beaten
#rabbit heartbeat: 205 bpm; source: http://www.cardio-research.com/quick-facts/animals
rabbit_heartbeat_since = age * 365 * 205 * 60 * 24
# 6. If the answer to (5) is more than a billion, say "XXX billion" instead of the very long raw number
if rabbit_heartbeat_since >= 1000000000:
print ("Whereas a rabbit's heart has beaten roughly", rabbit_heartbeat_since/1000000000, "billion times.")
#no idea how to round the number. Tried round ( x [, n]) and I assume it doesn't work because rabbit_heartbeat_since/1000000000 is not a number. Changing it into an integer didn't help either. Defining it as a new variable neither. So, gave up on rounding it for now.
# 7. How old they are in Venus years
# One year = one surrounding of the sun. For Venus to surround the sun once, it takes 225 Earth days; source: http://spaceplace.nasa.gov/all-about-venus/en/
# To translate into code: How many times did Venus surround the sun since you were born?
# Approach: 1) Calculate the number of days passed since birth 2) divide them by 225
age_on_venus = age * 365 / 225
print ("Measured in Venus years, you are", age_on_venus, "years old.")
# 8. How old they are in Neptune years
# A year on Neptune equals 164.8 Earth years; source: https://pds.jpl.nasa.gov/planets/special/neptune.htm
age_on_neptune = age * 164.8
print ("Measured in Neptune years, you are", age_on_neptune, "years old.")
# 9. Whether they are the same age as you, older or younger
if int(year_of_birth) == 1987:
print("And it might surprise you, but we were both born in the same year!")
# 10. If older or younger, how many years difference
elif int(year_of_birth) > 1987:
print ("You are", int(year_of_birth)-1987, "years younger than me.")
else:
print ("You are", 1987-int(year_of_birth), "years older than me.")
# 11. If they were born in an even or odd year
# Approach: If year_of_birth divided by 2 results in an integer number, the year is even
if int(year_of_birth) % 2 == 0:
print ("You might have noticed, but in case not: you were born in an even year.")
else:
print ("You might have noticed, but in case not: you were born in an odd year.")
# 12. How many times the Pittsburgh Steelers have won the Superbowl since their birth.
#Pittsburgh Steelers won in 1975, 1976, 1979, 1980, 2006, 2009; source: http://www.steelers.com/history/superbowl.html
if int(year_of_birth) <= 1975:
print ("And did you know that the Pittsburgh Steelers won six Superbowls since you were born?!")
elif int(year_of_birth) >= 1976 and int(year_of_birth) < 1979:
print ("And did you know that the Pittsburgh Steelers won five Superbowls since you were born?!")
elif int(year_of_birth) == 1979:
print ("And did you know that the Pittsburgh Steelers won four Superbowls since you were born?!")
elif int(year_of_birth) == 1980:
print ("And did you know that the Pittsburgh Steelers won three Superbowls since you were born?!")
elif int(year_of_birth) >= 1981 and int(year_of_birth) <= 2006:
print ("And did you know that the Pittsburgh Steelers won two Superbowls since you were born?!")
elif int(year_of_birth) > 2006 and int(year_of_birth) <= 2009:
print ("And did you know that the Pittsburgh Steelers won one Superbowl since you were born?!")
elif int(year_of_birth) > 2009:
print ("And did you know that the Pittsburgh Steelers haven't won one single Superbowl since you were born?!")
# 13. Which US President was in office when they were born (FDR onward)
# actually I guess there's probably a more elegant way to solve Task 12 and this one, however I haven't yet figured the right way to google it...
# Franklin D. Roosevelt 1933 - 1945
# Harry S. Truman 1945 - 1953
# Dwight D. Eisenhower 1953 - 1961
# John F. Kennedy 1961 - 1963
# Lydon B. Johnson 1963 - 1969
# Richard Nixon 1969 - 1974
# Gerald Ford 1974 - 1977
# Jimmy Carter 1977- 1981
# Ronald Reagan 1981 - 1989
# George Bush 1989 - 1993
# Bill Clinton 1993 - 2001
# George W. Bush 2001 - 2009
# Barack Obama 2009 - 2016
if int(year_of_birth) >= 1933 and int(year_of_birth) < 1945:
print ("At the end, we're getting official: When you were born, President Franklin D. Roosevelt governed the US from the Oval Office")
elif int(year_of_birth) == 1945:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Frankling D. Roosevelt was followed by President Harry S. Truman.")
elif int(year_of_birth) > 1945 and int(year_of_birth) < 1953:
print ("At the end, we're getting official: When you were born, President Harry S. Truman governed the US from the Oval Office.")
elif int(year_of_birth) == 1953:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Harry S. Truman was followed by President Dwight D. Eisenhower.")
elif int(year_of_birth) > 1953 and int(year_of_birth) < 1961:
print ("At the end, we're getting official: When you were born, President Dwight D. Eisenhower governed the US from the Oval Office.")
elif int(year_of_birth) == 1961:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Dwight D. Eisenhower was followed by President John F. Kennedy.")
elif int(year_of_birth) > 1961 and int(year_of_birth) < 1963:
print ("At the end, we're getting official: When you were born, President John F. Kennedy governed the US from the Oval Office.")
elif int(year_of_birth) == 1963:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President John F. Kennedy was followed by President Lydon B. Johnson.")
elif int(year_of_birth) > 1963 and int(year_of_birth) < 1969:
print ("At the end, we're getting official: When you were born, President Lydon B. Johnson governed the US from the Oval Office.")
elif int(year_of_birth) == 1969:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Lydon B. Johnson was followed by President Richard Nixon.")
elif int(year_of_birth) > 1969 and int(year_of_birth) < 1974:
print ("At the end, we're getting official: When you were born, President Richard Nixon governed the US from the Oval Office.")
elif int(year_of_birth) == 1974:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Richard Nixon was followed by President Gerald Ford.")
elif int(year_of_birth) > 1974 and int(year_of_birth) < 1977:
print ("At the end, we're getting official: When you were born, President Gerald Ford governed the US from the Oval Office.")
elif int(year_of_birth) == 1977:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Gerald Ford was followed by President Jimmy Carter.")
elif int(year_of_birth) > 1977 and int(year_of_birth) < 1981:
print ("At the end, we're getting official: When you were born, President Jimmy Carter governed the US from the Oval Office.")
elif int(year_of_birth) == 1981:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Jimmy Carter was followed by President Ronald Reagan.")
elif int(year_of_birth) > 1981 and int(year_of_birth) < 1989:
print ("At the end, we're getting official: When you were born, President Ronald Reagan governed the US from the Oval Office.")
elif int(year_of_birth) == 1989:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Ronald Reagan was followed by President George Bush.")
elif int(year_of_birth) > 1989 and int(year_of_birth) < 1993:
print ("At the end, we're getting official: When you were born, President George Bush governed the US from the Oval Office.")
elif int(year_of_birth) == 1993:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President George Bush was followed by President Bill Clinton.")
elif int(year_of_birth) > 1993 and int(year_of_birth) < 2001:
print ("At the end, we're getting official: When you were born, President Bill Clinton governed the US from the Oval Office.")
elif int(year_of_birth) == 2001:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President Bill Clinton was followed by President George W. Bush.")
elif int(year_of_birth) > 2001 and int(year_of_birth) < 2009:
print ("At the end, we're getting official: When you were born, President George W. Bush governed the US from the Oval Office.")
elif int(year_of_birth) == 2009:
print ("At the end, we're getting official: The year you were born, there were elections in the US. President George W. Bush was followed by President Barack Obama.")
elif int(year_of_birth) > 2009:
print ("At the end, we're getting official: When you were born, President Barack Obama governed the US from the Oval Office.")
|
# https://contest.yandex.ru/contest/24735/run-report/53783569/
def broken_search(nums, target) -> int:
"""Бинарный поиск в 'сломанном' списке.
Args:
nums (List): массив, бывший отсортированным в кольцевой структуре
target ([type]): искомый эл-т
Returns:
int: индекс искомого эл-та, или -1 если не найден
Алгоритм поиска:
Массив делится на две части посередине.
Одна точно должна быть упорядоченна.
Если часть отсортирована, легко проверяется, входит ли в неё X.
Итого:
За left, right берутся индексы первого и последнего эл-тов.
В цикле пока диапазон не схлопнется:
Делим на части.
Проверяем mid == X.
Если левая сортирована:
если X входит:
индексы левой для след. итерации
иначе:
индексы правой для след. итерации
иначе:
если X входит:
индексы правой для след. итерации
иначе:
индексы левой для след. итерации
след. итерация
При сужении диапазона до двух эл-тов, проверка на сортированность
сравнивает один и тот же эл-т с собой. В условии необходимо '='.
"""
left, right = 0, len(nums) - 1
while left <= right:
mid = (left + right) // 2
if nums[mid] == target:
return mid
# левая часть
if nums[left] <= nums[mid]:
if nums[left] <= target < nums[mid]:
right = mid - 1
else:
left = mid + 1
else: # правая часть
if nums[mid] < target <= nums[right]:
left = mid + 1
else:
right = mid - 1
return -1
|
'''078 - Faça um programa que leia 5 valores numéricos e guarde-os em uma lista. No final,
mostre qual foi o maior e o menor valor digitado e as suas respectivas posições na lista. '''
lista = []
posicao_maior = []
posicao_menor = []
for p in range(0, 5):
val = int(input(f'Digite um valor na posição {p}: '))
lista.append(val)
for posicao, valores in enumerate(lista):
if valores == max(lista):
posicao_maior.append(posicao)
if valores == min(lista):
posicao_menor.append(posicao)
print(f'Você digitou os valores {lista}')
print(f'O maior valor da lista é {max(lista)}, na posição {posicao_maior}')
print(f'O menor valor da lista é {min(lista)}, na posição {posicao_menor}') |
# Copyright (c) 2020-2021 Matematyka dla Ciekawych Świata (http://ciekawi.icm.edu.pl/)
# Copyright (c) 2020-2021 Robert Ryszard Paciorek <rrp@opcode.eu.org>
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
try: clipData
except NameError: clipData = []
clipData += [
{ 'title': [ "#08.1", "Podstawy", "elektroniki", "" ] },
{ 'comment': 'podstawy elektroniki' },
{
'image': [
[0.0, ""], # TODO jakaś ilustracja filmik obrazujący zjawisko przepływu prądu ... https://www.youtube.com/watch?v=63FnT0W-Hxc https://www.youtube.com/watch?v=FReDAGo5fks
],
'text' : [
'Zjawisko przepływu prądu związane jest z przepływem ładunku elektrycznego, <m> czyli uporządkowanym ruchem nośników ładunku elektrycznego. <m>'
'W teorii przyjmuje się że prąd płynie od plusa do minusa, <m> natomiast w rzeczywistości zależy to od tego w jakim ośrodku on płynie. <m>'
'W przypadku metali ładunki elektryczne mają znak ujemny, są to elektrony <m> i fizyczne przepływ jest od potencjału ujemnego do dodatniego. <m>'
'Istnieją jednak także środowiska w których występują nośniki ładunku <m> o obu znakach, tudzież jedynie nośniki ładunku dodatnie. <m>'
'Aby występowało zjawisko przepływu ładunku konieczna jest różnica potencjałów, <m> jakieś napięcie pomiędzy końcami takiego przewodnika. <m>'
'Natomiast sam przepływ prowadzi do neutralizacji tej różnicy, <m> dlatego dla podtrzymania stałej różnicy konieczne jest istnienie źródeł prądu, <m> prowadzących do rozdzielania ładunków dodatnich od ujemnych. <m>'
]
},
{
'image': [
[0.0, eduMovie.convertFile('napięcie.svg', negate=True)],
["potencjal_def", eduMovie.convertFile("potencjał-definicja.tex", negate=True)],
["potencjal_sym", eduMovie.convertFile("potencjał.sch", negate=True)],
["gnd_sym", eduMovie.convertFile("masa.sch", negate=True)],
],
'text' : [
'Na wstępie należy zdefiniować kilka pojęć. <m>'
'Napięciem elektrycznym nazywamy różnicę potencjałów pomiędzy dwoma punktami, <m> czyli napięcie pomiędzy punktem A i punktem B jakiegoś obwodu, <m> jest to różnica potencjałów w tych punktach. <m>'
'Jako że w przypadku odejmowania znak wyniku zależy od kolejności argumentów, <m> to również napięcie pomiędzy A i B to jest to samo co <m> minus napięcie pomiędzy B i A. <m>'
'Znak napięcia zależy od kierunku w którym przechodzimy po obwodzie elektrycznym. <mark name="potencjal_def" />'
'Do zdefiniowania napięcia skorzystaliśmy z pojęcia potencjału elektrycznego. <m>'
'Potencjał elektryczny w jakimś punkcie jest to skalarna wielkość, <m> charakteryzująca pole elektryczne w danym punkcie. <m>'
'Odpowiada ona pracy którą trzeba wykonać aby przenieść ładunek <m> z tego punktu do nieskończoności podzielonej przez wielkość tego ładunku. <m>'
'Tak brzmi formalna definicja. Natomiast w większości przypadków <m> w praktyce elektronika nie jest ona mu potrzebna. <mark name="potencjal_sym" />'
'W elektronice często używa się wartości potencjału <m> względem umownego potencjału zerowego. <m>'
'Pozwala to na traktowanie samych potencjałów tak jak różnicy potencjałów, <m> czyli jak napięcia elektrycznego. <m>'
'W efekcie czego elektronik często zamiennie używa określenia <m> stałe napięcie i stały potencjał w jakimś punkcie. <m>'
'Jeżeli mówimy że w jakimś punkcie mamy potencjał na przykład 5 woltów, <m> to mamy na myśli że mamy tam napięcie 5 woltów w stosunku co do punktu <m> mającego ten umowny potencjał zerowy. <mark name="gnd_sym" />'
'Potencjał zerowy określany jest mianem masy. <m>'
'Do jego oznaczenia używane jest często <GND>[ge en de] od angielskiego ground. <m>'
'Punkty na których występuje ten potencjał zerowy na schematach <m> oznaczamy najczęściej tak jak pokazano to na ekranie. <m>'
'Jest to tak naprawdę umowa, że w danym miejscu potencjał przyjmujemy za zerowy. <m>'
'Potencjały w innych punktach mogą być dodatnie bądź ujemne, <m> w stosunku co do potencjału zerowego. <m>'
'Potencjał ten może być równy potencjałowi ziemi, <m> masie ochronnej określanej jako <PE>[Pe E]. <m>'
'Natomiast nie musi być z nim związany – układy te mogą być izolowane, <m> czyli masa naszego układu elektronicznego niekoniecznie musi być powiązana <m> z potencjałem masy ochronnej, czyli tak zwanym uziemieniem. <m>'
]
},
{
'image': [
[0.0, eduMovie.convertFile("elektronik_vs_szkoła.sch", negate=True)],
["line_crossing", eduMovie.convertFile("line_crossing.sch", negate=True)],
["current", eduMovie.convertFile("current.sch", negate=True)],
],
'text' : [
'Typowo w schematach stosowanych przez elektroników <m> nie znajdziemy symbolu baterii, <m> chyba że urządzenie jest fizycznie z niej zasilane, <m>'
'natomiast będziemy tam mieli oznaczenie potencjału zerowego <m> i oznaczenie jakiś potencjałów zasilających. <m>'
'Unika się też nadmiernej ilości linii związanych z tymi potencjałami, <m> stosując zamiast tego wielokrotnie znaczniki tych potencjałów. <m>'
'Jeżeli w dwóch miejscach schematu widzimy ten sam potencjał, <m> na przykład symbol masy, oznacza to że są one połączone, <m> nawet jeżeli nie ma pomiędzy nimi linii. <m>'
'Typowo jeżeli rysujemy jakiś schemat elektroniczny to potencjały wyższe <m> umieszcza się wyżej, a niższe niżej, czyli punkty z potencjałem na przykład <m> <5V>[pięciu woltów] będziemy mieli na górze obrazka, a masę na dole. <m>'
'Również przepływ prądu jest od góry do dołu i od lewej do prawej, <m> czyli jeżeli mamy opornik narysowany poziomo <m> to typowo prąd będzie płynął od lewej do prawej. <m>'
'Oczywiście są to tylko konwencje i dany schemat może tego nie spełniać, <m> jednak większość schematów trzyma się tych konwencji, <m> gdyż są one wygodne i ułatwiają czytanie schematów. <m>'
'Natomiast należy zachować ostrożność bo może się zdarzyć, <m> że jednak ten prąd przez dany opornik będzie płynął odwrotnie, <m> w związku z tym że schemat narysowany jest dziwnie albo podchwytliwie. <mark name="line_crossing" />'
'Powszechnie przyjętą praktyką jest oznaczanie miejsc połączeń linii, <m> nazywanych też węzłami za pomocą kropki. <m>'
'Czyli jeżeli mamy dwie po prostu przecinające się linie <m> to oznacza brak połączenia elektrycznego między nimi, <m>'
'a jeżeli na przecięciu zostanie umieszczona kropka <m> to znaczy że są one ze sobą połączone, <m> tworząc tak zwany węzeł sieci elektrycznej. <m>'
'Zasadniczo nie ma formalnego standardu, <m> który określałby sposób rysowania schematów elektronicznych, <m> czy elektrycznych i używane na nich symbole. <m>'
'Generalnie są to powszechnie przyjęte zwyczaje. <m>'
'Nierzadko zdarza się że temu samemu elementowi odpowiada <m> kilka różnych reprezentacji graficznych, <m> ale o nich będziemy mówić przy omawianiu poszczególnych elementów. <mark name="current" />'
'Ostatnim pojęciem które warto zdefiniować na wstępie <m> jest natężenie prądu określane skrótowo jako prąd i oznaczone jako I. <m>'
'Jest to stosunek przemieszczanego ładunku w jakimś czasie <m> do czasu jego przepływu, <m>'
'czyli informuje nas o tym jak szybko przepływa ładunek, <m> ile jednostek ładunku elektrycznego przepływa w jednostce czasu. <m>'
'Im większy prąd (formalnie jego natężenie) tym więcej ładunków <m> w danym czasie jest przemieszczanych. <m>'
'Oczywiście przepływ prądu ma również swój kierunek <m> i jak już wspomnieliśmy, niezależnie od ruchu fizycznych nośników, <m>'
'przyjmuje się że prąd przepływa od potencjału wyższego do niższego <m> – zgodnie z kierunkiem przepływu prądu mamy spadek potencjału, napięcia. <m>'
]
},
]
|
class Solution:
def removePalindromeSub(self, s: str) -> int:
# exception
if s == '':
return 0
elif s == s[::-1]:
return 1
else:
return 2
|
#!/usr/bin/env python
# coding=utf-8
class startURL:
xinfangURL = [
'http://cs.ganji.com/fang12/o1/',
'http://cs.ganji.com/fang12/o2/',
'http://cs.ganji.com/fang12/o3/',
'http://cs.ganji.com/fang12/o4/',
'http://cs.ganji.com/fang12/o5/',
'http://cs.ganji.com/fang12/o6/',
'http://cs.ganji.com/fang12/o7/',
'http://cs.ganji.com/fang12/o8/',
'http://cs.ganji.com/fang12/o9/',
'http://cs.ganji.com/fang12/o10/',
'http://cs.ganji.com/fang12/o11/',
'http://cs.ganji.com/fang12/o12/',
'http://cs.ganji.com/fang12/o13/',
'http://cs.ganji.com/fang12/o14/',
'http://cs.ganji.com/fang12/o15/',
'http://cs.ganji.com/fang12/o16/',
'http://cs.ganji.com/fang12/o17/',
'http://cs.ganji.com/fang12/o18/',
'http://cs.ganji.com/fang12/o19/',
'http://cs.ganji.com/fang12/o20/',
'http://cs.ganji.com/fang12/o21/',
'http://cs.ganji.com/fang12/o22/',
'http://cs.ganji.com/fang12/o23/',
'http://cs.ganji.com/fang12/o24/',
'http://cs.ganji.com/fang12/o25/',
'http://cs.ganji.com/fang12/o26/',
'http://cs.ganji.com/fang12/o27/',
'http://cs.ganji.com/fang12/o28/',
'http://cs.ganji.com/fang12/o29/',
'http://cs.ganji.com/fang12/o30/',
'http://cs.ganji.com/fang12/o31/',
'http://cs.ganji.com/fang12/o32/',
'http://cs.ganji.com/fang12/o33/',
'http://cs.ganji.com/fang12/o34/',
'http://cs.ganji.com/fang12/o35/',
'http://cs.ganji.com/fang12/o36/',
'http://cs.ganji.com/fang12/o37/',
'http://cs.ganji.com/fang12/o38/',
'http://cs.ganji.com/fang12/o39/',
'http://cs.ganji.com/fang12/o40/',
'http://cs.ganji.com/fang12/o41/',
'http://cs.ganji.com/fang12/o42/',
'http://cs.ganji.com/fang12/o43/',
'http://cs.ganji.com/fang12/o44/',
'http://cs.ganji.com/fang12/o45/',
'http://cs.ganji.com/fang12/o46/',
'http://cs.ganji.com/fang12/o47/',
'http://cs.ganji.com/fang12/o48/',
'http://cs.ganji.com/fang12/o49/',
'http://cs.ganji.com/fang12/o50/',
'http://cs.ganji.com/fang12/o51/',
'http://cs.ganji.com/fang12/o52/',
'http://cs.ganji.com/fang12/o53/',
'http://cs.ganji.com/fang12/o54/',
'http://cs.ganji.com/fang12/o55/',
'http://cs.ganji.com/fang12/o56/',
'http://cs.ganji.com/fang12/o57/',
'http://cs.ganji.com/fang12/o58/',
'http://cs.ganji.com/fang12/o59/',
'http://cs.ganji.com/fang12/o60/',
'http://cs.ganji.com/fang12/o61/',
'http://cs.ganji.com/fang12/o62/',
'http://cs.ganji.com/fang12/o63/',
'http://cs.ganji.com/fang12/o64/',
'http://cs.ganji.com/fang12/o65/',
'http://cs.ganji.com/fang12/o66/',
'http://cs.ganji.com/fang12/o67/',
'http://cs.ganji.com/fang12/o68/',
'http://cs.ganji.com/fang12/o69/',
'http://cs.ganji.com/fang12/o70/'
]
ershoufangURL = [
'http://cs.ganji.com/fang5/o1/',
'http://cs.ganji.com/fang5/o2/',
'http://cs.ganji.com/fang5/o3/',
'http://cs.ganji.com/fang5/o4/',
'http://cs.ganji.com/fang5/o5/',
'http://cs.ganji.com/fang5/o6/',
'http://cs.ganji.com/fang5/o7/',
'http://cs.ganji.com/fang5/o8/',
'http://cs.ganji.com/fang5/o9/',
'http://cs.ganji.com/fang5/o10/',
'http://cs.ganji.com/fang5/o11/',
'http://cs.ganji.com/fang5/o12/',
'http://cs.ganji.com/fang5/o13/',
'http://cs.ganji.com/fang5/o14/',
'http://cs.ganji.com/fang5/o15/',
'http://cs.ganji.com/fang5/o16/',
'http://cs.ganji.com/fang5/o17/',
'http://cs.ganji.com/fang5/o18/',
'http://cs.ganji.com/fang5/o19/',
'http://cs.ganji.com/fang5/o20/',
'http://cs.ganji.com/fang5/o21/',
'http://cs.ganji.com/fang5/o22/',
'http://cs.ganji.com/fang5/o23/',
'http://cs.ganji.com/fang5/o24/',
'http://cs.ganji.com/fang5/o25/',
'http://cs.ganji.com/fang5/o26/',
'http://cs.ganji.com/fang5/o27/',
'http://cs.ganji.com/fang5/o28/',
'http://cs.ganji.com/fang5/o29/',
'http://cs.ganji.com/fang5/o30/',
'http://cs.ganji.com/fang5/o31/',
'http://cs.ganji.com/fang5/o32/',
'http://cs.ganji.com/fang5/o33/',
'http://cs.ganji.com/fang5/o34/',
'http://cs.ganji.com/fang5/o35/',
'http://cs.ganji.com/fang5/o36/',
'http://cs.ganji.com/fang5/o37/',
'http://cs.ganji.com/fang5/o38/',
'http://cs.ganji.com/fang5/o39/',
'http://cs.ganji.com/fang5/o40/',
'http://cs.ganji.com/fang5/o41/',
'http://cs.ganji.com/fang5/o42/',
'http://cs.ganji.com/fang5/o43/',
'http://cs.ganji.com/fang5/o44/',
'http://cs.ganji.com/fang5/o45/',
'http://cs.ganji.com/fang5/o46/',
'http://cs.ganji.com/fang5/o47/',
'http://cs.ganji.com/fang5/o48/',
'http://cs.ganji.com/fang5/o49/',
'http://cs.ganji.com/fang5/o50/',
'http://cs.ganji.com/fang5/o51/',
'http://cs.ganji.com/fang5/o52/',
'http://cs.ganji.com/fang5/o53/',
'http://cs.ganji.com/fang5/o54/',
'http://cs.ganji.com/fang5/o55/',
'http://cs.ganji.com/fang5/o56/',
'http://cs.ganji.com/fang5/o57/',
'http://cs.ganji.com/fang5/o58/',
'http://cs.ganji.com/fang5/o59/',
'http://cs.ganji.com/fang5/o60/',
'http://cs.ganji.com/fang5/o61/',
'http://cs.ganji.com/fang5/o62/',
'http://cs.ganji.com/fang5/o63/',
'http://cs.ganji.com/fang5/o64/',
'http://cs.ganji.com/fang5/o65/',
'http://cs.ganji.com/fang5/o66/',
'http://cs.ganji.com/fang5/o67/',
'http://cs.ganji.com/fang5/o68/',
'http://cs.ganji.com/fang5/o69/',
'http://cs.ganji.com/fang5/o70/'
]
zufangURL = [
'http://cs.ganji.com/fang1/o1/',
'http://cs.ganji.com/fang1/o2/',
'http://cs.ganji.com/fang1/o3/',
'http://cs.ganji.com/fang1/o4/',
'http://cs.ganji.com/fang1/o5/',
'http://cs.ganji.com/fang1/o6/',
'http://cs.ganji.com/fang1/o7/',
'http://cs.ganji.com/fang1/o8/',
'http://cs.ganji.com/fang1/o9/',
'http://cs.ganji.com/fang1/o10/',
'http://cs.ganji.com/fang1/o11/',
'http://cs.ganji.com/fang1/o12/',
'http://cs.ganji.com/fang1/o13/',
'http://cs.ganji.com/fang1/o14/',
'http://cs.ganji.com/fang1/o15/',
'http://cs.ganji.com/fang1/o16/',
'http://cs.ganji.com/fang1/o17/',
'http://cs.ganji.com/fang1/o18/',
'http://cs.ganji.com/fang1/o19/',
'http://cs.ganji.com/fang1/o20/',
'http://cs.ganji.com/fang1/o21/',
'http://cs.ganji.com/fang1/o22/',
'http://cs.ganji.com/fang1/o23/',
'http://cs.ganji.com/fang1/o24/',
'http://cs.ganji.com/fang1/o25/',
'http://cs.ganji.com/fang1/o26/',
'http://cs.ganji.com/fang1/o27/',
'http://cs.ganji.com/fang1/o28/',
'http://cs.ganji.com/fang1/o29/',
'http://cs.ganji.com/fang1/o30/',
'http://cs.ganji.com/fang1/o31/',
'http://cs.ganji.com/fang1/o32/',
'http://cs.ganji.com/fang1/o33/',
'http://cs.ganji.com/fang1/o34/',
'http://cs.ganji.com/fang1/o35/',
'http://cs.ganji.com/fang1/o36/',
'http://cs.ganji.com/fang1/o37/',
'http://cs.ganji.com/fang1/o38/',
'http://cs.ganji.com/fang1/o39/',
'http://cs.ganji.com/fang1/o40/',
'http://cs.ganji.com/fang1/o41/',
'http://cs.ganji.com/fang1/o42/',
'http://cs.ganji.com/fang1/o43/',
'http://cs.ganji.com/fang1/o44/',
'http://cs.ganji.com/fang1/o45/',
'http://cs.ganji.com/fang1/o46/',
'http://cs.ganji.com/fang1/o47/',
'http://cs.ganji.com/fang1/o48/',
'http://cs.ganji.com/fang1/o49/',
'http://cs.ganji.com/fang1/o50/',
'http://cs.ganji.com/fang1/o51/',
'http://cs.ganji.com/fang1/o52/',
'http://cs.ganji.com/fang1/o53/',
'http://cs.ganji.com/fang1/o54/',
'http://cs.ganji.com/fang1/o55/',
'http://cs.ganji.com/fang1/o56/',
'http://cs.ganji.com/fang1/o57/',
'http://cs.ganji.com/fang1/o58/',
'http://cs.ganji.com/fang1/o59/',
'http://cs.ganji.com/fang1/o60/',
'http://cs.ganji.com/fang1/o61/',
'http://cs.ganji.com/fang1/o62/',
'http://cs.ganji.com/fang1/o63/',
'http://cs.ganji.com/fang1/o64/',
'http://cs.ganji.com/fang1/o65/',
'http://cs.ganji.com/fang1/o66/',
'http://cs.ganji.com/fang1/o67/',
'http://cs.ganji.com/fang1/o68/',
'http://cs.ganji.com/fang1/o69/',
'http://cs.ganji.com/fang1/o70/'
]
|
# File: hackerone_consts.py
# Copyright (c) 2020-2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
# Constants for actions
ACTION_ID_GET_ALL = 'get_reports'
ACTION_ID_GET_UPDATED = 'get_updated_reports'
ACTION_ID_GET_ONE = 'get_report'
ACTION_ID_UPDATE = 'update_id'
ACTION_ID_UNASSIGN = 'unassign'
ACTION_ID_ON_POLL = 'on_poll'
ACTION_ID_TEST = 'test_asset_connectivity'
ACTION_ID_GET_BOUNTY_BALANCE = 'get_bounty_balance'
ACTION_ID_GET_BILLING_TRANSACTIONS = 'get_billing_transactions'
# Constants for error messages
ERR_CODE_MSG = "Error code unavailable"
ERR_MSG_UNAVAILABLE = "Error message unavailable. Please check the asset configuration and|or action parameters"
PARSE_ERR_MSG = "Unable to parse the error message. Please check the asset configuration and|or action parameters"
TYPE_ERR_MSG = "Error occurred while connecting to the HackerOne Server. Please check the asset configuration and|or the action parameters"
INT_VALIDATION_ERR_MSG = "Please provide a valid integer value in the {}"
NEG_INT_VALIDATION_ERR_MSG = "Please provide a valid non-negative integer value in the {}"
# Constants for params
RANGE_KEY = "'range' action parameter"
CONTAINER_COUNT_KEY = "'container_count' action parameter"
|
# Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def removeNthFromEnd(self, head, n):
"""
:type head: ListNode
:type n: int
:rtype: ListNode
"""
pre_n_th = n_th = tail = head
i = 0
if head.next is None:
return None
while n > 1:
tail = tail.next
n -= 1
while tail.next is not None:
tail = tail.next
n_th = n_th.next
if i > 0:
pre_n_th = pre_n_th.next
i += 1
if n_th == pre_n_th:
return head.next
else:
pre_n_th.next = n_th.next
return head
def removeNthFromEnd2(self, head, n):
"""
:type head: ListNode
:type n: int
:rtype: ListNode
"""
fast = slow = head
for _ in range(n):
fast = fast.next
if not fast:
return head.next
while fast.next:
fast = fast.next
slow = slow.next
slow.next = slow.next.next
return head
|
# -*- coding: utf-8 -*-
# Author: Daniel Yang <daniel.yj.yang@gmail.com>
#
# License: BSD-3-Clause
__version__ = "0.0.6"
__license__ = "BSD-3-Clause License"
|
##n=int(input("enter a number:"))
##i=1
##
##count=0
##while(i<n):
## if(n%i==0):
## count=count+1
##
## i=i+1
##if(count<=2):
## print("prime")
##else:
## print("not")
i=2
j=2
while(i<=10):
while(j<i):
if(i%j==0):
break;
else:
print(i)
j+=1
i+=1
|
for m in range(1,1000):
for n in range(m+1,1000):
c=1000-m-n
if c**2==(m**2+n**2):
print('The individual numbers a,b,c respectively are',m,n,c,'the product of abc is',m*n*c)
|
{
'target_defaults': {
'includes': ['../common-mk/common.gypi'],
'variables': {
'deps': [
'protobuf',
],
},
},
'targets': [
{
'target_name': 'media_perception_protos',
'type': 'static_library',
'variables': {
'proto_in_dir': 'proto/',
'proto_out_dir': 'include/media_perception',
},
'sources': [
'<(proto_in_dir)/device_management.proto',
'<(proto_in_dir)/pipeline.proto',
],
'includes': ['../common-mk/protoc.gypi'],
},
{
'target_name': 'media_perception_mojo_bindings',
'type': 'static_library',
'sources': [
'mojom/color_space.mojom',
'mojom/constants.mojom',
'mojom/device.mojom',
'mojom/device_factory.mojom',
'mojom/device_management.mojom',
'mojom/geometry.mojom',
'mojom/image_capture.mojom',
'mojom/mailbox.mojom',
'mojom/mailbox_holder.mojom',
'mojom/media_perception.mojom',
'mojom/media_perception_service.mojom',
'mojom/pipeline.mojom',
'mojom/producer.mojom',
'mojom/receiver.mojom',
'mojom/scoped_access_permission.mojom',
'mojom/shared_memory.mojom',
'mojom/sync_token.mojom',
'mojom/time.mojom',
'mojom/values.mojom',
'mojom/video_capture_types.mojom',
'mojom/virtual_device.mojom',
],
'includes': ['../common-mk/mojom_bindings_generator.gypi'],
},
{
'target_name': 'media_perception_service_lib',
'type': 'static_library',
'variables': {
'exported_deps': [
'libchrome-<(libbase_ver)',
'libbrillo-<(libbase_ver)',
'libmojo-<(libbase_ver)',
],
'deps': ['<@(exported_deps)'],
},
'dependencies': [
'media_perception_mojo_bindings',
'media_perception_protos',
],
'all_dependent_settings': {
'variables': {
'deps': [
'<@(exported_deps)',
],
},
},
'sources': [
'cras_client_impl.cc',
'media_perception_controller_impl.cc',
'media_perception_impl.cc',
'media_perception_service_impl.cc',
'mojo_connector.cc',
'producer_impl.cc',
'proto_mojom_conversion.cc',
'receiver_impl.cc',
'shared_memory_provider.cc',
'video_capture_service_client_impl.cc',
],
'direct_dependent_settings': {
'cflags': [
'<!@(<(pkg-config) --cflags libcras)',
'<!@(<(pkg-config) --cflags dbus-1)',
],
},
'link_settings': {
'ldflags': [
'<!@(<(pkg-config) --libs-only-L --libs-only-other libcras)',
'<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
],
'libraries': [
'<!@(<(pkg-config) --libs-only-l libcras)',
'<!@(<(pkg-config) --libs-only-l dbus-1)',
],
},
},
{
'target_name': 'rtanalytics_main',
'type': 'executable',
'dependencies': [
'media_perception_service_lib',
],
'sources': ['main.cc'],
'link_settings': {
'ldflags': [
'-L .',
],
'libraries': [
'-lrtanalytics -ldl',
],
},
},
],
'conditions': [
['USE_test == 1', {
'targets': [
{
'target_name': 'media_perception_service_test',
'type': 'executable',
'includes': ['../common-mk/common_test.gypi'],
'dependencies': ['media_perception_service_lib'],
'sources': [
'../common-mk/testrunner.cc',
'proto_mojom_conversion_test.cc',
],
},
],
}],
],
}
|
class Solution:
def canReach(self, arr: List[int], start: int) -> bool:
# bastardized version of DFS
# if we are out of bounds return false
# else check to left and right
# same idea as sinking islands where we remove visited for current recurse
left, right = 0, len(arr)
def dfs(i):
if (i < left or i >= right or arr[i] < 0):
return False
if arr[i] == 0:
return True
arr[i] = -arr[i]
poss1 = dfs(i - arr[i])
poss2 = dfs(i + arr[i])
arr[i] = -arr[i]
return poss1 or poss2
return dfs(start)
|
# Escreva um programa em Python que leia um número inteiro qualquer e peça para o usuário escolher qual será a base de conversão: 1 para binário, 2 para octal e 3 para hexadecimal.
numero = int(input('Digite um número: '))
print('''[1] para binário
[2] para octal
[3] para hexadecimal''')
escolha = int(input('Escolha entre 1, 2 e 3: '))
if escolha == 1:
print(f'O número {numero} em valor binário fica: {bin(numero)[2:]}')
elif escolha == 2:
print(f'O número {numero} em valoor octal fica: {oct(numero)[2:]}')
elif escolha == 3:
print(f'O número {numero} em valor hexadecimal fica: {hex(numero)[2:]}')
else:
print('Número invalido.')
|
class Queue:
def __init__(self, maxsize):
self.__max_size = maxsize
self.__elements = [None] * self.__max_size
self.__rear = -1
self.__front = 0
def getMaxSize(self):
return self.__max_size
def isFull(self):
return self.__rear == self.__max_size
def isEmpty(self):
if self.__rear == -1 or self.__front == self.__max_size:
return True
else:
return False
def enqueue(self, data):
if self.isFull():
print('Queue is full')
else:
self.__rear += 1
self.__elements[self.__rear] = data
def dequeue(self):
if self.isEmpty():
print('Queue is empty.')
else:
data = self.__elements[self.__front]
self.__front += 1
return data
def display(self):
if not self.isEmpty():
for i in range(self.__front, (self.__rear + 1)):
print(self.__elements[i])
else:
print('Empty queue.')
def __str__(self):
msg = []
index = self.__front
while index <= self.__rear:
msg.append(str(self.__elements[index]))
index += 1
msg = ' '.join(msg)
msg = f'Queue data (from front to rear) : {msg}'
return msg
if __name__ == '__main__':
queue = Queue(5)
queue.enqueue('A')
queue.enqueue('B')
queue.enqueue('C')
queue.enqueue('D')
queue.enqueue('E')
print(queue)
print('Dequeued: ', queue.dequeue())
print('Dequeued: ', queue.dequeue())
print('Dequeued: ', queue.dequeue())
print('Dequeued: ', queue.dequeue())
print('Dequeued: ', queue.dequeue())
print('Dequeued: ', queue.dequeue())
queue.display() |
def HammingDistance(p, q):
mm = [p[i] != q[i] for i in range(len(p))]
return sum(mm)
# def ImmediateNeighbors(Pattern):
# Neighborhood = [Pattern]
# for i in range(len(Pattern)):
# nuc = Pattern[i]
# for nuc2 in ['A', 'C', 'G', 'T']:
# if nuc != nuc2:
# pat = list(Pattern)
# pat[i] = nuc2
# Neighborhood.append(''.join(pat))
# return Neighborhood
def Neighbors(Pattern, d):
if d == 0:
return Pattern
if len(Pattern) == 1:
return ['A', 'C', 'G', 'T']
Neighborhood = set()
SuffixNeighbors = Neighbors(Pattern[1:], d)
for Text in SuffixNeighbors:
if HammingDistance(Pattern[1:], Text) < d:
for nuc in ['A', 'C', 'G', 'T']:
Neighborhood.add(nuc + Text)
else:
Neighborhood.add(Pattern[0] + Text)
return Neighborhood
def FrequentWordsWithMismatches(Text, k, d):
pattern_dict = {}
max_val = -1
for i in range(len(Text) - k + 1):
Pattern = Text[i:i+k]
Neighborhood = Neighbors(Pattern, d)
for ApproximatePattern in Neighborhood:
if ApproximatePattern in pattern_dict.keys():
pattern_dict[ApproximatePattern] += 1
if pattern_dict[ApproximatePattern] > max_val:
max_val = pattern_dict[ApproximatePattern]
else:
pattern_dict[ApproximatePattern] = 1
if pattern_dict[ApproximatePattern] > max_val:
max_val = pattern_dict[ApproximatePattern]
FrequentPatterns = []
for key, value in pattern_dict.iteritems():
if value == max_val:
FrequentPatterns.append(key)
return FrequentPatterns
FrequentWordsWithMismatches('ATA', 3, 1)
FrequentWordsWithMismatches('GTAAGATGTGCACTGATGTAAGTAAGTAACACTGACGGACGGATGTGGATGTAACACTCACTGTGGACGGATGTGGTAAGACGGTAAGTGCACTGATGACGGTGGTGGATGATGATGTGGATGACGCACTCACTGTAAGTGGATCACTGACGGATGTAAGACGGTGGATGTAAGATGTGGATGATGATGACGCACTGTAAGACGGTAAGTAAGTAAGACGGTGGTGGTGGTAAGACGGTAACACTCACTGTGCACTGACGGATGTAACACTGATCACTCACTGATGTGGTGGTAAGACGGTAAGATGTAAGACGCACTGTGCACTGTAAGATGACGGACGGTGGATCACTGATGACGGTAACACTCACTGACGGTAA', 6, 2) |
'''
Description:
Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive).
The binary search tree is guaranteed to have unique values.
Example 1:
Input: root = [10,5,15,3,7,null,18], L = 7, R = 15
Output: 32
Example 2:
Input: root = [10,5,15,3,7,13,18,1,null,6], L = 6, R = 10
Output: 23
Note:
The number of nodes in the tree is at most 10000.
The final answer is guaranteed to be less than 2^31.
'''
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def helper(self, node, arr):
# in-order traversal
if node:
self.helper( node.left, arr )
arr.append( node.val )
self.helper( node.right, arr )
def rangeSumBST(self, root: TreeNode, L: int, R: int) -> int:
arr = []
self.helper(root, arr)
index_of_L, index_of_R = arr.index(L), arr.index(R)
return sum( arr[index_of_L : index_of_R+1] )
# n : the number of node in given binary search tree
## Time Complexity: O( n )
#
# The overhead in time is to traversal the binary search tree within range, which is of O( n )
## Space Complexity: O( n )
#
# The overhead in space is the call stack for recursion and array, arr, which are both of O( n )
def test_bench():
root = TreeNode( 10 )
root.left = TreeNode( 5 )
root.right = TreeNode( 15 )
root.left.left = TreeNode( 3 )
root.left.right = TreeNode( 7 )
root.right.left = None
root.right.right = TreeNode( 18 )
L, R = 7, 15
print( Solution().rangeSumBST(root, L, R) )
return
if __name__ == '__main__':
test_bench() |
"""
This is a modelmanager settings file.
Import or define your settings variables, functions or classes below.
For example:
```
# will only be available here
import pandas as example_module
from pandas.some_module import some_function as _pandas_function
# will be available as project.example_variable
example_variable = 123
# will be available as project.example_function()
def example_function(project, d=1):
dd = d + 2
return dd
# will be initialised and available as project.example (lower cased!)
class Example:
example_variable = 456
def __init__(self, project):
self.project = project
return
```
"""
|
"""
Given array of integers lengths, create an array of arrays output such that output[i] consists of lengths[i] elements and output[i][j] = j.
Example
For lengths = [1, 2, 0, 4], the output should be
create2DArray(lengths) = [[0],
[0, 1],
[],
[0, 1, 2, 3]]
"""
def create2DArray(lengths):
return [range(i) for i in lengths]
|
# Exercício 086
numeros = [[], [], []]
for c in range(0, 3):
for d in range(0, 3):
n = int(input(f'Digite o valor {c},{d}: '))
numeros[c].append(n)
print('=-' * 10)
print('NÚMEROS EM MATRIZ:')
for c in range(0, 3):
for d in range(0, 3):
print(f'{numeros[c][d]:^5}', end='')
print()
|
# model settings
model = dict(
type='Classification',
pretrained=None,
backbone=dict(
type='MobileNetV3',
arch='large',
out_indices=(16,), # x-1: stage-x
norm_cfg=dict(type='BN', eps=0.001, momentum=0.01),
),
head=dict(
type='ClsHead',
loss=dict(type='CrossEntropyLoss', loss_weight=1.0),
with_avg_pool=True, in_channels=960, num_classes=1000)
)
|
#coding=utf-8
'''
Created on 2015-11-11
@author: zhangtiande
'''
class Project(object):
project_save_filed="项目保存失败,请联系管理员"
project_member_save_fail="添加成员失败,请重试"
project_member_remove_fail="删除成员失败,请重试"
project_member_update_role_fail="更新成员角色失败,请重试"
project_webhook_save_fail="添加webhook失败,请重试"
project_webhook_remove_fail="删除webhook失败,请重试"
project_webhook_set_default_fail="必须有一个默认的WebHook"
project_webhook_perform_fail="尝试发送请求失败,请检查url,参数是否正确"
class Fortesting(object):
fortesting_save_fail="提测保存失败请联系管理员"
fortesting_build_fail="构建请求失败请联系管理员"
fortesting_commit_fail="提测失败请联系管理员"
class Version(object):
version_save_fail="版本添加失败请联系管理员"
version_delete_fail="版本删除失败请联系管理员"
version_update_fail="版本更新失败请联系管理员"
class Module(object):
module_save_fail="模块添加失败请联系管理员"
module_delete_fail="模块删除失败请联系管理员"
module_update_fail="模块更新失败请联系管理员"
class Task(object):
task_save_fail="任务创建失败,请联系管理员"
task_delete_fail="任务删除失败,请联系管理员"
task_update_progress_fail="进度更新失败,请稍后重试"
|
"""
API for yt.frontends.gamer
"""
|
# Generate permutations with a space
def permutation_with_space_helper(input_val, output_val):
if len(input_val) == 0:
# Base condition to get a final output once the input string is empty
final.append(output_val)
return
# Store the first element of the string and make decisions on it
temp = input_val[0]
# Recursively calling the fnc including the temp in the output
permutation_with_space_helper(input_val[1:], output_val + temp)
# Recursively calling the fnc including the temp and "_" in the output
permutation_with_space_helper(input_val[1:], output_val + "_" + temp)
def permutation_with_space(input_val):
output_val = ""
# Calling the helper function
for i in range(len(input_val)):
permutation_with_space_helper(input_val[:i] + input_val[i+1:], input_val[i])
final = []
permutation_with_space('abc')
print(final) |
"""Skeleton for 'itertools' stdlib module."""
class islice(object):
def __init__(self, iterable, start, stop=None, step=None):
"""
:type iterable: collections.Iterable[T]
:type start: numbers.Integral
:type stop: numbers.Integral | None
:type step: numbers.Integral | None
:rtype: itertools.islice[T]
"""
pass
|
EXAMPLE_DOCS = [ # Collection stored as "docs"
{
'_data': 'one two',
'_type': 'http://sharejs.org/types/textv1',
'_v': 8,
'_m': {
'mtime': 1415654366808,
'ctime': 1415654358668
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'_data': 'XXX',
'_type': 'http://sharejs.org/types/textv1',
'_v': 4,
'_m': {
'mtime': 1415654385628,
'ctime': 1415654381131
},
'_id': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a'
}
]
EXAMPLE_OPS = [ # Collection stored as "docs_ops"
{
'op': None,
'v': 0,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 1,
'create': {
'type': 'http://sharejs.org/types/textv1',
'data': None
},
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654358667
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v0',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': [
'o'
],
'v': 1,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 2,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654363751
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v1',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': [
1,
'n'
],
'v': 2,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 3,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654363838
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v2',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': [
2,
'e'
],
'v': 3,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 4,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654364007
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v3',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': [
3,
' '
],
'v': 4,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 5,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654366367
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v4',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': [
4,
't'
],
'v': 5,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 6,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654366542
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v5',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': [
5,
'w'
],
'v': 6,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 7,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654366678
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v6',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': [
6,
'o'
],
'v': 7,
'src': '94ae709f9736c24d821301de2dfc71df',
'seq': 8,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654366808
},
'_id': '26aabd89-541b-5c02-9e6a-ad332ba43118 v7',
'name': '26aabd89-541b-5c02-9e6a-ad332ba43118'
},
{
'op': None,
'v': 0,
'src': '166028c1b14818475eec6fab9720af7b',
'seq': 1,
'create': {
'type': 'http://sharejs.org/types/textv1',
'data': None
},
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654381130
},
'_id': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a v0',
'name': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a'
},
{
'op': [
'X'
],
'v': 1,
'src': '166028c1b14818475eec6fab9720af7b',
'seq': 2,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654384929
},
'_id': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a v1',
'name': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a'
},
{
'op': [
1,
'X'
],
'v': 2,
'src': '166028c1b14818475eec6fab9720af7b',
'seq': 3,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654385266
},
'_id': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a v2',
'name': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a'
},
{
'op': [
2,
'X'
],
'v': 3,
'src': '166028c1b14818475eec6fab9720af7b',
'seq': 4,
'preValidate': None,
'validate': None,
'm': {
'ts': 1415654385626
},
'_id': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a v3',
'name': '9a68120a-d3c5-5ba6-b399-fe39e8f2028a'
}
]
EXAMPLE_DOCS_6 = {
'_id': '9a247ce9-b219-5f7d-b2c8-ef31661b38d7',
'data': {
'v': 20,
'meta': {
'mtime': 1413229471447.0,
'ctime': 1413229471447.0,
},
'snapshot': 'one two three four! ',
'type': 'text',
}
}
|
dia = input("Digite o dia de nascimento: ")
mes = input("Digite o mês de nascimento: ")
ano = input("Digite o ano de nascimento: ")
print("A data de nascimento é: {}/{}/{} ." .format(dia, mes, ano)) |
"""
Ranges
- Precisamos conhecer o loop for para usar o ranges.
- Precisamos conhecer o range para trabalhar melhor com loops for.
Ranges são utilizados para gerar sequências numéricas, não de forma aleatória, mas sim de maneira especificada.
Formas gerais:
# Forma 01 range(valor_de_parada)
for num in range(11):
print(num)
OBS: valor_de_parada não inclusive (início padrão 0, e passo de 1 em 1)
# Forma 02 range(valor_de_inicio, valor_de_parada)
for num in range(1, 11):
print(num)
OBS: valor_de_parada não inclusive (início especificado pelo usuário, e passo de 1 em 1)
# Forma 03 range(valor_de_inicio, valor_de_parada, passo)
for num in range (1, 10, 2):
print(num)
OBS: valor_de_parada não inclusive (inicio especificado pelo usuário, e passo especificado pelo usuário)
# Forma 4 (inversa) range(valor_de_inicio, valor_de_parada, passo)
for num in range(10, -1, -1)
print(num)
""" |
def insert_line(file, text, after=None, before=None, past=None, once=True):
with open(file) as f:
lines = iter(f.readlines())
with open(file, 'w') as f:
if past:
for line in lines:
f.write(line)
if re.match(past, line):
break
for line in lines:
if before and re.match(before, line):
f.write(text + '\n')
if once:
f.write(line)
break
f.write(line)
if after and re.match(after, line):
f.write(text + '\n')
if once:
break
for line in lines:
f.write(line)
|
count = int(input())
tux = [" _~_ ", " (o o) ", " / V \ ", "/( _ )\\ ", " ^^ ^^ "]
for i in tux:
print(i * count)
|
class Node():
'''
The DiNode class is specifically designed for altering path search.
- Active and passive out nodes, for easily iteratively find new nodes in path.
- Marks for easy look up edges already visited (earlier Schlaufen) / nodes in path-creation already visited
- The edge-marks have the Schlaufen number saved, such that later a reconstruction of the Schlaufen found is
possible
'''
def __init__(self, id, degree, totalnodes):
self.id = id
self.degree = degree
self.passive_outnodes = set(range(totalnodes))
self.passive_outnodes.remove(id)
self.passive_outnodes_removed_selfloop_crossarrow = 1 # for graph correctness check
self.outnodes = set()
# marks
self.active_visited = False
self.passive_visited = False
# marked edges
self.active_marked = {} # dictionary outarrows as key, number of schlaufe as Value
self.passive_marked = {}
def add_outedge(self, out_node):
self.outnodes.add(out_node)
def add_passive_outedge(self, out_node):
self.passive_outnodes.add(out_node)
def del_outedge(self, out_node):
if not (out_node in self.outnodes):
raise ValueError('outnode subtraction error')
else:
self.outnodes.remove(out_node)
def del_passive_outedge(self, out_node):
if not (out_node in self.passive_outnodes):
raise ValueError('outnode subtraction error')
else:
self.passive_outnodes.remove(out_node)
|
## 函数 抽象
#斐波那契数列
##函数体要写在调用之前
nums=int(input("enter a num"))
def fibs(nums):
##为函数编写文档
'a fibs function'
list = [];
for i in range(nums):
if i==0 or i==1:
list.append(1)
else:
list.append(list[i-2]+list[i-1]);
print(list)
fibs(nums);
##打印函数文档
doc=fibs.__doc__
print(doc)
##return 只是为了结束语句
def my_introduce(name,age,sex):
print("myname is",name,sex,"im",age,"old");
##多参数的函数 在调用时候可以指定 函数参数
my_introduce(name="xiaohong",age="14",sex="male");
## java 中传入多个参数 是这样的 如 ...String 这代表了一个string的数组 python中这么干,叫做收集参数
def test(name1,name2,name3):
print(name1,name2,name3)
def test1(*params):
print(params)
test("a","b","c")
test1("ABC") |
class Point2D:
def __init__(self,x,y):
self.x = x
self.y = y
def __eq__(self, value):
return self.x == value.x and self.y == value.y
def __hash__(self):
return hash((self.x,self.y)) |
bind = "localhost:10050" # 绑定的ip与端口
backlog = 512 # 监听队列数量,64-2048
worker_class = 'sync' # 使用gevent模式,还可以使用sync 模式,默认的是sync模式
workers = 2 # multiprocessing.cpu_count() #进程数
threads = 8 # multiprocessing.cpu_count()*4 #指定每个进程开启的线程数
loglevel = 'info' # 日志级别,这个日志级别指的是错误日志的级别,而访问日志的级别无法设置
access_log_format = '%(t)s %(p)s %(h)s "%(r)s" %(s)s %(L)s %(b)s %(f)s" "%(a)s"'
accesslog = "-" # 访问日志文件,"-" 表示标准输出
errorlog = "-" # 错误日志文件,"-" 表示标准输出
proc_name = 'fof_api' # 进程名
# 配置系统参数
raw_env = ["API_DOMAIN=http://example.com"]
|
"""
This is pure Python implementation of linear search algorithm
For doctests run following command:
python3 -m doctest -v linear_search.py
For manual testing run:
python3 linear_search.py
"""
def linear_search(sequence: list, target: int) -> int:
"""A pure Python implementation of a linear search algorithm
:param sequence: a collection with comparable items (as sorted items not required
in Linear Search)
:param target: item value to search
:return: index of found item or None if item is not found
Examples:
>>> linear_search([0, 5, 7, 10, 15], 0)
0
>>> linear_search([0, 5, 7, 10, 15], 15)
4
>>> linear_search([0, 5, 7, 10, 15], 5)
1
>>> linear_search([0, 5, 7, 10, 15], 6)
-1
"""
for index, item in enumerate(sequence):
if item == target:
return index
return -1
def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int:
"""
A pure Python implementation of a recursive linear search algorithm
:param sequence: a collection with comparable items (as sorted items not required
in Linear Search)
:param low: Lower bound of the array
:param high: Higher bound of the array
:param target: The element to be found
:return: Index of the key or -1 if key not found
Examples:
>>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 0)
0
>>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 700)
4
>>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, 30)
1
>>> rec_linear_search([0, 30, 500, 100, 700], 0, 4, -6)
-1
"""
if not (0 <= high < len(sequence) and 0 <= low < len(sequence)):
raise Exception("Invalid upper or lower bound!")
if high < low:
return -1
if sequence[low] == target:
return low
if sequence[high] == target:
return high
return rec_linear_search(sequence, low + 1, high - 1, target)
if __name__ == "__main__":
user_input = input("Enter numbers separated by comma:\n").strip()
sequence = [int(item.strip()) for item in user_input.split(",")]
target = int(input("Enter a single number to be found in the list:\n").strip())
result = linear_search(sequence, target)
if result != -1:
print(f"linear_search({sequence}, {target}) = {result}")
else:
print(f"{target} was not found in {sequence}")
|
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def mergeTwoLists(self, a, b):
if a is None:
return b
if b is None:
return a
if a.val > b.val:
a, b = b, a
result = a
result_head = result
a = a.next
while a is not None or b is not None:
a_val = a.val if a is not None else math.inf
b_val = b.val if b is not None else math.inf
if a_val < b_val:
result.next = a
a = a.next
else:
result.next = b
b = b.next
result = result.next
return result_head
|
"""
package information : Core package
Author: Shanmugathas Vigneswaran
email: shanmugathas.vigneswaran@outlook.fr
Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
Licence: https://creativecommons.org/licenses/by-nc/4.0/
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING,
LICENSOR OFFERS THE WORK AS-IS AND ONLY TO THE EXTENT
OF ANY RIGHTS HELD IN THE LICENSED WORK BY THE LICENSOR.
THE LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES
OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED,
STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MARKETABILITY, MERCHANTIBILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT,
OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY,
OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES,
SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
"""
__all__ = ["controller", "uv_helpers"]
|
# DEFAULT_ASSET_URL="https://totogoto.com/assets/python_project/images/"
DEFAULT_ASSET_URL="https://cdn.jsdelivr.net/gh/totogoto/assets/"
DEFAULT_OBJECTS = [
"1",
"2",
"3",
"4",
"5",
"apple_goal",
"apple",
"around3_sol",
"banana_goal",
"banana",
"beeper_goal",
"box_goal",
"box",
"bricks",
"bridge",
"carrot_goal",
"carrot",
"daisy_goal",
"daisy",
"dandelion_goal",
"dandelion",
"desert",
"east_goal",
"east_grid",
"east",
"external_link",
"favicon",
"fence_double",
"fence_left",
"fence_right",
"fence_vertical",
"fire1",
"fire2",
"fire",
"flame1",
"flame2",
"flame3",
"flame4",
"flame5",
"flame6",
"fromage",
"grass_bottom_left",
"grass_bottom_right",
"grass",
"grass_top_left",
"grass_top_right",
"gravel",
"green_home_tile",
"highlight",
"house",
"hurdles",
"ice",
"leaf_goal",
"leaf",
"logs",
"magnifying_no",
"magnifying_yes",
"mailto",
"mort",
"mud",
"north",
"not_ok",
"ok",
"open_program",
"orange_goal",
"orange",
"ouch",
"pale_grass",
"pause",
"plain_e",
"plain_n",
"plain_s",
"plain_w",
"play",
"poison",
"racing_flag",
"racing_flag_small",
"rat_e",
"rat_n",
"rat_s",
"rat_w",
"reeborg_judkis",
"reload",
"resize",
"reverse_step",
"save_program",
"scorpion",
"seed",
"simple_path",
"sp_e",
"sp_n",
"sp_s",
"sp_w",
"square_goal",
"square",
"stalactite2",
"stalactite",
"star_goal",
"star",
"step",
"stop",
"strawberry_goal",
"strawberry",
"student",
"teleport",
"tile_colour",
"token_goal",
"token",
"transparent_tile",
"triangle_goal",
"triangle",
"tulip_goal",
"tulip",
"water2",
"water3",
"water4",
"water5",
"water6",
"water_bucket",
"water",
"east_arrow",
"north_arrow",
"west_arrow",
"south_arrow",
"envelope",
"envelope-30",
"envelope-sprite",
"speech_bubble",
"robot-yellow"
]
DEFAULT_TILE_MAP = {tile: "{}{}.png".format(DEFAULT_ASSET_URL, tile) for tile in DEFAULT_OBJECTS }
|
def main():
with open('test.txt','rt') as infile:
test2 = infile.read()
test1 ='This is a test of the emergency text system'
print(test1 == test2)
if __name__ == '__main__':
main()
|
# Enter your code here. Read input from STDIN. Print output to STDOUT
testCases = int(input())
for i in range(testCases):
word = input()
for j in range(len(word)):
if j%2 == 0:
print(word[j], end='')
print(" ", end="")
for j in range(len(word)):
if j%2 !=0 :
print(word[j], end='')
print('') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.