content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
#
# PySNMP MIB module Juniper-HOST-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-HOST-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:02:51 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
juniMibs, = mibBuilder.importSymbols("Juniper-MIBs", "juniMibs")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
ModuleIdentity, Counter32, iso, Integer32, MibIdentifier, Bits, NotificationType, TimeTicks, ObjectIdentity, Unsigned32, Counter64, IpAddress, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "Counter32", "iso", "Integer32", "MibIdentifier", "Bits", "NotificationType", "TimeTicks", "ObjectIdentity", "Unsigned32", "Counter64", "IpAddress", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus")
juniHostMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33))
juniHostMIB.setRevisions(('2004-11-26 00:00', '2002-09-16 21:44', '2001-05-07 17:02', '2000-01-26 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: juniHostMIB.setRevisionsDescriptions(('Added Tftp option in juniHostProtocol object.', 'Replaced Unisphere names with Juniper names.', 'Increase the max lenght of the host name.', 'Initial version of this MIB module.',))
if mibBuilder.loadTexts: juniHostMIB.setLastUpdated('200209162144Z')
if mibBuilder.loadTexts: juniHostMIB.setOrganization('Juniper Networks, Inc.')
if mibBuilder.loadTexts: juniHostMIB.setContactInfo(' Juniper Networks, Inc. Postal: 10 Technology Park Road Westford, MA 01886-3146 USA Tel: +1 978 589 5800 E-mail: mib@Juniper.net')
if mibBuilder.loadTexts: juniHostMIB.setDescription('The host configuration MIB for Juniper Networks enterprise.')
juniHostObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1))
juniHost = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1))
juniHostTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1), )
if mibBuilder.loadTexts: juniHostTable.setStatus('current')
if mibBuilder.loadTexts: juniHostTable.setDescription('The entries in this table describe host configuration information.')
juniHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1), ).setIndexNames((1, "Juniper-HOST-MIB", "juniHostName"))
if mibBuilder.loadTexts: juniHostEntry.setStatus('current')
if mibBuilder.loadTexts: juniHostEntry.setDescription('An entry describing the configuration of a host.')
juniHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 40))).setMaxAccess("readonly")
if mibBuilder.loadTexts: juniHostName.setStatus('current')
if mibBuilder.loadTexts: juniHostName.setDescription('The hostname identifier associated with this host entry.')
juniHostIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 2), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: juniHostIpAddress.setStatus('current')
if mibBuilder.loadTexts: juniHostIpAddress.setDescription('The IP address associated with this host entry.')
juniHostProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("juniHostFtp", 1), ("juniHostTftp", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: juniHostProtocol.setStatus('current')
if mibBuilder.loadTexts: juniHostProtocol.setDescription('The file transfer protocol associated with this host entry.')
juniHostUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: juniHostUserName.setStatus('current')
if mibBuilder.loadTexts: juniHostUserName.setDescription('The username associated with this host entry.')
juniHostUserPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 25))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: juniHostUserPassword.setStatus('current')
if mibBuilder.loadTexts: juniHostUserPassword.setDescription('The password associated with this host entry. Reading this object returns a null DisplayString to avoid security breaches. However, a null string is not accepted for create or write operations.')
juniHostRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: juniHostRowStatus.setStatus('current')
if mibBuilder.loadTexts: juniHostRowStatus.setDescription("Controls creation/deletion of entries in this table. Only the values 'createAndGo' and 'destroy' may be SET.")
juniHostMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4))
juniHostMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 1))
juniHostMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 2))
juniHostCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 1, 1)).setObjects(("Juniper-HOST-MIB", "juniHostGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniHostCompliance = juniHostCompliance.setStatus('current')
if mibBuilder.loadTexts: juniHostCompliance.setDescription('The compliance statement for systems supporting host configuration.')
juniHostGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 2, 1)).setObjects(("Juniper-HOST-MIB", "juniHostName"), ("Juniper-HOST-MIB", "juniHostIpAddress"), ("Juniper-HOST-MIB", "juniHostProtocol"), ("Juniper-HOST-MIB", "juniHostUserName"), ("Juniper-HOST-MIB", "juniHostUserPassword"), ("Juniper-HOST-MIB", "juniHostRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juniHostGroup = juniHostGroup.setStatus('current')
if mibBuilder.loadTexts: juniHostGroup.setDescription('The basic collection of objects providing management of host configuration functionality in a Juniper product.')
mibBuilder.exportSymbols("Juniper-HOST-MIB", juniHostObjects=juniHostObjects, juniHostMIBConformance=juniHostMIBConformance, juniHostIpAddress=juniHostIpAddress, juniHostGroup=juniHostGroup, juniHostProtocol=juniHostProtocol, juniHostTable=juniHostTable, juniHostUserPassword=juniHostUserPassword, juniHostEntry=juniHostEntry, juniHostMIB=juniHostMIB, juniHostName=juniHostName, juniHost=juniHost, juniHostUserName=juniHostUserName, PYSNMP_MODULE_ID=juniHostMIB, juniHostRowStatus=juniHostRowStatus, juniHostMIBGroups=juniHostMIBGroups, juniHostCompliance=juniHostCompliance, juniHostMIBCompliances=juniHostMIBCompliances)
| (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_range_constraint, single_value_constraint, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint')
(juni_mibs,) = mibBuilder.importSymbols('Juniper-MIBs', 'juniMibs')
(module_compliance, object_group, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'ObjectGroup', 'NotificationGroup')
(module_identity, counter32, iso, integer32, mib_identifier, bits, notification_type, time_ticks, object_identity, unsigned32, counter64, ip_address, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'Counter32', 'iso', 'Integer32', 'MibIdentifier', 'Bits', 'NotificationType', 'TimeTicks', 'ObjectIdentity', 'Unsigned32', 'Counter64', 'IpAddress', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn')
(textual_convention, display_string, row_status) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus')
juni_host_mib = module_identity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33))
juniHostMIB.setRevisions(('2004-11-26 00:00', '2002-09-16 21:44', '2001-05-07 17:02', '2000-01-26 00:00'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
juniHostMIB.setRevisionsDescriptions(('Added Tftp option in juniHostProtocol object.', 'Replaced Unisphere names with Juniper names.', 'Increase the max lenght of the host name.', 'Initial version of this MIB module.'))
if mibBuilder.loadTexts:
juniHostMIB.setLastUpdated('200209162144Z')
if mibBuilder.loadTexts:
juniHostMIB.setOrganization('Juniper Networks, Inc.')
if mibBuilder.loadTexts:
juniHostMIB.setContactInfo(' Juniper Networks, Inc. Postal: 10 Technology Park Road Westford, MA 01886-3146 USA Tel: +1 978 589 5800 E-mail: mib@Juniper.net')
if mibBuilder.loadTexts:
juniHostMIB.setDescription('The host configuration MIB for Juniper Networks enterprise.')
juni_host_objects = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1))
juni_host = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1))
juni_host_table = mib_table((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1))
if mibBuilder.loadTexts:
juniHostTable.setStatus('current')
if mibBuilder.loadTexts:
juniHostTable.setDescription('The entries in this table describe host configuration information.')
juni_host_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1)).setIndexNames((1, 'Juniper-HOST-MIB', 'juniHostName'))
if mibBuilder.loadTexts:
juniHostEntry.setStatus('current')
if mibBuilder.loadTexts:
juniHostEntry.setDescription('An entry describing the configuration of a host.')
juni_host_name = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 40))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
juniHostName.setStatus('current')
if mibBuilder.loadTexts:
juniHostName.setDescription('The hostname identifier associated with this host entry.')
juni_host_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 2), ip_address()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
juniHostIpAddress.setStatus('current')
if mibBuilder.loadTexts:
juniHostIpAddress.setDescription('The IP address associated with this host entry.')
juni_host_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('juniHostFtp', 1), ('juniHostTftp', 2)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
juniHostProtocol.setStatus('current')
if mibBuilder.loadTexts:
juniHostProtocol.setDescription('The file transfer protocol associated with this host entry.')
juni_host_user_name = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 20))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
juniHostUserName.setStatus('current')
if mibBuilder.loadTexts:
juniHostUserName.setDescription('The username associated with this host entry.')
juni_host_user_password = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(0, 25))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
juniHostUserPassword.setStatus('current')
if mibBuilder.loadTexts:
juniHostUserPassword.setDescription('The password associated with this host entry. Reading this object returns a null DisplayString to avoid security breaches. However, a null string is not accepted for create or write operations.')
juni_host_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 1, 1, 1, 1, 6), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
juniHostRowStatus.setStatus('current')
if mibBuilder.loadTexts:
juniHostRowStatus.setDescription("Controls creation/deletion of entries in this table. Only the values 'createAndGo' and 'destroy' may be SET.")
juni_host_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4))
juni_host_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 1))
juni_host_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 2))
juni_host_compliance = module_compliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 1, 1)).setObjects(('Juniper-HOST-MIB', 'juniHostGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_host_compliance = juniHostCompliance.setStatus('current')
if mibBuilder.loadTexts:
juniHostCompliance.setDescription('The compliance statement for systems supporting host configuration.')
juni_host_group = object_group((1, 3, 6, 1, 4, 1, 4874, 2, 2, 33, 4, 2, 1)).setObjects(('Juniper-HOST-MIB', 'juniHostName'), ('Juniper-HOST-MIB', 'juniHostIpAddress'), ('Juniper-HOST-MIB', 'juniHostProtocol'), ('Juniper-HOST-MIB', 'juniHostUserName'), ('Juniper-HOST-MIB', 'juniHostUserPassword'), ('Juniper-HOST-MIB', 'juniHostRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
juni_host_group = juniHostGroup.setStatus('current')
if mibBuilder.loadTexts:
juniHostGroup.setDescription('The basic collection of objects providing management of host configuration functionality in a Juniper product.')
mibBuilder.exportSymbols('Juniper-HOST-MIB', juniHostObjects=juniHostObjects, juniHostMIBConformance=juniHostMIBConformance, juniHostIpAddress=juniHostIpAddress, juniHostGroup=juniHostGroup, juniHostProtocol=juniHostProtocol, juniHostTable=juniHostTable, juniHostUserPassword=juniHostUserPassword, juniHostEntry=juniHostEntry, juniHostMIB=juniHostMIB, juniHostName=juniHostName, juniHost=juniHost, juniHostUserName=juniHostUserName, PYSNMP_MODULE_ID=juniHostMIB, juniHostRowStatus=juniHostRowStatus, juniHostMIBGroups=juniHostMIBGroups, juniHostCompliance=juniHostCompliance, juniHostMIBCompliances=juniHostMIBCompliances) |
##def do_twice(f):
# f()
# f()
#
#def print_spam():
# print('spam')
#
#do_twice(print_spam)
def do_twice(dt_function,dt_value):
dt_function(dt_value)*2
thing = "Sausage, Egg and Spam"
do_twice(print,"thing")
| def do_twice(dt_function, dt_value):
dt_function(dt_value) * 2
thing = 'Sausage, Egg and Spam'
do_twice(print, 'thing') |
class Tile:
map_word = "Island beach"
def describe(self):
print("The beach is really quiet and you can hear and see the seagulls "
"on the sea.\n")
def action(self, player, do):
print("What is this gibberish?")
def leave(self, player, direction):
if direction == "e":
print("You can't go back by swimming, that part is full of "
"electric eels.\n")
return False
elif direction == "s":
print("I'm afraid I can't let you go there Dave.")
return False
elif direction == "w":
print("The sandy beach is transforming into big rocks but it looks "
"like you are able to climb them.\n"
"Just be careful because they are a bit slipery.")
return True
else:
return True
| class Tile:
map_word = 'Island beach'
def describe(self):
print('The beach is really quiet and you can hear and see the seagulls on the sea.\n')
def action(self, player, do):
print('What is this gibberish?')
def leave(self, player, direction):
if direction == 'e':
print("You can't go back by swimming, that part is full of electric eels.\n")
return False
elif direction == 's':
print("I'm afraid I can't let you go there Dave.")
return False
elif direction == 'w':
print('The sandy beach is transforming into big rocks but it looks like you are able to climb them.\nJust be careful because they are a bit slipery.')
return True
else:
return True |
f = maxsumit
assert f([]) == []
assert f([-1]) == []
assert f([0]) == []
assert f([1]) == [1]
assert f([1, 0]) == [1]
assert f([0, 1]) == [0, 1]
assert f([0, 1, 0]) == [0, 1]
assert f([2]) == [2]
assert f([2, -1]) == [2]
assert f([-1, 2]) == [2]
assert f([-1, 2, -1]) == [2]
assert f([2, -1, 3]) == [2, -1, 3]
assert f([2, -1, 3, -1]) == [2, -1, 3]
assert f([-1, 2, -1, 3]) == [2, -1, 3]
assert f([-1, 2, -1, 3, -1]) == [2, -1, 3]
assert f([-1, 1, 2, -5, -6]) == [1,2]
| f = maxsumit
assert f([]) == []
assert f([-1]) == []
assert f([0]) == []
assert f([1]) == [1]
assert f([1, 0]) == [1]
assert f([0, 1]) == [0, 1]
assert f([0, 1, 0]) == [0, 1]
assert f([2]) == [2]
assert f([2, -1]) == [2]
assert f([-1, 2]) == [2]
assert f([-1, 2, -1]) == [2]
assert f([2, -1, 3]) == [2, -1, 3]
assert f([2, -1, 3, -1]) == [2, -1, 3]
assert f([-1, 2, -1, 3]) == [2, -1, 3]
assert f([-1, 2, -1, 3, -1]) == [2, -1, 3]
assert f([-1, 1, 2, -5, -6]) == [1, 2] |
field=[[0]*100 for i in range(100)]
n,m=map(int,input().split())
for i in range(n):
x,y,a,b=map(int,input().split())
for j in range(x-1,a):
for k in range(y-1,b):
field[j][k]+=1
a=0
for i in range(100):
for j in range(100):
if field[i][j]>m:a+=1
print(a) | field = [[0] * 100 for i in range(100)]
(n, m) = map(int, input().split())
for i in range(n):
(x, y, a, b) = map(int, input().split())
for j in range(x - 1, a):
for k in range(y - 1, b):
field[j][k] += 1
a = 0
for i in range(100):
for j in range(100):
if field[i][j] > m:
a += 1
print(a) |
class oprand:
def init (self):
self.props = {}
def add (self, name, value):
self.props[name] = value
def get (self, name):
return self.props.get(name, "")
def remove (self, name):
return self.props.pop(name)
def parse (self, stream):
pass
def run (self):
pass
def build (self):
pass
__init__ = init
| class Oprand:
def init(self):
self.props = {}
def add(self, name, value):
self.props[name] = value
def get(self, name):
return self.props.get(name, '')
def remove(self, name):
return self.props.pop(name)
def parse(self, stream):
pass
def run(self):
pass
def build(self):
pass
__init__ = init |
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
print(' Hello world ')
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
user_input = input('What is your name?')
reply = 'Nice to meet you ' + user_input
print(reply)
| print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
print(' Hello world ')
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
user_input = input('What is your name?')
reply = 'Nice to meet you ' + user_input
print(reply) |
def get_next_sparse(num):
str_bin = str(bin(num))[2:]
new_str_bin = ""
prev_digit = None
flag = False
for i, digit in enumerate(str_bin):
if digit == '1' and prev_digit == '1':
flag = True
if flag:
new_str_bin += '0' * (len(str_bin) - i)
break
else:
new_str_bin += digit
prev_digit = digit
if flag:
if new_str_bin[0] == '1':
new_str_bin = '10' + new_str_bin[1:]
else:
new_str_bin = '1' + new_str_bin
new_num = int(new_str_bin, base=2)
return new_num
# Tests
assert get_next_sparse(21) == 21
assert get_next_sparse(25) == 32
assert get_next_sparse(255) == 256
| def get_next_sparse(num):
str_bin = str(bin(num))[2:]
new_str_bin = ''
prev_digit = None
flag = False
for (i, digit) in enumerate(str_bin):
if digit == '1' and prev_digit == '1':
flag = True
if flag:
new_str_bin += '0' * (len(str_bin) - i)
break
else:
new_str_bin += digit
prev_digit = digit
if flag:
if new_str_bin[0] == '1':
new_str_bin = '10' + new_str_bin[1:]
else:
new_str_bin = '1' + new_str_bin
new_num = int(new_str_bin, base=2)
return new_num
assert get_next_sparse(21) == 21
assert get_next_sparse(25) == 32
assert get_next_sparse(255) == 256 |
__author__ = 'mcxiaoke'
def gen():
for i in range(4):
yield i
gene=gen()
print(type(gene))
print(gene.next())
print(gene.next())
print(gene.next())
re=iter(range(10))
try:
#for i in range(5):
for i in range(20):
print(re.next())
except StopIteration as e:
print('here is the end: ',i)
else:
print("next")
finally:
print("finally")
print('hahahah') | __author__ = 'mcxiaoke'
def gen():
for i in range(4):
yield i
gene = gen()
print(type(gene))
print(gene.next())
print(gene.next())
print(gene.next())
re = iter(range(10))
try:
for i in range(20):
print(re.next())
except StopIteration as e:
print('here is the end: ', i)
else:
print('next')
finally:
print('finally')
print('hahahah') |
l = list(range(101))
def even(i):
return i % 2 == 0
print(list(filter(even, l)))
def fake_filter(function, list):
list_new=[]
for n in list:
if function(n) is True:
list_new.append(n)
return list_new
print(fake_filter(even, l))
| l = list(range(101))
def even(i):
return i % 2 == 0
print(list(filter(even, l)))
def fake_filter(function, list):
list_new = []
for n in list:
if function(n) is True:
list_new.append(n)
return list_new
print(fake_filter(even, l)) |
#
# PySNMP MIB module BCCUSTOM-OPR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BCCUSTOM-OPR-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:36:29 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")
ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint")
fcSwitch, = mibBuilder.importSymbols("Brocade-REG-MIB", "fcSwitch")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Unsigned32, Bits, ModuleIdentity, Counter32, Gauge32, MibIdentifier, TimeTicks, iso, Integer32, Counter64, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Bits", "ModuleIdentity", "Counter32", "Gauge32", "MibIdentifier", "TimeTicks", "iso", "Integer32", "Counter64", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "NotificationType")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
bcCustomOperation = ModuleIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52))
bcCustomOperation.setRevisions(('2011-12-19 10:30',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: bcCustomOperation.setRevisionsDescriptions(('Initial version of this module.',))
if mibBuilder.loadTexts: bcCustomOperation.setLastUpdated('200807291830Z')
if mibBuilder.loadTexts: bcCustomOperation.setOrganization('Brocade Communications Systems, Inc.')
if mibBuilder.loadTexts: bcCustomOperation.setContactInfo('Customer Support Group Brocade Communications Systems, 120 Holger Way, San Jose, CA 95134 U.S.A Tel: +1-408-333-6061 Email: support@Brocade.COM WEB: www.brocade.com.')
if mibBuilder.loadTexts: bcCustomOperation.setDescription('The MIB module is to get the details of T8000 Embedded switch. copyright (c) 2011-2018 Brocade Communications Systems, Inc. All rights reserved.')
hwinfospsaveCmd = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 1))
if mibBuilder.loadTexts: hwinfospsaveCmd.setStatus('current')
if mibBuilder.loadTexts: hwinfospsaveCmd.setDescription('The OID subtree for supportsave operation.')
hwinfospsaveSet = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 1024))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwinfospsaveSet.setStatus('current')
if mibBuilder.loadTexts: hwinfospsaveSet.setDescription("Parameter required for FC switch to execute supportsave operation: FTP Server IP Type: IPV4/IPV6 Server IP address: IP address of FTP server FTP User: FTP server username to login FTP Code: password of FTP server Command: which is executed on the FC switch board. Filename: The name of info package after command executed. Used: Trigger 'supportsave' command when received a trap of FC switch work abnormally.")
hwinfospsaveGet = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("success", 0), ("ftperror", 1), ("progressing", 2), ("systemerror", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwinfospsaveGet.setStatus('current')
if mibBuilder.loadTexts: hwinfospsaveGet.setDescription('Get the state how the triggered Command executed. Command: which is executed on the FC switch board. Used: Get state of Hwinfospsaveget execute. 0x0: command execute success ,file already transferred to FTP server 0x1: FTP server connect Error 0x2: progressing 0x3: System Error.')
hwUpdateFilecmd = ObjectIdentity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2))
if mibBuilder.loadTexts: hwUpdateFilecmd.setStatus('current')
if mibBuilder.loadTexts: hwUpdateFilecmd.setDescription('The OID subtree for Firmware download operation.')
hwUpdateFile = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 1024))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hwUpdateFile.setStatus('current')
if mibBuilder.loadTexts: hwUpdateFile.setDescription("Does Firmware upgrade of the FC switch. Use a space between each attribute separated. 1.The type, the current must be IPV4 2.ftp Host ip 3.ftp User name 4.ftp Password 5.The upgrade of the software loaded, you can bear with the path. Example: 'IPV4 172.16.128.1 user password xcbf.cc'")
hwUpdateFileInfo = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwUpdateFileInfo.setStatus('current')
if mibBuilder.loadTexts: hwUpdateFileInfo.setDescription("For getting firmware upgrade and progress status. Format is 1. INT32 iStatus 'Update state' 2. UINT8 ucResv[2] 'Reserved' Example: 1. Success - Firmwaredownload completed successfully 2. Inprogress - Firmwaredownload is going on 3. Another Firmware download in progress - When another download is going on 4. Invalid URI - Input URI is in incorrect format 5. Failure - Firmwaredownload is failed")
hwSoftwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 4096))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hwSoftwareVersion.setStatus('current')
if mibBuilder.loadTexts: hwSoftwareVersion.setDescription("Software firmware version information. Format is 1. UINT32 hwSoftwareVersionNum 'The number of software' 'Version of the software structure' 2. UINT8 ucNameLen 'Software name length' 3. char ucName[ucNameLen] 'Software Name' Example (XCBC board) are as follows 00.00.00.02. --- The number of software 03. --- The length of the current version of the software (Firmware 1) 32.31.38. --- The current version of the software 218 (Firmware 1) 03. --- The length of the current version of the software (Firmware 2) 32.31.38. --- The current version of the software 218 (Firmware 2")
mibBuilder.exportSymbols("BCCUSTOM-OPR-MIB", hwinfospsaveGet=hwinfospsaveGet, hwinfospsaveSet=hwinfospsaveSet, bcCustomOperation=bcCustomOperation, hwinfospsaveCmd=hwinfospsaveCmd, hwUpdateFileInfo=hwUpdateFileInfo, PYSNMP_MODULE_ID=bcCustomOperation, hwUpdateFile=hwUpdateFile, hwUpdateFilecmd=hwUpdateFilecmd, hwSoftwareVersion=hwSoftwareVersion)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, single_value_constraint, value_size_constraint, constraints_union, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint')
(fc_switch,) = mibBuilder.importSymbols('Brocade-REG-MIB', 'fcSwitch')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(unsigned32, bits, module_identity, counter32, gauge32, mib_identifier, time_ticks, iso, integer32, counter64, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'Bits', 'ModuleIdentity', 'Counter32', 'Gauge32', 'MibIdentifier', 'TimeTicks', 'iso', 'Integer32', 'Counter64', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'NotificationType')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
bc_custom_operation = module_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52))
bcCustomOperation.setRevisions(('2011-12-19 10:30',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
bcCustomOperation.setRevisionsDescriptions(('Initial version of this module.',))
if mibBuilder.loadTexts:
bcCustomOperation.setLastUpdated('200807291830Z')
if mibBuilder.loadTexts:
bcCustomOperation.setOrganization('Brocade Communications Systems, Inc.')
if mibBuilder.loadTexts:
bcCustomOperation.setContactInfo('Customer Support Group Brocade Communications Systems, 120 Holger Way, San Jose, CA 95134 U.S.A Tel: +1-408-333-6061 Email: support@Brocade.COM WEB: www.brocade.com.')
if mibBuilder.loadTexts:
bcCustomOperation.setDescription('The MIB module is to get the details of T8000 Embedded switch. copyright (c) 2011-2018 Brocade Communications Systems, Inc. All rights reserved.')
hwinfospsave_cmd = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 1))
if mibBuilder.loadTexts:
hwinfospsaveCmd.setStatus('current')
if mibBuilder.loadTexts:
hwinfospsaveCmd.setDescription('The OID subtree for supportsave operation.')
hwinfospsave_set = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 1024))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hwinfospsaveSet.setStatus('current')
if mibBuilder.loadTexts:
hwinfospsaveSet.setDescription("Parameter required for FC switch to execute supportsave operation: FTP Server IP Type: IPV4/IPV6 Server IP address: IP address of FTP server FTP User: FTP server username to login FTP Code: password of FTP server Command: which is executed on the FC switch board. Filename: The name of info package after command executed. Used: Trigger 'supportsave' command when received a trap of FC switch work abnormally.")
hwinfospsave_get = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('success', 0), ('ftperror', 1), ('progressing', 2), ('systemerror', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwinfospsaveGet.setStatus('current')
if mibBuilder.loadTexts:
hwinfospsaveGet.setDescription('Get the state how the triggered Command executed. Command: which is executed on the FC switch board. Used: Get state of Hwinfospsaveget execute. 0x0: command execute success ,file already transferred to FTP server 0x1: FTP server connect Error 0x2: progressing 0x3: System Error.')
hw_update_filecmd = object_identity((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2))
if mibBuilder.loadTexts:
hwUpdateFilecmd.setStatus('current')
if mibBuilder.loadTexts:
hwUpdateFilecmd.setDescription('The OID subtree for Firmware download operation.')
hw_update_file = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 1024))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hwUpdateFile.setStatus('current')
if mibBuilder.loadTexts:
hwUpdateFile.setDescription("Does Firmware upgrade of the FC switch. Use a space between each attribute separated. 1.The type, the current must be IPV4 2.ftp Host ip 3.ftp User name 4.ftp Password 5.The upgrade of the software loaded, you can bear with the path. Example: 'IPV4 172.16.128.1 user password xcbf.cc'")
hw_update_file_info = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 1024))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwUpdateFileInfo.setStatus('current')
if mibBuilder.loadTexts:
hwUpdateFileInfo.setDescription("For getting firmware upgrade and progress status. Format is 1. INT32 iStatus 'Update state' 2. UINT8 ucResv[2] 'Reserved' Example: 1. Success - Firmwaredownload completed successfully 2. Inprogress - Firmwaredownload is going on 3. Another Firmware download in progress - When another download is going on 4. Invalid URI - Input URI is in incorrect format 5. Failure - Firmwaredownload is failed")
hw_software_version = mib_scalar((1, 3, 6, 1, 4, 1, 1588, 2, 1, 1, 52, 2, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 4096))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hwSoftwareVersion.setStatus('current')
if mibBuilder.loadTexts:
hwSoftwareVersion.setDescription("Software firmware version information. Format is 1. UINT32 hwSoftwareVersionNum 'The number of software' 'Version of the software structure' 2. UINT8 ucNameLen 'Software name length' 3. char ucName[ucNameLen] 'Software Name' Example (XCBC board) are as follows 00.00.00.02. --- The number of software 03. --- The length of the current version of the software (Firmware 1) 32.31.38. --- The current version of the software 218 (Firmware 1) 03. --- The length of the current version of the software (Firmware 2) 32.31.38. --- The current version of the software 218 (Firmware 2")
mibBuilder.exportSymbols('BCCUSTOM-OPR-MIB', hwinfospsaveGet=hwinfospsaveGet, hwinfospsaveSet=hwinfospsaveSet, bcCustomOperation=bcCustomOperation, hwinfospsaveCmd=hwinfospsaveCmd, hwUpdateFileInfo=hwUpdateFileInfo, PYSNMP_MODULE_ID=bcCustomOperation, hwUpdateFile=hwUpdateFile, hwUpdateFilecmd=hwUpdateFilecmd, hwSoftwareVersion=hwSoftwareVersion) |
def findDecision(obj): #obj[0]: Driving_to, obj[1]: Passanger, obj[2]: Weather, obj[3]: Temperature, obj[4]: Time, obj[5]: Coupon, obj[6]: Coupon_validity, obj[7]: Gender, obj[8]: Age, obj[9]: Maritalstatus, obj[10]: Children, obj[11]: Education, obj[12]: Occupation, obj[13]: Income, obj[14]: Bar, obj[15]: Coffeehouse, obj[16]: Restaurantlessthan20, obj[17]: Restaurant20to50, obj[18]: Direction_same, obj[19]: Distance
# {"feature": "Coupon", "instances": 85, "metric_value": 0.9465, "depth": 1}
if obj[5]>0:
# {"feature": "Occupation", "instances": 69, "metric_value": 0.8281, "depth": 2}
if obj[12]<=6:
# {"feature": "Age", "instances": 40, "metric_value": 0.6098, "depth": 3}
if obj[8]<=2:
# {"feature": "Maritalstatus", "instances": 22, "metric_value": 0.2668, "depth": 4}
if obj[9]<=1:
return 'True'
elif obj[9]>1:
return 'False'
else: return 'False'
elif obj[8]>2:
# {"feature": "Restaurant20to50", "instances": 18, "metric_value": 0.8524, "depth": 4}
if obj[17]<=1.0:
# {"feature": "Income", "instances": 12, "metric_value": 0.9799, "depth": 5}
if obj[13]>2:
# {"feature": "Gender", "instances": 10, "metric_value": 0.8813, "depth": 6}
if obj[7]<=0:
# {"feature": "Bar", "instances": 6, "metric_value": 1.0, "depth": 7}
if obj[14]<=1.0:
# {"feature": "Passanger", "instances": 4, "metric_value": 0.8113, "depth": 8}
if obj[1]>0:
return 'False'
elif obj[1]<=0:
return 'True'
else: return 'True'
elif obj[14]>1.0:
return 'True'
else: return 'True'
elif obj[7]>0:
return 'True'
else: return 'True'
elif obj[13]<=2:
return 'False'
else: return 'False'
elif obj[17]>1.0:
return 'True'
else: return 'True'
else: return 'True'
elif obj[12]>6:
# {"feature": "Distance", "instances": 29, "metric_value": 0.9784, "depth": 3}
if obj[19]<=2:
# {"feature": "Weather", "instances": 26, "metric_value": 0.9306, "depth": 4}
if obj[2]<=0:
# {"feature": "Direction_same", "instances": 22, "metric_value": 0.976, "depth": 5}
if obj[18]<=0:
# {"feature": "Driving_to", "instances": 18, "metric_value": 1.0, "depth": 6}
if obj[0]<=0:
# {"feature": "Time", "instances": 11, "metric_value": 0.8454, "depth": 7}
if obj[4]>2:
# {"feature": "Bar", "instances": 7, "metric_value": 0.9852, "depth": 8}
if obj[14]<=1.0:
# {"feature": "Income", "instances": 5, "metric_value": 0.971, "depth": 9}
if obj[13]>2:
# {"feature": "Passanger", "instances": 3, "metric_value": 0.9183, "depth": 10}
if obj[1]>1:
# {"feature": "Temperature", "instances": 2, "metric_value": 1.0, "depth": 11}
if obj[3]<=80:
# {"feature": "Coupon_validity", "instances": 2, "metric_value": 1.0, "depth": 12}
if obj[6]<=0:
# {"feature": "Gender", "instances": 2, "metric_value": 1.0, "depth": 13}
if obj[7]<=1:
# {"feature": "Age", "instances": 2, "metric_value": 1.0, "depth": 14}
if obj[8]<=4:
# {"feature": "Maritalstatus", "instances": 2, "metric_value": 1.0, "depth": 15}
if obj[9]<=0:
# {"feature": "Children", "instances": 2, "metric_value": 1.0, "depth": 16}
if obj[10]<=0:
# {"feature": "Education", "instances": 2, "metric_value": 1.0, "depth": 17}
if obj[11]<=0:
# {"feature": "Coffeehouse", "instances": 2, "metric_value": 1.0, "depth": 18}
if obj[15]<=4.0:
# {"feature": "Restaurantlessthan20", "instances": 2, "metric_value": 1.0, "depth": 19}
if obj[16]<=2.0:
# {"feature": "Restaurant20to50", "instances": 2, "metric_value": 1.0, "depth": 20}
if obj[17]<=2.0:
return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
else: return 'True'
elif obj[1]<=1:
return 'True'
else: return 'True'
elif obj[13]<=2:
return 'False'
else: return 'False'
elif obj[14]>1.0:
return 'True'
else: return 'True'
elif obj[4]<=2:
return 'True'
else: return 'True'
elif obj[0]>0:
# {"feature": "Restaurantlessthan20", "instances": 7, "metric_value": 0.5917, "depth": 7}
if obj[16]>1.0:
return 'False'
elif obj[16]<=1.0:
return 'True'
else: return 'True'
else: return 'False'
elif obj[18]>0:
return 'True'
else: return 'True'
elif obj[2]>0:
return 'True'
else: return 'True'
elif obj[19]>2:
return 'False'
else: return 'False'
else: return 'True'
elif obj[5]<=0:
# {"feature": "Education", "instances": 16, "metric_value": 0.6962, "depth": 2}
if obj[11]<=3:
return 'False'
elif obj[11]>3:
# {"feature": "Age", "instances": 4, "metric_value": 0.8113, "depth": 3}
if obj[8]>1:
return 'True'
elif obj[8]<=1:
return 'False'
else: return 'False'
else: return 'True'
else: return 'False'
| def find_decision(obj):
if obj[5] > 0:
if obj[12] <= 6:
if obj[8] <= 2:
if obj[9] <= 1:
return 'True'
elif obj[9] > 1:
return 'False'
else:
return 'False'
elif obj[8] > 2:
if obj[17] <= 1.0:
if obj[13] > 2:
if obj[7] <= 0:
if obj[14] <= 1.0:
if obj[1] > 0:
return 'False'
elif obj[1] <= 0:
return 'True'
else:
return 'True'
elif obj[14] > 1.0:
return 'True'
else:
return 'True'
elif obj[7] > 0:
return 'True'
else:
return 'True'
elif obj[13] <= 2:
return 'False'
else:
return 'False'
elif obj[17] > 1.0:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[12] > 6:
if obj[19] <= 2:
if obj[2] <= 0:
if obj[18] <= 0:
if obj[0] <= 0:
if obj[4] > 2:
if obj[14] <= 1.0:
if obj[13] > 2:
if obj[1] > 1:
if obj[3] <= 80:
if obj[6] <= 0:
if obj[7] <= 1:
if obj[8] <= 4:
if obj[9] <= 0:
if obj[10] <= 0:
if obj[11] <= 0:
if obj[15] <= 4.0:
if obj[16] <= 2.0:
if obj[17] <= 2.0:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
else:
return 'True'
elif obj[1] <= 1:
return 'True'
else:
return 'True'
elif obj[13] <= 2:
return 'False'
else:
return 'False'
elif obj[14] > 1.0:
return 'True'
else:
return 'True'
elif obj[4] <= 2:
return 'True'
else:
return 'True'
elif obj[0] > 0:
if obj[16] > 1.0:
return 'False'
elif obj[16] <= 1.0:
return 'True'
else:
return 'True'
else:
return 'False'
elif obj[18] > 0:
return 'True'
else:
return 'True'
elif obj[2] > 0:
return 'True'
else:
return 'True'
elif obj[19] > 2:
return 'False'
else:
return 'False'
else:
return 'True'
elif obj[5] <= 0:
if obj[11] <= 3:
return 'False'
elif obj[11] > 3:
if obj[8] > 1:
return 'True'
elif obj[8] <= 1:
return 'False'
else:
return 'False'
else:
return 'True'
else:
return 'False' |
class PyraFaceMapper:
@staticmethod
def is_face_twist(original_move: str) -> bool:
return (len(original_move) >= 2 and original_move[1] == 'w') or \
(len(original_move) >=
3 and original_move[0] == '2' and original_move[2] == 'w')
@staticmethod
def convert_vertex_twist_to_face_twist(original_move: str) -> str:
'''
Given a vertex twist X, translate it to a face twist followed by a vertex-based rotation
For example, U becomes Dw [U], and U' becomes Dw' [U']
Given a face twist, keep it after checking validity
For example, Dw' stays as Dw'
'''
vertex_face_map = {
"U": "Dw", "R": "Lw", "L": "Rw", "B": "Fw",
"u": "2Dw", "r": "2Lw", "l": "2Rw", "b": "2Fw"
}
accepted_directions = ["", "'", "2", "2'", "'2"]
accepted_faces = vertex_face_map.values()
if PyraFaceMapper.is_face_twist(original_move):
# e.g. if the original move is Dw2 or 2Fw2', etc.,
# the move should be left unchanged but verified
wide_move_char_index = original_move.find('w')
if wide_move_char_index < 0:
raise Exception("Invalid move entered: " + original_move)
move_direction = original_move[wide_move_char_index + 1:]
face_move = original_move[:wide_move_char_index + 1]
if face_move not in accepted_faces:
raise Exception("Invalid move entered: " + original_move)
final_face_move = original_move
else:
# e.g. if the original move is u',
# the face move with the direction is 2Dw',
# and the following_rotation is [U']
vertex_move_tip = original_move[:1]
move_direction = original_move[1:]
tmp_move = vertex_face_map.get(vertex_move_tip)
if tmp_move is None:
raise Exception("Invalid move entered: " + original_move)
face_move = tmp_move
face_move_with_direction = face_move + move_direction
final_face_move = face_move_with_direction + \
" " + "[" + original_move.upper() + "]"
if move_direction not in accepted_directions:
raise Exception("Invalid move direction detected")
return final_face_move
| class Pyrafacemapper:
@staticmethod
def is_face_twist(original_move: str) -> bool:
return len(original_move) >= 2 and original_move[1] == 'w' or (len(original_move) >= 3 and original_move[0] == '2' and (original_move[2] == 'w'))
@staticmethod
def convert_vertex_twist_to_face_twist(original_move: str) -> str:
"""
Given a vertex twist X, translate it to a face twist followed by a vertex-based rotation
For example, U becomes Dw [U], and U' becomes Dw' [U']
Given a face twist, keep it after checking validity
For example, Dw' stays as Dw'
"""
vertex_face_map = {'U': 'Dw', 'R': 'Lw', 'L': 'Rw', 'B': 'Fw', 'u': '2Dw', 'r': '2Lw', 'l': '2Rw', 'b': '2Fw'}
accepted_directions = ['', "'", '2', "2'", "'2"]
accepted_faces = vertex_face_map.values()
if PyraFaceMapper.is_face_twist(original_move):
wide_move_char_index = original_move.find('w')
if wide_move_char_index < 0:
raise exception('Invalid move entered: ' + original_move)
move_direction = original_move[wide_move_char_index + 1:]
face_move = original_move[:wide_move_char_index + 1]
if face_move not in accepted_faces:
raise exception('Invalid move entered: ' + original_move)
final_face_move = original_move
else:
vertex_move_tip = original_move[:1]
move_direction = original_move[1:]
tmp_move = vertex_face_map.get(vertex_move_tip)
if tmp_move is None:
raise exception('Invalid move entered: ' + original_move)
face_move = tmp_move
face_move_with_direction = face_move + move_direction
final_face_move = face_move_with_direction + ' ' + '[' + original_move.upper() + ']'
if move_direction not in accepted_directions:
raise exception('Invalid move direction detected')
return final_face_move |
class TestGenerate(unittest.TestCase):
def test_generate_bin(self):
M = [1, 1, 1, 3, 3, 3, 5, 5, 5, 5, 2, 6]
ctrl = [0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 0, 3]
self.assertTrue(np.array_equal(ctrl, generate_bin(M, 3)))
M = np.array([0.1, 3.0, 0.0, 1.2, 2.5, 1.7, 2])
ctrl = [0, 3, 0, 1, 2, 1, 2]
self.assertTrue(np.array_equal(ctrl, generate_bin(M, 3)))
def test_choose_rows_where(self):
M = [[1,2,3], [2,3,4], [3,4,5]]
col_names = ['heigh','weight', 'age']
lables= [0,0,1]
M = diogenes.utils.cast_list_of_list_to_sa(
M,
col_names=col_names)
arguments = [{'func': val_eq, 'col_name': 'heigh', 'vals': 1},
{'func': val_lt, 'col_name': 'weight', 'vals': 3},
{'func': val_between, 'col_name': 'age', 'vals':
(3, 4)}]
res = choose_rows_where(
M,
arguments,
'eq_to_stuff')
ctrl = np.array(
[(1, 2, 3, True), (2, 3, 4, False), (3, 4, 5, False)],
dtype=[('heigh', '<i8'), ('weight', '<i8'), ('age', '<i8'),
('eq_to_stuff', '?')])
self.assertTrue(np.array_equal(res, ctrl))
def test_combine_cols(self):
M = np.array(
[(0, 1, 2), (3, 4, 5), (6, 7, 8)],
dtype=[('f0', float), ('f1', float), ('f2', float)])
ctrl = np.array(
[(0, 1, 2, 1, 1.5), (3, 4, 5, 7, 4.5), (6, 7, 8, 13, 7.5)],
dtype=[('f0', float), ('f1', float), ('f2', float),
('sum', float), ('avg', float)])
M = combine_cols(M, combine_sum, ('f0', 'f1'), 'sum')
M = combine_cols(M, combine_mean, ('f1', 'f2'), 'avg')
self.assertTrue(np.array_equal(M, ctrl))
def test_normalize(self):
col = np.array([-2, -1, 0, 1, 2])
res, mean, stddev = normalize(col, return_fit=True)
self.assertTrue(np.allclose(np.std(res), 1.0))
self.assertTrue(np.allclose(np.mean(res), 0.0))
col = np.arange(10)
res = normalize(col, mean=mean, stddev=stddev)
self.assertTrue(np.allclose(res, (col - mean) / stddev))
def test_distance_from_point(self):
# Coords according to https://tools.wmflabs.org/geohack/
# Paris
lat_origin = 48.8567
lng_origin = 2.3508
# New York, Beijing, Jerusalem
lat_col = [40.7127, 39.9167, 31.7833]
lng_col = [-74.0059, 116.3833, 35.2167]
# According to http://www.movable-type.co.uk/scripts/latlong.html
# (Rounds to nearest km)
ctrl = np.array([5837, 8215, 3331])
res = distance_from_point(lat_origin, lng_origin, lat_col, lng_col)
# get it right within 1km
self.assertTrue(np.allclose(ctrl, res, atol=1, rtol=0))
if __name__ == '__main__':
unittest.main()
| class Testgenerate(unittest.TestCase):
def test_generate_bin(self):
m = [1, 1, 1, 3, 3, 3, 5, 5, 5, 5, 2, 6]
ctrl = [0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 0, 3]
self.assertTrue(np.array_equal(ctrl, generate_bin(M, 3)))
m = np.array([0.1, 3.0, 0.0, 1.2, 2.5, 1.7, 2])
ctrl = [0, 3, 0, 1, 2, 1, 2]
self.assertTrue(np.array_equal(ctrl, generate_bin(M, 3)))
def test_choose_rows_where(self):
m = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
col_names = ['heigh', 'weight', 'age']
lables = [0, 0, 1]
m = diogenes.utils.cast_list_of_list_to_sa(M, col_names=col_names)
arguments = [{'func': val_eq, 'col_name': 'heigh', 'vals': 1}, {'func': val_lt, 'col_name': 'weight', 'vals': 3}, {'func': val_between, 'col_name': 'age', 'vals': (3, 4)}]
res = choose_rows_where(M, arguments, 'eq_to_stuff')
ctrl = np.array([(1, 2, 3, True), (2, 3, 4, False), (3, 4, 5, False)], dtype=[('heigh', '<i8'), ('weight', '<i8'), ('age', '<i8'), ('eq_to_stuff', '?')])
self.assertTrue(np.array_equal(res, ctrl))
def test_combine_cols(self):
m = np.array([(0, 1, 2), (3, 4, 5), (6, 7, 8)], dtype=[('f0', float), ('f1', float), ('f2', float)])
ctrl = np.array([(0, 1, 2, 1, 1.5), (3, 4, 5, 7, 4.5), (6, 7, 8, 13, 7.5)], dtype=[('f0', float), ('f1', float), ('f2', float), ('sum', float), ('avg', float)])
m = combine_cols(M, combine_sum, ('f0', 'f1'), 'sum')
m = combine_cols(M, combine_mean, ('f1', 'f2'), 'avg')
self.assertTrue(np.array_equal(M, ctrl))
def test_normalize(self):
col = np.array([-2, -1, 0, 1, 2])
(res, mean, stddev) = normalize(col, return_fit=True)
self.assertTrue(np.allclose(np.std(res), 1.0))
self.assertTrue(np.allclose(np.mean(res), 0.0))
col = np.arange(10)
res = normalize(col, mean=mean, stddev=stddev)
self.assertTrue(np.allclose(res, (col - mean) / stddev))
def test_distance_from_point(self):
lat_origin = 48.8567
lng_origin = 2.3508
lat_col = [40.7127, 39.9167, 31.7833]
lng_col = [-74.0059, 116.3833, 35.2167]
ctrl = np.array([5837, 8215, 3331])
res = distance_from_point(lat_origin, lng_origin, lat_col, lng_col)
self.assertTrue(np.allclose(ctrl, res, atol=1, rtol=0))
if __name__ == '__main__':
unittest.main() |
def test_admin_peers(web3, skip_if_testrpc):
skip_if_testrpc(web3)
assert web3.admin.peers == []
| def test_admin_peers(web3, skip_if_testrpc):
skip_if_testrpc(web3)
assert web3.admin.peers == [] |
'''
LeetCode Q.1170 Compare Strings by Frequency of the Smallest Character
'''
def numSmallerByFrequency(queries, words):
def bin_search(arr, t):
l = 0
r = len(arr)-1
while l <= r:
mid = (l+r)//2
if l == r:
if arr[mid] > t:
return len(arr) - mid
elif arr[mid] == t:
return len(arr) - mid - 1
else:
break
if (arr[mid] <= t and arr[mid+1] > t):
return len(arr) - mid-1
if (arr[mid-1] <= t and arr[mid] > t):
return len(arr) - mid
elif arr[mid] <= t:
l = mid+1
else:
r = mid-1
return 0
def f(s):
smallest = min(s)
return s.count(smallest)
arr1 = [f(i) for i in queries]
arr2 = sorted([f(i) for i in words])
ans = [0] * len(arr1)
for ind, i in enumerate(arr1):
ans[ind] = bin_search(arr2, i)
return ans
if __name__ == '__main__':
queries = ["cbd"]
words = ["zaaaz"]
print(numSmallerByFrequency(queries, words))
| """
LeetCode Q.1170 Compare Strings by Frequency of the Smallest Character
"""
def num_smaller_by_frequency(queries, words):
def bin_search(arr, t):
l = 0
r = len(arr) - 1
while l <= r:
mid = (l + r) // 2
if l == r:
if arr[mid] > t:
return len(arr) - mid
elif arr[mid] == t:
return len(arr) - mid - 1
else:
break
if arr[mid] <= t and arr[mid + 1] > t:
return len(arr) - mid - 1
if arr[mid - 1] <= t and arr[mid] > t:
return len(arr) - mid
elif arr[mid] <= t:
l = mid + 1
else:
r = mid - 1
return 0
def f(s):
smallest = min(s)
return s.count(smallest)
arr1 = [f(i) for i in queries]
arr2 = sorted([f(i) for i in words])
ans = [0] * len(arr1)
for (ind, i) in enumerate(arr1):
ans[ind] = bin_search(arr2, i)
return ans
if __name__ == '__main__':
queries = ['cbd']
words = ['zaaaz']
print(num_smaller_by_frequency(queries, words)) |
#!/usr/bin/env python
prod = 0
for a in range(1, 1001):
for b in range(a + 1, 1001):
c = 1000 - a - b
if a**2 + b**2 == c**2:
prod = a * b * c
break
if prod != 0:
break
print(prod)
| prod = 0
for a in range(1, 1001):
for b in range(a + 1, 1001):
c = 1000 - a - b
if a ** 2 + b ** 2 == c ** 2:
prod = a * b * c
break
if prod != 0:
break
print(prod) |
def max_sub_array(nums):
""" Returns the max subarray of the given list of numbers.
Returns 0 if nums is None or an empty list.
Time Complexity: O(n)
Space Complexity: O(n)
"""
if nums == None:
return 0
if len(nums) == 0:
return 0
max_sum = 0
current_sum = 0
for i in range(len(nums)):
current_sum = max((nums[i] + current_sum), nums[i])
max_sum = max(current_sum, max_sum)
if max_sum <=0:
return max(nums)
return max_sum
| def max_sub_array(nums):
""" Returns the max subarray of the given list of numbers.
Returns 0 if nums is None or an empty list.
Time Complexity: O(n)
Space Complexity: O(n)
"""
if nums == None:
return 0
if len(nums) == 0:
return 0
max_sum = 0
current_sum = 0
for i in range(len(nums)):
current_sum = max(nums[i] + current_sum, nums[i])
max_sum = max(current_sum, max_sum)
if max_sum <= 0:
return max(nums)
return max_sum |
d = list(map(int, input().split()))
d.sort()
if d[0] == d[1] and d[1] == d[2]:
print(10000 + d[0] * 1000)
elif d[0] == d[1]:
print(1000 + d[0] * 100)
elif d[1] == d[2]:
print(1000 + d[1] * 100)
else:
print(100 * d[2])
| d = list(map(int, input().split()))
d.sort()
if d[0] == d[1] and d[1] == d[2]:
print(10000 + d[0] * 1000)
elif d[0] == d[1]:
print(1000 + d[0] * 100)
elif d[1] == d[2]:
print(1000 + d[1] * 100)
else:
print(100 * d[2]) |
# Aggregate all `python` rules to one loadable file
load(":python_proto_compile.bzl", _python_proto_compile="python_proto_compile")
load(":python_grpc_compile.bzl", _python_grpc_compile="python_grpc_compile")
load(":python_grpclib_compile.bzl", _python_grpclib_compile="python_grpclib_compile")
load(":python_proto_library.bzl", _python_proto_library="python_proto_library")
load(":python_grpc_library.bzl", _python_grpc_library="python_grpc_library")
load(":python_grpclib_library.bzl", _python_grpclib_library="python_grpclib_library")
python_proto_compile = _python_proto_compile
python_grpc_compile = _python_grpc_compile
python_grpclib_compile = _python_grpclib_compile
python_proto_library = _python_proto_library
python_grpc_library = _python_grpc_library
python_grpclib_library = _python_grpclib_library
# Aliases
py_grpc_compile = _python_grpc_compile
py_grpc_library = _python_grpc_library
py_grpclib_compile = _python_grpclib_compile
py_grpclib_library = _python_grpclib_library
py_proto_compile = _python_proto_compile
py_proto_library = _python_proto_library
| load(':python_proto_compile.bzl', _python_proto_compile='python_proto_compile')
load(':python_grpc_compile.bzl', _python_grpc_compile='python_grpc_compile')
load(':python_grpclib_compile.bzl', _python_grpclib_compile='python_grpclib_compile')
load(':python_proto_library.bzl', _python_proto_library='python_proto_library')
load(':python_grpc_library.bzl', _python_grpc_library='python_grpc_library')
load(':python_grpclib_library.bzl', _python_grpclib_library='python_grpclib_library')
python_proto_compile = _python_proto_compile
python_grpc_compile = _python_grpc_compile
python_grpclib_compile = _python_grpclib_compile
python_proto_library = _python_proto_library
python_grpc_library = _python_grpc_library
python_grpclib_library = _python_grpclib_library
py_grpc_compile = _python_grpc_compile
py_grpc_library = _python_grpc_library
py_grpclib_compile = _python_grpclib_compile
py_grpclib_library = _python_grpclib_library
py_proto_compile = _python_proto_compile
py_proto_library = _python_proto_library |
def initFont(name, w, h): # -> fontId
imagep = Image.open(name)
ix = imagep.size[0]
iy = imagep.size[1]
image = imagep.tobytes("raw", "RGBX", 0, -1)
tid = texture_init(image, ix, iy)
col_count = ix // w
row_count = iy // h
return {
#'tid':tid,
'col':col_count,
'row':row_count,
'w':w,
'h':h,
'width':ix,
'height':iy,
}
def font_coord_to_tex_coord(fid, x, y):
w = fid['w'] + 1
h = fid['h'] + 1
width = fid['width']
height = fid['height']
s, t = x, y
x *= w
y *= h
x = x/width
y = 1.0 - y/height
s = (s+1) * w
t = (t+1) * w
s = s/width
t = 1.0 - t/height
return x, t, s, y
def say_2dfont(font_id, msg):
tid = font_id['tid']
col = font_id['col']
glColor3f(1.0, 1.0, 1.0)
glDisable(GL_BLEND)
glEnable(GL_TEXTURE_2D)
glBindTexture(GL_TEXTURE_2D, tid)
glLoadIdentity()
glTranslatef(50.0, 50.0, -0.1)
x = window_width
x /= 30
y = x
left = -40.0
for char in msg:
code = ord(char) - ord('a')
xx = code % col
yy = code // col
a, b, s, t = font_coord_to_tex_coord(font_id, xx, yy)
#print(msg, char, code, x, a,b,s,t)
glBegin(GL_QUADS)
glTexCoord2f(a, b)
glVertex3f(left-x, -y, 0.0)
glTexCoord2f(a, t)
glVertex3f(left - x, y, 0.0)
glTexCoord2f(s, t)
glVertex3f(left + x, y, 0.0)
glTexCoord2f(s, b)
glVertex3f(left + x, -y, 0.0)
glEnd()
left += 10
| def init_font(name, w, h):
imagep = Image.open(name)
ix = imagep.size[0]
iy = imagep.size[1]
image = imagep.tobytes('raw', 'RGBX', 0, -1)
tid = texture_init(image, ix, iy)
col_count = ix // w
row_count = iy // h
return {'col': col_count, 'row': row_count, 'w': w, 'h': h, 'width': ix, 'height': iy}
def font_coord_to_tex_coord(fid, x, y):
w = fid['w'] + 1
h = fid['h'] + 1
width = fid['width']
height = fid['height']
(s, t) = (x, y)
x *= w
y *= h
x = x / width
y = 1.0 - y / height
s = (s + 1) * w
t = (t + 1) * w
s = s / width
t = 1.0 - t / height
return (x, t, s, y)
def say_2dfont(font_id, msg):
tid = font_id['tid']
col = font_id['col']
gl_color3f(1.0, 1.0, 1.0)
gl_disable(GL_BLEND)
gl_enable(GL_TEXTURE_2D)
gl_bind_texture(GL_TEXTURE_2D, tid)
gl_load_identity()
gl_translatef(50.0, 50.0, -0.1)
x = window_width
x /= 30
y = x
left = -40.0
for char in msg:
code = ord(char) - ord('a')
xx = code % col
yy = code // col
(a, b, s, t) = font_coord_to_tex_coord(font_id, xx, yy)
gl_begin(GL_QUADS)
gl_tex_coord2f(a, b)
gl_vertex3f(left - x, -y, 0.0)
gl_tex_coord2f(a, t)
gl_vertex3f(left - x, y, 0.0)
gl_tex_coord2f(s, t)
gl_vertex3f(left + x, y, 0.0)
gl_tex_coord2f(s, b)
gl_vertex3f(left + x, -y, 0.0)
gl_end()
left += 10 |
# Returns length of LCS for X[0..m-1], Y[0..n-1]
def longest_common_subsequence(X, Y):
X_length = len(X)
Y_length = len(Y)
L = [[0 for x in range(Y_length + 1)] for x in range(X_length + 1)]
# Following steps build L[m+1][n+1] in bottom up fashion. Note
# that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1]
for i in range(X_length + 1):
for j in range(Y_length + 1):
if i == 0 or j == 0:
L[i][j] = 0
elif X[i - 1] == Y[j - 1]:
L[i][j] = L[i - 1][j - 1] + 1
else:
L[i][j] = max(L[i - 1][j], L[i][j - 1])
# Following code is used to print LCS
index = L[X_length][Y_length]
# Create a character array to store the lcs string
lcs = [""] * (index + 1)
lcs[index] = ""
# Start from the right-most-bottom-most corner and
# one by one store characters in lcs[]
i = X_length
j = Y_length
while i > 0 and j > 0:
# If current character in X[] and Y are same, then
# current character is part of LCS
if X[i - 1] == Y[j - 1]:
lcs[index - 1] = X[i - 1]
i -= 1
j -= 1
index -= 1
# If not same, then find the larger of two and
# go in the direction of larger value
elif L[i - 1][j] > L[i][j - 1]:
i -= 1
else:
j -= 1
# print("LCS of " + X + " and " + Y + " is " + "".join(lcs))
return "".join(lcs)
# Test
X = "ACCAEF"
Y = "CCAACCF"
longest_common_subsequence(X, Y) | def longest_common_subsequence(X, Y):
x_length = len(X)
y_length = len(Y)
l = [[0 for x in range(Y_length + 1)] for x in range(X_length + 1)]
for i in range(X_length + 1):
for j in range(Y_length + 1):
if i == 0 or j == 0:
L[i][j] = 0
elif X[i - 1] == Y[j - 1]:
L[i][j] = L[i - 1][j - 1] + 1
else:
L[i][j] = max(L[i - 1][j], L[i][j - 1])
index = L[X_length][Y_length]
lcs = [''] * (index + 1)
lcs[index] = ''
i = X_length
j = Y_length
while i > 0 and j > 0:
if X[i - 1] == Y[j - 1]:
lcs[index - 1] = X[i - 1]
i -= 1
j -= 1
index -= 1
elif L[i - 1][j] > L[i][j - 1]:
i -= 1
else:
j -= 1
return ''.join(lcs)
x = 'ACCAEF'
y = 'CCAACCF'
longest_common_subsequence(X, Y) |
################################################################################
#
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix elements for arbitrary
# high-energy processes in the Standard Model and beyond.
#
# It is subject to the MadGraph5_aMC@NLO license which should accompany this
# distribution.
#
# For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch
#
################################################################################
tutorial_MadLoop = """
You have entered tutorial mode. This will introduce you to the main
syntax options for MadLoop which are mostly similar to the MadGraph5_aMC@NLO one.
If you have not done so already, please follow MadGraph5_aMC@NLO tutorial before
this one.
Remember that exactly as in MadGraph5, you can learn more about the different
options for any command by typing
MG5_aMC> help A_CMD
And to see a list of all commands, use
MG5_aMC> help
MadLoop is the part of MadGraph5_aMC@NLO used to generate the code for
evaluating the loop diagrams. This tutorial teaches you how to use MadLoop
as standalone tool for studying loops within particular processes.
Therefore in this mode, you can only consider definite processes, meaning
without multiparticle labels.
This tutorial has three parts:
a) How to generate a process.
b) How to cross-check / profile an output.
c) How to compute the loop matrix element squared for local phase-space points.
Let's start with the first point, how to generate a process with MadLoop in
standalone mode. Keep in mind that this means only the loop and born diagrams
are generated.
MG5_aMC>generate g g > d d~ [virt=QCD]
Note that a space is mandatory between the particle names and that '[virt=QCD]'
specifies that you want to consider QCD NLO corrections. The keyword option
'virt' before '=' within the squared brackets precisely specifies you are only
interested in the virtual contribution.
"""
tutorial = tutorial_MadLoop
generate = """
You have just generated a new process.
You can find more information on supported syntax by using:
MG5_aMC>help generate
To list all defined processes, type
MG5_aMC>display processes
You can display a pictorial representation of the diagrams with
MG5_aMC> display diagrams
Notice you can add the option 'loop' or 'born' if you only want those diagrams
to be displayed.
If you want to add a second process, you can use the add process command:
MG5_aMC>add process e+ e- > d d~ [virt=QCD]
But keep in mind that you must still consider only virtual corrections and
cannot employ multiparticle labels. Also decay chains are not available for
loops.
At this stage you can export your processes.
This is done simply by typing:
MG5_aMC>output MY_FIRST_MADLOOP_RUN
Notice that the standalone output mode (implicit in the above) is the only
available for MadLoop standalone runs.
"""
display_processes = """
You have seen a list of the already defined processes.
At this stage you can export your processes to different formats.
To create a MadLoop standalone output for these, simply type:
MG5_aMC>output MY_FIRST_MADLOOP_RUN
"""
display_diagrams = """
You have displayed the diagrams.
Notice you can add the 'born' or 'loop' option to this command to specify the
class of diagrams to be displayed.
At this stage you can export your processes to different formats.
To create a MadLoop standalone output for these, simply type:
MG5_aMC>output MY_FIRST_MADLOOP_RUN
"""
add_process = """
You have added a process to your process list.
At this stage you can export your processes.
For this, simply type
MG5_aMC>output MY_FIRST_MADLOOP_RUN
"""
output = """
If you are following the tutorial, a directory MY_FIRST_MADLOOP_RUN has
been created under your MadGraph5_aMC@NLO installation directory.
The code for the evaluation of the squared loop matrix element is in
'SubProcesses/P0_<shell_proc_name>/'. There, you can compile and edit
running parameters from 'MadloopParams.dat' and then run the code with './check'
Alternatively, for a simple quick run, type:
MG5_aMC>launch -f
This computes the squared matrix element for a given PS points.
For the purpose of this tutorial, the option '-f' is added to automatically skip
the edition of the cards and phase-space point specification.
"""
launch = """
You just launched the MadLoop standalone evalutation of the squared loop matrix
element for (a/many) specific process(es) for a random Phase-Space point.
The two processes proposed in this tutorial were g g > d d~ and e+ e- > d d~.
You can check that you get the right double pole normalized with respect to
the born*(alpha_s/2*pi), namely -26/3 and -8/3 respectively.
Now this tutorial will introduce you to two checking functionalities for the
evaluation of the contributions of virtual origin.
Start by typing:
MG5_aMC>check g g > d d~ [virt=QCD]
This will test lorentz and crossing invariance as well as of the gauge
invariance check from the ward identity for the initial state gluon.
You can add an option after check to specify to perform only one definite check.
Notice that the check functionality is only available for MadLoop standalone
runs (those with the 'virt=' option).
"""
check = """
You have seen the results for the various consistency checks performed on the
MadGraph5_aMC@NLO loop computation.
You can now use the check command to obtain a full profiling of a given process
including loop contributions.
Simply type:
MG5_aMC>check profile g g > d d~ [virt=QCD]
Notice that you can replace 'profile' by 'timing' or 'stability' if
you only want timing or stability benchmarks about this process.
"""
check_profile = """
You have seen detailed information about the stability, timings and code size
of a given process including loop.
Keep in mind that these check functionalities are only available for MadLoop
standalone runs.
You just learned the basic commands for the MadLoop runs (i.e. with the
'virt=' option). You can close this tutorial by typing
MG5_aMC>tutorial stop
Or exit MG5 with
MG5_aMC>exit
"""
| tutorial__mad_loop = "\nYou have entered tutorial mode. This will introduce you to the main\nsyntax options for MadLoop which are mostly similar to the MadGraph5_aMC@NLO one. \nIf you have not done so already, please follow MadGraph5_aMC@NLO tutorial before \nthis one. \n\nRemember that exactly as in MadGraph5, you can learn more about the different \noptions for any command by typing\nMG5_aMC> help A_CMD\nAnd to see a list of all commands, use\nMG5_aMC> help \n\nMadLoop is the part of MadGraph5_aMC@NLO used to generate the code for\nevaluating the loop diagrams. This tutorial teaches you how to use MadLoop\nas standalone tool for studying loops within particular processes.\nTherefore in this mode, you can only consider definite processes, meaning \nwithout multiparticle labels.\n\nThis tutorial has three parts:\na) How to generate a process.\nb) How to cross-check / profile an output.\nc) How to compute the loop matrix element squared for local phase-space points.\n\nLet's start with the first point, how to generate a process with MadLoop in\nstandalone mode. Keep in mind that this means only the loop and born diagrams\nare generated.\n\nMG5_aMC>generate g g > d d~ [virt=QCD]\n\nNote that a space is mandatory between the particle names and that '[virt=QCD]' \nspecifies that you want to consider QCD NLO corrections. The keyword option\n'virt' before '=' within the squared brackets precisely specifies you are only\ninterested in the virtual contribution. \n"
tutorial = tutorial_MadLoop
generate = "\nYou have just generated a new process.\nYou can find more information on supported syntax by using:\nMG5_aMC>help generate\nTo list all defined processes, type\nMG5_aMC>display processes\n\nYou can display a pictorial representation of the diagrams with \nMG5_aMC> display diagrams\nNotice you can add the option 'loop' or 'born' if you only want those diagrams\nto be displayed.\n\nIf you want to add a second process, you can use the add process command:\nMG5_aMC>add process e+ e- > d d~ [virt=QCD]\nBut keep in mind that you must still consider only virtual corrections and \ncannot employ multiparticle labels. Also decay chains are not available for\nloops.\n\nAt this stage you can export your processes.\nThis is done simply by typing:\n\nMG5_aMC>output MY_FIRST_MADLOOP_RUN\n\nNotice that the standalone output mode (implicit in the above) is the only\navailable for MadLoop standalone runs.\n"
display_processes = '\nYou have seen a list of the already defined processes.\n\nAt this stage you can export your processes to different formats. \nTo create a MadLoop standalone output for these, simply type:\n\nMG5_aMC>output MY_FIRST_MADLOOP_RUN\n'
display_diagrams = "\nYou have displayed the diagrams.\nNotice you can add the 'born' or 'loop' option to this command to specify the\nclass of diagrams to be displayed.\n\nAt this stage you can export your processes to different formats. \nTo create a MadLoop standalone output for these, simply type:\n\nMG5_aMC>output MY_FIRST_MADLOOP_RUN\n"
add_process = '\nYou have added a process to your process list.\n\nAt this stage you can export your processes.\nFor this, simply type\n\nMG5_aMC>output MY_FIRST_MADLOOP_RUN\n'
output = "\nIf you are following the tutorial, a directory MY_FIRST_MADLOOP_RUN has\nbeen created under your MadGraph5_aMC@NLO installation directory.\n\nThe code for the evaluation of the squared loop matrix element is in \n'SubProcesses/P0_<shell_proc_name>/'. There, you can compile and edit \nrunning parameters from 'MadloopParams.dat' and then run the code with './check'\nAlternatively, for a simple quick run, type:\n\nMG5_aMC>launch -f\n\nThis computes the squared matrix element for a given PS points.\nFor the purpose of this tutorial, the option '-f' is added to automatically skip\nthe edition of the cards and phase-space point specification.\n"
launch = "\nYou just launched the MadLoop standalone evalutation of the squared loop matrix\nelement for (a/many) specific process(es) for a random Phase-Space point.\nThe two processes proposed in this tutorial were g g > d d~ and e+ e- > d d~.\nYou can check that you get the right double pole normalized with respect to\nthe born*(alpha_s/2*pi), namely -26/3 and -8/3 respectively.\n\nNow this tutorial will introduce you to two checking functionalities for the\nevaluation of the contributions of virtual origin.\nStart by typing:\n\nMG5_aMC>check g g > d d~ [virt=QCD]\n\nThis will test lorentz and crossing invariance as well as of the gauge \ninvariance check from the ward identity for the initial state gluon.\nYou can add an option after check to specify to perform only one definite check.\nNotice that the check functionality is only available for MadLoop standalone\nruns (those with the 'virt=' option).\n"
check = "\nYou have seen the results for the various consistency checks performed on the\nMadGraph5_aMC@NLO loop computation.\nYou can now use the check command to obtain a full profiling of a given process\nincluding loop contributions.\nSimply type:\n\nMG5_aMC>check profile g g > d d~ [virt=QCD]\n\nNotice that you can replace 'profile' by 'timing' or 'stability' if\nyou only want timing or stability benchmarks about this process.\n"
check_profile = "\nYou have seen detailed information about the stability, timings and code size\nof a given process including loop.\nKeep in mind that these check functionalities are only available for MadLoop\nstandalone runs.\n\nYou just learned the basic commands for the MadLoop runs (i.e. with the \n'virt=' option). You can close this tutorial by typing\nMG5_aMC>tutorial stop\nOr exit MG5 with\nMG5_aMC>exit\n" |
__all__ = ['directories',
'load_wfcorrection',
'mosaic_tools',
'wise_flux_correction']
| __all__ = ['directories', 'load_wfcorrection', 'mosaic_tools', 'wise_flux_correction'] |
dirfrom = open(r"C:\Users\emurphy24\Documents\GitHub\WoordleCalculator\dictfrom.txt", "r", encoding="utf-8")
dirlist = []
for line in dirfrom:
line = line.strip()
dirlist.append(line)
print(len(dirlist))
dirfrom.close()
dirto = open(r"C:\Users\emurphy24\Documents\GitHub\WoordleCalculator\fiveletterdir", "a", encoding="utf-8")
for i in dirlist:
if len(i) == 5 and i.isalpha():
dirto.write(i + "\n") | dirfrom = open('C:\\Users\\emurphy24\\Documents\\GitHub\\WoordleCalculator\\dictfrom.txt', 'r', encoding='utf-8')
dirlist = []
for line in dirfrom:
line = line.strip()
dirlist.append(line)
print(len(dirlist))
dirfrom.close()
dirto = open('C:\\Users\\emurphy24\\Documents\\GitHub\\WoordleCalculator\\fiveletterdir', 'a', encoding='utf-8')
for i in dirlist:
if len(i) == 5 and i.isalpha():
dirto.write(i + '\n') |
# Advent of Code Day 12
# https://adventofcode.com/2020/day/12
def heading_to_dir(heading):
if heading == 0:
return "N"
elif heading == 90:
return "E"
elif heading == 180:
return "S"
elif heading == 270:
return "W"
def rotate_waypoint(old_north, old_east, degrees):
# degrees in increments of 90, pos or neg
new_north = old_north
new_east = old_east
degrees = (degrees + 360) % 360 # make the movement positive
for turns in range(degrees // 90):
old_north = new_north
old_east = new_east
new_north = -1 * old_east
new_east = old_north
return new_north, new_east
def test_rotate_waypoint():
north, east = rotate_waypoint(10, 4, 90)
assert north == -4 and east == 10
north, east = rotate_waypoint(10, 4, 180)
assert north == -10 and east == -4
north, east = rotate_waypoint(10, 4, 270)
assert north == 4 and east == -10
north, east = rotate_waypoint(10, 4, 360)
assert north == 10 and east == 4
north, east = rotate_waypoint(10, 4, -90)
assert north == 4 and east == -10
north, east = rotate_waypoint(10, 4, -180)
assert north == -10 and east == -4
north, east = rotate_waypoint(10, 4, -270)
assert north == -4 and east == 10
if __name__ == "__main__":
filepath = ".\\AdventOfCode\\2020\\day12-input.txt"
with open(filepath) as f:
instructions = [line.strip() for line in f]
# print(instructions)
part1_instr = instructions.copy()
# state
state_north = 0
state_east = 0
state_heading = 90
for ins in part1_instr:
command = ins[0]
value = int(ins[1:])
if command == "N":
state_north += value
elif command == "S":
state_north -= value
elif command == "E":
state_east += value
elif command == "W":
state_east -= value
elif command == "F":
part1_instr.append(heading_to_dir(state_heading) + str(value))
elif command == "L":
state_heading = (state_heading - value) % 360
elif command == "R":
state_heading = (state_heading + value) % 360
# print(f"North: {state_north} East: {state_east} Heading:{state_heading}")
print(f"Part 1: {abs(state_north) + abs(state_east)}")
# Part 2
part2_instr = instructions.copy()
# state
state_north = 0
state_east = 0
# state_heading = 90
waypoint_north = 1
waypoint_east = 10
for ins in part2_instr:
command = ins[0]
value = int(ins[1:])
if command == "N":
waypoint_north += value
elif command == "S":
waypoint_north -= value
elif command == "E":
waypoint_east += value
elif command == "W":
waypoint_east -= value
elif command == "F":
state_north += waypoint_north * value
state_east += waypoint_east * value
elif command == "L":
waypoint_north, waypoint_east = rotate_waypoint(
waypoint_north, waypoint_east, -1 * value
)
elif command == "R":
waypoint_north, waypoint_east = rotate_waypoint(
waypoint_north, waypoint_east, value
)
# print(f"North: {state_north} East: {state_east} Heading:{state_heading}")
print(f"Part 2: {abs(state_north) + abs(state_east)}") # 6276 too low
| def heading_to_dir(heading):
if heading == 0:
return 'N'
elif heading == 90:
return 'E'
elif heading == 180:
return 'S'
elif heading == 270:
return 'W'
def rotate_waypoint(old_north, old_east, degrees):
new_north = old_north
new_east = old_east
degrees = (degrees + 360) % 360
for turns in range(degrees // 90):
old_north = new_north
old_east = new_east
new_north = -1 * old_east
new_east = old_north
return (new_north, new_east)
def test_rotate_waypoint():
(north, east) = rotate_waypoint(10, 4, 90)
assert north == -4 and east == 10
(north, east) = rotate_waypoint(10, 4, 180)
assert north == -10 and east == -4
(north, east) = rotate_waypoint(10, 4, 270)
assert north == 4 and east == -10
(north, east) = rotate_waypoint(10, 4, 360)
assert north == 10 and east == 4
(north, east) = rotate_waypoint(10, 4, -90)
assert north == 4 and east == -10
(north, east) = rotate_waypoint(10, 4, -180)
assert north == -10 and east == -4
(north, east) = rotate_waypoint(10, 4, -270)
assert north == -4 and east == 10
if __name__ == '__main__':
filepath = '.\\AdventOfCode\\2020\\day12-input.txt'
with open(filepath) as f:
instructions = [line.strip() for line in f]
part1_instr = instructions.copy()
state_north = 0
state_east = 0
state_heading = 90
for ins in part1_instr:
command = ins[0]
value = int(ins[1:])
if command == 'N':
state_north += value
elif command == 'S':
state_north -= value
elif command == 'E':
state_east += value
elif command == 'W':
state_east -= value
elif command == 'F':
part1_instr.append(heading_to_dir(state_heading) + str(value))
elif command == 'L':
state_heading = (state_heading - value) % 360
elif command == 'R':
state_heading = (state_heading + value) % 360
print(f'Part 1: {abs(state_north) + abs(state_east)}')
part2_instr = instructions.copy()
state_north = 0
state_east = 0
waypoint_north = 1
waypoint_east = 10
for ins in part2_instr:
command = ins[0]
value = int(ins[1:])
if command == 'N':
waypoint_north += value
elif command == 'S':
waypoint_north -= value
elif command == 'E':
waypoint_east += value
elif command == 'W':
waypoint_east -= value
elif command == 'F':
state_north += waypoint_north * value
state_east += waypoint_east * value
elif command == 'L':
(waypoint_north, waypoint_east) = rotate_waypoint(waypoint_north, waypoint_east, -1 * value)
elif command == 'R':
(waypoint_north, waypoint_east) = rotate_waypoint(waypoint_north, waypoint_east, value)
print(f'Part 2: {abs(state_north) + abs(state_east)}') |
def test_home_page(test_client):
"""
GIVEN a Flask application
WHEN the '/' page is requested (GET)
THEN check the response is valid
"""
response = test_client.get('/')
assert response.status_code == 200
assert b"Fantasy PLQ" in response.data
assert b"Login" in response.data
def test_valid_login(test_client, init_database):
"""
GIVEN a Flask application
WHEN the '/login' page is posted to (POST)
THEN check the response is valid
"""
response = test_client.post('/login',
data=dict(email='test@user.com', password='hi'),
follow_redirects=True)
# print(response)
assert response.status_code == 200
assert b"Logout" in response.data
assert b"Profile" in response.data
def test_valid_logout(test_client, init_database):
"""
GIVEN a Flask application
WHEN the '/logout' page is requested (GET)
THEN check the response is valid
"""
response = test_client.get('/logout', follow_redirects=True)
assert response.status_code == 200
assert b"Logout" not in response.data
| def test_home_page(test_client):
"""
GIVEN a Flask application
WHEN the '/' page is requested (GET)
THEN check the response is valid
"""
response = test_client.get('/')
assert response.status_code == 200
assert b'Fantasy PLQ' in response.data
assert b'Login' in response.data
def test_valid_login(test_client, init_database):
"""
GIVEN a Flask application
WHEN the '/login' page is posted to (POST)
THEN check the response is valid
"""
response = test_client.post('/login', data=dict(email='test@user.com', password='hi'), follow_redirects=True)
assert response.status_code == 200
assert b'Logout' in response.data
assert b'Profile' in response.data
def test_valid_logout(test_client, init_database):
"""
GIVEN a Flask application
WHEN the '/logout' page is requested (GET)
THEN check the response is valid
"""
response = test_client.get('/logout', follow_redirects=True)
assert response.status_code == 200
assert b'Logout' not in response.data |
'''
input:
123
-123
120
0
1534236469
Output
321
-321
21
0
0
'''
class Solution:
def reverse(self, x: int) -> int:
range_value = 2**31
val = x;
output = ""
if x < 0:
output += "-"
val = abs(val)
while True:
dig = val%10
val = int(val/10)
output += str(dig)
if val == 0:
break
val = int(output)
# print(output)
if -range_value <= val <= range_value - 1:
return val
else:
return 0
| """
input:
123
-123
120
0
1534236469
Output
321
-321
21
0
0
"""
class Solution:
def reverse(self, x: int) -> int:
range_value = 2 ** 31
val = x
output = ''
if x < 0:
output += '-'
val = abs(val)
while True:
dig = val % 10
val = int(val / 10)
output += str(dig)
if val == 0:
break
val = int(output)
if -range_value <= val <= range_value - 1:
return val
else:
return 0 |
""" this is the application url path(s)
"""
__all__ = [
'auth', 'postfix', 'dovecot', 'fetch'
]
| """ this is the application url path(s)
"""
__all__ = ['auth', 'postfix', 'dovecot', 'fetch'] |
# Dragon
sm.setSpeakerID(1013001)
sm.sendNext("You, who is destined to be a Dragon Master... You have finally arrived.")
sm.sendNext("Go and fulfill your duties as the Dragon Master...")
#todo effects
sm.warp(100030100, 0)
sm.dispose() | sm.setSpeakerID(1013001)
sm.sendNext('You, who is destined to be a Dragon Master... You have finally arrived.')
sm.sendNext('Go and fulfill your duties as the Dragon Master...')
sm.warp(100030100, 0)
sm.dispose() |
def foo():
pass
def bar():
pass
def boing():
pass
| def foo():
pass
def bar():
pass
def boing():
pass |
"""
Este es el comentario del archivo tarea2.py
""" | """
Este es el comentario del archivo tarea2.py
""" |
dict_month = {"A": 1, "B": 2, "C": 3,
"D": 4, "E": 5, "F": 6,
"G": 7, "H": 8, "I": 9,
"J": 10, "K": 11, "L": 12,
"M": 1, "N": 2, "O": 3,
"P": 4, "Q": 5, "R": 6,
"S": 7, "T": 8, "U": 9,
"V": 10, "W": 11, "X": 12}
dict_is_call = {"A": True, "B": True, "C": True,
"D": True, "E": True, "F": True,
"G": True, "H": True, "I": True,
"J": True, "K": True, "L": True,
"M": False, "N": False, "O": False,
"P": False, "Q": False, "R": False,
"S": False, "T": False, "U": False,
"V": False, "W": False, "X": False}
def get_option_info_from_ticker(ticker, equity_length=3):
asset = ticker[:equity_length]
exp_month_code = ticker[equity_length]
month = dict_month[exp_month_code]
is_call = dict_is_call[exp_month_code]
day = int(ticker[equity_length + 1:equity_length + 3])
year = int(ticker[equity_length + 3:equity_length + 5]) + 2000
K = int(ticker[equity_length + 5:-2]) / 100
country = ticker[-1]
return asset, is_call, month, day, year, K, country
| dict_month = {'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9, 'J': 10, 'K': 11, 'L': 12, 'M': 1, 'N': 2, 'O': 3, 'P': 4, 'Q': 5, 'R': 6, 'S': 7, 'T': 8, 'U': 9, 'V': 10, 'W': 11, 'X': 12}
dict_is_call = {'A': True, 'B': True, 'C': True, 'D': True, 'E': True, 'F': True, 'G': True, 'H': True, 'I': True, 'J': True, 'K': True, 'L': True, 'M': False, 'N': False, 'O': False, 'P': False, 'Q': False, 'R': False, 'S': False, 'T': False, 'U': False, 'V': False, 'W': False, 'X': False}
def get_option_info_from_ticker(ticker, equity_length=3):
asset = ticker[:equity_length]
exp_month_code = ticker[equity_length]
month = dict_month[exp_month_code]
is_call = dict_is_call[exp_month_code]
day = int(ticker[equity_length + 1:equity_length + 3])
year = int(ticker[equity_length + 3:equity_length + 5]) + 2000
k = int(ticker[equity_length + 5:-2]) / 100
country = ticker[-1]
return (asset, is_call, month, day, year, K, country) |
#python 3
debug = False
def from_input():
m = int(input())
idx_matrix = []
for _ in range(m):
row = list(map(float, input().split()))
idx_matrix.append(row)
return idx_matrix
def to_str(x):
return list(map(lambda a: format(a, '.6f'), x))
def gauss(matrix):
if len(matrix) == 0:
return []
size = len(matrix[0]) - 1
size_rows = len(matrix)
used_columns = [False] * size
used_rows = [False] * size_rows
def makePivot(selectedRow, selectedColumn):
used_rows[selectedRow] = True
used_columns[selectedColumn] = True
def leftMostNonZeroInNonPivotRow():
if False not in used_rows:
return False
initialRow = used_rows.index(False)
for row in range(initialRow, size_rows):
for column in range(size):
if matrix[row][column] != 0 and column < size:
used_rows[row] = True
return (row, column)
return False
def swapRowToTopOfNonPivotRow(selectedRow):
if False not in used_rows:
return
topNonPivotRow = used_rows.index(False)
if topNonPivotRow < selectedRow:
matrix[topNonPivotRow], matrix[selectedRow] = matrix[selectedRow], matrix[topNonPivotRow]
selectedRow = topNonPivotRow
def rescaleToMakePivotOne(selectedRow, selectedColumn):
pivot = matrix[selectedRow][selectedColumn]
matrix[selectedRow] = [elem/pivot for elem in matrix[selectedRow]]
def substractToMakeOtherRowsZero(selectedRow, selectedColumn):
for row in range(size_rows):
if row != selectedRow:
times = matrix[row][selectedColumn]
matrix[row] = [i - (times * j) for i, j in zip(matrix[row], matrix[selectedRow])]
while False in used_rows and False in used_columns:
selectedRow, selectedColumn = leftMostNonZeroInNonPivotRow()
swapRowToTopOfNonPivotRow(selectedRow)
makePivot(selectedRow, selectedColumn)
rescaleToMakePivotOne(selectedRow, selectedColumn)
substractToMakeOtherRowsZero(selectedRow, selectedColumn)
res = [matrix[row][-1] for row in range(size_rows)]
for i in range(len(res)):
if res[i] == -0.0:
res[i] = 0.0
return to_str(res)
def test():
def run(data, expected, f=gauss):
result = f(data)
if result != expected:
raise Exception("Expected %s, Actual: %s" % (expected, result))
run([[1.0, 1.0, 3.0], [2.0, 3.0, 7.0]], ["2.000000", "1.000000"])
run([[1.0, 1.0]], ["1.000000"])
run([], [])
run([[5.0, -5.0, -1.0], [-1.0, -2.0, -1.0]], ["0.200000", "0.400000"])
run([[1.0, 0.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 0.0, 5.0],
[0.0, 0.0, 1.0, 0.0, 4.0], [0.0, 0.0, 0.0, 1.0, 3.0]],
["1.000000", "5.000000", "4.000000", "3.000000"])
run([
[2.0, 4.0, -2.0, 0.0, -2.0],
[-1.0, -2.0, 1.0, -2.0, -1.0],
[2.0, 2.0, 0.0, 2.0, 0.0]],
["-1.000000", "1.000000", "0.000000"])
print("Tests passed")
if __name__ == '__main__':
if debug:
test()
else:
s = gauss(from_input())
print(" ".join(s)) | debug = False
def from_input():
m = int(input())
idx_matrix = []
for _ in range(m):
row = list(map(float, input().split()))
idx_matrix.append(row)
return idx_matrix
def to_str(x):
return list(map(lambda a: format(a, '.6f'), x))
def gauss(matrix):
if len(matrix) == 0:
return []
size = len(matrix[0]) - 1
size_rows = len(matrix)
used_columns = [False] * size
used_rows = [False] * size_rows
def make_pivot(selectedRow, selectedColumn):
used_rows[selectedRow] = True
used_columns[selectedColumn] = True
def left_most_non_zero_in_non_pivot_row():
if False not in used_rows:
return False
initial_row = used_rows.index(False)
for row in range(initialRow, size_rows):
for column in range(size):
if matrix[row][column] != 0 and column < size:
used_rows[row] = True
return (row, column)
return False
def swap_row_to_top_of_non_pivot_row(selectedRow):
if False not in used_rows:
return
top_non_pivot_row = used_rows.index(False)
if topNonPivotRow < selectedRow:
(matrix[topNonPivotRow], matrix[selectedRow]) = (matrix[selectedRow], matrix[topNonPivotRow])
selected_row = topNonPivotRow
def rescale_to_make_pivot_one(selectedRow, selectedColumn):
pivot = matrix[selectedRow][selectedColumn]
matrix[selectedRow] = [elem / pivot for elem in matrix[selectedRow]]
def substract_to_make_other_rows_zero(selectedRow, selectedColumn):
for row in range(size_rows):
if row != selectedRow:
times = matrix[row][selectedColumn]
matrix[row] = [i - times * j for (i, j) in zip(matrix[row], matrix[selectedRow])]
while False in used_rows and False in used_columns:
(selected_row, selected_column) = left_most_non_zero_in_non_pivot_row()
swap_row_to_top_of_non_pivot_row(selectedRow)
make_pivot(selectedRow, selectedColumn)
rescale_to_make_pivot_one(selectedRow, selectedColumn)
substract_to_make_other_rows_zero(selectedRow, selectedColumn)
res = [matrix[row][-1] for row in range(size_rows)]
for i in range(len(res)):
if res[i] == -0.0:
res[i] = 0.0
return to_str(res)
def test():
def run(data, expected, f=gauss):
result = f(data)
if result != expected:
raise exception('Expected %s, Actual: %s' % (expected, result))
run([[1.0, 1.0, 3.0], [2.0, 3.0, 7.0]], ['2.000000', '1.000000'])
run([[1.0, 1.0]], ['1.000000'])
run([], [])
run([[5.0, -5.0, -1.0], [-1.0, -2.0, -1.0]], ['0.200000', '0.400000'])
run([[1.0, 0.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 0.0, 5.0], [0.0, 0.0, 1.0, 0.0, 4.0], [0.0, 0.0, 0.0, 1.0, 3.0]], ['1.000000', '5.000000', '4.000000', '3.000000'])
run([[2.0, 4.0, -2.0, 0.0, -2.0], [-1.0, -2.0, 1.0, -2.0, -1.0], [2.0, 2.0, 0.0, 2.0, 0.0]], ['-1.000000', '1.000000', '0.000000'])
print('Tests passed')
if __name__ == '__main__':
if debug:
test()
else:
s = gauss(from_input())
print(' '.join(s)) |
class Dog:
kind = 'canine'
# tricks = []
def __init__(self, name):
self.name = name
self.tricks = []
def add_trick(self, trick):
self.tricks.append(trick)
my_dog = Dog('Carl')
my_dog.add_trick('roll over')
another_dog = Dog('Max')
another_dog.add_trick('play dead')
print(my_dog.name, my_dog.kind, my_dog.tricks)
print(another_dog.name, another_dog.kind, another_dog.tricks)
| class Dog:
kind = 'canine'
def __init__(self, name):
self.name = name
self.tricks = []
def add_trick(self, trick):
self.tricks.append(trick)
my_dog = dog('Carl')
my_dog.add_trick('roll over')
another_dog = dog('Max')
another_dog.add_trick('play dead')
print(my_dog.name, my_dog.kind, my_dog.tricks)
print(another_dog.name, another_dog.kind, another_dog.tricks) |
# reverse the order of the items in an array
lista_unu = [1, 2, 3, 4, 5]
def Reverse(list):
list.reverse()
return list
print(Reverse(lista_unu))
# number of occurrences
lista_doi = [1, 1, 1, 1, 4, 4, 6, 7, 9, 9, 9, 3]
def NumberOfOccu(var, list):
occ = 0
for i in list:
if i == var:
occ += 1
return occ
var = 6
print(NumberOfOccu(var, lista_doi))
# number of words
string = "numaram cate cuvinte avem in propozitia asta "
def Words(string):
words = 1
for i in range(len(string)-1):
if string[i] == " " and string[i+1] != " ":
words += 1
return words
print(Words(string))
| lista_unu = [1, 2, 3, 4, 5]
def reverse(list):
list.reverse()
return list
print(reverse(lista_unu))
lista_doi = [1, 1, 1, 1, 4, 4, 6, 7, 9, 9, 9, 3]
def number_of_occu(var, list):
occ = 0
for i in list:
if i == var:
occ += 1
return occ
var = 6
print(number_of_occu(var, lista_doi))
string = 'numaram cate cuvinte avem in propozitia asta '
def words(string):
words = 1
for i in range(len(string) - 1):
if string[i] == ' ' and string[i + 1] != ' ':
words += 1
return words
print(words(string)) |
#
# PySNMP MIB module DLINK-PORT-SECURITY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DLINK-PORT-SECURITY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:35:02 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")
ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion")
dlink_common_mgmt, = mibBuilder.importSymbols("DLINK-ID-REC-MIB", "dlink-common-mgmt")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Integer32, IpAddress, ObjectIdentity, NotificationType, ModuleIdentity, MibIdentifier, iso, Gauge32, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, Bits, Unsigned32, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "IpAddress", "ObjectIdentity", "NotificationType", "ModuleIdentity", "MibIdentifier", "iso", "Gauge32", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "Bits", "Unsigned32", "TimeTicks")
MacAddress, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "DisplayString", "TextualConvention")
swPortSecMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 12, 63))
if mibBuilder.loadTexts: swPortSecMIB.setLastUpdated('1210161030Z')
if mibBuilder.loadTexts: swPortSecMIB.setOrganization('D-Link Corp.')
swPortSecCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 1))
swPortSecInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 2))
swPortSecMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3))
swPortSecTrapLogState = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecTrapLogState.setStatus('current')
swPortSecSysMaxLernAddr = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecSysMaxLernAddr.setStatus('current')
swPortSecTrapState = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecTrapState.setStatus('current')
swPortSecLogState = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecLogState.setStatus('current')
swPortSecMgmtByPort = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1))
swPortSecPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1), )
if mibBuilder.loadTexts: swPortSecPortTable.setStatus('current')
swPortSecPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1), ).setIndexNames((0, "DLINK-PORT-SECURITY-MIB", "swPortSecPortIndex"))
if mibBuilder.loadTexts: swPortSecPortEntry.setStatus('current')
swPortSecPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 1), Integer32())
if mibBuilder.loadTexts: swPortSecPortIndex.setStatus('current')
swPortSecPortMaxLernAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecPortMaxLernAddr.setStatus('current')
swPortSecPortLockAddrMode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("permanent", 1), ("deleteOnTimeout", 2), ("deleteOnReset", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecPortLockAddrMode.setStatus('current')
swPortSecPortAdmState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecPortAdmState.setStatus('current')
swPortSecPortClearCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("start", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecPortClearCtrl.setStatus('current')
swPortSecPortViolationAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("drop", 1), ("shutdown", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecPortViolationAction.setStatus('current')
swPortSecMgmtByVLAN = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2))
swPortSecVLANTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1), )
if mibBuilder.loadTexts: swPortSecVLANTable.setStatus('current')
swPortSecVLANEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1), ).setIndexNames((0, "DLINK-PORT-SECURITY-MIB", "swPortSecVLANID"))
if mibBuilder.loadTexts: swPortSecVLANEntry.setStatus('current')
swPortSecVLANID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094)))
if mibBuilder.loadTexts: swPortSecVLANID.setStatus('current')
swPortSecVLANMaxLernAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecVLANMaxLernAddr.setStatus('current')
swPortSecVLANClearCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("start", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecVLANClearCtrl.setStatus('current')
swPortSecMgmtByVLANOnPort = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3))
swPortSecVLANOnPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1), )
if mibBuilder.loadTexts: swPortSecVLANOnPortTable.setStatus('current')
swPortSecVLANOnPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1, 1), ).setIndexNames((0, "DLINK-PORT-SECURITY-MIB", "swPortSecPortIndex"), (0, "DLINK-PORT-SECURITY-MIB", "swPortSecVLANID"))
if mibBuilder.loadTexts: swPortSecVLANOnPortEntry.setStatus('current')
swPortSecVLANOnPortMaxLernAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1, 1, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecVLANOnPortMaxLernAddr.setStatus('current')
swPortSecVLANOnPortAddCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("add", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: swPortSecVLANOnPortAddCtrl.setStatus('current')
swPortSecMgmtByVLANOnPortClearCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2))
swPortSecMgmtByVLANOnPortClearPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2, 1), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecMgmtByVLANOnPortClearPort.setStatus('current')
swPortSecMgmtByVLANOnPortClearVID = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2, 2), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecMgmtByVLANOnPortClearVID.setStatus('current')
swPortSecMgmtByVLANOnPortClearAction = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("start", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecMgmtByVLANOnPortClearAction.setStatus('current')
swPortSecEntriesTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4), )
if mibBuilder.loadTexts: swPortSecEntriesTable.setStatus('current')
swPortSecEntriesEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1), ).setIndexNames((0, "DLINK-PORT-SECURITY-MIB", "swPortSecMac"), (0, "DLINK-PORT-SECURITY-MIB", "swPortSecVID"))
if mibBuilder.loadTexts: swPortSecEntriesEntry.setStatus('current')
swPortSecMac = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 1), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swPortSecMac.setStatus('current')
swPortSecVID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swPortSecVID.setStatus('current')
swPortSecPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: swPortSecPort.setStatus('current')
swPortSecDelCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("start", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swPortSecDelCtrl.setStatus('current')
mibBuilder.exportSymbols("DLINK-PORT-SECURITY-MIB", swPortSecDelCtrl=swPortSecDelCtrl, swPortSecVLANOnPortEntry=swPortSecVLANOnPortEntry, swPortSecVLANEntry=swPortSecVLANEntry, swPortSecPortClearCtrl=swPortSecPortClearCtrl, swPortSecPort=swPortSecPort, swPortSecTrapState=swPortSecTrapState, swPortSecMgmtByVLANOnPortClearPort=swPortSecMgmtByVLANOnPortClearPort, swPortSecMgmtByVLANOnPortClearAction=swPortSecMgmtByVLANOnPortClearAction, swPortSecPortLockAddrMode=swPortSecPortLockAddrMode, swPortSecCtrl=swPortSecCtrl, swPortSecLogState=swPortSecLogState, swPortSecVLANID=swPortSecVLANID, swPortSecVLANOnPortMaxLernAddr=swPortSecVLANOnPortMaxLernAddr, swPortSecMIB=swPortSecMIB, swPortSecPortViolationAction=swPortSecPortViolationAction, swPortSecMgmtByVLANOnPortClearVID=swPortSecMgmtByVLANOnPortClearVID, swPortSecVLANMaxLernAddr=swPortSecVLANMaxLernAddr, swPortSecPortAdmState=swPortSecPortAdmState, swPortSecMgmtByVLAN=swPortSecMgmtByVLAN, swPortSecPortTable=swPortSecPortTable, swPortSecMac=swPortSecMac, swPortSecEntriesTable=swPortSecEntriesTable, swPortSecSysMaxLernAddr=swPortSecSysMaxLernAddr, swPortSecVLANTable=swPortSecVLANTable, swPortSecMgmt=swPortSecMgmt, swPortSecVLANOnPortTable=swPortSecVLANOnPortTable, swPortSecTrapLogState=swPortSecTrapLogState, swPortSecVLANClearCtrl=swPortSecVLANClearCtrl, swPortSecVID=swPortSecVID, swPortSecMgmtByVLANOnPortClearCtrl=swPortSecMgmtByVLANOnPortClearCtrl, swPortSecEntriesEntry=swPortSecEntriesEntry, swPortSecPortMaxLernAddr=swPortSecPortMaxLernAddr, swPortSecPortEntry=swPortSecPortEntry, swPortSecInfo=swPortSecInfo, swPortSecPortIndex=swPortSecPortIndex, swPortSecMgmtByPort=swPortSecMgmtByPort, swPortSecVLANOnPortAddCtrl=swPortSecVLANOnPortAddCtrl, PYSNMP_MODULE_ID=swPortSecMIB, swPortSecMgmtByVLANOnPort=swPortSecMgmtByVLANOnPort)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_intersection, value_size_constraint, single_value_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion')
(dlink_common_mgmt,) = mibBuilder.importSymbols('DLINK-ID-REC-MIB', 'dlink-common-mgmt')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(integer32, ip_address, object_identity, notification_type, module_identity, mib_identifier, iso, gauge32, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, counter64, bits, unsigned32, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'IpAddress', 'ObjectIdentity', 'NotificationType', 'ModuleIdentity', 'MibIdentifier', 'iso', 'Gauge32', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter64', 'Bits', 'Unsigned32', 'TimeTicks')
(mac_address, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'MacAddress', 'DisplayString', 'TextualConvention')
sw_port_sec_mib = module_identity((1, 3, 6, 1, 4, 1, 171, 12, 63))
if mibBuilder.loadTexts:
swPortSecMIB.setLastUpdated('1210161030Z')
if mibBuilder.loadTexts:
swPortSecMIB.setOrganization('D-Link Corp.')
sw_port_sec_ctrl = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 1))
sw_port_sec_info = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 2))
sw_port_sec_mgmt = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3))
sw_port_sec_trap_log_state = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecTrapLogState.setStatus('current')
sw_port_sec_sys_max_lern_addr = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 2), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecSysMaxLernAddr.setStatus('current')
sw_port_sec_trap_state = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecTrapState.setStatus('current')
sw_port_sec_log_state = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecLogState.setStatus('current')
sw_port_sec_mgmt_by_port = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1))
sw_port_sec_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1))
if mibBuilder.loadTexts:
swPortSecPortTable.setStatus('current')
sw_port_sec_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1)).setIndexNames((0, 'DLINK-PORT-SECURITY-MIB', 'swPortSecPortIndex'))
if mibBuilder.loadTexts:
swPortSecPortEntry.setStatus('current')
sw_port_sec_port_index = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 1), integer32())
if mibBuilder.loadTexts:
swPortSecPortIndex.setStatus('current')
sw_port_sec_port_max_lern_addr = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 2), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecPortMaxLernAddr.setStatus('current')
sw_port_sec_port_lock_addr_mode = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('permanent', 1), ('deleteOnTimeout', 2), ('deleteOnReset', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecPortLockAddrMode.setStatus('current')
sw_port_sec_port_adm_state = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecPortAdmState.setStatus('current')
sw_port_sec_port_clear_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('other', 1), ('start', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecPortClearCtrl.setStatus('current')
sw_port_sec_port_violation_action = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 1, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('drop', 1), ('shutdown', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecPortViolationAction.setStatus('current')
sw_port_sec_mgmt_by_vlan = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2))
sw_port_sec_vlan_table = mib_table((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1))
if mibBuilder.loadTexts:
swPortSecVLANTable.setStatus('current')
sw_port_sec_vlan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1)).setIndexNames((0, 'DLINK-PORT-SECURITY-MIB', 'swPortSecVLANID'))
if mibBuilder.loadTexts:
swPortSecVLANEntry.setStatus('current')
sw_port_sec_vlanid = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094)))
if mibBuilder.loadTexts:
swPortSecVLANID.setStatus('current')
sw_port_sec_vlan_max_lern_addr = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1, 2), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecVLANMaxLernAddr.setStatus('current')
sw_port_sec_vlan_clear_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 2, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('other', 1), ('start', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecVLANClearCtrl.setStatus('current')
sw_port_sec_mgmt_by_vlan_on_port = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3))
sw_port_sec_vlan_on_port_table = mib_table((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1))
if mibBuilder.loadTexts:
swPortSecVLANOnPortTable.setStatus('current')
sw_port_sec_vlan_on_port_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1, 1)).setIndexNames((0, 'DLINK-PORT-SECURITY-MIB', 'swPortSecPortIndex'), (0, 'DLINK-PORT-SECURITY-MIB', 'swPortSecVLANID'))
if mibBuilder.loadTexts:
swPortSecVLANOnPortEntry.setStatus('current')
sw_port_sec_vlan_on_port_max_lern_addr = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1, 1, 1), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecVLANOnPortMaxLernAddr.setStatus('current')
sw_port_sec_vlan_on_port_add_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('other', 1), ('add', 2)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
swPortSecVLANOnPortAddCtrl.setStatus('current')
sw_port_sec_mgmt_by_vlan_on_port_clear_ctrl = mib_identifier((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2))
sw_port_sec_mgmt_by_vlan_on_port_clear_port = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2, 1), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecMgmtByVLANOnPortClearPort.setStatus('current')
sw_port_sec_mgmt_by_vlan_on_port_clear_vid = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2, 2), integer32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecMgmtByVLANOnPortClearVID.setStatus('current')
sw_port_sec_mgmt_by_vlan_on_port_clear_action = mib_scalar((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 3, 2, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('other', 1), ('start', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecMgmtByVLANOnPortClearAction.setStatus('current')
sw_port_sec_entries_table = mib_table((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4))
if mibBuilder.loadTexts:
swPortSecEntriesTable.setStatus('current')
sw_port_sec_entries_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1)).setIndexNames((0, 'DLINK-PORT-SECURITY-MIB', 'swPortSecMac'), (0, 'DLINK-PORT-SECURITY-MIB', 'swPortSecVID'))
if mibBuilder.loadTexts:
swPortSecEntriesEntry.setStatus('current')
sw_port_sec_mac = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 1), mac_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swPortSecMac.setStatus('current')
sw_port_sec_vid = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 4094))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swPortSecVID.setStatus('current')
sw_port_sec_port = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
swPortSecPort.setStatus('current')
sw_port_sec_del_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 171, 12, 63, 3, 4, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('other', 1), ('start', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
swPortSecDelCtrl.setStatus('current')
mibBuilder.exportSymbols('DLINK-PORT-SECURITY-MIB', swPortSecDelCtrl=swPortSecDelCtrl, swPortSecVLANOnPortEntry=swPortSecVLANOnPortEntry, swPortSecVLANEntry=swPortSecVLANEntry, swPortSecPortClearCtrl=swPortSecPortClearCtrl, swPortSecPort=swPortSecPort, swPortSecTrapState=swPortSecTrapState, swPortSecMgmtByVLANOnPortClearPort=swPortSecMgmtByVLANOnPortClearPort, swPortSecMgmtByVLANOnPortClearAction=swPortSecMgmtByVLANOnPortClearAction, swPortSecPortLockAddrMode=swPortSecPortLockAddrMode, swPortSecCtrl=swPortSecCtrl, swPortSecLogState=swPortSecLogState, swPortSecVLANID=swPortSecVLANID, swPortSecVLANOnPortMaxLernAddr=swPortSecVLANOnPortMaxLernAddr, swPortSecMIB=swPortSecMIB, swPortSecPortViolationAction=swPortSecPortViolationAction, swPortSecMgmtByVLANOnPortClearVID=swPortSecMgmtByVLANOnPortClearVID, swPortSecVLANMaxLernAddr=swPortSecVLANMaxLernAddr, swPortSecPortAdmState=swPortSecPortAdmState, swPortSecMgmtByVLAN=swPortSecMgmtByVLAN, swPortSecPortTable=swPortSecPortTable, swPortSecMac=swPortSecMac, swPortSecEntriesTable=swPortSecEntriesTable, swPortSecSysMaxLernAddr=swPortSecSysMaxLernAddr, swPortSecVLANTable=swPortSecVLANTable, swPortSecMgmt=swPortSecMgmt, swPortSecVLANOnPortTable=swPortSecVLANOnPortTable, swPortSecTrapLogState=swPortSecTrapLogState, swPortSecVLANClearCtrl=swPortSecVLANClearCtrl, swPortSecVID=swPortSecVID, swPortSecMgmtByVLANOnPortClearCtrl=swPortSecMgmtByVLANOnPortClearCtrl, swPortSecEntriesEntry=swPortSecEntriesEntry, swPortSecPortMaxLernAddr=swPortSecPortMaxLernAddr, swPortSecPortEntry=swPortSecPortEntry, swPortSecInfo=swPortSecInfo, swPortSecPortIndex=swPortSecPortIndex, swPortSecMgmtByPort=swPortSecMgmtByPort, swPortSecVLANOnPortAddCtrl=swPortSecVLANOnPortAddCtrl, PYSNMP_MODULE_ID=swPortSecMIB, swPortSecMgmtByVLANOnPort=swPortSecMgmtByVLANOnPort) |
class Node:
def __init__(self):
self.data=None
self.next=None
class Linked_List(Node):
def __init__(self):
self.start=None
def Create(self):
while True:
newnode=Node()
newnode.data=int(input("Enter data part : "))
if self.start==None:
self.start=newnode
current=newnode
else:
current.next=newnode
current=newnode
char=input("DO YOU WANT TO ENTER MORE NODES? : ")
if char in ('n','N'):
break
def Display(self):
ptr=self.start
print("\n\nDATA IS AS FOLLOWS : \n")
while ptr!=None:
print(ptr.data,end=' ')
ptr=ptr.next
print()
def Reverse(self,ptr):
if ptr==None:
return
self.Reverse(ptr.next)
print(ptr.data)
l1=Linked_List()
l1.Create()
l1.Display()
l1.Reverse(l1.start)
| class Node:
def __init__(self):
self.data = None
self.next = None
class Linked_List(Node):
def __init__(self):
self.start = None
def create(self):
while True:
newnode = node()
newnode.data = int(input('Enter data part : '))
if self.start == None:
self.start = newnode
current = newnode
else:
current.next = newnode
current = newnode
char = input('DO YOU WANT TO ENTER MORE NODES? : ')
if char in ('n', 'N'):
break
def display(self):
ptr = self.start
print('\n\nDATA IS AS FOLLOWS : \n')
while ptr != None:
print(ptr.data, end=' ')
ptr = ptr.next
print()
def reverse(self, ptr):
if ptr == None:
return
self.Reverse(ptr.next)
print(ptr.data)
l1 = linked__list()
l1.Create()
l1.Display()
l1.Reverse(l1.start) |
# -------------------
# Universal Exception
# -------------------
class FontPartsError(Exception):
pass
| class Fontpartserror(Exception):
pass |
for i in range(2,10):
flag=0
s=0
for j in range(2,i//2+1):
if i%j==0:
flag=1
break
if flag==0:
s+=i
print('prime',i,s)
| for i in range(2, 10):
flag = 0
s = 0
for j in range(2, i // 2 + 1):
if i % j == 0:
flag = 1
break
if flag == 0:
s += i
print('prime', i, s) |
class RoadmapNode:
def __init__(self, id, config):
self.id = id
self.config = config
self.neighbors = []
def get_config(self):
return self.config
def get_id(self):
return self.id
''' Add another RoadmapNode as neighbor. '''
def add_neighbor(self, node):
self.neighbors.append(node)
def get_neighbors(self):
return self.neighbors
def __len__(self):
return 3
def __getitem__(self, i):
return self.config[i]
def __repr__(self):
return 'Item({}, {})'.format(self.config[0], self.config[1]) | class Roadmapnode:
def __init__(self, id, config):
self.id = id
self.config = config
self.neighbors = []
def get_config(self):
return self.config
def get_id(self):
return self.id
' Add another RoadmapNode as neighbor. '
def add_neighbor(self, node):
self.neighbors.append(node)
def get_neighbors(self):
return self.neighbors
def __len__(self):
return 3
def __getitem__(self, i):
return self.config[i]
def __repr__(self):
return 'Item({}, {})'.format(self.config[0], self.config[1]) |
class AudioError(Exception):
""" Any audio-related error.
This is used as the base error type for all errors in the audio module.
"""
pass
class MixerError(AudioError):
""" An audio mixer IO error.
An error that occurs while loading audio data from disk.
"""
pass
class RequestError(AudioError):
""" A TTS request IO error.
An error that occurs when writing a request to disk.
"""
pass
class TTSError(AudioError):
""" A TTS invocation error.
An error that occurs when the external TTS command fails. This is raised
when the DEC invocation returns an error code other than zero. Information
written to stderr by DEC is usually included with this exception.
"""
pass
| class Audioerror(Exception):
""" Any audio-related error.
This is used as the base error type for all errors in the audio module.
"""
pass
class Mixererror(AudioError):
""" An audio mixer IO error.
An error that occurs while loading audio data from disk.
"""
pass
class Requesterror(AudioError):
""" A TTS request IO error.
An error that occurs when writing a request to disk.
"""
pass
class Ttserror(AudioError):
""" A TTS invocation error.
An error that occurs when the external TTS command fails. This is raised
when the DEC invocation returns an error code other than zero. Information
written to stderr by DEC is usually included with this exception.
"""
pass |
model_source = 'bert-base-chinese'
max_len = 512
num_workers = 2
batch_size = 32
# for training
manual_seed = 1313
exp_name = 'bert_detection'
train_json = 'data/aishell3_train.json'
valid_json = 'data/aishell3_valid.json'
lr = 5e-5
val_interval = 100
num_iter = 10000
| model_source = 'bert-base-chinese'
max_len = 512
num_workers = 2
batch_size = 32
manual_seed = 1313
exp_name = 'bert_detection'
train_json = 'data/aishell3_train.json'
valid_json = 'data/aishell3_valid.json'
lr = 5e-05
val_interval = 100
num_iter = 10000 |
#!/usr/bin/env python
# coding: utf-8
def sort_blocks():
# First, we load the current README into memory
with open('README.md', 'r', encoding='UTF8') as read_me_file:
read_me = read_me_file.read()
# Separating the 'table of contents' from the contents (blocks)
table_of_contents = ''.join(read_me.split('- - -')[0])
blocks = ''.join(read_me.split('- - -')[1]).split('\n# ')
for i in range(len(blocks)):
if i == 0:
blocks[i] = blocks[i] + '\n'
else:
blocks[i] = '# ' + blocks[i] + '\n'
# Sorting the libraries
inner_blocks = sorted(blocks[0].split('##'))
for i in range(1, len(inner_blocks)):
if inner_blocks[i][0] != '#':
inner_blocks[i] = '##' + inner_blocks[i]
inner_blocks = ''.join(inner_blocks)
# Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file
blocks[0] = inner_blocks
final_README = table_of_contents + '- - -' + ''.join(blocks)
with open('README.md', 'w+', encoding='UTF8') as sorted_file:
sorted_file.write(final_README)
def main():
# First, we load the current README into memory as an array of lines
with open('README.md', 'r', encoding='UTF8') as read_me_file:
read_me = read_me_file.readlines()
# Then we cluster the lines together as blocks
# Each block represents a collection of lines that should be sorted
# This was done by assuming only links ([...](...)) are meant to be sorted
# Clustering is done by indentation
blocks = []
last_indent = None
for line in read_me:
s_line = line.lstrip()
indent = len(line) - len(s_line)
if s_line.startswith('-'):
if indent == last_indent:
blocks[-1].append(line)
else:
blocks.append([line])
last_indent = indent
else:
blocks.append([line])
last_indent = None
with open('README.md', 'w+', encoding='UTF8') as sorted_file:
# Then all of the blocks are sorted individually
blocks = [
''.join(sorted(block, key=str.lower)) for block in blocks
]
# And the result is written back to README.md
sorted_file.write(''.join(blocks))
# Then we call the sorting method
sort_blocks()
if __name__ == "__main__":
main() | def sort_blocks():
with open('README.md', 'r', encoding='UTF8') as read_me_file:
read_me = read_me_file.read()
table_of_contents = ''.join(read_me.split('- - -')[0])
blocks = ''.join(read_me.split('- - -')[1]).split('\n# ')
for i in range(len(blocks)):
if i == 0:
blocks[i] = blocks[i] + '\n'
else:
blocks[i] = '# ' + blocks[i] + '\n'
inner_blocks = sorted(blocks[0].split('##'))
for i in range(1, len(inner_blocks)):
if inner_blocks[i][0] != '#':
inner_blocks[i] = '##' + inner_blocks[i]
inner_blocks = ''.join(inner_blocks)
blocks[0] = inner_blocks
final_readme = table_of_contents + '- - -' + ''.join(blocks)
with open('README.md', 'w+', encoding='UTF8') as sorted_file:
sorted_file.write(final_README)
def main():
with open('README.md', 'r', encoding='UTF8') as read_me_file:
read_me = read_me_file.readlines()
blocks = []
last_indent = None
for line in read_me:
s_line = line.lstrip()
indent = len(line) - len(s_line)
if s_line.startswith('-'):
if indent == last_indent:
blocks[-1].append(line)
else:
blocks.append([line])
last_indent = indent
else:
blocks.append([line])
last_indent = None
with open('README.md', 'w+', encoding='UTF8') as sorted_file:
blocks = [''.join(sorted(block, key=str.lower)) for block in blocks]
sorted_file.write(''.join(blocks))
sort_blocks()
if __name__ == '__main__':
main() |
for i in range(int(input())):
s = input().split()
if 'not' in s:
print('Real Fancy')
else:
print('regularly fancy')
| for i in range(int(input())):
s = input().split()
if 'not' in s:
print('Real Fancy')
else:
print('regularly fancy') |
def gcd(a, b):
"""
a, b: two positive integers
Returns the greatest common divisor of a and b
"""
if b == 0:
return a
return gcd(b, a % b)
def general_poly (L):
""" L, a list of numbers (n0, n1, n2, ... nk)
Returns a function, which when applied to a value x, returns the value
n0 * x^k + n1 * x^(k-1) + ... nk * x^0 """
def in_poly(x):
result = 0
for k in range(len(L)):
result += L[k] * x**(len(L) - k - 1)
return result
return in_poly
if __name__ == "__main__":
print(general_poly([1, 2, 3, 4])(10))
print(general_poly([1, 2, 3, 4])(-7))
print(general_poly([1, 2, 3, 4])(4.32))
| def gcd(a, b):
"""
a, b: two positive integers
Returns the greatest common divisor of a and b
"""
if b == 0:
return a
return gcd(b, a % b)
def general_poly(L):
""" L, a list of numbers (n0, n1, n2, ... nk)
Returns a function, which when applied to a value x, returns the value
n0 * x^k + n1 * x^(k-1) + ... nk * x^0 """
def in_poly(x):
result = 0
for k in range(len(L)):
result += L[k] * x ** (len(L) - k - 1)
return result
return in_poly
if __name__ == '__main__':
print(general_poly([1, 2, 3, 4])(10))
print(general_poly([1, 2, 3, 4])(-7))
print(general_poly([1, 2, 3, 4])(4.32)) |
input = [
"17-19 p: pwpzpfbrcpppjppbmppp",
"10-11 b: bbbbbbbbbbbj",
"17-19 c: ccccccccccfrcctcccjc",
"8-10 k: kkkkkkkfkkks",
"13-14 l: lvllvllllslllv",
"8-9 n: nhhcnnnknnqnb",
"1-3 d: pdbdfbws",
"5-6 v: vvvgvb",
"7-8 x: gxcxtwbl",
"2-15 r: xlgrwqpcsqtrvfrrt",
"9-14 l: glnldlllllllln",
"2-3 r: vxnw",
"8-9 g: gfggczgkgggjgg",
"4-5 d: ddddh",
"6-9 t: zttttbhbttttftd",
"3-6 k: kkkzwnmv",
"2-7 w: sgmvplwwjx",
"11-13 h: hhhvhhhhhhvhh",
"9-10 f: mhfdfffffmlffsfvts",
"17-18 l: llllllllllllllllrzl",
"4-5 c: crcccccccvc",
"9-12 q: qqqqqpqrqqlcq",
"7-8 n: nnnnnndn",
"3-5 f: ffqnfpffhf",
"3-4 j: djpj",
"17-18 q: qqqqqqqmqqsqqqqqjq",
"8-15 j: bjmjbbqfjjrgjgfkjj",
"2-11 d: xdgdmxgwzdpdxdhjwd",
"8-9 p: bppppppmp",
"10-11 t: ttttttttttb",
"5-8 v: vhxvfcsvvxjvvvpgwdv",
"9-17 q: mqqqqqqqqqjvqqqqzlq",
"1-2 t: tptbbn",
"9-11 q: gqqqqqqfwqqqq",
"8-9 h: hsdsfkgphxglmsjndhh",
"2-3 z: mzgz",
"4-16 n: nxnsqmrnnnpfvnfnb",
"1-3 r: rbzcrkjrqrrnjxj",
"1-5 c: ccccccq",
"4-11 m: mmmgmmmmmmm",
"8-9 z: zlzvzzzpzz",
"1-18 h: xzqhmkzhhrtxpljptbc",
"3-4 p: pbpg",
"16-20 j: jrfjjzjjjrjjgvjkzjjj",
"6-9 t: ctdtthtlttttpt",
"3-4 h: mfhj",
"5-10 t: tgtxttqhtl",
"1-3 w: fwgw",
"6-7 q: qvqlrqp",
"12-13 m: mmmmmmmmrmmmplm",
"12-14 r: rrrrhrrrrrrrrbrc",
"4-6 b: ljzbqgwxcdmdjfbcwd",
"7-10 g: gggggggmgpg",
"2-3 c: mbcc",
"7-8 k: kbkkkktkckc",
"7-8 p: pppppppbp",
"5-8 w: twwwwwwgvvwvdttmh",
"13-17 p: ppppfppppppppppppp",
"8-12 x: xxxcxxxbjxxxxk",
"9-18 b: hhbbqcbbbsblbgpwbbhf",
"6-8 h: hhhhfhhchhjhhch",
"7-11 g: ggtnwvcdgctkrggxj",
"5-8 k: kknhndzm",
"4-5 z: zzznz",
"2-4 p: pbtp",
"16-18 r: rrrrtrrrrrrrrrrhrr",
"15-16 r: rhrrrrrrrrrrrrrx",
"7-10 l: lllklmhxzlxcdljz",
"7-8 q: qqpwsqqb",
"9-13 k: qkknkkxlzkrkkkkkpk",
"4-8 h: wlrhfbth",
"6-8 q: vppqqqgntfqqgqq",
"19-20 g: ggggggggggggggggggfg",
"4-5 m: shmzmsdm",
"3-4 k: kkhkk",
"4-7 b: cbsqkcpnkcfzhmpvfvgz",
"18-19 l: lllllllnllltdlwgllxl",
"14-15 z: zztzzzthdzzzzzn",
"9-10 s: ksssbsssstss",
"2-10 t: mltjpttttthpttttz",
"3-9 n: pqnpfxgfnzqxv",
"7-11 d: ndddddhdddddddd",
"11-13 v: vkvbwrchzvhhvpc",
"13-15 l: llllllllllllllll",
"10-13 c: ccclwbcbccbxvcrdzctc",
"8-9 w: klvwtwwwbwhww",
"2-4 j: mnmb",
"10-14 w: wwwmwwwwwwwwlnwsw",
"14-17 x: xxxxxxxxxxxxxlxxkxx",
"3-7 r: bxrqzxsrfmclfdrqrtpf",
"7-14 b: bbbbqbbbbbbbbbbbbbb",
"7-13 p: wwvhwdprjxppwnhsbp",
"2-3 h: hqhh",
"8-11 n: nnnnnnnjcnn",
"5-12 l: cwzxlpvwlsfjqrgk",
"3-5 v: vvphwvv",
"5-16 d: dpdrdfdrhwdrrqdqxd",
"14-18 z: zzzzzzzzzzzzzzzzzkzz",
"2-5 h: hcjlh",
"12-13 w: wwwwwwwwwbwlw",
"15-16 c: ccccccccccccccxc",
"4-7 b: lbbsbbwhb",
"2-5 z: qtwmzhzmwqw",
"5-6 d: drjddc",
"7-9 q: qqqqjqqfdqq",
"14-15 r: rvrqrrrrrwsrrmrrd",
"16-17 h: hhhhhhhhhhhhhhhhlh",
"10-16 f: fvhgfzffchmffgfff",
"3-7 q: qcqlvdvgrqtqcq",
"7-9 x: xxsxxrxxpsx",
"3-10 h: hjhjthhrthcdhhhhxz",
"15-16 t: tttttttztwbwptjt",
"3-5 x: xrlxqx",
"3-4 b: bbbp",
"1-4 n: jnhnndn",
"3-6 c: ccccfm",
"7-8 v: tvtvdvspvvv",
"6-8 l: lljlllgsglcsw",
"2-13 h: jhzzcgpxhbgqsbwhf",
"17-18 j: jjjjjjjjjjjjjjjjhc",
"2-3 c: ctcchxklnbrqc",
"3-14 w: wwcwwwwwwwcwww",
"1-3 k: kcxf",
"9-14 t: ttttkttlnttmtttt",
"2-4 x: xkxxqzxvck",
"5-6 h: dgmxghjxjnhs",
"4-12 f: fvhlffxnfjhfffqxfcf",
"1-10 b: pfsbflbbkbqk",
"8-9 s: qzkfszjss",
"1-14 m: mmmmmsmmxmqmmmmmmmm",
"11-13 w: nsgwwwwwwpbwvwww",
"2-15 t: sprsbpztsznslst",
"3-4 d: tqscgnrjxrqdwqd",
"5-17 x: xqrzxxxxfxzxrzxxxw",
"8-9 m: mkmhmgdmq",
"6-8 q: qqqqqqqxq",
"2-5 m: mmmmmf",
"4-13 v: gvvvsvfmmmvvx",
"13-16 t: ttttttttgtvtwttntt",
"8-16 c: ccccccczccccccccc",
"10-11 b: bbbbbbkbbvbbbbb",
"1-12 n: pnnnnbnhnnbng",
"5-6 b: qbbbbb",
"4-6 z: zzzzzvjzzznxdzx",
"2-3 p: dwxqpjp",
"4-6 w: wwwxwq",
"2-3 x: pvpdh",
"5-8 n: pqnnkncnnfnnnnnn",
"10-12 w: drqwwxrwwkwwwswwl",
"2-4 g: rbggfslgjqqhj",
"9-19 r: pzxhrcfrrrqjqfkhrhjz",
"3-6 n: rngtnnnnn",
"4-14 t: tttttttttttftgttttht",
"6-8 q: qqdtqqmrgqcqqqqc",
"3-14 t: tttnttttttttqk",
"9-10 w: qqwcjzwgjnqdrdxwjwl",
"10-12 t: tthtthtktvtttt",
"2-7 v: vzvvvvv",
"5-17 p: zzpsmpgpprdmhxprsvs",
"8-9 t: ttttttvnt",
"4-8 v: vvvfvvvvvvvvvvv",
"7-15 h: cwkhdzmththzjnh",
"7-9 v: vjvlwzvvmv",
"1-2 c: hchw",
"7-8 f: ffpfffsfqf",
"5-8 s: xlssskszb",
"2-15 x: fxzpbvqzmkxvtlljjrg",
"1-3 s: hsss",
"7-14 m: xmmtmmmgmrmmxzmxm",
"10-13 z: dnzztzzzzzfszxzczg",
"3-8 h: rhthhnhh",
"6-9 g: hbggggggggbg",
"13-15 z: zzzzpzbzzzzzfzzz",
"5-15 l: llllwlllllllllll",
"3-5 m: dhmmm",
"2-13 h: hrrhgqhhnhkhhhhb",
"1-5 p: kpppp",
"2-13 m: fmqjmrzhskzwdnt",
"7-8 q: bqxvzqqsjpqqqq",
"2-13 d: ddhdddddddddbddddd",
"5-9 s: nhkmxssqsjssjs",
"2-11 b: vlrtxpzkqwb",
"6-7 q: qqqqqcq",
"7-9 n: nnnnnknnmgn",
"3-9 n: qfkxknwnn",
"15-16 d: dddddddddddddddgd",
"12-13 h: hhhhhhhhhjmvhhh",
"3-4 w: tbfw",
"8-9 f: fkffbfhtf",
"2-4 q: qjsqqf",
"2-11 t: ttttpdgtlxhtx",
"7-10 k: dkkkkkkkkh",
"6-7 c: hccccxcgv",
"6-7 j: sjcbfmj",
"1-2 w: vtrwjcgndvwx",
"12-13 m: mmmcmmmmmmmms",
"3-7 h: hhhhhhw",
"9-13 g: gghgwgrrkgcgg",
"12-13 g: gggggggggggfgggg",
"13-16 s: sssssssfsssssszb",
"2-17 p: pbpmpmwpnqppppppphbd",
"2-9 c: cmrcwfnjcdcxccccrzc",
"8-12 j: jvjjjcjxjjdqjjjr",
"6-9 m: mgjxmcfdm",
"2-5 l: klmxlx",
"2-10 x: jvxwxpxrxx",
"2-3 r: rrzrp",
"2-12 v: cbfrnctdmzwvlbvjmdgg",
"2-9 r: wrbrrrrzm",
"12-13 h: fhsbhhhhhhhwhhhhhh",
"5-8 d: ddhqdddddp",
"4-5 l: djnlnlllbl",
"2-9 t: tdtgttddtwwj",
"16-20 t: tttttttttttttttttttt",
"5-8 z: zzzszzzmszz",
"8-13 d: dddddddbdzwddd",
"9-10 z: zzztzzzhzxgz",
"10-12 p: wppcppxpppgpppzr",
"4-5 w: wkwtwwzww",
"3-9 m: dmmmrmmmm",
"1-4 g: gvmr",
"8-9 d: frxndpdzwd",
"17-20 q: qqqqqqnqqqqqqqqqhqqq",
"7-13 w: pwfwwrwwwkwww",
"3-5 q: qqpqw",
"11-13 p: pplpppppppppb",
"4-12 g: glggjmsggggjrgbgm",
"3-7 p: cfphqrxpsgthp",
"12-15 f: gfnrhffgftnbggfwtbp",
"16-18 p: pppppppppppppppppm",
"3-4 l: lllzn",
"1-2 d: dddd",
"8-12 n: nnnnxnnhnnnn",
"2-4 z: zzzzz",
"1-4 s: sssms",
"2-4 h: hghhh",
"1-10 l: nhtnzhdtmslxqskf",
"5-13 j: bpzjjrrqzndjtw",
"1-2 x: xxchn",
"1-16 v: vjvrxvdbdnvvkzvg",
"9-10 b: xbvzbbmfmbqbbvbbrb",
"8-12 k: ktnkfbgkkkkbkmkk",
"7-9 h: hhhhhhwhh",
"16-17 g: sgggmggggggggggvggg",
"3-10 q: qmlqqqqqqq",
"11-14 h: hhhxhhhhhchhwkh",
"9-14 f: kqwqcftkfdxgmsd",
"12-13 p: pppppppppppph",
"7-8 f: dkfnjfff",
"5-6 f: jtfrrfxckhfmfffszggg",
"6-8 n: jzhpkszn",
"8-10 c: cccccnckcxmrchjc",
"14-15 d: dddjdjdddddddpp",
"8-10 f: cfshmqfffwtffltfzff",
"3-4 b: bdbq",
"2-6 b: cfqkbtvmn",
"15-16 z: zgzzqzjhzzmnzkzvzz",
"4-6 r: krrrrlm",
"3-6 c: dcczrfr",
"8-9 s: ssssssfws",
"11-12 s: mssssssssssq",
"1-2 r: zrznpmzrs",
"10-11 k: kkkkkkkkkfk",
"3-9 k: kbkkkkgkk",
"1-4 w: lwwtw",
"3-4 t: ttkt",
"2-3 m: htvmjk",
"2-4 p: mdpp",
"10-17 s: ssssssssssssssssws",
"1-2 m: gmmc",
"5-9 d: dddbvjkdd",
"5-8 z: tmnfplzz",
"7-14 s: ssssssssssssstkss",
"2-7 q: gqbcxnqcvszwbxqkz",
"6-17 b: btbxlbbbbbbbbbvtbkd",
"6-9 l: lllllllld",
"11-12 q: nqqjjrhgxgqp",
"6-9 n: nlnnfnnjb",
"13-17 x: xnxxxxxxxxbdbxxrc",
"5-13 w: wwtwrwzwwwqfwtkwtwbw",
"5-10 g: gggxbgmgrgggggg",
"13-16 h: mhhhhmshhchhhhhl",
"2-3 f: flff",
"2-4 k: kkhr",
"2-6 m: mmmqmml",
"6-7 p: ppppppp",
"2-6 k: ksktkkk",
"2-4 m: gkml",
"5-6 h: hhvqhjz",
"2-5 h: hkhqhfh",
"3-4 z: zzglz",
"2-3 f: zhfn",
"10-11 m: mmzmmmmmmfmm",
"3-13 d: ddwzdmmddmddz",
"1-2 h: hvkhm",
"4-5 n: nnnnb",
"5-7 f: fjppbffffz",
"2-4 g: tmlp",
"15-16 q: bqfvqqqcptqqzqqx",
"18-19 g: lpgqgcgsdtngfddbggnp",
"3-5 z: kjzkq",
"1-6 q: qjkqqzqq",
"3-4 m: bpmmjgmmfmj",
"2-5 k: jkvkz",
"11-14 q: qqqbjqqqqqgqqq",
"6-17 q: bfqqtlqqfjgqtqtqs",
"5-16 s: ssdzfbsdhsszspssvs",
"1-7 n: nhnvmhb",
"4-5 b: hbbrk",
"9-14 f: fffbffkfftcfnfgf",
"1-3 n: nznxndpb",
"3-4 k: qkktw",
"3-8 r: rrprrgrrr",
"2-5 l: sqmllls",
"6-7 n: njnknvnnpvlbnx",
"3-5 t: hbrtmcttt",
"5-9 j: fjjnjcgjhnkcpqjbc",
"2-4 l: jllx",
"7-8 d: dddddndd",
"3-6 t: gtsttjnt",
"9-11 m: cbmgjlqcbsmllm",
"1-2 l: vllfcckl",
"10-11 p: ppppzppppplp",
"2-4 m: slzmmrw",
"3-8 h: bhhgmpbs",
"7-14 t: tttttthttttttttt",
"1-3 r: rrvvrrprwrfrcr",
"5-15 w: gwbhwjwwwkswcsww",
"2-5 v: zvtls",
"1-4 v: vsvv",
"10-15 z: zzzzzzzzzztrjzr",
"3-5 v: vvvjhdvv",
"3-12 s: wqssnmdlwlws",
"2-3 r: djrftptcrskpzrz",
"1-3 p: nbppgkmfnjp",
"17-18 w: wwwwwwwwtwwwwwwwrw",
"2-5 l: xqntklqlt",
"2-5 g: gtkggghcvgl",
"18-19 z: zzzzzzgzzzzzzzzzzztz",
"16-17 x: xxcxxwxxblpxzkfxzj",
"15-19 f: frffffstcwffccffffff",
"3-4 n: npnm",
"2-3 d: zvddd",
"7-9 x: xzxxctxxl",
"13-14 s: hhsxbzssdtssfss",
"4-5 m: vbpmhmrmvrjnmhlsbmm",
"3-6 z: zzzzzwdzzzzzzzzzz",
"18-19 g: gggggggggggggggggng",
"14-15 x: fxxjxxxxxxmxxwxxnxb",
"10-12 m: xmmmmfmdmmkh",
"3-4 b: bbgbgb",
"11-13 c: cclcccbcxcccqcczc",
"10-17 w: wwwwwwwswwwwwwnwpw",
"5-7 l: blllqll",
"4-10 n: nnnnnnnnntn",
"9-10 z: fzzztzczwzzgkzzn",
"4-5 x: gxjhxbxxx",
"3-6 p: plhxppk",
"10-19 p: mpgpmxdvqphrcckpvqw",
"3-14 p: kfdwtqxpstpcfpgcfmp",
"2-6 k: gnxkkkjrzkknskmpbsj",
"8-10 l: lzllklldplllzl",
"16-17 n: nnnsnnnnnnnnpnnjnnn",
"1-14 c: kccccccccgccccc",
"2-11 s: lsqghkzwsgsbdmgq",
"6-7 p: pcpgqrcpqpptpm",
"1-11 h: lhhhhhhhhqhhxbhhfhhh",
"11-12 r: rrhjrbrrvrrrrdrrr",
"5-8 c: cccccwck",
"6-8 w: wwwwwwwb",
"12-15 n: htvxnnhvnpnnknnhnt",
"1-2 c: jcct",
"2-10 v: vsvvvvvvvvv",
"4-5 x: xhxtx",
"3-4 f: ffxf",
"5-8 v: wprmvflppqwvwfwpkq",
"5-7 n: znnnnnxblcrn",
"8-9 n: zljnjjbnn",
"10-11 m: mzwkrvmzrdc",
"3-7 h: hxkhfhcqhr",
"6-13 j: vhcmljdxwkqnfcvmjjb",
"1-6 g: gvgggthkr",
"6-10 l: bldnllklkllllclslm",
"6-7 g: gggggng",
"1-4 x: xxxxxpnsv",
"15-16 q: qqqqqsqqqqqqqqqbq",
"6-7 q: qnqqqdqqq",
"5-6 p: ppppspppp",
"3-5 k: kkskkk",
"1-2 j: jrjjjjj",
"8-9 d: ddpzdlldmddhdhdd",
"5-8 t: ttsljtnt",
"2-4 w: qwwmwwhwwwwwwww",
"6-8 c: clcccccv",
"1-8 f: ffbfqfpfbfb",
"5-13 r: rrrrkrrrrrrrrr",
"15-18 v: vvvvvvvvjvvvvvvvvvvv",
"7-8 r: xjwxkzqrrxr",
"7-10 d: kddddddddbddd",
"1-8 k: kkkkkkkkk",
"4-6 q: rhdkjsqjqvzqcpsnq",
"1-2 t: tdtt",
"5-6 l: lllwlh",
"3-5 f: pdzfff",
"7-8 s: qsswssks",
"3-5 d: dcdddd",
"1-12 r: rvlrrrwdtkrcxffr",
"2-7 d: rddcdlqtnffbdd",
"5-9 t: phmtdzfjtdb",
"9-12 x: jxxxxxxxxxxcx",
"14-16 c: fcclccccmcnccwccqccv",
"4-5 p: zxpzk",
"15-19 t: ttttttttttttfkttttl",
"5-10 k: kdmjgkkkkkblkvkkkk",
"6-15 q: wqgmcqcmcjlgxkqrdstw",
"6-7 r: rrrrrrr",
"2-6 n: ksnnnnnzn",
"16-17 g: ggggggggggggggghgg",
"11-13 k: nsgkkkkzckxtkn",
"2-5 q: jqvkqm",
"2-10 q: lpqqmqlqqqqqtqqw",
"10-20 k: dkztkkkkshkkkkkkkkdk",
"4-7 d: fddddxd",
"3-5 v: vvvvs",
"7-9 b: bbbbbbrzb",
"4-14 z: nbnzkbxbwhqpjsdlzz",
"3-14 x: xxvxxxnxxxxxxxdxktxx",
"7-9 z: qqpzzxzvsgzfzdzz",
"14-15 c: ccccccccccccccmc",
"11-12 k: kkkkkkkkkskv",
"15-16 d: ddddddddddddddddd",
"6-8 x: xkjhxwgxxzxxnzwxcxk",
"2-6 t: tmwttc",
"7-8 w: jwcwwwql",
"5-14 d: jdpddtkddrdddpq",
"9-14 t: mwctmnjxmztckt",
"4-8 l: llnlxlmjn",
"3-6 s: sssskvk",
"4-8 c: ccchcrctczt",
"4-6 s: wssnlsnsss",
"8-18 s: sfkssssbswshsvshms",
"6-7 b: bbkbcffmwblcmp",
"8-15 w: fwwmswcwwhlwjwvtlq",
"2-9 n: wnnnnmqhdpsnzn",
"1-7 x: xkzzxpz",
"5-8 x: txxxxmlxkrxsxzsx",
"7-10 t: lchndztdttgk",
"1-2 q: tqqq",
"1-9 z: nzzzzzzzz",
"1-2 l: djfmfwpnjclt",
"2-6 x: xxxxxmxxs",
"2-4 p: ppcv",
"4-10 d: dddpddddddd",
"8-11 n: nnnnnnnxnnnn",
"17-18 v: vvvvnvtvvvjvvvvvzzvv",
"5-8 h: hhhhhhhfhh",
"9-16 v: vvvvvvvbvvvvsvtq",
"3-4 r: hrhrrtrgrr",
"11-17 g: mvgggwggggggwggxw",
"3-6 r: rrnrrgrrrr",
"8-10 n: rgjntnrmkn",
"6-7 f: sffftmm",
"4-5 b: bbddn",
"4-9 d: cdrbqddsqqpzkdd",
"9-17 n: nnnnnnnnrnnnnnnnjn",
"1-4 n: knnn",
"15-16 k: kkkhkkkkkkkkkkkv",
"15-17 v: jkrddvtmgfqvqvvxk",
"10-16 j: jjjjjjjjgpsjhjjljjj",
"9-10 d: jdndwddvdrhndddd",
"5-7 x: bxxxxwmcb",
"5-7 r: mlrrdsrrrnrgwrrq",
"14-17 h: hhhlhhhhhhhhhhhhm",
"1-12 n: zpnwtpnnnnxzm",
"11-19 k: ccktkhkwthkkklkvhkmk",
"6-14 s: sfssxsscssgssqhsnssl",
"17-18 g: ggdgggggggggfgggrggg",
"4-13 k: dwddvztkhjnzk",
"17-19 k: kkkkkkkkkkkkkkkkkkx",
"5-8 q: qmqzqqqqqqqqqcqq",
"2-4 q: vqqqqhxd",
"1-13 c: fjccqcmrcjxgccdvbzr",
"8-12 h: hkhhhhhhhvhhch",
"4-10 w: jmwfwxwwkwwcnbwwftrc",
"8-11 f: fffffffbffdf",
"12-18 b: bbbbbbbbbbbcbbbbbbb",
"2-8 k: rdwwjvrkcs",
"13-14 p: pppphpnppppphpppp",
"1-3 d: nddddddddddd",
"5-8 m: mmfdkmnfmqm",
"2-9 x: xjgwxxxxxl",
"1-2 v: vhvsvv",
"11-17 r: tlrgrrrrrwrzrrrrsrr",
"1-7 c: lcclcvgk",
"3-5 s: slnkss",
"3-4 w: hqwbw",
"11-19 l: lfxllllllldlllllllq",
"4-5 t: tttbt",
"10-12 g: gggggggggsgfg",
"6-8 k: kkmkkkkmk",
"10-11 q: qqqqqqpqqpsqd",
"5-17 k: pxwkmdxkskthkkkkn",
"14-16 m: mmmmmmmmmmmmmpmmmmmm",
"14-15 k: kkkkkkkkkjkkkkt",
"13-14 c: ccccccdccccccccccccc",
"1-2 v: gvmqqnkpln",
"4-6 k: lwkkkjgwkkk",
"1-12 h: mhhthhghhhhhhhhh",
"6-7 t: ptxtwtg",
"3-9 j: zsjkcjlzj",
"5-8 q: cpzhqfhvsjx",
"5-11 s: ssbsskssgssdss",
"4-12 t: ltkttnzdvxttllttt",
"4-5 j: jjfjh",
"4-5 r: rrrprjdtrfr",
"4-8 d: ccwqskmd",
"2-9 p: npzptdhsxxpkpk",
"6-17 x: cxnxxpmxxxxhxxfhxxxx",
"1-7 q: nqqzqnqqqf",
"15-17 v: vvvvmkvjvwvscvvvv",
"12-16 d: mddddbdddjddxddbd",
"3-7 f: fxpfffff",
"6-7 d: dgdwrddwhprchmvdr",
"5-17 h: whhphdbxzwcdhhshwkkh",
"5-7 f: ffffffjw",
"10-12 s: grcsbsnssbfs",
"6-10 z: zzzzzrzzzzzjz",
"14-15 m: kdmmcmmmmmdmldm",
"6-7 m: mcxmmcmm",
"5-6 l: lmlllrlw",
"3-16 q: qqwqqqqcmqqqqqxqbqq",
"14-16 p: pppzspppppnppbppwwpp",
"10-12 q: qqqqqqqqqqqqqq",
"1-5 j: rjkjvjj",
"3-9 d: fhqwddjrdzpkgdkd",
"2-4 v: vlvw",
"1-4 w: qwcww",
"6-12 r: rhhzkrzhrwrxrkvrcbmr",
"3-5 t: xxbtr",
"5-6 x: xxxpxx",
"2-5 q: qhqqq",
"8-16 n: nnnnnknnnnnnnnnt",
"8-10 g: gdzvghxcnbq",
"4-19 m: rgmmbqmljmzswbkpkcn",
"8-12 g: ggggggmhggrgbtghg",
"13-15 t: ttttttttttttttxttt",
"1-3 n: nntn",
"3-4 h: hhxh",
"6-7 f: ffffffbf",
"2-3 t: bgtt",
"7-9 n: nnnnnnjnn",
"2-4 j: ljgj",
"12-15 c: ccccdcccccccccfccc",
"4-9 s: wssssssqlcssz",
"1-2 z: ljzjgcvg",
"6-7 q: qqqqqqs",
"1-6 d: xpddgd",
"4-14 f: ffffffffdzfffmf",
"13-14 r: rrrrrrrrrrrrwrrr",
"6-7 r: rrrcgbrrr",
"9-15 b: lkkbbbbhbsbgxpgpbb",
"3-4 f: qzfzwnffv",
"4-14 m: rkksnmbgjmqmmmc",
"8-13 n: fjnbrnnnqnnnnn",
"13-17 h: hhhhhhchhhhhhhhhz",
"8-9 n: rbtknnmpng",
"1-6 c: qgtfhqtjkw",
"2-8 m: wzfmmmmmflmdk",
"5-7 v: cnvvvvvvv",
"10-15 n: nxnnnjnsnnnnngnnknrt",
"12-13 d: ddjddddddddddddd",
"4-5 n: jncnnh",
"6-10 z: zzzznbzzzczzl",
"4-5 s: bsjsv",
"9-11 g: hvkccbpfxkg",
"1-2 b: bbqb",
"7-16 l: lllllllllllllllplll",
"1-5 l: llllml",
"3-4 f: fmsf",
"2-4 g: tgshjbgg",
"2-7 h: vlzzhhhhhphhf",
"8-9 p: pnpppppqh",
"9-11 w: wrxlwdtwnwwtqwpwxgw",
"8-10 m: mmmmmmmnmm",
"1-5 p: dpnpppzpp",
"3-5 l: bllflklcmp",
"11-19 j: jkjjjvmjjjkjljjjjfj",
"6-9 k: kkkkkkkbkk",
"2-4 r: njprlsrmtr",
"9-10 d: dxhdddddfdd",
"3-8 z: dmrqpzwzghmznc",
"2-8 r: tlgqwxcrdpj",
"10-11 z: zzzzzzzzzzhz",
"1-10 q: qqqqqqqqqsqqqqqqqq",
"2-4 x: xrwxx",
"10-11 s: zssssssssfz",
"3-9 z: rszsgfzzz",
"6-13 x: zsxwxxqtgxvbcxxbn",
"10-16 s: smsssgssshsspwxsq",
"1-2 g: ngqgc",
"4-8 l: xllllngb",
"4-7 h: rhhhhhghbm",
"1-7 v: vqvslhm",
"2-7 z: jjfmnmz",
"1-10 v: vvvvvvvvvqv",
"11-13 g: ggpgrgggggggggg",
"3-6 p: tpgqnpphpl",
"1-3 d: sddddd",
"8-9 g: gggggggvg",
"2-6 w: wtvwnw",
"1-4 m: kmmwm",
"3-4 h: mhvh",
"1-4 h: cnjhxvhkdch",
"7-8 w: wwwwwfwww",
"6-9 r: rlrrrgrrr",
"2-4 h: lggh",
"10-11 q: qqqqqqqqqlh",
"4-5 l: llllgl",
"13-16 k: kmffmjbzrpprcdkxglk",
"1-3 f: ffpf",
"19-20 n: nnnnnnnbnnnnnnnnnnnv",
"3-7 h: hhpmhjhwdhzhm",
"1-5 k: hlkkrkzkf",
"2-4 s: sssxssssssssssssssss",
"12-13 d: dddgdddddqndtdkd",
"3-14 c: cccczvcxchccccclctcl",
"2-5 b: mbgbb",
"6-8 j: jjtrtbsjnj",
"5-6 s: sssqsk",
"8-16 l: lfrlllllctllqxrpllll",
"6-12 g: grxlwlnggxvg",
"16-17 j: jjjjjjjjjjjjjjjjp",
"6-10 q: nqmzqflbhqqb",
"12-19 j: jjjjjjwjjjjkjjjjjjgt",
"8-10 s: sscssssssp",
"11-12 s: ssssssssssds",
"2-5 n: hswqnqldwwbbmnnrnht",
"4-7 p: ztpvbqpwsxrgrkp",
"3-9 h: hhlhhcjrkhwnhq",
"10-12 k: kkkkkkkkklkwk",
"14-15 w: wwwwwvwwwwkwwqwnw",
"16-20 b: bbbbbbbbbbbbbbbhbbbt",
"2-5 t: tttttftttttt",
"3-12 l: qswhtwvnfmfwn",
"11-12 b: bbbbbbbbbjgvbbbbbbz",
"8-13 w: wwwwtwwvwwwww",
"5-6 f: kgjfhfffv",
"7-17 g: qpxgkvgttkhxjhzxnv",
"2-3 n: rhffpsqknv",
"2-10 p: pkpppppppppp",
"3-15 p: rnpqjpgmcpgzkxcppk",
"12-13 d: nhdddldxdddddndpdddj",
"14-16 h: hhhhhhhhhhhhhbrhhhhh",
"4-9 r: rpzrcnrrrlx",
"2-14 f: ffffzfzffffffjfff",
"1-9 s: snhfksssxssss",
"1-14 n: bnnnnnnnnlnnnn",
"2-3 c: cwtccc",
"10-12 k: kkkkkkkkcskkkdkk",
"2-5 r: qrqsrkrk",
"3-11 k: nlkqkszttxk",
"2-3 d: vqdgpwnjprgsgsdrxwk",
"7-12 k: hkkkkkkdkkkrk",
"6-8 r: smmfvtxrhzvnrj",
"8-10 l: llrllllllmll",
"5-10 l: bpwgqlnktt",
"4-6 f: flfvjfff",
"13-14 b: bbbbbbbbbbfbqzzb",
"5-6 m: rmhmqmkmtkmjnmvdx",
"10-16 j: jtjjjjjjjdkjgjjjj",
"3-4 c: cpcc",
"10-11 v: vxgbfvqftvmc",
"5-12 n: knqlnbhdphpw",
"7-13 r: rrrrrtrrrrrrrrr",
"4-7 n: nbnnffkjnwpqnhvqnr",
"4-13 r: htrkdwrcmcndrxngd",
"1-8 h: dhhhhjhdxhh",
"4-8 b: bbbcbbbg",
"1-7 b: zqpzzqbfbwbwcbbbp",
"6-7 l: jlhllllmljvl",
"9-11 w: hwpwlcwkwcwjgkt",
"14-17 m: mmmmmmmmmmmmmmmmjm",
"6-11 r: rrrrrbrrrrr",
"1-6 c: fccxxc",
"14-15 j: jjkjjjbjjjfjjljfjj",
"15-17 q: qqqqqqqqvqqjqqqqz",
"11-14 j: qjjsjjjjjjcjjjj",
"11-13 m: mfhjhnsshfxmmm",
"6-9 z: wrsjtzzzj",
"6-19 b: lbkksbnggbcdpffqjxbb",
"1-5 w: wwwwwww",
"3-5 h: htdhh",
"5-15 n: nlfdnkvknxgbqlw",
"3-4 z: pzrz",
"7-9 h: hhslhhkhhhhh",
"11-13 n: wqnrnbnnlnjnd",
"15-17 f: ffsfffffffffffbfff",
"1-2 m: pmmt",
"8-9 z: zzzzzzzmzz",
"2-12 q: qqftqqqklxjc",
"12-13 p: pppppppppppbp",
"8-9 q: qqqqxqqlqqqqq",
"3-5 m: mhmfbq",
"3-5 j: ckpkjjf",
"7-11 k: kgkkkkkkkkkkkk",
"2-3 n: pnnnnmmnkl",
"1-6 l: lnvqjlflmp",
"3-14 t: nhzvstnltttdftt",
"2-3 s: hsrscsz",
"9-12 b: bbdbbbsbbjbgb",
"1-10 h: mlkcgnrkwhpgwjvflhgx",
"5-7 p: spnpmppwp",
"2-3 h: hrhh",
"8-11 g: fggsggqhgpg",
"5-8 n: nsxnvnlpnvn",
"9-11 f: fvffffjfffrcfff",
"6-9 q: qqqpzqmqpstrk",
"8-12 v: vmvvvvpzvrvvv",
"2-4 x: cnbx",
"3-5 h: hhqrhhh",
"6-13 t: ttttttttttttltvttt",
"2-4 v: zqvvgrxwtw",
"6-8 v: vdbvvfjv",
"16-19 g: gggggggggggggggjggg",
"4-6 m: mmwmstmpmj",
"1-11 b: bnxzhlbbgbpdvp",
"7-16 n: txfjncnhsxgbjvhh",
"5-8 m: mmtvmkmvfkmzmpmd",
"3-6 g: ggjgggg",
"8-12 l: lslllglqcnlwlll",
"2-4 l: llpqjdwxq",
"6-7 b: bbbbbvb",
"6-12 b: bbbnbbbbbkrq",
"17-18 s: msfggsssfsrdvssssdr",
"3-5 m: mmmmb",
"4-7 g: ggrwgbgggg",
"5-6 z: zzzzjpz",
"1-3 l: mrvclxrpvgnrl",
"11-13 g: gggjgggggggbgg",
"1-6 q: qqqqqjqqqz",
"3-5 d: dndnpzdmqcjrdgd",
"8-11 g: gggggggbggqggggggg",
"1-7 k: dkkkkkfkkkkkkrk",
"3-9 p: slbxznfwvjpnj",
"12-14 t: kbthtttfttrttt",
"3-6 x: xxbxxkxx",
"4-5 z: zzzdz",
"6-13 c: ccbcjccpcnscqc",
"11-14 x: xxxgmnxxxxfxhx",
"2-4 b: gjbrwk",
"3-4 l: bwmlzldj",
"10-13 d: qdcxdbrdrdddkdnddd",
"7-9 d: dddflddbwnmddd",
"12-14 f: rkgdfbdkqhnfsqjltntx",
"5-14 x: xxxxxxxxxxxxxxx",
"8-18 r: rrrrrrrlrrrrrrrrrr",
"1-19 q: qqqqqqqqqqqqqqqqqqdq",
"7-11 c: kscqhtcccctprbc",
"3-5 h: dchjkntfhrbmmkkjpnh",
"2-9 l: lllllllln",
"1-6 c: sqczzcnkpwrcgvctlrc",
"6-16 f: wcnppfpffjxpthhfxf",
"16-17 x: xxxxcxxxrxsfxxpxfq",
"7-9 q: qqqqqqqqt",
"4-6 h: hxhhkgg",
"12-20 v: pwvzsxtvvslvfxhvcvtz",
"12-17 k: tkkkkkkkcfktknkkkk",
"2-3 b: bpqr",
"4-5 m: mhppm",
"4-9 g: jrgxgqjqgrrpj",
"7-12 h: hhswhqwhhqhhhlhtkhzw",
"5-19 l: llllhlllllllllllllll",
"2-3 n: mqncngfps",
"6-15 q: qqqqqnhqqqqqqqtqq",
"1-8 k: kfkkkkkkr",
"5-10 f: pmpffbdkfpffgffcf",
"3-8 b: bbsbcbbb",
"9-12 h: hwhhhxhshhhhhc",
"1-5 r: nhcrrbrrrj",
"2-4 q: qqqsq",
"13-17 h: lrlngvrhpsdmhkhzt",
"8-17 m: rmmmmmmlmmmmqmsmmqm",
"4-8 n: njnsnkjkhnkgblg",
"9-10 d: pdwdkgcdrdzqdd",
"3-4 p: pppp",
"10-12 j: zcjjjjqwjrjj",
"1-9 d: mddgrxsdk",
"2-4 v: gsvvjv",
"5-7 h: hhhbbhjh",
"15-16 w: wwjwwwwwwwwwwwbw",
"8-10 b: cbczjdpbkhdbkpbztn",
"7-10 z: skfvjzzxzt",
"15-16 m: mmmmmmrmjzxmmmbtmmm",
"2-6 j: rjjgqb",
"4-16 d: dptndnvddgtpqdddd",
"7-8 j: jjhjjjbd",
"2-3 w: bwdr",
"4-6 g: jgngnmgggfpgcn",
"2-3 p: ppkp",
"7-8 m: mmmmmmnm",
"5-6 l: lfllln",
"3-4 r: rrrm",
"6-7 s: ssssssss",
"4-15 g: kdtgzznwrczjzgx",
"11-12 w: jhwwrwwpwwwmwwfwgww",
"13-15 w: wwwwcjjwwwwwgwwwwwf",
"4-11 f: fffxffffffff",
"3-7 g: ggggggpg",
"3-10 m: mmnmmmmmmm",
"9-11 h: hfhhhqhhhchhhwh",
"4-5 j: jjqjq",
"13-14 x: jmxnxbjrklnvxtn",
"5-6 f: zzkqnzchtfnvffqd",
"4-8 j: cxcjvfjjkjz",
"8-14 s: sssssswnrsssscsss",
"6-12 t: dftrtdvtxttt",
"3-4 p: ppmp",
"1-5 z: zzgszfrg",
"1-8 g: wbgwggdgtswrlllj",
"2-4 f: fffpf",
"16-17 t: tttrktsmtmpttttttnt",
"6-11 m: mqsxmmtfthmfwn",
"2-3 c: mcbs",
"1-3 j: xmjj",
"15-16 j: jtjjjjjjjjjjjjjxj",
"6-8 k: kkrkktckk",
"9-11 l: ltlllllsllmlz",
"17-18 s: sxmssqtjrhmzhssssk",
"9-13 k: kkkkkkkkkkkkkkkhk",
"6-9 g: kpnhsggmqklvtttgcxvl",
"5-7 z: vzrxbmzzwglvczz",
"4-10 k: khkkdkkckkkkkzkk",
"2-6 q: qsqqnqq",
"1-3 x: qxsxxxx",
"10-14 x: xxzxxtxxxjcxxx",
"4-6 z: dzzzvz",
"1-2 c: cccv",
"9-12 h: hhhhhhhhhhhc",
"13-15 z: zzgzzzzzzmzzqzzkzz",
"3-6 h: pgvjdhtpmthbz",
"10-13 x: mxqbxxwxxxhxfrxxchxx",
"2-5 b: qbbmpzrzkcjqqwbj",
"3-14 q: ltxhrqqqqzfqqq",
"6-10 j: jjjjprjkqj",
"9-15 c: dsncxxlqwvzccwc",
"12-16 m: nxrmdgmmxmscmhnm",
"4-5 p: ppppthp",
"10-13 d: ddddddddddddb",
"2-6 x: bxkwbtsx",
"5-7 j: jjjjqjjjjjj",
"8-10 d: wzdddddtdddd",
"6-9 z: dlzzzzzvwz",
"2-3 h: hhhh",
"11-13 t: ttttjtttttttxtt",
"4-5 s: sdbps",
"2-10 x: dcmxxxlxxhgxftrjbp",
"9-15 h: hhhhhhhzjzhwhrkhh",
"2-6 f: ftxhffff",
"4-5 k: kkfrkwnbkkh",
"3-5 m: mmdmm",
"5-10 z: znvxzzldzvhqztr",
"7-8 r: rrrrrrcr",
"14-16 k: kkkkkkvkkkkkkbkk",
"4-10 x: cxsxzxxxxxxxxn",
"12-13 s: ssssssssssssss",
"7-9 s: sswssssshs",
"1-3 c: ncccrc",
"7-9 r: rrrwrrtwr",
"13-14 v: vvvvvvvvvvvvnv",
"4-6 k: bkkkkx",
"7-10 r: rrrrrrrrrrrrr",
"7-8 l: llllllzll",
"3-11 v: vqvvmnkvvswgkqvmvd",
"8-10 c: cccccdcccm",
"1-9 s: sssksqsshsj",
"5-8 c: cccchmcccc",
"5-6 h: hsqhhghrhk",
"4-5 z: czzzrzlzn",
"2-4 f: fzfffj",
"14-17 p: pppppppppppppppmpp",
"4-5 x: ldqxq",
"12-16 g: gtgggggggggpgggggt",
"13-14 v: zfbmrhphzmrvqv",
"6-10 p: ppppppppphppkp",
"10-12 l: xlllklllllkwlcl",
"4-6 v: qvbvgdw",
"6-12 q: qqqsqlqqqqqq",
"3-5 s: rssgpssnb",
"1-2 g: gzlpcmbsmgrq",
"2-9 w: lpmbmfvpwggfvmzmmw",
"4-6 n: nqtfzz",
"3-4 f: fftf",
"13-17 n: nnnznkgmnnnnpnngnfn",
"8-10 p: ppppxppppppppprppsp",
"10-12 g: ggnggkggggcvg",
"3-8 l: lxrcbjnddcbpg",
"6-7 q: qkjqfqqdkkkqrqqqc",
"5-8 p: wpbpmpwpfsblpplmpp",
"2-7 n: bbrtwnhhttntqhnr",
"1-2 p: pcdxzjwmnkfjkpbj",
"1-15 n: nnnnnnnnnnnnnnznn",
"18-20 s: ssmsssssssssssssrssw",
"1-12 h: vhxhmhhhhhhhd",
"3-7 r: qkkvhvr",
"3-5 k: xkpkkkzbtwkv",
"2-4 z: zfzz",
"1-2 t: ktttt",
"2-3 p: pbwp",
"2-4 j: ljjj",
"14-15 t: pzpcktthttfttttt",
"3-4 n: nwnj",
"8-10 l: lzllllllln",
"1-12 q: qqqqqqqqqqqqq",
"6-12 z: xxltbzrpwzzmw",
"15-16 q: qqqqqqqqqqqvqqqjq",
"4-5 r: rhmrkrd",
"7-10 r: rrrrrrlrrrrrr",
"16-18 t: ttttwttttttttttttn",
"9-17 m: bmmmmmmzmmpmmhmrw",
"9-13 r: rrxfrrxrrrrrrr",
"13-18 p: ppdxprpqppbpppprpz",
"5-8 p: rprmpfpxgjphfktszplp",
"5-7 h: hhhhhhnh",
"3-7 h: rwhpshznhhh",
"9-10 x: xwxzbrxxgxrxxdxxs",
"6-7 h: hvhhhhng",
"5-6 b: bbbbwhbb",
"4-5 g: gbgggg",
"3-9 g: gsbggghggpgdgg",
"1-3 r: rxrhh",
"3-4 c: rccn",
"4-8 z: zpzzznzzzwz",
"14-17 b: bbbbbbbbbbbbbbbbbzb",
"2-4 w: rwvwrdn",
"3-6 p: pfpsgp",
"2-12 p: zpwkjpppbppjrppknh",
"5-9 t: tmttgtttn",
"2-3 v: wvvcv",
"3-5 h: bnbhhtjhk",
"15-17 f: tffwftdskgfxgfffpk",
"16-17 h: hphhhhdhhhhhxhhhrhh",
"7-8 d: ddddddtnd",
"9-20 t: tqttttttttttttttbttw",
"1-11 v: vxcgzvvvkrlqvg",
"2-6 r: ghrbwrtfksqkxx",
"8-10 w: wwwswwwmvwww",
"4-10 m: mqmmmtmmfq",
"2-3 g: gkgtgv",
"9-11 w: wwwwsqwwpwwxrwww",
"3-4 w: zwxwtcscwmwmndcw",
"8-9 q: xsqqqqzxfqfv",
"2-4 w: wwhh",
"9-18 d: ddddddhddddddddddq",
"3-4 s: sssjsvs",
"15-16 p: wphpxpppppppppppppvp",
"10-12 t: qftttqhtvttt",
"1-2 b: vbfxqgbzrktjm",
"3-4 k: lkkr",
"9-11 d: dddddkdqdttddd",
"9-11 m: mwngbfmhmcvwx",
"2-5 b: scbxbb",
"6-9 z: zzzzzzzzzzz",
"1-3 z: zzvhz",
"5-7 x: xxxxxxkxx",
"1-5 s: ssscshss",
"1-7 s: csrfvfsqjss",
"16-17 k: fwdkkkckkkkrrkkck",
"3-4 h: hhhs",
"4-8 w: wwwswwwx",
"1-10 f: fffskffsdfcfvfff",
"7-15 r: rrrrrrrrrrrrrrxr",
"1-2 k: kvxbzdcnsqrskhmx",
"2-4 s: wbvsfs",
"2-7 q: rbgqpqdq",
"15-16 f: fffffffffffffffq",
"1-3 c: bccpkm",
"5-11 g: fsvgthpglgg",
"3-5 f: ffffwf",
"5-16 j: djmwqfxsbzwjdwtj",
"3-4 p: pprpp",
"5-6 n: nhnnwj",
"8-12 s: tssssssrsssksss",
"5-8 p: pppppppppppp",
"10-15 w: wgfwwcwtmwwgwpwwh",
"12-15 l: lllllllllllplll",
"1-8 c: ccccqccd",
"3-4 z: zzzvzkzgc",
"2-10 h: swwbtfkvfhrjztdzx",
"2-7 z: zhbzkzlzz",
"2-9 q: ddqdqpkcjqkfgqtcjqq",
"9-10 l: lllmllkltlll",
"2-3 n: ngwn",
"2-3 r: rrnr",
"5-10 n: ltnnnknnvcnnn",
"7-9 p: jtpptpllpj",
"2-5 s: slssssszssssssss",
"16-17 d: dddddddddddddddlp",
"2-5 q: bbwqqbkmdhqmjhn",
"7-10 m: qmpgmmsmmmmkmmkj",
"4-7 g: vczggdgbgxgg",
]
| input = ['17-19 p: pwpzpfbrcpppjppbmppp', '10-11 b: bbbbbbbbbbbj', '17-19 c: ccccccccccfrcctcccjc', '8-10 k: kkkkkkkfkkks', '13-14 l: lvllvllllslllv', '8-9 n: nhhcnnnknnqnb', '1-3 d: pdbdfbws', '5-6 v: vvvgvb', '7-8 x: gxcxtwbl', '2-15 r: xlgrwqpcsqtrvfrrt', '9-14 l: glnldlllllllln', '2-3 r: vxnw', '8-9 g: gfggczgkgggjgg', '4-5 d: ddddh', '6-9 t: zttttbhbttttftd', '3-6 k: kkkzwnmv', '2-7 w: sgmvplwwjx', '11-13 h: hhhvhhhhhhvhh', '9-10 f: mhfdfffffmlffsfvts', '17-18 l: llllllllllllllllrzl', '4-5 c: crcccccccvc', '9-12 q: qqqqqpqrqqlcq', '7-8 n: nnnnnndn', '3-5 f: ffqnfpffhf', '3-4 j: djpj', '17-18 q: qqqqqqqmqqsqqqqqjq', '8-15 j: bjmjbbqfjjrgjgfkjj', '2-11 d: xdgdmxgwzdpdxdhjwd', '8-9 p: bppppppmp', '10-11 t: ttttttttttb', '5-8 v: vhxvfcsvvxjvvvpgwdv', '9-17 q: mqqqqqqqqqjvqqqqzlq', '1-2 t: tptbbn', '9-11 q: gqqqqqqfwqqqq', '8-9 h: hsdsfkgphxglmsjndhh', '2-3 z: mzgz', '4-16 n: nxnsqmrnnnpfvnfnb', '1-3 r: rbzcrkjrqrrnjxj', '1-5 c: ccccccq', '4-11 m: mmmgmmmmmmm', '8-9 z: zlzvzzzpzz', '1-18 h: xzqhmkzhhrtxpljptbc', '3-4 p: pbpg', '16-20 j: jrfjjzjjjrjjgvjkzjjj', '6-9 t: ctdtthtlttttpt', '3-4 h: mfhj', '5-10 t: tgtxttqhtl', '1-3 w: fwgw', '6-7 q: qvqlrqp', '12-13 m: mmmmmmmmrmmmplm', '12-14 r: rrrrhrrrrrrrrbrc', '4-6 b: ljzbqgwxcdmdjfbcwd', '7-10 g: gggggggmgpg', '2-3 c: mbcc', '7-8 k: kbkkkktkckc', '7-8 p: pppppppbp', '5-8 w: twwwwwwgvvwvdttmh', '13-17 p: ppppfppppppppppppp', '8-12 x: xxxcxxxbjxxxxk', '9-18 b: hhbbqcbbbsblbgpwbbhf', '6-8 h: hhhhfhhchhjhhch', '7-11 g: ggtnwvcdgctkrggxj', '5-8 k: kknhndzm', '4-5 z: zzznz', '2-4 p: pbtp', '16-18 r: rrrrtrrrrrrrrrrhrr', '15-16 r: rhrrrrrrrrrrrrrx', '7-10 l: lllklmhxzlxcdljz', '7-8 q: qqpwsqqb', '9-13 k: qkknkkxlzkrkkkkkpk', '4-8 h: wlrhfbth', '6-8 q: vppqqqgntfqqgqq', '19-20 g: ggggggggggggggggggfg', '4-5 m: shmzmsdm', '3-4 k: kkhkk', '4-7 b: cbsqkcpnkcfzhmpvfvgz', '18-19 l: lllllllnllltdlwgllxl', '14-15 z: zztzzzthdzzzzzn', '9-10 s: ksssbsssstss', '2-10 t: mltjpttttthpttttz', '3-9 n: pqnpfxgfnzqxv', '7-11 d: ndddddhdddddddd', '11-13 v: vkvbwrchzvhhvpc', '13-15 l: llllllllllllllll', '10-13 c: ccclwbcbccbxvcrdzctc', '8-9 w: klvwtwwwbwhww', '2-4 j: mnmb', '10-14 w: wwwmwwwwwwwwlnwsw', '14-17 x: xxxxxxxxxxxxxlxxkxx', '3-7 r: bxrqzxsrfmclfdrqrtpf', '7-14 b: bbbbqbbbbbbbbbbbbbb', '7-13 p: wwvhwdprjxppwnhsbp', '2-3 h: hqhh', '8-11 n: nnnnnnnjcnn', '5-12 l: cwzxlpvwlsfjqrgk', '3-5 v: vvphwvv', '5-16 d: dpdrdfdrhwdrrqdqxd', '14-18 z: zzzzzzzzzzzzzzzzzkzz', '2-5 h: hcjlh', '12-13 w: wwwwwwwwwbwlw', '15-16 c: ccccccccccccccxc', '4-7 b: lbbsbbwhb', '2-5 z: qtwmzhzmwqw', '5-6 d: drjddc', '7-9 q: qqqqjqqfdqq', '14-15 r: rvrqrrrrrwsrrmrrd', '16-17 h: hhhhhhhhhhhhhhhhlh', '10-16 f: fvhgfzffchmffgfff', '3-7 q: qcqlvdvgrqtqcq', '7-9 x: xxsxxrxxpsx', '3-10 h: hjhjthhrthcdhhhhxz', '15-16 t: tttttttztwbwptjt', '3-5 x: xrlxqx', '3-4 b: bbbp', '1-4 n: jnhnndn', '3-6 c: ccccfm', '7-8 v: tvtvdvspvvv', '6-8 l: lljlllgsglcsw', '2-13 h: jhzzcgpxhbgqsbwhf', '17-18 j: jjjjjjjjjjjjjjjjhc', '2-3 c: ctcchxklnbrqc', '3-14 w: wwcwwwwwwwcwww', '1-3 k: kcxf', '9-14 t: ttttkttlnttmtttt', '2-4 x: xkxxqzxvck', '5-6 h: dgmxghjxjnhs', '4-12 f: fvhlffxnfjhfffqxfcf', '1-10 b: pfsbflbbkbqk', '8-9 s: qzkfszjss', '1-14 m: mmmmmsmmxmqmmmmmmmm', '11-13 w: nsgwwwwwwpbwvwww', '2-15 t: sprsbpztsznslst', '3-4 d: tqscgnrjxrqdwqd', '5-17 x: xqrzxxxxfxzxrzxxxw', '8-9 m: mkmhmgdmq', '6-8 q: qqqqqqqxq', '2-5 m: mmmmmf', '4-13 v: gvvvsvfmmmvvx', '13-16 t: ttttttttgtvtwttntt', '8-16 c: ccccccczccccccccc', '10-11 b: bbbbbbkbbvbbbbb', '1-12 n: pnnnnbnhnnbng', '5-6 b: qbbbbb', '4-6 z: zzzzzvjzzznxdzx', '2-3 p: dwxqpjp', '4-6 w: wwwxwq', '2-3 x: pvpdh', '5-8 n: pqnnkncnnfnnnnnn', '10-12 w: drqwwxrwwkwwwswwl', '2-4 g: rbggfslgjqqhj', '9-19 r: pzxhrcfrrrqjqfkhrhjz', '3-6 n: rngtnnnnn', '4-14 t: tttttttttttftgttttht', '6-8 q: qqdtqqmrgqcqqqqc', '3-14 t: tttnttttttttqk', '9-10 w: qqwcjzwgjnqdrdxwjwl', '10-12 t: tthtthtktvtttt', '2-7 v: vzvvvvv', '5-17 p: zzpsmpgpprdmhxprsvs', '8-9 t: ttttttvnt', '4-8 v: vvvfvvvvvvvvvvv', '7-15 h: cwkhdzmththzjnh', '7-9 v: vjvlwzvvmv', '1-2 c: hchw', '7-8 f: ffpfffsfqf', '5-8 s: xlssskszb', '2-15 x: fxzpbvqzmkxvtlljjrg', '1-3 s: hsss', '7-14 m: xmmtmmmgmrmmxzmxm', '10-13 z: dnzztzzzzzfszxzczg', '3-8 h: rhthhnhh', '6-9 g: hbggggggggbg', '13-15 z: zzzzpzbzzzzzfzzz', '5-15 l: llllwlllllllllll', '3-5 m: dhmmm', '2-13 h: hrrhgqhhnhkhhhhb', '1-5 p: kpppp', '2-13 m: fmqjmrzhskzwdnt', '7-8 q: bqxvzqqsjpqqqq', '2-13 d: ddhdddddddddbddddd', '5-9 s: nhkmxssqsjssjs', '2-11 b: vlrtxpzkqwb', '6-7 q: qqqqqcq', '7-9 n: nnnnnknnmgn', '3-9 n: qfkxknwnn', '15-16 d: dddddddddddddddgd', '12-13 h: hhhhhhhhhjmvhhh', '3-4 w: tbfw', '8-9 f: fkffbfhtf', '2-4 q: qjsqqf', '2-11 t: ttttpdgtlxhtx', '7-10 k: dkkkkkkkkh', '6-7 c: hccccxcgv', '6-7 j: sjcbfmj', '1-2 w: vtrwjcgndvwx', '12-13 m: mmmcmmmmmmmms', '3-7 h: hhhhhhw', '9-13 g: gghgwgrrkgcgg', '12-13 g: gggggggggggfgggg', '13-16 s: sssssssfsssssszb', '2-17 p: pbpmpmwpnqppppppphbd', '2-9 c: cmrcwfnjcdcxccccrzc', '8-12 j: jvjjjcjxjjdqjjjr', '6-9 m: mgjxmcfdm', '2-5 l: klmxlx', '2-10 x: jvxwxpxrxx', '2-3 r: rrzrp', '2-12 v: cbfrnctdmzwvlbvjmdgg', '2-9 r: wrbrrrrzm', '12-13 h: fhsbhhhhhhhwhhhhhh', '5-8 d: ddhqdddddp', '4-5 l: djnlnlllbl', '2-9 t: tdtgttddtwwj', '16-20 t: tttttttttttttttttttt', '5-8 z: zzzszzzmszz', '8-13 d: dddddddbdzwddd', '9-10 z: zzztzzzhzxgz', '10-12 p: wppcppxpppgpppzr', '4-5 w: wkwtwwzww', '3-9 m: dmmmrmmmm', '1-4 g: gvmr', '8-9 d: frxndpdzwd', '17-20 q: qqqqqqnqqqqqqqqqhqqq', '7-13 w: pwfwwrwwwkwww', '3-5 q: qqpqw', '11-13 p: pplpppppppppb', '4-12 g: glggjmsggggjrgbgm', '3-7 p: cfphqrxpsgthp', '12-15 f: gfnrhffgftnbggfwtbp', '16-18 p: pppppppppppppppppm', '3-4 l: lllzn', '1-2 d: dddd', '8-12 n: nnnnxnnhnnnn', '2-4 z: zzzzz', '1-4 s: sssms', '2-4 h: hghhh', '1-10 l: nhtnzhdtmslxqskf', '5-13 j: bpzjjrrqzndjtw', '1-2 x: xxchn', '1-16 v: vjvrxvdbdnvvkzvg', '9-10 b: xbvzbbmfmbqbbvbbrb', '8-12 k: ktnkfbgkkkkbkmkk', '7-9 h: hhhhhhwhh', '16-17 g: sgggmggggggggggvggg', '3-10 q: qmlqqqqqqq', '11-14 h: hhhxhhhhhchhwkh', '9-14 f: kqwqcftkfdxgmsd', '12-13 p: pppppppppppph', '7-8 f: dkfnjfff', '5-6 f: jtfrrfxckhfmfffszggg', '6-8 n: jzhpkszn', '8-10 c: cccccnckcxmrchjc', '14-15 d: dddjdjdddddddpp', '8-10 f: cfshmqfffwtffltfzff', '3-4 b: bdbq', '2-6 b: cfqkbtvmn', '15-16 z: zgzzqzjhzzmnzkzvzz', '4-6 r: krrrrlm', '3-6 c: dcczrfr', '8-9 s: ssssssfws', '11-12 s: mssssssssssq', '1-2 r: zrznpmzrs', '10-11 k: kkkkkkkkkfk', '3-9 k: kbkkkkgkk', '1-4 w: lwwtw', '3-4 t: ttkt', '2-3 m: htvmjk', '2-4 p: mdpp', '10-17 s: ssssssssssssssssws', '1-2 m: gmmc', '5-9 d: dddbvjkdd', '5-8 z: tmnfplzz', '7-14 s: ssssssssssssstkss', '2-7 q: gqbcxnqcvszwbxqkz', '6-17 b: btbxlbbbbbbbbbvtbkd', '6-9 l: lllllllld', '11-12 q: nqqjjrhgxgqp', '6-9 n: nlnnfnnjb', '13-17 x: xnxxxxxxxxbdbxxrc', '5-13 w: wwtwrwzwwwqfwtkwtwbw', '5-10 g: gggxbgmgrgggggg', '13-16 h: mhhhhmshhchhhhhl', '2-3 f: flff', '2-4 k: kkhr', '2-6 m: mmmqmml', '6-7 p: ppppppp', '2-6 k: ksktkkk', '2-4 m: gkml', '5-6 h: hhvqhjz', '2-5 h: hkhqhfh', '3-4 z: zzglz', '2-3 f: zhfn', '10-11 m: mmzmmmmmmfmm', '3-13 d: ddwzdmmddmddz', '1-2 h: hvkhm', '4-5 n: nnnnb', '5-7 f: fjppbffffz', '2-4 g: tmlp', '15-16 q: bqfvqqqcptqqzqqx', '18-19 g: lpgqgcgsdtngfddbggnp', '3-5 z: kjzkq', '1-6 q: qjkqqzqq', '3-4 m: bpmmjgmmfmj', '2-5 k: jkvkz', '11-14 q: qqqbjqqqqqgqqq', '6-17 q: bfqqtlqqfjgqtqtqs', '5-16 s: ssdzfbsdhsszspssvs', '1-7 n: nhnvmhb', '4-5 b: hbbrk', '9-14 f: fffbffkfftcfnfgf', '1-3 n: nznxndpb', '3-4 k: qkktw', '3-8 r: rrprrgrrr', '2-5 l: sqmllls', '6-7 n: njnknvnnpvlbnx', '3-5 t: hbrtmcttt', '5-9 j: fjjnjcgjhnkcpqjbc', '2-4 l: jllx', '7-8 d: dddddndd', '3-6 t: gtsttjnt', '9-11 m: cbmgjlqcbsmllm', '1-2 l: vllfcckl', '10-11 p: ppppzppppplp', '2-4 m: slzmmrw', '3-8 h: bhhgmpbs', '7-14 t: tttttthttttttttt', '1-3 r: rrvvrrprwrfrcr', '5-15 w: gwbhwjwwwkswcsww', '2-5 v: zvtls', '1-4 v: vsvv', '10-15 z: zzzzzzzzzztrjzr', '3-5 v: vvvjhdvv', '3-12 s: wqssnmdlwlws', '2-3 r: djrftptcrskpzrz', '1-3 p: nbppgkmfnjp', '17-18 w: wwwwwwwwtwwwwwwwrw', '2-5 l: xqntklqlt', '2-5 g: gtkggghcvgl', '18-19 z: zzzzzzgzzzzzzzzzzztz', '16-17 x: xxcxxwxxblpxzkfxzj', '15-19 f: frffffstcwffccffffff', '3-4 n: npnm', '2-3 d: zvddd', '7-9 x: xzxxctxxl', '13-14 s: hhsxbzssdtssfss', '4-5 m: vbpmhmrmvrjnmhlsbmm', '3-6 z: zzzzzwdzzzzzzzzzz', '18-19 g: gggggggggggggggggng', '14-15 x: fxxjxxxxxxmxxwxxnxb', '10-12 m: xmmmmfmdmmkh', '3-4 b: bbgbgb', '11-13 c: cclcccbcxcccqcczc', '10-17 w: wwwwwwwswwwwwwnwpw', '5-7 l: blllqll', '4-10 n: nnnnnnnnntn', '9-10 z: fzzztzczwzzgkzzn', '4-5 x: gxjhxbxxx', '3-6 p: plhxppk', '10-19 p: mpgpmxdvqphrcckpvqw', '3-14 p: kfdwtqxpstpcfpgcfmp', '2-6 k: gnxkkkjrzkknskmpbsj', '8-10 l: lzllklldplllzl', '16-17 n: nnnsnnnnnnnnpnnjnnn', '1-14 c: kccccccccgccccc', '2-11 s: lsqghkzwsgsbdmgq', '6-7 p: pcpgqrcpqpptpm', '1-11 h: lhhhhhhhhqhhxbhhfhhh', '11-12 r: rrhjrbrrvrrrrdrrr', '5-8 c: cccccwck', '6-8 w: wwwwwwwb', '12-15 n: htvxnnhvnpnnknnhnt', '1-2 c: jcct', '2-10 v: vsvvvvvvvvv', '4-5 x: xhxtx', '3-4 f: ffxf', '5-8 v: wprmvflppqwvwfwpkq', '5-7 n: znnnnnxblcrn', '8-9 n: zljnjjbnn', '10-11 m: mzwkrvmzrdc', '3-7 h: hxkhfhcqhr', '6-13 j: vhcmljdxwkqnfcvmjjb', '1-6 g: gvgggthkr', '6-10 l: bldnllklkllllclslm', '6-7 g: gggggng', '1-4 x: xxxxxpnsv', '15-16 q: qqqqqsqqqqqqqqqbq', '6-7 q: qnqqqdqqq', '5-6 p: ppppspppp', '3-5 k: kkskkk', '1-2 j: jrjjjjj', '8-9 d: ddpzdlldmddhdhdd', '5-8 t: ttsljtnt', '2-4 w: qwwmwwhwwwwwwww', '6-8 c: clcccccv', '1-8 f: ffbfqfpfbfb', '5-13 r: rrrrkrrrrrrrrr', '15-18 v: vvvvvvvvjvvvvvvvvvvv', '7-8 r: xjwxkzqrrxr', '7-10 d: kddddddddbddd', '1-8 k: kkkkkkkkk', '4-6 q: rhdkjsqjqvzqcpsnq', '1-2 t: tdtt', '5-6 l: lllwlh', '3-5 f: pdzfff', '7-8 s: qsswssks', '3-5 d: dcdddd', '1-12 r: rvlrrrwdtkrcxffr', '2-7 d: rddcdlqtnffbdd', '5-9 t: phmtdzfjtdb', '9-12 x: jxxxxxxxxxxcx', '14-16 c: fcclccccmcnccwccqccv', '4-5 p: zxpzk', '15-19 t: ttttttttttttfkttttl', '5-10 k: kdmjgkkkkkblkvkkkk', '6-15 q: wqgmcqcmcjlgxkqrdstw', '6-7 r: rrrrrrr', '2-6 n: ksnnnnnzn', '16-17 g: ggggggggggggggghgg', '11-13 k: nsgkkkkzckxtkn', '2-5 q: jqvkqm', '2-10 q: lpqqmqlqqqqqtqqw', '10-20 k: dkztkkkkshkkkkkkkkdk', '4-7 d: fddddxd', '3-5 v: vvvvs', '7-9 b: bbbbbbrzb', '4-14 z: nbnzkbxbwhqpjsdlzz', '3-14 x: xxvxxxnxxxxxxxdxktxx', '7-9 z: qqpzzxzvsgzfzdzz', '14-15 c: ccccccccccccccmc', '11-12 k: kkkkkkkkkskv', '15-16 d: ddddddddddddddddd', '6-8 x: xkjhxwgxxzxxnzwxcxk', '2-6 t: tmwttc', '7-8 w: jwcwwwql', '5-14 d: jdpddtkddrdddpq', '9-14 t: mwctmnjxmztckt', '4-8 l: llnlxlmjn', '3-6 s: sssskvk', '4-8 c: ccchcrctczt', '4-6 s: wssnlsnsss', '8-18 s: sfkssssbswshsvshms', '6-7 b: bbkbcffmwblcmp', '8-15 w: fwwmswcwwhlwjwvtlq', '2-9 n: wnnnnmqhdpsnzn', '1-7 x: xkzzxpz', '5-8 x: txxxxmlxkrxsxzsx', '7-10 t: lchndztdttgk', '1-2 q: tqqq', '1-9 z: nzzzzzzzz', '1-2 l: djfmfwpnjclt', '2-6 x: xxxxxmxxs', '2-4 p: ppcv', '4-10 d: dddpddddddd', '8-11 n: nnnnnnnxnnnn', '17-18 v: vvvvnvtvvvjvvvvvzzvv', '5-8 h: hhhhhhhfhh', '9-16 v: vvvvvvvbvvvvsvtq', '3-4 r: hrhrrtrgrr', '11-17 g: mvgggwggggggwggxw', '3-6 r: rrnrrgrrrr', '8-10 n: rgjntnrmkn', '6-7 f: sffftmm', '4-5 b: bbddn', '4-9 d: cdrbqddsqqpzkdd', '9-17 n: nnnnnnnnrnnnnnnnjn', '1-4 n: knnn', '15-16 k: kkkhkkkkkkkkkkkv', '15-17 v: jkrddvtmgfqvqvvxk', '10-16 j: jjjjjjjjgpsjhjjljjj', '9-10 d: jdndwddvdrhndddd', '5-7 x: bxxxxwmcb', '5-7 r: mlrrdsrrrnrgwrrq', '14-17 h: hhhlhhhhhhhhhhhhm', '1-12 n: zpnwtpnnnnxzm', '11-19 k: ccktkhkwthkkklkvhkmk', '6-14 s: sfssxsscssgssqhsnssl', '17-18 g: ggdgggggggggfgggrggg', '4-13 k: dwddvztkhjnzk', '17-19 k: kkkkkkkkkkkkkkkkkkx', '5-8 q: qmqzqqqqqqqqqcqq', '2-4 q: vqqqqhxd', '1-13 c: fjccqcmrcjxgccdvbzr', '8-12 h: hkhhhhhhhvhhch', '4-10 w: jmwfwxwwkwwcnbwwftrc', '8-11 f: fffffffbffdf', '12-18 b: bbbbbbbbbbbcbbbbbbb', '2-8 k: rdwwjvrkcs', '13-14 p: pppphpnppppphpppp', '1-3 d: nddddddddddd', '5-8 m: mmfdkmnfmqm', '2-9 x: xjgwxxxxxl', '1-2 v: vhvsvv', '11-17 r: tlrgrrrrrwrzrrrrsrr', '1-7 c: lcclcvgk', '3-5 s: slnkss', '3-4 w: hqwbw', '11-19 l: lfxllllllldlllllllq', '4-5 t: tttbt', '10-12 g: gggggggggsgfg', '6-8 k: kkmkkkkmk', '10-11 q: qqqqqqpqqpsqd', '5-17 k: pxwkmdxkskthkkkkn', '14-16 m: mmmmmmmmmmmmmpmmmmmm', '14-15 k: kkkkkkkkkjkkkkt', '13-14 c: ccccccdccccccccccccc', '1-2 v: gvmqqnkpln', '4-6 k: lwkkkjgwkkk', '1-12 h: mhhthhghhhhhhhhh', '6-7 t: ptxtwtg', '3-9 j: zsjkcjlzj', '5-8 q: cpzhqfhvsjx', '5-11 s: ssbsskssgssdss', '4-12 t: ltkttnzdvxttllttt', '4-5 j: jjfjh', '4-5 r: rrrprjdtrfr', '4-8 d: ccwqskmd', '2-9 p: npzptdhsxxpkpk', '6-17 x: cxnxxpmxxxxhxxfhxxxx', '1-7 q: nqqzqnqqqf', '15-17 v: vvvvmkvjvwvscvvvv', '12-16 d: mddddbdddjddxddbd', '3-7 f: fxpfffff', '6-7 d: dgdwrddwhprchmvdr', '5-17 h: whhphdbxzwcdhhshwkkh', '5-7 f: ffffffjw', '10-12 s: grcsbsnssbfs', '6-10 z: zzzzzrzzzzzjz', '14-15 m: kdmmcmmmmmdmldm', '6-7 m: mcxmmcmm', '5-6 l: lmlllrlw', '3-16 q: qqwqqqqcmqqqqqxqbqq', '14-16 p: pppzspppppnppbppwwpp', '10-12 q: qqqqqqqqqqqqqq', '1-5 j: rjkjvjj', '3-9 d: fhqwddjrdzpkgdkd', '2-4 v: vlvw', '1-4 w: qwcww', '6-12 r: rhhzkrzhrwrxrkvrcbmr', '3-5 t: xxbtr', '5-6 x: xxxpxx', '2-5 q: qhqqq', '8-16 n: nnnnnknnnnnnnnnt', '8-10 g: gdzvghxcnbq', '4-19 m: rgmmbqmljmzswbkpkcn', '8-12 g: ggggggmhggrgbtghg', '13-15 t: ttttttttttttttxttt', '1-3 n: nntn', '3-4 h: hhxh', '6-7 f: ffffffbf', '2-3 t: bgtt', '7-9 n: nnnnnnjnn', '2-4 j: ljgj', '12-15 c: ccccdcccccccccfccc', '4-9 s: wssssssqlcssz', '1-2 z: ljzjgcvg', '6-7 q: qqqqqqs', '1-6 d: xpddgd', '4-14 f: ffffffffdzfffmf', '13-14 r: rrrrrrrrrrrrwrrr', '6-7 r: rrrcgbrrr', '9-15 b: lkkbbbbhbsbgxpgpbb', '3-4 f: qzfzwnffv', '4-14 m: rkksnmbgjmqmmmc', '8-13 n: fjnbrnnnqnnnnn', '13-17 h: hhhhhhchhhhhhhhhz', '8-9 n: rbtknnmpng', '1-6 c: qgtfhqtjkw', '2-8 m: wzfmmmmmflmdk', '5-7 v: cnvvvvvvv', '10-15 n: nxnnnjnsnnnnngnnknrt', '12-13 d: ddjddddddddddddd', '4-5 n: jncnnh', '6-10 z: zzzznbzzzczzl', '4-5 s: bsjsv', '9-11 g: hvkccbpfxkg', '1-2 b: bbqb', '7-16 l: lllllllllllllllplll', '1-5 l: llllml', '3-4 f: fmsf', '2-4 g: tgshjbgg', '2-7 h: vlzzhhhhhphhf', '8-9 p: pnpppppqh', '9-11 w: wrxlwdtwnwwtqwpwxgw', '8-10 m: mmmmmmmnmm', '1-5 p: dpnpppzpp', '3-5 l: bllflklcmp', '11-19 j: jkjjjvmjjjkjljjjjfj', '6-9 k: kkkkkkkbkk', '2-4 r: njprlsrmtr', '9-10 d: dxhdddddfdd', '3-8 z: dmrqpzwzghmznc', '2-8 r: tlgqwxcrdpj', '10-11 z: zzzzzzzzzzhz', '1-10 q: qqqqqqqqqsqqqqqqqq', '2-4 x: xrwxx', '10-11 s: zssssssssfz', '3-9 z: rszsgfzzz', '6-13 x: zsxwxxqtgxvbcxxbn', '10-16 s: smsssgssshsspwxsq', '1-2 g: ngqgc', '4-8 l: xllllngb', '4-7 h: rhhhhhghbm', '1-7 v: vqvslhm', '2-7 z: jjfmnmz', '1-10 v: vvvvvvvvvqv', '11-13 g: ggpgrgggggggggg', '3-6 p: tpgqnpphpl', '1-3 d: sddddd', '8-9 g: gggggggvg', '2-6 w: wtvwnw', '1-4 m: kmmwm', '3-4 h: mhvh', '1-4 h: cnjhxvhkdch', '7-8 w: wwwwwfwww', '6-9 r: rlrrrgrrr', '2-4 h: lggh', '10-11 q: qqqqqqqqqlh', '4-5 l: llllgl', '13-16 k: kmffmjbzrpprcdkxglk', '1-3 f: ffpf', '19-20 n: nnnnnnnbnnnnnnnnnnnv', '3-7 h: hhpmhjhwdhzhm', '1-5 k: hlkkrkzkf', '2-4 s: sssxssssssssssssssss', '12-13 d: dddgdddddqndtdkd', '3-14 c: cccczvcxchccccclctcl', '2-5 b: mbgbb', '6-8 j: jjtrtbsjnj', '5-6 s: sssqsk', '8-16 l: lfrlllllctllqxrpllll', '6-12 g: grxlwlnggxvg', '16-17 j: jjjjjjjjjjjjjjjjp', '6-10 q: nqmzqflbhqqb', '12-19 j: jjjjjjwjjjjkjjjjjjgt', '8-10 s: sscssssssp', '11-12 s: ssssssssssds', '2-5 n: hswqnqldwwbbmnnrnht', '4-7 p: ztpvbqpwsxrgrkp', '3-9 h: hhlhhcjrkhwnhq', '10-12 k: kkkkkkkkklkwk', '14-15 w: wwwwwvwwwwkwwqwnw', '16-20 b: bbbbbbbbbbbbbbbhbbbt', '2-5 t: tttttftttttt', '3-12 l: qswhtwvnfmfwn', '11-12 b: bbbbbbbbbjgvbbbbbbz', '8-13 w: wwwwtwwvwwwww', '5-6 f: kgjfhfffv', '7-17 g: qpxgkvgttkhxjhzxnv', '2-3 n: rhffpsqknv', '2-10 p: pkpppppppppp', '3-15 p: rnpqjpgmcpgzkxcppk', '12-13 d: nhdddldxdddddndpdddj', '14-16 h: hhhhhhhhhhhhhbrhhhhh', '4-9 r: rpzrcnrrrlx', '2-14 f: ffffzfzffffffjfff', '1-9 s: snhfksssxssss', '1-14 n: bnnnnnnnnlnnnn', '2-3 c: cwtccc', '10-12 k: kkkkkkkkcskkkdkk', '2-5 r: qrqsrkrk', '3-11 k: nlkqkszttxk', '2-3 d: vqdgpwnjprgsgsdrxwk', '7-12 k: hkkkkkkdkkkrk', '6-8 r: smmfvtxrhzvnrj', '8-10 l: llrllllllmll', '5-10 l: bpwgqlnktt', '4-6 f: flfvjfff', '13-14 b: bbbbbbbbbbfbqzzb', '5-6 m: rmhmqmkmtkmjnmvdx', '10-16 j: jtjjjjjjjdkjgjjjj', '3-4 c: cpcc', '10-11 v: vxgbfvqftvmc', '5-12 n: knqlnbhdphpw', '7-13 r: rrrrrtrrrrrrrrr', '4-7 n: nbnnffkjnwpqnhvqnr', '4-13 r: htrkdwrcmcndrxngd', '1-8 h: dhhhhjhdxhh', '4-8 b: bbbcbbbg', '1-7 b: zqpzzqbfbwbwcbbbp', '6-7 l: jlhllllmljvl', '9-11 w: hwpwlcwkwcwjgkt', '14-17 m: mmmmmmmmmmmmmmmmjm', '6-11 r: rrrrrbrrrrr', '1-6 c: fccxxc', '14-15 j: jjkjjjbjjjfjjljfjj', '15-17 q: qqqqqqqqvqqjqqqqz', '11-14 j: qjjsjjjjjjcjjjj', '11-13 m: mfhjhnsshfxmmm', '6-9 z: wrsjtzzzj', '6-19 b: lbkksbnggbcdpffqjxbb', '1-5 w: wwwwwww', '3-5 h: htdhh', '5-15 n: nlfdnkvknxgbqlw', '3-4 z: pzrz', '7-9 h: hhslhhkhhhhh', '11-13 n: wqnrnbnnlnjnd', '15-17 f: ffsfffffffffffbfff', '1-2 m: pmmt', '8-9 z: zzzzzzzmzz', '2-12 q: qqftqqqklxjc', '12-13 p: pppppppppppbp', '8-9 q: qqqqxqqlqqqqq', '3-5 m: mhmfbq', '3-5 j: ckpkjjf', '7-11 k: kgkkkkkkkkkkkk', '2-3 n: pnnnnmmnkl', '1-6 l: lnvqjlflmp', '3-14 t: nhzvstnltttdftt', '2-3 s: hsrscsz', '9-12 b: bbdbbbsbbjbgb', '1-10 h: mlkcgnrkwhpgwjvflhgx', '5-7 p: spnpmppwp', '2-3 h: hrhh', '8-11 g: fggsggqhgpg', '5-8 n: nsxnvnlpnvn', '9-11 f: fvffffjfffrcfff', '6-9 q: qqqpzqmqpstrk', '8-12 v: vmvvvvpzvrvvv', '2-4 x: cnbx', '3-5 h: hhqrhhh', '6-13 t: ttttttttttttltvttt', '2-4 v: zqvvgrxwtw', '6-8 v: vdbvvfjv', '16-19 g: gggggggggggggggjggg', '4-6 m: mmwmstmpmj', '1-11 b: bnxzhlbbgbpdvp', '7-16 n: txfjncnhsxgbjvhh', '5-8 m: mmtvmkmvfkmzmpmd', '3-6 g: ggjgggg', '8-12 l: lslllglqcnlwlll', '2-4 l: llpqjdwxq', '6-7 b: bbbbbvb', '6-12 b: bbbnbbbbbkrq', '17-18 s: msfggsssfsrdvssssdr', '3-5 m: mmmmb', '4-7 g: ggrwgbgggg', '5-6 z: zzzzjpz', '1-3 l: mrvclxrpvgnrl', '11-13 g: gggjgggggggbgg', '1-6 q: qqqqqjqqqz', '3-5 d: dndnpzdmqcjrdgd', '8-11 g: gggggggbggqggggggg', '1-7 k: dkkkkkfkkkkkkrk', '3-9 p: slbxznfwvjpnj', '12-14 t: kbthtttfttrttt', '3-6 x: xxbxxkxx', '4-5 z: zzzdz', '6-13 c: ccbcjccpcnscqc', '11-14 x: xxxgmnxxxxfxhx', '2-4 b: gjbrwk', '3-4 l: bwmlzldj', '10-13 d: qdcxdbrdrdddkdnddd', '7-9 d: dddflddbwnmddd', '12-14 f: rkgdfbdkqhnfsqjltntx', '5-14 x: xxxxxxxxxxxxxxx', '8-18 r: rrrrrrrlrrrrrrrrrr', '1-19 q: qqqqqqqqqqqqqqqqqqdq', '7-11 c: kscqhtcccctprbc', '3-5 h: dchjkntfhrbmmkkjpnh', '2-9 l: lllllllln', '1-6 c: sqczzcnkpwrcgvctlrc', '6-16 f: wcnppfpffjxpthhfxf', '16-17 x: xxxxcxxxrxsfxxpxfq', '7-9 q: qqqqqqqqt', '4-6 h: hxhhkgg', '12-20 v: pwvzsxtvvslvfxhvcvtz', '12-17 k: tkkkkkkkcfktknkkkk', '2-3 b: bpqr', '4-5 m: mhppm', '4-9 g: jrgxgqjqgrrpj', '7-12 h: hhswhqwhhqhhhlhtkhzw', '5-19 l: llllhlllllllllllllll', '2-3 n: mqncngfps', '6-15 q: qqqqqnhqqqqqqqtqq', '1-8 k: kfkkkkkkr', '5-10 f: pmpffbdkfpffgffcf', '3-8 b: bbsbcbbb', '9-12 h: hwhhhxhshhhhhc', '1-5 r: nhcrrbrrrj', '2-4 q: qqqsq', '13-17 h: lrlngvrhpsdmhkhzt', '8-17 m: rmmmmmmlmmmmqmsmmqm', '4-8 n: njnsnkjkhnkgblg', '9-10 d: pdwdkgcdrdzqdd', '3-4 p: pppp', '10-12 j: zcjjjjqwjrjj', '1-9 d: mddgrxsdk', '2-4 v: gsvvjv', '5-7 h: hhhbbhjh', '15-16 w: wwjwwwwwwwwwwwbw', '8-10 b: cbczjdpbkhdbkpbztn', '7-10 z: skfvjzzxzt', '15-16 m: mmmmmmrmjzxmmmbtmmm', '2-6 j: rjjgqb', '4-16 d: dptndnvddgtpqdddd', '7-8 j: jjhjjjbd', '2-3 w: bwdr', '4-6 g: jgngnmgggfpgcn', '2-3 p: ppkp', '7-8 m: mmmmmmnm', '5-6 l: lfllln', '3-4 r: rrrm', '6-7 s: ssssssss', '4-15 g: kdtgzznwrczjzgx', '11-12 w: jhwwrwwpwwwmwwfwgww', '13-15 w: wwwwcjjwwwwwgwwwwwf', '4-11 f: fffxffffffff', '3-7 g: ggggggpg', '3-10 m: mmnmmmmmmm', '9-11 h: hfhhhqhhhchhhwh', '4-5 j: jjqjq', '13-14 x: jmxnxbjrklnvxtn', '5-6 f: zzkqnzchtfnvffqd', '4-8 j: cxcjvfjjkjz', '8-14 s: sssssswnrsssscsss', '6-12 t: dftrtdvtxttt', '3-4 p: ppmp', '1-5 z: zzgszfrg', '1-8 g: wbgwggdgtswrlllj', '2-4 f: fffpf', '16-17 t: tttrktsmtmpttttttnt', '6-11 m: mqsxmmtfthmfwn', '2-3 c: mcbs', '1-3 j: xmjj', '15-16 j: jtjjjjjjjjjjjjjxj', '6-8 k: kkrkktckk', '9-11 l: ltlllllsllmlz', '17-18 s: sxmssqtjrhmzhssssk', '9-13 k: kkkkkkkkkkkkkkkhk', '6-9 g: kpnhsggmqklvtttgcxvl', '5-7 z: vzrxbmzzwglvczz', '4-10 k: khkkdkkckkkkkzkk', '2-6 q: qsqqnqq', '1-3 x: qxsxxxx', '10-14 x: xxzxxtxxxjcxxx', '4-6 z: dzzzvz', '1-2 c: cccv', '9-12 h: hhhhhhhhhhhc', '13-15 z: zzgzzzzzzmzzqzzkzz', '3-6 h: pgvjdhtpmthbz', '10-13 x: mxqbxxwxxxhxfrxxchxx', '2-5 b: qbbmpzrzkcjqqwbj', '3-14 q: ltxhrqqqqzfqqq', '6-10 j: jjjjprjkqj', '9-15 c: dsncxxlqwvzccwc', '12-16 m: nxrmdgmmxmscmhnm', '4-5 p: ppppthp', '10-13 d: ddddddddddddb', '2-6 x: bxkwbtsx', '5-7 j: jjjjqjjjjjj', '8-10 d: wzdddddtdddd', '6-9 z: dlzzzzzvwz', '2-3 h: hhhh', '11-13 t: ttttjtttttttxtt', '4-5 s: sdbps', '2-10 x: dcmxxxlxxhgxftrjbp', '9-15 h: hhhhhhhzjzhwhrkhh', '2-6 f: ftxhffff', '4-5 k: kkfrkwnbkkh', '3-5 m: mmdmm', '5-10 z: znvxzzldzvhqztr', '7-8 r: rrrrrrcr', '14-16 k: kkkkkkvkkkkkkbkk', '4-10 x: cxsxzxxxxxxxxn', '12-13 s: ssssssssssssss', '7-9 s: sswssssshs', '1-3 c: ncccrc', '7-9 r: rrrwrrtwr', '13-14 v: vvvvvvvvvvvvnv', '4-6 k: bkkkkx', '7-10 r: rrrrrrrrrrrrr', '7-8 l: llllllzll', '3-11 v: vqvvmnkvvswgkqvmvd', '8-10 c: cccccdcccm', '1-9 s: sssksqsshsj', '5-8 c: cccchmcccc', '5-6 h: hsqhhghrhk', '4-5 z: czzzrzlzn', '2-4 f: fzfffj', '14-17 p: pppppppppppppppmpp', '4-5 x: ldqxq', '12-16 g: gtgggggggggpgggggt', '13-14 v: zfbmrhphzmrvqv', '6-10 p: ppppppppphppkp', '10-12 l: xlllklllllkwlcl', '4-6 v: qvbvgdw', '6-12 q: qqqsqlqqqqqq', '3-5 s: rssgpssnb', '1-2 g: gzlpcmbsmgrq', '2-9 w: lpmbmfvpwggfvmzmmw', '4-6 n: nqtfzz', '3-4 f: fftf', '13-17 n: nnnznkgmnnnnpnngnfn', '8-10 p: ppppxppppppppprppsp', '10-12 g: ggnggkggggcvg', '3-8 l: lxrcbjnddcbpg', '6-7 q: qkjqfqqdkkkqrqqqc', '5-8 p: wpbpmpwpfsblpplmpp', '2-7 n: bbrtwnhhttntqhnr', '1-2 p: pcdxzjwmnkfjkpbj', '1-15 n: nnnnnnnnnnnnnnznn', '18-20 s: ssmsssssssssssssrssw', '1-12 h: vhxhmhhhhhhhd', '3-7 r: qkkvhvr', '3-5 k: xkpkkkzbtwkv', '2-4 z: zfzz', '1-2 t: ktttt', '2-3 p: pbwp', '2-4 j: ljjj', '14-15 t: pzpcktthttfttttt', '3-4 n: nwnj', '8-10 l: lzllllllln', '1-12 q: qqqqqqqqqqqqq', '6-12 z: xxltbzrpwzzmw', '15-16 q: qqqqqqqqqqqvqqqjq', '4-5 r: rhmrkrd', '7-10 r: rrrrrrlrrrrrr', '16-18 t: ttttwttttttttttttn', '9-17 m: bmmmmmmzmmpmmhmrw', '9-13 r: rrxfrrxrrrrrrr', '13-18 p: ppdxprpqppbpppprpz', '5-8 p: rprmpfpxgjphfktszplp', '5-7 h: hhhhhhnh', '3-7 h: rwhpshznhhh', '9-10 x: xwxzbrxxgxrxxdxxs', '6-7 h: hvhhhhng', '5-6 b: bbbbwhbb', '4-5 g: gbgggg', '3-9 g: gsbggghggpgdgg', '1-3 r: rxrhh', '3-4 c: rccn', '4-8 z: zpzzznzzzwz', '14-17 b: bbbbbbbbbbbbbbbbbzb', '2-4 w: rwvwrdn', '3-6 p: pfpsgp', '2-12 p: zpwkjpppbppjrppknh', '5-9 t: tmttgtttn', '2-3 v: wvvcv', '3-5 h: bnbhhtjhk', '15-17 f: tffwftdskgfxgfffpk', '16-17 h: hphhhhdhhhhhxhhhrhh', '7-8 d: ddddddtnd', '9-20 t: tqttttttttttttttbttw', '1-11 v: vxcgzvvvkrlqvg', '2-6 r: ghrbwrtfksqkxx', '8-10 w: wwwswwwmvwww', '4-10 m: mqmmmtmmfq', '2-3 g: gkgtgv', '9-11 w: wwwwsqwwpwwxrwww', '3-4 w: zwxwtcscwmwmndcw', '8-9 q: xsqqqqzxfqfv', '2-4 w: wwhh', '9-18 d: ddddddhddddddddddq', '3-4 s: sssjsvs', '15-16 p: wphpxpppppppppppppvp', '10-12 t: qftttqhtvttt', '1-2 b: vbfxqgbzrktjm', '3-4 k: lkkr', '9-11 d: dddddkdqdttddd', '9-11 m: mwngbfmhmcvwx', '2-5 b: scbxbb', '6-9 z: zzzzzzzzzzz', '1-3 z: zzvhz', '5-7 x: xxxxxxkxx', '1-5 s: ssscshss', '1-7 s: csrfvfsqjss', '16-17 k: fwdkkkckkkkrrkkck', '3-4 h: hhhs', '4-8 w: wwwswwwx', '1-10 f: fffskffsdfcfvfff', '7-15 r: rrrrrrrrrrrrrrxr', '1-2 k: kvxbzdcnsqrskhmx', '2-4 s: wbvsfs', '2-7 q: rbgqpqdq', '15-16 f: fffffffffffffffq', '1-3 c: bccpkm', '5-11 g: fsvgthpglgg', '3-5 f: ffffwf', '5-16 j: djmwqfxsbzwjdwtj', '3-4 p: pprpp', '5-6 n: nhnnwj', '8-12 s: tssssssrsssksss', '5-8 p: pppppppppppp', '10-15 w: wgfwwcwtmwwgwpwwh', '12-15 l: lllllllllllplll', '1-8 c: ccccqccd', '3-4 z: zzzvzkzgc', '2-10 h: swwbtfkvfhrjztdzx', '2-7 z: zhbzkzlzz', '2-9 q: ddqdqpkcjqkfgqtcjqq', '9-10 l: lllmllkltlll', '2-3 n: ngwn', '2-3 r: rrnr', '5-10 n: ltnnnknnvcnnn', '7-9 p: jtpptpllpj', '2-5 s: slssssszssssssss', '16-17 d: dddddddddddddddlp', '2-5 q: bbwqqbkmdhqmjhn', '7-10 m: qmpgmmsmmmmkmmkj', '4-7 g: vczggdgbgxgg'] |
QUEUES_KEY = 'rq:queues'
WORKERS_KEY = 'rq:workers'
SUSPENDED_KEY = 'rq:suspended'
QUEUE_NAMESPACE_PREFIX = 'rq:queue:'
JOB_NAMESPACE_PREFIX = 'rq:job:'
def queue_key_from_name(name):
return QUEUE_NAMESPACE_PREFIX + name
def queue_name_from_key(key):
assert key.startswith(QUEUE_NAMESPACE_PREFIX)
return key[len(QUEUE_NAMESPACE_PREFIX):]
def job_id_from_key(key):
assert key.startswith(JOB_NAMESPACE_PREFIX)
return key[len(JOB_NAMESPACE_PREFIX):]
def job_key_from_id(job_id):
return JOB_NAMESPACE_PREFIX + job_id
def children_key_from_id(job_id):
return 'rq:job:{0}:children'.format(job_id)
def parents_key_from_id(job_id):
return 'rq:job:{0}:parents'.format(job_id)
def started_registry_key_from_name(name):
return 'rq:wip:{0}'.format(name)
def finished_registry_key_from_name(name):
return 'rq:finished:{0}'.format(name)
def deferred_registry_key_from_name(name):
return 'rq:deferred:{0}'.format(name)
def worker_key_from_name(name):
return 'rq:worker:{0}'.format(name)
| queues_key = 'rq:queues'
workers_key = 'rq:workers'
suspended_key = 'rq:suspended'
queue_namespace_prefix = 'rq:queue:'
job_namespace_prefix = 'rq:job:'
def queue_key_from_name(name):
return QUEUE_NAMESPACE_PREFIX + name
def queue_name_from_key(key):
assert key.startswith(QUEUE_NAMESPACE_PREFIX)
return key[len(QUEUE_NAMESPACE_PREFIX):]
def job_id_from_key(key):
assert key.startswith(JOB_NAMESPACE_PREFIX)
return key[len(JOB_NAMESPACE_PREFIX):]
def job_key_from_id(job_id):
return JOB_NAMESPACE_PREFIX + job_id
def children_key_from_id(job_id):
return 'rq:job:{0}:children'.format(job_id)
def parents_key_from_id(job_id):
return 'rq:job:{0}:parents'.format(job_id)
def started_registry_key_from_name(name):
return 'rq:wip:{0}'.format(name)
def finished_registry_key_from_name(name):
return 'rq:finished:{0}'.format(name)
def deferred_registry_key_from_name(name):
return 'rq:deferred:{0}'.format(name)
def worker_key_from_name(name):
return 'rq:worker:{0}'.format(name) |
class Solution:
def search(self, nums: List[int], target: int) -> int:
if not nums:
return -1
left, right = 0, len(nums) - 1
while left <= right:
m = (left + right) // 2
if nums[m] == target:
return m
if nums[m] >= nums[left]:
if nums[left] <= target < nums[m]:
right = m - 1
else:
left = m + 1
else:
if nums[m] < target <= nums[right]:
left = m + 1
else:
right = m - 1
return -1 | class Solution:
def search(self, nums: List[int], target: int) -> int:
if not nums:
return -1
(left, right) = (0, len(nums) - 1)
while left <= right:
m = (left + right) // 2
if nums[m] == target:
return m
if nums[m] >= nums[left]:
if nums[left] <= target < nums[m]:
right = m - 1
else:
left = m + 1
elif nums[m] < target <= nums[right]:
left = m + 1
else:
right = m - 1
return -1 |
# Write your solution for 1.3 here!
n= 0
i= 0
while n <= 10000:
i = i + 1
n = n + i
print(i)
| n = 0
i = 0
while n <= 10000:
i = i + 1
n = n + i
print(i) |
##
## Intro to Git, Python, and Programming Basics (bypassing XML)
##
# going over some git basics
# git --version
# git help
# Pull down a repo from somewhere
# git clone <url>
# git branches; discussed to some degree; means of doing changes off to side without affecting core code
# then we can merge this stuff in as needed
# git remote -v
# origin git@github.com:russellpope/devnet-express-dc.git (fetch)
# origin git@github.com:russellpope/devnet-express-dc.git (push)
# lets us know where we're pulling stuff from and where we make a push to
# origin in this case is an alias
# git pull
# Pulls the latest changes for the selected branch
# python -V or python --version
# note you can do this with py3 in a virtualenv or python3 --version
# python YOURSCRIPT.py
# Some python bits of note:
# indentation defining scopes (WHITESPACE CHARACTER IS IMPORTANT)
# i.e. spaces and tabs are different things
#
# Sample below; illustrates white spaces
print("Hellworld!")
num = 1
if num < 1:
print(f"I'm less than {num}!")
print("goodbye cruel world!")
# note the 'if' condition will never execute
# editorial note: I used an f string because I wanted to
print("Helloworld!")
num = 1
print(f"Value is: {num}")
print("Value is: " + str(num))
print("Value is:", num)
if num < 1:
print(f"I'm less than {num}!")
elif num == 1:
print(f"I'm {num}")
else:
print(f"{num} is something else!")
#
# tried to transcribe his example before he switched sides
# I hate his variable names because they look like java stuff
# goes through an excercise of running python from CLI
# walking through his interpreter stuff
# ran the below with expected output:
# >>> print("Hello World! How are you?")
# Hello World! How are you?
# to exit python interpreter
# >>> quit()
#
# talks about running scripts
# unix prompt below:
# #python your_script_here.py
# Covers the "shebang" line
# #!/usr/bin/python
# or you could do this which he may not cover
# #!/usr/bin/env python
# This will actually use whatever python interpreter is defined in the environment var
# Scopes, operators, conditiona statemments
# Parsing JSOn with python
sample_json = {
"first_name" : "Mike",
"last_name" : "Maas"
}
# data structure
# nice thing about it is that it maps to python dictionaries pretty nicely
# collections of key/value pairs enclosed in {}
# Can also have values be ordered lists of values
# or even ordered lists of key value pairs
sample_json_with_array = [{"first_name" : "Mike","last_name" : "Maas"},
{"first_name" : "Brett","last_name" : "Tiller"}]
# provided a more complex data structure to describe a donut to showcase the sorts of embedded stuff you can do
##
##
# REST APIs
##
##
# two major types of web services: REST or SOAP
#
# Commonly used in industry
# R in rest is Representational not resourcing
# Representation State Transfer
# Give me a look at a thing
# Here's what the thing should look like now!
# Typically over HTTP
# Several REST methods;
# GET - go get some information
# POST - Create a new thing with this information
# PUT - Update an existing thing with this information
# DELETE - Delete/destroy the thing
# These typically go to different URLs
# Lots of ways to authenticate; varies from API to API
# Basic HTTP - Username/Password
# Different status codes
# 200 "Everything is fine! Here's your data"
# 201 "I got the thing you asked me to do okay!"
# 4XX "You screwed up!"
# 5XX "I screwed up!"
# Headers; important to define ESPECIALLY WHEN POSTing or PUTing
# Body; used in POST/PUT for updates
# Using Spark API as starting point
# talking about OAUTH token; Spark makes it easy to retrieve
# Request/response; i.e. Get rooms and it responds with a list of rooms
# Example shows a GET to a regular URL
| print('Hellworld!')
num = 1
if num < 1:
print(f"I'm less than {num}!")
print('goodbye cruel world!')
print('Helloworld!')
num = 1
print(f'Value is: {num}')
print('Value is: ' + str(num))
print('Value is:', num)
if num < 1:
print(f"I'm less than {num}!")
elif num == 1:
print(f"I'm {num}")
else:
print(f'{num} is something else!')
sample_json = {'first_name': 'Mike', 'last_name': 'Maas'}
sample_json_with_array = [{'first_name': 'Mike', 'last_name': 'Maas'}, {'first_name': 'Brett', 'last_name': 'Tiller'}] |
#
# liberator:configuration.py
#
# The Initial Developer of the Original Code is
# Minh Minh <hnimminh at[@] outlook dot[.] com>
# Portions created by the Initial Developer are Copyright (C) the Initial Developer.
# All Rights Reserved.
#
#-----------------------------------------------------------------------------------------------------
# GLOBAL CONFIGURATION FILES
#-----------------------------------------------------------------------------------------------------
_APPLICATION = 'LIBRESBC'
_DESCRIPTION = 'Open Source Session Border Controller for Large-Scale Voice Infrastructures'
_SWVERSION = '0.5.7'
#-----------------------------------------------------------------------------------------------------
# REDIS ENDPOINT
#-----------------------------------------------------------------------------------------------------
REDIS_HOST = '{{redis.host}}'
REDIS_PORT = {{redis.port}}
REDIS_DB = {{redis.database}}
REDIS_PASSWORD = {{ ('%s')|format(redis.password)|to_json if redis.password else 'None' }}
SCAN_COUNT = 1000
REDIS_TIMEOUT = 5
#-----------------------------------------------------------------------------------------------------
# VOICE ATTRIBUTE
#-----------------------------------------------------------------------------------------------------
SWCODECS = ['ALAW', 'ULAW', 'OPUS', 'G729', 'AMR', 'AMR-WB']
_BUILTIN_ACLS_ = ['rfc1918.auto', 'nat.auto', 'localnet.auto', 'loopback.auto']
#-----------------------------------------------------------------------------------------------------
# SERVER PROPERTIES
#-----------------------------------------------------------------------------------------------------
NODEID = '{{nodeid}}'
CLUSTERS = {
'name': 'defaultname',
'members': [NODEID],
"rtp_start_port": 0,
"rtp_end_port": 0,
"max_calls_per_second": 0,
"max_concurrent_calls": 0
}
#-----------------------------------------------------------------------------------------------------
CHANGE_CFG_CHANNEL = 'CHANGE_CFG_CHANNEL'
SECURITY_CHANNEL = 'SECURITY_CHANNEL'
NODEID_CHANNEL = f'{NODEID.upper()}_CHANNEL'
#-----------------------------------------------------------------------------------------------------
# CALL ENGINE EVENT SOCKET
#-----------------------------------------------------------------------------------------------------
ESL_HOST = '127.0.0.1'
ESL_PORT = 8021
# LOG DIRECTORY
LOGDIR = '/var/log/libresbc'
#-----------------------------------------------------------------------------------------------------
# HTTPCDR DATA
#-----------------------------------------------------------------------------------------------------
HTTPCDR_ENDPOINTS = {{httpcdr.endpoints if httpcdr else 'None'}}
| _application = 'LIBRESBC'
_description = 'Open Source Session Border Controller for Large-Scale Voice Infrastructures'
_swversion = '0.5.7'
redis_host = '{{redis.host}}'
redis_port = {{redis.port}}
redis_db = {{redis.database}}
redis_password = {{'%s' | format(redis.password) | to_json if redis.password else 'None'}}
scan_count = 1000
redis_timeout = 5
swcodecs = ['ALAW', 'ULAW', 'OPUS', 'G729', 'AMR', 'AMR-WB']
_builtin_acls_ = ['rfc1918.auto', 'nat.auto', 'localnet.auto', 'loopback.auto']
nodeid = '{{nodeid}}'
clusters = {'name': 'defaultname', 'members': [NODEID], 'rtp_start_port': 0, 'rtp_end_port': 0, 'max_calls_per_second': 0, 'max_concurrent_calls': 0}
change_cfg_channel = 'CHANGE_CFG_CHANNEL'
security_channel = 'SECURITY_CHANNEL'
nodeid_channel = f'{NODEID.upper()}_CHANNEL'
esl_host = '127.0.0.1'
esl_port = 8021
logdir = '/var/log/libresbc'
httpcdr_endpoints = {{httpcdr.endpoints if httpcdr else 'None'}} |
#9 type c
str1=input('Enter the 1st String: ')
str2=input('Enter the 2st String: ')
if str1<str2:
print(str2)
else:
l=len(str1)
for x in range(l//2):
print(' '*x+str1[x]+' '*(l-(2*(x+1)))+str1[-(x+1)])
| str1 = input('Enter the 1st String: ')
str2 = input('Enter the 2st String: ')
if str1 < str2:
print(str2)
else:
l = len(str1)
for x in range(l // 2):
print(' ' * x + str1[x] + ' ' * (l - 2 * (x + 1)) + str1[-(x + 1)]) |
__title__ = 'freeproxies'
__description__ = 'Free proxies for humans'
__url__ = 'https://github.com/iamkamleshrangi/freeproxies'
__version__ = '0.0.1'
__author__ = 'Kamlesh Kumar Rangi'
__author_email__ = 'iamkamleshrangi@gmail.com'
__license__ = 'GPL v3'
__copyright__ = 'Copyright 2020 Kamlesh Kumar Rangi'
| __title__ = 'freeproxies'
__description__ = 'Free proxies for humans'
__url__ = 'https://github.com/iamkamleshrangi/freeproxies'
__version__ = '0.0.1'
__author__ = 'Kamlesh Kumar Rangi'
__author_email__ = 'iamkamleshrangi@gmail.com'
__license__ = 'GPL v3'
__copyright__ = 'Copyright 2020 Kamlesh Kumar Rangi' |
"""
Write a Python function that returns the highest number in a list.
input_list = [9,6,45,67,12]
Expected output = 67
"""
def high_num(input_list):
input_list.sort()
return input_list[-1]
| """
Write a Python function that returns the highest number in a list.
input_list = [9,6,45,67,12]
Expected output = 67
"""
def high_num(input_list):
input_list.sort()
return input_list[-1] |
# Sensor classes
class SensCalPoly: # Polynomial calibration curve class
def __init__(self, id, signalMin, signalMax, *args):
self.id = id
self.coeffs = []
for arg in args:
self.coeffs.append(arg)
self.signalMin = signalMin
self.signalMax = signalMax
def setCoeffs(self, *args):
self.coeffs = []
for arg in args:
self.coeffs.append(arg)
def setId(self, id):
self.id = id
def getId(self):
return self.id
def applyCal(self, signal):
if self.signalMin <= signal and signal <= self.signalMax:
calSignal = 0
degree = 0
for coeff in self.coeffs:
calSignal += coeff * signal ** degree
degree += 1
return calSignal
else:
return -1
class ADistSens:
def __init__(self, id, analog, aPin, calObj):
self.id = id
self.analog = analog[aPin]
self.aPin = aPin
self.cal = calObj
def setCal(self, calObj):
self.cal = calObj
def getObstDist(self):
return self.cal.applyCal(self.analog)
def hasObst(self, distMin, distMax):
obstDist = self.getObstDist()
if obstDist != -1 and distMin <= obstDist and obstDist <= distMax:
return True
else:
return False
class DProxSens:
def __init__(self, id, analog, aPin):
self.id = id
self.analog = analog[aPin]
self.aPin = aPin
def hasObst(self):
if self.analog < 1023:
return True
else:
return False
| class Senscalpoly:
def __init__(self, id, signalMin, signalMax, *args):
self.id = id
self.coeffs = []
for arg in args:
self.coeffs.append(arg)
self.signalMin = signalMin
self.signalMax = signalMax
def set_coeffs(self, *args):
self.coeffs = []
for arg in args:
self.coeffs.append(arg)
def set_id(self, id):
self.id = id
def get_id(self):
return self.id
def apply_cal(self, signal):
if self.signalMin <= signal and signal <= self.signalMax:
cal_signal = 0
degree = 0
for coeff in self.coeffs:
cal_signal += coeff * signal ** degree
degree += 1
return calSignal
else:
return -1
class Adistsens:
def __init__(self, id, analog, aPin, calObj):
self.id = id
self.analog = analog[aPin]
self.aPin = aPin
self.cal = calObj
def set_cal(self, calObj):
self.cal = calObj
def get_obst_dist(self):
return self.cal.applyCal(self.analog)
def has_obst(self, distMin, distMax):
obst_dist = self.getObstDist()
if obstDist != -1 and distMin <= obstDist and (obstDist <= distMax):
return True
else:
return False
class Dproxsens:
def __init__(self, id, analog, aPin):
self.id = id
self.analog = analog[aPin]
self.aPin = aPin
def has_obst(self):
if self.analog < 1023:
return True
else:
return False |
num = 50
flag = True
for i in range(2, num-1):
if(num % i == 0):
flag = False
break
if(flag == True):
print("Prime number.")
if(flag == False):
print("Not a prime number.")
| num = 50
flag = True
for i in range(2, num - 1):
if num % i == 0:
flag = False
break
if flag == True:
print('Prime number.')
if flag == False:
print('Not a prime number.') |
# This program is used to make a fibonacci sequence in a certain terms
def fibonacci(term) :
n1 = 0
n2 = 1
if(term <= 0) :
print("Please, print with positive integer")
elif(term == 1) :
print(n1)
else :
print(n1)
print(n2)
count = 1
while(count <= term-2) :
n_update = n1 + n2
# Update number
n1 = n2
n2 = n_update
print(n2)
count += 1
input_number = int(input("How many terms? "))
fibonacci(input_number) | def fibonacci(term):
n1 = 0
n2 = 1
if term <= 0:
print('Please, print with positive integer')
elif term == 1:
print(n1)
else:
print(n1)
print(n2)
count = 1
while count <= term - 2:
n_update = n1 + n2
n1 = n2
n2 = n_update
print(n2)
count += 1
input_number = int(input('How many terms? '))
fibonacci(input_number) |
# uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: otp.distributed.PotentialShard
class PotentialShard:
__module__ = __name__
def __init__(self, id):
self.id = id
self.name = None
self.population = 0
self.welcomeValleyPopulation = 0
self.active = 1
self.available = 1
return | class Potentialshard:
__module__ = __name__
def __init__(self, id):
self.id = id
self.name = None
self.population = 0
self.welcomeValleyPopulation = 0
self.active = 1
self.available = 1
return |
class Move:
def __init__(self, start_row, start_column, end_row, end_column):
self.start_row = start_row
self.start_column = start_column
self.end_row = end_row
self.end_column = end_column
| class Move:
def __init__(self, start_row, start_column, end_row, end_column):
self.start_row = start_row
self.start_column = start_column
self.end_row = end_row
self.end_column = end_column |
"""
You are given two sets, and .Your job is to find whether set is a subset of set .If set is subset of set , print True.
If set is not a subset of set , print False.
Input Format
The first line will contain the number of test cases, .
The first line of each test case contains the number of elements in set .
The second line of each test case contains the space separated elements of set .
The third line of each test case contains the number of elements in set .
The fourth line of each test case contains the space separated elements of set .
Sample Input
3
5
1 2 3 5 6
9
9 8 5 6 3 2 1 4 7
1
2
5
3 6 5 4 1
7
1 2 3 5 6 8 9
3
9 8 2
Sample Output
True
False
False
"""
T = int(input())
for i in range(T):
Set_A = int(input())
arrA = set(input().split())
Set_B = int(input())
arrB = set( input().split())
print(arrA.issubset(arrB))
| """
You are given two sets, and .Your job is to find whether set is a subset of set .If set is subset of set , print True.
If set is not a subset of set , print False.
Input Format
The first line will contain the number of test cases, .
The first line of each test case contains the number of elements in set .
The second line of each test case contains the space separated elements of set .
The third line of each test case contains the number of elements in set .
The fourth line of each test case contains the space separated elements of set .
Sample Input
3
5
1 2 3 5 6
9
9 8 5 6 3 2 1 4 7
1
2
5
3 6 5 4 1
7
1 2 3 5 6 8 9
3
9 8 2
Sample Output
True
False
False
"""
t = int(input())
for i in range(T):
set_a = int(input())
arr_a = set(input().split())
set_b = int(input())
arr_b = set(input().split())
print(arrA.issubset(arrB)) |
'''This file holds the version of the project, according to Jira'''
# starting ml modelling
__version__ = '0.2.4'
| """This file holds the version of the project, according to Jira"""
__version__ = '0.2.4' |
#LeetCode problem 572: Subtree of Another Tree
# 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 isSubtree(self, s: TreeNode, t: TreeNode) -> bool:
res1=[]
res2=[]
res1=self.getInorder(s,res1)
res2=self.getInorder(t,res2)
s1=''
for i in range(len(res1)):
s1+=res1[i]
s2=''
for i in range(len(res2)):
s2+=res2[i]
print(s1,s2)
return s2 in s1
def getInorder(self, root:TreeNode,res):
if root is None:
res.append("null")
return
if root.left is None:
res.append("lnull")
elif root.right is None:
res.append("rnull")
self.getInorder(root.left,res)
res.append(str(root.val))
self.getInorder(root.right,res)
return res
| class Solution:
def is_subtree(self, s: TreeNode, t: TreeNode) -> bool:
res1 = []
res2 = []
res1 = self.getInorder(s, res1)
res2 = self.getInorder(t, res2)
s1 = ''
for i in range(len(res1)):
s1 += res1[i]
s2 = ''
for i in range(len(res2)):
s2 += res2[i]
print(s1, s2)
return s2 in s1
def get_inorder(self, root: TreeNode, res):
if root is None:
res.append('null')
return
if root.left is None:
res.append('lnull')
elif root.right is None:
res.append('rnull')
self.getInorder(root.left, res)
res.append(str(root.val))
self.getInorder(root.right, res)
return res |
characterMapSean = {
"sean_base_001": "sean_base_001", # Auto: Edited
"sean_base_y_001": "", # Auto: Deleted
"sean_ex_001_001": "sean_ex_001_001", # Auto: Edited
"sean_ex_002_001": "sean_ex_002_001", # Auto: Edited
"sean_ex_003_001": "sean_ex_003_001", # Auto: Edited
"sean_ex_004_001": "sean_ex_004_001", # Auto: Edited
"sean_ex_005_001": "sean_ex_005_001", # Auto: Edited
"sean_ex_006_001": "sean_ex_006_001", # Auto: Edited
"sean_ex_007_001": "sean_ex_007_001", # Auto: Edited
"sean_ex_008_001": "sean_ex_008_001", # Auto: Edited
"sean_ex_009_001": "sean_ex_009_001", # Auto: Edited
"sean_ex_010_001": "sean_ex_010_001", # Auto: Edited
"sean_ex_011_001": "sean_ex_011_001", # Auto: Edited
"sean_ex_012_001": "sean_ex_012_001", # Auto: Edited
"sean_ex_013_001": "", # Auto: Deleted
"sean_ex_014_001": "", # Auto: Deleted
"sean_ex_y_001_001": "", # Auto: Deleted
"sean_ex_y_002_001": "", # Auto: Deleted
"sean_ex_y_003_001": "", # Auto: Deleted
"sean_ex_y_004_001": "", # Auto: Deleted
"sean_ex_y_005_001": "", # Auto: Deleted
"sean_ex_y_006_001": "", # Auto: Deleted
"sean_ex_y_007_001": "", # Auto: Deleted
"sean_ex_y_008_001": "", # Auto: Deleted
"sean_ex_y_009_001": "", # Auto: Deleted
"sean_ex_y_010_001": "", # Auto: Deleted
"sean_ex_y_011_001": "", # Auto: Deleted
"sean_ex_y_012_001": "", # Auto: Deleted
"sean_ex_y_013_001": "", # Auto: Deleted
"sean_ex_y_014_001": "", # Auto: Deleted
}
| character_map_sean = {'sean_base_001': 'sean_base_001', 'sean_base_y_001': '', 'sean_ex_001_001': 'sean_ex_001_001', 'sean_ex_002_001': 'sean_ex_002_001', 'sean_ex_003_001': 'sean_ex_003_001', 'sean_ex_004_001': 'sean_ex_004_001', 'sean_ex_005_001': 'sean_ex_005_001', 'sean_ex_006_001': 'sean_ex_006_001', 'sean_ex_007_001': 'sean_ex_007_001', 'sean_ex_008_001': 'sean_ex_008_001', 'sean_ex_009_001': 'sean_ex_009_001', 'sean_ex_010_001': 'sean_ex_010_001', 'sean_ex_011_001': 'sean_ex_011_001', 'sean_ex_012_001': 'sean_ex_012_001', 'sean_ex_013_001': '', 'sean_ex_014_001': '', 'sean_ex_y_001_001': '', 'sean_ex_y_002_001': '', 'sean_ex_y_003_001': '', 'sean_ex_y_004_001': '', 'sean_ex_y_005_001': '', 'sean_ex_y_006_001': '', 'sean_ex_y_007_001': '', 'sean_ex_y_008_001': '', 'sean_ex_y_009_001': '', 'sean_ex_y_010_001': '', 'sean_ex_y_011_001': '', 'sean_ex_y_012_001': '', 'sean_ex_y_013_001': '', 'sean_ex_y_014_001': ''} |
def getMinimumCost(k, c):
n = len(c)
x = n // k
price = 0
for i in range(1 , x + 1):
for _ in range(k):
max_c = max(c)
price += max_c * i
c.remove(max_c)
for j in c:
price += j * (i + 1)
return price
print(getMinimumCost(3 , [2, 5 , 6]))
| def get_minimum_cost(k, c):
n = len(c)
x = n // k
price = 0
for i in range(1, x + 1):
for _ in range(k):
max_c = max(c)
price += max_c * i
c.remove(max_c)
for j in c:
price += j * (i + 1)
return price
print(get_minimum_cost(3, [2, 5, 6])) |
PATH = "path"
SRC_PATH = "src_path"
CONFIG_PATH = "config_path"
USERNAME = "username"
EMAIL = "email"
ASSUMPTIONS_PATH = "ass_path"
NOTES_PATH = "notes_path"
TODOS_PATH = "todos_path"
CONFIG_FILENAME = "config.json"
ASSUMPTIONS_DIRNAME = "assumptions"
NOTES_DIRNAME = "notes"
TODOS_DIRNAME = "todos"
INITIALIZED_FLAG = "initialized" | path = 'path'
src_path = 'src_path'
config_path = 'config_path'
username = 'username'
email = 'email'
assumptions_path = 'ass_path'
notes_path = 'notes_path'
todos_path = 'todos_path'
config_filename = 'config.json'
assumptions_dirname = 'assumptions'
notes_dirname = 'notes'
todos_dirname = 'todos'
initialized_flag = 'initialized' |
# sender, recipent and mail subject
sender = 'sender@mail.com'
recipent = 'recipent@mail.com'
subject = 'New public IP address'
# SMTP url and port
smtpServer = 'smtp.mail.com:587'
# credentials for your mail account
username = 'sender@mail.com'
password = 'password' | sender = 'sender@mail.com'
recipent = 'recipent@mail.com'
subject = 'New public IP address'
smtp_server = 'smtp.mail.com:587'
username = 'sender@mail.com'
password = 'password' |
pizzas = ['Popcorn Shrimp Pizza ', 'Surf&Turf Pizza', 'BBQ Sausage Pizza']
for pizza in pizzas:
print("I like " + pizza)
print("I really love pizza!") | pizzas = ['Popcorn Shrimp Pizza ', 'Surf&Turf Pizza', 'BBQ Sausage Pizza']
for pizza in pizzas:
print('I like ' + pizza)
print('I really love pizza!') |
""" Defines the template of a format handling backend
Mainly a generic template to read and write functions.
The registery of backends is located in backends/__init__.py
"""
#==============================================================================
class BaseBackend(object):
""" Template class for managing access to table files
The aim of this class is to propose various format managers by
simply providing reading and writing methods
Define any format manager by deriving this class and defining
the two followin method:
read -- reading from the considered format
write -- export to the considered format
then you can register this format manager by using the
register_extension function
"""
#==============================================================================
def __init__(self, tableType, readerFunction = None, writerFunction = None):
""" constructor """
self.tableType = tableType
if readerFunction:
del self.read
self.read = readerFunction
if writerFunction:
del self.write
self.write = writerFunction
def read(self,*args, **kwargs):
""" to be overwritten """
pass
def write(self, *args, **kwargs):
""" to be overwritten """
pass
| """ Defines the template of a format handling backend
Mainly a generic template to read and write functions.
The registery of backends is located in backends/__init__.py
"""
class Basebackend(object):
""" Template class for managing access to table files
The aim of this class is to propose various format managers by
simply providing reading and writing methods
Define any format manager by deriving this class and defining
the two followin method:
read -- reading from the considered format
write -- export to the considered format
then you can register this format manager by using the
register_extension function
"""
def __init__(self, tableType, readerFunction=None, writerFunction=None):
""" constructor """
self.tableType = tableType
if readerFunction:
del self.read
self.read = readerFunction
if writerFunction:
del self.write
self.write = writerFunction
def read(self, *args, **kwargs):
""" to be overwritten """
pass
def write(self, *args, **kwargs):
""" to be overwritten """
pass |
class Solution:
def combinationSum(self, candidates, target):
# candidates.sort()
# dp = [[[]]] + [[] for i in range(target)]
# for i in range(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] = dp[i] + [L + [number]]
# return dp[target]
res = []
candidates.sort()
def dfs(remain, stack):
if not remain:
res.append(stack)
return
for item in candidates:
if item > remain:
break
elif not stack or item >= stack[-1]:
dfs(remain - item, stack + [item])
dfs(target, [])
return res | class Solution:
def combination_sum(self, candidates, target):
res = []
candidates.sort()
def dfs(remain, stack):
if not remain:
res.append(stack)
return
for item in candidates:
if item > remain:
break
elif not stack or item >= stack[-1]:
dfs(remain - item, stack + [item])
dfs(target, [])
return res |
# OpenWeatherMap API Key
api_key_owm= "b80fd2ed7964ad60c921362b393b0613"
# Google API Key
api_key_g = "YOUR KEY HERE!"
| api_key_owm = 'b80fd2ed7964ad60c921362b393b0613'
api_key_g = 'YOUR KEY HERE!' |
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def plusOne(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
def reverse(cur):
pre = None
while cur:
tmp = cur.next
cur.next = pre
pre = cur
cur = tmp
return pre
p = head = reverse(head)
carry = 1
pre = None
while p:
val = (p.val + carry) % 10
carry = 1 if val < p.val else 0
p.val = val
pre = p
p = p.next
if carry == 1:
pre.next = ListNode(1)
return reverse(head)
| class Solution(object):
def plus_one(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
def reverse(cur):
pre = None
while cur:
tmp = cur.next
cur.next = pre
pre = cur
cur = tmp
return pre
p = head = reverse(head)
carry = 1
pre = None
while p:
val = (p.val + carry) % 10
carry = 1 if val < p.val else 0
p.val = val
pre = p
p = p.next
if carry == 1:
pre.next = list_node(1)
return reverse(head) |
# demonstrate template string functions
def main():
# Usual string formatting with format()
str1 = "You're watching {0} by {1}".format("Advanced Python", "Joe Marini")
print(str1)
# TODO: create a template with placeholders
# TODO: use the substitute method with keyword arguments
# TODO: use the substitute method with a dictionary
if __name__ == "__main__":
main()
| def main():
str1 = "You're watching {0} by {1}".format('Advanced Python', 'Joe Marini')
print(str1)
if __name__ == '__main__':
main() |
def test_devices(spotify_user_auth):
assert spotify_user_auth.devices()
def test_recently_played_tracks(spotify_user_auth):
assert spotify_user_auth.recently_played_tracks()
def test_play_album(spotify_user_auth, reise_reise_album_id):
assert spotify_user_auth.play(album_id=reise_reise_album_id) is not None
def test_play_single_track(spotify_user_auth, them_bones_track_id):
assert spotify_user_auth.play(track_ids=them_bones_track_id) is not None
assert spotify_user_auth.pause() is not None
def test_play_multiple_tracks(
spotify_user_auth, them_bones_track_id, cover_me_track_id
):
assert (
spotify_user_auth.play(track_ids=[them_bones_track_id, cover_me_track_id])
is not None
)
assert spotify_user_auth.pause() is not None
def test_play_artist(spotify_user_auth, depeche_mode_artist_id):
assert spotify_user_auth.play(artist_id=depeche_mode_artist_id) is not None
assert spotify_user_auth.pause() is not None
def test_play_with_no_args(spotify_user_auth):
assert spotify_user_auth.play() is not None
def test_currently_playing(spotify_user_auth):
assert spotify_user_auth.currently_playing()
def test_currently_playing_info(spotify_user_auth):
assert spotify_user_auth.currently_playing_info()
def test_next(spotify_user_auth):
assert spotify_user_auth.next() is not None
def test_previous(spotify_user_auth):
assert spotify_user_auth.previous() is not None
def test_repeat(spotify_user_auth):
assert spotify_user_auth.repeat() is not None
def test_shuffle(spotify_user_auth):
assert spotify_user_auth.shuffle() is not None
def test_seek(spotify_user_auth):
assert spotify_user_auth.seek(10000) is not None # 10 seconds
def test_volume(spotify_user_auth):
assert spotify_user_auth.volume(72) is not None
assert spotify_user_auth.volume(32) is not None
def test_pause(spotify_user_auth):
assert spotify_user_auth.pause() is not None
def test_queue(spotify_user_auth, them_bones_track_id):
assert spotify_user_auth.queue(them_bones_track_id) is not None
| def test_devices(spotify_user_auth):
assert spotify_user_auth.devices()
def test_recently_played_tracks(spotify_user_auth):
assert spotify_user_auth.recently_played_tracks()
def test_play_album(spotify_user_auth, reise_reise_album_id):
assert spotify_user_auth.play(album_id=reise_reise_album_id) is not None
def test_play_single_track(spotify_user_auth, them_bones_track_id):
assert spotify_user_auth.play(track_ids=them_bones_track_id) is not None
assert spotify_user_auth.pause() is not None
def test_play_multiple_tracks(spotify_user_auth, them_bones_track_id, cover_me_track_id):
assert spotify_user_auth.play(track_ids=[them_bones_track_id, cover_me_track_id]) is not None
assert spotify_user_auth.pause() is not None
def test_play_artist(spotify_user_auth, depeche_mode_artist_id):
assert spotify_user_auth.play(artist_id=depeche_mode_artist_id) is not None
assert spotify_user_auth.pause() is not None
def test_play_with_no_args(spotify_user_auth):
assert spotify_user_auth.play() is not None
def test_currently_playing(spotify_user_auth):
assert spotify_user_auth.currently_playing()
def test_currently_playing_info(spotify_user_auth):
assert spotify_user_auth.currently_playing_info()
def test_next(spotify_user_auth):
assert spotify_user_auth.next() is not None
def test_previous(spotify_user_auth):
assert spotify_user_auth.previous() is not None
def test_repeat(spotify_user_auth):
assert spotify_user_auth.repeat() is not None
def test_shuffle(spotify_user_auth):
assert spotify_user_auth.shuffle() is not None
def test_seek(spotify_user_auth):
assert spotify_user_auth.seek(10000) is not None
def test_volume(spotify_user_auth):
assert spotify_user_auth.volume(72) is not None
assert spotify_user_auth.volume(32) is not None
def test_pause(spotify_user_auth):
assert spotify_user_auth.pause() is not None
def test_queue(spotify_user_auth, them_bones_track_id):
assert spotify_user_auth.queue(them_bones_track_id) is not None |
# O(log n)
def binary_search(items, item):
bottom = 0
top = len(items) - 1
while bottom <= top:
middle = int((bottom + top) / 2)
guess = items[middle]
if guess == item:
return middle
if guess > item:
top = middle - 1
else:
bottom = middle + 1
return None
items = [1,29,30,40,57,72,100]
print(binary_search(items, 30))
print(binary_search(items, 404))
| def binary_search(items, item):
bottom = 0
top = len(items) - 1
while bottom <= top:
middle = int((bottom + top) / 2)
guess = items[middle]
if guess == item:
return middle
if guess > item:
top = middle - 1
else:
bottom = middle + 1
return None
items = [1, 29, 30, 40, 57, 72, 100]
print(binary_search(items, 30))
print(binary_search(items, 404)) |
class Solution:
# One Liner (Accepted + Top Voted), O(n) time and space
def getConcatenation(self, nums: List[int]) -> List[int]:
return nums + nums
# Extend (Sample), O(n) time and space
def getConcatenation(self, nums: List[int]) -> List[int]:
ans = nums
ans.extend(nums)
return ans
| class Solution:
def get_concatenation(self, nums: List[int]) -> List[int]:
return nums + nums
def get_concatenation(self, nums: List[int]) -> List[int]:
ans = nums
ans.extend(nums)
return ans |
def challenge_to_string(scheme, params):
s = scheme
for name, value in params.items():
s += ' {}="{}"'.format(name, value.replace('\\', '\\\\').replace('"', '\\"'))
return s
class WWWAuthenticateMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
request.auth_challenges = []
response = self.get_response(request)
for i, challenge in enumerate(request.auth_challenges):
whatever = 'WWW-Authenticate' + str(i)
response._headers[whatever] = ('WWW-Authenticate', challenge_to_string(*challenge))
return response
| def challenge_to_string(scheme, params):
s = scheme
for (name, value) in params.items():
s += ' {}="{}"'.format(name, value.replace('\\', '\\\\').replace('"', '\\"'))
return s
class Wwwauthenticatemiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
request.auth_challenges = []
response = self.get_response(request)
for (i, challenge) in enumerate(request.auth_challenges):
whatever = 'WWW-Authenticate' + str(i)
response._headers[whatever] = ('WWW-Authenticate', challenge_to_string(*challenge))
return response |
URL_HOST_FILES = [
# "https://adaway.org/hosts.txt",
"http://winhelp2002.mvps.org/hosts.txt",
"http://hosts-file.net/ad_servers.txt",
"http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext",
"http://someonewhocares.org/hosts/hosts",
]
| url_host_files = ['http://winhelp2002.mvps.org/hosts.txt', 'http://hosts-file.net/ad_servers.txt', 'http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext', 'http://someonewhocares.org/hosts/hosts'] |
songs = ["Like a Rolling Stone", "Satisfaction", "Imagine", "What's Going On", "Respect", "Good Vibrations"]
playcounts = [78, 29, 44, 21, 89, 5]
plays = {key:value for key, value in zip(songs, playcounts)}
print(plays)
plays["Purple Haze"] = 1
plays["Respect"] = 94
library = {"The Best Songs": plays, "Sunday Feelings": {}}
print(library)
| songs = ['Like a Rolling Stone', 'Satisfaction', 'Imagine', "What's Going On", 'Respect', 'Good Vibrations']
playcounts = [78, 29, 44, 21, 89, 5]
plays = {key: value for (key, value) in zip(songs, playcounts)}
print(plays)
plays['Purple Haze'] = 1
plays['Respect'] = 94
library = {'The Best Songs': plays, 'Sunday Feelings': {}}
print(library) |
#count the no. of same string and print for ex wwwwrrrig will be w4r3ig
def countnsay(s):
n = len(s)
say = ""
cur = ""
count = 1
for i in range(n-1):
curr = s[i]
nxt = s[i+1]
if curr == nxt:
count +=1
elif(count>1):
cur+=curr
say+=(str(curr)+str(count))
count = 1
else:
cur+=curr
say+=str(curr)
cur += curr
say+=(str(s[n-1])+str(count))
print(cur)
print(say)
s = "wwwwaaadexxxxxx"
countnsay(s) | def countnsay(s):
n = len(s)
say = ''
cur = ''
count = 1
for i in range(n - 1):
curr = s[i]
nxt = s[i + 1]
if curr == nxt:
count += 1
elif count > 1:
cur += curr
say += str(curr) + str(count)
count = 1
else:
cur += curr
say += str(curr)
cur += curr
say += str(s[n - 1]) + str(count)
print(cur)
print(say)
s = 'wwwwaaadexxxxxx'
countnsay(s) |
# Index of practices
'''
Part I - List
1) Create a empty list
2) Append to list
2.1) One bye One
2.2) By '*'
2.3) By extend()
2.4) By for
3) Joint 2 lists
4) Lenth a list
5) Pick out from list
5.1) Pick 1 ( By [index] )
5.2) Pick by for
5.3) If exist ( By 'in')
6) Delete in list
6.1) Delete one
6.2) Empty a list ( By 'clear()')
Part II - Operaters of List
max()
min()
len()
------
list( seq )
---------
sort()
index()
copy()
Part III - Tuple
1) Create a tuple
2) Joint 2 tuples
3) Lenth a tuple
4) Pick out from tuple
5) Delete a tuple
Part IV - Operaters of List
max()
min()
len()
------
tuple(seq)
'''
| """
Part I - List
1) Create a empty list
2) Append to list
2.1) One bye One
2.2) By '*'
2.3) By extend()
2.4) By for
3) Joint 2 lists
4) Lenth a list
5) Pick out from list
5.1) Pick 1 ( By [index] )
5.2) Pick by for
5.3) If exist ( By 'in')
6) Delete in list
6.1) Delete one
6.2) Empty a list ( By 'clear()')
Part II - Operaters of List
max()
min()
len()
------
list( seq )
---------
sort()
index()
copy()
Part III - Tuple
1) Create a tuple
2) Joint 2 tuples
3) Lenth a tuple
4) Pick out from tuple
5) Delete a tuple
Part IV - Operaters of List
max()
min()
len()
------
tuple(seq)
""" |
N = int(input())
M = []
for i in range(N):
x, y = [int(x) for x in input().split()]
M.append([x, y])
areatotal = 0
for i in range(N):
if i != 0:
for j in range(i, -1, -1):
if M[i][0] > M[j][0]:
menorx = M[j][0]
if M[i][1] > M[j][1]:
menory = M[j][1]
for j in range(i, -1, -1):
try:
if menorx < M[j][0] < M[i][0]:
menorx = M[j][0]
except:
if menory < M[j][1] < M[i][1]:
menory = M[j][1]
try:
if menory < M[j][1] < M[i][1]:
menory = M[j][1]
except:
if menorx < M[j][0] < M[i][0]:
menorx = M[j][0]
areamenor = 0
try:
areamenor += menorx * M[i][1]
except:
sla = 0
try:
areamenor += menory * M[i][0]
except:
sla = 0
areaquad = M[i][0] * M[i][1] - areamenor
else:
areaquad = M[i][0] * M[i][1]
areatotal += areaquad
print(areatotal) | n = int(input())
m = []
for i in range(N):
(x, y) = [int(x) for x in input().split()]
M.append([x, y])
areatotal = 0
for i in range(N):
if i != 0:
for j in range(i, -1, -1):
if M[i][0] > M[j][0]:
menorx = M[j][0]
if M[i][1] > M[j][1]:
menory = M[j][1]
for j in range(i, -1, -1):
try:
if menorx < M[j][0] < M[i][0]:
menorx = M[j][0]
except:
if menory < M[j][1] < M[i][1]:
menory = M[j][1]
try:
if menory < M[j][1] < M[i][1]:
menory = M[j][1]
except:
if menorx < M[j][0] < M[i][0]:
menorx = M[j][0]
areamenor = 0
try:
areamenor += menorx * M[i][1]
except:
sla = 0
try:
areamenor += menory * M[i][0]
except:
sla = 0
areaquad = M[i][0] * M[i][1] - areamenor
else:
areaquad = M[i][0] * M[i][1]
areatotal += areaquad
print(areatotal) |
"""Variables globales de la clase PyTikZ"""
def init():
global ruta_raiz
global ruta_imagen
global carpetas_necesarias
ruta_raiz = ""
ruta_imagen = ""
#"imagen" -> Todas las carpetas en "imagen", son las que se encuentra en "C:\Users\juanf\Pictures" (Window) o "sdcard/dcim" (Android).
carpetas_necesarias = {
"imagen":["Pytikz"]
} | """Variables globales de la clase PyTikZ"""
def init():
global ruta_raiz
global ruta_imagen
global carpetas_necesarias
ruta_raiz = ''
ruta_imagen = ''
carpetas_necesarias = {'imagen': ['Pytikz']} |
def distance(s1, s2):
d = 0
l1 = list(s1)
l2 = list(s2)
for i in range(len(l1)):
if l2.count(l1[i]) == 0:
d += 1
continue
l2_index = l2.index(l1[i], i)
l2_distance = l2_index - i
if l2_distance > 0:
l2.pop(l2_distance)
d += l2_distance
return d
if __name__ == '__main__':
print(distance('biting', 'sitting'))
# 2
| def distance(s1, s2):
d = 0
l1 = list(s1)
l2 = list(s2)
for i in range(len(l1)):
if l2.count(l1[i]) == 0:
d += 1
continue
l2_index = l2.index(l1[i], i)
l2_distance = l2_index - i
if l2_distance > 0:
l2.pop(l2_distance)
d += l2_distance
return d
if __name__ == '__main__':
print(distance('biting', 'sitting')) |
"""
"""
class MyIterator:
def __init__(self, c):
self.c = c
self.i = 0
def __next__(self):
if self.i < len(self.c.mylist):
self.i += 1
return self.c.mylist[self.i - 1]
else:
raise StopIteration
def __hasNext__(self):
return self.i<len(self.c.mylist)
class MyCollection:
def __init__(self, n):
self.mylist = list(range(n))
def __iter__(self):
return MyIterator(self)
c1 = MyCollection(20)
"""
for e in c1:
print(e)
"""
it1 = iter(c1)
it2 = iter(c1)
print(next(it1)) # it1.__next__() # 0
print(next(it2)) # it1.__next__() # 0 # we expect 0; we get it!
print(it2.__hasNext__())
print(hasNext(it1))
| """
"""
class Myiterator:
def __init__(self, c):
self.c = c
self.i = 0
def __next__(self):
if self.i < len(self.c.mylist):
self.i += 1
return self.c.mylist[self.i - 1]
else:
raise StopIteration
def __has_next__(self):
return self.i < len(self.c.mylist)
class Mycollection:
def __init__(self, n):
self.mylist = list(range(n))
def __iter__(self):
return my_iterator(self)
c1 = my_collection(20)
'\nfor e in c1:\n print(e)\n'
it1 = iter(c1)
it2 = iter(c1)
print(next(it1))
print(next(it2))
print(it2.__hasNext__())
print(has_next(it1)) |
def main():
a = [1, 2, 3]
print(a[0])
print(a[1])
print(a[2])
a.append(4)
print(a[3])
a += [5, 6, 7]
a = a + [8, 9, 10]
print(a[4])
print(a[-1])
if __name__ == '__main__':
main()
| def main():
a = [1, 2, 3]
print(a[0])
print(a[1])
print(a[2])
a.append(4)
print(a[3])
a += [5, 6, 7]
a = a + [8, 9, 10]
print(a[4])
print(a[-1])
if __name__ == '__main__':
main() |
# set comprehension
odd_number_set = { x for x in range(10) if x % 2 == 1 }
# expected output:
'''
{1, 3, 5, 7, 9}
'''
print( odd_number_set ) | odd_number_set = {x for x in range(10) if x % 2 == 1}
'\n{1, 3, 5, 7, 9}\n'
print(odd_number_set) |
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
longest = 0
longestSub = ""
for char in s:
if char not in longestSub:
longestSub += char
else:
while char in longestSub:
longestSub = longestSub[1:]
longestSub += char
if len(longestSub) > longest:
longest = len(longestSub)
return longest
| class Solution:
def length_of_longest_substring(self, s: str) -> int:
longest = 0
longest_sub = ''
for char in s:
if char not in longestSub:
longest_sub += char
else:
while char in longestSub:
longest_sub = longestSub[1:]
longest_sub += char
if len(longestSub) > longest:
longest = len(longestSub)
return longest |
n = int(input())
k_lst = [int(input()) for _ in range(n)]
k_lst.sort(reverse=True)
cnt = 1
for i in range(n-1):
if k_lst[i] == k_lst[i+1]:
continue
if k_lst[i] > k_lst[i+1]:
cnt += 1
print(cnt)
| n = int(input())
k_lst = [int(input()) for _ in range(n)]
k_lst.sort(reverse=True)
cnt = 1
for i in range(n - 1):
if k_lst[i] == k_lst[i + 1]:
continue
if k_lst[i] > k_lst[i + 1]:
cnt += 1
print(cnt) |
N = int(input())
A = {}
for i in range(N):
A[i] = []
for j in range(int(input())):
A[i].append([int(n) for n in input().split()])
| n = int(input())
a = {}
for i in range(N):
A[i] = []
for j in range(int(input())):
A[i].append([int(n) for n in input().split()]) |
# -*- coding: utf-8 -*-
# Digital Ocean api urls
ACCOUNT_INFO = 'account/'
ACTION_LIST = 'actions/'
DOMAIN_LIST = 'domains/'
DROPLETS = 'droplets/'
IMAGES = 'images/'
KEYS = 'account/keys/'
REGIONS = 'regions/'
SIZES = 'sizes/' | account_info = 'account/'
action_list = 'actions/'
domain_list = 'domains/'
droplets = 'droplets/'
images = 'images/'
keys = 'account/keys/'
regions = 'regions/'
sizes = 'sizes/' |
class MissingUserDatabaseURLError(Exception):
def __init__(self):
self.message = 'Users database URL is not provided'
super().__init__(self.message)
| class Missinguserdatabaseurlerror(Exception):
def __init__(self):
self.message = 'Users database URL is not provided'
super().__init__(self.message) |
# -*- coding: utf-8 -*-
__author__ = 'Aaron Bassett'
__email__ = 'engineering@getadministrate.com'
__version__ = '0.14.0'
| __author__ = 'Aaron Bassett'
__email__ = 'engineering@getadministrate.com'
__version__ = '0.14.0' |
# Copyright 2016 Srinivas Venkattaramanujam (author: Srinivas Venkattaramanujam)
# Licensed under the Apache License, Version 2.0 (the "License")
# Until we have a config file
class Config:
TRAIN_FEATS = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/train_90/feats.scp'
TRAIN_ALIGNMENTS = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/labels/train/ali_tr.scp'
CV_FEATS = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/cv_10/feats.scp'
CV_ALIGNMENTS = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/labels/train/ali_cv.scp'
TEST_FEATS = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/test/feats.scp'
| class Config:
train_feats = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/train_90/feats.scp'
train_alignments = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/labels/train/ali_tr.scp'
cv_feats = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/cv_10/feats.scp'
cv_alignments = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/labels/train/ali_cv.scp'
test_feats = '/speech1/DIT_PROJ/srini/TIMIT/s5/working_dir/test/feats.scp' |
#! /root/anaconda3/bin/python
t = (1, 2, 3, 4, 5)
del t
try:
print(t)
except NameError:
print(NameError)
| t = (1, 2, 3, 4, 5)
del t
try:
print(t)
except NameError:
print(NameError) |
"""
Author: Ben Carlson
Project: 100DaysPython
File: module1_day01_installing.py
Creation Date: 2019-06-03
Description: Use this script to confirm successful installation of the PyCharm IDE
"""
print("Hello World!")
| """
Author: Ben Carlson
Project: 100DaysPython
File: module1_day01_installing.py
Creation Date: 2019-06-03
Description: Use this script to confirm successful installation of the PyCharm IDE
"""
print('Hello World!') |
# -*- coding:utf-8 -*-
'''
@Author: yanwii
@Date: 2018-08-16 15:18:52
'''
class BatchManager(object):
def __init__(self, batch_size=1):
self.batch_size = batch_size
self.data = []
self.batch_data = []
self.head_vocab = {"unk":0}
self.tail_vocab = {"unk":0}
self.relation_vocab = {"unk":0}
self.load_data()
self.prepare_batch()
def add_vocab(self, word, vocab={}):
if word not in vocab:
vocab[word] = len(vocab.keys())
return vocab[word]
def load_data(self):
with open("data/train") as fopen:
lines = fopen.readlines()
for line in lines:
head, tail, relation = line.strip().split(",")
h_v = self.add_vocab(head, self.head_vocab)
t_v = self.add_vocab(tail, self.tail_vocab)
r_v = self.add_vocab(relation, self.relation_vocab)
self.data.append([[h_v], [t_v], [r_v]])
self.head_vocab_size = len(self.head_vocab) + 1
self.tail_vocab_size = len(self.tail_vocab) + 1
self.relation_vocab_size = len(self.relation_vocab) + 1
def prepare_batch(self):
index = 0
while True:
if index + self.batch_size >= len(self.data):
data = self.data[-self.batch_size:]
self.batch_data.append(data)
break
else:
data = self.data[index:index+self.batch_size]
index += self.batch_size
self.batch_data.append(data)
def iteration(self):
idx = 0
while True:
yield self.batch_data[idx]
idx += 1
if idx > len(self.batch_data)-1:
idx = 0
def get_batch(self):
for data in self.batch_data:
yield data | """
@Author: yanwii
@Date: 2018-08-16 15:18:52
"""
class Batchmanager(object):
def __init__(self, batch_size=1):
self.batch_size = batch_size
self.data = []
self.batch_data = []
self.head_vocab = {'unk': 0}
self.tail_vocab = {'unk': 0}
self.relation_vocab = {'unk': 0}
self.load_data()
self.prepare_batch()
def add_vocab(self, word, vocab={}):
if word not in vocab:
vocab[word] = len(vocab.keys())
return vocab[word]
def load_data(self):
with open('data/train') as fopen:
lines = fopen.readlines()
for line in lines:
(head, tail, relation) = line.strip().split(',')
h_v = self.add_vocab(head, self.head_vocab)
t_v = self.add_vocab(tail, self.tail_vocab)
r_v = self.add_vocab(relation, self.relation_vocab)
self.data.append([[h_v], [t_v], [r_v]])
self.head_vocab_size = len(self.head_vocab) + 1
self.tail_vocab_size = len(self.tail_vocab) + 1
self.relation_vocab_size = len(self.relation_vocab) + 1
def prepare_batch(self):
index = 0
while True:
if index + self.batch_size >= len(self.data):
data = self.data[-self.batch_size:]
self.batch_data.append(data)
break
else:
data = self.data[index:index + self.batch_size]
index += self.batch_size
self.batch_data.append(data)
def iteration(self):
idx = 0
while True:
yield self.batch_data[idx]
idx += 1
if idx > len(self.batch_data) - 1:
idx = 0
def get_batch(self):
for data in self.batch_data:
yield data |
class IncompleteStructureError(Exception):
"""An exception to raise when a structure is incomplete."""
def __init__(self, message):
self.message = message
class NonStandardAminoAcidError(Exception):
"""An exception to raise when a structure contains a Non-standard amino acid."""
def __init__(self, *args):
super().__init__(*args)
#TODO The one instance where this was called in stucture_utils.py was commented out. May not be needed.
class MissingBackboneAtomsError(Exception):
"""An exception to raise when a protein backbone is incomplete."""
def __init__(self, message):
self.message = message
class SequenceError(Exception):
"""An exception to raise when a sequence is not as expected."""
def __init__(self, *args):
super().__init__(*args)
class ContigMultipleMatchingError(Exception):
"""An exception to raise when a sequence is ambiguous due to multiple matching contig locations."""
def __init__(self, *args):
super().__init__(*args)
class ShortStructureError(Exception):
"""An exception to raise when a sequence too short to be meaningful."""
def __init__(self, *args):
super().__init__(*args)
class MissingAtomsError(Exception):
"""An exception to raise when a residue is missing atoms and bond angles can't be calculated."""
def __init__(self, *args):
super().__init__(*args)
class NoneStructureError(Exception):
"""An exception to raise when a parsed structure becomes None."""
def __init__(self, *args):
super().__init__(*args) | class Incompletestructureerror(Exception):
"""An exception to raise when a structure is incomplete."""
def __init__(self, message):
self.message = message
class Nonstandardaminoaciderror(Exception):
"""An exception to raise when a structure contains a Non-standard amino acid."""
def __init__(self, *args):
super().__init__(*args)
class Missingbackboneatomserror(Exception):
"""An exception to raise when a protein backbone is incomplete."""
def __init__(self, message):
self.message = message
class Sequenceerror(Exception):
"""An exception to raise when a sequence is not as expected."""
def __init__(self, *args):
super().__init__(*args)
class Contigmultiplematchingerror(Exception):
"""An exception to raise when a sequence is ambiguous due to multiple matching contig locations."""
def __init__(self, *args):
super().__init__(*args)
class Shortstructureerror(Exception):
"""An exception to raise when a sequence too short to be meaningful."""
def __init__(self, *args):
super().__init__(*args)
class Missingatomserror(Exception):
"""An exception to raise when a residue is missing atoms and bond angles can't be calculated."""
def __init__(self, *args):
super().__init__(*args)
class Nonestructureerror(Exception):
"""An exception to raise when a parsed structure becomes None."""
def __init__(self, *args):
super().__init__(*args) |
def parse(d):
return (
([frozenset(c) for c in g.split()] for g in l.split("|")) for l in d.split("\n")
)
def aoc(data):
return sum(len(d) in (2, 3, 4, 7) for _, b in parse(data) for d in b)
| def parse(d):
return (([frozenset(c) for c in g.split()] for g in l.split('|')) for l in d.split('\n'))
def aoc(data):
return sum((len(d) in (2, 3, 4, 7) for (_, b) in parse(data) for d in b)) |
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Kotlin Toolchains
This file contains macros for defining and registering specific toolchains.
### Examples
To override a tool chain use the appropriate macro in a `BUILD` file to declare the toolchain:
```bzl
load("@io_bazel_rules_kotlin//kotlin:toolchains.bzl", "define_kt_jvm_toolchain")
define_kt_jvm_toolchain(
name= "custom_toolchain",
api_version = "1.1",
language_version = "1.1",
)
```
and then register it in the `WORKSPACE`:
```bzl
register_toolchains("//:custom_toolchain")
```
"""
# The toolchain rules are not made private, at least the jvm ones so that they may be introspected in Intelij.
_common_attrs = {
'language_version': attr.string(default="1.2", values=["1.1", "1.2"]),
'api_version': attr.string(default="1.2", values=["1.1", "1.2"]),
"coroutines": attr.string(default="enable", values=["enable", "warn", "error"]),
}
_kt_jvm_attrs = dict(_common_attrs.items() + {
'jvm_target': attr.string(default="1.8", values=["1.6", "1.8"]),
}.items())
def _kotlin_jvm_toolchain_impl(ctx):
toolchain = platform_common.ToolchainInfo(
language_version = ctx.attr.language_version,
api_version = ctx.attr.api_version,
jvm_target = ctx.attr.jvm_target,
coroutines = ctx.attr.coroutines
)
return [toolchain]
kt_jvm_toolchain = rule(
implementation = _kotlin_jvm_toolchain_impl,
attrs = _kt_jvm_attrs
)
"""The kotlin jvm toolchain
Args:
language_version: the -languag_version flag [see](https://kotlinlang.org/docs/reference/compatibility.html).
api_version: the -api_version flag [see](https://kotlinlang.org/docs/reference/compatibility.html).
jvm_target: the -jvm_target flag.
coroutines: the -Xcoroutines flag, enabled by default as it's considered production ready 1.2.0 onward.
"""
def define_kt_jvm_toolchain(name, language_version=None, api_version=None, jvm_target=None, coroutines=None):
"""Define a Kotlin JVM Toolchain, the name is used in the `toolchain` rule so can be used to register the toolchain in the WORKSPACE file."""
impl_name = name + "_impl"
kt_jvm_toolchain(
name = impl_name,
language_version = language_version,
api_version = api_version,
jvm_target = jvm_target,
coroutines = coroutines,
visibility = ["//visibility:public"]
)
native.toolchain(
name = name,
toolchain_type = "@io_bazel_rules_kotlin//kotlin:kt_jvm_toolchain_type",
toolchain = impl_name,
visibility = ["//visibility:public"]
)
def kt_register_jvm_toolchain():
"""Register the default JVM toolchain."""
native.register_toolchains("@io_bazel_rules_kotlin//kotlin:default_jvm_toolchain")
| """Kotlin Toolchains
This file contains macros for defining and registering specific toolchains.
### Examples
To override a tool chain use the appropriate macro in a `BUILD` file to declare the toolchain:
```bzl
load("@io_bazel_rules_kotlin//kotlin:toolchains.bzl", "define_kt_jvm_toolchain")
define_kt_jvm_toolchain(
name= "custom_toolchain",
api_version = "1.1",
language_version = "1.1",
)
```
and then register it in the `WORKSPACE`:
```bzl
register_toolchains("//:custom_toolchain")
```
"""
_common_attrs = {'language_version': attr.string(default='1.2', values=['1.1', '1.2']), 'api_version': attr.string(default='1.2', values=['1.1', '1.2']), 'coroutines': attr.string(default='enable', values=['enable', 'warn', 'error'])}
_kt_jvm_attrs = dict(_common_attrs.items() + {'jvm_target': attr.string(default='1.8', values=['1.6', '1.8'])}.items())
def _kotlin_jvm_toolchain_impl(ctx):
toolchain = platform_common.ToolchainInfo(language_version=ctx.attr.language_version, api_version=ctx.attr.api_version, jvm_target=ctx.attr.jvm_target, coroutines=ctx.attr.coroutines)
return [toolchain]
kt_jvm_toolchain = rule(implementation=_kotlin_jvm_toolchain_impl, attrs=_kt_jvm_attrs)
"The kotlin jvm toolchain\nArgs:\n language_version: the -languag_version flag [see](https://kotlinlang.org/docs/reference/compatibility.html).\n api_version: the -api_version flag [see](https://kotlinlang.org/docs/reference/compatibility.html).\n jvm_target: the -jvm_target flag.\n coroutines: the -Xcoroutines flag, enabled by default as it's considered production ready 1.2.0 onward.\n"
def define_kt_jvm_toolchain(name, language_version=None, api_version=None, jvm_target=None, coroutines=None):
"""Define a Kotlin JVM Toolchain, the name is used in the `toolchain` rule so can be used to register the toolchain in the WORKSPACE file."""
impl_name = name + '_impl'
kt_jvm_toolchain(name=impl_name, language_version=language_version, api_version=api_version, jvm_target=jvm_target, coroutines=coroutines, visibility=['//visibility:public'])
native.toolchain(name=name, toolchain_type='@io_bazel_rules_kotlin//kotlin:kt_jvm_toolchain_type', toolchain=impl_name, visibility=['//visibility:public'])
def kt_register_jvm_toolchain():
"""Register the default JVM toolchain."""
native.register_toolchains('@io_bazel_rules_kotlin//kotlin:default_jvm_toolchain') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.