content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# AC 26/08/2019 17:58:21 IST #
n = int(input())
print(n)
| n = int(input())
print(n) |
def Range(first, second=None, step=1):
if second is None:
current = 0
end = first
else:
current = first
end = second
while not (current >= end and step > 0
or current <= end and step < 0):
yield current
current += step
def print_space(str):
print("{}".format(str), end=' ')
for i in Range(10):
print_space(i)
print()
for i in Range(3, 18):
print_space(i)
print()
for i in Range(2, 15, 2):
print_space(i)
print()
for i in Range(10, 0, -1):
print_space(i)
| def range(first, second=None, step=1):
if second is None:
current = 0
end = first
else:
current = first
end = second
while not (current >= end and step > 0 or (current <= end and step < 0)):
yield current
current += step
def print_space(str):
print('{}'.format(str), end=' ')
for i in range(10):
print_space(i)
print()
for i in range(3, 18):
print_space(i)
print()
for i in range(2, 15, 2):
print_space(i)
print()
for i in range(10, 0, -1):
print_space(i) |
class Info:
"""
Represents more of the metadata associated with the API
output
"""
def __init__(self, **kwargs):
self.seed = kwargs['seed']
self.results = kwargs['results'] # will represent an integer (500 in this case)
self.page = kwargs['page']
self.version = kwargs['version']
class User:
"""
Represents a top level result entry from the API output
"""
def __init__(self, **kwargs):
self.gender = kwargs['gender']
self.name = kwargs['name']
self.location = kwargs['email']
self.email = kwargs['email']
self.login = kwargs['gender']
self.dob = kwargs['dob']
self.registered = kwargs['registered']
self.phone = kwargs['phone']
self.cell = kwargs['cell']
self.id = kwargs['id']
self.picture = kwargs['picture']
self.nat = kwargs['nat']
class Name:
def __init__(self, **kwargs):
self.title = kwargs['title']
self.first = kwargs['first']
self.last = kwargs['last']
class Location:
def __init__(self, **kwargs):
self.street = kwargs['street']
self.city = kwargs['city']
self.state = kwargs['state']
self.country = kwargs['country']
self.postcode = kwargs['postcode']
self.coordinates = kwargs['coordinates']
self.timezone = kwargs['coordinates']
class Street:
def __init__(self, **kwargs):
self.number = kwargs['number']
self.name = kwargs['name']
class Coordinates:
def __init__(self, **kwargs):
self.latitude = kwargs['latitude']
self.longitude = kwargs['longitude']
class Timezone:
def __init__(self, **kwargs):
self.offset = kwargs['offset']
self.description = kwargs['description']
class Login:
def __init__(self, **kwargs):
self.uuid = kwargs['uuid']
self.username = kwargs['username']
self.password = kwargs['password']
self.salt = kwargs['salt']
self.md5 = kwargs['md5']
self.sha1 = kwargs['sha1']
self.sha256 = kwargs['sha256']
class Dob:
def __init__(self, **kwargs):
self.date = kwargs['date']
self.age = kwargs['age']
class Registered:
def __init__(self, **kwargs):
self.date = kwargs['date']
self.age = kwargs['age']
class Id:
def __init__(self, **kwargs):
self.name = kwargs['name']
self.value = kwargs['value']
class Picture:
def __init__(self, **kwargs):
self.large = kwargs['large']
self.medium = kwargs['medium']
self.thumbnail = kwargs['thumbnail']
| class Info:
"""
Represents more of the metadata associated with the API
output
"""
def __init__(self, **kwargs):
self.seed = kwargs['seed']
self.results = kwargs['results']
self.page = kwargs['page']
self.version = kwargs['version']
class User:
"""
Represents a top level result entry from the API output
"""
def __init__(self, **kwargs):
self.gender = kwargs['gender']
self.name = kwargs['name']
self.location = kwargs['email']
self.email = kwargs['email']
self.login = kwargs['gender']
self.dob = kwargs['dob']
self.registered = kwargs['registered']
self.phone = kwargs['phone']
self.cell = kwargs['cell']
self.id = kwargs['id']
self.picture = kwargs['picture']
self.nat = kwargs['nat']
class Name:
def __init__(self, **kwargs):
self.title = kwargs['title']
self.first = kwargs['first']
self.last = kwargs['last']
class Location:
def __init__(self, **kwargs):
self.street = kwargs['street']
self.city = kwargs['city']
self.state = kwargs['state']
self.country = kwargs['country']
self.postcode = kwargs['postcode']
self.coordinates = kwargs['coordinates']
self.timezone = kwargs['coordinates']
class Street:
def __init__(self, **kwargs):
self.number = kwargs['number']
self.name = kwargs['name']
class Coordinates:
def __init__(self, **kwargs):
self.latitude = kwargs['latitude']
self.longitude = kwargs['longitude']
class Timezone:
def __init__(self, **kwargs):
self.offset = kwargs['offset']
self.description = kwargs['description']
class Login:
def __init__(self, **kwargs):
self.uuid = kwargs['uuid']
self.username = kwargs['username']
self.password = kwargs['password']
self.salt = kwargs['salt']
self.md5 = kwargs['md5']
self.sha1 = kwargs['sha1']
self.sha256 = kwargs['sha256']
class Dob:
def __init__(self, **kwargs):
self.date = kwargs['date']
self.age = kwargs['age']
class Registered:
def __init__(self, **kwargs):
self.date = kwargs['date']
self.age = kwargs['age']
class Id:
def __init__(self, **kwargs):
self.name = kwargs['name']
self.value = kwargs['value']
class Picture:
def __init__(self, **kwargs):
self.large = kwargs['large']
self.medium = kwargs['medium']
self.thumbnail = kwargs['thumbnail'] |
#from baconsarnie.io.window import Window
#__all__ = ["io", "Window"]
__all__ = ["io"] | __all__ = ['io'] |
{
'target_defaults': {
'default_configuration': 'Release',
'configurations': {
'Debug': {
'cflags': ['-g3', '-O0'],
'msvs_settings': {
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
'LinkIncremental': 2
}
}
},
'Release': {
'cflags': ['-O2', '-W', '-Wall', '-Wextra', '-ansi', '-pedantic'],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': 3, # -O3
'FavorSizeOrSpeed': 1, # favor speed
},
'VCLinkerTool': {
'OptimizeReferences': 2, # /OPT:REF
}
}
},
},
},
"targets": [
{
"target_name": "<(module_name)",
'lflags': ['-lm'],
"include_dirs": [
"zopfli/src/zopfli",
"zopfli/src/zopflipng",
"<!(node -e \"require('nan')\")"
],
"sources": [
"src/zopfli-binding.cc",
"src/png/zopflipng.cc",
"zopfli/src/zopfli/blocksplitter.c",
"zopfli/src/zopfli/cache.c",
"zopfli/src/zopfli/deflate.c",
"zopfli/src/zopfli/gzip_container.c",
"zopfli/src/zopfli/hash.c",
"zopfli/src/zopfli/katajainen.c",
"zopfli/src/zopfli/lz77.c",
"zopfli/src/zopfli/squeeze.c",
"zopfli/src/zopfli/tree.c",
"zopfli/src/zopfli/util.c",
"zopfli/src/zopfli/zlib_container.c",
"zopfli/src/zopfli/zopfli_lib.c",
"zopfli/src/zopflipng/zopflipng_lib.cc",
"zopfli/src/zopflipng/lodepng/lodepng.cpp",
"zopfli/src/zopflipng/lodepng/lodepng_util.cpp"
],
"cflags": [
"-Wall",
"-O3"
]
},
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"destination": "<(module_path)"
}
]
}
]
}
| {'target_defaults': {'default_configuration': 'Release', 'configurations': {'Debug': {'cflags': ['-g3', '-O0'], 'msvs_settings': {'VCLinkerTool': {'GenerateDebugInformation': 'true', 'LinkIncremental': 2}}}, 'Release': {'cflags': ['-O2', '-W', '-Wall', '-Wextra', '-ansi', '-pedantic'], 'msvs_settings': {'VCCLCompilerTool': {'Optimization': 3, 'FavorSizeOrSpeed': 1}, 'VCLinkerTool': {'OptimizeReferences': 2}}}}}, 'targets': [{'target_name': '<(module_name)', 'lflags': ['-lm'], 'include_dirs': ['zopfli/src/zopfli', 'zopfli/src/zopflipng', '<!(node -e "require(\'nan\')")'], 'sources': ['src/zopfli-binding.cc', 'src/png/zopflipng.cc', 'zopfli/src/zopfli/blocksplitter.c', 'zopfli/src/zopfli/cache.c', 'zopfli/src/zopfli/deflate.c', 'zopfli/src/zopfli/gzip_container.c', 'zopfli/src/zopfli/hash.c', 'zopfli/src/zopfli/katajainen.c', 'zopfli/src/zopfli/lz77.c', 'zopfli/src/zopfli/squeeze.c', 'zopfli/src/zopfli/tree.c', 'zopfli/src/zopfli/util.c', 'zopfli/src/zopfli/zlib_container.c', 'zopfli/src/zopfli/zopfli_lib.c', 'zopfli/src/zopflipng/zopflipng_lib.cc', 'zopfli/src/zopflipng/lodepng/lodepng.cpp', 'zopfli/src/zopflipng/lodepng/lodepng_util.cpp'], 'cflags': ['-Wall', '-O3']}, {'target_name': 'action_after_build', 'type': 'none', 'dependencies': ['<(module_name)'], 'copies': [{'files': ['<(PRODUCT_DIR)/<(module_name).node'], 'destination': '<(module_path)'}]}]} |
class Board():
# Initialize Board
def __init__(self):
'''Initialize the tiles with private attributes'''
self.__tiles = list(map(str, range(9)))
# Get tile value
def get_tile(self, index:int):
'''Getter for the tile'''
if self.__tiles[index] not in list(map(str, range(9))):
return self.__tiles[index]
else:
return str(int(self.__tiles[index])+1)
# Add symbol
def set_tile(self, symbol, coordinate:int):
'''Setter for the tile'''
if self.__tiles[coordinate] not in list(map(str, range(9))):
return False
self.__tiles[coordinate] = symbol
return True
# Print board
def possible_moves(self):
'''Returns a list of unoccupied tiles in the board'''
return [ index+1 for index in range(len(self.__tiles)) if self.__tiles[index] in list(map(str, range(9)))]
# Win condition
def check_board(self, symbol):
'''Check if the player won, cause a draw, or doesn't cause either'''
possible_combination = [
self.__tiles[:3], self.__tiles[3:6], self.__tiles[6:],
self.__tiles[::3],self.__tiles[1::3], self.__tiles[2::3],
self.__tiles[0::4], self.__tiles[2:8:2]
]
if len(list(filter(lambda x: x==[symbol]*3, possible_combination)))>0:
return symbol
elif not len(list(filter(lambda x: x in list(map(str, range(9))),self.__tiles))):
return 'DRAW'
else:
return False | class Board:
def __init__(self):
"""Initialize the tiles with private attributes"""
self.__tiles = list(map(str, range(9)))
def get_tile(self, index: int):
"""Getter for the tile"""
if self.__tiles[index] not in list(map(str, range(9))):
return self.__tiles[index]
else:
return str(int(self.__tiles[index]) + 1)
def set_tile(self, symbol, coordinate: int):
"""Setter for the tile"""
if self.__tiles[coordinate] not in list(map(str, range(9))):
return False
self.__tiles[coordinate] = symbol
return True
def possible_moves(self):
"""Returns a list of unoccupied tiles in the board"""
return [index + 1 for index in range(len(self.__tiles)) if self.__tiles[index] in list(map(str, range(9)))]
def check_board(self, symbol):
"""Check if the player won, cause a draw, or doesn't cause either"""
possible_combination = [self.__tiles[:3], self.__tiles[3:6], self.__tiles[6:], self.__tiles[::3], self.__tiles[1::3], self.__tiles[2::3], self.__tiles[0::4], self.__tiles[2:8:2]]
if len(list(filter(lambda x: x == [symbol] * 3, possible_combination))) > 0:
return symbol
elif not len(list(filter(lambda x: x in list(map(str, range(9))), self.__tiles))):
return 'DRAW'
else:
return False |
# -*- coding: utf-8 -*-
# if Statements
x = int(input("Please enter an integer: "))
if x < 0:
print('Negative number')
elif x > 0:
print('Positive number')
else:
print('Zero')
# for Statement
words = ['cat', 'window', 'door']
for w in words:
print(w, len(w))
# range(begin=0, end, step) Function
for i in range(5):
print(i) # 0 1 2 3 4
range(10) # -> an iterator
list(range(10)) # -> a list
# stay away from else Clauses on loops, anti-pattern
for n in range(10):
pass
else:
pass
# functions
def fib(n):
if n <= 0:
return 0
elif n == 1:
return 1
else:
return fib(n - 1) + fib(n - 2)
print('fib of 10', fib(10))
# default argument values
def ask_ok(prompt, retries=4, remider='Please try again'):
while True:
ok = input(prompt)
if ok in ('y', 'yes'):
return True
if ok in ('n', 'no'):
return False
retries = retries - 1
if retries < 0:
raise ValueError('invalid user')
print(remider)
# the scope of default argument values
i = 100
def foo(bar=i):
print(bar)
i = 6
foo() # 5
# default arguments caution
def f(a, L=None):
if L is None:
L = []
L.append(a)
return L
f(1) # [1]
f(2) # [2]
f(3) # [3]
# keyword arguments
def foo(a, b='b', c='c'):
pass
foo(1)
foo(1, c=3)
foo(b=2)
def cheeseshop(kind, *arguments, **keywords):
print("-- Do you have any", kind, "?")
print("-- I'm sorry, we're all out of", kind)
for arg in arguments:
print(arg)
print("-" * 40)
keys = sorted(keywords.keys())
for kw in keys:
print(kw, ":", keywords[kw])
cheeseshop(
"Limburger",
*[
"It's very runny, sir.",
"It's really very, VERY runny, sir.",
],
**{
"shopkeeper": "Michael Palin",
"client": "John Cleese",
"sketch": "Cheese Shop Sketch",
}
)
# -- Do you have any Limburger ?
# -- I'm sorry, we're all out of Limburger
# It's very runny, sir.
# It's really very, VERY runny, sir.
# ----------------------------------------
# client : John Cleese
# shopkeeper : Michael Palin
# sketch : Cheese Shop Sketch
# lambda expression
f = lambda x: x + n
# documentation strings
def func():
"""
it's func
"""
pass
print(func.__doc__)
# function annotations, but you can still pass other typed values
def f(ham: str, eggs: str = 'eggs') -> str:
print("Annotations:", f.__annotations__)
print("Arguments:", ham, eggs)
return ham + ' and ' + eggs
| x = int(input('Please enter an integer: '))
if x < 0:
print('Negative number')
elif x > 0:
print('Positive number')
else:
print('Zero')
words = ['cat', 'window', 'door']
for w in words:
print(w, len(w))
for i in range(5):
print(i)
range(10)
list(range(10))
for n in range(10):
pass
else:
pass
def fib(n):
if n <= 0:
return 0
elif n == 1:
return 1
else:
return fib(n - 1) + fib(n - 2)
print('fib of 10', fib(10))
def ask_ok(prompt, retries=4, remider='Please try again'):
while True:
ok = input(prompt)
if ok in ('y', 'yes'):
return True
if ok in ('n', 'no'):
return False
retries = retries - 1
if retries < 0:
raise value_error('invalid user')
print(remider)
i = 100
def foo(bar=i):
print(bar)
i = 6
foo()
def f(a, L=None):
if L is None:
l = []
L.append(a)
return L
f(1)
f(2)
f(3)
def foo(a, b='b', c='c'):
pass
foo(1)
foo(1, c=3)
foo(b=2)
def cheeseshop(kind, *arguments, **keywords):
print('-- Do you have any', kind, '?')
print("-- I'm sorry, we're all out of", kind)
for arg in arguments:
print(arg)
print('-' * 40)
keys = sorted(keywords.keys())
for kw in keys:
print(kw, ':', keywords[kw])
cheeseshop('Limburger', *["It's very runny, sir.", "It's really very, VERY runny, sir."], **{'shopkeeper': 'Michael Palin', 'client': 'John Cleese', 'sketch': 'Cheese Shop Sketch'})
f = lambda x: x + n
def func():
"""
it's func
"""
pass
print(func.__doc__)
def f(ham: str, eggs: str='eggs') -> str:
print('Annotations:', f.__annotations__)
print('Arguments:', ham, eggs)
return ham + ' and ' + eggs |
# Parsing file using list comprehension
file1 = open("test.txt", "r")
output = [i for i in file1 if "All" in i]
print(output) | file1 = open('test.txt', 'r')
output = [i for i in file1 if 'All' in i]
print(output) |
'''
Description : Use Of Forloop With Hardcoded Value
Function Date : 15 Feb 2021
Function Author : Prasad Dangare
Input : Int
Output : str
'''
def display():
print("Output of For loop")
icnt = 0
for icnt in range(10, 1, -1):
print(icnt)
else:
print("End of For loop")
def main():
display()
if __name__ == "__main__":
main() | """
Description : Use Of Forloop With Hardcoded Value
Function Date : 15 Feb 2021
Function Author : Prasad Dangare
Input : Int
Output : str
"""
def display():
print('Output of For loop')
icnt = 0
for icnt in range(10, 1, -1):
print(icnt)
else:
print('End of For loop')
def main():
display()
if __name__ == '__main__':
main() |
class AuthError(Exception):
"""Authentication error"""
def __init__(self, msg):
super(AuthError, self).__init__(msg)
class DocumentNotFound(Exception):
"""Could not found a requested document"""
def __init__(self, msg):
super(DocumentNotFound, self).__init__(msg)
class UnsupportedTypeError(Exception):
"""Not the expected type"""
def __init__(self, msg):
super(UnsupportedTypeError, self).__init__(msg)
class FolderNotFound(Exception):
"""Could not found a requested folder"""
def __init__(self, msg):
super(FolderNotFound, self).__init__(msg)
class ApiError(Exception):
"""Could not found a requested document"""
def __init__(self, msg, response=None):
self.response = response
super(ApiError, self).__init__(msg)
| class Autherror(Exception):
"""Authentication error"""
def __init__(self, msg):
super(AuthError, self).__init__(msg)
class Documentnotfound(Exception):
"""Could not found a requested document"""
def __init__(self, msg):
super(DocumentNotFound, self).__init__(msg)
class Unsupportedtypeerror(Exception):
"""Not the expected type"""
def __init__(self, msg):
super(UnsupportedTypeError, self).__init__(msg)
class Foldernotfound(Exception):
"""Could not found a requested folder"""
def __init__(self, msg):
super(FolderNotFound, self).__init__(msg)
class Apierror(Exception):
"""Could not found a requested document"""
def __init__(self, msg, response=None):
self.response = response
super(ApiError, self).__init__(msg) |
# Grocery list class
class GroceryList:
def __init__(self, initial_items=[]):
# Use a set, so that we don't get duplicates
self.grocery_list = set(initial_items)
def add(self, item):
# Use the lower case of the item so we don't get duplicates
self.grocery_list.add(item.lower())
def remove(self, item):
self.grocery_list.remove(item.lower())
def contains(self, item):
return item.lower() in self.grocery_list
def items(self):
return list(self.grocery_list)
#################
# Example usage
my_list = GroceryList()
my_list.add("strawberries")
my_list.add("wine")
my_list.add("gouda cheese")
if not my_list.contains("Crackers"):
my_list.add("crackers")
my_list.add("beer")
my_list.remove("beer")
print("My list has: ")
for item in my_list.items():
print ("\t",item) | class Grocerylist:
def __init__(self, initial_items=[]):
self.grocery_list = set(initial_items)
def add(self, item):
self.grocery_list.add(item.lower())
def remove(self, item):
self.grocery_list.remove(item.lower())
def contains(self, item):
return item.lower() in self.grocery_list
def items(self):
return list(self.grocery_list)
my_list = grocery_list()
my_list.add('strawberries')
my_list.add('wine')
my_list.add('gouda cheese')
if not my_list.contains('Crackers'):
my_list.add('crackers')
my_list.add('beer')
my_list.remove('beer')
print('My list has: ')
for item in my_list.items():
print('\t', item) |
{
'includes': [
'common.gypi',
],
'target_defaults': {
'conditions': [
['skia_os != "win"', {
'sources/': [ ['exclude', '_win.(h|cpp)$'],
],
}],
['skia_os != "mac"', {
'sources/': [ ['exclude', '_mac.(h|cpp)$'],
],
}],
['skia_os != "linux"', {
'sources/': [ ['exclude', '_unix.(h|cpp)$'],
],
}],
['skia_os != "ios"', {
'sources/': [ ['exclude', '_iOS.(h|cpp)$'],
],
}],
['skia_os != "android"', {
'sources/': [ ['exclude', '_android.(h|cpp)$'],
],
}],
[ 'skia_os == "android"', {
'defines': [
'GR_ANDROID_BUILD=1',
],
}],
[ 'skia_os == "mac"', {
'defines': [
'GR_MAC_BUILD=1',
],
}],
[ 'skia_os == "linux"', {
'defines': [
'GR_LINUX_BUILD=1',
],
}],
[ 'skia_os == "ios"', {
'defines': [
'GR_IOS_BUILD=1',
],
}],
[ 'skia_os == "win"', {
'defines': [
'GR_WIN32_BUILD=1',
],
}],
# nullify the targets in this gyp file if skia_gpu is 0
[ 'skia_gpu == 0', {
'sources/': [
['exclude', '.*'],
],
'defines/': [
['exclude', '.*'],
],
'include_dirs/': [
['exclude', '.*'],
],
'link_settings': {
'libraries/': [
['exclude', '.*'],
],
},
'direct_dependent_settings': {
'defines/': [
['exclude', '.*'],
],
'include_dirs/': [
['exclude', '.*'],
],
},
}],
],
'direct_dependent_settings': {
'conditions': [
[ 'skia_os == "android"', {
'defines': [
'GR_ANDROID_BUILD=1',
],
}],
[ 'skia_os == "mac"', {
'defines': [
'GR_MAC_BUILD=1',
],
}],
[ 'skia_os == "linux"', {
'defines': [
'GR_LINUX_BUILD=1',
],
}],
[ 'skia_os == "ios"', {
'defines': [
'GR_IOS_BUILD=1',
],
}],
[ 'skia_os == "win"', {
'defines': [
'GR_WIN32_BUILD=1',
'GR_GL_FUNCTION_TYPE=__stdcall',
],
}],
],
'include_dirs': [
'../deps/skia/include/gpu',
],
},
},
'targets': [
{
'target_name': 'skgr',
'type': 'static_library',
'include_dirs': [
'../deps/skia/include/config',
'../deps/skia/include/core',
'../deps/skia/src/core',
'../deps/skia/include/gpu',
'../deps/skia/src/gpu',
],
'dependencies': [
'angle.gyp:*',
],
'export_dependent_settings': [
'angle.gyp:*',
],
'sources': [
'../deps/skia/include/gpu/SkGpuCanvas.h',
'../deps/skia/include/gpu/SkGpuDevice.h',
'../deps/skia/include/gpu/SkGr.h',
'../deps/skia/include/gpu/SkGrPixelRef.h',
'../deps/skia/include/gpu/SkGrTexturePixelRef.h',
'../deps/skia/include/gpu/gl/SkGLContext.h',
'../deps/skia/include/gpu/gl/SkMesaGLContext.h',
'../deps/skia/include/gpu/gl/SkANGLEGLContext.h',
'../deps/skia/include/gpu/gl/SkNativeGLContext.h',
'../deps/skia/include/gpu/gl/SkNullGLContext.h',
'../deps/skia/include/gpu/gl/SkDebugGLContext.h',
'../deps/skia/src/gpu/SkGpuCanvas.cpp',
'../deps/skia/src/gpu/SkGpuDevice.cpp',
'../deps/skia/src/gpu/SkGr.cpp',
'../deps/skia/src/gpu/SkGrFontScaler.cpp',
'../deps/skia/src/gpu/SkGrPixelRef.cpp',
'../deps/skia/src/gpu/SkGrTexturePixelRef.cpp',
'../deps/skia/src/gpu/gl/SkGLContext.cpp',
'../deps/skia/src/gpu/gl/SkNullGLContext.cpp',
'../deps/skia/src/gpu/gl/debug/SkDebugGLContext.cpp',
'../deps/skia/src/gpu/gl/mac/SkNativeGLContext_mac.cpp',
'../deps/skia/src/gpu/gl/win/SkNativeGLContext_win.cpp',
'../deps/skia/src/gpu/gl/unix/SkNativeGLContext_unix.cpp',
'../deps/skia/src/gpu/gl/mesa/SkMesaGLContext.cpp',
'../deps/skia/src/gpu/gl/angle/SkANGLEGLContext.cpp',
'../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp',
'../deps/skia/src/gpu/android/SkNativeGLContext_android.cpp',
],
'conditions': [
[ 'not skia_mesa', {
'sources!': [
'../deps/skia/src/gpu/gl/mesa/SkMesaGLContext.cpp',
],
}],
[ 'skia_mesa and skia_os == "mac"', {
'include_dirs': [
'$(SDKROOT)/usr/X11/include/',
],
}],
[ 'not skia_angle', {
'sources!': [
'../deps/skia/include/gpu/gl/SkANGLEGLContext.h',
'../deps/skia/src/gpu/gl/angle/SkANGLEGLContext.cpp',
'../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp',
],
}],
],
},
{
'target_name': 'gr',
'type': 'static_library',
'include_dirs': [
'../deps/skia/include/core',
'../deps/skia/include/config',
'../deps/skia/include/gpu',
'../deps/skia/src/core', # SkRasterClip.h
'../deps/skia/src/gpu'
],
'dependencies': [
'angle.gyp:*',
],
'export_dependent_settings': [
'angle.gyp:*',
],
'sources': [
'../deps/skia/include/gpu/GrAARectRenderer.h',
'../deps/skia/include/gpu/GrClipData.h',
'../deps/skia/include/gpu/GrColor.h',
'../deps/skia/include/gpu/GrConfig.h',
'../deps/skia/include/gpu/GrContext.h',
'../deps/skia/include/gpu/GrContextFactory.h',
'../deps/skia/include/gpu/GrCustomStage.h',
'../deps/skia/include/gpu/GrCustomStageUnitTest.h',
'../deps/skia/include/gpu/GrFontScaler.h',
'../deps/skia/include/gpu/GrGlyph.h',
'../deps/skia/include/gpu/GrInstanceCounter.h',
'../deps/skia/include/gpu/GrKey.h',
'../deps/skia/include/gpu/GrMatrix.h',
'../deps/skia/include/gpu/GrNoncopyable.h',
'../deps/skia/include/gpu/GrPaint.h',
'../deps/skia/include/gpu/GrPoint.h',
'../deps/skia/include/gpu/GrProgramStageFactory.h',
'../deps/skia/include/gpu/GrRect.h',
'../deps/skia/include/gpu/GrRefCnt.h',
'../deps/skia/include/gpu/GrRenderTarget.h',
'../deps/skia/include/gpu/GrResource.h',
'../deps/skia/include/gpu/GrSamplerState.h',
'../deps/skia/include/gpu/GrScalar.h',
'../deps/skia/include/gpu/GrSurface.h',
'../deps/skia/include/gpu/GrTextContext.h',
'../deps/skia/include/gpu/GrTexture.h',
'../deps/skia/include/gpu/GrTypes.h',
'../deps/skia/include/gpu/GrUserConfig.h',
'../deps/skia/include/gpu/gl/GrGLConfig.h',
'../deps/skia/include/gpu/gl/GrGLConfig_chrome.h',
'../deps/skia/include/gpu/gl/GrGLFunctions.h',
'../deps/skia/include/gpu/gl/GrGLInterface.h',
'../deps/skia/src/gpu/GrAAHairLinePathRenderer.cpp',
'../deps/skia/src/gpu/GrAAHairLinePathRenderer.h',
'../deps/skia/src/gpu/GrAAConvexPathRenderer.cpp',
'../deps/skia/src/gpu/GrAAConvexPathRenderer.h',
'../deps/skia/src/gpu/GrAARectRenderer.cpp',
'../deps/skia/src/gpu/GrAddPathRenderers_default.cpp',
'../deps/skia/src/gpu/GrAllocator.h',
'../deps/skia/src/gpu/GrAllocPool.h',
'../deps/skia/src/gpu/GrAllocPool.cpp',
'../deps/skia/src/gpu/GrAtlas.cpp',
'../deps/skia/src/gpu/GrAtlas.h',
'../deps/skia/src/gpu/GrBinHashKey.h',
'../deps/skia/src/gpu/GrBufferAllocPool.cpp',
'../deps/skia/src/gpu/GrBufferAllocPool.h',
'../deps/skia/src/gpu/GrClipData.cpp',
'../deps/skia/src/gpu/GrContext.cpp',
'../deps/skia/src/gpu/GrCustomStage.cpp',
'../deps/skia/src/gpu/GrDefaultPathRenderer.cpp',
'../deps/skia/src/gpu/GrDefaultPathRenderer.h',
'../deps/skia/src/gpu/GrDrawState.h',
'../deps/skia/src/gpu/GrDrawTarget.cpp',
'../deps/skia/src/gpu/GrDrawTarget.h',
'../deps/skia/src/gpu/GrGeometryBuffer.h',
'../deps/skia/src/gpu/GrClipMaskManager.h',
'../deps/skia/src/gpu/GrClipMaskManager.cpp',
'../deps/skia/src/gpu/GrGpu.cpp',
'../deps/skia/src/gpu/GrGpu.h',
'../deps/skia/src/gpu/GrGpuFactory.cpp',
'../deps/skia/src/gpu/GrGpuVertex.h',
'../deps/skia/src/gpu/GrIndexBuffer.h',
'../deps/skia/src/gpu/GrInOrderDrawBuffer.cpp',
'../deps/skia/src/gpu/GrInOrderDrawBuffer.h',
'../deps/skia/src/gpu/GrMatrix.cpp',
'../deps/skia/src/gpu/GrMemory.cpp',
'../deps/skia/src/gpu/GrMemoryPool.cpp',
'../deps/skia/src/gpu/GrMemoryPool.h',
'../deps/skia/src/gpu/GrPath.h',
'../deps/skia/src/gpu/GrPathRendererChain.cpp',
'../deps/skia/src/gpu/GrPathRendererChain.h',
'../deps/skia/src/gpu/GrPathRenderer.cpp',
'../deps/skia/src/gpu/GrPathRenderer.h',
'../deps/skia/src/gpu/GrPathUtils.cpp',
'../deps/skia/src/gpu/GrPathUtils.h',
'../deps/skia/src/gpu/GrPlotMgr.h',
'../deps/skia/src/gpu/GrRandom.h',
'../deps/skia/src/gpu/GrRectanizer.cpp',
'../deps/skia/src/gpu/GrRectanizer.h',
'../deps/skia/src/gpu/GrRedBlackTree.h',
'../deps/skia/src/gpu/GrRenderTarget.cpp',
'../deps/skia/src/gpu/GrResource.cpp',
'../deps/skia/src/gpu/GrResourceCache.cpp',
'../deps/skia/src/gpu/GrResourceCache.h',
'../deps/skia/src/gpu/GrStencil.cpp',
'../deps/skia/src/gpu/GrStencil.h',
'../deps/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp',
'../deps/skia/src/gpu/GrStencilAndCoverPathRenderer.h',
'../deps/skia/src/gpu/GrStencilBuffer.cpp',
'../deps/skia/src/gpu/GrStencilBuffer.h',
'../deps/skia/src/gpu/GrTBSearch.h',
'../deps/skia/src/gpu/GrTDArray.h',
'../deps/skia/src/gpu/GrSWMaskHelper.cpp',
'../deps/skia/src/gpu/GrSWMaskHelper.h',
'../deps/skia/src/gpu/GrSoftwarePathRenderer.cpp',
'../deps/skia/src/gpu/GrSoftwarePathRenderer.h',
'../deps/skia/src/gpu/GrSurface.cpp',
'../deps/skia/src/gpu/GrTemplates.h',
'../deps/skia/src/gpu/GrTextContext.cpp',
'../deps/skia/src/gpu/GrTextStrike.cpp',
'../deps/skia/src/gpu/GrTextStrike.h',
'../deps/skia/src/gpu/GrTextStrike_impl.h',
'../deps/skia/src/gpu/GrTexture.cpp',
'../deps/skia/src/gpu/GrTHashCache.h',
'../deps/skia/src/gpu/GrTLList.h',
'../deps/skia/src/gpu/GrVertexBuffer.h',
'../deps/skia/src/gpu/gr_unittests.cpp',
'../deps/skia/src/gpu/effects/Gr1DKernelEffect.h',
'../deps/skia/src/gpu/effects/GrColorTableEffect.cpp',
'../deps/skia/src/gpu/effects/GrColorTableEffect.h',
'../deps/skia/src/gpu/effects/GrConvolutionEffect.cpp',
'../deps/skia/src/gpu/effects/GrConvolutionEffect.h',
'../deps/skia/src/gpu/effects/GrMorphologyEffect.cpp',
'../deps/skia/src/gpu/effects/GrMorphologyEffect.h',
'../deps/skia/src/gpu/effects/GrSingleTextureEffect.cpp',
'../deps/skia/src/gpu/effects/GrSingleTextureEffect.h',
'../deps/skia/src/gpu/effects/GrTextureDomainEffect.cpp',
'../deps/skia/src/gpu/effects/GrTextureDomainEffect.h',
'../deps/skia/src/gpu/gl/GrGLCaps.cpp',
'../deps/skia/src/gpu/gl/GrGLCaps.h',
'../deps/skia/src/gpu/gl/GrGLContextInfo.cpp',
'../deps/skia/src/gpu/gl/GrGLContextInfo.h',
'../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
'../deps/skia/src/gpu/gl/GrGLCreateNullInterface.cpp',
'../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp',
'../deps/skia/src/gpu/gl/GrGLDefaultInterface_native.cpp',
'../deps/skia/src/gpu/gl/GrGLDefines.h',
'../deps/skia/src/gpu/gl/GrGLIndexBuffer.cpp',
'../deps/skia/src/gpu/gl/GrGLIndexBuffer.h',
'../deps/skia/src/gpu/gl/GrGLInterface.cpp',
'../deps/skia/src/gpu/gl/GrGLIRect.h',
'../deps/skia/src/gpu/gl/GrGLPath.cpp',
'../deps/skia/src/gpu/gl/GrGLPath.h',
'../deps/skia/src/gpu/gl/GrGLProgram.cpp',
'../deps/skia/src/gpu/gl/GrGLProgram.h',
'../deps/skia/src/gpu/gl/GrGLProgramStage.cpp',
'../deps/skia/src/gpu/gl/GrGLProgramStage.h',
'../deps/skia/src/gpu/gl/GrGLRenderTarget.cpp',
'../deps/skia/src/gpu/gl/GrGLRenderTarget.h',
'../deps/skia/src/gpu/gl/GrGLShaderBuilder.cpp',
'../deps/skia/src/gpu/gl/GrGLShaderBuilder.h',
'../deps/skia/src/gpu/gl/GrGLShaderVar.h',
'../deps/skia/src/gpu/gl/GrGLSL.cpp',
'../deps/skia/src/gpu/gl/GrGLSL.h',
'../deps/skia/src/gpu/gl/GrGLStencilBuffer.cpp',
'../deps/skia/src/gpu/gl/GrGLStencilBuffer.h',
'../deps/skia/src/gpu/gl/GrGLTexture.cpp',
'../deps/skia/src/gpu/gl/GrGLTexture.h',
'../deps/skia/src/gpu/gl/GrGLUtil.cpp',
'../deps/skia/src/gpu/gl/GrGLUtil.h',
'../deps/skia/src/gpu/gl/GrGLUniformManager.cpp',
'../deps/skia/src/gpu/gl/GrGLUniformManager.h',
'../deps/skia/src/gpu/gl/GrGLUniformHandle.h',
'../deps/skia/src/gpu/gl/GrGLVertexBuffer.cpp',
'../deps/skia/src/gpu/gl/GrGLVertexBuffer.h',
'../deps/skia/src/gpu/gl/GrGpuGL.cpp',
'../deps/skia/src/gpu/gl/GrGpuGL.h',
'../deps/skia/src/gpu/gl/GrGpuGL_program.cpp',
'../deps/skia/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp',
'../deps/skia/src/gpu/gl/debug/GrFakeRefObj.h',
'../deps/skia/src/gpu/gl/debug/GrBufferObj.h',
'../deps/skia/src/gpu/gl/debug/GrBufferObj.cpp',
'../deps/skia/src/gpu/gl/debug/GrFBBindableObj.h',
'../deps/skia/src/gpu/gl/debug/GrRenderBufferObj.h',
'../deps/skia/src/gpu/gl/debug/GrTextureObj.h',
'../deps/skia/src/gpu/gl/debug/GrTextureObj.cpp',
'../deps/skia/src/gpu/gl/debug/GrTextureUnitObj.h',
'../deps/skia/src/gpu/gl/debug/GrTextureUnitObj.cpp',
'../deps/skia/src/gpu/gl/debug/GrFrameBufferObj.h',
'../deps/skia/src/gpu/gl/debug/GrFrameBufferObj.cpp',
'../deps/skia/src/gpu/gl/debug/GrShaderObj.h',
'../deps/skia/src/gpu/gl/debug/GrShaderObj.cpp',
'../deps/skia/src/gpu/gl/debug/GrProgramObj.h',
'../deps/skia/src/gpu/gl/debug/GrProgramObj.cpp',
'../deps/skia/src/gpu/gl/debug/GrDebugGL.h',
'../deps/skia/src/gpu/gl/debug/GrDebugGL.cpp',
'../deps/skia/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp',
'../deps/skia/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp',
'../deps/skia/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp',
'../deps/skia/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
'../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp',
'../deps/skia/src/gpu/android/GrGLCreateNativeInterface_android.cpp',
],
'defines': [
'GR_IMPLEMENTATION=1',
],
'conditions': [
[ 'skia_nv_path_rendering', {
'defines': [
'GR_GL_USE_NV_PATH_RENDERING=1',
],
}],
[ 'skia_os == "linux"', {
'sources!': [
'../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp',
'../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
],
'link_settings': {
'libraries': [
'-lGL',
'-lX11',
],
},
}],
[ 'skia_mesa and skia_os == "linux"', {
'link_settings': {
'libraries': [
'-lOSMesa',
],
},
}],
[ 'skia_os == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
],
},
'sources!': [
'../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp',
'../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
],
}],
[ 'skia_mesa and skia_os == "mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/usr/X11/lib/libOSMesa.dylib',
],
},
'include_dirs': [
'$(SDKROOT)/usr/X11/include/',
],
}],
[ 'not skia_mesa', {
'sources!': [
'../deps/skia/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
],
}],
[ 'skia_os == "win"', {
'sources!': [
'../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp',
'../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
],
}],
[ 'not skia_angle', {
'sources!': [
'../deps/skia/include/gpu/gl/SkANGLEGLContext.h',
'../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp',
'../deps/skia/src/gpu/gl/angle/SkANGLEGLContext.cpp',
],
}],
[ 'skia_os == "android"', {
'sources!': [
'../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp',
'../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
],
'link_settings': {
'libraries': [
'-lGLESv2',
'-lEGL',
],
},
}],
],
},
],
}
# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2:
| {'includes': ['common.gypi'], 'target_defaults': {'conditions': [['skia_os != "win"', {'sources/': [['exclude', '_win.(h|cpp)$']]}], ['skia_os != "mac"', {'sources/': [['exclude', '_mac.(h|cpp)$']]}], ['skia_os != "linux"', {'sources/': [['exclude', '_unix.(h|cpp)$']]}], ['skia_os != "ios"', {'sources/': [['exclude', '_iOS.(h|cpp)$']]}], ['skia_os != "android"', {'sources/': [['exclude', '_android.(h|cpp)$']]}], ['skia_os == "android"', {'defines': ['GR_ANDROID_BUILD=1']}], ['skia_os == "mac"', {'defines': ['GR_MAC_BUILD=1']}], ['skia_os == "linux"', {'defines': ['GR_LINUX_BUILD=1']}], ['skia_os == "ios"', {'defines': ['GR_IOS_BUILD=1']}], ['skia_os == "win"', {'defines': ['GR_WIN32_BUILD=1']}], ['skia_gpu == 0', {'sources/': [['exclude', '.*']], 'defines/': [['exclude', '.*']], 'include_dirs/': [['exclude', '.*']], 'link_settings': {'libraries/': [['exclude', '.*']]}, 'direct_dependent_settings': {'defines/': [['exclude', '.*']], 'include_dirs/': [['exclude', '.*']]}}]], 'direct_dependent_settings': {'conditions': [['skia_os == "android"', {'defines': ['GR_ANDROID_BUILD=1']}], ['skia_os == "mac"', {'defines': ['GR_MAC_BUILD=1']}], ['skia_os == "linux"', {'defines': ['GR_LINUX_BUILD=1']}], ['skia_os == "ios"', {'defines': ['GR_IOS_BUILD=1']}], ['skia_os == "win"', {'defines': ['GR_WIN32_BUILD=1', 'GR_GL_FUNCTION_TYPE=__stdcall']}]], 'include_dirs': ['../deps/skia/include/gpu']}}, 'targets': [{'target_name': 'skgr', 'type': 'static_library', 'include_dirs': ['../deps/skia/include/config', '../deps/skia/include/core', '../deps/skia/src/core', '../deps/skia/include/gpu', '../deps/skia/src/gpu'], 'dependencies': ['angle.gyp:*'], 'export_dependent_settings': ['angle.gyp:*'], 'sources': ['../deps/skia/include/gpu/SkGpuCanvas.h', '../deps/skia/include/gpu/SkGpuDevice.h', '../deps/skia/include/gpu/SkGr.h', '../deps/skia/include/gpu/SkGrPixelRef.h', '../deps/skia/include/gpu/SkGrTexturePixelRef.h', '../deps/skia/include/gpu/gl/SkGLContext.h', '../deps/skia/include/gpu/gl/SkMesaGLContext.h', '../deps/skia/include/gpu/gl/SkANGLEGLContext.h', '../deps/skia/include/gpu/gl/SkNativeGLContext.h', '../deps/skia/include/gpu/gl/SkNullGLContext.h', '../deps/skia/include/gpu/gl/SkDebugGLContext.h', '../deps/skia/src/gpu/SkGpuCanvas.cpp', '../deps/skia/src/gpu/SkGpuDevice.cpp', '../deps/skia/src/gpu/SkGr.cpp', '../deps/skia/src/gpu/SkGrFontScaler.cpp', '../deps/skia/src/gpu/SkGrPixelRef.cpp', '../deps/skia/src/gpu/SkGrTexturePixelRef.cpp', '../deps/skia/src/gpu/gl/SkGLContext.cpp', '../deps/skia/src/gpu/gl/SkNullGLContext.cpp', '../deps/skia/src/gpu/gl/debug/SkDebugGLContext.cpp', '../deps/skia/src/gpu/gl/mac/SkNativeGLContext_mac.cpp', '../deps/skia/src/gpu/gl/win/SkNativeGLContext_win.cpp', '../deps/skia/src/gpu/gl/unix/SkNativeGLContext_unix.cpp', '../deps/skia/src/gpu/gl/mesa/SkMesaGLContext.cpp', '../deps/skia/src/gpu/gl/angle/SkANGLEGLContext.cpp', '../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp', '../deps/skia/src/gpu/android/SkNativeGLContext_android.cpp'], 'conditions': [['not skia_mesa', {'sources!': ['../deps/skia/src/gpu/gl/mesa/SkMesaGLContext.cpp']}], ['skia_mesa and skia_os == "mac"', {'include_dirs': ['$(SDKROOT)/usr/X11/include/']}], ['not skia_angle', {'sources!': ['../deps/skia/include/gpu/gl/SkANGLEGLContext.h', '../deps/skia/src/gpu/gl/angle/SkANGLEGLContext.cpp', '../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp']}]]}, {'target_name': 'gr', 'type': 'static_library', 'include_dirs': ['../deps/skia/include/core', '../deps/skia/include/config', '../deps/skia/include/gpu', '../deps/skia/src/core', '../deps/skia/src/gpu'], 'dependencies': ['angle.gyp:*'], 'export_dependent_settings': ['angle.gyp:*'], 'sources': ['../deps/skia/include/gpu/GrAARectRenderer.h', '../deps/skia/include/gpu/GrClipData.h', '../deps/skia/include/gpu/GrColor.h', '../deps/skia/include/gpu/GrConfig.h', '../deps/skia/include/gpu/GrContext.h', '../deps/skia/include/gpu/GrContextFactory.h', '../deps/skia/include/gpu/GrCustomStage.h', '../deps/skia/include/gpu/GrCustomStageUnitTest.h', '../deps/skia/include/gpu/GrFontScaler.h', '../deps/skia/include/gpu/GrGlyph.h', '../deps/skia/include/gpu/GrInstanceCounter.h', '../deps/skia/include/gpu/GrKey.h', '../deps/skia/include/gpu/GrMatrix.h', '../deps/skia/include/gpu/GrNoncopyable.h', '../deps/skia/include/gpu/GrPaint.h', '../deps/skia/include/gpu/GrPoint.h', '../deps/skia/include/gpu/GrProgramStageFactory.h', '../deps/skia/include/gpu/GrRect.h', '../deps/skia/include/gpu/GrRefCnt.h', '../deps/skia/include/gpu/GrRenderTarget.h', '../deps/skia/include/gpu/GrResource.h', '../deps/skia/include/gpu/GrSamplerState.h', '../deps/skia/include/gpu/GrScalar.h', '../deps/skia/include/gpu/GrSurface.h', '../deps/skia/include/gpu/GrTextContext.h', '../deps/skia/include/gpu/GrTexture.h', '../deps/skia/include/gpu/GrTypes.h', '../deps/skia/include/gpu/GrUserConfig.h', '../deps/skia/include/gpu/gl/GrGLConfig.h', '../deps/skia/include/gpu/gl/GrGLConfig_chrome.h', '../deps/skia/include/gpu/gl/GrGLFunctions.h', '../deps/skia/include/gpu/gl/GrGLInterface.h', '../deps/skia/src/gpu/GrAAHairLinePathRenderer.cpp', '../deps/skia/src/gpu/GrAAHairLinePathRenderer.h', '../deps/skia/src/gpu/GrAAConvexPathRenderer.cpp', '../deps/skia/src/gpu/GrAAConvexPathRenderer.h', '../deps/skia/src/gpu/GrAARectRenderer.cpp', '../deps/skia/src/gpu/GrAddPathRenderers_default.cpp', '../deps/skia/src/gpu/GrAllocator.h', '../deps/skia/src/gpu/GrAllocPool.h', '../deps/skia/src/gpu/GrAllocPool.cpp', '../deps/skia/src/gpu/GrAtlas.cpp', '../deps/skia/src/gpu/GrAtlas.h', '../deps/skia/src/gpu/GrBinHashKey.h', '../deps/skia/src/gpu/GrBufferAllocPool.cpp', '../deps/skia/src/gpu/GrBufferAllocPool.h', '../deps/skia/src/gpu/GrClipData.cpp', '../deps/skia/src/gpu/GrContext.cpp', '../deps/skia/src/gpu/GrCustomStage.cpp', '../deps/skia/src/gpu/GrDefaultPathRenderer.cpp', '../deps/skia/src/gpu/GrDefaultPathRenderer.h', '../deps/skia/src/gpu/GrDrawState.h', '../deps/skia/src/gpu/GrDrawTarget.cpp', '../deps/skia/src/gpu/GrDrawTarget.h', '../deps/skia/src/gpu/GrGeometryBuffer.h', '../deps/skia/src/gpu/GrClipMaskManager.h', '../deps/skia/src/gpu/GrClipMaskManager.cpp', '../deps/skia/src/gpu/GrGpu.cpp', '../deps/skia/src/gpu/GrGpu.h', '../deps/skia/src/gpu/GrGpuFactory.cpp', '../deps/skia/src/gpu/GrGpuVertex.h', '../deps/skia/src/gpu/GrIndexBuffer.h', '../deps/skia/src/gpu/GrInOrderDrawBuffer.cpp', '../deps/skia/src/gpu/GrInOrderDrawBuffer.h', '../deps/skia/src/gpu/GrMatrix.cpp', '../deps/skia/src/gpu/GrMemory.cpp', '../deps/skia/src/gpu/GrMemoryPool.cpp', '../deps/skia/src/gpu/GrMemoryPool.h', '../deps/skia/src/gpu/GrPath.h', '../deps/skia/src/gpu/GrPathRendererChain.cpp', '../deps/skia/src/gpu/GrPathRendererChain.h', '../deps/skia/src/gpu/GrPathRenderer.cpp', '../deps/skia/src/gpu/GrPathRenderer.h', '../deps/skia/src/gpu/GrPathUtils.cpp', '../deps/skia/src/gpu/GrPathUtils.h', '../deps/skia/src/gpu/GrPlotMgr.h', '../deps/skia/src/gpu/GrRandom.h', '../deps/skia/src/gpu/GrRectanizer.cpp', '../deps/skia/src/gpu/GrRectanizer.h', '../deps/skia/src/gpu/GrRedBlackTree.h', '../deps/skia/src/gpu/GrRenderTarget.cpp', '../deps/skia/src/gpu/GrResource.cpp', '../deps/skia/src/gpu/GrResourceCache.cpp', '../deps/skia/src/gpu/GrResourceCache.h', '../deps/skia/src/gpu/GrStencil.cpp', '../deps/skia/src/gpu/GrStencil.h', '../deps/skia/src/gpu/GrStencilAndCoverPathRenderer.cpp', '../deps/skia/src/gpu/GrStencilAndCoverPathRenderer.h', '../deps/skia/src/gpu/GrStencilBuffer.cpp', '../deps/skia/src/gpu/GrStencilBuffer.h', '../deps/skia/src/gpu/GrTBSearch.h', '../deps/skia/src/gpu/GrTDArray.h', '../deps/skia/src/gpu/GrSWMaskHelper.cpp', '../deps/skia/src/gpu/GrSWMaskHelper.h', '../deps/skia/src/gpu/GrSoftwarePathRenderer.cpp', '../deps/skia/src/gpu/GrSoftwarePathRenderer.h', '../deps/skia/src/gpu/GrSurface.cpp', '../deps/skia/src/gpu/GrTemplates.h', '../deps/skia/src/gpu/GrTextContext.cpp', '../deps/skia/src/gpu/GrTextStrike.cpp', '../deps/skia/src/gpu/GrTextStrike.h', '../deps/skia/src/gpu/GrTextStrike_impl.h', '../deps/skia/src/gpu/GrTexture.cpp', '../deps/skia/src/gpu/GrTHashCache.h', '../deps/skia/src/gpu/GrTLList.h', '../deps/skia/src/gpu/GrVertexBuffer.h', '../deps/skia/src/gpu/gr_unittests.cpp', '../deps/skia/src/gpu/effects/Gr1DKernelEffect.h', '../deps/skia/src/gpu/effects/GrColorTableEffect.cpp', '../deps/skia/src/gpu/effects/GrColorTableEffect.h', '../deps/skia/src/gpu/effects/GrConvolutionEffect.cpp', '../deps/skia/src/gpu/effects/GrConvolutionEffect.h', '../deps/skia/src/gpu/effects/GrMorphologyEffect.cpp', '../deps/skia/src/gpu/effects/GrMorphologyEffect.h', '../deps/skia/src/gpu/effects/GrSingleTextureEffect.cpp', '../deps/skia/src/gpu/effects/GrSingleTextureEffect.h', '../deps/skia/src/gpu/effects/GrTextureDomainEffect.cpp', '../deps/skia/src/gpu/effects/GrTextureDomainEffect.h', '../deps/skia/src/gpu/gl/GrGLCaps.cpp', '../deps/skia/src/gpu/gl/GrGLCaps.h', '../deps/skia/src/gpu/gl/GrGLContextInfo.cpp', '../deps/skia/src/gpu/gl/GrGLContextInfo.h', '../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp', '../deps/skia/src/gpu/gl/GrGLCreateNullInterface.cpp', '../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp', '../deps/skia/src/gpu/gl/GrGLDefaultInterface_native.cpp', '../deps/skia/src/gpu/gl/GrGLDefines.h', '../deps/skia/src/gpu/gl/GrGLIndexBuffer.cpp', '../deps/skia/src/gpu/gl/GrGLIndexBuffer.h', '../deps/skia/src/gpu/gl/GrGLInterface.cpp', '../deps/skia/src/gpu/gl/GrGLIRect.h', '../deps/skia/src/gpu/gl/GrGLPath.cpp', '../deps/skia/src/gpu/gl/GrGLPath.h', '../deps/skia/src/gpu/gl/GrGLProgram.cpp', '../deps/skia/src/gpu/gl/GrGLProgram.h', '../deps/skia/src/gpu/gl/GrGLProgramStage.cpp', '../deps/skia/src/gpu/gl/GrGLProgramStage.h', '../deps/skia/src/gpu/gl/GrGLRenderTarget.cpp', '../deps/skia/src/gpu/gl/GrGLRenderTarget.h', '../deps/skia/src/gpu/gl/GrGLShaderBuilder.cpp', '../deps/skia/src/gpu/gl/GrGLShaderBuilder.h', '../deps/skia/src/gpu/gl/GrGLShaderVar.h', '../deps/skia/src/gpu/gl/GrGLSL.cpp', '../deps/skia/src/gpu/gl/GrGLSL.h', '../deps/skia/src/gpu/gl/GrGLStencilBuffer.cpp', '../deps/skia/src/gpu/gl/GrGLStencilBuffer.h', '../deps/skia/src/gpu/gl/GrGLTexture.cpp', '../deps/skia/src/gpu/gl/GrGLTexture.h', '../deps/skia/src/gpu/gl/GrGLUtil.cpp', '../deps/skia/src/gpu/gl/GrGLUtil.h', '../deps/skia/src/gpu/gl/GrGLUniformManager.cpp', '../deps/skia/src/gpu/gl/GrGLUniformManager.h', '../deps/skia/src/gpu/gl/GrGLUniformHandle.h', '../deps/skia/src/gpu/gl/GrGLVertexBuffer.cpp', '../deps/skia/src/gpu/gl/GrGLVertexBuffer.h', '../deps/skia/src/gpu/gl/GrGpuGL.cpp', '../deps/skia/src/gpu/gl/GrGpuGL.h', '../deps/skia/src/gpu/gl/GrGpuGL_program.cpp', '../deps/skia/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp', '../deps/skia/src/gpu/gl/debug/GrFakeRefObj.h', '../deps/skia/src/gpu/gl/debug/GrBufferObj.h', '../deps/skia/src/gpu/gl/debug/GrBufferObj.cpp', '../deps/skia/src/gpu/gl/debug/GrFBBindableObj.h', '../deps/skia/src/gpu/gl/debug/GrRenderBufferObj.h', '../deps/skia/src/gpu/gl/debug/GrTextureObj.h', '../deps/skia/src/gpu/gl/debug/GrTextureObj.cpp', '../deps/skia/src/gpu/gl/debug/GrTextureUnitObj.h', '../deps/skia/src/gpu/gl/debug/GrTextureUnitObj.cpp', '../deps/skia/src/gpu/gl/debug/GrFrameBufferObj.h', '../deps/skia/src/gpu/gl/debug/GrFrameBufferObj.cpp', '../deps/skia/src/gpu/gl/debug/GrShaderObj.h', '../deps/skia/src/gpu/gl/debug/GrShaderObj.cpp', '../deps/skia/src/gpu/gl/debug/GrProgramObj.h', '../deps/skia/src/gpu/gl/debug/GrProgramObj.cpp', '../deps/skia/src/gpu/gl/debug/GrDebugGL.h', '../deps/skia/src/gpu/gl/debug/GrDebugGL.cpp', '../deps/skia/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp', '../deps/skia/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp', '../deps/skia/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp', '../deps/skia/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp', '../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp', '../deps/skia/src/gpu/android/GrGLCreateNativeInterface_android.cpp'], 'defines': ['GR_IMPLEMENTATION=1'], 'conditions': [['skia_nv_path_rendering', {'defines': ['GR_GL_USE_NV_PATH_RENDERING=1']}], ['skia_os == "linux"', {'sources!': ['../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp', '../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp'], 'link_settings': {'libraries': ['-lGL', '-lX11']}}], ['skia_mesa and skia_os == "linux"', {'link_settings': {'libraries': ['-lOSMesa']}}], ['skia_os == "mac"', {'link_settings': {'libraries': ['$(SDKROOT)/System/Library/Frameworks/OpenGL.framework']}, 'sources!': ['../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp', '../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp']}], ['skia_mesa and skia_os == "mac"', {'link_settings': {'libraries': ['$(SDKROOT)/usr/X11/lib/libOSMesa.dylib']}, 'include_dirs': ['$(SDKROOT)/usr/X11/include/']}], ['not skia_mesa', {'sources!': ['../deps/skia/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp']}], ['skia_os == "win"', {'sources!': ['../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp', '../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp']}], ['not skia_angle', {'sources!': ['../deps/skia/include/gpu/gl/SkANGLEGLContext.h', '../deps/skia/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp', '../deps/skia/src/gpu/gl/angle/SkANGLEGLContext.cpp']}], ['skia_os == "android"', {'sources!': ['../deps/skia/src/gpu/gl/GrGLDefaultInterface_none.cpp', '../deps/skia/src/gpu/gl/GrGLCreateNativeInterface_none.cpp'], 'link_settings': {'libraries': ['-lGLESv2', '-lEGL']}}]]}]} |
def pares(num):
valores_pares = 0
for n in num:
if n % 2 == 0:
valores_pares += 1
return print(f'{valores_pares} valor(es) par(es)')
def impares(num):
valores_impares = 0
for n in num:
if n % 2 != 0:
valores_impares += 1
return print(f'{valores_impares} valor(es) impar(es)')
def positivos(num):
valores_positivos = 0
for n in num:
if n > 0:
valores_positivos += 1
return print(f'{valores_positivos} valor(es) positivo(s)')
def negativos(num):
valores_negativos = 0
for n in num:
if n < 0:
valores_negativos += 1
return print(f'{valores_negativos} valor(es) negativo(s)')
def entrada():
numeros = list()
for i in range(5):
numeros.append(int(input()))
return numeros
numbers = entrada()
pares(numbers)
impares(numbers)
positivos(numbers)
negativos(numbers)
| def pares(num):
valores_pares = 0
for n in num:
if n % 2 == 0:
valores_pares += 1
return print(f'{valores_pares} valor(es) par(es)')
def impares(num):
valores_impares = 0
for n in num:
if n % 2 != 0:
valores_impares += 1
return print(f'{valores_impares} valor(es) impar(es)')
def positivos(num):
valores_positivos = 0
for n in num:
if n > 0:
valores_positivos += 1
return print(f'{valores_positivos} valor(es) positivo(s)')
def negativos(num):
valores_negativos = 0
for n in num:
if n < 0:
valores_negativos += 1
return print(f'{valores_negativos} valor(es) negativo(s)')
def entrada():
numeros = list()
for i in range(5):
numeros.append(int(input()))
return numeros
numbers = entrada()
pares(numbers)
impares(numbers)
positivos(numbers)
negativos(numbers) |
def insertShiftArray(list,val):
list[int(len(list)/2):int(len(list)/2)] = [val]
return list
| def insert_shift_array(list, val):
list[int(len(list) / 2):int(len(list) / 2)] = [val]
return list |
class Solution:
def findMaxLength(self, nums: List[int]) -> int:
c = 0
res = 0
dic = {0:-1}
for i in range(len(nums)):
n = nums[i]
if n == 1 : c += 1
else: c -= 1
if c in dic : res = max(res, i - dic[c])
else:dic[c] = i
return res | class Solution:
def find_max_length(self, nums: List[int]) -> int:
c = 0
res = 0
dic = {0: -1}
for i in range(len(nums)):
n = nums[i]
if n == 1:
c += 1
else:
c -= 1
if c in dic:
res = max(res, i - dic[c])
else:
dic[c] = i
return res |
# No Bugs in Production (NBP) Library
# https://github.com/aenachescu/nbplib
#
# Licensed under the MIT License <http://opensource.org/licenses/MIT>.
# SPDX-License-Identifier: MIT
# Copyright (c) 2019-2020 Alin Enachescu <https://github.com/aenachescu>
#
# 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.
supportedCompilersDict = {
"gcc-5": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-5"
},
"gcc-6": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-6"
},
"gcc-7": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-7"
},
"gcc-8": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-8"
},
"gcc-9": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-9"
},
"g++-5": {
"standards": [ "-std=c++03", "-std=c++11", "-std=c++14", "-std=c++17" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-5"
},
"g++-6": {
"standards": [ "-std=c++03", "-std=c++11", "-std=c++14", "-std=c++17" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-6"
},
"g++-7": {
"standards": [ "-std=c++03", "-std=c++11", "-std=c++14", "-std=c++17" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-7"
},
"g++-8": {
"standards": [ "-std=c++03", "-std=c++11", "-std=c++14", "-std=c++17" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-8"
},
"g++-9": {
"standards": [ "-std=c++03", "-std=c++11", "-std=c++14", "-std=c++17" ],
"platforms": [ "-m32", "-m64"],
"gcov_tool": "gcov-9"
},
"clang-5.0": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64" ],
"gcov_tool": "scripts/clang_cov/clang_cov_5.sh",
"gcov_tool_absolute_path": True
},
"clang-6.0": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64" ],
"gcov_tool": "scripts/clang_cov/clang_cov_6.sh",
"gcov_tool_absolute_path": True
},
"clang-7": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64" ],
"gcov_tool": "scripts/clang_cov/clang_cov_7.sh",
"gcov_tool_absolute_path": True
},
"clang-8": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64" ],
"gcov_tool": "scripts/clang_cov/clang_cov_8.sh",
"gcov_tool_absolute_path": True
},
"clang-9": {
"standards": [ "-std=c99", "-std=c11" ],
"platforms": [ "-m32", "-m64" ],
"gcov_tool": "scripts/clang_cov/clang_cov_9.sh",
"gcov_tool_absolute_path": True
},
}
| supported_compilers_dict = {'gcc-5': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-5'}, 'gcc-6': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-6'}, 'gcc-7': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-7'}, 'gcc-8': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-8'}, 'gcc-9': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-9'}, 'g++-5': {'standards': ['-std=c++03', '-std=c++11', '-std=c++14', '-std=c++17'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-5'}, 'g++-6': {'standards': ['-std=c++03', '-std=c++11', '-std=c++14', '-std=c++17'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-6'}, 'g++-7': {'standards': ['-std=c++03', '-std=c++11', '-std=c++14', '-std=c++17'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-7'}, 'g++-8': {'standards': ['-std=c++03', '-std=c++11', '-std=c++14', '-std=c++17'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-8'}, 'g++-9': {'standards': ['-std=c++03', '-std=c++11', '-std=c++14', '-std=c++17'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'gcov-9'}, 'clang-5.0': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'scripts/clang_cov/clang_cov_5.sh', 'gcov_tool_absolute_path': True}, 'clang-6.0': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'scripts/clang_cov/clang_cov_6.sh', 'gcov_tool_absolute_path': True}, 'clang-7': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'scripts/clang_cov/clang_cov_7.sh', 'gcov_tool_absolute_path': True}, 'clang-8': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'scripts/clang_cov/clang_cov_8.sh', 'gcov_tool_absolute_path': True}, 'clang-9': {'standards': ['-std=c99', '-std=c11'], 'platforms': ['-m32', '-m64'], 'gcov_tool': 'scripts/clang_cov/clang_cov_9.sh', 'gcov_tool_absolute_path': True}} |
# This sample tests annotated types on global variables.
# This should generate an error because the declared
# type below does not match the assigned type.
glob_var1 = 4
# This should generate an error because the declared
# type doesn't match the later declared type.
glob_var1 = Exception() # type: str
glob_var1 = Exception() # type: Exception
# This should generate an error because the assigned
# type doesn't match the declared type.
glob_var1 = "hello" # type: Exception
# This should generate an error.
glob_var2 = 5
def func1():
global glob_var1
global glob_var2
# This should generate an error.
glob_var1 = 3
glob_var2 = "hello" # type: str
| glob_var1 = 4
glob_var1 = exception()
glob_var1 = exception()
glob_var1 = 'hello'
glob_var2 = 5
def func1():
global glob_var1
global glob_var2
glob_var1 = 3
glob_var2 = 'hello' |
numbers = [5, 5, 5, 6, 7, 4, 6, 10]
uniques = []
for number in numbers:
if number not in uniques:
uniques.append(number)
print(uniques) | numbers = [5, 5, 5, 6, 7, 4, 6, 10]
uniques = []
for number in numbers:
if number not in uniques:
uniques.append(number)
print(uniques) |
technologies = {}
while True:
line = input()
if "end" == line:
break
technology, courses_tokens = line.split(" - ")
if technology not in technologies:
technologies[technology] = {}
courses_tokens = [(course, int(participants)) for course, participants in
[token.split(':') for token in courses_tokens.split(", ")]]
for course, participants in courses_tokens:
technologies[technology].setdefault(course, 0)
technologies[technology][course] += participants
def get_total_participants(tech):
return sum(tech.values())
technologies = sorted(technologies.items(), key=lambda key: -get_total_participants(key[1]))
print(f"Most popular: {technologies[0][0]} ({get_total_participants(technologies[0][1])} participants)")
print(f"Least popular: {technologies[-1][0]} ({get_total_participants(technologies[-1][1])} participants)")
for technology, courses in technologies:
print(f"{technology} ({get_total_participants(courses)} participants):")
for course, participants in sorted(courses.items(), key=lambda x: -x[1]):
print(f"--{course} -> {participants}")
| technologies = {}
while True:
line = input()
if 'end' == line:
break
(technology, courses_tokens) = line.split(' - ')
if technology not in technologies:
technologies[technology] = {}
courses_tokens = [(course, int(participants)) for (course, participants) in [token.split(':') for token in courses_tokens.split(', ')]]
for (course, participants) in courses_tokens:
technologies[technology].setdefault(course, 0)
technologies[technology][course] += participants
def get_total_participants(tech):
return sum(tech.values())
technologies = sorted(technologies.items(), key=lambda key: -get_total_participants(key[1]))
print(f'Most popular: {technologies[0][0]} ({get_total_participants(technologies[0][1])} participants)')
print(f'Least popular: {technologies[-1][0]} ({get_total_participants(technologies[-1][1])} participants)')
for (technology, courses) in technologies:
print(f'{technology} ({get_total_participants(courses)} participants):')
for (course, participants) in sorted(courses.items(), key=lambda x: -x[1]):
print(f'--{course} -> {participants}') |
variavel = 'valor'
def func():
print(variavel)
def func2():
variavel = 'Outro valor'
print(variavel)
func()
func2()
print(variavel)
| variavel = 'valor'
def func():
print(variavel)
def func2():
variavel = 'Outro valor'
print(variavel)
func()
func2()
print(variavel) |
class Solution:
def moveRobot(self, matrix, current_position):
"""
Handles following cases:
if moving results in 0 no result
otherwise returns positions.
"""
# move robot to the right
# or down
down_move = current_position[0] + \
1, current_position[1], current_position[2] + 1
right_move = current_position[0], current_position[1] + \
1, current_position[2] + 1
if not down_move[0] < len(matrix):
# invalid down move
down_move = current_position
if not right_move[1] < len(matrix[0]):
# invalid right move
right_move = current_position
# check if 0 pos...
moves = [down_move, right_move]
answers = []
for move in moves:
if(matrix[move[0]][move[1]] != 0 and move != current_position):
answers.append(move)
return answers
def demolitionRobot(self, matrix):
# robot can only make right moves
# or down moves.
positions = [(0, 0, 0)]
while len(positions) > 0:
current_position = positions.pop()
new_pos = self.moveRobot(matrix, current_position)
# check if there is 9 in new positions.
for pos in new_pos:
if(matrix[pos[0]][pos[1]] == 9):
return pos[2]
# add new positions to the list.
positions.append(pos)
return -1
matrix = [[1, 0, 0], [1, 0, 0], [1, 1, 9]]
print(Solution().demolitionRobot(matrix))
| class Solution:
def move_robot(self, matrix, current_position):
"""
Handles following cases:
if moving results in 0 no result
otherwise returns positions.
"""
down_move = (current_position[0] + 1, current_position[1], current_position[2] + 1)
right_move = (current_position[0], current_position[1] + 1, current_position[2] + 1)
if not down_move[0] < len(matrix):
down_move = current_position
if not right_move[1] < len(matrix[0]):
right_move = current_position
moves = [down_move, right_move]
answers = []
for move in moves:
if matrix[move[0]][move[1]] != 0 and move != current_position:
answers.append(move)
return answers
def demolition_robot(self, matrix):
positions = [(0, 0, 0)]
while len(positions) > 0:
current_position = positions.pop()
new_pos = self.moveRobot(matrix, current_position)
for pos in new_pos:
if matrix[pos[0]][pos[1]] == 9:
return pos[2]
positions.append(pos)
return -1
matrix = [[1, 0, 0], [1, 0, 0], [1, 1, 9]]
print(solution().demolitionRobot(matrix)) |
"""Collect modules for import."""
__author__ = "David Longo (longodj@gmail.com)"
#from .data import JTNNCollator # noqa: F401 | """Collect modules for import."""
__author__ = 'David Longo (longodj@gmail.com)' |
#
# PySNMP MIB module ROOMALERT4E-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ROOMALERT4E-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:58:20 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, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, IpAddress, Bits, Counter32, Gauge32, Unsigned32, enterprises, TimeTicks, MibIdentifier, iso, NotificationType, Integer32, ObjectIdentity, ModuleIdentity, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "IpAddress", "Bits", "Counter32", "Gauge32", "Unsigned32", "enterprises", "TimeTicks", "MibIdentifier", "iso", "NotificationType", "Integer32", "ObjectIdentity", "ModuleIdentity", "Counter64")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
avtech = MibIdentifier((1, 3, 6, 1, 4, 1, 20916))
products = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1))
ROOMALERT4E = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6))
sensors = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1))
signaltower = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2))
traps = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 3))
internal = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1))
temperature = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 1))
humidity = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 2))
heat_index = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 3)).setLabel("heat-index")
digital = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2))
digital_sen1 = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1)).setLabel("digital-sen1")
digital_sen2 = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2)).setLabel("digital-sen2")
switch = MibIdentifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 3))
internal_tempf = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("internal-tempf").setMaxAccess("readonly")
if mibBuilder.loadTexts: internal_tempf.setStatus('mandatory')
if mibBuilder.loadTexts: internal_tempf.setDescription('The internal temperature reading in Fahrenheit. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
internal_tempc = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("internal-tempc").setMaxAccess("readonly")
if mibBuilder.loadTexts: internal_tempc.setStatus('mandatory')
if mibBuilder.loadTexts: internal_tempc.setDescription('The internal temperature reading in Celsius. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
internal_humidity = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("internal-humidity").setMaxAccess("readonly")
if mibBuilder.loadTexts: internal_humidity.setStatus('mandatory')
if mibBuilder.loadTexts: internal_humidity.setDescription('The internal relative humidity reading in %RH. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
internal_heat_index = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("internal-heat-index").setMaxAccess("readonly")
if mibBuilder.loadTexts: internal_heat_index.setStatus('mandatory')
if mibBuilder.loadTexts: internal_heat_index.setDescription('The internal heat index reading in Fahrenheit. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
digital_sen1_1 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen1-1").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen1_1.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen1_1.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Celsius. If this sensor is a Digital Power Sensor, this value represents the Current reading in Amperage.')
digital_sen1_2 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen1-2").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen1_2.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen1_2.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Power reading in Watts.')
digital_sen1_3 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen1-3").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen1_3.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen1_3.setDescription('If this sensor is a Temp/Humidity sensor, this value represents the current relative humidity in % Relative Humidity. If this sensor is a Digital Power Sensor, this value represents the Voltage reading in Volts.')
digital_sen1_4 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen1-4").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen1_4.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen1_4.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current heat index in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Reference reading in Volts.')
digital_sen2_1 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen2-1").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen2_1.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen2_1.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Celsius. If this sensor is a Digital Power Sensor, this value represents the Current reading in Amperage.')
digital_sen2_2 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen2-2").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen2_2.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen2_2.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Power reading in Watts.')
digital_sen2_3 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen2-3").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen2_3.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen2_3.setDescription('If this sensor is a Temp/Humidity sensor, this value represents the current relative humidity in % Relative Humidity. If this sensor is a Digital Power Sensor, this value represents the Voltage reading in Volts.')
digital_sen2_4 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setLabel("digital-sen2-4").setMaxAccess("readonly")
if mibBuilder.loadTexts: digital_sen2_4.setStatus('mandatory')
if mibBuilder.loadTexts: digital_sen2_4.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current heat index in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Reference reading in Volts.')
switch_sen1 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setLabel("switch-sen1").setMaxAccess("readonly")
if mibBuilder.loadTexts: switch_sen1.setStatus('mandatory')
if mibBuilder.loadTexts: switch_sen1.setDescription('The reading for switch sensor 1 (0 = OPEN, 1 = CLOSED).')
red_led = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setLabel("red-led").setMaxAccess("readwrite")
if mibBuilder.loadTexts: red_led.setStatus('current')
if mibBuilder.loadTexts: red_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
amber_led = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setLabel("amber-led").setMaxAccess("readwrite")
if mibBuilder.loadTexts: amber_led.setStatus('current')
if mibBuilder.loadTexts: amber_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
green_led = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setLabel("green-led").setMaxAccess("readwrite")
if mibBuilder.loadTexts: green_led.setStatus('current')
if mibBuilder.loadTexts: green_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
blue_led = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setLabel("blue-led").setMaxAccess("readwrite")
if mibBuilder.loadTexts: blue_led.setStatus('current')
if mibBuilder.loadTexts: blue_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
white_led = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setLabel("white-led").setMaxAccess("readwrite")
if mibBuilder.loadTexts: white_led.setStatus('current')
if mibBuilder.loadTexts: white_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
alarm1 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alarm1.setStatus('current')
if mibBuilder.loadTexts: alarm1.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
alarm2 = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: alarm2.setStatus('current')
if mibBuilder.loadTexts: alarm2.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
alarmmessage = MibScalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 3, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: alarmmessage.setStatus('mandatory')
if mibBuilder.loadTexts: alarmmessage.setDescription('Last Alarm Message')
room_alert_4e_snmp_trap = NotificationType((1, 3, 6, 1, 4, 1, 20916, 1, 6) + (0,2)).setLabel("room-alert-4e-snmp-trap").setObjects(("ROOMALERT4E-MIB", "alarmmessage"))
if mibBuilder.loadTexts: room_alert_4e_snmp_trap.setDescription('A room-alert-4e-snmp-trap indicates that an alarm condition has occurred on the sensor indicated by the alarmmessage variable.')
mibBuilder.exportSymbols("ROOMALERT4E-MIB", digital_sen2_4=digital_sen2_4, alarm2=alarm2, digital_sen1_3=digital_sen1_3, internal=internal, green_led=green_led, digital_sen1_4=digital_sen1_4, red_led=red_led, blue_led=blue_led, digital=digital, temperature=temperature, white_led=white_led, signaltower=signaltower, digital_sen1_1=digital_sen1_1, digital_sen1_2=digital_sen1_2, sensors=sensors, ROOMALERT4E=ROOMALERT4E, internal_tempf=internal_tempf, internal_humidity=internal_humidity, internal_heat_index=internal_heat_index, room_alert_4e_snmp_trap=room_alert_4e_snmp_trap, digital_sen2_1=digital_sen2_1, traps=traps, products=products, digital_sen2_3=digital_sen2_3, alarm1=alarm1, switch_sen1=switch_sen1, heat_index=heat_index, humidity=humidity, switch=switch, avtech=avtech, alarmmessage=alarmmessage, digital_sen2=digital_sen2, digital_sen2_2=digital_sen2_2, digital_sen1=digital_sen1, amber_led=amber_led, internal_tempc=internal_tempc)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_range_constraint, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_scalar, mib_table, mib_table_row, mib_table_column, notification_type, ip_address, bits, counter32, gauge32, unsigned32, enterprises, time_ticks, mib_identifier, iso, notification_type, integer32, object_identity, module_identity, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'NotificationType', 'IpAddress', 'Bits', 'Counter32', 'Gauge32', 'Unsigned32', 'enterprises', 'TimeTicks', 'MibIdentifier', 'iso', 'NotificationType', 'Integer32', 'ObjectIdentity', 'ModuleIdentity', 'Counter64')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
avtech = mib_identifier((1, 3, 6, 1, 4, 1, 20916))
products = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1))
roomalert4_e = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6))
sensors = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1))
signaltower = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2))
traps = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 3))
internal = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1))
temperature = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 1))
humidity = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 2))
heat_index = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 3)).setLabel('heat-index')
digital = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2))
digital_sen1 = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1)).setLabel('digital-sen1')
digital_sen2 = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2)).setLabel('digital-sen2')
switch = mib_identifier((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 3))
internal_tempf = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('internal-tempf').setMaxAccess('readonly')
if mibBuilder.loadTexts:
internal_tempf.setStatus('mandatory')
if mibBuilder.loadTexts:
internal_tempf.setDescription('The internal temperature reading in Fahrenheit. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
internal_tempc = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('internal-tempc').setMaxAccess('readonly')
if mibBuilder.loadTexts:
internal_tempc.setStatus('mandatory')
if mibBuilder.loadTexts:
internal_tempc.setDescription('The internal temperature reading in Celsius. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
internal_humidity = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('internal-humidity').setMaxAccess('readonly')
if mibBuilder.loadTexts:
internal_humidity.setStatus('mandatory')
if mibBuilder.loadTexts:
internal_humidity.setDescription('The internal relative humidity reading in %RH. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
internal_heat_index = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 1, 3, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('internal-heat-index').setMaxAccess('readonly')
if mibBuilder.loadTexts:
internal_heat_index.setStatus('mandatory')
if mibBuilder.loadTexts:
internal_heat_index.setDescription('The internal heat index reading in Fahrenheit. Because the SNMP Protocol does not support floating point numbers, values are scaled by 100 and should be divided by 100 to get the actual value.')
digital_sen1_1 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen1-1').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen1_1.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen1_1.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Celsius. If this sensor is a Digital Power Sensor, this value represents the Current reading in Amperage.')
digital_sen1_2 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen1-2').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen1_2.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen1_2.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Power reading in Watts.')
digital_sen1_3 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen1-3').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen1_3.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen1_3.setDescription('If this sensor is a Temp/Humidity sensor, this value represents the current relative humidity in % Relative Humidity. If this sensor is a Digital Power Sensor, this value represents the Voltage reading in Volts.')
digital_sen1_4 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen1-4').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen1_4.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen1_4.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current heat index in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Reference reading in Volts.')
digital_sen2_1 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen2-1').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen2_1.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen2_1.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Celsius. If this sensor is a Digital Power Sensor, this value represents the Current reading in Amperage.')
digital_sen2_2 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen2-2').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen2_2.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen2_2.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current temperature in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Power reading in Watts.')
digital_sen2_3 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen2-3').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen2_3.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen2_3.setDescription('If this sensor is a Temp/Humidity sensor, this value represents the current relative humidity in % Relative Humidity. If this sensor is a Digital Power Sensor, this value represents the Voltage reading in Volts.')
digital_sen2_4 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 2, 2, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setLabel('digital-sen2-4').setMaxAccess('readonly')
if mibBuilder.loadTexts:
digital_sen2_4.setStatus('mandatory')
if mibBuilder.loadTexts:
digital_sen2_4.setDescription('If this sensor is a Temperature or Temp/Humidity sensor, this value represents the current heat index in Fahrenheit. If this sensor is a Digital Power Sensor, this value represents the Reference reading in Volts.')
switch_sen1 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 1, 3, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setLabel('switch-sen1').setMaxAccess('readonly')
if mibBuilder.loadTexts:
switch_sen1.setStatus('mandatory')
if mibBuilder.loadTexts:
switch_sen1.setDescription('The reading for switch sensor 1 (0 = OPEN, 1 = CLOSED).')
red_led = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setLabel('red-led').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
red_led.setStatus('current')
if mibBuilder.loadTexts:
red_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
amber_led = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setLabel('amber-led').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
amber_led.setStatus('current')
if mibBuilder.loadTexts:
amber_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
green_led = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setLabel('green-led').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
green_led.setStatus('current')
if mibBuilder.loadTexts:
green_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
blue_led = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setLabel('blue-led').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
blue_led.setStatus('current')
if mibBuilder.loadTexts:
blue_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
white_led = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setLabel('white-led').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
white_led.setStatus('current')
if mibBuilder.loadTexts:
white_led.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
alarm1 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alarm1.setStatus('current')
if mibBuilder.loadTexts:
alarm1.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
alarm2 = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 2, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
alarm2.setStatus('current')
if mibBuilder.loadTexts:
alarm2.setDescription('The status of this Signal Tower element (0 = OFF, 1 = ON).')
alarmmessage = mib_scalar((1, 3, 6, 1, 4, 1, 20916, 1, 6, 3, 1), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
alarmmessage.setStatus('mandatory')
if mibBuilder.loadTexts:
alarmmessage.setDescription('Last Alarm Message')
room_alert_4e_snmp_trap = notification_type((1, 3, 6, 1, 4, 1, 20916, 1, 6) + (0, 2)).setLabel('room-alert-4e-snmp-trap').setObjects(('ROOMALERT4E-MIB', 'alarmmessage'))
if mibBuilder.loadTexts:
room_alert_4e_snmp_trap.setDescription('A room-alert-4e-snmp-trap indicates that an alarm condition has occurred on the sensor indicated by the alarmmessage variable.')
mibBuilder.exportSymbols('ROOMALERT4E-MIB', digital_sen2_4=digital_sen2_4, alarm2=alarm2, digital_sen1_3=digital_sen1_3, internal=internal, green_led=green_led, digital_sen1_4=digital_sen1_4, red_led=red_led, blue_led=blue_led, digital=digital, temperature=temperature, white_led=white_led, signaltower=signaltower, digital_sen1_1=digital_sen1_1, digital_sen1_2=digital_sen1_2, sensors=sensors, ROOMALERT4E=ROOMALERT4E, internal_tempf=internal_tempf, internal_humidity=internal_humidity, internal_heat_index=internal_heat_index, room_alert_4e_snmp_trap=room_alert_4e_snmp_trap, digital_sen2_1=digital_sen2_1, traps=traps, products=products, digital_sen2_3=digital_sen2_3, alarm1=alarm1, switch_sen1=switch_sen1, heat_index=heat_index, humidity=humidity, switch=switch, avtech=avtech, alarmmessage=alarmmessage, digital_sen2=digital_sen2, digital_sen2_2=digital_sen2_2, digital_sen1=digital_sen1, amber_led=amber_led, internal_tempc=internal_tempc) |
dist = 0
speed = 0
lastTime = 0
while(True):
try:
inp = input()
if not inp:
raise ValueError
except ValueError:
break
except EOFError:
break
arr = inp.split(' ')
if (len(arr) == 1):
outp = True
else:
outp = False
time = arr[0].split(':')
currtime = int(time[0])*3600 + int(time[1])*60 + int(time[2]) - 1
diff = currtime - lastTime
dist += speed * (diff / 3600)
# print(time)
# print(currtime)
if outp:
# print(diff * 60)
print(arr[0] + ' ' + '%.2f' % dist + ' km')
else:
speed = int(arr[1])
lastTime = currtime
| dist = 0
speed = 0
last_time = 0
while True:
try:
inp = input()
if not inp:
raise ValueError
except ValueError:
break
except EOFError:
break
arr = inp.split(' ')
if len(arr) == 1:
outp = True
else:
outp = False
time = arr[0].split(':')
currtime = int(time[0]) * 3600 + int(time[1]) * 60 + int(time[2]) - 1
diff = currtime - lastTime
dist += speed * (diff / 3600)
if outp:
print(arr[0] + ' ' + '%.2f' % dist + ' km')
else:
speed = int(arr[1])
last_time = currtime |
class Solution:
# 1st solution
# O(1) time | O(1) space
def isPowerOfTwo(self, n: int) -> bool:
x = 1
while x < n:
x *= 2
return x == n
# 2nd solution
# O(1) time | O(1) space
def isPowerOfTwo(self, n: int) -> bool:
return n > 0 and not (n & n-1) | class Solution:
def is_power_of_two(self, n: int) -> bool:
x = 1
while x < n:
x *= 2
return x == n
def is_power_of_two(self, n: int) -> bool:
return n > 0 and (not n & n - 1) |
# coding=utf-8
"""
Tests for gym-acnportal.
TODO: This module copies data from acnportal. Should this instead be
accessed directly from acnportal?
"""
| """
Tests for gym-acnportal.
TODO: This module copies data from acnportal. Should this instead be
accessed directly from acnportal?
""" |
'''
# Pass command
for i in range (0,9):
if i == 3:
pass
print (" Pass Here", end = '')
else:
print (f" {i}", end = '')
'''
# String Commands
myString = "India is my country"
myString2 = "I love my India"
print (myString.index("is"))
print (myString.find("is"))
print (myString.isalpha())
print (myString.isalnum())
print (myString.isdecimal())
print (myString.islower())
print (myString.isupper())
print (myString.isdigit())
print (myString.isspace())
print (myString.isidentifier())
print (myString.isnumeric())
print (myString.istitle())
print (myString.join(myString2))
S1 = "Kerivada Makkale"
S2 = "Anjooran"
print(S1.join(S2))
print (len(S1))
print (S1.lower())
print (S1.upper())
print (S1.replace("Kerivada","Odivada"))
print (S1.strip())
print (S1.split())
print (S1.startswith("Kerivada"))
print (S1.swapcase())
| """
# Pass command
for i in range (0,9):
if i == 3:
pass
print (" Pass Here", end = '')
else:
print (f" {i}", end = '')
"""
my_string = 'India is my country'
my_string2 = 'I love my India'
print(myString.index('is'))
print(myString.find('is'))
print(myString.isalpha())
print(myString.isalnum())
print(myString.isdecimal())
print(myString.islower())
print(myString.isupper())
print(myString.isdigit())
print(myString.isspace())
print(myString.isidentifier())
print(myString.isnumeric())
print(myString.istitle())
print(myString.join(myString2))
s1 = 'Kerivada Makkale'
s2 = 'Anjooran'
print(S1.join(S2))
print(len(S1))
print(S1.lower())
print(S1.upper())
print(S1.replace('Kerivada', 'Odivada'))
print(S1.strip())
print(S1.split())
print(S1.startswith('Kerivada'))
print(S1.swapcase()) |
# Issue #38 in Python 2.7
# Problem is distinguishing 'continue' from 'jump_back'
# in assembly instructions.
# Here, we hack looking for two jump backs
# followed by the end of the except. This
# is a big hack.
for a in [__name__]:
try:len(a)
except:continue
# The above has JUMP_ABSOLUTE in it.
# This has JUMP_FORWARD instead.
for a in [__name__]:
try:len(a)
except:continue
y = 2
| for a in [__name__]:
try:
len(a)
except:
continue
for a in [__name__]:
try:
len(a)
except:
continue
y = 2 |
App.open("java -jar C:/JabRef-4.2-fat.jar")
wait(30)
click("1529632189350.png")
wait(2)
click("1529632296782.png")
wait(2)
click("1529632312432.png")
wait(2)
click("1529632554435.png")
wait(2)
click("1529632574104.png")
wait(2)
click("1529632589427.png")
wait(2)
click("1529632601277.png")
wait(2)
click("1529632757740.png")
| App.open('java -jar C:/JabRef-4.2-fat.jar')
wait(30)
click('1529632189350.png')
wait(2)
click('1529632296782.png')
wait(2)
click('1529632312432.png')
wait(2)
click('1529632554435.png')
wait(2)
click('1529632574104.png')
wait(2)
click('1529632589427.png')
wait(2)
click('1529632601277.png')
wait(2)
click('1529632757740.png') |
class Solution:
def makeLargestSpecial(self, S):
"""
:type S: str
:rtype: str
"""
count = i = 0
res = []
for j, ch in enumerate(S):
count += 1 if ch == '1' else -1
if count == 0:
res.append('1' + self.makeLargestSpecial(S[i + 1:j]) + '0')
i = j + 1
return ''.join(sorted(res, reverse=True)) | class Solution:
def make_largest_special(self, S):
"""
:type S: str
:rtype: str
"""
count = i = 0
res = []
for (j, ch) in enumerate(S):
count += 1 if ch == '1' else -1
if count == 0:
res.append('1' + self.makeLargestSpecial(S[i + 1:j]) + '0')
i = j + 1
return ''.join(sorted(res, reverse=True)) |
class Solution:
@staticmethod
def jewels_and_stones(jewels: str, stones: str) -> int:
count = 0
for i in stones:
if i in jewels:
count += 1
continue
return count
J = "z"
S = "ZZ"
solution = Solution()
print(solution.jewels_and_stones(J, S))
| class Solution:
@staticmethod
def jewels_and_stones(jewels: str, stones: str) -> int:
count = 0
for i in stones:
if i in jewels:
count += 1
continue
return count
j = 'z'
s = 'ZZ'
solution = solution()
print(solution.jewels_and_stones(J, S)) |
'''A simple calculator using a dictionary to look up functions for operators'''
def add(n1, n2): return n1 + n2
def mult(n1, n2): return n1 * n2
opers = {
'+': add,
'*': mult
}
print("Enter expressions like 23 * 10 or 2 - 5")
while True:
expr = input('> ')
if expr:
try:
(op1, op, op2) = expr.split(' ')
print(opers[op](int(op1), int(op2)))
except Exception:
print("Sorry, I couldn't make sense of that")
else:
break
| """A simple calculator using a dictionary to look up functions for operators"""
def add(n1, n2):
return n1 + n2
def mult(n1, n2):
return n1 * n2
opers = {'+': add, '*': mult}
print('Enter expressions like 23 * 10 or 2 - 5')
while True:
expr = input('> ')
if expr:
try:
(op1, op, op2) = expr.split(' ')
print(opers[op](int(op1), int(op2)))
except Exception:
print("Sorry, I couldn't make sense of that")
else:
break |
#read the input test cases into a list (of lists)
test_file = open("input_test_case", "r")
test_file = [element.strip() for element in test_file]
test_case_count = int(test_file[0])
test_cases = [[] for col in range(test_case_count)]; test_case_count = 0
test_file = test_file[2:]
for idx, element in enumerate(test_file):
if (len(element)):
test_cases[test_case_count].append(element)
else:
test_case_count += 1
#process each case individually
for case in test_cases:
#calculate length of the file
file_len = 0
for fragment in case:
file_len += len(fragment)
file_len //= (len(case)//2)
#create an array of dicts. for all possible fragments
dict_array = [ {} for frag_size in range(file_len) ]
for fragment in case:
if (fragment in dict_array[len(fragment)]):
dict_array[len(fragment)-1][fragment] += 1
else:
dict_array[len(fragment)-1][fragment] = 1
dict_array = [ list(element) for element in dict_array ]
#go through each of the sizes, and create all possible combinations of a file
comb_array = [ set() for case_count in range(file_len//2) ]
for idx in range(file_len//2):
word_size = idx + 1;
if ( word_size == file_len//2 and (not file_len%2) ):
if (len(dict_array[word_size-1]) == 1):
comb_array[idx].add(2*dict_array[word_size-1][0])
else:
for rep in range(0, 1+1):
comb_array[idx].add("".join(dict_array[word_size-1]))
dict_array[word_size-1].reverse()
else:
for idx_1, element_1 in enumerate(dict_array[word_size-1]):
for idx_2, element_2 in enumerate(dict_array[file_len-word_size-1]):
comb_array[idx].add(element_1 + element_2); comb_array[idx].add(element_2 + element_1)
#we find the only combination that's common across ALL the words
final_set = set();
for comb_set in comb_array:
if (comb_set):
#check if 'final' set is empty
if (not final_set):
final_set = final_set.union(comb_set)
else:
final_set.intersection_update(comb_set)
#break out of loop if only one selection remains
if (len(final_set) == 1):
break
#we print all possibilities (in case there are multiple)
print(list(final_set)[0])
print("");
#NOTE: there can be MULTIPLE solutions (and we need to print only ONE of them), and that might NOT neccesarily
#match uDebug's solution(s), but this solutino IS correct
| test_file = open('input_test_case', 'r')
test_file = [element.strip() for element in test_file]
test_case_count = int(test_file[0])
test_cases = [[] for col in range(test_case_count)]
test_case_count = 0
test_file = test_file[2:]
for (idx, element) in enumerate(test_file):
if len(element):
test_cases[test_case_count].append(element)
else:
test_case_count += 1
for case in test_cases:
file_len = 0
for fragment in case:
file_len += len(fragment)
file_len //= len(case) // 2
dict_array = [{} for frag_size in range(file_len)]
for fragment in case:
if fragment in dict_array[len(fragment)]:
dict_array[len(fragment) - 1][fragment] += 1
else:
dict_array[len(fragment) - 1][fragment] = 1
dict_array = [list(element) for element in dict_array]
comb_array = [set() for case_count in range(file_len // 2)]
for idx in range(file_len // 2):
word_size = idx + 1
if word_size == file_len // 2 and (not file_len % 2):
if len(dict_array[word_size - 1]) == 1:
comb_array[idx].add(2 * dict_array[word_size - 1][0])
else:
for rep in range(0, 1 + 1):
comb_array[idx].add(''.join(dict_array[word_size - 1]))
dict_array[word_size - 1].reverse()
else:
for (idx_1, element_1) in enumerate(dict_array[word_size - 1]):
for (idx_2, element_2) in enumerate(dict_array[file_len - word_size - 1]):
comb_array[idx].add(element_1 + element_2)
comb_array[idx].add(element_2 + element_1)
final_set = set()
for comb_set in comb_array:
if comb_set:
if not final_set:
final_set = final_set.union(comb_set)
else:
final_set.intersection_update(comb_set)
if len(final_set) == 1:
break
print(list(final_set)[0])
print('') |
#
# Copyright 2022 Erwan Mahe (github.com/erwanM974)
# 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.
#
timeout_in_seconds = 10
#
multi_trace_number_per_loop_height = 5
#
multitrace_outer_loop_ns = [x for x in range(1,41)]
#
multi_trace_obs = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10]
#
hsfs = ["hid_wtloc","hid_noloc","sim_wtloc","sim_noloc"]
#
sensor_example_lifelines = ["CSI","CI","SM","LSM","CSM","CR","CA","SOS"]
| timeout_in_seconds = 10
multi_trace_number_per_loop_height = 5
multitrace_outer_loop_ns = [x for x in range(1, 41)]
multi_trace_obs = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10]
hsfs = ['hid_wtloc', 'hid_noloc', 'sim_wtloc', 'sim_noloc']
sensor_example_lifelines = ['CSI', 'CI', 'SM', 'LSM', 'CSM', 'CR', 'CA', 'SOS'] |
'''
Bifurcaciones
Estructura.-
if CONDICION:
INSTRUCCIONES
[elif CONDICION:
INSTRUCCIONES
else:
INSTRUCCIONES
]
**Las palabras en mayusculas indican estatutos variables (no siempre son los mismos)
y lo que esta en corchetes es opcional. Puede haber mas de un elif.
'''
#Ejemplos
matricula=20
temperatura=40
if matricula%2==0:
print('La matricula es par')
else:
print('La matricula es impar')
if temperatura<15:
print('Tengo frio')
elif temperatura>=15 and temperatura<26:
print('Esta agradable')
elif temperatura>=26 and temperatura<35:
print('Tengo calor')
else:
print('Tengo mucho calor')
| """
Bifurcaciones
Estructura.-
if CONDICION:
INSTRUCCIONES
[elif CONDICION:
INSTRUCCIONES
else:
INSTRUCCIONES
]
**Las palabras en mayusculas indican estatutos variables (no siempre son los mismos)
y lo que esta en corchetes es opcional. Puede haber mas de un elif.
"""
matricula = 20
temperatura = 40
if matricula % 2 == 0:
print('La matricula es par')
else:
print('La matricula es impar')
if temperatura < 15:
print('Tengo frio')
elif temperatura >= 15 and temperatura < 26:
print('Esta agradable')
elif temperatura >= 26 and temperatura < 35:
print('Tengo calor')
else:
print('Tengo mucho calor') |
# Python program to display the Fibonacci sequence
def fibonacci(n):
if n <= 1:
return n
else:
return(fibonacci(n-1) + fibonacci(n-2))
N = input()
if N <= 0:
print("Plese enter a positive integer")
else:
print("Fibonacci sequence:")
for i in range(N):
print(fibonacci(i)) | def fibonacci(n):
if n <= 1:
return n
else:
return fibonacci(n - 1) + fibonacci(n - 2)
n = input()
if N <= 0:
print('Plese enter a positive integer')
else:
print('Fibonacci sequence:')
for i in range(N):
print(fibonacci(i)) |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 13 06:01:48 2020
@author: azmanrafee
"""
X=[8]
NX=[800]
x0=0
xn=0
azim_div=64
energy_group=1
nu=1
def sigma_scatter(x):
return 0.8
def sigma_trans(x):
return 1.0
def sigma_fis(x):
return 1.0
| """
Created on Fri Mar 13 06:01:48 2020
@author: azmanrafee
"""
x = [8]
nx = [800]
x0 = 0
xn = 0
azim_div = 64
energy_group = 1
nu = 1
def sigma_scatter(x):
return 0.8
def sigma_trans(x):
return 1.0
def sigma_fis(x):
return 1.0 |
__author__ = '''
Dawson Reid (dreid93@gmail.com)
'''
VALID_CURRENCY = ['CAD', 'BTC', 'LTC']
VALID_CURRENCY_PAIRS = ['BTCCAD', 'LTCCAD', 'BTCLTC']
DATE_FORMAT = '%Y-%m-%d'
VALID_WITHDRAW_CURRENCY = ['BTC', 'LTC']
| __author__ = '\nDawson Reid (dreid93@gmail.com)\n'
valid_currency = ['CAD', 'BTC', 'LTC']
valid_currency_pairs = ['BTCCAD', 'LTCCAD', 'BTCLTC']
date_format = '%Y-%m-%d'
valid_withdraw_currency = ['BTC', 'LTC'] |
"""
Stores information for each dimension of parallelism
"""
class parallelism():
def __init__(self, pp: int, dp: int, mp: int, pp_parts: list, rank_map: dict):
self.pp = pp
self.dp = dp
self.mp = mp
"""
The order of axis is (pp, dp, mp). For example, if dp=2,mp=3,pp=4,
the numbe gpu at number 5 stands for (pp=0, dp=1, mp=2).
An example pp_parts for pp = 2 is [0, 14, 30] for a load-balanced
GPT2 model with num_layer = 24.
"""
self._check_valid_rank(rank_map)
self.rank_map = rank_map
self.pp_parts = pp_parts
"""
Check whether the rank_map is a valid permutation from 0 to num(gpu)-1.
"""
def _check_valid_rank(self, rank_map):
base = []
for k, v in rank_map.items():
base.extend(v)
bijection = (len(rank_map) == self.pp * self.dp * self.mp)
validity = (sorted(base) == list(range(len(base))))
assert validity and bijection, "rank map is not a permutation from 0 to num_gpus-1."
"""
Returns this as (rank_map, pp, dp, mp, pp_config)
"""
def get_repr(self):
return (self.rank_map, self.pp, self.dp, self.mp, self.pp_parts)
"""
Returns the rank to axis. If pp=dp=mp=2, rank 3 gives (0,1,1)
"""
def rank2axis(self, rank):
pp = rank // (self.mp * self.dp)
remainder = rank % (self.mp * self.dp)
dp = remainder // (self.mp)
remainder = remainder % self.mp
mp = remainder
returns (pp, dp, mp)
"""
Returns the axis to rank. If pp=dp=mp=2, (0,1,1) gives 3
"""
def axis2rank(self, axis):
pp, dp, mp = axis
return mp + self.mp * dp + (self.mp * self.dp) * pp
| """
Stores information for each dimension of parallelism
"""
class Parallelism:
def __init__(self, pp: int, dp: int, mp: int, pp_parts: list, rank_map: dict):
self.pp = pp
self.dp = dp
self.mp = mp
'\n The order of axis is (pp, dp, mp). For example, if dp=2,mp=3,pp=4,\n the numbe gpu at number 5 stands for (pp=0, dp=1, mp=2).\n\n \n An example pp_parts for pp = 2 is [0, 14, 30] for a load-balanced\n GPT2 model with num_layer = 24.\n\n '
self._check_valid_rank(rank_map)
self.rank_map = rank_map
self.pp_parts = pp_parts
'\n Check whether the rank_map is a valid permutation from 0 to num(gpu)-1.\n '
def _check_valid_rank(self, rank_map):
base = []
for (k, v) in rank_map.items():
base.extend(v)
bijection = len(rank_map) == self.pp * self.dp * self.mp
validity = sorted(base) == list(range(len(base)))
assert validity and bijection, 'rank map is not a permutation from 0 to num_gpus-1.'
'\n Returns this as (rank_map, pp, dp, mp, pp_config)\n '
def get_repr(self):
return (self.rank_map, self.pp, self.dp, self.mp, self.pp_parts)
'\n Returns the rank to axis. If pp=dp=mp=2, rank 3 gives (0,1,1)\n '
def rank2axis(self, rank):
pp = rank // (self.mp * self.dp)
remainder = rank % (self.mp * self.dp)
dp = remainder // self.mp
remainder = remainder % self.mp
mp = remainder
returns(pp, dp, mp)
'\n Returns the axis to rank. If pp=dp=mp=2, (0,1,1) gives 3\n '
def axis2rank(self, axis):
(pp, dp, mp) = axis
return mp + self.mp * dp + self.mp * self.dp * pp |
# https://leetcode.com/problems/number-of-rectangles-that-can-form-the-largest-square
'''
Time Complexity: O(N)
Space Complexity: O(N)
'''
def count_good_rectangles(rectangles):
max_len, all_max_lens = 0, []
for rec in rectangles:
square_len = min(rec[0], rec[1])
max_len = max(max_len, square_len)
all_max_lens.append(square_len)
counter = 0
for length in all_max_lens:
if length == max_len:
counter += 1
return counter
def count_good_rectangles_optimized(rectangles):
max_len, counter = 0, 0
for rec in rectangles:
square_len = min(rec[0], rec[1])
if square_len > max_len:
max_len = square_len
counter = 0
if square_len == max_len:
counter += 1
return counter | """
Time Complexity: O(N)
Space Complexity: O(N)
"""
def count_good_rectangles(rectangles):
(max_len, all_max_lens) = (0, [])
for rec in rectangles:
square_len = min(rec[0], rec[1])
max_len = max(max_len, square_len)
all_max_lens.append(square_len)
counter = 0
for length in all_max_lens:
if length == max_len:
counter += 1
return counter
def count_good_rectangles_optimized(rectangles):
(max_len, counter) = (0, 0)
for rec in rectangles:
square_len = min(rec[0], rec[1])
if square_len > max_len:
max_len = square_len
counter = 0
if square_len == max_len:
counter += 1
return counter |
"""Author: Brandon Trabucco
String values for use in the caption machine.
"""
WELCOME_STRING = """
I'm ready to caption images for you.
Please tell me a command, or say help.
"""
HELP_STRING = """
Ask me to navigate,
learn a place,
tell where I am,
look around,
or tell what I see
I currently know {0} places.
These are {1}.
"""
UNK_STRING = """
I'm sorry, I do not recognize the {0}.
I currently know {1} places.
These are {2}.
"""
LOST_STRING = """
I'm sorry, I cannot determine my position.
"""
WHERE_STRING = """
I am closest to the {0},
which is about {1:.2f} units away.
"""
NAV_STRING = """
I am navigating to the {0},
which is about {1:.2f} units away.
"""
STOP_STRING = """
Thanks for talking with me, have a nice day.
"""
ERROR_STRING = """
There was an error with your request.
"""
THINK_STRING = """
Okay, I am thinking of a caption.
"""
STILL_THINK_STRING = """
Still thinking of a caption.
"""
KNOWN_STRING = """
I already know where the {0} is located.
"""
LEARN_STRING = """
I have added {0} to my memory.
"""
| """Author: Brandon Trabucco
String values for use in the caption machine.
"""
welcome_string = "\n\nI'm ready to caption images for you.\nPlease tell me a command, or say help.\n\n"
help_string = '\n\nAsk me to navigate,\nlearn a place,\ntell where I am,\nlook around,\nor tell what I see\n\nI currently know {0} places.\nThese are {1}.\n\n'
unk_string = "\n\nI'm sorry, I do not recognize the {0}.\nI currently know {1} places.\nThese are {2}.\n\n"
lost_string = "\n\nI'm sorry, I cannot determine my position.\n\n"
where_string = '\n\nI am closest to the {0},\nwhich is about {1:.2f} units away.\n\n'
nav_string = '\n\nI am navigating to the {0},\nwhich is about {1:.2f} units away.\n\n'
stop_string = '\n\nThanks for talking with me, have a nice day.\n\n'
error_string = '\n\nThere was an error with your request.\n\n'
think_string = '\n\nOkay, I am thinking of a caption.\n\n'
still_think_string = '\n\nStill thinking of a caption.\n\n'
known_string = '\n\nI already know where the {0} is located.\n\n'
learn_string = '\n\nI have added {0} to my memory.\n\n' |
class UnionFind:
def __init__(self):
self.parent = {}
self.name = {}
def find(self, a):
path = []
while self.parent[a] != a:
path.append(a)
a = self.parent[a]
for p in path:
self.parent[p] = a
return a
def connect(self, a, b):
root_a = self.find(a)
root_b = self.find(b)
if root_a != root_b:
self.parent[root_b] = root_a
def add(self, a, name):
self.parent[a] = a
self.name[a] = name
def exist(self, a):
return a in self.parent
class Solution:
"""
@param accounts: List[List[str]]
@return: return a List[List[str]]
"""
def accountsMerge(self, accounts):
union = UnionFind()
for mails in accounts:
if len(mails) < 2:
continue
for i in range(1, len(mails)):
if not union.exist(mails[i]):
union.add(mails[i], mails[0])
for i in range(1, len(mails) - 1):
union.connect(mails[i], mails[i + 1])
mail_group = {}
for mail in union.parent.keys():
root = union.find(mail)
if root not in mail_group:
mail_group[root] = set([root])
mail_group[root].add(mail)
results = []
for mail, mail_list in mail_group.items():
mail_list = list(mail_list)
mail_list.sort()
mail_list.insert(0, union.name[mail])
results.append(mail_list)
return results | class Unionfind:
def __init__(self):
self.parent = {}
self.name = {}
def find(self, a):
path = []
while self.parent[a] != a:
path.append(a)
a = self.parent[a]
for p in path:
self.parent[p] = a
return a
def connect(self, a, b):
root_a = self.find(a)
root_b = self.find(b)
if root_a != root_b:
self.parent[root_b] = root_a
def add(self, a, name):
self.parent[a] = a
self.name[a] = name
def exist(self, a):
return a in self.parent
class Solution:
"""
@param accounts: List[List[str]]
@return: return a List[List[str]]
"""
def accounts_merge(self, accounts):
union = union_find()
for mails in accounts:
if len(mails) < 2:
continue
for i in range(1, len(mails)):
if not union.exist(mails[i]):
union.add(mails[i], mails[0])
for i in range(1, len(mails) - 1):
union.connect(mails[i], mails[i + 1])
mail_group = {}
for mail in union.parent.keys():
root = union.find(mail)
if root not in mail_group:
mail_group[root] = set([root])
mail_group[root].add(mail)
results = []
for (mail, mail_list) in mail_group.items():
mail_list = list(mail_list)
mail_list.sort()
mail_list.insert(0, union.name[mail])
results.append(mail_list)
return results |
num_to_word = {
0: '',
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
6: 'six',
7: 'seven',
8: 'eight',
9: 'nine',
10: 'ten',
11: 'eleven',
12: 'twelve',
13: 'thirteen',
14: 'fourteen',
15: 'fifteen',
16: 'sixteen',
17: 'seventeen',
18: 'eighteen',
19: 'nineteen',
20: 'twenty',
30: 'thirty',
40: 'forty',
50: 'fifty',
60: 'sixty',
70: 'seventy',
80: 'eighty',
90: 'ninety',
100: 'hundred',
1000: 'thousand'
}
def number_to_word(n):
if 20 >= n > 0:
return num_to_word[n]
# 21 - 99
if n < 100:
n_ten = n // 10
n_one = n - (n_ten * 10)
return f'{num_to_word[n_ten * 10]} {num_to_word[n_one]}'
# 101 - 999
if n < 1000:
n_hundred = n // 100
n_ten = (n // 10) - (n_hundred * 10)
n_one = n - (n_hundred * 100) - (n_ten * 10)
word = f'{num_to_word[n_hundred]} hundred'
if n_ten == 0 and n_one == 0:
return word
elif n_ten == 0 and n_one > 0:
word += f' and {num_to_word[n_one]}'
elif n_ten == 1 and n_one > 0:
word += f' and {num_to_word[10 * n_ten + n_one]}'
else:
word += f' and {num_to_word[n_ten * 10]} {num_to_word[n_one]}'
return word
# 1000
if n == 100 or n == 1000:
return f'one {num_to_word[n]}'
# We don't support anything else :\
return None
def count_number_chars(n):
word = number_to_word(n)
return len(word.replace(' ', ''))
def compute():
total = 0
for i in range(1, 1001):
print(number_to_word(i))
total += count_number_chars(i)
return total
if __name__ == '__main__':
print(compute())
| num_to_word = {0: '', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thirteen', 14: 'fourteen', 15: 'fifteen', 16: 'sixteen', 17: 'seventeen', 18: 'eighteen', 19: 'nineteen', 20: 'twenty', 30: 'thirty', 40: 'forty', 50: 'fifty', 60: 'sixty', 70: 'seventy', 80: 'eighty', 90: 'ninety', 100: 'hundred', 1000: 'thousand'}
def number_to_word(n):
if 20 >= n > 0:
return num_to_word[n]
if n < 100:
n_ten = n // 10
n_one = n - n_ten * 10
return f'{num_to_word[n_ten * 10]} {num_to_word[n_one]}'
if n < 1000:
n_hundred = n // 100
n_ten = n // 10 - n_hundred * 10
n_one = n - n_hundred * 100 - n_ten * 10
word = f'{num_to_word[n_hundred]} hundred'
if n_ten == 0 and n_one == 0:
return word
elif n_ten == 0 and n_one > 0:
word += f' and {num_to_word[n_one]}'
elif n_ten == 1 and n_one > 0:
word += f' and {num_to_word[10 * n_ten + n_one]}'
else:
word += f' and {num_to_word[n_ten * 10]} {num_to_word[n_one]}'
return word
if n == 100 or n == 1000:
return f'one {num_to_word[n]}'
return None
def count_number_chars(n):
word = number_to_word(n)
return len(word.replace(' ', ''))
def compute():
total = 0
for i in range(1, 1001):
print(number_to_word(i))
total += count_number_chars(i)
return total
if __name__ == '__main__':
print(compute()) |
# 1.2 Check Permutation:
# Given two strings, write a method to decide if one is a permutation of the other.
# https://github.com/joaomh/Cracking-the-Code-Interview-Python
# My solution
def Permutation(str1, str2):
str1 = str1.lower()
str2 = str2.lower()
for character in str1:
if character is ' ':
pass
elif character in str2:
str2 = str2.replace(character, '', 1)
else:
return False
if len(str2.replace(' ','')) == 0:
return True
else:
return False
# Test
print("Pass" if Permutation('he llo','elhlo') else "Fail")
print("Pass" if Permutation('he was there','theresaweh') else "Fail")
| def permutation(str1, str2):
str1 = str1.lower()
str2 = str2.lower()
for character in str1:
if character is ' ':
pass
elif character in str2:
str2 = str2.replace(character, '', 1)
else:
return False
if len(str2.replace(' ', '')) == 0:
return True
else:
return False
print('Pass' if permutation('he llo', 'elhlo') else 'Fail')
print('Pass' if permutation('he was there', 'theresaweh') else 'Fail') |
n = int(input())
data = []
for _ in range(n):
x, y = map(str, input().split())
data.append([int(x), y])
sorted_data = sorted(data, key=lambda item : item[0])
for x, y in sorted_data:
print('{0} {1}'.format(x, y)) | n = int(input())
data = []
for _ in range(n):
(x, y) = map(str, input().split())
data.append([int(x), y])
sorted_data = sorted(data, key=lambda item: item[0])
for (x, y) in sorted_data:
print('{0} {1}'.format(x, y)) |
# subtracting type dp with sort
class Solution(object):
def combinationSum(self, candidates, target):
candidates.sort()
dp = [[[]]] + [[] for i in xrange(target)]
for i in xrange(1, target + 1):
for number in candidates:
if number > i:
break
for L in dp[i - number]:
if not L or number >= L[-1]:
dp[i] += L + [number],
return dp[target]
| class Solution(object):
def combination_sum(self, candidates, target):
candidates.sort()
dp = [[[]]] + [[] for i in xrange(target)]
for i in xrange(1, target + 1):
for number in candidates:
if number > i:
break
for l in dp[i - number]:
if not L or number >= L[-1]:
dp[i] += (L + [number],)
return dp[target] |
"""A list of structured message templates supported by the platform. For unstructured content see content_types"""
class Template(object):
pass
| """A list of structured message templates supported by the platform. For unstructured content see content_types"""
class Template(object):
pass |
def dict_path(d, path):
if not isinstance(path, (list, tuple)):
raise ValueError()
for keys in path:
if type(keys) is not list:
keys = [keys]
value = None
for key in keys:
if key not in d:
continue
value = d[key]
if value is None:
value = {}
for key in keys:
d[key] = value
d = value
return d
| def dict_path(d, path):
if not isinstance(path, (list, tuple)):
raise value_error()
for keys in path:
if type(keys) is not list:
keys = [keys]
value = None
for key in keys:
if key not in d:
continue
value = d[key]
if value is None:
value = {}
for key in keys:
d[key] = value
d = value
return d |
dias = int(input('Digite a quantidade de dias: '))
horas = int(input('Digite a quantidade de horas: '))
minutos = int(input('Digite a quantidade de minutos: '))
segundos = int(input('Digite a quantidade de segundos: '))
total = segundos + (minutos * 60) + ((horas * 60) * 60) + (((dias * 24) * 60) * 60)
print ('Isso equivale a %d segundos' %total)
| dias = int(input('Digite a quantidade de dias: '))
horas = int(input('Digite a quantidade de horas: '))
minutos = int(input('Digite a quantidade de minutos: '))
segundos = int(input('Digite a quantidade de segundos: '))
total = segundos + minutos * 60 + horas * 60 * 60 + dias * 24 * 60 * 60
print('Isso equivale a %d segundos' % total) |
# Each line gives the password policy and then the password. The password policy indicates the lowest and highest number of times a given letter must appear for the password to be valid. For example, 1-3 a means that the password must contain a at least 1 time and at most 3 times.
# How many passwords are valid according to their policies?
# Part 2
# Each policy actually describes two positions in the password, where 1 means the first character, 2 means the second character, and so on. (Be careful; Toboggan Corporate Policies have no concept of "index zero"!) Exactly one of these positions must contain the given letter. Other occurrences of the letter are irrelevant for the purposes of policy enforcement.
problemInput = ["2-5 z: zzztvz",
"2-8 d: pddzddkdvqgxndd",
"4-14 r: rrrjrrrrrrbrrccrr",
"2-7 r: zrgsnrr",
"9-10 z: zzzxwzznpd",
"8-13 g: gggggggxgggghggg",
"1-6 c: xcccxcccccz",
"3-4 b: bxbt",
"8-11 d: dddddddzddv",
"4-14 m: kxdmmmdmfwmmmdfr",
"16-17 g: ggggggggggggggggg",
"2-3 f: ddvdlff",
"9-11 g: ggggpfgggggg",
"7-8 c: fdhctccc",
"3-6 c: tmcdcncqcvccg",
"2-3 l: clllll",
"1-9 b: bbbbbbbbbb",
"10-15 w: wglmwwwrnnzgwhhwvvd",
"10-14 g: ggggggxsgggqggg",
"9-19 q: fjlqbvtdngwvtbnsgfm",
"1-2 k: kgbkkv",
"4-10 m: mmmmtmmmmgm",
"3-4 h: hplh",
"5-7 q: qqqqrqk",
"3-12 v: zbvlbpxcrnvvwjpwl",
"1-4 r: crrr",
"4-5 h: hhhrj",
"2-4 r: mhrr",
"9-10 c: pccccsccbk",
"10-16 n: drnhqnnnnqnnpxmh",
"5-6 v: vvvnvvg",
"11-12 c: ccccgcccccpc",
"5-10 b: bdbjbbfmfbb",
"9-13 w: zwbwwzhwwkwsxdfwglx",
"5-19 v: vvvvvqrvvfvgvvvvmvv",
"3-9 d: dddgztdljb",
"12-13 s: swssssrsssshx",
"5-6 l: dllkljq",
"4-5 q: qqqsdqq",
"2-4 w: tmwg",
"10-12 l: llllsldflllllljjlxl",
"3-11 s: sjtsssssksbs",
"1-5 v: hvvtmvgvv",
"3-12 g: ggvgkgfgggghgg",
"3-4 p: ccpp",
"3-9 v: vfvvvvvvvvvvvr",
"8-16 k: kkkkkkkkkkkkkwkkkk",
"8-9 x: wxbrxfdrw",
"7-9 n: nnnfnnnnn",
"7-11 w: wwwwxwwwwwzxw",
"6-9 n: nknnhnnnnlnnn",
"10-12 l: qllllllllqbl",
"17-19 p: pppppppppppppwppkpp",
"4-5 q: qqqqqq",
"7-15 v: vvvbmbjvjznzdhfvtn",
"3-12 w: wwwwwdwwwwwwtwwwww",
"7-10 x: mmgmknpvdbxdl",
"9-10 v: jljttxpvvv",
"11-15 d: dshddnddqdhddvm",
"1-3 r: vrqrrr",
"6-7 c: ltcbpccw",
"5-13 q: qqqqcqqqxqrqg",
"3-7 l: lhlmhzl",
"2-3 l: lxntjnttkllll",
"3-4 b: bbnsb",
"5-6 j: rjppzvjdjj",
"4-10 g: fgggjgvfggggggsggm",
"11-12 z: ztzzzkzzzzsvzzzzt",
"2-3 h: hcvbf",
"7-13 s: sswkwhsdqsdcs",
"3-10 j: mghjglnbdhjp",
"6-8 x: dfxrxxsxpsxxxxmc",
"11-12 f: fffmfcdpffmpflfffdw",
"4-7 n: nnnknncnn",
"2-6 k: tzqlzqhrncvktfwvswt",
"2-4 h: pqplh",
"8-13 h: zhlwqvmnkjhhtkf",
"2-3 l: llll",
"19-20 j: jjjjjjjjjjjjjjjjjrjj",
"3-14 n: crnnrgpmxxlrfljk",
"2-4 t: stpr",
"11-13 c: cctcccccccccccc",
"5-6 q: fqqqqqdwtwqjq",
"6-7 z: zzzzzzg",
"8-16 j: njjgsjjljktjcbjvjc",
"3-6 c: swjccc",
"5-7 h: ghvwjmzm",
"9-12 s: sssssmvtdckmfs",
"3-4 r: bsrm",
"6-7 c: ccctcccc",
"6-10 t: swndrtcvtl",
"13-19 v: vjvxvvvdvvvvvvdvblv",
"5-7 w: hnwwwtwp",
"8-9 k: kkkkkktzxkkv",
"4-6 g: xpsxgs",
"2-3 r: xrrdxm",
"2-9 f: ffvqxxvsf",
"7-10 t: tttttttttt",
"4-6 q: bbqqqqqqbq",
"7-9 q: xjcwqhprgh",
"3-6 j: jjjjjjjxjjj",
"1-3 l: blll",
"2-5 p: phbppp",
"3-4 p: phpb",
"2-15 r: mwgnrkxrrbmgpzrdrr",
"8-13 x: jsrlvxmxwglkh",
"4-11 b: ctcbsjgjplbthhrskfnb",
"6-7 q: qqqqqfvcq",
"10-11 d: ddddddjdbndddd",
"8-9 p: pppppppkf",
"10-14 q: qqqqqqnqzgqsqv",
"12-13 b: bbbbbbbbbbbbb",
"6-11 h: khnkthfhhdhrhh",
"5-6 g: gzggwcgq",
"2-4 f: fbfg",
"6-9 f: ffvfsfvffxff",
"6-7 t: tsfdltt",
"14-17 t: tttttttttttxtcttp",
"3-4 v: vwtv",
"7-10 x: pxmldqqxmw",
"1-2 s: pdssssssss",
"5-6 n: snwnml",
"3-8 t: tjnpjqzxbj",
"5-7 n: mxkqfnjb",
"4-12 q: qqqkqqqqqqqkqqq",
"4-5 d: pjhnsfdgddjsddvpxxd",
"14-15 t: trttdtxwtdmtttt",
"3-4 j: jjvz",
"1-2 p: xqpppp",
"11-15 d: dddpdddddddddddq",
"15-16 b: bnbbbbbbbbbtbbdbb",
"9-11 w: wwwnwwmwbghw",
"15-18 g: tjwqbgwmvpvghxgzkgj",
"3-4 j: jjps",
"9-12 f: ffflfffmfnffvff",
"1-3 g: gbgstndgggqrdbtpdqdr",
"4-6 f: fflxfqffff",
"10-14 t: ttttttttttttttttt",
"1-7 v: vvsqlvvvvkj",
"3-7 b: wvbxlwbjtbbbvh",
"3-7 p: hqvsvpn",
"2-6 f: fkwfhf",
"3-11 d: dzrwnffrdvs",
"8-9 s: sssdssztlssqksx",
"12-15 t: tttttttttthtttt",
"5-6 m: mmmmmmmm",
"2-3 n: dnnl",
"12-16 w: wrwwtvwwwwwwwwww",
"2-4 j: jjjjsj",
"7-11 x: xxxxxtcxxxlxxx",
"8-17 n: nbngnnnsnjnbhnntzwxt",
"5-6 b: tmbdgn",
"15-16 x: xqlpjxbbxnrbxxxxqmkf",
"1-3 c: ccclf",
"12-14 m: zhmmmzltwhrmfmx",
"15-17 c: ccvcxcmccgccccbcccc",
"10-13 k: mkgkljkkkjkkg",
"1-4 b: ckdr",
"10-12 b: bvfbgbbbbbbb",
"2-4 v: jfvcv",
"2-7 p: jswmqpmc",
"11-16 b: bbbncbpmbjbbvgrb",
"1-6 n: ktjcwr",
"2-9 l: lllrwljlnlwllln",
"17-18 h: hhhhhhhhhhhhhhhhzfh",
"9-14 b: bbbsbqbbjjbbkb",
"7-12 j: jjjjjwwjjjjcj",
"10-13 w: wfwwwwwwwjwww",
"2-6 j: bjghpj",
"13-16 z: zzzzzzzzbzzzzzvg",
"10-11 f: ffffkfffcfxff",
"3-4 m: mmmmkjvzmkp",
"2-5 k: kkkkk",
"5-6 r: rrbrrs",
"1-2 c: ccqjmc",
"13-14 r: rrrrrrrrrrrrztr",
"8-12 z: zrzzzzzqbzvdz",
"4-9 m: hlgmtvvqs",
"9-10 t: tthttrtbrnt",
"2-4 k: snpkzhck",
"12-13 x: wlxwwxxxhgxxx",
"11-16 h: ncmfhhvgghhhhhjhd",
"13-15 g: sgxgfntgjnxkgbgm",
"4-13 s: vqkslldmgmfrd",
"3-14 z: zzzzzzzzzzzzzzzz",
"14-15 c: ccccvccccccsmlpcfccx",
"4-5 p: pppppp",
"9-10 z: kgblzrqbzz",
"13-15 p: pppppptpmppbpppqpp",
"7-8 b: dntbbcmswb",
"16-17 d: dddddddddddddddgd",
"10-11 r: rrrsrmrrrqtr",
"2-3 q: qtqgz",
"6-8 c: xztzfkcch",
"14-15 l: lllflllllllllzsl",
"1-6 s: zssssss",
"5-8 d: hdddwddvdpd",
"10-12 j: jjjjjjjjjpjbj",
"1-9 q: tqqqqqqqqnqqwqk",
"2-4 t: shpwwttwqb",
"8-9 s: xrssssssz",
"3-4 c: cjcfc",
"3-10 v: rfvzsncmfv",
"4-7 t: lshczltjfqkmkt",
"13-16 x: xxxxxxxfxxxxzxxrxx",
"1-3 z: pzkzlzmzz",
"4-5 d: ddkbfdtdd",
"9-10 r: rrrrrrrrlfkj",
"3-7 s: svtbsssjsldts",
"10-13 c: ccccgxzqtctrc",
"1-7 q: zgwqgrx",
"6-8 f: ffnffrfg",
"4-5 f: kffcffp",
"1-2 m: ggcm",
"5-6 z: zzzdgz",
"9-14 j: jjjnjjjjjjjjjjjj",
"2-17 d: xttgzggnfhsrjqdbppps",
"5-6 f: xrcfff",
"1-3 z: wzzg",
"1-2 h: hhhvl",
"13-17 q: qqqqqqqqqqmqqqqqqq",
"2-3 q: bjqq",
"1-5 w: zwwwgww",
"5-7 s: jnvpmgj",
"9-10 q: zctgztwpqq",
"16-20 j: jkjjkjnjwqqjjjzgjjpk",
"16-20 k: kkkkkkkkkkkkkkkkkkkk",
"17-18 d: dddddddddddddddddbd",
"3-5 d: dngrhxb",
"10-12 t: tmttttttttrttwh",
"7-9 q: nqqqkqcqqqqq",
"7-9 z: zqzzzzwctng",
"10-13 d: dddjldsddkddjpddd",
"3-7 g: lgglgggggphx",
"6-7 b: llkbcdxwtzrblp",
"1-5 s: dssdscpzwcn",
"2-6 h: hhphhhhhh",
"4-13 z: smkzzpzjfzzbzqzxzjz",
"2-5 j: jjjjjj",
"8-11 p: lgmppspppppk",
"9-10 c: ccccccccdnkc",
"3-9 m: mmfmmmmpkmsmmm",
"13-15 m: mmmmkmmmmmmmgmhmmm",
"5-6 x: xxxxxxx",
"10-14 b: bbbjbqbbwcbbbb",
"3-12 f: ffmfffffffnzfffff",
"11-12 m: mmmnmmmmmmmmm",
"8-12 v: jptmbccvmvsxchfvv",
"4-5 s: ssssns",
"12-14 j: jjjjjjdjjjjvjhjjj",
"11-13 j: wjjjljjjcjjjjqjjp",
"1-7 g: ggggggggdg",
"2-3 v: bkjqv",
"4-13 q: qzhldwthbwgtr",
"12-13 p: ppplppdgpppppp",
"11-12 f: flffxfpffprgfff",
"8-14 b: mbbbbbtbwbhstbbbbbbb",
"6-7 m: bqmsmmm",
"1-3 w: qxlggmxtwj",
"3-17 c: dwbkjcwqcrccbcxcnvxc",
"11-13 p: ppxppppdppxpzpppp",
"4-10 v: vfvvfvzvqv",
"1-7 m: mmmxmmmmmbmmrmmmmmm",
"2-12 x: xrdxwxzwfxpxtqxxxgxp",
"6-11 w: swzwwkddmsrxwzfg",
"6-8 g: ggggggggggg",
"3-4 h: tzshs",
"7-8 t: zjtzpclm",
"5-6 k: brzkzk",
"14-15 c: cccccccccjccccc",
"2-3 h: hhfh",
"15-19 w: wwwwwwwkzxwwwwwwwwh",
"8-10 f: mjmwqnlnhf",
"3-8 l: ksllllplllc",
"1-3 q: gjmhq",
"2-9 l: lwklcxllf",
"5-7 p: ppcclscppgdxmg",
"3-6 z: fpxmpz",
"8-11 r: vrrrrrrrrrrrrrs",
"1-7 q: cqqqqqgq",
"13-14 t: tttztttttttttt",
"4-6 q: qzkqsqzmhhq",
"8-14 l: llllfllplllgzll",
"5-9 m: mmmtmmmmm",
"9-14 l: llllllllrllllltl",
"3-4 r: czrr",
"2-5 s: lssslssnmfqss",
"14-17 h: hhhhhhhhhhhhhhhhhh",
"3-4 x: xxxx",
"7-8 x: zdjbxxsl",
"10-13 n: ffrnphpzhnfxnncptmn",
"7-11 m: mmmmmmdmmmmmf",
"1-2 j: jjjjjjjjjtj",
"2-6 g: kglgsq",
"3-8 x: csvxxxxxztxdxpw",
"3-9 m: qbqwfmfpjmbnbcccgfgk",
"2-14 v: rmqhqlrvcjdhpw",
"8-9 p: pppppppvwpm",
"8-12 f: zvfjxbdgzjbplm",
"2-3 f: frff",
"7-9 f: htkxffclfr",
"4-7 v: cvqjctzvzvvv",
"6-7 f: fjffflj",
"1-4 b: tbnpb",
"8-10 t: tjpbtfzhtfsdjtlttttt",
"8-12 h: hhhhhhhhhhhrh",
"3-5 n: hxbwgjchklnplnb",
"1-2 z: jzvz",
"4-7 z: vzzzvcz",
"11-12 f: fffffvcfskcfcfftqf",
"2-5 p: cxktpckkqkgjpptvgp",
"9-16 b: bbbbbbbbkbbbbbbbbbbb",
"10-11 p: jcpnpppxpppb",
"7-9 n: sncnrzncnzdnngn",
"10-11 n: ttqrrkbspnn",
"11-19 c: ccczncccccsccpccccjc",
"1-2 h: hhhbwhhknzf",
"5-8 q: zxbtktkf",
"2-6 x: trxhzl",
"1-5 d: dskddkqdgqkhcz",
"7-12 c: ccccccccccccc",
"7-9 t: kskrrhtxtvsqzt",
"5-12 v: vvvjvwrdfscv",
"6-10 z: pzznznzczkwzzzmzz",
"15-18 t: tttttntttttttttttttt",
"4-6 m: bxmmmm",
"2-8 k: tkkhqwkkkpk",
"6-11 p: pppppgmpppppp",
"7-10 b: bkbcbbrrbr",
"6-11 c: cctccccbnbcvccc",
"2-5 t: ccpxgwzqktxwjf",
"4-11 s: sssssscsssssg",
"3-4 d: ndpk",
"3-4 z: gjzzzkbhzzs",
"8-9 t: ttttttttt",
"5-10 l: lllldmmlln",
"9-15 j: njzjgjjjjjjjprjjj",
"5-7 p: zppppppgkp",
"2-6 r: rvdrrrgdnrrrlrr",
"6-7 k: kkkkkkkk",
"3-4 x: nxxxmtmljgldjx",
"2-6 f: qfxxxftf",
"1-9 z: zzdlqgzwzzjw",
"6-8 n: rnjnstwm",
"4-6 w: vhfhwckw",
"3-7 k: kkpkkfpk",
"5-7 k: kkkfzkhkk",
"1-11 j: jjjtjjjjmjs",
"2-17 w: wlwdkkwmkwskpstxvrwr",
"5-11 g: kgpgjspqlwnx",
"2-6 l: lpllld",
"1-6 d: xwkvgvkdxlljpdqwmhs",
"5-6 z: llrzzsz",
"4-5 l: lllll",
"18-19 g: gggggggngggggggggggg",
"1-10 x: kkdxwkrtfh",
"3-4 t: ttrqzttbsrt",
"14-16 s: ssshsssssssssnsss",
"2-6 k: kjzkxkkhkp",
"2-10 b: bbbbbbbbbbbbbb",
"1-9 v: vvvvvvvvvvv",
"11-12 m: mqmmmmmmmmhsl",
"5-6 s: sssmsss",
"14-20 s: srssssssdsssskssksvs",
"1-3 r: rrrr",
"4-7 d: zddkdptdfdw",
"6-7 g: rggglggtgkgg",
"3-5 c: bcctcvpcprcccqccpcrc",
"8-9 r: rrrxzrrlmrd",
"12-17 c: hcctccccbqcctscsscv",
"15-16 d: dkddddjdddddsdhwdddj",
"13-14 b: blbbbbqbhbbbmz",
"2-10 p: hvxqpjqstv",
"1-4 p: plxp",
"3-6 z: zzdlzqjzzz",
"1-14 s: qsssssssslshswsjh",
"3-5 r: grrrnrrrsvrrrdrrrjrr",
"1-4 d: dfdjdxbpdddf",
"2-3 p: pppppp",
"16-18 c: cmcccjxfclcgmchswq",
"9-11 x: xxrxxxxxvxrxx",
"13-14 p: dpppppsppspftpppwp",
"15-19 h: hhhhhhhhhhhhhhhhhhhh",
"6-12 q: qqqxqqqqgqqpqqqqqqqv",
"10-12 g: gqgdgzhgghjgdd",
"2-6 p: pnppppp",
"3-14 l: lllllllllllllllll",
"12-19 h: hhdhhhhvxrfhcshhwxh",
"16-18 m: mmrmmmmlmmgmmmmmmmmm",
"8-11 t: tntmlpgfttv",
"8-11 f: mffffffffff",
"15-18 t: tftttttttjwtttjttjt",
"5-12 d: pzdrdqxzqzwgzwcgsv",
"4-9 d: cdwdmhksdzgd",
"9-17 l: mlsllmgdlhlgmfglr",
"1-5 r: rrcnr",
"3-4 c: ccccccc",
"1-2 g: cskvbgnlgnpfrh",
"5-10 n: tfnnvnnqbbn",
"1-15 g: fxpdggmtrqggdglh",
"3-4 t: ftttppdtdbxzqw",
"5-6 p: qpxsjt",
"8-14 r: bkltjzprkhrhmrg",
"1-11 f: gffkkmpflxlqfsf",
"1-4 d: vddknn",
"5-7 l: llllllvlllll",
"2-11 b: bbbbbbbbbbbbb",
"1-3 h: hhhh",
"13-14 q: jqqqcckhdqkqqj",
"4-14 p: mfwcbqxpdkhtdfj",
"3-4 g: ggggg",
"6-14 v: vvvvvvvvvvvvvvv",
"16-18 v: vvvvvvvsvvvsvvvvvv",
"9-13 l: llllllllllllllllllll",
"3-4 r: zjrr",
"6-8 x: xxxxxxxxx",
"2-6 p: zlgpps",
"3-8 t: ttjtbttjt",
"18-19 k: kkkkkkkkkkkklkkkkkk",
"8-13 q: hcvnkpnqfzqmqscwf",
"15-16 p: ppppppppppppdpmr",
"7-12 c: cqccccdcccwsccc",
"8-12 d: ddhddddgdddgdddd",
"3-4 x: xxxx",
"6-8 w: wwwrlzcbwhwlqwwwv",
"1-5 h: hhhhdwhhlhph",
"4-5 f: fffvz",
"3-8 c: ccqqcccc",
"3-5 k: xkwkdkh",
"2-3 s: ssssshhsss",
"4-6 x: gxxxcx",
"8-12 l: vsnlqbjltbtlphjtf",
"3-6 n: tgpnqxnntkmntvl",
"9-12 f: cjzkldhmvclk",
"4-7 b: zgpdznb",
"1-12 s: ssssnrssssscnssssq",
"14-16 p: pppppppppppppwpjp",
"4-14 b: xpbbvcbbbspgbbqbw",
"5-6 s: smssrb",
"5-16 b: tzbdqxgkbxbvzwvt",
"2-14 f: vzplvvftrcdmgs",
"13-15 t: tttttkthhtzttdt",
"2-3 s: vpwss",
"9-14 s: sssssssfssssss",
"7-13 s: tsnwzxwzjzsjkchlg",
"12-15 q: qlqbbfqqvqmcqhvq",
"12-13 g: gggggggggggggggggg",
"1-3 g: jjdqzgwgggggg",
"5-6 n: nlnxnnnwv",
"15-16 m: mmmmmmmmmmmmmmmjmmm",
"2-6 m: vmrqrmz",
"4-5 n: nvnnwb",
"13-15 x: xgblxvxmpskqwvlx",
"6-7 v: vvvvvvvv",
"8-10 r: fsrrdprbrfxhrdv",
"4-5 j: jsjjf",
"4-6 k: kkkjkkk",
"5-9 j: cflfvjjtjljjhbhnj",
"9-11 t: xswktxtqrbm",
"4-16 r: drrrrrrrrrrrrfwnr",
"13-18 p: bbkplmplqmppppspmp",
"9-15 r: kgnwvxmcrmltpcgwvrb",
"4-5 c: jcwcccnc",
"2-4 f: ffff",
"8-12 d: rvsdddvdtdcd",
"3-10 v: qvdzjhcvsz",
"10-11 x: qcmvlvgxkxx",
"6-9 s: sxsspsksjssfsnssrvs",
"3-7 x: zbxxxxxwrpxgr",
"9-17 j: hrppktjsqhzqwxhdz",
"5-7 z: nzzzvzswz",
"6-7 p: ppppsbpp",
"10-13 f: fffffffffhffmfcxffpf",
"9-12 f: ffffffffsffmf",
"14-15 r: rrrrrrmrrrrmrrzr",
"3-6 w: whwwwwwwwwwwm",
"7-8 b: btqbbbbbbbz",
"13-16 z: zznbbdmbzhjzzzzzmngd",
"6-7 q: fqmqltdqqqdwqss",
"3-4 h: hphhhhh",
"1-3 r: rdgktrmrmdztrkmn",
"17-18 w: wwslwwsmwswwfxwwwww",
"6-8 p: ppprpppp",
"8-10 z: zzzzzdzrztzzzz",
"8-11 m: tmldmmwxmjmrmtrmm",
"12-16 s: phpprsdvkmsssmssnqwm",
"3-4 h: qplnhkhh",
"14-19 w: wvxvqzqzdnjjwwtdbwc",
"2-4 p: fpnp",
"3-5 c: ccccpcccccccc",
"3-12 g: ggwggbgfggrxggg",
"4-8 r: rrszrgdbrw",
"2-4 n: vnmgjtps",
"8-10 j: mjjjxjjgjc",
"2-6 m: vmmhmm",
"3-4 w: vwww",
"10-18 v: mvnbqbvcpkvnhqvvbvzv",
"15-19 g: ggtggggggbggggxggglg",
"7-13 m: mmmmmmjmmmmmmm",
"5-11 d: ddxhdndtfdddndxzdqk",
"3-11 f: ffnfbfffffgrff",
"7-14 w: fflfpgklzlxfwwt",
"15-17 d: zxllzgbjrrddnmdhdwp",
"1-5 n: nnnnknnn",
"15-16 j: ffkjjljgndljjnjscs",
"2-3 v: nvvxvntqcrqq",
"5-6 c: rcccgpcc",
"2-3 j: qjjfrhwljgczj",
"5-8 k: kkkkkkkkkk",
"1-2 r: rrrrxrcrrr",
"1-15 t: ltttttttttttttttt",
"4-13 q: prlqzqvgpqslqqcqqjq",
"3-12 q: gfbpbdrwrbqt",
"2-5 q: qsxccx",
"4-9 t: slglllcdkjzdmxt",
"2-3 r: rlvrrr",
"2-13 w: wwmkwwwjcwbcwzwwcg",
"3-4 t: ndkvx",
"6-13 b: qflzbbbcfzkbmtx",
"6-10 j: pdckwfhkjxqljnjjw",
"1-5 j: jjjjjqmj",
"2-10 x: xlxxxxxxxfxx",
"1-5 r: rvcnr",
"4-10 c: cnchrcsgcvncpq",
"3-5 j: fjxbj",
"4-11 c: ccdlcsxckcx",
"12-16 m: mmmmlmvmpcmnmmdbmms",
"3-4 q: qqwlqqqq",
"2-6 f: kvcfdv",
"8-10 m: mmmmmmmmmm",
"7-8 j: jjjjjjjj",
"5-7 c: ccccncsjc",
"7-9 f: fffffrpfplhzfff",
"1-6 c: sbcccscccccccccccc",
"5-7 j: njpjqxjrljnqjwjgchtj",
"11-18 b: gktmxhjwbmbpjrbqkb",
"1-4 f: lffbfffffw",
"5-6 c: ccccsc",
"10-14 v: mkbxvxvgvvvvbv",
"5-6 x: jxxxxxx",
"4-6 c: qccmhcccw",
"3-7 s: qwmtwprsxd",
"10-19 d: rkdwbrndmxdsknddddl",
"2-5 p: pppppppppppp",
"6-7 w: wwffxwc",
"2-7 z: pkzcnxr",
"5-10 b: bbqbkbtdbbbbb",
"10-13 j: qmqgvhzkjmfjhjjm",
"5-6 n: nnnnrn",
"7-14 n: qgmlsvnjnrdzcdbstxv",
"9-16 q: qpllvqpmqlqvkhwqqrsm",
"2-4 s: sqpnqsgsssq",
"13-15 z: zzzzmzzzzzzzzzzzzg",
"10-15 b: bbbdbmqbkjbbtbd",
"2-5 h: qrhhhhp",
"11-12 x: xxcxhmxxxxxx",
"13-18 c: ccccccccccccdccccccc",
"12-13 h: knktllrdtgjhhhxpd",
"9-13 g: tdpfvzcqgbslgnbxkgpq",
"8-15 g: gggggggsggggggxggggg",
"1-3 v: wvfvvdvvvvv",
"10-11 b: bbbbbbbbbhzb",
"15-17 b: bbbbbbbbbbbbbbpttv",
"1-7 m: bmmmmmdm",
"2-3 h: rhksbfgh",
"6-7 w: wwwwwgf",
"3-12 h: hkhzhhhhhhhlhhmh",
"3-5 x: xxcxpx",
"7-9 m: mmdmtmjdxmm",
"1-4 n: lnnlnnnnn",
"4-9 k: kkkmkkkkbk",
"3-4 t: tttt",
"5-12 k: tkgwkrwwzcwkhkmk",
"4-5 f: fhfvfgwfff",
"3-5 h: fmbgjrxgh",
"5-6 j: xtwnjj",
"11-15 r: rrrrrrrrprqrrrfrr",
"13-14 f: fdffffflfffvfff",
"1-6 b: krsbnd",
"6-7 b: bbbbvxqbl",
"1-2 v: vvcvvvv",
"7-9 t: ctfcmttht",
"2-7 v: bcxhtdwbfqvv",
"14-15 n: nnsnlnvkqztnxnn",
"2-6 g: rknndvrhbg",
"2-6 z: mzzzdzzzz",
"11-14 q: qqqqqqvrqqzlqkqqq",
"3-4 t: ttcrttjtknjpvwhzm",
"8-10 j: jjjjjjjjjjjj",
"2-7 c: ccnhcccc",
"3-14 m: mmmmmmmmmmmmzmm",
"10-16 w: swsmwwwwwrnwmwwk",
"4-5 m: bmdjm",
"6-11 l: cmlllxllllkrllf",
"14-18 t: tttttttttttttvtltt",
"11-13 f: ffffffffffhfzfff",
"3-6 g: wkzxtrkgr",
"7-10 c: cccpcccccvccc",
"3-13 m: mmbmmzbcmlwmmfnmmq",
"2-3 p: pdszp",
"13-14 r: rqrrfrdrrrwvrrrrrwrr",
"9-11 g: gggwggggfcpg",
"3-9 p: pnppppdpppp",
"17-19 k: gzkktkxkkskkkmkkkpk",
"4-11 x: bmqhtxzqmvx",
"11-14 v: cvsvssqghzjqxm",
"1-14 z: zwxczzszzdmkztl",
"8-9 t: jkpptwctt",
"3-8 z: vqmzzpjj",
"6-10 s: msdrxssssswssjz",
"1-7 z: zhpzzzz",
"13-17 m: mmmmmmmmmlmmgmmmgm",
"9-10 n: qgtcnnnnnkcnnn",
"2-4 v: vrcvv",
"4-5 h: hhhdwh",
"8-9 c: zcccccccc",
"13-14 p: pjxcpmdpppmgwt",
"2-6 c: gskmcc",
"6-7 q: qqqqqqqq",
"3-13 b: gfbxqtnxnqxbb",
"8-10 l: lhrlqlrqlsllll",
"5-8 z: jlzgzzzq",
"10-13 z: zzzzzzzpzkzzgz",
"6-7 d: wddnddd",
"10-11 h: vbhhbhhhhbz",
"7-10 s: sxssksskqs",
"1-12 b: vdgxvsxpgbbpd",
"5-6 n: npnvckn",
"3-4 v: vvjvv",
"9-15 r: njhhqlmcmncjrpx",
"2-8 h: bghrdhhrjbhhhbjz",
"5-7 q: qqqqlflrq",
"9-12 f: qfhfffffffffffff",
"2-3 m: mmmblxmbpz",
"13-16 v: vvvvvvvqvvvvlvvw",
"6-12 b: wbfgbghzbmvf",
"12-15 r: rbrrrrthrrrrrrrr",
"4-8 k: pkprqkkkpsphwnhp",
"8-9 h: hhhhhhhsl",
"1-3 b: bsbn",
"15-16 j: ktjjjxjfjjrjjcjk",
"4-8 z: smzzmzzszzr",
"3-4 m: qmmmzqzlrpt",
"11-12 n: nnnnngnnnnwgnnnn",
"5-10 x: slpbxqfxxxx",
"12-19 q: qqqqgqqqsqqqqqqqsqqq",
"4-10 s: ssstssssss",
"6-11 g: gggggvggggzggggggg",
"12-14 c: cckccccdccxnngccc",
"3-5 j: jnrjvj",
"2-6 t: vtdtms",
"13-15 p: ppppppppppppjpq",
"1-9 j: jjjjjjjjjjj",
"8-9 d: wfdddddkddxd",
"3-7 p: pwpcpvp",
"3-4 h: hhzl",
"9-10 n: lnkjxnsbnn",
"7-11 z: zzzzfznzbzbzbzd",
"1-2 m: mmzlmkm",
"6-7 t: jbmpztx",
"5-6 v: vvbvvtn",
"7-17 q: lvdfpbqxbxdnwqzjlfs",
"3-5 z: zdzzzxczbzzz",
"10-14 f: fpffffffffffff",
"3-8 x: wxxchxjx",
"1-6 x: xxxxxx",
"14-15 x: zmxtcbjxtvxxxxg",
"4-5 f: qfffghf",
"2-3 p: pppp",
"10-12 n: nnngnxnnnhnsbntln",
"1-2 w: ftwwww",
"10-11 f: fffffffffpkf",
"4-5 n: nnnnnn",
"10-11 r: rrrrtrrlrrrr",
"5-6 h: hjhxhhnbhlbxvhs",
"1-4 q: qqqq",
"7-11 p: dkpfppwzpxqqx",
"11-17 l: lzknllnllkgvllllh",
"1-3 z: zzzzz",
"16-17 b: bbbbbbbbbbbbbbbbbb",
"2-4 n: qcpwnhn",
"1-4 v: svvhvvv",
"10-12 l: llllllllllljl",
"1-2 l: xzlllllll",
"1-3 l: plklll",
"4-8 x: xxxxfxbxcxxqxfxpx",
"3-8 b: xgbbwncxclbv",
"5-6 m: mmmmmmm",
"4-5 p: pptppfnpl",
"14-16 x: gwjfkzwrldzxpdxgk",
"10-11 z: zzzzvzzzzzzz",
"3-12 k: kkxkblkkkkkgkkkmkk",
"4-6 p: pppfpx",
"2-7 r: rrmrrrrrrrrrr",
"7-9 p: pbpfpppppp",
"2-3 v: tvvbbjnvv",
"5-8 j: jjjjjjjjj",
"2-5 c: xcwcczjkvgccccvpkd",
"5-7 f: ffffpfqfffff",
"11-13 m: qmmmmmmmlwkmmmmmm",
"14-15 d: dddddddpmddddszdd",
"6-15 b: kptphpbxxqsbxlhxplml",
"16-18 x: xxkzfxgqxdcvzdxlzn",
"10-12 m: clrmmmmksmmm",
"1-3 w: wwpww",
"8-15 g: ggggggnlgggggggggng",
"3-6 h: tnhhxh",
"4-5 l: lllrdllxlnllqll",
"1-2 m: lmjhvl",
"1-4 k: dkkhkkk",
"6-7 x: wncxcxf",
"4-5 w: wwwhfww",
"4-8 b: bshnbbdbmfxbbrc",
"4-7 t: tbdtztm",
"7-8 n: zntlhccn",
"10-14 f: frgffffffflfzlf",
"3-4 b: nzbbbnfbdg",
"2-6 m: srmwsmtp",
"5-6 z: zzpvsrz",
"2-13 m: msmmmhmmmmmmtm",
"3-4 c: ccvcc",
"1-4 n: nnnnnn",
"2-3 j: zdvsj",
"4-6 c: ccctccc",
"4-5 z: zzpdztnrzl",
"4-6 z: hzdzpz",
"2-6 x: gxjxcxxjqcb",
"4-9 j: jjjvjcgzl",
"5-8 z: dmppvjqfzzzzn",
"5-7 v: vvvvvvr",
"2-5 l: lvkkft",
"2-11 n: nnhnqnnvnsn",
"1-3 d: dhndddjfd",
"8-9 x: xxxxxxxxxxxxxxxxxxxx",
"4-9 p: fntpgcwtwv",
"4-12 q: qbrlqzqcnwtjq",
"2-3 f: ftcjvnfkzx",
"1-2 d: dddd",
"7-10 g: gggggghggzgg",
"4-6 g: zhgbgphggtm",
"2-4 l: lblq",
"14-17 n: bnnngnnnnnnznnnnn",
"5-6 f: fxxffffhmswq",
"6-10 p: pppppppppp",
"2-4 q: lsxgqkqsblqqq",
"11-19 x: xxnrgxxxxxxxxxfwmxx",
"4-7 j: jjjtjjljjjjjjj",
"6-7 l: llllllll",
"1-4 f: pfftffffnffff",
"11-13 r: xrrlrrrrrqrrzrr",
"1-3 p: pvpqp",
"9-13 d: ddddxrnddddfdscsd",
"1-2 f: lbbr",
"3-7 t: mpttsgwb",
"2-10 c: jccchctshcpchwx",
"2-4 p: lmpd",
"1-2 n: zlnxnnf",
"2-3 w: fwwtqw",
"9-16 s: sssssssssssssssssssj",
"1-5 s: hssrm",
"15-17 b: ghpvwjbzpksvhsjbj",
"8-9 h: hzrvxhhdz",
"3-4 j: mkjjpvkfhprr",
"1-8 n: cnnnnnnmnn",
"1-4 x: lxxxx",
"3-5 m: pjttcvvcmfvzffcfmmv",
"3-10 r: rsxtvwjrfrqrrbzzr",
"2-7 h: hhckhhr",
"7-8 r: srrrmprrrhkzsndrrkr",
"4-13 m: pdsmlsnxcmhmmsvc",
"3-12 d: ddsdddddddddddddd",
"14-16 s: sssssssssssssjsds",
"3-4 m: djfp",
"2-5 w: bgwpc",
"4-5 r: zffrrqrs",
"4-9 r: rrrgrrrrqrrrrrrr",
"4-6 w: wxwwvw",
"7-8 d: tvddddwtdddldd",
"6-7 g: tgdggggfzrgqggggmggg",
"2-6 t: tgtfdtttttttttqxd",
"14-18 f: fffsffgfffffskfkff",
"1-12 b: qbvbbbbmbsqbcbgbbbcp",
"5-7 d: ddbqhdddsdm",
"6-9 n: tqwnckjsn",
"1-3 n: nnnn",
"5-10 w: wwwwwwwlwwqwwwp",
"3-4 r: rrrr",
"2-12 m: mmchtqmhfdpm",
"6-9 d: dzgzdbddwgdwldb",
"10-14 k: kkkkkkkkkkkkkzkkkkk",
"13-14 v: vvvvvvvvvvvvvvvv",
"2-12 f: btqtbrvkmfzhz",
"1-5 b: bbbbbb",
"7-10 j: jhjnjjwnjbj",
"2-16 h: kjszvtwrjgrvzrqlzcb",
"6-8 t: nxzftvtnrtxg",
"3-6 h: cvhhnhnhhcgst",
"5-8 f: fxgfjnjzz",
"11-12 b: bbbbbnbbbzbqbbbq",
"1-6 h: hjzhhw",
"18-19 m: xrvmftmpkpmrlkqmxvm",
"6-7 v: cvxbdsr",
"5-6 v: vjvvvvf",
"2-3 m: mmzpm",
"3-4 k: mkghkxc",
"1-6 s: sjsmjsstsss",
"2-10 s: wndvkxbmffh",
"9-15 q: qqqqqqqqqqqqqqqqq",
"4-5 f: rffffpc",
"10-11 v: vvvvvvrvvlmv",
"6-7 n: tnnnnlq",
"16-18 g: gggggdgdgggggggggggg",
"5-11 l: lwlfvzlsjll",
"11-14 v: vvvvvvvrvwvvvv",
"12-16 j: jjjjjjjjjjjpjjjx",
"4-6 w: wwwwwr",
"2-4 d: ncdd",
"15-17 c: nccccctccwccccqcqcc",
"3-5 m: mnlmqtsvn",
"7-8 w: swwwwwnl",
"6-12 l: zlplklqldllxlpvb",
"7-9 h: fhkhqnfhhzrhqhhh",
"11-14 v: vvvvvvvvvvvvvv",
"16-18 v: vnvvsllmvswcvzqvvxjl",
"7-9 k: kkkzkkkkskkkzkkkjlk",
"5-17 w: wckwxwlrlwrncxwwb",
"2-4 v: vqvvqgx",
"2-3 b: bbbbbbmbbbbqb",
"4-5 p: ptphbprpv",
"3-6 q: kqqkpqbnt",
"15-20 n: nnnnnnngnnnnnnnnnnnw",
"10-12 p: pppppxpppmpnjp",
"5-10 x: bhwlxkrdxxqvkphvmfgn",
"2-3 l: lllhql",
"4-11 l: wllvwfccllk",
"7-11 d: dmvmmzlngpw",
"2-6 v: rskbvv",
"7-9 k: kwtckkkkx",
"11-12 j: jnjjfzjjjjjjjj",
"2-5 v: rvvnnjjxjnnt",
"2-6 j: ljcqpjmhgmmcxjkgd",
"1-3 k: lklbx",
"14-15 c: ccccccccccccckc",
"2-6 x: xxxxxxxxxxxx",
"1-7 t: btrtxtjgtt",
"2-3 t: sttt",
"5-7 k: kkkkzksxgb",
"3-4 q: mnnxqwtnw",
"8-10 t: vwzmnxjdzx",
"4-10 f: svglffffpzw",
"1-5 s: dsfjsv",
"8-10 m: vmwpmmmjmv",
"6-7 h: hhhhhwxhhhhhhhhhhhhh",
"7-19 n: ktlblznjctnnrzwrknt",
"3-6 n: nzxclnvc",
"2-5 t: wtrttkx",
"9-10 j: jjjjjjxjjj",
"12-13 r: rrrrrjrrrrrwx",
"11-16 c: plvcnjcpnkvcpcmcpbc",
"2-3 c: gccclcslqdmsg",
"10-13 d: dddddddddhddd",
"8-9 w: kklwmwqmwwtwqw",
"2-5 q: qsqqwx",
"3-4 c: hcqvfbccccctcc",
"6-7 k: kkkwqgv",
"13-15 h: qhhmhkjvhhhhngnhhhhs",
"4-5 d: msjdd",
"6-7 g: ggggggg",
"5-8 r: cqrdrfxnrrjrsr",
"9-15 r: lprrqrrrrrrrrrrbr",
"6-7 h: hhrqhrlhhh",
"2-3 g: glgg",
"1-11 n: nnnnnnnnlnnjzwnnnn",
"3-6 l: bwllrl",
"2-6 p: nptphqv",
"3-8 l: lrlknvlpcm",
"2-8 g: wjbgpjrlfsgg",
"5-6 w: swwfww",
"1-8 p: pptpxppppppwpppfx",
"3-4 d: wlddg",
"15-17 c: sccccccgccccccccc",
"4-6 n: nnnhnp",
"8-9 r: prvrxmprlzxs",
"9-12 t: ttttttttttttkrtt",
"5-6 h: hhhhkfh",
"1-10 q: psqpzpkqtcq",
"4-7 f: ffflnfzkf",
"10-11 j: jjjvjjxfjjj",
"4-11 p: wlhgrxlclnt",
"1-14 t: wfntvttxmldhqg",
"14-19 c: ccpczqrccfhtcvljlvc",
"11-12 w: wwwwwwwwwwwww",
"2-8 z: lzsdqxzz",
"17-18 p: pppppppppppqphppprpp",
"2-4 j: wjjq",
"4-6 f: ffkfffgff",
"8-20 x: phxxxxxnwxxdqzxxxxxx",
"9-10 d: xvddddsldd",
"3-10 l: rglllxlnfl",
"6-15 d: ddddddgddpddddwd",
"6-7 w: kwwwwhs",
"8-10 r: rrrfmrrrrd",
"2-11 x: xcjcgtkzkhtmrxqjxxx",
"4-5 v: wvmdr",
"7-8 d: dddddddd",
"7-13 l: lllllldlxllln",
"13-14 z: zzdrzzzffzzzzzznzz",
"3-4 j: zjjj",
"8-9 s: sssssssbss",
"6-15 f: pfsfvfxqpffqfqf",
"9-11 p: pjpppprzpcphvppwp",
"3-4 c: ccrd",
"9-10 c: qcwbccccjhwvtwcccnc",
"3-4 x: xgxx",
"5-6 x: xgxzxxxxxxx",
"5-10 l: kxdgnqrkpqgcmcmnk",
"4-7 v: vvvpvvvv",
"1-4 n: nqnnnnnn",
"5-6 p: pprgpst",
"14-20 q: wlxrjczhxwdctvpcgxqc",
"5-8 g: gcggbggggggzgg",
"10-11 g: ggggtggggggg",
"14-18 h: hhchhhmhhbwhhlhsvrh",
"3-6 f: ffmfffffffff",
"1-12 n: rnnnnjwnnnnv",
"7-12 l: bpxlhthjplljwxvvvjm",
"4-5 j: jhjjjjj",
"9-12 q: qvqqqqqvqsqq",
"3-4 d: ddnvdddddgddd",
"1-7 h: xhhhhhkh",
"1-4 f: fffff",
"3-4 q: qfrq",
"5-8 k: kkkkgkkqkk",
"14-18 k: nkkkkkkfkkwkkkkkqk",
"1-4 q: qqdc",
"17-18 f: ffffffffhffffffffff",
"16-17 b: bbbbbbbbbbbbbbbdm",
"17-18 z: zzzzzzzzzznzzzvzmwzz",
"3-4 g: tggd",
"4-6 t: mlttlqqz",
"11-18 f: fgffgwlffffftfzfrt",
"7-9 h: hmmhhhpljjn",
"16-17 m: mmrsnmmzfhtmrjwmmjm",
"2-3 l: cllcbm",
"3-4 k: fkkkqbpbmmcd",
"9-10 f: kfmchwkwzfh",
"5-6 j: jjmjjjjjj",
"3-5 v: vsvbfvvh",
"3-4 k: tgkk",
"2-8 k: lscvjjnhpxl",
"7-8 v: vvlvvfkqqv",
"8-9 q: qcqqtqqhqvqqtq",
"12-14 z: zzzhzwzzqzzzzwzzlz",
"5-8 k: kzknkkkkkp",
"5-6 s: spsssw",
"2-3 k: kmkh",
"9-10 f: vnlxmstqbsg",
"1-2 k: kkkk",
"6-15 r: rcrrrsrrrrrrrrzrrqrr",
"3-8 c: cfczjwkcxbc",
"15-16 k: kkkkgkkkkkkkkkkh",
"5-18 c: ccdcxtccccccpcfccv",
"6-11 w: qdwnfhzlwwwwxwwgwhwk",
"1-6 d: fddddddhddw",
"7-10 p: wpbppvpzwc",
"12-14 k: kkkkkkkkkkhhkslsk",
"4-7 r: hdrrfhrqrdmcbnlrrjbr",
"7-10 b: bbbbbjbbbbbb",
"4-7 p: pzppzppsp",
"11-12 h: qhhhhhhqhrlwlhhthh",
"6-9 s: sbssxsskswvp",
"17-18 b: bbmpbbhhbnsbbbbbbb",
"8-9 g: wgggktggg",
"1-12 s: vsssssfssssrqk",
"2-5 s: bsgssxc",
"3-4 c: ccccccc",
"2-3 d: dddd",
"5-7 r: ldlcjrrlrngr",
"5-10 m: msmjqmmmmm",
"3-7 c: ccccccccc",
"13-14 p: pppxpppppppppcpppp",
"2-3 r: jrfrvrk",
"11-12 g: gggggggggggg",
"6-18 t: ctvqgcrgnxdvbzjfrrbt",
"6-11 f: rnjptfnwgxfp",
"5-8 w: wwwtwwwwww",
"14-15 r: rkrbrvrrrgrczrz",
"12-13 t: trtjtttlnxnxx",
"5-8 l: qnwllfsl",
"2-15 g: xgtcjftlqqfwkggpf",
"11-16 j: jjjjjjjjjljjjjjjj",
"8-9 b: bbzbkbbvgcbb",
"5-6 r: dvkxrrsvrrksszsdr",
"12-13 j: jjjjjjjjjjjhdjjj",
"16-17 z: mzzzrxfzzzzczzgzz",
"2-15 p: lpjxcdzjmnghfppr",
"9-15 s: ssssssssnsssssss",
"1-11 t: tfvtqvlbtld",
"4-5 k: kkkczkkkvkkk",
"2-7 p: ptphppvppppp"]
def ParsePasswordAndPolicy(line: str):
password = line[line.find(':') + 2:len(line)]
character = line[line.find(':') - 1]
minNum = int(line[:line.find('-')])
maxNum = int(line[line.find('-') + 1:line.find(' ')])
return {
"password": password,
"character": character,
"min": minNum,
"max": maxNum}
def VerifyPasswordSecondPolicy(passworddata):
parsedData = ParsePasswordAndPolicy(passworddata)
pword = parsedData["password"]
firstIndex = pword[parsedData["min"] - 1] == parsedData["character"]
secondIndex = pword[parsedData["max"] - 1] == parsedData["character"]
return firstIndex != secondIndex
def VerifyPasswordFirstPolicy(passworddata):
parsedData = ParsePasswordAndPolicy(passworddata)
characterCount = 0
for character in parsedData["password"]:
if (character == parsedData["character"]):
characterCount += 1
return(characterCount >= parsedData["min"] and characterCount <= parsedData["max"])
def CheckPasswordsPartTwo(input):
validPasswords = 0
for line in input:
if (VerifyPasswordFirstPolicy(line)):
validPasswords += 1
return validPasswords
def CheckPasswordsPartOne(input):
validPasswords = 0
for line in input:
if (VerifyPasswordSecondPolicy(line)):
validPasswords += 1
return validPasswords
print(CheckPasswordsPartOne(problemInput))
print(CheckPasswordsPartTwo(problemInput)) | problem_input = ['2-5 z: zzztvz', '2-8 d: pddzddkdvqgxndd', '4-14 r: rrrjrrrrrrbrrccrr', '2-7 r: zrgsnrr', '9-10 z: zzzxwzznpd', '8-13 g: gggggggxgggghggg', '1-6 c: xcccxcccccz', '3-4 b: bxbt', '8-11 d: dddddddzddv', '4-14 m: kxdmmmdmfwmmmdfr', '16-17 g: ggggggggggggggggg', '2-3 f: ddvdlff', '9-11 g: ggggpfgggggg', '7-8 c: fdhctccc', '3-6 c: tmcdcncqcvccg', '2-3 l: clllll', '1-9 b: bbbbbbbbbb', '10-15 w: wglmwwwrnnzgwhhwvvd', '10-14 g: ggggggxsgggqggg', '9-19 q: fjlqbvtdngwvtbnsgfm', '1-2 k: kgbkkv', '4-10 m: mmmmtmmmmgm', '3-4 h: hplh', '5-7 q: qqqqrqk', '3-12 v: zbvlbpxcrnvvwjpwl', '1-4 r: crrr', '4-5 h: hhhrj', '2-4 r: mhrr', '9-10 c: pccccsccbk', '10-16 n: drnhqnnnnqnnpxmh', '5-6 v: vvvnvvg', '11-12 c: ccccgcccccpc', '5-10 b: bdbjbbfmfbb', '9-13 w: zwbwwzhwwkwsxdfwglx', '5-19 v: vvvvvqrvvfvgvvvvmvv', '3-9 d: dddgztdljb', '12-13 s: swssssrsssshx', '5-6 l: dllkljq', '4-5 q: qqqsdqq', '2-4 w: tmwg', '10-12 l: llllsldflllllljjlxl', '3-11 s: sjtsssssksbs', '1-5 v: hvvtmvgvv', '3-12 g: ggvgkgfgggghgg', '3-4 p: ccpp', '3-9 v: vfvvvvvvvvvvvr', '8-16 k: kkkkkkkkkkkkkwkkkk', '8-9 x: wxbrxfdrw', '7-9 n: nnnfnnnnn', '7-11 w: wwwwxwwwwwzxw', '6-9 n: nknnhnnnnlnnn', '10-12 l: qllllllllqbl', '17-19 p: pppppppppppppwppkpp', '4-5 q: qqqqqq', '7-15 v: vvvbmbjvjznzdhfvtn', '3-12 w: wwwwwdwwwwwwtwwwww', '7-10 x: mmgmknpvdbxdl', '9-10 v: jljttxpvvv', '11-15 d: dshddnddqdhddvm', '1-3 r: vrqrrr', '6-7 c: ltcbpccw', '5-13 q: qqqqcqqqxqrqg', '3-7 l: lhlmhzl', '2-3 l: lxntjnttkllll', '3-4 b: bbnsb', '5-6 j: rjppzvjdjj', '4-10 g: fgggjgvfggggggsggm', '11-12 z: ztzzzkzzzzsvzzzzt', '2-3 h: hcvbf', '7-13 s: sswkwhsdqsdcs', '3-10 j: mghjglnbdhjp', '6-8 x: dfxrxxsxpsxxxxmc', '11-12 f: fffmfcdpffmpflfffdw', '4-7 n: nnnknncnn', '2-6 k: tzqlzqhrncvktfwvswt', '2-4 h: pqplh', '8-13 h: zhlwqvmnkjhhtkf', '2-3 l: llll', '19-20 j: jjjjjjjjjjjjjjjjjrjj', '3-14 n: crnnrgpmxxlrfljk', '2-4 t: stpr', '11-13 c: cctcccccccccccc', '5-6 q: fqqqqqdwtwqjq', '6-7 z: zzzzzzg', '8-16 j: njjgsjjljktjcbjvjc', '3-6 c: swjccc', '5-7 h: ghvwjmzm', '9-12 s: sssssmvtdckmfs', '3-4 r: bsrm', '6-7 c: ccctcccc', '6-10 t: swndrtcvtl', '13-19 v: vjvxvvvdvvvvvvdvblv', '5-7 w: hnwwwtwp', '8-9 k: kkkkkktzxkkv', '4-6 g: xpsxgs', '2-3 r: xrrdxm', '2-9 f: ffvqxxvsf', '7-10 t: tttttttttt', '4-6 q: bbqqqqqqbq', '7-9 q: xjcwqhprgh', '3-6 j: jjjjjjjxjjj', '1-3 l: blll', '2-5 p: phbppp', '3-4 p: phpb', '2-15 r: mwgnrkxrrbmgpzrdrr', '8-13 x: jsrlvxmxwglkh', '4-11 b: ctcbsjgjplbthhrskfnb', '6-7 q: qqqqqfvcq', '10-11 d: ddddddjdbndddd', '8-9 p: pppppppkf', '10-14 q: qqqqqqnqzgqsqv', '12-13 b: bbbbbbbbbbbbb', '6-11 h: khnkthfhhdhrhh', '5-6 g: gzggwcgq', '2-4 f: fbfg', '6-9 f: ffvfsfvffxff', '6-7 t: tsfdltt', '14-17 t: tttttttttttxtcttp', '3-4 v: vwtv', '7-10 x: pxmldqqxmw', '1-2 s: pdssssssss', '5-6 n: snwnml', '3-8 t: tjnpjqzxbj', '5-7 n: mxkqfnjb', '4-12 q: qqqkqqqqqqqkqqq', '4-5 d: pjhnsfdgddjsddvpxxd', '14-15 t: trttdtxwtdmtttt', '3-4 j: jjvz', '1-2 p: xqpppp', '11-15 d: dddpdddddddddddq', '15-16 b: bnbbbbbbbbbtbbdbb', '9-11 w: wwwnwwmwbghw', '15-18 g: tjwqbgwmvpvghxgzkgj', '3-4 j: jjps', '9-12 f: ffflfffmfnffvff', '1-3 g: gbgstndgggqrdbtpdqdr', '4-6 f: fflxfqffff', '10-14 t: ttttttttttttttttt', '1-7 v: vvsqlvvvvkj', '3-7 b: wvbxlwbjtbbbvh', '3-7 p: hqvsvpn', '2-6 f: fkwfhf', '3-11 d: dzrwnffrdvs', '8-9 s: sssdssztlssqksx', '12-15 t: tttttttttthtttt', '5-6 m: mmmmmmmm', '2-3 n: dnnl', '12-16 w: wrwwtvwwwwwwwwww', '2-4 j: jjjjsj', '7-11 x: xxxxxtcxxxlxxx', '8-17 n: nbngnnnsnjnbhnntzwxt', '5-6 b: tmbdgn', '15-16 x: xqlpjxbbxnrbxxxxqmkf', '1-3 c: ccclf', '12-14 m: zhmmmzltwhrmfmx', '15-17 c: ccvcxcmccgccccbcccc', '10-13 k: mkgkljkkkjkkg', '1-4 b: ckdr', '10-12 b: bvfbgbbbbbbb', '2-4 v: jfvcv', '2-7 p: jswmqpmc', '11-16 b: bbbncbpmbjbbvgrb', '1-6 n: ktjcwr', '2-9 l: lllrwljlnlwllln', '17-18 h: hhhhhhhhhhhhhhhhzfh', '9-14 b: bbbsbqbbjjbbkb', '7-12 j: jjjjjwwjjjjcj', '10-13 w: wfwwwwwwwjwww', '2-6 j: bjghpj', '13-16 z: zzzzzzzzbzzzzzvg', '10-11 f: ffffkfffcfxff', '3-4 m: mmmmkjvzmkp', '2-5 k: kkkkk', '5-6 r: rrbrrs', '1-2 c: ccqjmc', '13-14 r: rrrrrrrrrrrrztr', '8-12 z: zrzzzzzqbzvdz', '4-9 m: hlgmtvvqs', '9-10 t: tthttrtbrnt', '2-4 k: snpkzhck', '12-13 x: wlxwwxxxhgxxx', '11-16 h: ncmfhhvgghhhhhjhd', '13-15 g: sgxgfntgjnxkgbgm', '4-13 s: vqkslldmgmfrd', '3-14 z: zzzzzzzzzzzzzzzz', '14-15 c: ccccvccccccsmlpcfccx', '4-5 p: pppppp', '9-10 z: kgblzrqbzz', '13-15 p: pppppptpmppbpppqpp', '7-8 b: dntbbcmswb', '16-17 d: dddddddddddddddgd', '10-11 r: rrrsrmrrrqtr', '2-3 q: qtqgz', '6-8 c: xztzfkcch', '14-15 l: lllflllllllllzsl', '1-6 s: zssssss', '5-8 d: hdddwddvdpd', '10-12 j: jjjjjjjjjpjbj', '1-9 q: tqqqqqqqqnqqwqk', '2-4 t: shpwwttwqb', '8-9 s: xrssssssz', '3-4 c: cjcfc', '3-10 v: rfvzsncmfv', '4-7 t: lshczltjfqkmkt', '13-16 x: xxxxxxxfxxxxzxxrxx', '1-3 z: pzkzlzmzz', '4-5 d: ddkbfdtdd', '9-10 r: rrrrrrrrlfkj', '3-7 s: svtbsssjsldts', '10-13 c: ccccgxzqtctrc', '1-7 q: zgwqgrx', '6-8 f: ffnffrfg', '4-5 f: kffcffp', '1-2 m: ggcm', '5-6 z: zzzdgz', '9-14 j: jjjnjjjjjjjjjjjj', '2-17 d: xttgzggnfhsrjqdbppps', '5-6 f: xrcfff', '1-3 z: wzzg', '1-2 h: hhhvl', '13-17 q: qqqqqqqqqqmqqqqqqq', '2-3 q: bjqq', '1-5 w: zwwwgww', '5-7 s: jnvpmgj', '9-10 q: zctgztwpqq', '16-20 j: jkjjkjnjwqqjjjzgjjpk', '16-20 k: kkkkkkkkkkkkkkkkkkkk', '17-18 d: dddddddddddddddddbd', '3-5 d: dngrhxb', '10-12 t: tmttttttttrttwh', '7-9 q: nqqqkqcqqqqq', '7-9 z: zqzzzzwctng', '10-13 d: dddjldsddkddjpddd', '3-7 g: lgglgggggphx', '6-7 b: llkbcdxwtzrblp', '1-5 s: dssdscpzwcn', '2-6 h: hhphhhhhh', '4-13 z: smkzzpzjfzzbzqzxzjz', '2-5 j: jjjjjj', '8-11 p: lgmppspppppk', '9-10 c: ccccccccdnkc', '3-9 m: mmfmmmmpkmsmmm', '13-15 m: mmmmkmmmmmmmgmhmmm', '5-6 x: xxxxxxx', '10-14 b: bbbjbqbbwcbbbb', '3-12 f: ffmfffffffnzfffff', '11-12 m: mmmnmmmmmmmmm', '8-12 v: jptmbccvmvsxchfvv', '4-5 s: ssssns', '12-14 j: jjjjjjdjjjjvjhjjj', '11-13 j: wjjjljjjcjjjjqjjp', '1-7 g: ggggggggdg', '2-3 v: bkjqv', '4-13 q: qzhldwthbwgtr', '12-13 p: ppplppdgpppppp', '11-12 f: flffxfpffprgfff', '8-14 b: mbbbbbtbwbhstbbbbbbb', '6-7 m: bqmsmmm', '1-3 w: qxlggmxtwj', '3-17 c: dwbkjcwqcrccbcxcnvxc', '11-13 p: ppxppppdppxpzpppp', '4-10 v: vfvvfvzvqv', '1-7 m: mmmxmmmmmbmmrmmmmmm', '2-12 x: xrdxwxzwfxpxtqxxxgxp', '6-11 w: swzwwkddmsrxwzfg', '6-8 g: ggggggggggg', '3-4 h: tzshs', '7-8 t: zjtzpclm', '5-6 k: brzkzk', '14-15 c: cccccccccjccccc', '2-3 h: hhfh', '15-19 w: wwwwwwwkzxwwwwwwwwh', '8-10 f: mjmwqnlnhf', '3-8 l: ksllllplllc', '1-3 q: gjmhq', '2-9 l: lwklcxllf', '5-7 p: ppcclscppgdxmg', '3-6 z: fpxmpz', '8-11 r: vrrrrrrrrrrrrrs', '1-7 q: cqqqqqgq', '13-14 t: tttztttttttttt', '4-6 q: qzkqsqzmhhq', '8-14 l: llllfllplllgzll', '5-9 m: mmmtmmmmm', '9-14 l: llllllllrllllltl', '3-4 r: czrr', '2-5 s: lssslssnmfqss', '14-17 h: hhhhhhhhhhhhhhhhhh', '3-4 x: xxxx', '7-8 x: zdjbxxsl', '10-13 n: ffrnphpzhnfxnncptmn', '7-11 m: mmmmmmdmmmmmf', '1-2 j: jjjjjjjjjtj', '2-6 g: kglgsq', '3-8 x: csvxxxxxztxdxpw', '3-9 m: qbqwfmfpjmbnbcccgfgk', '2-14 v: rmqhqlrvcjdhpw', '8-9 p: pppppppvwpm', '8-12 f: zvfjxbdgzjbplm', '2-3 f: frff', '7-9 f: htkxffclfr', '4-7 v: cvqjctzvzvvv', '6-7 f: fjffflj', '1-4 b: tbnpb', '8-10 t: tjpbtfzhtfsdjtlttttt', '8-12 h: hhhhhhhhhhhrh', '3-5 n: hxbwgjchklnplnb', '1-2 z: jzvz', '4-7 z: vzzzvcz', '11-12 f: fffffvcfskcfcfftqf', '2-5 p: cxktpckkqkgjpptvgp', '9-16 b: bbbbbbbbkbbbbbbbbbbb', '10-11 p: jcpnpppxpppb', '7-9 n: sncnrzncnzdnngn', '10-11 n: ttqrrkbspnn', '11-19 c: ccczncccccsccpccccjc', '1-2 h: hhhbwhhknzf', '5-8 q: zxbtktkf', '2-6 x: trxhzl', '1-5 d: dskddkqdgqkhcz', '7-12 c: ccccccccccccc', '7-9 t: kskrrhtxtvsqzt', '5-12 v: vvvjvwrdfscv', '6-10 z: pzznznzczkwzzzmzz', '15-18 t: tttttntttttttttttttt', '4-6 m: bxmmmm', '2-8 k: tkkhqwkkkpk', '6-11 p: pppppgmpppppp', '7-10 b: bkbcbbrrbr', '6-11 c: cctccccbnbcvccc', '2-5 t: ccpxgwzqktxwjf', '4-11 s: sssssscsssssg', '3-4 d: ndpk', '3-4 z: gjzzzkbhzzs', '8-9 t: ttttttttt', '5-10 l: lllldmmlln', '9-15 j: njzjgjjjjjjjprjjj', '5-7 p: zppppppgkp', '2-6 r: rvdrrrgdnrrrlrr', '6-7 k: kkkkkkkk', '3-4 x: nxxxmtmljgldjx', '2-6 f: qfxxxftf', '1-9 z: zzdlqgzwzzjw', '6-8 n: rnjnstwm', '4-6 w: vhfhwckw', '3-7 k: kkpkkfpk', '5-7 k: kkkfzkhkk', '1-11 j: jjjtjjjjmjs', '2-17 w: wlwdkkwmkwskpstxvrwr', '5-11 g: kgpgjspqlwnx', '2-6 l: lpllld', '1-6 d: xwkvgvkdxlljpdqwmhs', '5-6 z: llrzzsz', '4-5 l: lllll', '18-19 g: gggggggngggggggggggg', '1-10 x: kkdxwkrtfh', '3-4 t: ttrqzttbsrt', '14-16 s: ssshsssssssssnsss', '2-6 k: kjzkxkkhkp', '2-10 b: bbbbbbbbbbbbbb', '1-9 v: vvvvvvvvvvv', '11-12 m: mqmmmmmmmmhsl', '5-6 s: sssmsss', '14-20 s: srssssssdsssskssksvs', '1-3 r: rrrr', '4-7 d: zddkdptdfdw', '6-7 g: rggglggtgkgg', '3-5 c: bcctcvpcprcccqccpcrc', '8-9 r: rrrxzrrlmrd', '12-17 c: hcctccccbqcctscsscv', '15-16 d: dkddddjdddddsdhwdddj', '13-14 b: blbbbbqbhbbbmz', '2-10 p: hvxqpjqstv', '1-4 p: plxp', '3-6 z: zzdlzqjzzz', '1-14 s: qsssssssslshswsjh', '3-5 r: grrrnrrrsvrrrdrrrjrr', '1-4 d: dfdjdxbpdddf', '2-3 p: pppppp', '16-18 c: cmcccjxfclcgmchswq', '9-11 x: xxrxxxxxvxrxx', '13-14 p: dpppppsppspftpppwp', '15-19 h: hhhhhhhhhhhhhhhhhhhh', '6-12 q: qqqxqqqqgqqpqqqqqqqv', '10-12 g: gqgdgzhgghjgdd', '2-6 p: pnppppp', '3-14 l: lllllllllllllllll', '12-19 h: hhdhhhhvxrfhcshhwxh', '16-18 m: mmrmmmmlmmgmmmmmmmmm', '8-11 t: tntmlpgfttv', '8-11 f: mffffffffff', '15-18 t: tftttttttjwtttjttjt', '5-12 d: pzdrdqxzqzwgzwcgsv', '4-9 d: cdwdmhksdzgd', '9-17 l: mlsllmgdlhlgmfglr', '1-5 r: rrcnr', '3-4 c: ccccccc', '1-2 g: cskvbgnlgnpfrh', '5-10 n: tfnnvnnqbbn', '1-15 g: fxpdggmtrqggdglh', '3-4 t: ftttppdtdbxzqw', '5-6 p: qpxsjt', '8-14 r: bkltjzprkhrhmrg', '1-11 f: gffkkmpflxlqfsf', '1-4 d: vddknn', '5-7 l: llllllvlllll', '2-11 b: bbbbbbbbbbbbb', '1-3 h: hhhh', '13-14 q: jqqqcckhdqkqqj', '4-14 p: mfwcbqxpdkhtdfj', '3-4 g: ggggg', '6-14 v: vvvvvvvvvvvvvvv', '16-18 v: vvvvvvvsvvvsvvvvvv', '9-13 l: llllllllllllllllllll', '3-4 r: zjrr', '6-8 x: xxxxxxxxx', '2-6 p: zlgpps', '3-8 t: ttjtbttjt', '18-19 k: kkkkkkkkkkkklkkkkkk', '8-13 q: hcvnkpnqfzqmqscwf', '15-16 p: ppppppppppppdpmr', '7-12 c: cqccccdcccwsccc', '8-12 d: ddhddddgdddgdddd', '3-4 x: xxxx', '6-8 w: wwwrlzcbwhwlqwwwv', '1-5 h: hhhhdwhhlhph', '4-5 f: fffvz', '3-8 c: ccqqcccc', '3-5 k: xkwkdkh', '2-3 s: ssssshhsss', '4-6 x: gxxxcx', '8-12 l: vsnlqbjltbtlphjtf', '3-6 n: tgpnqxnntkmntvl', '9-12 f: cjzkldhmvclk', '4-7 b: zgpdznb', '1-12 s: ssssnrssssscnssssq', '14-16 p: pppppppppppppwpjp', '4-14 b: xpbbvcbbbspgbbqbw', '5-6 s: smssrb', '5-16 b: tzbdqxgkbxbvzwvt', '2-14 f: vzplvvftrcdmgs', '13-15 t: tttttkthhtzttdt', '2-3 s: vpwss', '9-14 s: sssssssfssssss', '7-13 s: tsnwzxwzjzsjkchlg', '12-15 q: qlqbbfqqvqmcqhvq', '12-13 g: gggggggggggggggggg', '1-3 g: jjdqzgwgggggg', '5-6 n: nlnxnnnwv', '15-16 m: mmmmmmmmmmmmmmmjmmm', '2-6 m: vmrqrmz', '4-5 n: nvnnwb', '13-15 x: xgblxvxmpskqwvlx', '6-7 v: vvvvvvvv', '8-10 r: fsrrdprbrfxhrdv', '4-5 j: jsjjf', '4-6 k: kkkjkkk', '5-9 j: cflfvjjtjljjhbhnj', '9-11 t: xswktxtqrbm', '4-16 r: drrrrrrrrrrrrfwnr', '13-18 p: bbkplmplqmppppspmp', '9-15 r: kgnwvxmcrmltpcgwvrb', '4-5 c: jcwcccnc', '2-4 f: ffff', '8-12 d: rvsdddvdtdcd', '3-10 v: qvdzjhcvsz', '10-11 x: qcmvlvgxkxx', '6-9 s: sxsspsksjssfsnssrvs', '3-7 x: zbxxxxxwrpxgr', '9-17 j: hrppktjsqhzqwxhdz', '5-7 z: nzzzvzswz', '6-7 p: ppppsbpp', '10-13 f: fffffffffhffmfcxffpf', '9-12 f: ffffffffsffmf', '14-15 r: rrrrrrmrrrrmrrzr', '3-6 w: whwwwwwwwwwwm', '7-8 b: btqbbbbbbbz', '13-16 z: zznbbdmbzhjzzzzzmngd', '6-7 q: fqmqltdqqqdwqss', '3-4 h: hphhhhh', '1-3 r: rdgktrmrmdztrkmn', '17-18 w: wwslwwsmwswwfxwwwww', '6-8 p: ppprpppp', '8-10 z: zzzzzdzrztzzzz', '8-11 m: tmldmmwxmjmrmtrmm', '12-16 s: phpprsdvkmsssmssnqwm', '3-4 h: qplnhkhh', '14-19 w: wvxvqzqzdnjjwwtdbwc', '2-4 p: fpnp', '3-5 c: ccccpcccccccc', '3-12 g: ggwggbgfggrxggg', '4-8 r: rrszrgdbrw', '2-4 n: vnmgjtps', '8-10 j: mjjjxjjgjc', '2-6 m: vmmhmm', '3-4 w: vwww', '10-18 v: mvnbqbvcpkvnhqvvbvzv', '15-19 g: ggtggggggbggggxggglg', '7-13 m: mmmmmmjmmmmmmm', '5-11 d: ddxhdndtfdddndxzdqk', '3-11 f: ffnfbfffffgrff', '7-14 w: fflfpgklzlxfwwt', '15-17 d: zxllzgbjrrddnmdhdwp', '1-5 n: nnnnknnn', '15-16 j: ffkjjljgndljjnjscs', '2-3 v: nvvxvntqcrqq', '5-6 c: rcccgpcc', '2-3 j: qjjfrhwljgczj', '5-8 k: kkkkkkkkkk', '1-2 r: rrrrxrcrrr', '1-15 t: ltttttttttttttttt', '4-13 q: prlqzqvgpqslqqcqqjq', '3-12 q: gfbpbdrwrbqt', '2-5 q: qsxccx', '4-9 t: slglllcdkjzdmxt', '2-3 r: rlvrrr', '2-13 w: wwmkwwwjcwbcwzwwcg', '3-4 t: ndkvx', '6-13 b: qflzbbbcfzkbmtx', '6-10 j: pdckwfhkjxqljnjjw', '1-5 j: jjjjjqmj', '2-10 x: xlxxxxxxxfxx', '1-5 r: rvcnr', '4-10 c: cnchrcsgcvncpq', '3-5 j: fjxbj', '4-11 c: ccdlcsxckcx', '12-16 m: mmmmlmvmpcmnmmdbmms', '3-4 q: qqwlqqqq', '2-6 f: kvcfdv', '8-10 m: mmmmmmmmmm', '7-8 j: jjjjjjjj', '5-7 c: ccccncsjc', '7-9 f: fffffrpfplhzfff', '1-6 c: sbcccscccccccccccc', '5-7 j: njpjqxjrljnqjwjgchtj', '11-18 b: gktmxhjwbmbpjrbqkb', '1-4 f: lffbfffffw', '5-6 c: ccccsc', '10-14 v: mkbxvxvgvvvvbv', '5-6 x: jxxxxxx', '4-6 c: qccmhcccw', '3-7 s: qwmtwprsxd', '10-19 d: rkdwbrndmxdsknddddl', '2-5 p: pppppppppppp', '6-7 w: wwffxwc', '2-7 z: pkzcnxr', '5-10 b: bbqbkbtdbbbbb', '10-13 j: qmqgvhzkjmfjhjjm', '5-6 n: nnnnrn', '7-14 n: qgmlsvnjnrdzcdbstxv', '9-16 q: qpllvqpmqlqvkhwqqrsm', '2-4 s: sqpnqsgsssq', '13-15 z: zzzzmzzzzzzzzzzzzg', '10-15 b: bbbdbmqbkjbbtbd', '2-5 h: qrhhhhp', '11-12 x: xxcxhmxxxxxx', '13-18 c: ccccccccccccdccccccc', '12-13 h: knktllrdtgjhhhxpd', '9-13 g: tdpfvzcqgbslgnbxkgpq', '8-15 g: gggggggsggggggxggggg', '1-3 v: wvfvvdvvvvv', '10-11 b: bbbbbbbbbhzb', '15-17 b: bbbbbbbbbbbbbbpttv', '1-7 m: bmmmmmdm', '2-3 h: rhksbfgh', '6-7 w: wwwwwgf', '3-12 h: hkhzhhhhhhhlhhmh', '3-5 x: xxcxpx', '7-9 m: mmdmtmjdxmm', '1-4 n: lnnlnnnnn', '4-9 k: kkkmkkkkbk', '3-4 t: tttt', '5-12 k: tkgwkrwwzcwkhkmk', '4-5 f: fhfvfgwfff', '3-5 h: fmbgjrxgh', '5-6 j: xtwnjj', '11-15 r: rrrrrrrrprqrrrfrr', '13-14 f: fdffffflfffvfff', '1-6 b: krsbnd', '6-7 b: bbbbvxqbl', '1-2 v: vvcvvvv', '7-9 t: ctfcmttht', '2-7 v: bcxhtdwbfqvv', '14-15 n: nnsnlnvkqztnxnn', '2-6 g: rknndvrhbg', '2-6 z: mzzzdzzzz', '11-14 q: qqqqqqvrqqzlqkqqq', '3-4 t: ttcrttjtknjpvwhzm', '8-10 j: jjjjjjjjjjjj', '2-7 c: ccnhcccc', '3-14 m: mmmmmmmmmmmmzmm', '10-16 w: swsmwwwwwrnwmwwk', '4-5 m: bmdjm', '6-11 l: cmlllxllllkrllf', '14-18 t: tttttttttttttvtltt', '11-13 f: ffffffffffhfzfff', '3-6 g: wkzxtrkgr', '7-10 c: cccpcccccvccc', '3-13 m: mmbmmzbcmlwmmfnmmq', '2-3 p: pdszp', '13-14 r: rqrrfrdrrrwvrrrrrwrr', '9-11 g: gggwggggfcpg', '3-9 p: pnppppdpppp', '17-19 k: gzkktkxkkskkkmkkkpk', '4-11 x: bmqhtxzqmvx', '11-14 v: cvsvssqghzjqxm', '1-14 z: zwxczzszzdmkztl', '8-9 t: jkpptwctt', '3-8 z: vqmzzpjj', '6-10 s: msdrxssssswssjz', '1-7 z: zhpzzzz', '13-17 m: mmmmmmmmmlmmgmmmgm', '9-10 n: qgtcnnnnnkcnnn', '2-4 v: vrcvv', '4-5 h: hhhdwh', '8-9 c: zcccccccc', '13-14 p: pjxcpmdpppmgwt', '2-6 c: gskmcc', '6-7 q: qqqqqqqq', '3-13 b: gfbxqtnxnqxbb', '8-10 l: lhrlqlrqlsllll', '5-8 z: jlzgzzzq', '10-13 z: zzzzzzzpzkzzgz', '6-7 d: wddnddd', '10-11 h: vbhhbhhhhbz', '7-10 s: sxssksskqs', '1-12 b: vdgxvsxpgbbpd', '5-6 n: npnvckn', '3-4 v: vvjvv', '9-15 r: njhhqlmcmncjrpx', '2-8 h: bghrdhhrjbhhhbjz', '5-7 q: qqqqlflrq', '9-12 f: qfhfffffffffffff', '2-3 m: mmmblxmbpz', '13-16 v: vvvvvvvqvvvvlvvw', '6-12 b: wbfgbghzbmvf', '12-15 r: rbrrrrthrrrrrrrr', '4-8 k: pkprqkkkpsphwnhp', '8-9 h: hhhhhhhsl', '1-3 b: bsbn', '15-16 j: ktjjjxjfjjrjjcjk', '4-8 z: smzzmzzszzr', '3-4 m: qmmmzqzlrpt', '11-12 n: nnnnngnnnnwgnnnn', '5-10 x: slpbxqfxxxx', '12-19 q: qqqqgqqqsqqqqqqqsqqq', '4-10 s: ssstssssss', '6-11 g: gggggvggggzggggggg', '12-14 c: cckccccdccxnngccc', '3-5 j: jnrjvj', '2-6 t: vtdtms', '13-15 p: ppppppppppppjpq', '1-9 j: jjjjjjjjjjj', '8-9 d: wfdddddkddxd', '3-7 p: pwpcpvp', '3-4 h: hhzl', '9-10 n: lnkjxnsbnn', '7-11 z: zzzzfznzbzbzbzd', '1-2 m: mmzlmkm', '6-7 t: jbmpztx', '5-6 v: vvbvvtn', '7-17 q: lvdfpbqxbxdnwqzjlfs', '3-5 z: zdzzzxczbzzz', '10-14 f: fpffffffffffff', '3-8 x: wxxchxjx', '1-6 x: xxxxxx', '14-15 x: zmxtcbjxtvxxxxg', '4-5 f: qfffghf', '2-3 p: pppp', '10-12 n: nnngnxnnnhnsbntln', '1-2 w: ftwwww', '10-11 f: fffffffffpkf', '4-5 n: nnnnnn', '10-11 r: rrrrtrrlrrrr', '5-6 h: hjhxhhnbhlbxvhs', '1-4 q: qqqq', '7-11 p: dkpfppwzpxqqx', '11-17 l: lzknllnllkgvllllh', '1-3 z: zzzzz', '16-17 b: bbbbbbbbbbbbbbbbbb', '2-4 n: qcpwnhn', '1-4 v: svvhvvv', '10-12 l: llllllllllljl', '1-2 l: xzlllllll', '1-3 l: plklll', '4-8 x: xxxxfxbxcxxqxfxpx', '3-8 b: xgbbwncxclbv', '5-6 m: mmmmmmm', '4-5 p: pptppfnpl', '14-16 x: gwjfkzwrldzxpdxgk', '10-11 z: zzzzvzzzzzzz', '3-12 k: kkxkblkkkkkgkkkmkk', '4-6 p: pppfpx', '2-7 r: rrmrrrrrrrrrr', '7-9 p: pbpfpppppp', '2-3 v: tvvbbjnvv', '5-8 j: jjjjjjjjj', '2-5 c: xcwcczjkvgccccvpkd', '5-7 f: ffffpfqfffff', '11-13 m: qmmmmmmmlwkmmmmmm', '14-15 d: dddddddpmddddszdd', '6-15 b: kptphpbxxqsbxlhxplml', '16-18 x: xxkzfxgqxdcvzdxlzn', '10-12 m: clrmmmmksmmm', '1-3 w: wwpww', '8-15 g: ggggggnlgggggggggng', '3-6 h: tnhhxh', '4-5 l: lllrdllxlnllqll', '1-2 m: lmjhvl', '1-4 k: dkkhkkk', '6-7 x: wncxcxf', '4-5 w: wwwhfww', '4-8 b: bshnbbdbmfxbbrc', '4-7 t: tbdtztm', '7-8 n: zntlhccn', '10-14 f: frgffffffflfzlf', '3-4 b: nzbbbnfbdg', '2-6 m: srmwsmtp', '5-6 z: zzpvsrz', '2-13 m: msmmmhmmmmmmtm', '3-4 c: ccvcc', '1-4 n: nnnnnn', '2-3 j: zdvsj', '4-6 c: ccctccc', '4-5 z: zzpdztnrzl', '4-6 z: hzdzpz', '2-6 x: gxjxcxxjqcb', '4-9 j: jjjvjcgzl', '5-8 z: dmppvjqfzzzzn', '5-7 v: vvvvvvr', '2-5 l: lvkkft', '2-11 n: nnhnqnnvnsn', '1-3 d: dhndddjfd', '8-9 x: xxxxxxxxxxxxxxxxxxxx', '4-9 p: fntpgcwtwv', '4-12 q: qbrlqzqcnwtjq', '2-3 f: ftcjvnfkzx', '1-2 d: dddd', '7-10 g: gggggghggzgg', '4-6 g: zhgbgphggtm', '2-4 l: lblq', '14-17 n: bnnngnnnnnnznnnnn', '5-6 f: fxxffffhmswq', '6-10 p: pppppppppp', '2-4 q: lsxgqkqsblqqq', '11-19 x: xxnrgxxxxxxxxxfwmxx', '4-7 j: jjjtjjljjjjjjj', '6-7 l: llllllll', '1-4 f: pfftffffnffff', '11-13 r: xrrlrrrrrqrrzrr', '1-3 p: pvpqp', '9-13 d: ddddxrnddddfdscsd', '1-2 f: lbbr', '3-7 t: mpttsgwb', '2-10 c: jccchctshcpchwx', '2-4 p: lmpd', '1-2 n: zlnxnnf', '2-3 w: fwwtqw', '9-16 s: sssssssssssssssssssj', '1-5 s: hssrm', '15-17 b: ghpvwjbzpksvhsjbj', '8-9 h: hzrvxhhdz', '3-4 j: mkjjpvkfhprr', '1-8 n: cnnnnnnmnn', '1-4 x: lxxxx', '3-5 m: pjttcvvcmfvzffcfmmv', '3-10 r: rsxtvwjrfrqrrbzzr', '2-7 h: hhckhhr', '7-8 r: srrrmprrrhkzsndrrkr', '4-13 m: pdsmlsnxcmhmmsvc', '3-12 d: ddsdddddddddddddd', '14-16 s: sssssssssssssjsds', '3-4 m: djfp', '2-5 w: bgwpc', '4-5 r: zffrrqrs', '4-9 r: rrrgrrrrqrrrrrrr', '4-6 w: wxwwvw', '7-8 d: tvddddwtdddldd', '6-7 g: tgdggggfzrgqggggmggg', '2-6 t: tgtfdtttttttttqxd', '14-18 f: fffsffgfffffskfkff', '1-12 b: qbvbbbbmbsqbcbgbbbcp', '5-7 d: ddbqhdddsdm', '6-9 n: tqwnckjsn', '1-3 n: nnnn', '5-10 w: wwwwwwwlwwqwwwp', '3-4 r: rrrr', '2-12 m: mmchtqmhfdpm', '6-9 d: dzgzdbddwgdwldb', '10-14 k: kkkkkkkkkkkkkzkkkkk', '13-14 v: vvvvvvvvvvvvvvvv', '2-12 f: btqtbrvkmfzhz', '1-5 b: bbbbbb', '7-10 j: jhjnjjwnjbj', '2-16 h: kjszvtwrjgrvzrqlzcb', '6-8 t: nxzftvtnrtxg', '3-6 h: cvhhnhnhhcgst', '5-8 f: fxgfjnjzz', '11-12 b: bbbbbnbbbzbqbbbq', '1-6 h: hjzhhw', '18-19 m: xrvmftmpkpmrlkqmxvm', '6-7 v: cvxbdsr', '5-6 v: vjvvvvf', '2-3 m: mmzpm', '3-4 k: mkghkxc', '1-6 s: sjsmjsstsss', '2-10 s: wndvkxbmffh', '9-15 q: qqqqqqqqqqqqqqqqq', '4-5 f: rffffpc', '10-11 v: vvvvvvrvvlmv', '6-7 n: tnnnnlq', '16-18 g: gggggdgdgggggggggggg', '5-11 l: lwlfvzlsjll', '11-14 v: vvvvvvvrvwvvvv', '12-16 j: jjjjjjjjjjjpjjjx', '4-6 w: wwwwwr', '2-4 d: ncdd', '15-17 c: nccccctccwccccqcqcc', '3-5 m: mnlmqtsvn', '7-8 w: swwwwwnl', '6-12 l: zlplklqldllxlpvb', '7-9 h: fhkhqnfhhzrhqhhh', '11-14 v: vvvvvvvvvvvvvv', '16-18 v: vnvvsllmvswcvzqvvxjl', '7-9 k: kkkzkkkkskkkzkkkjlk', '5-17 w: wckwxwlrlwrncxwwb', '2-4 v: vqvvqgx', '2-3 b: bbbbbbmbbbbqb', '4-5 p: ptphbprpv', '3-6 q: kqqkpqbnt', '15-20 n: nnnnnnngnnnnnnnnnnnw', '10-12 p: pppppxpppmpnjp', '5-10 x: bhwlxkrdxxqvkphvmfgn', '2-3 l: lllhql', '4-11 l: wllvwfccllk', '7-11 d: dmvmmzlngpw', '2-6 v: rskbvv', '7-9 k: kwtckkkkx', '11-12 j: jnjjfzjjjjjjjj', '2-5 v: rvvnnjjxjnnt', '2-6 j: ljcqpjmhgmmcxjkgd', '1-3 k: lklbx', '14-15 c: ccccccccccccckc', '2-6 x: xxxxxxxxxxxx', '1-7 t: btrtxtjgtt', '2-3 t: sttt', '5-7 k: kkkkzksxgb', '3-4 q: mnnxqwtnw', '8-10 t: vwzmnxjdzx', '4-10 f: svglffffpzw', '1-5 s: dsfjsv', '8-10 m: vmwpmmmjmv', '6-7 h: hhhhhwxhhhhhhhhhhhhh', '7-19 n: ktlblznjctnnrzwrknt', '3-6 n: nzxclnvc', '2-5 t: wtrttkx', '9-10 j: jjjjjjxjjj', '12-13 r: rrrrrjrrrrrwx', '11-16 c: plvcnjcpnkvcpcmcpbc', '2-3 c: gccclcslqdmsg', '10-13 d: dddddddddhddd', '8-9 w: kklwmwqmwwtwqw', '2-5 q: qsqqwx', '3-4 c: hcqvfbccccctcc', '6-7 k: kkkwqgv', '13-15 h: qhhmhkjvhhhhngnhhhhs', '4-5 d: msjdd', '6-7 g: ggggggg', '5-8 r: cqrdrfxnrrjrsr', '9-15 r: lprrqrrrrrrrrrrbr', '6-7 h: hhrqhrlhhh', '2-3 g: glgg', '1-11 n: nnnnnnnnlnnjzwnnnn', '3-6 l: bwllrl', '2-6 p: nptphqv', '3-8 l: lrlknvlpcm', '2-8 g: wjbgpjrlfsgg', '5-6 w: swwfww', '1-8 p: pptpxppppppwpppfx', '3-4 d: wlddg', '15-17 c: sccccccgccccccccc', '4-6 n: nnnhnp', '8-9 r: prvrxmprlzxs', '9-12 t: ttttttttttttkrtt', '5-6 h: hhhhkfh', '1-10 q: psqpzpkqtcq', '4-7 f: ffflnfzkf', '10-11 j: jjjvjjxfjjj', '4-11 p: wlhgrxlclnt', '1-14 t: wfntvttxmldhqg', '14-19 c: ccpczqrccfhtcvljlvc', '11-12 w: wwwwwwwwwwwww', '2-8 z: lzsdqxzz', '17-18 p: pppppppppppqphppprpp', '2-4 j: wjjq', '4-6 f: ffkfffgff', '8-20 x: phxxxxxnwxxdqzxxxxxx', '9-10 d: xvddddsldd', '3-10 l: rglllxlnfl', '6-15 d: ddddddgddpddddwd', '6-7 w: kwwwwhs', '8-10 r: rrrfmrrrrd', '2-11 x: xcjcgtkzkhtmrxqjxxx', '4-5 v: wvmdr', '7-8 d: dddddddd', '7-13 l: lllllldlxllln', '13-14 z: zzdrzzzffzzzzzznzz', '3-4 j: zjjj', '8-9 s: sssssssbss', '6-15 f: pfsfvfxqpffqfqf', '9-11 p: pjpppprzpcphvppwp', '3-4 c: ccrd', '9-10 c: qcwbccccjhwvtwcccnc', '3-4 x: xgxx', '5-6 x: xgxzxxxxxxx', '5-10 l: kxdgnqrkpqgcmcmnk', '4-7 v: vvvpvvvv', '1-4 n: nqnnnnnn', '5-6 p: pprgpst', '14-20 q: wlxrjczhxwdctvpcgxqc', '5-8 g: gcggbggggggzgg', '10-11 g: ggggtggggggg', '14-18 h: hhchhhmhhbwhhlhsvrh', '3-6 f: ffmfffffffff', '1-12 n: rnnnnjwnnnnv', '7-12 l: bpxlhthjplljwxvvvjm', '4-5 j: jhjjjjj', '9-12 q: qvqqqqqvqsqq', '3-4 d: ddnvdddddgddd', '1-7 h: xhhhhhkh', '1-4 f: fffff', '3-4 q: qfrq', '5-8 k: kkkkgkkqkk', '14-18 k: nkkkkkkfkkwkkkkkqk', '1-4 q: qqdc', '17-18 f: ffffffffhffffffffff', '16-17 b: bbbbbbbbbbbbbbbdm', '17-18 z: zzzzzzzzzznzzzvzmwzz', '3-4 g: tggd', '4-6 t: mlttlqqz', '11-18 f: fgffgwlffffftfzfrt', '7-9 h: hmmhhhpljjn', '16-17 m: mmrsnmmzfhtmrjwmmjm', '2-3 l: cllcbm', '3-4 k: fkkkqbpbmmcd', '9-10 f: kfmchwkwzfh', '5-6 j: jjmjjjjjj', '3-5 v: vsvbfvvh', '3-4 k: tgkk', '2-8 k: lscvjjnhpxl', '7-8 v: vvlvvfkqqv', '8-9 q: qcqqtqqhqvqqtq', '12-14 z: zzzhzwzzqzzzzwzzlz', '5-8 k: kzknkkkkkp', '5-6 s: spsssw', '2-3 k: kmkh', '9-10 f: vnlxmstqbsg', '1-2 k: kkkk', '6-15 r: rcrrrsrrrrrrrrzrrqrr', '3-8 c: cfczjwkcxbc', '15-16 k: kkkkgkkkkkkkkkkh', '5-18 c: ccdcxtccccccpcfccv', '6-11 w: qdwnfhzlwwwwxwwgwhwk', '1-6 d: fddddddhddw', '7-10 p: wpbppvpzwc', '12-14 k: kkkkkkkkkkhhkslsk', '4-7 r: hdrrfhrqrdmcbnlrrjbr', '7-10 b: bbbbbjbbbbbb', '4-7 p: pzppzppsp', '11-12 h: qhhhhhhqhrlwlhhthh', '6-9 s: sbssxsskswvp', '17-18 b: bbmpbbhhbnsbbbbbbb', '8-9 g: wgggktggg', '1-12 s: vsssssfssssrqk', '2-5 s: bsgssxc', '3-4 c: ccccccc', '2-3 d: dddd', '5-7 r: ldlcjrrlrngr', '5-10 m: msmjqmmmmm', '3-7 c: ccccccccc', '13-14 p: pppxpppppppppcpppp', '2-3 r: jrfrvrk', '11-12 g: gggggggggggg', '6-18 t: ctvqgcrgnxdvbzjfrrbt', '6-11 f: rnjptfnwgxfp', '5-8 w: wwwtwwwwww', '14-15 r: rkrbrvrrrgrczrz', '12-13 t: trtjtttlnxnxx', '5-8 l: qnwllfsl', '2-15 g: xgtcjftlqqfwkggpf', '11-16 j: jjjjjjjjjljjjjjjj', '8-9 b: bbzbkbbvgcbb', '5-6 r: dvkxrrsvrrksszsdr', '12-13 j: jjjjjjjjjjjhdjjj', '16-17 z: mzzzrxfzzzzczzgzz', '2-15 p: lpjxcdzjmnghfppr', '9-15 s: ssssssssnsssssss', '1-11 t: tfvtqvlbtld', '4-5 k: kkkczkkkvkkk', '2-7 p: ptphppvppppp']
def parse_password_and_policy(line: str):
password = line[line.find(':') + 2:len(line)]
character = line[line.find(':') - 1]
min_num = int(line[:line.find('-')])
max_num = int(line[line.find('-') + 1:line.find(' ')])
return {'password': password, 'character': character, 'min': minNum, 'max': maxNum}
def verify_password_second_policy(passworddata):
parsed_data = parse_password_and_policy(passworddata)
pword = parsedData['password']
first_index = pword[parsedData['min'] - 1] == parsedData['character']
second_index = pword[parsedData['max'] - 1] == parsedData['character']
return firstIndex != secondIndex
def verify_password_first_policy(passworddata):
parsed_data = parse_password_and_policy(passworddata)
character_count = 0
for character in parsedData['password']:
if character == parsedData['character']:
character_count += 1
return characterCount >= parsedData['min'] and characterCount <= parsedData['max']
def check_passwords_part_two(input):
valid_passwords = 0
for line in input:
if verify_password_first_policy(line):
valid_passwords += 1
return validPasswords
def check_passwords_part_one(input):
valid_passwords = 0
for line in input:
if verify_password_second_policy(line):
valid_passwords += 1
return validPasswords
print(check_passwords_part_one(problemInput))
print(check_passwords_part_two(problemInput)) |
class Solution:
def minDistance(self, word1: str, word2: str) -> int:
result = [[0 for _ in range(len(word2)+1)] for _ in range(len(word1) + 1)]
# update top row
for j in range(1,len(word2)+1):
result[0][j] = 1+ result[0][j-1]
# update first column
for i in range(1,len(word1) +1):
result[i][0] = 1 + result[i-1][0]
for i in range(1,len(word1) +1):
for j in range(1,len(word2)+1):
if word1[i-1] == word2[j-1]:
result[i][j] = result[i-1][j-1]
else:
result[i][j] = 1 + min(result[i-1][j-1], result[i][j-1], result[i-1][j])
return result[len(word1)][len(word2)]
word1 = "intention"
word2 = "execution"
ob = Solution()
print(ob.minDistance(word2, word1)) | class Solution:
def min_distance(self, word1: str, word2: str) -> int:
result = [[0 for _ in range(len(word2) + 1)] for _ in range(len(word1) + 1)]
for j in range(1, len(word2) + 1):
result[0][j] = 1 + result[0][j - 1]
for i in range(1, len(word1) + 1):
result[i][0] = 1 + result[i - 1][0]
for i in range(1, len(word1) + 1):
for j in range(1, len(word2) + 1):
if word1[i - 1] == word2[j - 1]:
result[i][j] = result[i - 1][j - 1]
else:
result[i][j] = 1 + min(result[i - 1][j - 1], result[i][j - 1], result[i - 1][j])
return result[len(word1)][len(word2)]
word1 = 'intention'
word2 = 'execution'
ob = solution()
print(ob.minDistance(word2, word1)) |
n = int(input()) # 1
k = int(input()) # 2
x = int(input()) # 3
y = int(input()) # 4
arr = list(map(int, input().split())) # 5
# s = sum(arr[:k+1])
w = 50
if k != 1:
for i in range(n):
arr[i] = sum(arr[i:i+k])
arr = arr[:-1]
# print(arr, len(arr))
for i in arr:
# print(i)
if i in range(x, y + 1): w = w
elif i < x: w -= 1
elif i > y: w += 1
print(w-50) | n = int(input())
k = int(input())
x = int(input())
y = int(input())
arr = list(map(int, input().split()))
w = 50
if k != 1:
for i in range(n):
arr[i] = sum(arr[i:i + k])
arr = arr[:-1]
for i in arr:
if i in range(x, y + 1):
w = w
elif i < x:
w -= 1
elif i > y:
w += 1
print(w - 50) |
# This is a file which does actually have a variable called 'answers'.
# This file is used in the test_check.py file which tests the check module
answers = 1
| answers = 1 |
#encoding:utf-8
subreddit = 'MoviePosterPorn'
t_channel = '@MoviePosterTG'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| subreddit = 'MoviePosterPorn'
t_channel = '@MoviePosterTG'
def send_post(submission, r2t):
return r2t.send_simple(submission) |
#
# PySNMP MIB module Juniper-ATM-1483-Profile-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-ATM-1483-Profile-CONF
# Produced by pysmi-0.3.4 at Wed May 1 14:01:45 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, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection")
juniProfileAgents, = mibBuilder.importSymbols("Juniper-Agents", "juniProfileAgents")
AgentCapabilities, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "AgentCapabilities", "NotificationGroup", "ModuleCompliance")
Bits, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, ModuleIdentity, Counter32, Counter64, NotificationType, ObjectIdentity, IpAddress, MibIdentifier, Unsigned32, Integer32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "ModuleIdentity", "Counter32", "Counter64", "NotificationType", "ObjectIdentity", "IpAddress", "MibIdentifier", "Unsigned32", "Integer32", "TimeTicks")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
juniAtm1483ProfileAgent = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6))
juniAtm1483ProfileAgent.setRevisions(('2004-07-26 19:54', '2004-11-02 21:07', '2004-11-02 21:07',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: juniAtm1483ProfileAgent.setRevisionsDescriptions(('Added Encapsulation Type Lockout objects.', 'Added ifALias support to profile entries.', 'The initial release of this management information module. Added support for OAM admin status and loopback frequency.',))
if mibBuilder.loadTexts: juniAtm1483ProfileAgent.setLastUpdated('200407261954Z')
if mibBuilder.loadTexts: juniAtm1483ProfileAgent.setOrganization('Juniper Networks, Inc.')
if mibBuilder.loadTexts: juniAtm1483ProfileAgent.setContactInfo(' Juniper Networks, Inc. Postal: 10 Technology Park Drive Westford, MA 01886-3146 USA Tel: +1 978 589 5800 E-mail: mib@Juniper.net')
if mibBuilder.loadTexts: juniAtm1483ProfileAgent.setDescription('The agent capabilities definitions for the ATM 1483 Profile component of the SNMP agent in the Juniper E-series family of products.')
juniAtm1483ProfileAgentV1 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 1))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV1 = juniAtm1483ProfileAgentV1.setProductRelease('Version 1 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.1 and 5.2 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV1 = juniAtm1483ProfileAgentV1.setStatus('obsolete')
if mibBuilder.loadTexts: juniAtm1483ProfileAgentV1.setDescription('The MIB supported by the SNMP agent for the ATM 1483 Profile application in JUNOSe. These capabilities became obsolete when ifALias support was added to profile entries.')
juniAtm1483ProfileAgentV2 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 2))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV2 = juniAtm1483ProfileAgentV2.setProductRelease('Version 2 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.3 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV2 = juniAtm1483ProfileAgentV2.setStatus('obsolete')
if mibBuilder.loadTexts: juniAtm1483ProfileAgentV2.setDescription('The MIB supported by the SNMP agent for the ATM 1483 Profile application in JUNOSe. These capabilities became obsolete when OAM support was added to profile entries.')
juniAtm1483ProfileAgentV3 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 3))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV3 = juniAtm1483ProfileAgentV3.setProductRelease('Version 3 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.1 and 5.2 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV3 = juniAtm1483ProfileAgentV3.setStatus('obsolete')
if mibBuilder.loadTexts: juniAtm1483ProfileAgentV3.setDescription('The MIB supported by the SNMP agent for the ATM 1483 Profile application in JUNOSe. These capabilities became obsolete when ifALias support was added to profile entries.')
juniAtm1483ProfileAgentV4 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 4))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV4 = juniAtm1483ProfileAgentV4.setProductRelease('Version 4 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.3, 6.0, and 6.1 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV4 = juniAtm1483ProfileAgentV4.setStatus('current')
if mibBuilder.loadTexts: juniAtm1483ProfileAgentV4.setDescription('')
juniAtm1483ProfileAgentV5 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 5))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV5 = juniAtm1483ProfileAgentV5.setProductRelease('Version 5 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component is supported in Juniper\n JUNOSe 7.0 and subsequent system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniAtm1483ProfileAgentV5 = juniAtm1483ProfileAgentV5.setStatus('current')
if mibBuilder.loadTexts: juniAtm1483ProfileAgentV5.setDescription('')
mibBuilder.exportSymbols("Juniper-ATM-1483-Profile-CONF", juniAtm1483ProfileAgentV4=juniAtm1483ProfileAgentV4, juniAtm1483ProfileAgentV1=juniAtm1483ProfileAgentV1, juniAtm1483ProfileAgentV2=juniAtm1483ProfileAgentV2, juniAtm1483ProfileAgent=juniAtm1483ProfileAgent, juniAtm1483ProfileAgentV5=juniAtm1483ProfileAgentV5, juniAtm1483ProfileAgentV3=juniAtm1483ProfileAgentV3, PYSNMP_MODULE_ID=juniAtm1483ProfileAgent)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_range_constraint, single_value_constraint, value_size_constraint, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsIntersection')
(juni_profile_agents,) = mibBuilder.importSymbols('Juniper-Agents', 'juniProfileAgents')
(agent_capabilities, notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'AgentCapabilities', 'NotificationGroup', 'ModuleCompliance')
(bits, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, module_identity, counter32, counter64, notification_type, object_identity, ip_address, mib_identifier, unsigned32, integer32, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'ModuleIdentity', 'Counter32', 'Counter64', 'NotificationType', 'ObjectIdentity', 'IpAddress', 'MibIdentifier', 'Unsigned32', 'Integer32', 'TimeTicks')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
juni_atm1483_profile_agent = module_identity((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6))
juniAtm1483ProfileAgent.setRevisions(('2004-07-26 19:54', '2004-11-02 21:07', '2004-11-02 21:07'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
juniAtm1483ProfileAgent.setRevisionsDescriptions(('Added Encapsulation Type Lockout objects.', 'Added ifALias support to profile entries.', 'The initial release of this management information module. Added support for OAM admin status and loopback frequency.'))
if mibBuilder.loadTexts:
juniAtm1483ProfileAgent.setLastUpdated('200407261954Z')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgent.setOrganization('Juniper Networks, Inc.')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgent.setContactInfo(' Juniper Networks, Inc. Postal: 10 Technology Park Drive Westford, MA 01886-3146 USA Tel: +1 978 589 5800 E-mail: mib@Juniper.net')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgent.setDescription('The agent capabilities definitions for the ATM 1483 Profile component of the SNMP agent in the Juniper E-series family of products.')
juni_atm1483_profile_agent_v1 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 1))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v1 = juniAtm1483ProfileAgentV1.setProductRelease('Version 1 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.1 and 5.2 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v1 = juniAtm1483ProfileAgentV1.setStatus('obsolete')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgentV1.setDescription('The MIB supported by the SNMP agent for the ATM 1483 Profile application in JUNOSe. These capabilities became obsolete when ifALias support was added to profile entries.')
juni_atm1483_profile_agent_v2 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 2))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v2 = juniAtm1483ProfileAgentV2.setProductRelease('Version 2 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.3 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v2 = juniAtm1483ProfileAgentV2.setStatus('obsolete')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgentV2.setDescription('The MIB supported by the SNMP agent for the ATM 1483 Profile application in JUNOSe. These capabilities became obsolete when OAM support was added to profile entries.')
juni_atm1483_profile_agent_v3 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 3))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v3 = juniAtm1483ProfileAgentV3.setProductRelease('Version 3 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.1 and 5.2 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v3 = juniAtm1483ProfileAgentV3.setStatus('obsolete')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgentV3.setDescription('The MIB supported by the SNMP agent for the ATM 1483 Profile application in JUNOSe. These capabilities became obsolete when ifALias support was added to profile entries.')
juni_atm1483_profile_agent_v4 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 4))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v4 = juniAtm1483ProfileAgentV4.setProductRelease('Version 4 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component was supported in Juniper\n JUNOSe 5.3, 6.0, and 6.1 system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v4 = juniAtm1483ProfileAgentV4.setStatus('current')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgentV4.setDescription('')
juni_atm1483_profile_agent_v5 = agent_capabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 34, 6, 5))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v5 = juniAtm1483ProfileAgentV5.setProductRelease('Version 5 of the ATM 1483 Profile component of the JUNOSe SNMP agent.\n This version of the ATM 1483 Profile component is supported in Juniper\n JUNOSe 7.0 and subsequent system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_atm1483_profile_agent_v5 = juniAtm1483ProfileAgentV5.setStatus('current')
if mibBuilder.loadTexts:
juniAtm1483ProfileAgentV5.setDescription('')
mibBuilder.exportSymbols('Juniper-ATM-1483-Profile-CONF', juniAtm1483ProfileAgentV4=juniAtm1483ProfileAgentV4, juniAtm1483ProfileAgentV1=juniAtm1483ProfileAgentV1, juniAtm1483ProfileAgentV2=juniAtm1483ProfileAgentV2, juniAtm1483ProfileAgent=juniAtm1483ProfileAgent, juniAtm1483ProfileAgentV5=juniAtm1483ProfileAgentV5, juniAtm1483ProfileAgentV3=juniAtm1483ProfileAgentV3, PYSNMP_MODULE_ID=juniAtm1483ProfileAgent) |
class parent:
def parentmethod(self):
print("Calling Parent Method")
def parentmethod2(self):
print("Calling the second parent method")
class child(parent):
def childmethod(self):
print("Calling the Child Method")
def parentmethod2(self):
print("Modified parent method 2")
p = parent()
c = child()
p.parentmethod() # Accessing Parent Method
c.childmethod() # Accessing Child Method
c.parentmethod() # Accessing the inherited parent method from child class.
p.parentmethod2() # Accessing the 2nd parent method from parent class
c.parentmethod2() # Accessing the 2nd parent method from the child class after modification
print("\nView code and read comments for better understanding.")
# Parent class cannot access child class. However, the child class can access the parent class.
| class Parent:
def parentmethod(self):
print('Calling Parent Method')
def parentmethod2(self):
print('Calling the second parent method')
class Child(parent):
def childmethod(self):
print('Calling the Child Method')
def parentmethod2(self):
print('Modified parent method 2')
p = parent()
c = child()
p.parentmethod()
c.childmethod()
c.parentmethod()
p.parentmethod2()
c.parentmethod2()
print('\nView code and read comments for better understanding.') |
# Flip the keys to the values, and the values to the keys
namesAndNumbers = {"Ellis": 123456789, "Roy": 987654321, "Blake": 753159842}
numbersAndNames = {}
for k in namesAndNumbers:
numbersAndNames[namesAndNumbers[k]] = k
print(numbersAndNames) | names_and_numbers = {'Ellis': 123456789, 'Roy': 987654321, 'Blake': 753159842}
numbers_and_names = {}
for k in namesAndNumbers:
numbersAndNames[namesAndNumbers[k]] = k
print(numbersAndNames) |
# directories path
BASIC_DIR = "~/ECG_Analysis/ECG_data"
ECG_eHEALTH_DATA_DIR = BASIC_DIR + '/eHealth_ECG'
ECG_ID_DATA_DIR = BASIC_DIR + '/ECG-ID/resampled'
ECG_eHEALTH_DATA_DIR = BASIC_DIR + '/eHealth_ECG'
ECG_eHEALTH_TRAIN_DATA_DIR = BASIC_DIR + '/trainECG'
ECG_eHEALTH_TEST_DATA_DIR = BASIC_DIR + '/testECG'
SEGMENTATOR_DIR = BASIC_DIR + '/ECG_segmentator'
COMBINATOR_DIR = BASIC_DIR + '/ECG_combinator' | basic_dir = '~/ECG_Analysis/ECG_data'
ecg_e_health_data_dir = BASIC_DIR + '/eHealth_ECG'
ecg_id_data_dir = BASIC_DIR + '/ECG-ID/resampled'
ecg_e_health_data_dir = BASIC_DIR + '/eHealth_ECG'
ecg_e_health_train_data_dir = BASIC_DIR + '/trainECG'
ecg_e_health_test_data_dir = BASIC_DIR + '/testECG'
segmentator_dir = BASIC_DIR + '/ECG_segmentator'
combinator_dir = BASIC_DIR + '/ECG_combinator' |
N = int(input())
for i in range(1, 10):
if N % i == 0 and (N // i) < 10:
print("Yes")
break
else:
print("No")
| n = int(input())
for i in range(1, 10):
if N % i == 0 and N // i < 10:
print('Yes')
break
else:
print('No') |
# --------------
##File path for the file
file_path
def read_file(path):
file = open (path,'r')
sentence = file.readline()
file.close ()
return sentence
sample_message = read_file (file_path)
print (sample_message)
#Code starts here
# --------------
#Code starts here
message_1 = read_file (file_path_1)
print (message_1)
message_2 = read_file (file_path_2)
print (str(message_2))
def fuse_msg (message_a, message_b):
quotient = int(message_a)//int(message_b)
return str(quotient)
secret_msg_1 = fuse_msg (message_2,message_1)
print (secret_msg_1)
# --------------
#Code starts here
message_3 = read_file (file_path_3)
print (message_3)
def substitute_msg (message_c):
if (message_c == 'Red'):
sub = "Army General"
elif (message_c == 'Green'):
sub = "Data Scientist"
elif (message_c == 'Blue'):
sub = "Marine Biologist"
return sub
secret_msg_2 = substitute_msg(message_3)
print (secret_msg_2)
# --------------
# File path for message 4 and message 5
file_path_4
file_path_5
#Code starts here
message_4 = read_file (file_path_4)
print (message_4)
message_5 = read_file (file_path_5)
print (message_5)
def compare_msg(message_d, message_e):
a_list =[]
b_list = []
c_list = []
a_list = message_d.split ()
print (a_list)
b_list = message_e.split ()
print (b_list)
c_list = [x for x in a_list if x not in b_list]
final_msg = " ".join(c_list)
return str(final_msg)
secret_msg_3 = compare_msg(message_4,message_5)
print (str(secret_msg_3))
# --------------
#Code starts here
message_6 = read_file (file_path_6)
print (message_6)
def extract_msg (message_f):
a_list = []
a_list = message_f.split()
print (a_list)
even_word = lambda x: True if (len(x)%2 ==0) else False
b_list = filter (even_word, a_list)
final_msg = " ".join(b_list)
return final_msg
secret_msg_4 = extract_msg (message_6)
print (str(secret_msg_4))
# --------------
#Secret message parts in the correct order
message_parts=[secret_msg_3, secret_msg_1, secret_msg_4, secret_msg_2]
final_path= user_data_dir + '/secret_message.txt'
#Code starts here
secret_msg = " ".join (message_parts)
def write_file (secret_msg, path):
f = open (path, 'a+')
f.write (str(secret_msg))
f.close ()
print (secret_msg)
write_file (message_parts, final_path)
| file_path
def read_file(path):
file = open(path, 'r')
sentence = file.readline()
file.close()
return sentence
sample_message = read_file(file_path)
print(sample_message)
message_1 = read_file(file_path_1)
print(message_1)
message_2 = read_file(file_path_2)
print(str(message_2))
def fuse_msg(message_a, message_b):
quotient = int(message_a) // int(message_b)
return str(quotient)
secret_msg_1 = fuse_msg(message_2, message_1)
print(secret_msg_1)
message_3 = read_file(file_path_3)
print(message_3)
def substitute_msg(message_c):
if message_c == 'Red':
sub = 'Army General'
elif message_c == 'Green':
sub = 'Data Scientist'
elif message_c == 'Blue':
sub = 'Marine Biologist'
return sub
secret_msg_2 = substitute_msg(message_3)
print(secret_msg_2)
file_path_4
file_path_5
message_4 = read_file(file_path_4)
print(message_4)
message_5 = read_file(file_path_5)
print(message_5)
def compare_msg(message_d, message_e):
a_list = []
b_list = []
c_list = []
a_list = message_d.split()
print(a_list)
b_list = message_e.split()
print(b_list)
c_list = [x for x in a_list if x not in b_list]
final_msg = ' '.join(c_list)
return str(final_msg)
secret_msg_3 = compare_msg(message_4, message_5)
print(str(secret_msg_3))
message_6 = read_file(file_path_6)
print(message_6)
def extract_msg(message_f):
a_list = []
a_list = message_f.split()
print(a_list)
even_word = lambda x: True if len(x) % 2 == 0 else False
b_list = filter(even_word, a_list)
final_msg = ' '.join(b_list)
return final_msg
secret_msg_4 = extract_msg(message_6)
print(str(secret_msg_4))
message_parts = [secret_msg_3, secret_msg_1, secret_msg_4, secret_msg_2]
final_path = user_data_dir + '/secret_message.txt'
secret_msg = ' '.join(message_parts)
def write_file(secret_msg, path):
f = open(path, 'a+')
f.write(str(secret_msg))
f.close()
print(secret_msg)
write_file(message_parts, final_path) |
def split_list(big_list , max_split: int):
for i in range(0, len(big_list), max_split):
yield big_list[i: i+max_split]
| def split_list(big_list, max_split: int):
for i in range(0, len(big_list), max_split):
yield big_list[i:i + max_split] |
def remove_repetidos(lista):
lista_b = []
for i in lista:
if i not in lista_b:
lista_b.append(i)
lista_b.sort()
return lista_b
def soma_elementos(lista):
return sum(lista)
#print(sum(lista))
def maior_elemento(lista):
#max(lista)
print(max(lista))
lista = [1, 1, 2, 1, 3, 4, 3, 6, 7, 6, 7, 8, 10 ,9]
lista = remove_repetidos(lista)
print(lista)
soma_elementos(lista)
maior_elemento(lista) | def remove_repetidos(lista):
lista_b = []
for i in lista:
if i not in lista_b:
lista_b.append(i)
lista_b.sort()
return lista_b
def soma_elementos(lista):
return sum(lista)
def maior_elemento(lista):
print(max(lista))
lista = [1, 1, 2, 1, 3, 4, 3, 6, 7, 6, 7, 8, 10, 9]
lista = remove_repetidos(lista)
print(lista)
soma_elementos(lista)
maior_elemento(lista) |
def Posicao(a, b, c, d,u, pos):
posicao =""
if pos != 0:
pos = "transversal"
else:
if (a*u[0] + b*u[1] + c*u[2] + d) == 0:
pos = "contida"
else:
pos = "paralela"
return pos | def posicao(a, b, c, d, u, pos):
posicao = ''
if pos != 0:
pos = 'transversal'
elif a * u[0] + b * u[1] + c * u[2] + d == 0:
pos = 'contida'
else:
pos = 'paralela'
return pos |
class JsonObject:
@staticmethod
def decode(json, agent):
return json
@staticmethod
def encode(obj):
return obj
| class Jsonobject:
@staticmethod
def decode(json, agent):
return json
@staticmethod
def encode(obj):
return obj |
#113
# Time: O(n)
# Space: O(h), h is height of binary tree
# Given a binary tree and a sum, find all root-to-leaf paths
# where each path's sum equals the given sum.
#
# For example:
# Given the below binary tree and sum = 22,
# 5
# / \
# 4 8
# / / \
# 11 13 4
# / \ / \
# 7 2 5 1
# return
# [
# [5,4,11,2],
# [5,8,4,5]
# ]
class TreeNode():
def __init__(self,val):
self.val=val;
self.right=None
self.left=None
class DFSSol():
def pathSumBTII(self,root,target_sum):
return self.pathSumBTIIRec(root,target_sum,[],[])
def pathSumBTIIRec(self,root,target_sum,cur_path,result):
if not root:
return result
if not root.left and not root.right and root.val==target_sum:
result.append(cur_path+[root.val])
return result
cur_path.append(root.val)
self.pathSumBTIIRec(root.left,target_sum-root.val,cur_path,result)
self.pathSumBTIIRec(root.right,target_sum-root.val,cur_path,result)
cur_path.pop()
return result
| class Treenode:
def __init__(self, val):
self.val = val
self.right = None
self.left = None
class Dfssol:
def path_sum_btii(self, root, target_sum):
return self.pathSumBTIIRec(root, target_sum, [], [])
def path_sum_btii_rec(self, root, target_sum, cur_path, result):
if not root:
return result
if not root.left and (not root.right) and (root.val == target_sum):
result.append(cur_path + [root.val])
return result
cur_path.append(root.val)
self.pathSumBTIIRec(root.left, target_sum - root.val, cur_path, result)
self.pathSumBTIIRec(root.right, target_sum - root.val, cur_path, result)
cur_path.pop()
return result |
#!/usr/bin/python3
qaly = 0
for x in range(int(input())):
a, b = map(float, input().split())
qaly += a*b
print("{0:.3f}".format(qaly))
| qaly = 0
for x in range(int(input())):
(a, b) = map(float, input().split())
qaly += a * b
print('{0:.3f}'.format(qaly)) |
class BreakOpportunity:
"""A `GraphicObject` mixin which indicates a break can be performed here.
Some notational constructs are well suited to be placed at line
or page breaks, for example bar lines or grand pauses. Such classes
should subclass this mixin so the flowable container can know this.
This mixin is only useful when used inside a `Flowable`.
"""
pass
| class Breakopportunity:
"""A `GraphicObject` mixin which indicates a break can be performed here.
Some notational constructs are well suited to be placed at line
or page breaks, for example bar lines or grand pauses. Such classes
should subclass this mixin so the flowable container can know this.
This mixin is only useful when used inside a `Flowable`.
"""
pass |
#
# PySNMP MIB module IPV6-TUNNEL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IPV6-TUNNEL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:56:52 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, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint")
InetAddressPrefixLength, InetAddressIPv4 = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressPrefixLength", "InetAddressIPv4")
Ipv6AddressPrefix, Ipv6IfIndex, Ipv6Address = mibBuilder.importSymbols("IPV6-TC", "Ipv6AddressPrefix", "Ipv6IfIndex", "Ipv6Address")
switch, = mibBuilder.importSymbols("QUANTA-SWITCH-MIB", "switch")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
MibScalar, MibTable, MibTableRow, MibTableColumn, mib_2, NotificationType, MibIdentifier, Counter32, Counter64, Unsigned32, ModuleIdentity, Integer32, TimeTicks, ObjectIdentity, iso, Gauge32, Bits, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "mib-2", "NotificationType", "MibIdentifier", "Counter32", "Counter64", "Unsigned32", "ModuleIdentity", "Integer32", "TimeTicks", "ObjectIdentity", "iso", "Gauge32", "Bits", "IpAddress")
RowStatus, TextualConvention, PhysAddress, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TextualConvention", "PhysAddress", "DisplayString")
ipv6Tunnel = ModuleIdentity((1, 3, 6, 1, 4, 1, 7244, 2, 27))
if mibBuilder.loadTexts: ipv6Tunnel.setLastUpdated('201108310000Z')
if mibBuilder.loadTexts: ipv6Tunnel.setOrganization('QCI')
if mibBuilder.loadTexts: ipv6Tunnel.setContactInfo(' Customer Support Postal: Quanta Computer Inc. 4, Wen Ming 1 St., Kuei Shan Hsiang, Tao Yuan Shien, Taiwan, R.O.C. Tel: +886 3 328 0050 E-Mail: strong.chen@quantatw.com')
if mibBuilder.loadTexts: ipv6Tunnel.setDescription('The Quanta Private MIB for IPV6 Tunnel')
agentTunnelIPV6Group = MibIdentifier((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1))
agentTunnelIPV6Table = MibTable((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1), )
if mibBuilder.loadTexts: agentTunnelIPV6Table.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIPV6Table.setDescription('A summary table of the IPV6 tunnel instances')
agentTunnelIPV6Entry = MibTableRow((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1), ).setIndexNames((0, "IPV6-TUNNEL-MIB", "agentTunnelID"))
if mibBuilder.loadTexts: agentTunnelIPV6Entry.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIPV6Entry.setDescription('')
agentTunnelID = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647)))
if mibBuilder.loadTexts: agentTunnelID.setStatus('current')
if mibBuilder.loadTexts: agentTunnelID.setDescription('The tunnel ID is associated with Internal Interface number which is generated when we create a tunnel, and is used to configure the tunnel.')
agentTunnelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentTunnelIfIndex.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIfIndex.setDescription('The external interface of the tunnel is associted with internal interface. The tunnel ID associated with Internal Interface number is generated when we create a tunnel, which is used to configure the tunnel.')
agentTunnelMode = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("undefined", 1), ("ip6over4", 2), ("ip6to4", 3))).clone('undefined')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: agentTunnelMode.setStatus('current')
if mibBuilder.loadTexts: agentTunnelMode.setDescription('Specifies the type of Tunnel either undefined, 6over4 or 6to4. The default value is undefined. It supports 6over4 which supports an assigned IPV6 address, an IPV4 address is not allowed. For this mode, the tunnel source and tunnel destination must be IPV4 address. For 6to4 tunnel, the tunnel source must be IPv4 address. Tunnel destination should not be set. The first 48-bits of the IPv4 address assigned to the 6to4 tunnel should be of the format 2002:sourceIpv4address.')
agentTunnelLocalIP4Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 4), InetAddressIPv4()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: agentTunnelLocalIP4Addr.setStatus('current')
if mibBuilder.loadTexts: agentTunnelLocalIP4Addr.setDescription('The address of the Local endpoint of the tunnel i.e. the source address used in the outer IP header. It is 0.0.0.0 if unknown or the tunnel is over IPv6.')
agentTunnelRemoteIP4Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 5), InetAddressIPv4()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: agentTunnelRemoteIP4Addr.setStatus('current')
if mibBuilder.loadTexts: agentTunnelRemoteIP4Addr.setDescription('The address of the Remote endpoint of the tunnel i.e. the destination address used in the outer IP header. It is 0.0.0.0 if the tunnel is unknown or IPv6 address, or not a point to point link')
agentTunnelLocalIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: agentTunnelLocalIfIndex.setStatus('current')
if mibBuilder.loadTexts: agentTunnelLocalIfIndex.setDescription('Specifies the interface for IPv6 Tunnel Source')
agentTunnelStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 7), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: agentTunnelStatus.setStatus('current')
if mibBuilder.loadTexts: agentTunnelStatus.setDescription('Status of this instance.Row can be added or deleted by setting the value to createAndGo/destroy active(1) - this Tunnel instance is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance')
agentTunnelIcmpUnreachableMode = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: agentTunnelIcmpUnreachableMode.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIcmpUnreachableMode.setDescription('Specifies the Mode of Sending ICMPv6 Unreachable messages on this tunnel interface.')
agentTunnelIPV6PrefixTable = MibTable((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2), )
if mibBuilder.loadTexts: agentTunnelIPV6PrefixTable.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIPV6PrefixTable.setDescription('A table of the IPV6 prefixes associated with tunnel instances')
agentTunnelIPV6PrefixEntry = MibTableRow((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1), ).setIndexNames((0, "IPV6-TUNNEL-MIB", "agentTunnelID"), (0, "IPV6-TUNNEL-MIB", "agentTunnelIPV6PrefixPrefix"), (0, "IPV6-TUNNEL-MIB", "agentTunnelIPV6PrefixPrefixLen"))
if mibBuilder.loadTexts: agentTunnelIPV6PrefixEntry.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIPV6PrefixEntry.setDescription('')
agentTunnelIPV6PrefixPrefix = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1, 1), Ipv6AddressPrefix())
if mibBuilder.loadTexts: agentTunnelIPV6PrefixPrefix.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIPV6PrefixPrefix.setDescription('The prefix associated with the tunnel interface. The data type is used to model the IPV6 address. It is a binary string of 16 octects in network byte-order. It specifies the IP address of tunnel which will be in IPV6 Format, generated using internal interface number.')
agentTunnelIPV6PrefixPrefixLen = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1, 2), InetAddressPrefixLength())
if mibBuilder.loadTexts: agentTunnelIPV6PrefixPrefixLen.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIPV6PrefixPrefixLen.setDescription('The length of the prefix (in bits).')
agentTunnelIPV6PrefixStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: agentTunnelIPV6PrefixStatus.setStatus('current')
if mibBuilder.loadTexts: agentTunnelIPV6PrefixStatus.setDescription('Status of this instance.Row can be added or deleted by setting the value to createAndGo/destroy active(1) - this Tunnel instance is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance')
mibBuilder.exportSymbols("IPV6-TUNNEL-MIB", agentTunnelStatus=agentTunnelStatus, PYSNMP_MODULE_ID=ipv6Tunnel, agentTunnelIcmpUnreachableMode=agentTunnelIcmpUnreachableMode, agentTunnelIPV6PrefixEntry=agentTunnelIPV6PrefixEntry, agentTunnelIPV6Group=agentTunnelIPV6Group, agentTunnelMode=agentTunnelMode, agentTunnelLocalIfIndex=agentTunnelLocalIfIndex, agentTunnelIPV6Table=agentTunnelIPV6Table, agentTunnelIPV6PrefixStatus=agentTunnelIPV6PrefixStatus, agentTunnelLocalIP4Addr=agentTunnelLocalIP4Addr, agentTunnelIPV6PrefixTable=agentTunnelIPV6PrefixTable, ipv6Tunnel=ipv6Tunnel, agentTunnelIPV6PrefixPrefix=agentTunnelIPV6PrefixPrefix, agentTunnelIPV6PrefixPrefixLen=agentTunnelIPV6PrefixPrefixLen, agentTunnelIPV6Entry=agentTunnelIPV6Entry, agentTunnelID=agentTunnelID, agentTunnelRemoteIP4Addr=agentTunnelRemoteIP4Addr, agentTunnelIfIndex=agentTunnelIfIndex)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_range_constraint, constraints_union, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ValueSizeConstraint')
(inet_address_prefix_length, inet_address_i_pv4) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressPrefixLength', 'InetAddressIPv4')
(ipv6_address_prefix, ipv6_if_index, ipv6_address) = mibBuilder.importSymbols('IPV6-TC', 'Ipv6AddressPrefix', 'Ipv6IfIndex', 'Ipv6Address')
(switch,) = mibBuilder.importSymbols('QUANTA-SWITCH-MIB', 'switch')
(module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup')
(mib_scalar, mib_table, mib_table_row, mib_table_column, mib_2, notification_type, mib_identifier, counter32, counter64, unsigned32, module_identity, integer32, time_ticks, object_identity, iso, gauge32, bits, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'mib-2', 'NotificationType', 'MibIdentifier', 'Counter32', 'Counter64', 'Unsigned32', 'ModuleIdentity', 'Integer32', 'TimeTicks', 'ObjectIdentity', 'iso', 'Gauge32', 'Bits', 'IpAddress')
(row_status, textual_convention, phys_address, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'TextualConvention', 'PhysAddress', 'DisplayString')
ipv6_tunnel = module_identity((1, 3, 6, 1, 4, 1, 7244, 2, 27))
if mibBuilder.loadTexts:
ipv6Tunnel.setLastUpdated('201108310000Z')
if mibBuilder.loadTexts:
ipv6Tunnel.setOrganization('QCI')
if mibBuilder.loadTexts:
ipv6Tunnel.setContactInfo(' Customer Support Postal: Quanta Computer Inc. 4, Wen Ming 1 St., Kuei Shan Hsiang, Tao Yuan Shien, Taiwan, R.O.C. Tel: +886 3 328 0050 E-Mail: strong.chen@quantatw.com')
if mibBuilder.loadTexts:
ipv6Tunnel.setDescription('The Quanta Private MIB for IPV6 Tunnel')
agent_tunnel_ipv6_group = mib_identifier((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1))
agent_tunnel_ipv6_table = mib_table((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1))
if mibBuilder.loadTexts:
agentTunnelIPV6Table.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIPV6Table.setDescription('A summary table of the IPV6 tunnel instances')
agent_tunnel_ipv6_entry = mib_table_row((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1)).setIndexNames((0, 'IPV6-TUNNEL-MIB', 'agentTunnelID'))
if mibBuilder.loadTexts:
agentTunnelIPV6Entry.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIPV6Entry.setDescription('')
agent_tunnel_id = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 2147483647)))
if mibBuilder.loadTexts:
agentTunnelID.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelID.setDescription('The tunnel ID is associated with Internal Interface number which is generated when we create a tunnel, and is used to configure the tunnel.')
agent_tunnel_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
agentTunnelIfIndex.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIfIndex.setDescription('The external interface of the tunnel is associted with internal interface. The tunnel ID associated with Internal Interface number is generated when we create a tunnel, which is used to configure the tunnel.')
agent_tunnel_mode = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('undefined', 1), ('ip6over4', 2), ('ip6to4', 3))).clone('undefined')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
agentTunnelMode.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelMode.setDescription('Specifies the type of Tunnel either undefined, 6over4 or 6to4. The default value is undefined. It supports 6over4 which supports an assigned IPV6 address, an IPV4 address is not allowed. For this mode, the tunnel source and tunnel destination must be IPV4 address. For 6to4 tunnel, the tunnel source must be IPv4 address. Tunnel destination should not be set. The first 48-bits of the IPv4 address assigned to the 6to4 tunnel should be of the format 2002:sourceIpv4address.')
agent_tunnel_local_ip4_addr = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 4), inet_address_i_pv4()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
agentTunnelLocalIP4Addr.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelLocalIP4Addr.setDescription('The address of the Local endpoint of the tunnel i.e. the source address used in the outer IP header. It is 0.0.0.0 if unknown or the tunnel is over IPv6.')
agent_tunnel_remote_ip4_addr = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 5), inet_address_i_pv4()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
agentTunnelRemoteIP4Addr.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelRemoteIP4Addr.setDescription('The address of the Remote endpoint of the tunnel i.e. the destination address used in the outer IP header. It is 0.0.0.0 if the tunnel is unknown or IPv6 address, or not a point to point link')
agent_tunnel_local_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 6), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
agentTunnelLocalIfIndex.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelLocalIfIndex.setDescription('Specifies the interface for IPv6 Tunnel Source')
agent_tunnel_status = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 7), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
agentTunnelStatus.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelStatus.setDescription('Status of this instance.Row can be added or deleted by setting the value to createAndGo/destroy active(1) - this Tunnel instance is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance')
agent_tunnel_icmp_unreachable_mode = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
agentTunnelIcmpUnreachableMode.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIcmpUnreachableMode.setDescription('Specifies the Mode of Sending ICMPv6 Unreachable messages on this tunnel interface.')
agent_tunnel_ipv6_prefix_table = mib_table((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2))
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixTable.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixTable.setDescription('A table of the IPV6 prefixes associated with tunnel instances')
agent_tunnel_ipv6_prefix_entry = mib_table_row((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1)).setIndexNames((0, 'IPV6-TUNNEL-MIB', 'agentTunnelID'), (0, 'IPV6-TUNNEL-MIB', 'agentTunnelIPV6PrefixPrefix'), (0, 'IPV6-TUNNEL-MIB', 'agentTunnelIPV6PrefixPrefixLen'))
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixEntry.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixEntry.setDescription('')
agent_tunnel_ipv6_prefix_prefix = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1, 1), ipv6_address_prefix())
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixPrefix.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixPrefix.setDescription('The prefix associated with the tunnel interface. The data type is used to model the IPV6 address. It is a binary string of 16 octects in network byte-order. It specifies the IP address of tunnel which will be in IPV6 Format, generated using internal interface number.')
agent_tunnel_ipv6_prefix_prefix_len = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1, 2), inet_address_prefix_length())
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixPrefixLen.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixPrefixLen.setDescription('The length of the prefix (in bits).')
agent_tunnel_ipv6_prefix_status = mib_table_column((1, 3, 6, 1, 4, 1, 7244, 2, 27, 1, 2, 1, 3), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixStatus.setStatus('current')
if mibBuilder.loadTexts:
agentTunnelIPV6PrefixStatus.setDescription('Status of this instance.Row can be added or deleted by setting the value to createAndGo/destroy active(1) - this Tunnel instance is active createAndGo(4) - set to this value to create an instance destroy(6) - set to this value to delete an instance')
mibBuilder.exportSymbols('IPV6-TUNNEL-MIB', agentTunnelStatus=agentTunnelStatus, PYSNMP_MODULE_ID=ipv6Tunnel, agentTunnelIcmpUnreachableMode=agentTunnelIcmpUnreachableMode, agentTunnelIPV6PrefixEntry=agentTunnelIPV6PrefixEntry, agentTunnelIPV6Group=agentTunnelIPV6Group, agentTunnelMode=agentTunnelMode, agentTunnelLocalIfIndex=agentTunnelLocalIfIndex, agentTunnelIPV6Table=agentTunnelIPV6Table, agentTunnelIPV6PrefixStatus=agentTunnelIPV6PrefixStatus, agentTunnelLocalIP4Addr=agentTunnelLocalIP4Addr, agentTunnelIPV6PrefixTable=agentTunnelIPV6PrefixTable, ipv6Tunnel=ipv6Tunnel, agentTunnelIPV6PrefixPrefix=agentTunnelIPV6PrefixPrefix, agentTunnelIPV6PrefixPrefixLen=agentTunnelIPV6PrefixPrefixLen, agentTunnelIPV6Entry=agentTunnelIPV6Entry, agentTunnelID=agentTunnelID, agentTunnelRemoteIP4Addr=agentTunnelRemoteIP4Addr, agentTunnelIfIndex=agentTunnelIfIndex) |
BASEURL = "https://fnbr.co/api"
VALID_IMAGE_TYPES = ['emote','glider','emoji','loading','outfit','pickaxe','skydive','umbrella','misc']
VALID_IMAGE_LIMIT_MIN = 1
VALID_IMAGE_LIMIT_MAX = 15
NONE_TYPE = "none"
ERROR_TYPE = "error"
STATS_TYPE = "stats"
IMAGE_TYPE = "image"
SHOP_TYPE = "shop"
| baseurl = 'https://fnbr.co/api'
valid_image_types = ['emote', 'glider', 'emoji', 'loading', 'outfit', 'pickaxe', 'skydive', 'umbrella', 'misc']
valid_image_limit_min = 1
valid_image_limit_max = 15
none_type = 'none'
error_type = 'error'
stats_type = 'stats'
image_type = 'image'
shop_type = 'shop' |
# Title: Validate Binary Search Tree
# Runtime: 52 ms
# Memory: 16.6 MB
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# Time Complexity: O(n)
# Space Complexity: O(n)
class Solution:
def postOrderTraverse(self, root: TreeNode, lst: List):
if not root:
return
self.postOrderTraverse(root.left, lst)
lst.append(root.val)
self.postOrderTraverse(root.right, lst)
def isSorted(self, lst: List) -> bool:
for i in range(len(lst) - 1):
if lst[i] >= lst[i + 1]:
return False
return True
def isValidBST(self, root: TreeNode) -> bool:
lst = []
self.postOrderTraverse(root, lst)
return self.isSorted(lst)
| class Solution:
def post_order_traverse(self, root: TreeNode, lst: List):
if not root:
return
self.postOrderTraverse(root.left, lst)
lst.append(root.val)
self.postOrderTraverse(root.right, lst)
def is_sorted(self, lst: List) -> bool:
for i in range(len(lst) - 1):
if lst[i] >= lst[i + 1]:
return False
return True
def is_valid_bst(self, root: TreeNode) -> bool:
lst = []
self.postOrderTraverse(root, lst)
return self.isSorted(lst) |
# RUN: test-output.sh %s
x = 1
def adder():
y = 2
def inner(z):
return x + y + z
return inner(10)
print("Start") # OUTPUT-LABEL: Start
print(adder()) # OUTPUT-NEXT: 13
print("End") # OUTPUT-LABEL: End
| x = 1
def adder():
y = 2
def inner(z):
return x + y + z
return inner(10)
print('Start')
print(adder())
print('End') |
parameter_lists_copy = [bar for bar in parameter_lists]
for bar in parameter_lists_copy:
if param_index >= len(bar.GetParameters()):
parameter_lists.remove(bar)
| parameter_lists_copy = [bar for bar in parameter_lists]
for bar in parameter_lists_copy:
if param_index >= len(bar.GetParameters()):
parameter_lists.remove(bar) |
# example of definitions of names part 3
#global name
X = 11
# access to global name from function
def f():
if __name__ == '__main__':
print(X)
# changing global name X in module
def g():
global X
X = 22
if __name__ == '__main__':
print(X)
def h1():
X = 33 # locale name in function
def nested():
print(X) # link to local name
if __name__ == '__main__':
nested()
def h2():
X = 33 # locale name in function
def nested():
nonlocal X
X = 44
print(X)
if __name__ == '__main__':
nested()
print(X)
if __name__ == '__main__':
print(X) # 11
f() # 11
g() # 22
print(X) # 22 - X in function is global
h1() # 33 - X in h1 is local
h2() # 44 - X is nonlocal and seen from h2() function
| x = 11
def f():
if __name__ == '__main__':
print(X)
def g():
global X
x = 22
if __name__ == '__main__':
print(X)
def h1():
x = 33
def nested():
print(X)
if __name__ == '__main__':
nested()
def h2():
x = 33
def nested():
nonlocal X
x = 44
print(X)
if __name__ == '__main__':
nested()
print(X)
if __name__ == '__main__':
print(X)
f()
g()
print(X)
h1()
h2() |
def gcdRecur(a,b):
'''
a,b:positive integers
returns a positive integer, the GCD of a and b
'''
if b==0:
return a
else:
return gcdRecur(b,a%b)
| def gcd_recur(a, b):
"""
a,b:positive integers
returns a positive integer, the GCD of a and b
"""
if b == 0:
return a
else:
return gcd_recur(b, a % b) |
def query_tekst(source, target):
postgreSQL_select_Query = f"SELECT MIN(r.seq) AS seq, " \
f"e.old_id AS id, " \
f"sum(e.distance) AS distance, " \
f"ST_Collect(e.the_geom) AS geom " \
f"FROM pgr_dijkstra('SELECT id, source, target, distance as cost FROM public.\"00DrogiINTER_noded\"', {source}, {target}, false ) AS r, " \
f"public.\"00DrogiINTER_noded\" AS e " \
f"WHERE r.edge=e.id " \
f"GROUP BY e.old_id"
# print(postgreSQL_select_Query)
return postgreSQL_select_Query
def sum_length_from_scratch(tablica):
# print(tablica)
dlugosc_drogi = 0
for row in tablica:
dlugosc_drogi = dlugosc_drogi + float(row[2])
return dlugosc_drogi
| def query_tekst(source, target):
postgre_sql_select__query = f"""SELECT MIN(r.seq) AS seq, e.old_id AS id, sum(e.distance) AS distance, ST_Collect(e.the_geom) AS geom FROM pgr_dijkstra('SELECT id, source, target, distance as cost FROM public."00DrogiINTER_noded"', {source}, {target}, false ) AS r, public."00DrogiINTER_noded" AS e WHERE r.edge=e.id GROUP BY e.old_id"""
return postgreSQL_select_Query
def sum_length_from_scratch(tablica):
dlugosc_drogi = 0
for row in tablica:
dlugosc_drogi = dlugosc_drogi + float(row[2])
return dlugosc_drogi |
{
"targets": [
{
"target_name": "ledcontrol",
"sources": [ "led-control.cpp", "include/gpio-driver.cpp",
"include/spi-driver.cpp", "include/ws2801-driver.cpp" ],
},
{
"target_name": "spectrum",
"sources": [ "i2c_spectrum.cc" ],
"include_dirs": [
"/usr/include/glib-2.0",
"/usr/lib/glib-2.0/include",
"/usr/include/gtk-2.0",
"/usr/lib/gtk-2.0/include",
"/usr/include/atk-1.0",
"/usr/include/cairo",
"/usr/include/gdk-pixbuf-2.0",
"/usr/include/pango-1.0",
"/usr/include/pixman-1",
"/usr/include/freetype2",
"/usr/include/libpng12",
],
}
]
}
| {'targets': [{'target_name': 'ledcontrol', 'sources': ['led-control.cpp', 'include/gpio-driver.cpp', 'include/spi-driver.cpp', 'include/ws2801-driver.cpp']}, {'target_name': 'spectrum', 'sources': ['i2c_spectrum.cc'], 'include_dirs': ['/usr/include/glib-2.0', '/usr/lib/glib-2.0/include', '/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/atk-1.0', '/usr/include/cairo', '/usr/include/gdk-pixbuf-2.0', '/usr/include/pango-1.0', '/usr/include/pixman-1', '/usr/include/freetype2', '/usr/include/libpng12']}]} |
double_qoute_string = "This is a string with double qoute";
single_qoute_string = 'This is a string with single qoute';
three_qoute_string = '''
This is a string with single qoute.
'''
three_double_qoute_string = """
This is a string with three double qoute.
"""
print(double_qoute_string);
print(single_qoute_string);
print(three_qoute_string);
print(three_double_qoute_string); | double_qoute_string = 'This is a string with double qoute'
single_qoute_string = 'This is a string with single qoute'
three_qoute_string = '\nThis is a string with single qoute.\n'
three_double_qoute_string = '\nThis is a string with three double qoute.\n'
print(double_qoute_string)
print(single_qoute_string)
print(three_qoute_string)
print(three_double_qoute_string) |
def bubble_sort(input_list):
last_position = len(input_list) - 1
made_changes = True
while made_changes:
made_changes = False
for i in range(0, last_position):
if input_list[i] > input_list[i + 1]:
input_list[i], input_list[i + 1] = input_list[i + 1], input_list[i]
made_changes = True
last_position -= 1
return input_list
| def bubble_sort(input_list):
last_position = len(input_list) - 1
made_changes = True
while made_changes:
made_changes = False
for i in range(0, last_position):
if input_list[i] > input_list[i + 1]:
(input_list[i], input_list[i + 1]) = (input_list[i + 1], input_list[i])
made_changes = True
last_position -= 1
return input_list |
class Solution:
def trap(self, height: List[int]) -> int:
box = 0
left_max = 0
right_max = 0
left = 0
right = len(height)-1
while left<right:
if height[left]<height[right]:
if height[left]>left_max:
left_max = height[left]
else:
box += left_max - height[left]
left+=1
else:
if height[right]>right_max:
right_max = height[right]
else:
box += right_max - height[right]
right-=1
return box
| class Solution:
def trap(self, height: List[int]) -> int:
box = 0
left_max = 0
right_max = 0
left = 0
right = len(height) - 1
while left < right:
if height[left] < height[right]:
if height[left] > left_max:
left_max = height[left]
else:
box += left_max - height[left]
left += 1
else:
if height[right] > right_max:
right_max = height[right]
else:
box += right_max - height[right]
right -= 1
return box |
'''
70. Climbing Stairs
https://leetcode.com/problems/climbing-stairs/
You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Example 1:
Input: n = 2
Output: 2
Explanation: There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps
Example 2:
Input: n = 3
Output: 3
Explanation: There are three ways to climb to the top.
1. 1 step + 1 step + 1 step
2. 1 step + 2 steps
3. 2 steps + 1 step
'''
class Solution:
def climbStairs(self, n: int) -> int:
if n > 2:
ai, an_2, an_1 = 0, 2, 1
for _ in range(n-3, -1, -1):
ai = an_1 + an_2
an_2, an_1 = ai, an_2
# print(ai, an_2, an_1)
return ai
elif n == 2:
return 2
else: # n == 1, 0:
return 1
| """
70. Climbing Stairs
https://leetcode.com/problems/climbing-stairs/
You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Example 1:
Input: n = 2
Output: 2
Explanation: There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps
Example 2:
Input: n = 3
Output: 3
Explanation: There are three ways to climb to the top.
1. 1 step + 1 step + 1 step
2. 1 step + 2 steps
3. 2 steps + 1 step
"""
class Solution:
def climb_stairs(self, n: int) -> int:
if n > 2:
(ai, an_2, an_1) = (0, 2, 1)
for _ in range(n - 3, -1, -1):
ai = an_1 + an_2
(an_2, an_1) = (ai, an_2)
return ai
elif n == 2:
return 2
else:
return 1 |
#
# PySNMP MIB module TIARA-GENERIC-HDLC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TIARA-GENERIC-HDLC-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:08:59 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")
ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, iso, NotificationType, Counter32, IpAddress, MibIdentifier, ObjectIdentity, Integer32, ModuleIdentity, Bits, Unsigned32, Gauge32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "iso", "NotificationType", "Counter32", "IpAddress", "MibIdentifier", "ObjectIdentity", "Integer32", "ModuleIdentity", "Bits", "Unsigned32", "Gauge32", "Counter64")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
bundleId, = mibBuilder.importSymbols("TIARA-BUNDLE-MIB", "bundleId")
tiaraMgmt, = mibBuilder.importSymbols("TIARA-NETWORKS-SMI", "tiaraMgmt")
tiaraGenHdlcMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 3174, 2, 15))
if mibBuilder.loadTexts: tiaraGenHdlcMib.setLastUpdated('9907010000Z')
if mibBuilder.loadTexts: tiaraGenHdlcMib.setOrganization('Tiara Networks Inc.')
genHdlcTable = MibTable((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1), )
if mibBuilder.loadTexts: genHdlcTable.setStatus('current')
genHdlcTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1, 1), ).setIndexNames((0, "TIARA-BUNDLE-MIB", "bundleId"))
if mibBuilder.loadTexts: genHdlcTableEntry.setStatus('current')
genHdlcKeepAlive = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 120)).clone(10)).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: genHdlcKeepAlive.setStatus('current')
genHdlcMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1, 1, 2), Integer32().clone(1500)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: genHdlcMtu.setStatus('current')
genHdlcStatsTable = MibTable((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2), )
if mibBuilder.loadTexts: genHdlcStatsTable.setStatus('current')
genHdlcStatsTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1), ).setIndexNames((0, "TIARA-BUNDLE-MIB", "bundleId"))
if mibBuilder.loadTexts: genHdlcStatsTableEntry.setStatus('current')
genHdlcStatsBytesRxLastBootClear = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsBytesRxLastBootClear.setStatus('current')
genHdlcStatsBytesTxLastBootClear = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsBytesTxLastBootClear.setStatus('current')
genHdlcStatsPktsRxLastBootClear = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsPktsRxLastBootClear.setStatus('current')
genHdlcStatsPktsTxLastBootClear = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsPktsTxLastBootClear.setStatus('current')
genHdlcStatsErrPktsRxLastBootClear = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsErrPktsRxLastBootClear.setStatus('current')
genHdlcStatsUpDownStatesLastBootClear = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsUpDownStatesLastBootClear.setStatus('current')
genHdlcStatsBytesRxLastFiveMins = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsBytesRxLastFiveMins.setStatus('current')
genHdlcStatsBytesTxLastFiveMins = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsBytesTxLastFiveMins.setStatus('current')
genHdlcStatsPktsRxLastFiveMins = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsPktsRxLastFiveMins.setStatus('current')
genHdlcStatsPktsTxLastFiveMins = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsPktsTxLastFiveMins.setStatus('current')
genHdlcStatsErrPktsRxLastFiveMins = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsErrPktsRxLastFiveMins.setStatus('current')
genHdlcStatsUpDownStatesLastFiveMins = MibTableColumn((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: genHdlcStatsUpDownStatesLastFiveMins.setStatus('current')
mibBuilder.exportSymbols("TIARA-GENERIC-HDLC-MIB", genHdlcStatsUpDownStatesLastBootClear=genHdlcStatsUpDownStatesLastBootClear, genHdlcMtu=genHdlcMtu, genHdlcStatsBytesTxLastFiveMins=genHdlcStatsBytesTxLastFiveMins, genHdlcStatsTableEntry=genHdlcStatsTableEntry, genHdlcStatsPktsRxLastBootClear=genHdlcStatsPktsRxLastBootClear, PYSNMP_MODULE_ID=tiaraGenHdlcMib, genHdlcStatsBytesRxLastFiveMins=genHdlcStatsBytesRxLastFiveMins, genHdlcStatsTable=genHdlcStatsTable, genHdlcKeepAlive=genHdlcKeepAlive, genHdlcTable=genHdlcTable, genHdlcStatsErrPktsRxLastBootClear=genHdlcStatsErrPktsRxLastBootClear, genHdlcStatsErrPktsRxLastFiveMins=genHdlcStatsErrPktsRxLastFiveMins, genHdlcStatsBytesRxLastBootClear=genHdlcStatsBytesRxLastBootClear, genHdlcStatsPktsTxLastBootClear=genHdlcStatsPktsTxLastBootClear, genHdlcStatsUpDownStatesLastFiveMins=genHdlcStatsUpDownStatesLastFiveMins, genHdlcStatsBytesTxLastBootClear=genHdlcStatsBytesTxLastBootClear, genHdlcStatsPktsRxLastFiveMins=genHdlcStatsPktsRxLastFiveMins, tiaraGenHdlcMib=tiaraGenHdlcMib, genHdlcTableEntry=genHdlcTableEntry, genHdlcStatsPktsTxLastFiveMins=genHdlcStatsPktsTxLastFiveMins)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_size_constraint, constraints_intersection, value_range_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint', 'SingleValueConstraint')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, iso, notification_type, counter32, ip_address, mib_identifier, object_identity, integer32, module_identity, bits, unsigned32, gauge32, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'iso', 'NotificationType', 'Counter32', 'IpAddress', 'MibIdentifier', 'ObjectIdentity', 'Integer32', 'ModuleIdentity', 'Bits', 'Unsigned32', 'Gauge32', 'Counter64')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
(bundle_id,) = mibBuilder.importSymbols('TIARA-BUNDLE-MIB', 'bundleId')
(tiara_mgmt,) = mibBuilder.importSymbols('TIARA-NETWORKS-SMI', 'tiaraMgmt')
tiara_gen_hdlc_mib = module_identity((1, 3, 6, 1, 4, 1, 3174, 2, 15))
if mibBuilder.loadTexts:
tiaraGenHdlcMib.setLastUpdated('9907010000Z')
if mibBuilder.loadTexts:
tiaraGenHdlcMib.setOrganization('Tiara Networks Inc.')
gen_hdlc_table = mib_table((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1))
if mibBuilder.loadTexts:
genHdlcTable.setStatus('current')
gen_hdlc_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1, 1)).setIndexNames((0, 'TIARA-BUNDLE-MIB', 'bundleId'))
if mibBuilder.loadTexts:
genHdlcTableEntry.setStatus('current')
gen_hdlc_keep_alive = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 120)).clone(10)).setUnits('seconds').setMaxAccess('readwrite')
if mibBuilder.loadTexts:
genHdlcKeepAlive.setStatus('current')
gen_hdlc_mtu = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 1, 1, 2), integer32().clone(1500)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
genHdlcMtu.setStatus('current')
gen_hdlc_stats_table = mib_table((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2))
if mibBuilder.loadTexts:
genHdlcStatsTable.setStatus('current')
gen_hdlc_stats_table_entry = mib_table_row((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1)).setIndexNames((0, 'TIARA-BUNDLE-MIB', 'bundleId'))
if mibBuilder.loadTexts:
genHdlcStatsTableEntry.setStatus('current')
gen_hdlc_stats_bytes_rx_last_boot_clear = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 1), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsBytesRxLastBootClear.setStatus('current')
gen_hdlc_stats_bytes_tx_last_boot_clear = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsBytesTxLastBootClear.setStatus('current')
gen_hdlc_stats_pkts_rx_last_boot_clear = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsPktsRxLastBootClear.setStatus('current')
gen_hdlc_stats_pkts_tx_last_boot_clear = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsPktsTxLastBootClear.setStatus('current')
gen_hdlc_stats_err_pkts_rx_last_boot_clear = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsErrPktsRxLastBootClear.setStatus('current')
gen_hdlc_stats_up_down_states_last_boot_clear = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 6), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsUpDownStatesLastBootClear.setStatus('current')
gen_hdlc_stats_bytes_rx_last_five_mins = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 7), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsBytesRxLastFiveMins.setStatus('current')
gen_hdlc_stats_bytes_tx_last_five_mins = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 8), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsBytesTxLastFiveMins.setStatus('current')
gen_hdlc_stats_pkts_rx_last_five_mins = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 9), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsPktsRxLastFiveMins.setStatus('current')
gen_hdlc_stats_pkts_tx_last_five_mins = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 10), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsPktsTxLastFiveMins.setStatus('current')
gen_hdlc_stats_err_pkts_rx_last_five_mins = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 11), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsErrPktsRxLastFiveMins.setStatus('current')
gen_hdlc_stats_up_down_states_last_five_mins = mib_table_column((1, 3, 6, 1, 4, 1, 3174, 2, 15, 2, 1, 12), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
genHdlcStatsUpDownStatesLastFiveMins.setStatus('current')
mibBuilder.exportSymbols('TIARA-GENERIC-HDLC-MIB', genHdlcStatsUpDownStatesLastBootClear=genHdlcStatsUpDownStatesLastBootClear, genHdlcMtu=genHdlcMtu, genHdlcStatsBytesTxLastFiveMins=genHdlcStatsBytesTxLastFiveMins, genHdlcStatsTableEntry=genHdlcStatsTableEntry, genHdlcStatsPktsRxLastBootClear=genHdlcStatsPktsRxLastBootClear, PYSNMP_MODULE_ID=tiaraGenHdlcMib, genHdlcStatsBytesRxLastFiveMins=genHdlcStatsBytesRxLastFiveMins, genHdlcStatsTable=genHdlcStatsTable, genHdlcKeepAlive=genHdlcKeepAlive, genHdlcTable=genHdlcTable, genHdlcStatsErrPktsRxLastBootClear=genHdlcStatsErrPktsRxLastBootClear, genHdlcStatsErrPktsRxLastFiveMins=genHdlcStatsErrPktsRxLastFiveMins, genHdlcStatsBytesRxLastBootClear=genHdlcStatsBytesRxLastBootClear, genHdlcStatsPktsTxLastBootClear=genHdlcStatsPktsTxLastBootClear, genHdlcStatsUpDownStatesLastFiveMins=genHdlcStatsUpDownStatesLastFiveMins, genHdlcStatsBytesTxLastBootClear=genHdlcStatsBytesTxLastBootClear, genHdlcStatsPktsRxLastFiveMins=genHdlcStatsPktsRxLastFiveMins, tiaraGenHdlcMib=tiaraGenHdlcMib, genHdlcTableEntry=genHdlcTableEntry, genHdlcStatsPktsTxLastFiveMins=genHdlcStatsPktsTxLastFiveMins) |
#!/opt/homebrew/opt/python@3.10/bin/python
indata = []
with open("input") as infile:
for line in infile:
line = line.strip()
indata.append(line)
o2_gen_rating = 1
vals = indata.copy()
for i in range(len(indata[0])):
zeroes = 0
ones = 0
for val in vals:
if val[i] == "0":
zeroes += 1
elif val[i] == "1":
ones += 1
else:
raise Exception("invalid input")
if zeroes > ones:
vals = [val for val in vals if val[i] == "0"]
else:
vals = [val for val in vals if val[i] == "1"]
if len(vals) == 1:
o2_gen_rating = int(vals[0], 2)
break
# yeah yeah I should make this a function... this is AoC not the mona lisa...
co2_scrubber_rating = 1
vals = indata.copy()
for i in range(len(indata[0])):
zeroes = 0
ones = 0
for val in vals:
if val[i] == "0":
zeroes += 1
elif val[i] == "1":
ones += 1
else:
raise Exception("invalid input")
if zeroes <= ones:
vals = [val for val in vals if val[i] == "0"]
else:
vals = [val for val in vals if val[i] == "1"]
if len(vals) == 1:
co2_scrubber_rating = int(vals[0], 2)
break
print(f"O2 generator rating: {o2_gen_rating}")
print(f"CO2 scrubber rating: {co2_scrubber_rating}")
print(f"Multiplied: {o2_gen_rating * co2_scrubber_rating}")
| indata = []
with open('input') as infile:
for line in infile:
line = line.strip()
indata.append(line)
o2_gen_rating = 1
vals = indata.copy()
for i in range(len(indata[0])):
zeroes = 0
ones = 0
for val in vals:
if val[i] == '0':
zeroes += 1
elif val[i] == '1':
ones += 1
else:
raise exception('invalid input')
if zeroes > ones:
vals = [val for val in vals if val[i] == '0']
else:
vals = [val for val in vals if val[i] == '1']
if len(vals) == 1:
o2_gen_rating = int(vals[0], 2)
break
co2_scrubber_rating = 1
vals = indata.copy()
for i in range(len(indata[0])):
zeroes = 0
ones = 0
for val in vals:
if val[i] == '0':
zeroes += 1
elif val[i] == '1':
ones += 1
else:
raise exception('invalid input')
if zeroes <= ones:
vals = [val for val in vals if val[i] == '0']
else:
vals = [val for val in vals if val[i] == '1']
if len(vals) == 1:
co2_scrubber_rating = int(vals[0], 2)
break
print(f'O2 generator rating: {o2_gen_rating}')
print(f'CO2 scrubber rating: {co2_scrubber_rating}')
print(f'Multiplied: {o2_gen_rating * co2_scrubber_rating}') |
number = int(input('Please insert any number'))
if number % 2 == 0 :
print('this number is par')
else:
print('this number is impar') | number = int(input('Please insert any number'))
if number % 2 == 0:
print('this number is par')
else:
print('this number is impar') |
first = 'Hello World. This is python string tutorial'
string_methods = ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold',
'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
print('Starts with "Hello" : {0}'.format(first.startswith('Hello')))
print('Starts with "hello" : {0}'.format(first.startswith('hello')))
print('Ends with "ial" : {0}'.format(first.endswith('ial')))
print('Capitalize "hello": {0}'.format('hello'.capitalize()))
print('Casefold (Lowercase) "HEllo": {0}'.format('hello'.casefold()))
print('Center "hello": {0}'.format('hello'.center(50, '*')))
print('Occurrences of "o" : {0}'.format(first.count('or')))
print('Encode : {0}'.format(first.encode('utf-8', 'xmlcharrefreplace')))
print('Find (finds index) : {0}'.format(first.find('or')))
print('UPPER : {0}'.format(first.upper()))
print('lower : {0}'.format(first.lower()))
print('Replace : {0}'.format(first.replace('or', '*FOR*', -1)))
print('Is Identifier : {0}'.format('def'.isidentifier()))
print('Patition : {0}'.format(first.partition(' ')))
print('RSplit : {0}'.format(first.rsplit(' ', 3)))
print('Split : {0}'.format(first.split(' ', -1)))
print('Index : {0}'.format(first.index('or', 8)))
| first = 'Hello World. This is python string tutorial'
string_methods = ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
print('Starts with "Hello" : {0}'.format(first.startswith('Hello')))
print('Starts with "hello" : {0}'.format(first.startswith('hello')))
print('Ends with "ial" : {0}'.format(first.endswith('ial')))
print('Capitalize "hello": {0}'.format('hello'.capitalize()))
print('Casefold (Lowercase) "HEllo": {0}'.format('hello'.casefold()))
print('Center "hello": {0}'.format('hello'.center(50, '*')))
print('Occurrences of "o" : {0}'.format(first.count('or')))
print('Encode : {0}'.format(first.encode('utf-8', 'xmlcharrefreplace')))
print('Find (finds index) : {0}'.format(first.find('or')))
print('UPPER : {0}'.format(first.upper()))
print('lower : {0}'.format(first.lower()))
print('Replace : {0}'.format(first.replace('or', '*FOR*', -1)))
print('Is Identifier : {0}'.format('def'.isidentifier()))
print('Patition : {0}'.format(first.partition(' ')))
print('RSplit : {0}'.format(first.rsplit(' ', 3)))
print('Split : {0}'.format(first.split(' ', -1)))
print('Index : {0}'.format(first.index('or', 8))) |
NO_TYPE_PENALTY_TYPES_1 = ["SPE1", "SPE2", "REL", "SIMI"]
NO_TYPE_PENALTY_TYPES_2 = ["SPE1", "SPE2", "SIMI"]
NO_TYPE_PENALTY_EQUI_2 = ["EQUI"]
class F1Metrics:
def __init__(self, predicted_types, predicted_scores, target_types, target_scores, num_tokens):
self._predicted_types = predicted_types
self._predicted_scores = predicted_scores
self._target_types = target_types
self._target_scores = target_scores
self._num_tokens = num_tokens
self._total_num_tokens = sum(num_tokens)
def print_statistics(self):
print("[F1 Type], where alignment types need to match, but scores are ignored: {}".format(self.f1_type_match()))
print("[F1 Score], where alignment type is ignored, but each alignment is penalized when scores do not match: {}".format(self.f1_score_match()))
print("[F1 T+S], where alignment types need to match and each alignment is penalized when scores do not match: {}".format(self.f1_all_match()))
def f1_type_match(self):
overlap = 0
for i in range(len(self._predicted_types) - 1):
if self._predicted_types[i] == self._target_types[i]:
overlap += self._num_tokens[i]
return self.count_f1(overlap, overlap)
def f1_score_match(self):
overlap = 0
for i in range(len(self._predicted_scores) - 1):
overlap += self._num_tokens[i] * (1 - abs(self._predicted_scores[i] - self._target_scores[i]) / 5)
return self.count_f1(overlap, overlap)
def f1_all_match(self):
overlap = 0
for pt, ps, tt, ts, tokens in zip(self._predicted_types, self._predicted_scores, self._target_types, self._target_scores, self._num_tokens):
if pt == tt or self.is_special_case1(pt, ps, tt, ts) or self.is_special_case2(pt, ps, tt, ts):
overlap += tokens * (1 - abs(ps - ts) / 5)
return self.count_f1(overlap, overlap)
def is_special_case1(self, predicted_type, predicted_score, target_type, target_score):
if target_score <= 2 and predicted_score <= 2:
if predicted_type in NO_TYPE_PENALTY_TYPES_1 and target_type in NO_TYPE_PENALTY_TYPES_1 and predicted_type != target_type:
return True
return False
def is_special_case2(self, predicted_type, predicted_score, target_type, target_score):
if predicted_score == 4 or target_score == 4:
if predicted_type in NO_TYPE_PENALTY_EQUI_2 and target_score >= 4 and target_type in NO_TYPE_PENALTY_TYPES_2 \
or target_type in NO_TYPE_PENALTY_EQUI_2 and predicted_score >= 4 and predicted_type in NO_TYPE_PENALTY_TYPES_2:
return True
return False
def count_f1(self, overlap_gs, overlap_sys):
precision = overlap_gs / self._total_num_tokens
recall = overlap_sys / self._total_num_tokens
return 2 * precision * recall/ (precision + recall)
| no_type_penalty_types_1 = ['SPE1', 'SPE2', 'REL', 'SIMI']
no_type_penalty_types_2 = ['SPE1', 'SPE2', 'SIMI']
no_type_penalty_equi_2 = ['EQUI']
class F1Metrics:
def __init__(self, predicted_types, predicted_scores, target_types, target_scores, num_tokens):
self._predicted_types = predicted_types
self._predicted_scores = predicted_scores
self._target_types = target_types
self._target_scores = target_scores
self._num_tokens = num_tokens
self._total_num_tokens = sum(num_tokens)
def print_statistics(self):
print('[F1 Type], where alignment types need to match, but scores are ignored: {}'.format(self.f1_type_match()))
print('[F1 Score], where alignment type is ignored, but each alignment is penalized when scores do not match: {}'.format(self.f1_score_match()))
print('[F1 T+S], where alignment types need to match and each alignment is penalized when scores do not match: {}'.format(self.f1_all_match()))
def f1_type_match(self):
overlap = 0
for i in range(len(self._predicted_types) - 1):
if self._predicted_types[i] == self._target_types[i]:
overlap += self._num_tokens[i]
return self.count_f1(overlap, overlap)
def f1_score_match(self):
overlap = 0
for i in range(len(self._predicted_scores) - 1):
overlap += self._num_tokens[i] * (1 - abs(self._predicted_scores[i] - self._target_scores[i]) / 5)
return self.count_f1(overlap, overlap)
def f1_all_match(self):
overlap = 0
for (pt, ps, tt, ts, tokens) in zip(self._predicted_types, self._predicted_scores, self._target_types, self._target_scores, self._num_tokens):
if pt == tt or self.is_special_case1(pt, ps, tt, ts) or self.is_special_case2(pt, ps, tt, ts):
overlap += tokens * (1 - abs(ps - ts) / 5)
return self.count_f1(overlap, overlap)
def is_special_case1(self, predicted_type, predicted_score, target_type, target_score):
if target_score <= 2 and predicted_score <= 2:
if predicted_type in NO_TYPE_PENALTY_TYPES_1 and target_type in NO_TYPE_PENALTY_TYPES_1 and (predicted_type != target_type):
return True
return False
def is_special_case2(self, predicted_type, predicted_score, target_type, target_score):
if predicted_score == 4 or target_score == 4:
if predicted_type in NO_TYPE_PENALTY_EQUI_2 and target_score >= 4 and (target_type in NO_TYPE_PENALTY_TYPES_2) or (target_type in NO_TYPE_PENALTY_EQUI_2 and predicted_score >= 4 and (predicted_type in NO_TYPE_PENALTY_TYPES_2)):
return True
return False
def count_f1(self, overlap_gs, overlap_sys):
precision = overlap_gs / self._total_num_tokens
recall = overlap_sys / self._total_num_tokens
return 2 * precision * recall / (precision + recall) |
#!/usr/bin/python
class FilterModule(object):
def filters(self):
return {
'get_mid_stages' : self.get_mid_stages,
'get_preprod' : self.get_preprod
}
def get_preprod(self, stages):
for i in range(len(stages)):
if stages[i]["name"] == "prod" :
return stages[i-1]["name"]
def get_mid_stages(self, stages):
preprod = self.get_preprod(stages)
mid_stages = []
for stage in stages:
if stage["name"] not in ['build', preprod, 'prod']:
mid_stages.append(stage["name"])
return mid_stages
| class Filtermodule(object):
def filters(self):
return {'get_mid_stages': self.get_mid_stages, 'get_preprod': self.get_preprod}
def get_preprod(self, stages):
for i in range(len(stages)):
if stages[i]['name'] == 'prod':
return stages[i - 1]['name']
def get_mid_stages(self, stages):
preprod = self.get_preprod(stages)
mid_stages = []
for stage in stages:
if stage['name'] not in ['build', preprod, 'prod']:
mid_stages.append(stage['name'])
return mid_stages |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Dice(object):
"""
This class is used to store information about
a dice that is detected on the grid.
"""
def __init__(self, x, y, top_face):
"""
This initializes the values of a detected dice.
:param row: The where the dice
"""
self.x = x
self.y = y
self.top_face = top_face
class Grid(object):
def __init__(self, dice):
self.dice = dice
| class Dice(object):
"""
This class is used to store information about
a dice that is detected on the grid.
"""
def __init__(self, x, y, top_face):
"""
This initializes the values of a detected dice.
:param row: The where the dice
"""
self.x = x
self.y = y
self.top_face = top_face
class Grid(object):
def __init__(self, dice):
self.dice = dice |
# Replace the below values with your values
NEXMO_API_KEY = "<your-api-key>"
NEXMO_API_SECRET = "<your-api-secret>"
NEXMO_NUMBER = "+447512345678"
NEXMO_APPLICATION_ID = "<nexmo-application-id>"
NEXMO_PRIVATE_KEY = '''-----BEGIN PRIVATE KEY-----
<your-private-key>
-----END PRIVATE KEY-----'''
# You will have to sign up for a free Microsoft account to use the Microsoft Translator Speech API: http://docs.microsofttranslator.com/speech-translate.html
MICROSOFT_TRANSLATION_SPEECH_CLIENT_SECRET = "<your-api-key>"
| nexmo_api_key = '<your-api-key>'
nexmo_api_secret = '<your-api-secret>'
nexmo_number = '+447512345678'
nexmo_application_id = '<nexmo-application-id>'
nexmo_private_key = '-----BEGIN PRIVATE KEY-----\n<your-private-key>\n-----END PRIVATE KEY-----'
microsoft_translation_speech_client_secret = '<your-api-key>' |
a=m=''
for x in input()[::-1]:
if x>=m: a+=x
m=max(m,x)
print(a[::-1])
| a = m = ''
for x in input()[::-1]:
if x >= m:
a += x
m = max(m, x)
print(a[::-1]) |
fhand = open('mbox-short_1.txt')
count = 0
for line in fhand:
words = line.split()
#print('Debug: ', words)
if len(words) > 2 and words[0] == 'From' :
print(words[2]) | fhand = open('mbox-short_1.txt')
count = 0
for line in fhand:
words = line.split()
if len(words) > 2 and words[0] == 'From':
print(words[2]) |
"""
BaseClass module for Numerical Methods
for Non-Linear root finding
"""
class Nu_Meth:
_max_iter = 500 # maximum iteriation before the solver quits
_tol = 0.0001 # tolerance
def __init__():
pass
def execute(self):
raise NotImplemented
def set_tol(self,tol):
self._tol = tol
def set_maxIter(mIter):
self._max_iter = mIter
| """
BaseClass module for Numerical Methods
for Non-Linear root finding
"""
class Nu_Meth:
_max_iter = 500
_tol = 0.0001
def __init__():
pass
def execute(self):
raise NotImplemented
def set_tol(self, tol):
self._tol = tol
def set_max_iter(mIter):
self._max_iter = mIter |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# class Solution:
# def tree2str(self, t: TreeNode) -> str:
# def buildTree(node):
# ans = ''
# if node:
# if not node.left and not node.right:
# ans = f'{node.val}'
# elif node.left and node.right:
# ans = f'{node.val}({buildTree(node.left)})({buildTree(node.right)})'
# elif not node.left:
# ans = f'{node.val}()({buildTree(node.right)})'
# else:
# ans = f'{node.val}({buildTree(node.left)})'
# return ans
# return buildTree(t)
class Solution:
def tree2str(self, t: TreeNode) -> str:
'''
use stack, inorder traversal
'''
stack = [t]
visited = set()
ans = ''
if not t:
return ''
while stack:
top = stack[-1]
if top in visited:
stack.pop()
ans += ')'
else:
visited.add(top)
ans += f'({top.val}'
if not top.left and top.right:
ans += '()'
if top.right:
stack.append(top.right)
if top.left:
stack.append(top.left)
return ans[1:-1]
| class Solution:
def tree2str(self, t: TreeNode) -> str:
"""
use stack, inorder traversal
"""
stack = [t]
visited = set()
ans = ''
if not t:
return ''
while stack:
top = stack[-1]
if top in visited:
stack.pop()
ans += ')'
else:
visited.add(top)
ans += f'({top.val}'
if not top.left and top.right:
ans += '()'
if top.right:
stack.append(top.right)
if top.left:
stack.append(top.left)
return ans[1:-1] |
class Tier:
def __init__(self):
self.children = [None] * 26
self.complete_word = 0
def __str__(self):
return f'{self.children} and {self.complete_word}'
class WordDictionary:
def __init__(self):
self.root = Tier()
self.found = list()
def get_index(self, char):
if char.isupper():
return abs(ord('A') - ord(char))
else:
return abs(ord('a') - ord(char))
def addWord(self, word):
curr_level = self.root
for char in word:
index = self.get_index(char)
if not curr_level.children[index]:
curr_level.children[index] = Tier()
curr_level = curr_level.children[index]
curr_level.complete_word += 1
def search(self, word):
curr_level = self.root
self.found = list()
self.dfs(word, 0, curr_level)
return True if self.found else False
def dfs(self, word, index, curr_level):
if index == len(word):
if curr_level.complete_word > 0:
self.found.append(True)
return
char = word[index]
if char == '.':
for level in curr_level.children:
if level:
self.dfs(word, index + 1, level)
if self.found:
return
else:
i = self.get_index(char)
if curr_level.children[i]:
self.dfs(word, index + 1, curr_level.children[i])
# Your WordDictionary object will be instantiated and called as such:
# obj = WordDictionary()
# obj.addWord(word)
# param_2 = obj.search(word)
s = WordDictionary()
s.addWord('at')
s.addWord('and')
s.addWord('an')
s.addWord('at')
s.addWord('add')
print(s)
| class Tier:
def __init__(self):
self.children = [None] * 26
self.complete_word = 0
def __str__(self):
return f'{self.children} and {self.complete_word}'
class Worddictionary:
def __init__(self):
self.root = tier()
self.found = list()
def get_index(self, char):
if char.isupper():
return abs(ord('A') - ord(char))
else:
return abs(ord('a') - ord(char))
def add_word(self, word):
curr_level = self.root
for char in word:
index = self.get_index(char)
if not curr_level.children[index]:
curr_level.children[index] = tier()
curr_level = curr_level.children[index]
curr_level.complete_word += 1
def search(self, word):
curr_level = self.root
self.found = list()
self.dfs(word, 0, curr_level)
return True if self.found else False
def dfs(self, word, index, curr_level):
if index == len(word):
if curr_level.complete_word > 0:
self.found.append(True)
return
char = word[index]
if char == '.':
for level in curr_level.children:
if level:
self.dfs(word, index + 1, level)
if self.found:
return
else:
i = self.get_index(char)
if curr_level.children[i]:
self.dfs(word, index + 1, curr_level.children[i])
s = word_dictionary()
s.addWord('at')
s.addWord('and')
s.addWord('an')
s.addWord('at')
s.addWord('add')
print(s) |
class Node:
def __init__(self, val):
self.value = val
self.next = None
class LinkedList(object):
def __init__(self, Node):
self.head = Node
# Insert Node at the front.
def push(self, val):
# Allocate the new node
new_node = Node(val)
# Point the new node's next to head
new_node.next = self.head
# modify the head
self.head = new_node
# Insert Node at the end
def append(self, val):
new_node = Node(4)
# Linked List is empty
if self.head is None:
self.head = new_node
# traverse the list
last = self.head
while last.next is not None:
last = last.next
last.next = new_node
def insertAfterIndex(self, index, value):
if index < 0:
return
# create new node
new_node = Node(value)
prev = None
curr = self.head
for _i in range(index + 1):
prev = curr
curr = curr.next
if prev:
prev.next = new_node
new_node.next = curr
def insertAfterValue(self, value_after, value):
curr = self.head
while curr is not None:
if curr.value == value_after:
break
curr = curr.next
else:
return
new_node = Node(value)
new_node.next = curr.next
curr.next = new_node
def deleteNode(self, key):
temp = self.head
if temp is not None:
if temp.value == key:
self.head = temp.next
temp = None
return
while temp is not None:
if temp.value == key:
break
prev = temp
temp = temp.next
if temp is None:
return
prev.next = temp.next
temp = None
# https://stackoverflow.com/questions/28269643/python-unordered-listwith-nodes-str-method
def __str__(self):
temp = self.head
result = "["
if temp != None:
result += " " + str(temp.value) + " -> "
temp = temp.next
while temp:
result += " " + str(temp.value)
temp = temp.next
if temp:
result += " -> "
else:
result += " -> NULL"
result += " ]"
return result
if __name__ == "__main__":
n1 = Node(1)
n2 = Node(2)
n1.next = n2
n3 = Node(3)
n2.next = n3
linkedList = LinkedList(n1)
print(str(linkedList))
linkedList.push(0)
print(str(linkedList))
linkedList.append(4)
print(str(linkedList))
linkedList.insertAfterIndex(2, 2.5)
print(str(linkedList))
linkedList.insertAfterIndex(1, 1.5)
print(str(linkedList))
linkedList.insertAfterIndex(-1, 0.5)
print(str(linkedList))
linkedList.insertAfterIndex(6, 4.5)
print(str(linkedList))
linkedList.insertAfterValue(1.5, 1.75)
print(str(linkedList))
linkedList.insertAfterValue(0, 0.25)
print(str(linkedList))
linkedList.deleteNode(100)
print(str(linkedList))
# linkedList = LinkedList(None)
# print(str(linkedList))
# linkedList.insertAfterValue(0, 0.25)
# print(str(linkedList))
| class Node:
def __init__(self, val):
self.value = val
self.next = None
class Linkedlist(object):
def __init__(self, Node):
self.head = Node
def push(self, val):
new_node = node(val)
new_node.next = self.head
self.head = new_node
def append(self, val):
new_node = node(4)
if self.head is None:
self.head = new_node
last = self.head
while last.next is not None:
last = last.next
last.next = new_node
def insert_after_index(self, index, value):
if index < 0:
return
new_node = node(value)
prev = None
curr = self.head
for _i in range(index + 1):
prev = curr
curr = curr.next
if prev:
prev.next = new_node
new_node.next = curr
def insert_after_value(self, value_after, value):
curr = self.head
while curr is not None:
if curr.value == value_after:
break
curr = curr.next
else:
return
new_node = node(value)
new_node.next = curr.next
curr.next = new_node
def delete_node(self, key):
temp = self.head
if temp is not None:
if temp.value == key:
self.head = temp.next
temp = None
return
while temp is not None:
if temp.value == key:
break
prev = temp
temp = temp.next
if temp is None:
return
prev.next = temp.next
temp = None
def __str__(self):
temp = self.head
result = '['
if temp != None:
result += ' ' + str(temp.value) + ' -> '
temp = temp.next
while temp:
result += ' ' + str(temp.value)
temp = temp.next
if temp:
result += ' -> '
else:
result += ' -> NULL'
result += ' ]'
return result
if __name__ == '__main__':
n1 = node(1)
n2 = node(2)
n1.next = n2
n3 = node(3)
n2.next = n3
linked_list = linked_list(n1)
print(str(linkedList))
linkedList.push(0)
print(str(linkedList))
linkedList.append(4)
print(str(linkedList))
linkedList.insertAfterIndex(2, 2.5)
print(str(linkedList))
linkedList.insertAfterIndex(1, 1.5)
print(str(linkedList))
linkedList.insertAfterIndex(-1, 0.5)
print(str(linkedList))
linkedList.insertAfterIndex(6, 4.5)
print(str(linkedList))
linkedList.insertAfterValue(1.5, 1.75)
print(str(linkedList))
linkedList.insertAfterValue(0, 0.25)
print(str(linkedList))
linkedList.deleteNode(100)
print(str(linkedList)) |
"""
DoJo Challenge for April 4, 2019 - for experienced Python developers.
A knight's tour is a sequence of moves by a knight on a chessboard such that
all squares are visited once.
Given N, write a function to return the number of knight's tours on an N by
N chessboard.
Source: Daily Coding Problems (https://www.dailycodingproblem.com/)
"""
| """
DoJo Challenge for April 4, 2019 - for experienced Python developers.
A knight's tour is a sequence of moves by a knight on a chessboard such that
all squares are visited once.
Given N, write a function to return the number of knight's tours on an N by
N chessboard.
Source: Daily Coding Problems (https://www.dailycodingproblem.com/)
""" |
"""
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=1500 ] = 0.107
Average Precision (AP) @[ IoU=0.25 | area= all | maxDets=1500 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.251
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=1500 ] = 0.074
Average Precision (AP) @[ IoU=0.50:0.95 | area=verytiny | maxDets=1500 ] = 0.001
Average Precision (AP) @[ IoU=0.50:0.95 | area= tiny | maxDets=1500 ] = 0.067
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1500 ] = 0.230
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1500 ] = 0.332
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.162
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=300 ] = 0.166
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=1500 ] = 0.166
Average Recall (AR) @[ IoU=0.50:0.95 | area=verytiny | maxDets=1500 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= tiny | maxDets=1500 ] = 0.092
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1500 ] = 0.377
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1500 ] = 0.452
Optimal LRP @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.899
Optimal LRP Loc @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.288
Optimal LRP FP @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.512
Optimal LRP FN @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.732
# Class-specific LRP-Optimal Thresholds #
[0.735 0.56 0.556 0.484 0.675 0.451 0.515 0.051]
+----------+-------+---------------+-------+--------------+-------+
| category | AP | category | AP | category | AP |
+----------+-------+---------------+-------+--------------+-------+
| airplane | 0.212 | bridge | 0.021 | storage-tank | 0.197 |
| ship | 0.188 | swimming-pool | 0.080 | vehicle | 0.121 |
| person | 0.039 | wind-mill | 0.000 | None | None |
+----------+-------+---------------+-------+--------------+-------+
+----------+-------+---------------+-------+--------------+-------+
| category | oLRP | category | oLRP | category | oLRP |
+----------+-------+---------------+-------+--------------+-------+
| airplane | 0.806 | bridge | 0.972 | storage-tank | 0.820 |
| ship | 0.833 | swimming-pool | 0.920 | vehicle | 0.884 |
| person | 0.957 | wind-mill | 0.999 | None | None |
+----------+-------+---------------+-------+--------------+-------+
"""
_base_ = [
'../_base_/models/faster_rcnn_r50_fpn_aitod.py',
'../_base_/datasets/aitod_detection.py',
'../_base_/schedules/schedule_1x.py',
'../_base_/default_runtime.py'
]
model = dict(
roi_head=dict(
bbox_head=dict(
reg_decoded_bbox=True,
loss_bbox=dict(type='DIoULoss', loss_weight=10.0))))
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)
# learning policy
checkpoint_config = dict(interval=4) | """
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=1500 ] = 0.107
Average Precision (AP) @[ IoU=0.25 | area= all | maxDets=1500 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.251
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=1500 ] = 0.074
Average Precision (AP) @[ IoU=0.50:0.95 | area=verytiny | maxDets=1500 ] = 0.001
Average Precision (AP) @[ IoU=0.50:0.95 | area= tiny | maxDets=1500 ] = 0.067
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1500 ] = 0.230
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1500 ] = 0.332
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.162
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=300 ] = 0.166
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=1500 ] = 0.166
Average Recall (AR) @[ IoU=0.50:0.95 | area=verytiny | maxDets=1500 ] = 0.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= tiny | maxDets=1500 ] = 0.092
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1500 ] = 0.377
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1500 ] = 0.452
Optimal LRP @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.899
Optimal LRP Loc @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.288
Optimal LRP FP @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.512
Optimal LRP FN @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.732
# Class-specific LRP-Optimal Thresholds #
[0.735 0.56 0.556 0.484 0.675 0.451 0.515 0.051]
+----------+-------+---------------+-------+--------------+-------+
| category | AP | category | AP | category | AP |
+----------+-------+---------------+-------+--------------+-------+
| airplane | 0.212 | bridge | 0.021 | storage-tank | 0.197 |
| ship | 0.188 | swimming-pool | 0.080 | vehicle | 0.121 |
| person | 0.039 | wind-mill | 0.000 | None | None |
+----------+-------+---------------+-------+--------------+-------+
+----------+-------+---------------+-------+--------------+-------+
| category | oLRP | category | oLRP | category | oLRP |
+----------+-------+---------------+-------+--------------+-------+
| airplane | 0.806 | bridge | 0.972 | storage-tank | 0.820 |
| ship | 0.833 | swimming-pool | 0.920 | vehicle | 0.884 |
| person | 0.957 | wind-mill | 0.999 | None | None |
+----------+-------+---------------+-------+--------------+-------+
"""
_base_ = ['../_base_/models/faster_rcnn_r50_fpn_aitod.py', '../_base_/datasets/aitod_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py']
model = dict(roi_head=dict(bbox_head=dict(reg_decoded_bbox=True, loss_bbox=dict(type='DIoULoss', loss_weight=10.0))))
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001)
checkpoint_config = dict(interval=4) |
"""Interop with cc_* rules
These rules are temporary and will be deprecated in the future.
"""
load(":providers.bzl",
"HaskellPackageInfo",
"CcSkylarkApiProviderHacked",
)
load(":set.bzl", "set")
def cc_headers(ctx):
"""Bring in scope the header files of dependencies, if any.
*Internal function - do not use.*
"""
hdrs = [
hdr
# XXX There's gotta be a better way to test the presence of
# CcSkylarkApiProvider.
for dep in ctx.attr.deps if hasattr(dep, "cc")
for hdr in dep.cc.transitive_headers.to_list()
] + [
hdr
# XXX cc_import doesn't produce a cc field, so we emulate it with
# a custom provider.
for dep in ctx.attr.deps if CcSkylarkApiProviderHacked in dep
for hdr in dep[CcSkylarkApiProviderHacked].transitive_headers.to_list()
]
return hdrs, ["-I" + hdr.dirname for hdr in hdrs]
def _cc_import_impl(ctx):
return [
DefaultInfo(files = depset(ctx.attr.shared_library.files)),
CcSkylarkApiProviderHacked(transitive_headers =
depset(transitive = [l.files for l in ctx.attr.hdrs]),
)
]
# XXX This is meant as a drop-in replacement for the native cc_import,
# but it's a temporary hack. It's only necessary because the native
# cc_import does not provide CcSkylarkApiProvider. So we write our own
# rule that does just that. See
# https://github.com/bazelbuild/bazel/issues/4369.
haskell_cc_import = rule(
_cc_import_impl,
attrs = {
"shared_library": attr.label(
# NOTE We do not list all extensions here because .so libraries may
# have numeric suffixes like foo.so.1.2.3, and if they also have
# SONAME with numeric suffix, matching file must be provided, so this
# attributes must accept libraries with almost arbitrary extensions.
# It would be easier if Skylark supported regexps.
allow_files = True,
doc = """A single precompiled shared library.
Bazel ensures it is available to the binary that depends on it
during runtime.
""",
),
"hdrs": attr.label_list(
allow_files = [".h"],
doc = """
The list of header files published by this precompiled library to be
directly included by sources in dependent rules.
""",
)
},
)
"""Imports a prebuilt shared library.
Use this to make `.so`, `.dll`, `.dylib` files residing in external
[external repositories][bazel-ext-repos] available to Haskell rules.
*This rule is temporary replacement for [cc_import][cc_import] and
will be deprecated in the future.*
Example:
```bzl
haskell_cc_import(name = "zlib", shared_library = "@zlib//:lib")
haskell_binary(
name = "crc32sum",
srcs = ["Main.hs"],
deps = [":zlib"],
prebuilt_dependencies = ["base"],
)
```
[bazel-ext-repos]: https://docs.bazel.build/versions/master/external.html
[cc_import]: https://docs.bazel.build/versions/master/be/c-cpp.html#cc_import
"""
def _cc_haskell_import(ctx):
if HaskellPackageInfo in ctx.attr.dep:
return [DefaultInfo(
files = set.to_depset(ctx.attr.dep[HaskellPackageInfo].dynamic_libraries)
)]
else:
fail("{0} has to provide HaskellPackageInfo".format(ctx.attr.dep.label.name))
cc_haskell_import = rule(
_cc_haskell_import,
attrs = {
"dep": attr.label(
doc = "Target providing a `HaskellPackageInfo`, such as `haskell_library`."
),
},
)
"""Exports a Haskell library as a CC library.
Given a [haskell_library](#haskell_library) input, outputs the shared
object file produced as well as the object files it depends on
directly and transitively. This is very useful if you want to link in
a Haskell shared library from `cc_library`.
There is a caveat: this will not provide any shared libraries that
aren't explicitly given to it. This means that if you're using
`prebuilt_dependencies` and relying on GHC to provide those objects,
they will not be present here. You will have to provide those
separately to your `cc_library`. If you're getting
`prebuilt_dependencies` from your toolchain, you will likely want to
extract those and pass them in as well.
*This rule is temporary and only needed until the Bazel C/C++
"sandwich" (see [bazelbuild/bazel#2163][bazel-cpp-sandwich]) is
implemented. This rule will be deprecated in the future.*
Example:
```bzl
haskell_library(
name = "my-lib",
...
)
cc_haskell_import(
name = "my-lib-objects",
dep = ":my-lib",
)
cc_library(
name = "my-cc",
srcs = ["main.c", ":my-lib-objects"],
)
```
[bazel-cpp-sandwich]: https://github.com/bazelbuild/bazel/issues/2163
"""
| """Interop with cc_* rules
These rules are temporary and will be deprecated in the future.
"""
load(':providers.bzl', 'HaskellPackageInfo', 'CcSkylarkApiProviderHacked')
load(':set.bzl', 'set')
def cc_headers(ctx):
"""Bring in scope the header files of dependencies, if any.
*Internal function - do not use.*
"""
hdrs = [hdr for dep in ctx.attr.deps if hasattr(dep, 'cc') for hdr in dep.cc.transitive_headers.to_list()] + [hdr for dep in ctx.attr.deps if CcSkylarkApiProviderHacked in dep for hdr in dep[CcSkylarkApiProviderHacked].transitive_headers.to_list()]
return (hdrs, ['-I' + hdr.dirname for hdr in hdrs])
def _cc_import_impl(ctx):
return [default_info(files=depset(ctx.attr.shared_library.files)), cc_skylark_api_provider_hacked(transitive_headers=depset(transitive=[l.files for l in ctx.attr.hdrs]))]
haskell_cc_import = rule(_cc_import_impl, attrs={'shared_library': attr.label(allow_files=True, doc='A single precompiled shared library.\n\nBazel ensures it is available to the binary that depends on it\nduring runtime.\n'), 'hdrs': attr.label_list(allow_files=['.h'], doc='\n\nThe list of header files published by this precompiled library to be\ndirectly included by sources in dependent rules.\n')})
'Imports a prebuilt shared library.\n\nUse this to make `.so`, `.dll`, `.dylib` files residing in external\n[external repositories][bazel-ext-repos] available to Haskell rules.\n\n*This rule is temporary replacement for [cc_import][cc_import] and\nwill be deprecated in the future.*\n\nExample:\n ```bzl\n haskell_cc_import(name = "zlib", shared_library = "@zlib//:lib")\n\n haskell_binary(\n name = "crc32sum",\n srcs = ["Main.hs"],\n deps = [":zlib"],\n prebuilt_dependencies = ["base"],\n )\n ```\n\n[bazel-ext-repos]: https://docs.bazel.build/versions/master/external.html\n[cc_import]: https://docs.bazel.build/versions/master/be/c-cpp.html#cc_import\n'
def _cc_haskell_import(ctx):
if HaskellPackageInfo in ctx.attr.dep:
return [default_info(files=set.to_depset(ctx.attr.dep[HaskellPackageInfo].dynamic_libraries))]
else:
fail('{0} has to provide HaskellPackageInfo'.format(ctx.attr.dep.label.name))
cc_haskell_import = rule(_cc_haskell_import, attrs={'dep': attr.label(doc='Target providing a `HaskellPackageInfo`, such as `haskell_library`.')})
'Exports a Haskell library as a CC library.\n\nGiven a [haskell_library](#haskell_library) input, outputs the shared\nobject file produced as well as the object files it depends on\ndirectly and transitively. This is very useful if you want to link in\na Haskell shared library from `cc_library`.\n\nThere is a caveat: this will not provide any shared libraries that\naren\'t explicitly given to it. This means that if you\'re using\n`prebuilt_dependencies` and relying on GHC to provide those objects,\nthey will not be present here. You will have to provide those\nseparately to your `cc_library`. If you\'re getting\n`prebuilt_dependencies` from your toolchain, you will likely want to\nextract those and pass them in as well.\n\n*This rule is temporary and only needed until the Bazel C/C++\n"sandwich" (see [bazelbuild/bazel#2163][bazel-cpp-sandwich]) is\nimplemented. This rule will be deprecated in the future.*\n\nExample:\n ```bzl\n haskell_library(\n name = "my-lib",\n ...\n )\n\n cc_haskell_import(\n name = "my-lib-objects",\n dep = ":my-lib",\n )\n\n cc_library(\n name = "my-cc",\n srcs = ["main.c", ":my-lib-objects"],\n )\n ```\n\n[bazel-cpp-sandwich]: https://github.com/bazelbuild/bazel/issues/2163\n\n' |
# Complete the compareTriplets function below.
def compareTriplets(a, b):
pointa = 0
pointb = 0
for i in range(0, 3):
if a[i] > b[i]:
pointa += 1
elif a[i] < b[i]:
pointb += 1
return (pointa, pointb)
if __name__ == '__main__':
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))
result = compareTriplets(a, b)
print(result)
| def compare_triplets(a, b):
pointa = 0
pointb = 0
for i in range(0, 3):
if a[i] > b[i]:
pointa += 1
elif a[i] < b[i]:
pointb += 1
return (pointa, pointb)
if __name__ == '__main__':
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))
result = compare_triplets(a, b)
print(result) |
def fact(n):
if n==1:
return 1
return n*fact(n-1)
print(fact(2))
| def fact(n):
if n == 1:
return 1
return n * fact(n - 1)
print(fact(2)) |
"""Decrease a key in of a Binary Heap """
class Heap:
def __init__(self, cap):
self.capacity = cap
self.arr = [0 for _ in range(cap)]
self.size = 0
def insert(self, val):
if self.capacity > self.size:
self.size += 1
self.arr[self.size - 1] = val
else:
print("Heap is Full")
return
def leftChild(self, pos):
return 2 * pos
# Function to return the position of
# the right child for the node currently
# at pos
def rightChild(self, pos):
return (2 * pos) + 1
# Function that returns true if the passed
# node is a leaf node
def isLeaf(self, pos):
if pos >= (self.size // 2) and pos <= self.size:
return True
return False
def swap(self, fpos, spos):
self.arr[fpos], self.arr[spos] = self.arr[spos], self.arr[fpos]
def heapify(self, pos):
# If the node is a non-leaf node and greater
# than any of its child
if not self.isLeaf(pos):
if (self.arr[pos] > self.arr[self.leftChild(pos)] or
self.arr[pos] > self.arr[self.rightChild(pos)]):
# Swap with the left child and heapify
# the left child
if self.arr[self.leftChild(pos)] < self.arr[self.rightChild(pos)]:
self.swap(pos, self.leftChild(pos))
self.heapify(self.leftChild(pos))
# Swap with the right child and heapify
# the right child
else:
self.swap(pos, self.rightChild(pos))
self.heapify(self.rightChild(pos))
def decrease_key(self, new_val, index):
self.arr[index] = new_val
temp = (index-1)//2
while index != 0 and self.arr[index] < self.arr[temp]:
self.arr[index], self.arr[temp] = self.arr[temp], self.arr[index]
index = temp
temp = (temp-1)//2
return
def extract_min(self):
if self.size == 0:
return
if self.size == 1:
a = self.arr[0]
self.arr[0] = 0
self.size -= 1
return a
a = self.arr[0]
self.arr[0], self.arr[self.size-1] = self.arr[self.size-1], self.arr[0]
self.arr[self.size-1] = 0
self.size -= 1
self.heapify(0)
return a
def delete_key(self, index):
self.decrease_key(-1000, index)
self.extract_min()
return
def build_heap(arr):
h = Heap(len(arr))
for i in range(len(arr)):
h.insert(arr[i])
print(h.arr)
for i in range((len(arr)-2)//2, -1, -1):
h.heapify(i)
return h.arr
def main():
h = Heap(6)
h.insert(10)
h.insert(20)
h.insert(40)
h.insert(80)
h.insert(100)
h.insert(70)
h.heapify(0)
print(h.arr)
h.decrease_key(5, 3)
print(h.arr)
h.delete_key(3)
print(h.arr)
n_arr = [10, 5, 20, 2, 4, 8]
print("New heap: ", build_heap(n_arr))
if __name__ == "__main__":
main()
| """Decrease a key in of a Binary Heap """
class Heap:
def __init__(self, cap):
self.capacity = cap
self.arr = [0 for _ in range(cap)]
self.size = 0
def insert(self, val):
if self.capacity > self.size:
self.size += 1
self.arr[self.size - 1] = val
else:
print('Heap is Full')
return
def left_child(self, pos):
return 2 * pos
def right_child(self, pos):
return 2 * pos + 1
def is_leaf(self, pos):
if pos >= self.size // 2 and pos <= self.size:
return True
return False
def swap(self, fpos, spos):
(self.arr[fpos], self.arr[spos]) = (self.arr[spos], self.arr[fpos])
def heapify(self, pos):
if not self.isLeaf(pos):
if self.arr[pos] > self.arr[self.leftChild(pos)] or self.arr[pos] > self.arr[self.rightChild(pos)]:
if self.arr[self.leftChild(pos)] < self.arr[self.rightChild(pos)]:
self.swap(pos, self.leftChild(pos))
self.heapify(self.leftChild(pos))
else:
self.swap(pos, self.rightChild(pos))
self.heapify(self.rightChild(pos))
def decrease_key(self, new_val, index):
self.arr[index] = new_val
temp = (index - 1) // 2
while index != 0 and self.arr[index] < self.arr[temp]:
(self.arr[index], self.arr[temp]) = (self.arr[temp], self.arr[index])
index = temp
temp = (temp - 1) // 2
return
def extract_min(self):
if self.size == 0:
return
if self.size == 1:
a = self.arr[0]
self.arr[0] = 0
self.size -= 1
return a
a = self.arr[0]
(self.arr[0], self.arr[self.size - 1]) = (self.arr[self.size - 1], self.arr[0])
self.arr[self.size - 1] = 0
self.size -= 1
self.heapify(0)
return a
def delete_key(self, index):
self.decrease_key(-1000, index)
self.extract_min()
return
def build_heap(arr):
h = heap(len(arr))
for i in range(len(arr)):
h.insert(arr[i])
print(h.arr)
for i in range((len(arr) - 2) // 2, -1, -1):
h.heapify(i)
return h.arr
def main():
h = heap(6)
h.insert(10)
h.insert(20)
h.insert(40)
h.insert(80)
h.insert(100)
h.insert(70)
h.heapify(0)
print(h.arr)
h.decrease_key(5, 3)
print(h.arr)
h.delete_key(3)
print(h.arr)
n_arr = [10, 5, 20, 2, 4, 8]
print('New heap: ', build_heap(n_arr))
if __name__ == '__main__':
main() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.