content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# Notices we don't need to worry about
ignore_notices = [
"already_banned",
"already_emote_only_off",
"already_emote_only_on",
"already_r9k_off",
"already_r9k_on",
"already_subs_off",
"already_subs_on",
"bad_ban_admin",
"bad_ban_anon",
"bad_ban_broadcaster",
"bad_ban_global_mod",
"bad_ban_mod",
"bad_ban_self",
"bad_ban_staff",
"bad_commercial_error",
"bad_delete_message_broadcaster",
"bad_delete_message_mod",
"bad_host_error",
"bad_host_hosting",
"bad_host_rate_exceeded",
"bad_host_rejected",
"bad_host_self",
"bad_marker_client",
"bad_mod_banned",
"bad_mod_mod",
"bad_slow_duration",
"bad_timeout_admin",
"bad_timeout_anon",
"bad_timeout_broadcaster",
"bad_timeout_duration",
"bad_timeout_global_mod",
"bad_timeout_mod",
"bad_timeout_self",
"bad_timeout_staff",
"bad_unban_no_ban",
"bad_unhost_error",
"bad_unmod_mod",
"ban_success",
"cmds_available",
"color_changed",
"commercial_success",
"delete_message_success",
"emote_only_off",
"emote_only_on",
"followers_off",
"followers_on",
"followers_onzero",
"host_off",
"host_on",
"host_success",
"host_success_viewers",
"host_target_went_offline",
"hosts_remaining",
"invalid_user",
"mod_success",
"no_help",
"no_mods",
"not_hosting",
"r9k_off",
"r9k_on",
"raid_error_already_raiding",
"raid_error_forbidden",
"raid_error_self",
"raid_error_too_many_viewers",
"raid_error_unexpected",
"raid_notice_mature",
"raid_notice_restricted_chat",
"room_mods",
"slow_off",
"slow_on",
"subs_off",
"subs_on",
"timeout_no_timeout",
"timeout_success",
"turbo_only_color",
"unban_success",
"unmod_success",
"unraid_error_no_active_raid",
"unraid_error_unexpected",
"unraid_success",
"untimeout_banned",
"untimeout_success",
"usage_ban",
"usage_clear",
"usage_color",
"usage_commercial",
"usage_disconnect",
"usage_emote_only_off",
"usage_emote_only_on",
"usage_followers_off",
"usage_followers_on",
"usage_help",
"usage_host",
"usage_marker",
"usage_me",
"usage_mod",
"usage_mods",
"usage_r9k_off",
"usage_r9k_on",
"usage_raid",
"usage_slow_off",
"usage_slow_on",
"usage_subs_off",
"usage_subs_on",
"usage_timeout",
"usage_unban",
"usage_unhost",
"usage_unmod",
"usage_unraid",
"usage_untimeout",
]
# Notices that indicate we're not a mod
cooldown_notices = [
"msg_duplicate",
"msg_emoteonly",
"msg_facebook",
"msg_followersonly",
"msg_followersonly_followed",
"msg_followersonly_zero",
"msg_r9k",
"msg_ratelimit",
"msg_rejected",
"msg_rejected_mandatory",
"msg_slowmode",
"msg_subsonly",
"no_permission",
]
# Notices that indicate we should probably go
leave_notices = [
"msg_banned",
"msg_channel_blocked",
"msg_room_not_found",
"msg_timedout",
"msg_verified_email",
"tos_ban",
]
| ignore_notices = ['already_banned', 'already_emote_only_off', 'already_emote_only_on', 'already_r9k_off', 'already_r9k_on', 'already_subs_off', 'already_subs_on', 'bad_ban_admin', 'bad_ban_anon', 'bad_ban_broadcaster', 'bad_ban_global_mod', 'bad_ban_mod', 'bad_ban_self', 'bad_ban_staff', 'bad_commercial_error', 'bad_delete_message_broadcaster', 'bad_delete_message_mod', 'bad_host_error', 'bad_host_hosting', 'bad_host_rate_exceeded', 'bad_host_rejected', 'bad_host_self', 'bad_marker_client', 'bad_mod_banned', 'bad_mod_mod', 'bad_slow_duration', 'bad_timeout_admin', 'bad_timeout_anon', 'bad_timeout_broadcaster', 'bad_timeout_duration', 'bad_timeout_global_mod', 'bad_timeout_mod', 'bad_timeout_self', 'bad_timeout_staff', 'bad_unban_no_ban', 'bad_unhost_error', 'bad_unmod_mod', 'ban_success', 'cmds_available', 'color_changed', 'commercial_success', 'delete_message_success', 'emote_only_off', 'emote_only_on', 'followers_off', 'followers_on', 'followers_onzero', 'host_off', 'host_on', 'host_success', 'host_success_viewers', 'host_target_went_offline', 'hosts_remaining', 'invalid_user', 'mod_success', 'no_help', 'no_mods', 'not_hosting', 'r9k_off', 'r9k_on', 'raid_error_already_raiding', 'raid_error_forbidden', 'raid_error_self', 'raid_error_too_many_viewers', 'raid_error_unexpected', 'raid_notice_mature', 'raid_notice_restricted_chat', 'room_mods', 'slow_off', 'slow_on', 'subs_off', 'subs_on', 'timeout_no_timeout', 'timeout_success', 'turbo_only_color', 'unban_success', 'unmod_success', 'unraid_error_no_active_raid', 'unraid_error_unexpected', 'unraid_success', 'untimeout_banned', 'untimeout_success', 'usage_ban', 'usage_clear', 'usage_color', 'usage_commercial', 'usage_disconnect', 'usage_emote_only_off', 'usage_emote_only_on', 'usage_followers_off', 'usage_followers_on', 'usage_help', 'usage_host', 'usage_marker', 'usage_me', 'usage_mod', 'usage_mods', 'usage_r9k_off', 'usage_r9k_on', 'usage_raid', 'usage_slow_off', 'usage_slow_on', 'usage_subs_off', 'usage_subs_on', 'usage_timeout', 'usage_unban', 'usage_unhost', 'usage_unmod', 'usage_unraid', 'usage_untimeout']
cooldown_notices = ['msg_duplicate', 'msg_emoteonly', 'msg_facebook', 'msg_followersonly', 'msg_followersonly_followed', 'msg_followersonly_zero', 'msg_r9k', 'msg_ratelimit', 'msg_rejected', 'msg_rejected_mandatory', 'msg_slowmode', 'msg_subsonly', 'no_permission']
leave_notices = ['msg_banned', 'msg_channel_blocked', 'msg_room_not_found', 'msg_timedout', 'msg_verified_email', 'tos_ban'] |
class InvalidUsage(Exception):
status_code = 404
message = 'Instance Not Found!'
def __init__(self, message=None, status_code=None):
Exception.__init__(self)
if message is not None:
self.message = message
if status_code is not None:
self.status_code = status_code
def to_dict(self):
rv = dict(self.payload or ())
rv['message'] = self.message
return rv
NotCorrectDirection = InvalidUsage("Direction is not correct!", 418)
IdNotFound = InvalidUsage("Id not found!", 404)
CoordinatesNotEmpty = InvalidUsage("Coordinates is not empty.", 421)
CoordinatesNotValid = InvalidUsage("Coordinates not valid.", 422)
ErrorOnBoardCoding = InvalidUsage("Not matching with robot values.", 423)
ErrorBoardCreation = InvalidUsage("String size is not matching with board size", 424)
BoardIsFull = InvalidUsage("Board is full, no emtpy spot! Attack!", 425)
RobotNotFound = InvalidUsage("Robot not found on given coordinates.", 426)
SizeIsNotValid = InvalidUsage("Size should be larger than 1!", 427)
ServerError = InvalidUsage("Server Error!", 500)
ExceptionResponses = {
NotCorrectDirection.status_code: NotCorrectDirection.message,
IdNotFound.status_code: IdNotFound.message,
CoordinatesNotEmpty.status_code: CoordinatesNotEmpty.message,
CoordinatesNotValid.status_code: CoordinatesNotValid.message,
ErrorOnBoardCoding.status_code: ErrorOnBoardCoding.message,
ErrorBoardCreation.status_code: ErrorBoardCreation.message,
BoardIsFull.status_code: BoardIsFull.message,
RobotNotFound.status_code: RobotNotFound.message,
ServerError.status_code: ServerError.message
}
| class Invalidusage(Exception):
status_code = 404
message = 'Instance Not Found!'
def __init__(self, message=None, status_code=None):
Exception.__init__(self)
if message is not None:
self.message = message
if status_code is not None:
self.status_code = status_code
def to_dict(self):
rv = dict(self.payload or ())
rv['message'] = self.message
return rv
not_correct_direction = invalid_usage('Direction is not correct!', 418)
id_not_found = invalid_usage('Id not found!', 404)
coordinates_not_empty = invalid_usage('Coordinates is not empty.', 421)
coordinates_not_valid = invalid_usage('Coordinates not valid.', 422)
error_on_board_coding = invalid_usage('Not matching with robot values.', 423)
error_board_creation = invalid_usage('String size is not matching with board size', 424)
board_is_full = invalid_usage('Board is full, no emtpy spot! Attack!', 425)
robot_not_found = invalid_usage('Robot not found on given coordinates.', 426)
size_is_not_valid = invalid_usage('Size should be larger than 1!', 427)
server_error = invalid_usage('Server Error!', 500)
exception_responses = {NotCorrectDirection.status_code: NotCorrectDirection.message, IdNotFound.status_code: IdNotFound.message, CoordinatesNotEmpty.status_code: CoordinatesNotEmpty.message, CoordinatesNotValid.status_code: CoordinatesNotValid.message, ErrorOnBoardCoding.status_code: ErrorOnBoardCoding.message, ErrorBoardCreation.status_code: ErrorBoardCreation.message, BoardIsFull.status_code: BoardIsFull.message, RobotNotFound.status_code: RobotNotFound.message, ServerError.status_code: ServerError.message} |
"""
Here we create template function
"""
def function_file2(value=1):
print(f"you have called function from file 2 level 1")
return value + 1
| """
Here we create template function
"""
def function_file2(value=1):
print(f'you have called function from file 2 level 1')
return value + 1 |
def build_response(parameters):
response = {}
if("success" in parameters and parameters["success"] == True):
response['success'] = True
else:
response['success'] = False
if("response" in parameters):
response["response"] = parameters["response"]
if("error" in parameters):
response['error'] = parameters["error"]
if("context" in parameters):
response['@context'] = parameters["context"]
return response
| def build_response(parameters):
response = {}
if 'success' in parameters and parameters['success'] == True:
response['success'] = True
else:
response['success'] = False
if 'response' in parameters:
response['response'] = parameters['response']
if 'error' in parameters:
response['error'] = parameters['error']
if 'context' in parameters:
response['@context'] = parameters['context']
return response |
f = open("Q20/testinputs.txt","r")
#ques_input = [i.strip("\n") for i in f.readlines()]
a,b = f.read().split("\n\n")
b = "".join(b).split("\n")
trans = []
for i in range(-1,2,1):
for j in range(-1,2,1):
trans += [(i,j)]
# rowlength = len(b[0])
# top_row = [inf_symbol] * (rowlength+4)
inf_symbol = "."
flip_switch = True
for _ in range(50):
rowlength = len(b[0])
top_row = [inf_symbol] * (rowlength+4)
new_matrix = []
next_iter = []
for _ in range(2):
new_matrix += [top_row[:]]
next_iter += [top_row[:]]
for c in b:
new_matrix += [[inf_symbol]*2 + list(c) + [inf_symbol]*2]
next_iter += [top_row[:]]
for _ in range(2):
new_matrix += [top_row[:]]
next_iter += [top_row[:]]
b = new_matrix
k = 0
for i in range(1,len(new_matrix)-1):
for j in range(1,len(new_matrix[i])-1):
u = ""
for x,y in [(-1,-1),(-1,0),(-1,1),(0,-1),(0,0),(0,1),(1,-1),(1,0),(1,1)]:
u += b[i+x][j+y]
binnum = int(u.replace(".","0").replace("#","1"),2)
next_iter[i][j] = a[binnum]
# if j == 0:
# #print(i,j)
b = [row[1:-1] for row in next_iter[1:-1]]
if flip_switch:
if inf_symbol == "#":
inf_symbol = "."
else:
inf_symbol = "#"
# for i in b:
# print("".join(i))
# 1/0
fstr = ""
for i in b:
fstr += "".join(i)
print(fstr.count("#")) | f = open('Q20/testinputs.txt', 'r')
(a, b) = f.read().split('\n\n')
b = ''.join(b).split('\n')
trans = []
for i in range(-1, 2, 1):
for j in range(-1, 2, 1):
trans += [(i, j)]
inf_symbol = '.'
flip_switch = True
for _ in range(50):
rowlength = len(b[0])
top_row = [inf_symbol] * (rowlength + 4)
new_matrix = []
next_iter = []
for _ in range(2):
new_matrix += [top_row[:]]
next_iter += [top_row[:]]
for c in b:
new_matrix += [[inf_symbol] * 2 + list(c) + [inf_symbol] * 2]
next_iter += [top_row[:]]
for _ in range(2):
new_matrix += [top_row[:]]
next_iter += [top_row[:]]
b = new_matrix
k = 0
for i in range(1, len(new_matrix) - 1):
for j in range(1, len(new_matrix[i]) - 1):
u = ''
for (x, y) in [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 0), (0, 1), (1, -1), (1, 0), (1, 1)]:
u += b[i + x][j + y]
binnum = int(u.replace('.', '0').replace('#', '1'), 2)
next_iter[i][j] = a[binnum]
b = [row[1:-1] for row in next_iter[1:-1]]
if flip_switch:
if inf_symbol == '#':
inf_symbol = '.'
else:
inf_symbol = '#'
fstr = ''
for i in b:
fstr += ''.join(i)
print(fstr.count('#')) |
goal = int(input('Write a number: '))
epsilon = 0.01
low = 0.0
high = max(1.0, goal)
answer = (high + low) / 2
while abs(answer**2 - goal) >= epsilon:
if answer**2 < goal:
low = answer
else:
high = answer
answer = (high + low) / 2
print(f'The square root of {goal} is {answer}') | goal = int(input('Write a number: '))
epsilon = 0.01
low = 0.0
high = max(1.0, goal)
answer = (high + low) / 2
while abs(answer ** 2 - goal) >= epsilon:
if answer ** 2 < goal:
low = answer
else:
high = answer
answer = (high + low) / 2
print(f'The square root of {goal} is {answer}') |
class CustomListIndexException(Exception):
pass
class CustomListTypeException(Exception):
pass
class CustomListSumException(Exception):
pass
| class Customlistindexexception(Exception):
pass
class Customlisttypeexception(Exception):
pass
class Customlistsumexception(Exception):
pass |
# len = 1001
tp_qtys = (
(0.0, 0.0, 0.0, 0.0, 1.0),
(0.0, 0.0, 0.0, 0.1, 0.9),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 0.1, 0.2), (0.7, 0.0, 0.0, 0.2, 0.1), (0.7, 0.0, 0.0, 0.3, 0.0), (0.7, 0.0, 0.1, 0.0, 0.2), (0.7, 0.0, 0.1, 0.1, 0.1), (0.7, 0.0, 0.1, 0.2, 0.0), (0.7, 0.0, 0.2, 0.0, 0.1), (0.7, 0.0, 0.2, 0.1, 0.0), (0.7, 0.0, 0.3, 0.0, 0.0), (0.7, 0.1, 0.0, 0.0, 0.2), (0.7, 0.1, 0.0, 0.1, 0.1), (0.7, 0.1, 0.0, 0.2, 0.0), (0.7, 0.1, 0.1, 0.0, 0.1), (0.7, 0.1, 0.1, 0.1, 0.0), (0.7, 0.1, 0.2, 0.0, 0.0), (0.7, 0.2, 0.0, 0.0, 0.1), (0.7, 0.2, 0.0, 0.1, 0.0), (0.7, 0.2, 0.1, 0.0, 0.0), (0.7, 0.3, 0.0, 0.0, 0.0), (0.8, 0.0, 0.0, 0.0, 0.2), (0.8, 0.0, 0.0, 0.1, 0.1), (0.8, 0.0, 0.0, 0.2, 0.0), (0.8, 0.0, 0.1, 0.0, 0.1), (0.8, 0.0, 0.1, 0.1, 0.0), (0.8, 0.0, 0.2, 0.0, 0.0), (0.8, 0.1, 0.0, 0.0, 0.1), (0.8, 0.1, 0.0, 0.1, 0.0), (0.8, 0.1, 0.1, 0.0, 0.0), (0.8, 0.2, 0.0, 0.0, 0.0), (0.9, 0.0, 0.0, 0.0, 0.1), (0.9, 0.0, 0.0, 0.1, 0.0), (0.9, 0.0, 0.1, 0.0, 0.0), (0.9, 0.1, 0.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0, 0.0)) |
def binary_prefix(value, binary=True):
'''Return a tuple with a scaled down version of value and it's binary prefix
Parameters:
- `value`: numeric type to trim down
- `binary`: use binary (ICE) or decimal (SI) prefix
'''
SI = 'kMGTPEZY'
unit = binary and 1024. or 1000.
for i in range(-1, len(SI)):
if abs(value) < unit:
break
value/= unit
return (value, i<0 and '' or (binary and SI[i].upper() + 'i' or SI[i]))
| def binary_prefix(value, binary=True):
"""Return a tuple with a scaled down version of value and it's binary prefix
Parameters:
- `value`: numeric type to trim down
- `binary`: use binary (ICE) or decimal (SI) prefix
"""
si = 'kMGTPEZY'
unit = binary and 1024.0 or 1000.0
for i in range(-1, len(SI)):
if abs(value) < unit:
break
value /= unit
return (value, i < 0 and '' or (binary and SI[i].upper() + 'i' or SI[i])) |
a, b, c = [int(x) for x in input().split()]
if c >= a and c <= b:
print("Yes")
else:
print("No")
| (a, b, c) = [int(x) for x in input().split()]
if c >= a and c <= b:
print('Yes')
else:
print('No') |
"""
All modules contained in frontend were written to be compiled bythe transpiler (transcrypt), they were not tested
in Cpython.
"""
| """
All modules contained in frontend were written to be compiled bythe transpiler (transcrypt), they were not tested
in Cpython.
""" |
def lambda_handler(event, context):
print("event ->", event)
print("context ->", context)
return {"statusCode": "200", "body" : "hello from user profile"}
| def lambda_handler(event, context):
print('event ->', event)
print('context ->', context)
return {'statusCode': '200', 'body': 'hello from user profile'} |
class SDKConfig(object):
"""
The class to configure the SDK.
"""
def __init__(self, auto_refresh_fields=False, pick_list_validation=True, read_timeout=None, connect_timeout=None):
"""
Creates an instance of SDKConfig with the following parameters
Parameters:
auto_refresh_fields(bool): A bool representing auto_refresh_fields
pick_list_validation(bool): A bool representing pick_list_validation
read_timeout(float): A Float representing read_timeout
connect_timeout(float): A Float representing connect_timeout
"""
self.__auto_refresh_fields = auto_refresh_fields
self.__pick_list_validation = pick_list_validation
self.__read_timeout = read_timeout
self.__connect_timeout = connect_timeout
def get_auto_refresh_fields(self):
"""
This is a getter method to get auto_refresh_fields.
Returns:
bool: A bool representing auto_refresh_fields
"""
return self.__auto_refresh_fields
def get_pick_list_validation(self):
"""
This is a getter method to get pick_list_validation.
Returns:
bool: A bool representing pick_list_validation
"""
return self.__pick_list_validation
def get_read_timeout(self):
"""
This is a getter method to get read_timeout.
Returns:
Float: A Float representing read_timeout
"""
return self.__read_timeout
def get_connect_timeout(self):
"""
This is a getter method to get connect_timeout.
Returns:
Float: A Float representing connect_timeout
"""
return self.__connect_timeout
| class Sdkconfig(object):
"""
The class to configure the SDK.
"""
def __init__(self, auto_refresh_fields=False, pick_list_validation=True, read_timeout=None, connect_timeout=None):
"""
Creates an instance of SDKConfig with the following parameters
Parameters:
auto_refresh_fields(bool): A bool representing auto_refresh_fields
pick_list_validation(bool): A bool representing pick_list_validation
read_timeout(float): A Float representing read_timeout
connect_timeout(float): A Float representing connect_timeout
"""
self.__auto_refresh_fields = auto_refresh_fields
self.__pick_list_validation = pick_list_validation
self.__read_timeout = read_timeout
self.__connect_timeout = connect_timeout
def get_auto_refresh_fields(self):
"""
This is a getter method to get auto_refresh_fields.
Returns:
bool: A bool representing auto_refresh_fields
"""
return self.__auto_refresh_fields
def get_pick_list_validation(self):
"""
This is a getter method to get pick_list_validation.
Returns:
bool: A bool representing pick_list_validation
"""
return self.__pick_list_validation
def get_read_timeout(self):
"""
This is a getter method to get read_timeout.
Returns:
Float: A Float representing read_timeout
"""
return self.__read_timeout
def get_connect_timeout(self):
"""
This is a getter method to get connect_timeout.
Returns:
Float: A Float representing connect_timeout
"""
return self.__connect_timeout |
#coding: UTF8
"""
Module description.
"""
| """
Module description.
""" |
# Python Classes and Objects
# Python is an Object-oriented Programming Language and almost everything in Python is an object with it properties and methods
# A Python Class is like an object constructor or a blueprint for creating objects
class Employee:
# This "Employee" class contains one variable "age"
age = 30
# Class instantiation uses function notation.
# The class object is a parameterless function that returns a new instance of the class.
# The below code creates a new instance of the class named "Employee" and assigns this object to the local variable named "employeeObject"
employeeObject = Employee()
print(employeeObject.age)
print("**********************************************************")
# _init_function of a class
# This gets executed when the class is being initiated. It can be used to assign values
# to object properties or ot other properties that are necessary when the object is
# being created
class Person:
# This "Person" class contains one public method "printAge" and a constructor
# The "self" parameter is a reference to the class itself, and is used to access variables
# that belongs to the class. It does not have to be named "self" , we can call it
# whatever we like, but it has to be the first parameter of any function in the class.
def __init__(self, name, age, city):
self.name = name
self.age = age
self.city = city
# Object Methods
# Objects can also contain methods. Methods in objects are functions that belong to the object
def printAge(self):
print("Printing the age of the person and his age is: " + str(self.age))
personObject1 = Person("Sam", 30, "Pune")
print("The name of the person is: " + personObject1.name)
print("The age of the person is: " + str(personObject1.age))
print("The city where the person lives is: " + personObject1.city)
print("**********************************************************")
personObject2 = Person("Richard", 35, "Kolkata")
personObject2.printAge()
print("**********************************************************")
# We can also modify, delete the object properties like below
personObject2.age = 40
personObject2.printAge()
del personObject2.age
# personObject2.printAge() # This will throw AttributeError
print("**********************************************************")
# We can also delete objects
del personObject2
# personObject2.printAge() # This will throw NameError
print("**********************************************************")
| class Employee:
age = 30
employee_object = employee()
print(employeeObject.age)
print('**********************************************************')
class Person:
def __init__(self, name, age, city):
self.name = name
self.age = age
self.city = city
def print_age(self):
print('Printing the age of the person and his age is: ' + str(self.age))
person_object1 = person('Sam', 30, 'Pune')
print('The name of the person is: ' + personObject1.name)
print('The age of the person is: ' + str(personObject1.age))
print('The city where the person lives is: ' + personObject1.city)
print('**********************************************************')
person_object2 = person('Richard', 35, 'Kolkata')
personObject2.printAge()
print('**********************************************************')
personObject2.age = 40
personObject2.printAge()
del personObject2.age
print('**********************************************************')
del personObject2
print('**********************************************************') |
def traverse_nested_dict(d):
iters = [d.iteritems()]
while iters:
it = iters.pop()
try:
k, v = it.next()
except StopIteration:
continue
iters.append(it)
if isinstance(v, dict):
iters.append(v.iteritems())
yield k, v
def transform_to_json(dot_notation_dict):
keys_dict = {}
delim = '.'
for key, val in dot_notation_dict.items():
if delim in key:
splits = key.split(delim)
if splits[0] not in keys_dict:
keys_dict[splits[0]] = {}
keys_dict[splits[0]]['.'.join(splits[1:])] = val
else:
keys_dict[key] = val
for key, val in keys_dict.items():
if isinstance(val, dict):
keys_dict[key] = transform_to_json(val)
return keys_dict
| def traverse_nested_dict(d):
iters = [d.iteritems()]
while iters:
it = iters.pop()
try:
(k, v) = it.next()
except StopIteration:
continue
iters.append(it)
if isinstance(v, dict):
iters.append(v.iteritems())
yield (k, v)
def transform_to_json(dot_notation_dict):
keys_dict = {}
delim = '.'
for (key, val) in dot_notation_dict.items():
if delim in key:
splits = key.split(delim)
if splits[0] not in keys_dict:
keys_dict[splits[0]] = {}
keys_dict[splits[0]]['.'.join(splits[1:])] = val
else:
keys_dict[key] = val
for (key, val) in keys_dict.items():
if isinstance(val, dict):
keys_dict[key] = transform_to_json(val)
return keys_dict |
T = int(input())
for i in range(T):
n_A = int(input())
A = set([int(j) for j in input().split(' ')])
n_B = int(input())
B = set([int(j) for j in input().split(' ')])
if not A.difference(B):
print("True")
else:
print("False") | t = int(input())
for i in range(T):
n_a = int(input())
a = set([int(j) for j in input().split(' ')])
n_b = int(input())
b = set([int(j) for j in input().split(' ')])
if not A.difference(B):
print('True')
else:
print('False') |
for _ in range(int(input())):
n=int(input())
if(n%4==0 or n%4==1):
print((n//4)**2)
else:
print(((n//4)+1) * (n//4))
| for _ in range(int(input())):
n = int(input())
if n % 4 == 0 or n % 4 == 1:
print((n // 4) ** 2)
else:
print((n // 4 + 1) * (n // 4)) |
class TSTreeNode(object):
def __init__(self, char, key, value, low, eq, high):
self.char = char
self.key = key
self.low = low
self.eq = eq
self.high = high
self.value = value
def __repr__(self):
return f"{self.key}:{self.value}<{self.low and self.low.key}={self.eq and self.eq.key}={self.high and self.high.key}>"
class TSTree(object):
def __init__(self):
self.root = None
def _get(self, node, chars):
char = chars[0]
if node == None:
return None
elif char < node.char:
return self._get(node.low, chars)
elif char == node.char:
if len(chars) > 1:
return self._get(node.eq, chars[1:])
else:
return node
else:
return self._get(node.high, chars)
def get(self, key):
chars = [ord(x) for x in key]
node = self._get(self.root, chars)
return node and node.value or None
def _set(self, node, chars, key, value):
next_char = chars[0]
if not node:
# what happens if you add the value here?
node = TSTreeNode(next_char, None, None, None, None, None)
if next_char < node.char:
node.low = self._set(node.low, chars, key, value)
elif next_char == node.char:
if len(chars) > 1:
node.eq = self._set(node.eq, chars[1:], key, value)
else:
# what happens if you DO NOT add the value here?
node.value = value
node.key = key
else:
node.high = self._set(node.high, chars, key, value)
return node
def set(self, key, value):
chars = [ord(x) for x in key]
self.root = self._set(self.root, chars, key, value)
def find_shortest(self, key):
nodes = self.find_all(key)
if nodes:
shortest = nodes[0]
for node in nodes:
if len(node.key) < len(shortest.key):
shortest = node
return shortest
else:
return None
def find_longest(self, key):
nodes = self.find_all(key)
longest = nodes[0]
for node in nodes:
if len(node.key) > len(longest.key):
longest = node
return longest
def _find_all(self, node, key, results):
if not node: return
if node.key and node.value:
# this node has something so save it
results.append(node)
# if there is a low then go low
if node.low:
self._find_all(node.low, key, results)
if node.eq:
# now follow middle
self._find_all(node.eq, key, results)
if node.high:
# if there is a high then go high
self._find_all(node.high, key, results)
def find_all(self, key):
results = []
chars = [ord(x) for x in key]
start = self._get(self.root, chars)
if start:
self._find_all(start.eq, key, results)
return results
def find_part(self, key):
"""The difference between part and shortest is this:
If you give find_part a 10 char key, and only 2 chars of the key
match 2 chars in the TSTree, then it will return that key. It is
partial on *both* search key and key/value key.
If you give a 10 char key to shortest, and only 2 chars match then
it doesn't find anything.
"""
# start by just finding the shortest key starting with the first char
found = self.find_shortest(key[:1])
if not found: return None
# now if we found something then keep increasing the key
for i in range(2, len(key)):
stem = key[:i]
node = self.find_shortest(stem)
if not node:
# didn't find something with the new key, so return what
# we've found so far
return found
else:
# found something, so update the best match so far
found = node
return found
| class Tstreenode(object):
def __init__(self, char, key, value, low, eq, high):
self.char = char
self.key = key
self.low = low
self.eq = eq
self.high = high
self.value = value
def __repr__(self):
return f'{self.key}:{self.value}<{self.low and self.low.key}={self.eq and self.eq.key}={self.high and self.high.key}>'
class Tstree(object):
def __init__(self):
self.root = None
def _get(self, node, chars):
char = chars[0]
if node == None:
return None
elif char < node.char:
return self._get(node.low, chars)
elif char == node.char:
if len(chars) > 1:
return self._get(node.eq, chars[1:])
else:
return node
else:
return self._get(node.high, chars)
def get(self, key):
chars = [ord(x) for x in key]
node = self._get(self.root, chars)
return node and node.value or None
def _set(self, node, chars, key, value):
next_char = chars[0]
if not node:
node = ts_tree_node(next_char, None, None, None, None, None)
if next_char < node.char:
node.low = self._set(node.low, chars, key, value)
elif next_char == node.char:
if len(chars) > 1:
node.eq = self._set(node.eq, chars[1:], key, value)
else:
node.value = value
node.key = key
else:
node.high = self._set(node.high, chars, key, value)
return node
def set(self, key, value):
chars = [ord(x) for x in key]
self.root = self._set(self.root, chars, key, value)
def find_shortest(self, key):
nodes = self.find_all(key)
if nodes:
shortest = nodes[0]
for node in nodes:
if len(node.key) < len(shortest.key):
shortest = node
return shortest
else:
return None
def find_longest(self, key):
nodes = self.find_all(key)
longest = nodes[0]
for node in nodes:
if len(node.key) > len(longest.key):
longest = node
return longest
def _find_all(self, node, key, results):
if not node:
return
if node.key and node.value:
results.append(node)
if node.low:
self._find_all(node.low, key, results)
if node.eq:
self._find_all(node.eq, key, results)
if node.high:
self._find_all(node.high, key, results)
def find_all(self, key):
results = []
chars = [ord(x) for x in key]
start = self._get(self.root, chars)
if start:
self._find_all(start.eq, key, results)
return results
def find_part(self, key):
"""The difference between part and shortest is this:
If you give find_part a 10 char key, and only 2 chars of the key
match 2 chars in the TSTree, then it will return that key. It is
partial on *both* search key and key/value key.
If you give a 10 char key to shortest, and only 2 chars match then
it doesn't find anything.
"""
found = self.find_shortest(key[:1])
if not found:
return None
for i in range(2, len(key)):
stem = key[:i]
node = self.find_shortest(stem)
if not node:
return found
else:
found = node
return found |
BASE_URL = 'https://imdb.com'
URLS = {
'Top 250 movies': '/chart/top/',
'Most popular movies': '/chart/moviemeter/',
'Top 250 TV shows': '/chart/toptv/',
'Most popular TV shows': '/chart/tvmeter/',
'Lowest rated movies': '/chart/bottom/',
}
def get_url(url_key):
if url_key in URLS:
return BASE_URL + URLS[url_key]
return BASE_URL + url_key
| base_url = 'https://imdb.com'
urls = {'Top 250 movies': '/chart/top/', 'Most popular movies': '/chart/moviemeter/', 'Top 250 TV shows': '/chart/toptv/', 'Most popular TV shows': '/chart/tvmeter/', 'Lowest rated movies': '/chart/bottom/'}
def get_url(url_key):
if url_key in URLS:
return BASE_URL + URLS[url_key]
return BASE_URL + url_key |
"""
Useful base functionality for use internally by the operations modules
"""
class Operation(object):
"""
An abstract operation that represents some modification/action on
this operations's image. Implementation of a particular operation can be created by
subclassing this and then overidding the `run()` method (and possibly the constructor).
This abstraction allows bookkeeping/higher-level parts of the api to treat
each operation as a discrete command, for the purposes of undos, tracking, etc.
"""
def __init__(self, image, *args, **kwargs):
"""
Initializes the operation
:Parameters:
image : `Image`
An image to operate on
"""
self.image = image
self.opimage = None
def run(self):
"""
Runs the operation and returns the resulting image after applying the operation
:Rtype:
`Image`
"""
self.opimage = self.image.clone()
return self.opimage
| """
Useful base functionality for use internally by the operations modules
"""
class Operation(object):
"""
An abstract operation that represents some modification/action on
this operations's image. Implementation of a particular operation can be created by
subclassing this and then overidding the `run()` method (and possibly the constructor).
This abstraction allows bookkeeping/higher-level parts of the api to treat
each operation as a discrete command, for the purposes of undos, tracking, etc.
"""
def __init__(self, image, *args, **kwargs):
"""
Initializes the operation
:Parameters:
image : `Image`
An image to operate on
"""
self.image = image
self.opimage = None
def run(self):
"""
Runs the operation and returns the resulting image after applying the operation
:Rtype:
`Image`
"""
self.opimage = self.image.clone()
return self.opimage |
while True:
try:
a = float(input('Number: '))
except ValueError:
print('Please, numbers only.')
continue
break
print('You entered a number: {}'.format(a))
| while True:
try:
a = float(input('Number: '))
except ValueError:
print('Please, numbers only.')
continue
break
print('You entered a number: {}'.format(a)) |
class Solution:
def maxProduct(self, nums: List[int]) -> int:
ans , max_p, min_p = nums[0], 1, 1
for num in nums:
max_p, min_p = max(num, min_p*num, max_p* num), min(num, min_p*num, max_p*num)
ans = max(ans, max_p)
return ans
| class Solution:
def max_product(self, nums: List[int]) -> int:
(ans, max_p, min_p) = (nums[0], 1, 1)
for num in nums:
(max_p, min_p) = (max(num, min_p * num, max_p * num), min(num, min_p * num, max_p * num))
ans = max(ans, max_p)
return ans |
class Solution:
# @param n, an integer
# @return an integer
def reverseBits(self, n):
t = bin(n)[2:]
return int(((32 - len(t)) * "0" + t)[: : -1], 2) | class Solution:
def reverse_bits(self, n):
t = bin(n)[2:]
return int(((32 - len(t)) * '0' + t)[::-1], 2) |
'''Simple parsing using mxTextTools
See the /doc subdirectory for introductory and
general documentation. See license.txt for licensing
information. (This is a BSD-licensed package).
'''
__version__="2.1.1"
| """Simple parsing using mxTextTools
See the /doc subdirectory for introductory and
general documentation. See license.txt for licensing
information. (This is a BSD-licensed package).
"""
__version__ = '2.1.1' |
class Stack:
def __init__(self):
self.stack = []
def push(self, el):
self.stack.append(el)
def pop(self):
return self.stack.pop()
def peek(self):
return self.stack[-1]
def is_empty(self):
return len(self.stack) == 0
| class Stack:
def __init__(self):
self.stack = []
def push(self, el):
self.stack.append(el)
def pop(self):
return self.stack.pop()
def peek(self):
return self.stack[-1]
def is_empty(self):
return len(self.stack) == 0 |
class Student:
def __init__(self, name, phy, chem, bio):
self.name = name
self.phy = phy
self.chem = chem
self.bio = bio
def totalObtained(self):
return(self.phy + self.chem + self.bio)
def percentage(self):
return((self.totalObtained() / 300) * 100)
| class Student:
def __init__(self, name, phy, chem, bio):
self.name = name
self.phy = phy
self.chem = chem
self.bio = bio
def total_obtained(self):
return self.phy + self.chem + self.bio
def percentage(self):
return self.totalObtained() / 300 * 100 |
local_var = "foo"
class C:
local_var = local_var #pass
def foo(self):
print(self.local_var)
C().foo()
| local_var = 'foo'
class C:
local_var = local_var
def foo(self):
print(self.local_var)
c().foo() |
n = int(input())
lista = list(map(int,input().split(" ")))
menor = lista[0]
posicao = 0
for i in range(len(lista)):
if menor > lista[i]:
menor = lista[i]
posicao = i
print("Menor valor: {}".format(menor))
print("Posicao: {}".format(posicao))
| n = int(input())
lista = list(map(int, input().split(' ')))
menor = lista[0]
posicao = 0
for i in range(len(lista)):
if menor > lista[i]:
menor = lista[i]
posicao = i
print('Menor valor: {}'.format(menor))
print('Posicao: {}'.format(posicao)) |
a = list(map(int, input().split()))
def mergesort(a):
if len(a) > 1:
mid = len(a) // 2
left = a[:mid]
right = a[mid:]
mergesort(left)
mergesort(right)
i = j = k = 0
while i < len(left) and j < len(right):
if left[i] <= right[j]:
a[k] = left[i]
i += 1
elif right[j] < left[i]:
a[k] = right[j]
j += 1
k += 1
while i < len(left):
a[k] = left[i]
i += 1
k += 1
while j < len(right):
a[k] = right[j]
j += 1
k += 1
mergesort(a)
print(a)
| a = list(map(int, input().split()))
def mergesort(a):
if len(a) > 1:
mid = len(a) // 2
left = a[:mid]
right = a[mid:]
mergesort(left)
mergesort(right)
i = j = k = 0
while i < len(left) and j < len(right):
if left[i] <= right[j]:
a[k] = left[i]
i += 1
elif right[j] < left[i]:
a[k] = right[j]
j += 1
k += 1
while i < len(left):
a[k] = left[i]
i += 1
k += 1
while j < len(right):
a[k] = right[j]
j += 1
k += 1
mergesort(a)
print(a) |
# -*- coding: utf-8 -*-
# # Figure 14-2 from page 284
class Item(object):
def __init__(self, n, v, w):
self._name = n
self._value = v
self._weight = w
def get_name(self):
return self._name
def get_value(self):
return self._value
def get_weight(self):
return self._weight
def __str__(self):
return f'<{self._name}, {self._value}, {self._weight}>'
def value(item):
return item.get_value()
def weight_inverse(item):
return 1.0/item.get_weight()
def density(item):
return item.get_value()/item.get_weight()
# # Figure 14-3 from page 284
def greedy(items, max_weight, key_function):
"""Assumes items a list, max_weight >= 0,
key_function maps elements of items to numbers"""
items_copy = sorted(items, key=key_function, reverse = True)
result = []
total_value, total_weight = 0.0, 0.0
for i in range(len(items_copy)):
if (total_weight + items_copy[i].get_weight()) <= max_weight:
result.append(items_copy[i])
total_weight += items_copy[i].get_weight()
total_value += items_copy[i].get_value()
return (result, total_value)
# # Figure 14-4 from page 286
def build_items():
names = ['clock','painting','radio','vase','book','computer']
values = [175,90,20,50,10,200]
weights = [10,9,4,2,1,20]
Items = []
for i in range(len(values)):
Items.append(Item(names[i], values[i], weights[i]))
return Items
def test_greedy(items, max_weight, key_function):
taken, val = greedy(items, max_weight, key_function)
print('Total value of items taken is', val)
for item in taken:
print(' ', item)
def test_greedys(max_weight = 20):
items = build_items()
print('Use greedy by value to fill knapsack of size', max_weight)
test_greedy(items, max_weight, value)
print('\nUse greedy by weight to fill knapsack of size',
max_weight)
test_greedy(items, max_weight, weight_inverse)
print('\nUse greedy by density to fill knapsack of size',
max_weight)
test_greedy(items, max_weight, density)
# # Code from page 287
# test_greedys()
# # Code from Figure 11-6
def get_binary_rep(n, num_digits):
"""Assumes n and numDigits are non-negative ints
Returns a str of length numDigits that is a binary
representation of n"""
result = ''
while n > 0:
result = str(n%2) + result
n = n//2
if len(result) > num_digits:
raise ValueError('not enough digits')
for i in range(num_digits - len(result)):
result = '0' + result
return result
def gen_powerset(L):
"""Assumes L is a list
Returns a list of lists that contains all possible
combinations of the elements of L. E.g., if
L is [1, 2] it will return a list with elements
[], [1], [2], and [1,2]."""
powerset = []
for i in range(0, 2**len(L)):
bin_str = get_binary_rep(i, len(L))
subset = []
for j in range(len(L)):
if bin_str[j] == '1':
subset.append(L[j])
powerset.append(subset)
return powerset
# # Figure 14-5 on page 289
def choose_best(pset, max_weight, get_val, get_weight):
best_val = 0.0
best_set = None
for items in pset:
items_val = 0.0
items_weight = 0.0
for item in items:
items_val += get_val(item)
items_weight += get_weight(item)
if items_weight <= max_weight and items_val > best_val:
best_val = items_val
best_set = items
return (best_set, best_val)
def test_best(max_weight = 20):
items = build_items()
pset = gen_powerset(items)
taken, val = choose_best(pset, max_weight, Item.get_value,
Item.get_weight)
print('Total value of items taken is', val)
for item in taken:
print(item)
# test_best()
# # Figure 14-7 on page 294
class Node(object):
def __init__(self, name):
"""Assumes name is a string"""
self._name = name
def get_name(self):
return self._name
def __str__(self):
return self._name
class Edge(object):
def __init__(self, src, dest):
"""Assumes src and dest are nodes"""
self._src = src
self._dest = dest
def get_source(self):
return self._src
def get_destination(self):
return self._dest
def __str__(self):
return self._src.get_name() + '->' + self._dest.get_name()
class Weighted_edge(Edge):
def __init__(self, src, dest, weight = 1.0):
"""Assumes src and dest are nodes, weight a number"""
self._src = src
self._dest = dest
self._weight = weight
def get_weight(self):
return self._weight
def __str__(self):
return (f'{self._src.get_name()}->({self._weight})' +
f'{self._dest.get_name()}')
# # Figure 14-8 on page 296
class Digraph(object):
#nodes is a list of the nodes in the graph
#edges is a dict mapping each node to a list of its children
def __init__(self):
self._nodes = []
self._edges = {}
def add_node(self, node):
if node in self._nodes:
raise ValueError('Duplicate node')
else:
self._nodes.append(node)
self._edges[node] = []
def add_edge(self, edge):
src = edge.get_source()
dest = edge.get_destination()
if not (src in self._nodes and dest in self._nodes):
raise ValueError('Node not in graph')
self._edges[src].append(dest)
def children_of(self, node):
return self._edges[node]
def has_node(self, node):
return node in self._nodes
def __str__(self):
result = ''
for src in self._nodes:
for dest in self._edges[src]:
result = (result + src.get_name() + '->'
+ dest.get_name() + '\n')
return result[:-1] #omit final newline
class Graph(Digraph):
def add_edge(self, edge):
Digraph.add_edge(self, edge)
rev = Edge(edge.get_destination(), edge.get_source())
Digraph.add_edge(self, rev)
# # Figure 14-9 on page 299
def print_path(path):
"""Assumes path is a list of nodes"""
result = ''
for i in range(len(path)):
result = result + str(path[i])
if i != len(path) - 1:
result = result + '->'
return result
def DFS(graph, start, end, path, shortest, to_print = False):
"""Assumes graph is a Digraph; start and end are nodes;
path and shortest are lists of nodes
Returns a shortest path from start to end in graph"""
path = path + [start]
if to_print:
print('Current DFS path:', print_path(path))
if start == end:
return path
for node in graph.children_of(start):
if node not in path: #avoid cycles
if shortest == None or len(path) < len(shortest):
new_path = DFS(graph, node, end, path, shortest,
to_print)
if new_path != None:
shortest = new_path
return shortest
def shortest_path(graph, start, end, to_print = False):
"""Assumes graph is a Digraph; start and end are nodes
Returns a shortest path from start to end in graph"""
return DFS(graph, start, end, [], None, to_print)
# # Figure 14-10 on page 301
def test_SP():
nodes = []
for name in range(6): #Create 6 nodes
nodes.append(Node(str(name)))
g = Digraph()
for n in nodes:
g.add_node(n)
g.add_edge(Edge(nodes[0],nodes[1]))
g.add_edge(Edge(nodes[1],nodes[2]))
g.add_edge(Edge(nodes[2],nodes[3]))
g.add_edge(Edge(nodes[2],nodes[4]))
g.add_edge(Edge(nodes[3],nodes[4]))
g.add_edge(Edge(nodes[3],nodes[5]))
g.add_edge(Edge(nodes[0],nodes[2]))
g.add_edge(Edge(nodes[1],nodes[0]))
g.add_edge(Edge(nodes[3],nodes[1]))
g.add_edge(Edge(nodes[4],nodes[0]))
sp = shortest_path(g, nodes[0], nodes[5], to_print = True)
print('Shortest path found by DFS:', print_path(sp))
# test_SP()
# # Figure 14-11 on page 303
def BFS(graph, start, end, to_print = False):
"""Assumes graph is a Digraph; start and end are nodes
Returns a shortest path from start to end in graph"""
init_path = [start]
path_queue = [init_path]
while len(path_queue) != 0:
#Get and remove oldest element in path_queue
tmp_path = path_queue.pop(0)
if to_print:
print('Current BFS path:', print_path(tmp_path))
last_node = tmp_path[-1]
if last_node == end:
return tmp_path
for next_node in graph.children_of(last_node):
if next_node not in tmp_path:
new_path = tmp_path + [next_node]
path_queue.append(new_path)
return None
# # test_sp modifed as per code on page 303
def test_SP():
nodes = []
for name in range(6): #Create 6 nodes
nodes.append(Node(str(name)))
g = Digraph()
for n in nodes:
g.add_node(n)
g.add_edge(Edge(nodes[0],nodes[1]))
g.add_edge(Edge(nodes[1],nodes[2]))
g.add_edge(Edge(nodes[2],nodes[3]))
g.add_edge(Edge(nodes[2],nodes[4]))
g.add_edge(Edge(nodes[3],nodes[4]))
g.add_edge(Edge(nodes[3],nodes[5]))
g.add_edge(Edge(nodes[0],nodes[2]))
g.add_edge(Edge(nodes[1],nodes[0]))
g.add_edge(Edge(nodes[3],nodes[1]))
g.add_edge(Edge(nodes[4],nodes[0]))
sp = shortest_path(g, nodes[0], nodes[5], to_print = True)
print('Shortest path found by DFS:', print_path(sp))
sp = BFS(g, nodes[0], nodes[5], to_print = True)
print('Shortest path found by BFS:', print_path(sp))
# test_SP()
| class Item(object):
def __init__(self, n, v, w):
self._name = n
self._value = v
self._weight = w
def get_name(self):
return self._name
def get_value(self):
return self._value
def get_weight(self):
return self._weight
def __str__(self):
return f'<{self._name}, {self._value}, {self._weight}>'
def value(item):
return item.get_value()
def weight_inverse(item):
return 1.0 / item.get_weight()
def density(item):
return item.get_value() / item.get_weight()
def greedy(items, max_weight, key_function):
"""Assumes items a list, max_weight >= 0,
key_function maps elements of items to numbers"""
items_copy = sorted(items, key=key_function, reverse=True)
result = []
(total_value, total_weight) = (0.0, 0.0)
for i in range(len(items_copy)):
if total_weight + items_copy[i].get_weight() <= max_weight:
result.append(items_copy[i])
total_weight += items_copy[i].get_weight()
total_value += items_copy[i].get_value()
return (result, total_value)
def build_items():
names = ['clock', 'painting', 'radio', 'vase', 'book', 'computer']
values = [175, 90, 20, 50, 10, 200]
weights = [10, 9, 4, 2, 1, 20]
items = []
for i in range(len(values)):
Items.append(item(names[i], values[i], weights[i]))
return Items
def test_greedy(items, max_weight, key_function):
(taken, val) = greedy(items, max_weight, key_function)
print('Total value of items taken is', val)
for item in taken:
print(' ', item)
def test_greedys(max_weight=20):
items = build_items()
print('Use greedy by value to fill knapsack of size', max_weight)
test_greedy(items, max_weight, value)
print('\nUse greedy by weight to fill knapsack of size', max_weight)
test_greedy(items, max_weight, weight_inverse)
print('\nUse greedy by density to fill knapsack of size', max_weight)
test_greedy(items, max_weight, density)
def get_binary_rep(n, num_digits):
"""Assumes n and numDigits are non-negative ints
Returns a str of length numDigits that is a binary
representation of n"""
result = ''
while n > 0:
result = str(n % 2) + result
n = n // 2
if len(result) > num_digits:
raise value_error('not enough digits')
for i in range(num_digits - len(result)):
result = '0' + result
return result
def gen_powerset(L):
"""Assumes L is a list
Returns a list of lists that contains all possible
combinations of the elements of L. E.g., if
L is [1, 2] it will return a list with elements
[], [1], [2], and [1,2]."""
powerset = []
for i in range(0, 2 ** len(L)):
bin_str = get_binary_rep(i, len(L))
subset = []
for j in range(len(L)):
if bin_str[j] == '1':
subset.append(L[j])
powerset.append(subset)
return powerset
def choose_best(pset, max_weight, get_val, get_weight):
best_val = 0.0
best_set = None
for items in pset:
items_val = 0.0
items_weight = 0.0
for item in items:
items_val += get_val(item)
items_weight += get_weight(item)
if items_weight <= max_weight and items_val > best_val:
best_val = items_val
best_set = items
return (best_set, best_val)
def test_best(max_weight=20):
items = build_items()
pset = gen_powerset(items)
(taken, val) = choose_best(pset, max_weight, Item.get_value, Item.get_weight)
print('Total value of items taken is', val)
for item in taken:
print(item)
class Node(object):
def __init__(self, name):
"""Assumes name is a string"""
self._name = name
def get_name(self):
return self._name
def __str__(self):
return self._name
class Edge(object):
def __init__(self, src, dest):
"""Assumes src and dest are nodes"""
self._src = src
self._dest = dest
def get_source(self):
return self._src
def get_destination(self):
return self._dest
def __str__(self):
return self._src.get_name() + '->' + self._dest.get_name()
class Weighted_Edge(Edge):
def __init__(self, src, dest, weight=1.0):
"""Assumes src and dest are nodes, weight a number"""
self._src = src
self._dest = dest
self._weight = weight
def get_weight(self):
return self._weight
def __str__(self):
return f'{self._src.get_name()}->({self._weight})' + f'{self._dest.get_name()}'
class Digraph(object):
def __init__(self):
self._nodes = []
self._edges = {}
def add_node(self, node):
if node in self._nodes:
raise value_error('Duplicate node')
else:
self._nodes.append(node)
self._edges[node] = []
def add_edge(self, edge):
src = edge.get_source()
dest = edge.get_destination()
if not (src in self._nodes and dest in self._nodes):
raise value_error('Node not in graph')
self._edges[src].append(dest)
def children_of(self, node):
return self._edges[node]
def has_node(self, node):
return node in self._nodes
def __str__(self):
result = ''
for src in self._nodes:
for dest in self._edges[src]:
result = result + src.get_name() + '->' + dest.get_name() + '\n'
return result[:-1]
class Graph(Digraph):
def add_edge(self, edge):
Digraph.add_edge(self, edge)
rev = edge(edge.get_destination(), edge.get_source())
Digraph.add_edge(self, rev)
def print_path(path):
"""Assumes path is a list of nodes"""
result = ''
for i in range(len(path)):
result = result + str(path[i])
if i != len(path) - 1:
result = result + '->'
return result
def dfs(graph, start, end, path, shortest, to_print=False):
"""Assumes graph is a Digraph; start and end are nodes;
path and shortest are lists of nodes
Returns a shortest path from start to end in graph"""
path = path + [start]
if to_print:
print('Current DFS path:', print_path(path))
if start == end:
return path
for node in graph.children_of(start):
if node not in path:
if shortest == None or len(path) < len(shortest):
new_path = dfs(graph, node, end, path, shortest, to_print)
if new_path != None:
shortest = new_path
return shortest
def shortest_path(graph, start, end, to_print=False):
"""Assumes graph is a Digraph; start and end are nodes
Returns a shortest path from start to end in graph"""
return dfs(graph, start, end, [], None, to_print)
def test_sp():
nodes = []
for name in range(6):
nodes.append(node(str(name)))
g = digraph()
for n in nodes:
g.add_node(n)
g.add_edge(edge(nodes[0], nodes[1]))
g.add_edge(edge(nodes[1], nodes[2]))
g.add_edge(edge(nodes[2], nodes[3]))
g.add_edge(edge(nodes[2], nodes[4]))
g.add_edge(edge(nodes[3], nodes[4]))
g.add_edge(edge(nodes[3], nodes[5]))
g.add_edge(edge(nodes[0], nodes[2]))
g.add_edge(edge(nodes[1], nodes[0]))
g.add_edge(edge(nodes[3], nodes[1]))
g.add_edge(edge(nodes[4], nodes[0]))
sp = shortest_path(g, nodes[0], nodes[5], to_print=True)
print('Shortest path found by DFS:', print_path(sp))
def bfs(graph, start, end, to_print=False):
"""Assumes graph is a Digraph; start and end are nodes
Returns a shortest path from start to end in graph"""
init_path = [start]
path_queue = [init_path]
while len(path_queue) != 0:
tmp_path = path_queue.pop(0)
if to_print:
print('Current BFS path:', print_path(tmp_path))
last_node = tmp_path[-1]
if last_node == end:
return tmp_path
for next_node in graph.children_of(last_node):
if next_node not in tmp_path:
new_path = tmp_path + [next_node]
path_queue.append(new_path)
return None
def test_sp():
nodes = []
for name in range(6):
nodes.append(node(str(name)))
g = digraph()
for n in nodes:
g.add_node(n)
g.add_edge(edge(nodes[0], nodes[1]))
g.add_edge(edge(nodes[1], nodes[2]))
g.add_edge(edge(nodes[2], nodes[3]))
g.add_edge(edge(nodes[2], nodes[4]))
g.add_edge(edge(nodes[3], nodes[4]))
g.add_edge(edge(nodes[3], nodes[5]))
g.add_edge(edge(nodes[0], nodes[2]))
g.add_edge(edge(nodes[1], nodes[0]))
g.add_edge(edge(nodes[3], nodes[1]))
g.add_edge(edge(nodes[4], nodes[0]))
sp = shortest_path(g, nodes[0], nodes[5], to_print=True)
print('Shortest path found by DFS:', print_path(sp))
sp = bfs(g, nodes[0], nodes[5], to_print=True)
print('Shortest path found by BFS:', print_path(sp)) |
'''
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.
A leaf is a node with no children.
'''
# 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 hasPathSum(self, root: Optional[TreeNode], targetSum: int) -> bool:
if not root:
return False
node_stack = []
node_stack.append((root, targetSum - root.val))
while node_stack:
node, curr_sum = node_stack.pop()
if not node.left and not node.right and curr_sum == 0:
return True
if node.right:
node_stack.append((node.right, curr_sum - node.right.val))
if node.left:
node_stack.append((node.left, curr_sum - node.left.val))
return False
def hasPathSum_recur(self, root: Optional[TreeNode], targetSum: int) -> bool:
if not root:
return False
targetSum = targetSum - root.val
if not root.left and not root.right:
return targetSum == 0
return self.hasPathSum_recur(root.left, targetSum) or self.hasPathSum_recur(root.right, targetSum)
| """
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum.
A leaf is a node with no children.
"""
class Treenode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def has_path_sum(self, root: Optional[TreeNode], targetSum: int) -> bool:
if not root:
return False
node_stack = []
node_stack.append((root, targetSum - root.val))
while node_stack:
(node, curr_sum) = node_stack.pop()
if not node.left and (not node.right) and (curr_sum == 0):
return True
if node.right:
node_stack.append((node.right, curr_sum - node.right.val))
if node.left:
node_stack.append((node.left, curr_sum - node.left.val))
return False
def has_path_sum_recur(self, root: Optional[TreeNode], targetSum: int) -> bool:
if not root:
return False
target_sum = targetSum - root.val
if not root.left and (not root.right):
return targetSum == 0
return self.hasPathSum_recur(root.left, targetSum) or self.hasPathSum_recur(root.right, targetSum) |
#
# PySNMP MIB module AP64STATS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AP64STATS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:07:11 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)
#
ap64Stats, = mibBuilder.importSymbols("APENT-MIB", "ap64Stats")
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
ModuleIdentity, Unsigned32, TimeTicks, iso, Counter64, IpAddress, Integer32, Counter32, Bits, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Gauge32, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "Unsigned32", "TimeTicks", "iso", "Counter64", "IpAddress", "Integer32", "Counter32", "Bits", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Gauge32", "NotificationType")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
ap64StatsMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 2467, 1, 44, 1))
if mibBuilder.loadTexts: ap64StatsMib.setLastUpdated('9710092000Z')
if mibBuilder.loadTexts: ap64StatsMib.setOrganization('ArrowPoint Communications Inc.')
class PhysAddress(OctetString):
pass
class OwnerString(DisplayString):
pass
class EntryStatus(Integer32):
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("valid", 1), ("createRequest", 2), ("underCreation", 3), ("invalid", 4))
ap64dot3StatsTable = MibTable((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2), )
if mibBuilder.loadTexts: ap64dot3StatsTable.setStatus('current')
ap64dot3StatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1), ).setIndexNames((0, "AP64STATS-MIB", "ap64dot3StatsIndex"))
if mibBuilder.loadTexts: ap64dot3StatsEntry.setStatus('current')
ap64dot3StatsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsIndex.setStatus('current')
ap64dot3StatsAlignmentErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsAlignmentErrors.setStatus('current')
ap64dot3StatsFCSErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsFCSErrors.setStatus('current')
ap64dot3StatsSingleCollisionFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsSingleCollisionFrames.setStatus('current')
ap64dot3StatsMultipleCollisionFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsMultipleCollisionFrames.setStatus('current')
ap64dot3StatsSQETestErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsSQETestErrors.setStatus('current')
ap64dot3StatsDeferredTransmissions = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsDeferredTransmissions.setStatus('current')
ap64dot3StatsLateCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsLateCollisions.setStatus('current')
ap64dot3StatsExcessiveCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsExcessiveCollisions.setStatus('current')
ap64dot3StatsInternalMacTransmitErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsInternalMacTransmitErrors.setStatus('current')
ap64dot3StatsCarrierSenseErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsCarrierSenseErrors.setStatus('current')
ap64dot3StatsFrameTooLongs = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsFrameTooLongs.setStatus('current')
ap64dot3StatsInternalMacReceiveErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64dot3StatsInternalMacReceiveErrors.setStatus('current')
ap64ifTable = MibTable((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3), )
if mibBuilder.loadTexts: ap64ifTable.setStatus('current')
ap64ifEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1), ).setIndexNames((0, "AP64STATS-MIB", "ap64ifIndex"))
if mibBuilder.loadTexts: ap64ifEntry.setStatus('current')
ap64ifIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifIndex.setStatus('current')
ap64ifDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifDescr.setStatus('current')
ap64ifType = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32))).clone(namedValues=NamedValues(("other", 1), ("regular1822", 2), ("hdh1822", 3), ("ddn-x25", 4), ("rfc877-x25", 5), ("ethernet-csmacd", 6), ("iso88023-csmacd", 7), ("iso88024-tokenBus", 8), ("iso88025-tokenRing", 9), ("iso88026-man", 10), ("starLan", 11), ("proteon-10Mbit", 12), ("proteon-80Mbit", 13), ("hyperchannel", 14), ("fddi", 15), ("lapb", 16), ("sdlc", 17), ("ds1", 18), ("e1", 19), ("basicISDN", 20), ("primaryISDN", 21), ("propPointToPointSerial", 22), ("ppp", 23), ("softwareLoopback", 24), ("eon", 25), ("ethernet-3Mbit", 26), ("nsip", 27), ("slip", 28), ("ultra", 29), ("ds3", 30), ("sip", 31), ("frame-relay", 32)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifType.setStatus('current')
ap64ifMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifMtu.setStatus('current')
ap64ifSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifSpeed.setStatus('current')
ap64ifPhysAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 6), PhysAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifPhysAddress.setStatus('current')
ap64ifAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifAdminStatus.setStatus('current')
ap64ifOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifOperStatus.setStatus('current')
ap64ifLastChange = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 9), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifLastChange.setStatus('current')
ap64ifInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifInOctets.setStatus('current')
ap64ifInUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifInUcastPkts.setStatus('current')
ap64ifInNUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifInNUcastPkts.setStatus('current')
ap64ifInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifInDiscards.setStatus('current')
ap64ifInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifInErrors.setStatus('current')
ap64ifInUnknownProtos = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifInUnknownProtos.setStatus('current')
ap64ifOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifOutOctets.setStatus('current')
ap64ifOutUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifOutUcastPkts.setStatus('current')
ap64ifOutNUcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifOutNUcastPkts.setStatus('current')
ap64ifOutDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifOutDiscards.setStatus('current')
ap64ifOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifOutErrors.setStatus('current')
ap64ifOutQLen = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 21), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifOutQLen.setStatus('current')
ap64ifSpecific = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 22), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64ifSpecific.setStatus('current')
ap64etherStatsTable = MibTable((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4), )
if mibBuilder.loadTexts: ap64etherStatsTable.setStatus('current')
ap64etherStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1), ).setIndexNames((0, "AP64STATS-MIB", "ap64etherStatsIndex"))
if mibBuilder.loadTexts: ap64etherStatsEntry.setStatus('current')
ap64etherStatsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsIndex.setStatus('current')
ap64etherStatsDataSource = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 2), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsDataSource.setStatus('current')
ap64etherStatsDropEvents = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsDropEvents.setStatus('current')
ap64etherStatsOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsOctets.setStatus('current')
ap64etherStatsPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsPkts.setStatus('current')
ap64etherStatsBroadcastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsBroadcastPkts.setStatus('current')
ap64etherStatsMulticastPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsMulticastPkts.setStatus('current')
ap64etherStatsCRCAlignErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsCRCAlignErrors.setStatus('current')
ap64etherStatsUndersizePkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsUndersizePkts.setStatus('current')
ap64etherStatsOversizePkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsOversizePkts.setStatus('current')
ap64etherStatsFragments = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsFragments.setStatus('current')
ap64etherStatsJabbers = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsJabbers.setStatus('current')
ap64etherStatsCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsCollisions.setStatus('current')
ap64etherStatsPkts64Octets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsPkts64Octets.setStatus('current')
ap64etherStatsPkts65to127Octets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsPkts65to127Octets.setStatus('current')
ap64etherStatsPkts128to255Octets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsPkts128to255Octets.setStatus('current')
ap64etherStatsPkts256to511Octets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsPkts256to511Octets.setStatus('current')
ap64etherStatsPkts512to1023Octets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsPkts512to1023Octets.setStatus('current')
ap64etherStatsPkts1024to1518Octets = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsPkts1024to1518Octets.setStatus('current')
ap64etherStatsOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 20), OwnerString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsOwner.setStatus('current')
ap64etherStatsStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 21), EntryStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ap64etherStatsStatus.setStatus('current')
mibBuilder.exportSymbols("AP64STATS-MIB", ap64etherStatsPkts64Octets=ap64etherStatsPkts64Octets, ap64etherStatsIndex=ap64etherStatsIndex, ap64etherStatsStatus=ap64etherStatsStatus, ap64etherStatsJabbers=ap64etherStatsJabbers, ap64ifInNUcastPkts=ap64ifInNUcastPkts, ap64etherStatsCollisions=ap64etherStatsCollisions, ap64dot3StatsInternalMacReceiveErrors=ap64dot3StatsInternalMacReceiveErrors, ap64dot3StatsExcessiveCollisions=ap64dot3StatsExcessiveCollisions, ap64ifLastChange=ap64ifLastChange, ap64ifOutDiscards=ap64ifOutDiscards, ap64ifMtu=ap64ifMtu, ap64ifInUcastPkts=ap64ifInUcastPkts, ap64ifInErrors=ap64ifInErrors, ap64dot3StatsIndex=ap64dot3StatsIndex, ap64etherStatsPkts=ap64etherStatsPkts, PYSNMP_MODULE_ID=ap64StatsMib, ap64etherStatsOwner=ap64etherStatsOwner, ap64dot3StatsSingleCollisionFrames=ap64dot3StatsSingleCollisionFrames, ap64ifInDiscards=ap64ifInDiscards, OwnerString=OwnerString, ap64etherStatsPkts128to255Octets=ap64etherStatsPkts128to255Octets, ap64ifSpecific=ap64ifSpecific, ap64etherStatsEntry=ap64etherStatsEntry, ap64ifType=ap64ifType, ap64ifOutOctets=ap64ifOutOctets, ap64etherStatsDropEvents=ap64etherStatsDropEvents, ap64etherStatsOversizePkts=ap64etherStatsOversizePkts, ap64StatsMib=ap64StatsMib, ap64ifAdminStatus=ap64ifAdminStatus, ap64ifOutErrors=ap64ifOutErrors, ap64dot3StatsLateCollisions=ap64dot3StatsLateCollisions, ap64etherStatsPkts512to1023Octets=ap64etherStatsPkts512to1023Octets, ap64dot3StatsTable=ap64dot3StatsTable, PhysAddress=PhysAddress, ap64ifOperStatus=ap64ifOperStatus, ap64dot3StatsMultipleCollisionFrames=ap64dot3StatsMultipleCollisionFrames, ap64ifEntry=ap64ifEntry, ap64dot3StatsAlignmentErrors=ap64dot3StatsAlignmentErrors, ap64ifOutNUcastPkts=ap64ifOutNUcastPkts, ap64ifSpeed=ap64ifSpeed, ap64dot3StatsFrameTooLongs=ap64dot3StatsFrameTooLongs, ap64etherStatsPkts1024to1518Octets=ap64etherStatsPkts1024to1518Octets, ap64dot3StatsSQETestErrors=ap64dot3StatsSQETestErrors, ap64dot3StatsInternalMacTransmitErrors=ap64dot3StatsInternalMacTransmitErrors, ap64etherStatsMulticastPkts=ap64etherStatsMulticastPkts, ap64etherStatsDataSource=ap64etherStatsDataSource, ap64ifDescr=ap64ifDescr, ap64etherStatsTable=ap64etherStatsTable, ap64etherStatsOctets=ap64etherStatsOctets, ap64etherStatsCRCAlignErrors=ap64etherStatsCRCAlignErrors, ap64etherStatsPkts65to127Octets=ap64etherStatsPkts65to127Octets, ap64ifOutUcastPkts=ap64ifOutUcastPkts, ap64etherStatsFragments=ap64etherStatsFragments, EntryStatus=EntryStatus, ap64dot3StatsDeferredTransmissions=ap64dot3StatsDeferredTransmissions, ap64ifInOctets=ap64ifInOctets, ap64etherStatsUndersizePkts=ap64etherStatsUndersizePkts, ap64dot3StatsFCSErrors=ap64dot3StatsFCSErrors, ap64dot3StatsCarrierSenseErrors=ap64dot3StatsCarrierSenseErrors, ap64ifTable=ap64ifTable, ap64ifOutQLen=ap64ifOutQLen, ap64etherStatsBroadcastPkts=ap64etherStatsBroadcastPkts, ap64ifPhysAddress=ap64ifPhysAddress, ap64etherStatsPkts256to511Octets=ap64etherStatsPkts256to511Octets, ap64dot3StatsEntry=ap64dot3StatsEntry, ap64ifInUnknownProtos=ap64ifInUnknownProtos, ap64ifIndex=ap64ifIndex)
| (ap64_stats,) = mibBuilder.importSymbols('APENT-MIB', 'ap64Stats')
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', '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')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(module_identity, unsigned32, time_ticks, iso, counter64, ip_address, integer32, counter32, bits, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, gauge32, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'Unsigned32', 'TimeTicks', 'iso', 'Counter64', 'IpAddress', 'Integer32', 'Counter32', 'Bits', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'Gauge32', 'NotificationType')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
ap64_stats_mib = module_identity((1, 3, 6, 1, 4, 1, 2467, 1, 44, 1))
if mibBuilder.loadTexts:
ap64StatsMib.setLastUpdated('9710092000Z')
if mibBuilder.loadTexts:
ap64StatsMib.setOrganization('ArrowPoint Communications Inc.')
class Physaddress(OctetString):
pass
class Ownerstring(DisplayString):
pass
class Entrystatus(Integer32):
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4))
named_values = named_values(('valid', 1), ('createRequest', 2), ('underCreation', 3), ('invalid', 4))
ap64dot3_stats_table = mib_table((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2))
if mibBuilder.loadTexts:
ap64dot3StatsTable.setStatus('current')
ap64dot3_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1)).setIndexNames((0, 'AP64STATS-MIB', 'ap64dot3StatsIndex'))
if mibBuilder.loadTexts:
ap64dot3StatsEntry.setStatus('current')
ap64dot3_stats_index = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsIndex.setStatus('current')
ap64dot3_stats_alignment_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsAlignmentErrors.setStatus('current')
ap64dot3_stats_fcs_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsFCSErrors.setStatus('current')
ap64dot3_stats_single_collision_frames = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsSingleCollisionFrames.setStatus('current')
ap64dot3_stats_multiple_collision_frames = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsMultipleCollisionFrames.setStatus('current')
ap64dot3_stats_sqe_test_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsSQETestErrors.setStatus('current')
ap64dot3_stats_deferred_transmissions = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsDeferredTransmissions.setStatus('current')
ap64dot3_stats_late_collisions = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsLateCollisions.setStatus('current')
ap64dot3_stats_excessive_collisions = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsExcessiveCollisions.setStatus('current')
ap64dot3_stats_internal_mac_transmit_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsInternalMacTransmitErrors.setStatus('current')
ap64dot3_stats_carrier_sense_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsCarrierSenseErrors.setStatus('current')
ap64dot3_stats_frame_too_longs = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 13), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsFrameTooLongs.setStatus('current')
ap64dot3_stats_internal_mac_receive_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 2, 1, 16), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64dot3StatsInternalMacReceiveErrors.setStatus('current')
ap64if_table = mib_table((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3))
if mibBuilder.loadTexts:
ap64ifTable.setStatus('current')
ap64if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1)).setIndexNames((0, 'AP64STATS-MIB', 'ap64ifIndex'))
if mibBuilder.loadTexts:
ap64ifEntry.setStatus('current')
ap64if_index = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifIndex.setStatus('current')
ap64if_descr = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifDescr.setStatus('current')
ap64if_type = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32))).clone(namedValues=named_values(('other', 1), ('regular1822', 2), ('hdh1822', 3), ('ddn-x25', 4), ('rfc877-x25', 5), ('ethernet-csmacd', 6), ('iso88023-csmacd', 7), ('iso88024-tokenBus', 8), ('iso88025-tokenRing', 9), ('iso88026-man', 10), ('starLan', 11), ('proteon-10Mbit', 12), ('proteon-80Mbit', 13), ('hyperchannel', 14), ('fddi', 15), ('lapb', 16), ('sdlc', 17), ('ds1', 18), ('e1', 19), ('basicISDN', 20), ('primaryISDN', 21), ('propPointToPointSerial', 22), ('ppp', 23), ('softwareLoopback', 24), ('eon', 25), ('ethernet-3Mbit', 26), ('nsip', 27), ('slip', 28), ('ultra', 29), ('ds3', 30), ('sip', 31), ('frame-relay', 32)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifType.setStatus('current')
ap64if_mtu = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifMtu.setStatus('current')
ap64if_speed = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 5), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifSpeed.setStatus('current')
ap64if_phys_address = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 6), phys_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifPhysAddress.setStatus('current')
ap64if_admin_status = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('up', 1), ('down', 2), ('testing', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifAdminStatus.setStatus('current')
ap64if_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('up', 1), ('down', 2), ('testing', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifOperStatus.setStatus('current')
ap64if_last_change = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 9), time_ticks()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifLastChange.setStatus('current')
ap64if_in_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifInOctets.setStatus('current')
ap64if_in_ucast_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifInUcastPkts.setStatus('current')
ap64if_in_n_ucast_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifInNUcastPkts.setStatus('current')
ap64if_in_discards = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 13), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifInDiscards.setStatus('current')
ap64if_in_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 14), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifInErrors.setStatus('current')
ap64if_in_unknown_protos = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 15), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifInUnknownProtos.setStatus('current')
ap64if_out_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 16), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifOutOctets.setStatus('current')
ap64if_out_ucast_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 17), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifOutUcastPkts.setStatus('current')
ap64if_out_n_ucast_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 18), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifOutNUcastPkts.setStatus('current')
ap64if_out_discards = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 19), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifOutDiscards.setStatus('current')
ap64if_out_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 20), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifOutErrors.setStatus('current')
ap64if_out_q_len = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 21), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifOutQLen.setStatus('current')
ap64if_specific = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 3, 1, 22), object_identifier()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64ifSpecific.setStatus('current')
ap64ether_stats_table = mib_table((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4))
if mibBuilder.loadTexts:
ap64etherStatsTable.setStatus('current')
ap64ether_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1)).setIndexNames((0, 'AP64STATS-MIB', 'ap64etherStatsIndex'))
if mibBuilder.loadTexts:
ap64etherStatsEntry.setStatus('current')
ap64ether_stats_index = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsIndex.setStatus('current')
ap64ether_stats_data_source = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 2), object_identifier()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsDataSource.setStatus('current')
ap64ether_stats_drop_events = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsDropEvents.setStatus('current')
ap64ether_stats_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsOctets.setStatus('current')
ap64ether_stats_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsPkts.setStatus('current')
ap64ether_stats_broadcast_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsBroadcastPkts.setStatus('current')
ap64ether_stats_multicast_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsMulticastPkts.setStatus('current')
ap64ether_stats_crc_align_errors = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsCRCAlignErrors.setStatus('current')
ap64ether_stats_undersize_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsUndersizePkts.setStatus('current')
ap64ether_stats_oversize_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsOversizePkts.setStatus('current')
ap64ether_stats_fragments = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsFragments.setStatus('current')
ap64ether_stats_jabbers = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsJabbers.setStatus('current')
ap64ether_stats_collisions = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 13), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsCollisions.setStatus('current')
ap64ether_stats_pkts64_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 14), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsPkts64Octets.setStatus('current')
ap64ether_stats_pkts65to127_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 15), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsPkts65to127Octets.setStatus('current')
ap64ether_stats_pkts128to255_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 16), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsPkts128to255Octets.setStatus('current')
ap64ether_stats_pkts256to511_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 17), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsPkts256to511Octets.setStatus('current')
ap64ether_stats_pkts512to1023_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 18), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsPkts512to1023Octets.setStatus('current')
ap64ether_stats_pkts1024to1518_octets = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 19), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsPkts1024to1518Octets.setStatus('current')
ap64ether_stats_owner = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 20), owner_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsOwner.setStatus('current')
ap64ether_stats_status = mib_table_column((1, 3, 6, 1, 4, 1, 2467, 1, 44, 4, 1, 21), entry_status()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ap64etherStatsStatus.setStatus('current')
mibBuilder.exportSymbols('AP64STATS-MIB', ap64etherStatsPkts64Octets=ap64etherStatsPkts64Octets, ap64etherStatsIndex=ap64etherStatsIndex, ap64etherStatsStatus=ap64etherStatsStatus, ap64etherStatsJabbers=ap64etherStatsJabbers, ap64ifInNUcastPkts=ap64ifInNUcastPkts, ap64etherStatsCollisions=ap64etherStatsCollisions, ap64dot3StatsInternalMacReceiveErrors=ap64dot3StatsInternalMacReceiveErrors, ap64dot3StatsExcessiveCollisions=ap64dot3StatsExcessiveCollisions, ap64ifLastChange=ap64ifLastChange, ap64ifOutDiscards=ap64ifOutDiscards, ap64ifMtu=ap64ifMtu, ap64ifInUcastPkts=ap64ifInUcastPkts, ap64ifInErrors=ap64ifInErrors, ap64dot3StatsIndex=ap64dot3StatsIndex, ap64etherStatsPkts=ap64etherStatsPkts, PYSNMP_MODULE_ID=ap64StatsMib, ap64etherStatsOwner=ap64etherStatsOwner, ap64dot3StatsSingleCollisionFrames=ap64dot3StatsSingleCollisionFrames, ap64ifInDiscards=ap64ifInDiscards, OwnerString=OwnerString, ap64etherStatsPkts128to255Octets=ap64etherStatsPkts128to255Octets, ap64ifSpecific=ap64ifSpecific, ap64etherStatsEntry=ap64etherStatsEntry, ap64ifType=ap64ifType, ap64ifOutOctets=ap64ifOutOctets, ap64etherStatsDropEvents=ap64etherStatsDropEvents, ap64etherStatsOversizePkts=ap64etherStatsOversizePkts, ap64StatsMib=ap64StatsMib, ap64ifAdminStatus=ap64ifAdminStatus, ap64ifOutErrors=ap64ifOutErrors, ap64dot3StatsLateCollisions=ap64dot3StatsLateCollisions, ap64etherStatsPkts512to1023Octets=ap64etherStatsPkts512to1023Octets, ap64dot3StatsTable=ap64dot3StatsTable, PhysAddress=PhysAddress, ap64ifOperStatus=ap64ifOperStatus, ap64dot3StatsMultipleCollisionFrames=ap64dot3StatsMultipleCollisionFrames, ap64ifEntry=ap64ifEntry, ap64dot3StatsAlignmentErrors=ap64dot3StatsAlignmentErrors, ap64ifOutNUcastPkts=ap64ifOutNUcastPkts, ap64ifSpeed=ap64ifSpeed, ap64dot3StatsFrameTooLongs=ap64dot3StatsFrameTooLongs, ap64etherStatsPkts1024to1518Octets=ap64etherStatsPkts1024to1518Octets, ap64dot3StatsSQETestErrors=ap64dot3StatsSQETestErrors, ap64dot3StatsInternalMacTransmitErrors=ap64dot3StatsInternalMacTransmitErrors, ap64etherStatsMulticastPkts=ap64etherStatsMulticastPkts, ap64etherStatsDataSource=ap64etherStatsDataSource, ap64ifDescr=ap64ifDescr, ap64etherStatsTable=ap64etherStatsTable, ap64etherStatsOctets=ap64etherStatsOctets, ap64etherStatsCRCAlignErrors=ap64etherStatsCRCAlignErrors, ap64etherStatsPkts65to127Octets=ap64etherStatsPkts65to127Octets, ap64ifOutUcastPkts=ap64ifOutUcastPkts, ap64etherStatsFragments=ap64etherStatsFragments, EntryStatus=EntryStatus, ap64dot3StatsDeferredTransmissions=ap64dot3StatsDeferredTransmissions, ap64ifInOctets=ap64ifInOctets, ap64etherStatsUndersizePkts=ap64etherStatsUndersizePkts, ap64dot3StatsFCSErrors=ap64dot3StatsFCSErrors, ap64dot3StatsCarrierSenseErrors=ap64dot3StatsCarrierSenseErrors, ap64ifTable=ap64ifTable, ap64ifOutQLen=ap64ifOutQLen, ap64etherStatsBroadcastPkts=ap64etherStatsBroadcastPkts, ap64ifPhysAddress=ap64ifPhysAddress, ap64etherStatsPkts256to511Octets=ap64etherStatsPkts256to511Octets, ap64dot3StatsEntry=ap64dot3StatsEntry, ap64ifInUnknownProtos=ap64ifInUnknownProtos, ap64ifIndex=ap64ifIndex) |
#!/usr/bin/env python
# encoding: utf-8
'''
@author: Jason Lee
@license: (C) Copyright @ Jason Lee
@contact: jiansenll@163.com
@file: jianzhi_offer_65_1.py
@time: 2019/4/25 15:29
@desc:
'''
class Solution:
def maxInWindows(self, num, size):
if not num or size <= 0:
return []
if size > len(num):
return []
if size == 1:
return num
idx = [] # queue stores index, max value in [0]
res = [] # results
# first size numbers
for i in range(size):
while idx and num[i] >= num[idx[-1]]:
idx.pop()
idx.append(i) # only store index
res.append(num[idx[0]]) # the first max value in the first sliding window
# other numbers
for i in range(size, len(num)):
if idx[0] <= i - size: # index[0] is out of the window
idx.pop(0)
while idx and num[i] >= num[idx[-1]]:
idx.pop()
idx.append(i)
res.append(num[idx[0]])
return res
if __name__ == '__main__':
num = [2,3,4,2,6,2,5,1]
res = Solution()
a = res.maxInWindows(num, 3)
print(a)
| """
@author: Jason Lee
@license: (C) Copyright @ Jason Lee
@contact: jiansenll@163.com
@file: jianzhi_offer_65_1.py
@time: 2019/4/25 15:29
@desc:
"""
class Solution:
def max_in_windows(self, num, size):
if not num or size <= 0:
return []
if size > len(num):
return []
if size == 1:
return num
idx = []
res = []
for i in range(size):
while idx and num[i] >= num[idx[-1]]:
idx.pop()
idx.append(i)
res.append(num[idx[0]])
for i in range(size, len(num)):
if idx[0] <= i - size:
idx.pop(0)
while idx and num[i] >= num[idx[-1]]:
idx.pop()
idx.append(i)
res.append(num[idx[0]])
return res
if __name__ == '__main__':
num = [2, 3, 4, 2, 6, 2, 5, 1]
res = solution()
a = res.maxInWindows(num, 3)
print(a) |
n=int(input("Enter the number : "))
sum=0
order=len(str(n))
copy_n=n
while(n>0):
digit=n%10
sum+=digit**order
n=n//10
if(sum==copy_n):
print(f"{copy_n} is an armstrong number")
else:
print(f"{copy_n} is not an armstrong number")
| n = int(input('Enter the number : '))
sum = 0
order = len(str(n))
copy_n = n
while n > 0:
digit = n % 10
sum += digit ** order
n = n // 10
if sum == copy_n:
print(f'{copy_n} is an armstrong number')
else:
print(f'{copy_n} is not an armstrong number') |
a = True
while a:
if(not a):
a = get()
else:
execute(b)
a = execute(mogrify(a)) | a = True
while a:
if not a:
a = get()
else:
execute(b)
a = execute(mogrify(a)) |
# Features used in this test:
#https://www.openstreetmap.org/way/316623706
#https://www.openstreetmap.org/way/343269426
#https://www.openstreetmap.org/way/370123970
#https://www.openstreetmap.org/way/84422829
#https://www.openstreetmap.org/way/316623706
#https://www.openstreetmap.org/way/343269426
#https://www.openstreetmap.org/way/370123970
#https://www.openstreetmap.org/way/84422829
#https://www.openstreetmap.org/way/103256220
# expect these features in _both_ the landuse and POIs layers.
for layer in ['pois', 'landuse']:
# whitelist zoo values
zoo_values = [
(17, 22916, 43711, 316623706, 'enclosure'), # Bear Enclosure (presumably + woods=yes?)
(17, 41926, 47147, 343269426, 'petting_zoo'), # Oaklawn Farm Zoo
(17, 20927, 45938, 370123970, 'aviary'), # Budgie Buddies
(17, 42457, 47102, 84422829, 'wildlife_park') # Shubenacadie Provincial Wildlife Park
]
for z, x, y, osm_id, zoo in zoo_values:
assert_has_feature(
z, x, y, layer,
{ 'id': osm_id,
'kind': zoo })
# this is a building, so won't show up in landuse. still should be a POI.
# Wings of Asia
assert_has_feature(
17, 36263, 55884, 'pois',
{ 'id': 103256220,
'kind': 'aviary' })
| for layer in ['pois', 'landuse']:
zoo_values = [(17, 22916, 43711, 316623706, 'enclosure'), (17, 41926, 47147, 343269426, 'petting_zoo'), (17, 20927, 45938, 370123970, 'aviary'), (17, 42457, 47102, 84422829, 'wildlife_park')]
for (z, x, y, osm_id, zoo) in zoo_values:
assert_has_feature(z, x, y, layer, {'id': osm_id, 'kind': zoo})
assert_has_feature(17, 36263, 55884, 'pois', {'id': 103256220, 'kind': 'aviary'}) |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Maintainer: Jonathan Lange
"""
Asynchronous unit testing framework.
Trial extends Python's builtin C{unittest} to provide support for asynchronous
tests.
Maintainer: Jonathan Lange
Trial strives to be compatible with other Python xUnit testing frameworks.
"Compatibility" is a difficult things to define. In practice, it means that:
- L{twisted.trial.unittest.TestCase} objects should be able to be used by
other test runners without those runners requiring special support for
Trial tests.
- Tests that subclass the standard library C{TestCase} and don't do anything
"too weird" should be able to be discoverable and runnable by the Trial
test runner without the authors of those tests having to jump through
hoops.
- Tests that implement the interface provided by the standard library
C{TestCase} should be runnable by the Trial runner.
- The Trial test runner and Trial L{unittest.TestCase} objects ought to be
able to use standard library C{TestResult} objects, and third party
C{TestResult} objects based on the standard library.
This list is not necessarily exhaustive -- compatibility is hard to define.
Contributors who discover more helpful ways of defining compatibility are
encouraged to update this document.
Examples:
B{Timeouts} for tests should be implemented in the runner. If this is done,
then timeouts could work for third-party TestCase objects as well as for
L{twisted.trial.unittest.TestCase} objects. Further, Twisted C{TestCase}
objects will run in other runners without timing out.
See U{http://twistedmatrix.com/trac/ticket/2675}.
Running tests in a temporary directory should be a feature of the test case,
because often tests themselves rely on this behaviour. If the feature is
implemented in the runner, then tests will change behaviour (possibly
breaking) when run in a different test runner. Further, many tests don't even
care about the filesystem.
See U{http://twistedmatrix.com/trac/ticket/2916}.
"""
| """
Asynchronous unit testing framework.
Trial extends Python's builtin C{unittest} to provide support for asynchronous
tests.
Maintainer: Jonathan Lange
Trial strives to be compatible with other Python xUnit testing frameworks.
"Compatibility" is a difficult things to define. In practice, it means that:
- L{twisted.trial.unittest.TestCase} objects should be able to be used by
other test runners without those runners requiring special support for
Trial tests.
- Tests that subclass the standard library C{TestCase} and don't do anything
"too weird" should be able to be discoverable and runnable by the Trial
test runner without the authors of those tests having to jump through
hoops.
- Tests that implement the interface provided by the standard library
C{TestCase} should be runnable by the Trial runner.
- The Trial test runner and Trial L{unittest.TestCase} objects ought to be
able to use standard library C{TestResult} objects, and third party
C{TestResult} objects based on the standard library.
This list is not necessarily exhaustive -- compatibility is hard to define.
Contributors who discover more helpful ways of defining compatibility are
encouraged to update this document.
Examples:
B{Timeouts} for tests should be implemented in the runner. If this is done,
then timeouts could work for third-party TestCase objects as well as for
L{twisted.trial.unittest.TestCase} objects. Further, Twisted C{TestCase}
objects will run in other runners without timing out.
See U{http://twistedmatrix.com/trac/ticket/2675}.
Running tests in a temporary directory should be a feature of the test case,
because often tests themselves rely on this behaviour. If the feature is
implemented in the runner, then tests will change behaviour (possibly
breaking) when run in a different test runner. Further, many tests don't even
care about the filesystem.
See U{http://twistedmatrix.com/trac/ticket/2916}.
""" |
#symbol
symbol = {
'PAD': 0,
'A': 1,
'T': 2,
'C': 3,
'G': 4,
'LOST': 5,
'CLS': 6,
'MASK': 7
}
vocab_size = len(symbol)
#pre-train
embed_len = 256
context_len = 512
lm_input_len = 2 * context_len + 2
drop_1_prob = 0.1
drop_1_ratio = 0.2
drop_x_prob = 0.15
drop_x_ratio = 0.4
lm_heads_num = 8
lm_trans_num = 8
lm_hidden_num = 256
lm_linear_dropout = 0.5
lm_batch = 4
data_queue_max = 4096
lm_step_samples = 1024
lm_show_samples = 1024
lm_save_samples = 102400 # 1000000
pre_lr = 1e-4
lm_model_out = './lm.pth'
lm_record_out = './lm.rec'
#access-train
dna_least_len = 50
test_ratio = 0.1
valid_ratio = 0.05
access_heads_num = 4
access_trans_num = 2
access_hidden_dim = lm_hidden_num
access_linear_dropout = 0.5
access_lr = 2e-5
#MT MU NO NP PC PH
access_data_name = 'SNEDE0000EPC'
access_model_out = './PC.pth'
dna_len = 767
access_epochs = 5
access_input_len = dna_len + 1
access_batch = 64 | symbol = {'PAD': 0, 'A': 1, 'T': 2, 'C': 3, 'G': 4, 'LOST': 5, 'CLS': 6, 'MASK': 7}
vocab_size = len(symbol)
embed_len = 256
context_len = 512
lm_input_len = 2 * context_len + 2
drop_1_prob = 0.1
drop_1_ratio = 0.2
drop_x_prob = 0.15
drop_x_ratio = 0.4
lm_heads_num = 8
lm_trans_num = 8
lm_hidden_num = 256
lm_linear_dropout = 0.5
lm_batch = 4
data_queue_max = 4096
lm_step_samples = 1024
lm_show_samples = 1024
lm_save_samples = 102400
pre_lr = 0.0001
lm_model_out = './lm.pth'
lm_record_out = './lm.rec'
dna_least_len = 50
test_ratio = 0.1
valid_ratio = 0.05
access_heads_num = 4
access_trans_num = 2
access_hidden_dim = lm_hidden_num
access_linear_dropout = 0.5
access_lr = 2e-05
access_data_name = 'SNEDE0000EPC'
access_model_out = './PC.pth'
dna_len = 767
access_epochs = 5
access_input_len = dna_len + 1
access_batch = 64 |
report = {
"Water": 300,
"Milk": 200,
"Coffee": 100,
"Money": 0,
}
prices = {
"espresso": 1.50,
"latte": 2.50,
"cappuccino": 3.00,
}
ingredients = {
"espresso": {"Water": 50, "Coffee": 18,},
"latte": {"Water": 200, "Coffee": 24, "Milk": 150,},
"cappuccino": {"Water": 250, "Coffee": 24, "Milk": 100,},
}
def get_coffee(coffee_type):
global report
global num_pennies
global num_nickels
global num_dimes
global num_quarters
print("Please enter the coins.")
try:
num_quarters = int(input("Quarters: "))
num_dimes = int(input("Dimes: "))
num_nickels = int(input("Nickels: "))
num_pennies = int(input("Pennies: "))
except ValueError:
num_quarters = 0
num_dimes = 0
num_nickels = 0
num_pennies = 0
total_money = num_quarters * 0.25 + num_dimes * 0.10 + num_nickels * 0.05 + num_pennies * 0.01
if total_money > prices[coffee_type]:
print(f"Here is your change: ${round(total_money - 1.50, 2)}.")
print(f"Here is your espresso.\nEnjoy!")
report["Water"] -= ingredients[coffee_type]["Water"]
report["Coffee"] -= ingredients[coffee_type]["Coffee"]
report["Money"] += prices[coffee_type]
try:
report["Milk"] -= ingredients[coffee_type]["Milk"]
except KeyError:
pass
else:
print("That is not enough money.")
while True:
the_input = input("What would you like? "
"Type 'report' for a list of the resources. "
"Type 'restock' to reload the resources. (espresso/latte/cappuccino/report/restock): ")
the_input = the_input.lower()
if the_input == 'report':
print(f"Water: {report['Water']}ml\n"
f"Milk: {report['Milk']}ml\n"
f"Coffee: {report['Coffee']}g\n"
f"Money: ${report['Money']}")
elif the_input == 'restock':
print("Resources restocked.")
report["Milk"] += 500
report["Water"] += 500
report["Coffee"] += 100
elif the_input == "espresso":
if report["Water"] < 50:
print("There isn't enough water.")
exit()
elif report["Coffee"] < 18:
print("There isn't enough coffee.")
exit()
get_coffee("espresso")
elif the_input == "latte":
if report["Water"] < 200:
print("There isn't enough water.")
exit()
elif report["Coffee"] < 24:
print("There isn't enough coffee.")
exit()
elif report["Milk"] < 150:
print("There isn't enough milk.")
exit()
get_coffee("latte")
elif the_input == "cappuccino":
if report["Water"] < 250:
print("There isn't enough water.")
exit()
elif report["Coffee"] < 24:
print("There isn't enough coffee.")
exit()
elif report["Milk"] < 100:
print("There isn't enough milk.")
exit()
get_coffee("cappuccino")
elif the_input == "exit":
print("Goodbye")
exit()
else:
print("That is not a coffee.")
| report = {'Water': 300, 'Milk': 200, 'Coffee': 100, 'Money': 0}
prices = {'espresso': 1.5, 'latte': 2.5, 'cappuccino': 3.0}
ingredients = {'espresso': {'Water': 50, 'Coffee': 18}, 'latte': {'Water': 200, 'Coffee': 24, 'Milk': 150}, 'cappuccino': {'Water': 250, 'Coffee': 24, 'Milk': 100}}
def get_coffee(coffee_type):
global report
global num_pennies
global num_nickels
global num_dimes
global num_quarters
print('Please enter the coins.')
try:
num_quarters = int(input('Quarters: '))
num_dimes = int(input('Dimes: '))
num_nickels = int(input('Nickels: '))
num_pennies = int(input('Pennies: '))
except ValueError:
num_quarters = 0
num_dimes = 0
num_nickels = 0
num_pennies = 0
total_money = num_quarters * 0.25 + num_dimes * 0.1 + num_nickels * 0.05 + num_pennies * 0.01
if total_money > prices[coffee_type]:
print(f'Here is your change: ${round(total_money - 1.5, 2)}.')
print(f'Here is your espresso.\nEnjoy!')
report['Water'] -= ingredients[coffee_type]['Water']
report['Coffee'] -= ingredients[coffee_type]['Coffee']
report['Money'] += prices[coffee_type]
try:
report['Milk'] -= ingredients[coffee_type]['Milk']
except KeyError:
pass
else:
print('That is not enough money.')
while True:
the_input = input("What would you like? Type 'report' for a list of the resources. Type 'restock' to reload the resources. (espresso/latte/cappuccino/report/restock): ")
the_input = the_input.lower()
if the_input == 'report':
print(f"Water: {report['Water']}ml\nMilk: {report['Milk']}ml\nCoffee: {report['Coffee']}g\nMoney: ${report['Money']}")
elif the_input == 'restock':
print('Resources restocked.')
report['Milk'] += 500
report['Water'] += 500
report['Coffee'] += 100
elif the_input == 'espresso':
if report['Water'] < 50:
print("There isn't enough water.")
exit()
elif report['Coffee'] < 18:
print("There isn't enough coffee.")
exit()
get_coffee('espresso')
elif the_input == 'latte':
if report['Water'] < 200:
print("There isn't enough water.")
exit()
elif report['Coffee'] < 24:
print("There isn't enough coffee.")
exit()
elif report['Milk'] < 150:
print("There isn't enough milk.")
exit()
get_coffee('latte')
elif the_input == 'cappuccino':
if report['Water'] < 250:
print("There isn't enough water.")
exit()
elif report['Coffee'] < 24:
print("There isn't enough coffee.")
exit()
elif report['Milk'] < 100:
print("There isn't enough milk.")
exit()
get_coffee('cappuccino')
elif the_input == 'exit':
print('Goodbye')
exit()
else:
print('That is not a coffee.') |
class IncompatibleStateToRuleException(RuntimeError):
def __init__(self):
RuntimeError.__init__(self, "State incompatible to any rule from grammar.")
| class Incompatiblestatetoruleexception(RuntimeError):
def __init__(self):
RuntimeError.__init__(self, 'State incompatible to any rule from grammar.') |
class NoOpTrainer(object):
def train(self,batcher,dir,dev_batcher):
pass | class Nooptrainer(object):
def train(self, batcher, dir, dev_batcher):
pass |
"""
"""
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load("@bazelrio//:deps.bzl", "setup_bazelrio_dependencies")
load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@rules_pmd//pmd:toolchains.bzl", "rules_pmd_toolchains")
load("@rules_python//python:pip.bzl", "pip_install")
def activate_dependencies():
"""
Final step of dependencies initialization. Does the various installation steps (pip_install, maven_intstall, etc)
"""
PMD_VERSION = "6.39.0"
rules_pmd_toolchains(pmd_version = PMD_VERSION)
pip_install(
name = "gos_pip_deps",
requirements = "//:requirements.txt",
)
pip_install(
name = "__bazelrio_deploy_pip_deps",
requirements = "@bazelrio//scripts/deploy:requirements.txt",
)
setup_bazelrio_dependencies()
jvm_maven_import_external(
name = "snobot_sim",
artifact = "org.snobotv2:snobot_sim_java:2022.2.2.0",
artifact_sha256 = "656a265bd7cc7eb3035341a7880ce24940b4afcec184123247774c3511872e9b",
server_urls = ["https://raw.githubusercontent.com/snobotsim/maven_repo/master/release"],
)
maven_install(
name = "maven",
artifacts = [
"com.google.guava:guava:21.0",
"org.fxmisc.easybind:easybind:1.0.3",
"junit:junit:4.12",
"org.ejml:ejml-simple:0.38",
],
repositories = ["https://repo1.maven.org/maven2", "http://raw.githubusercontent.com/snobotsim/maven_repo/master/development"],
maven_install_json = "//build_scripts/bazel/deps:maven_install.json",
)
# Separate this because the maven_install_json doesn't download other OS native files
maven_install(
name = "maven_javafx",
artifacts = [
"org.openjfx:javafx-base:11",
"org.openjfx:javafx-controls:11",
"org.openjfx:javafx-fxml:11",
"org.openjfx:javafx-graphics:11",
"org.openjfx:javafx-swing:11",
"org.openjfx:javafx-media:11",
"org.openjfx:javafx-web:11",
],
repositories = [
"https://repo1.maven.org/maven2",
"https://repo.maven.apache.org/maven2/",
],
)
| """
"""
load('@bazel_tools//tools/build_defs/repo:jvm.bzl', 'jvm_maven_import_external')
load('@bazelrio//:deps.bzl', 'setup_bazelrio_dependencies')
load('@rules_jvm_external//:defs.bzl', 'maven_install')
load('@rules_pmd//pmd:toolchains.bzl', 'rules_pmd_toolchains')
load('@rules_python//python:pip.bzl', 'pip_install')
def activate_dependencies():
"""
Final step of dependencies initialization. Does the various installation steps (pip_install, maven_intstall, etc)
"""
pmd_version = '6.39.0'
rules_pmd_toolchains(pmd_version=PMD_VERSION)
pip_install(name='gos_pip_deps', requirements='//:requirements.txt')
pip_install(name='__bazelrio_deploy_pip_deps', requirements='@bazelrio//scripts/deploy:requirements.txt')
setup_bazelrio_dependencies()
jvm_maven_import_external(name='snobot_sim', artifact='org.snobotv2:snobot_sim_java:2022.2.2.0', artifact_sha256='656a265bd7cc7eb3035341a7880ce24940b4afcec184123247774c3511872e9b', server_urls=['https://raw.githubusercontent.com/snobotsim/maven_repo/master/release'])
maven_install(name='maven', artifacts=['com.google.guava:guava:21.0', 'org.fxmisc.easybind:easybind:1.0.3', 'junit:junit:4.12', 'org.ejml:ejml-simple:0.38'], repositories=['https://repo1.maven.org/maven2', 'http://raw.githubusercontent.com/snobotsim/maven_repo/master/development'], maven_install_json='//build_scripts/bazel/deps:maven_install.json')
maven_install(name='maven_javafx', artifacts=['org.openjfx:javafx-base:11', 'org.openjfx:javafx-controls:11', 'org.openjfx:javafx-fxml:11', 'org.openjfx:javafx-graphics:11', 'org.openjfx:javafx-swing:11', 'org.openjfx:javafx-media:11', 'org.openjfx:javafx-web:11'], repositories=['https://repo1.maven.org/maven2', 'https://repo.maven.apache.org/maven2/']) |
SERIES_URL = 'https://api.themoviedb.org/3/tv/popular?language=en-US'
GENRE_SERIES_URL = 'https://api.themoviedb.org/3/genre/tv/list?language=en-US'
GENRE_MOVIES_URL = 'https://api.themoviedb.org/3/genre/movie/list?language=en-US'
paramAPI = '&api_key='
paramPage = '&page='
| series_url = 'https://api.themoviedb.org/3/tv/popular?language=en-US'
genre_series_url = 'https://api.themoviedb.org/3/genre/tv/list?language=en-US'
genre_movies_url = 'https://api.themoviedb.org/3/genre/movie/list?language=en-US'
param_api = '&api_key='
param_page = '&page=' |
"""
A jyotiSha computation package!
A note on time: We internally use julian dates in the UTC time scale (See wiki article: https://en.wikipedia.org/wiki/Time_standard ). This is different from the Terrestrial time (TT), which contuines from the former Ephemeris time(ET) standard.
Note on swiss ephemeris API: Please don't call it directly - there should always a layer inbetween the ephemeris API and our logic. This wrapper layer is located in the packages temporal, spatio_temporal, graha and zodiac. Using this wrapper allows us to easily adjust to ephemeris API changes, and to ensure correctness (eg. sending time in UTC rather than ET time scale).
Note on storing variables: Please remember that most objects here (including panchAnga-s) are serialized as JSON objects. That means that you CANNOT (re)store python dictionaries with numeric keys. Please don't do that. Use plain arrays of arrays if you must.
Note on core vs peripheral parts of the code: Please don't put your custom tex/ md/ ics whatever code in core code and pollute core library functions. Wrap them in your own functions if you must. Functions should be atomic.
"""
| """
A jyotiSha computation package!
A note on time: We internally use julian dates in the UTC time scale (See wiki article: https://en.wikipedia.org/wiki/Time_standard ). This is different from the Terrestrial time (TT), which contuines from the former Ephemeris time(ET) standard.
Note on swiss ephemeris API: Please don't call it directly - there should always a layer inbetween the ephemeris API and our logic. This wrapper layer is located in the packages temporal, spatio_temporal, graha and zodiac. Using this wrapper allows us to easily adjust to ephemeris API changes, and to ensure correctness (eg. sending time in UTC rather than ET time scale).
Note on storing variables: Please remember that most objects here (including panchAnga-s) are serialized as JSON objects. That means that you CANNOT (re)store python dictionaries with numeric keys. Please don't do that. Use plain arrays of arrays if you must.
Note on core vs peripheral parts of the code: Please don't put your custom tex/ md/ ics whatever code in core code and pollute core library functions. Wrap them in your own functions if you must. Functions should be atomic.
""" |
# See http://webpython.codepoint.net/mod_python_publisher_uri_traversal
s = """\
<html><body>
<h2>Hello %s!</h2>
</body></html>
"""
def index():
return s % 'World'
def everybody():
return s % 'everybody'
| s = '<html><body>\n<h2>Hello %s!</h2>\n</body></html>\n'
def index():
return s % 'World'
def everybody():
return s % 'everybody' |
class numtup(tuple):
def __add__(self, other):
if isinstance(other, tuple):
assert len(self) == len(other)
return numtup(lhs + rhs for lhs, rhs in zip(self, other))
return numtup(lhs + other for lhs in self)
def __mul__(self, other):
if isinstance(other, tuple):
assert len(self) == len(other)
return numtup(lhs * rhs for lhs, rhs in zip(self, other))
return numtup(lhs * other for lhs in self)
| class Numtup(tuple):
def __add__(self, other):
if isinstance(other, tuple):
assert len(self) == len(other)
return numtup((lhs + rhs for (lhs, rhs) in zip(self, other)))
return numtup((lhs + other for lhs in self))
def __mul__(self, other):
if isinstance(other, tuple):
assert len(self) == len(other)
return numtup((lhs * rhs for (lhs, rhs) in zip(self, other)))
return numtup((lhs * other for lhs in self)) |
# FIND THE DUPLICATE NUMBER LEETCODE SOLUTION:
# creating a class.
class Solution(object):
# creating a function to solve the problem.
def findDuplicate(self, nums):
# creating an iterable set.
elements = set()
# creating a for-loop to iterate for the elements in the list.
for i in nums:
# creating a nested if-statement to find the duplicated in the list.
if i not in elements:
# if the element is not initially present, we add it to the iterable set.
elements.add(i)
# creating an if-statement for returning the element if it is found more than once.
else:
# returning the element found more than once if the condition is met.
return i
| class Solution(object):
def find_duplicate(self, nums):
elements = set()
for i in nums:
if i not in elements:
elements.add(i)
else:
return i |
# -*- coding: utf-8 -*-
# This Python file uses the following encoding: utf-8
"""
> db.persons.findOne()
{
"_id" : "P_55",
"name" : "Anna Margaretha* /Falkengren/",
"sex" : "F",
"grpNameGiven" : "704 6942",
"grpNameLast" : "4419",
"death" : {
"date" : "17640827",
"source" : "*1 Klinte CI:2, Sidan 195",
"quality": 1,
"tag" : "BURI",
"place" : "Klinte (I)",
"normPlaceUid" : "1675"
},
"birth" : < EVENT - same as death>,
"type" : "person",
"refId" : "I1223"
}
> db.families.findOne()
{
"_id" : "F_19",
"marriage" : < EVENT >,
"type" : "family",
"refId" : "F01"
}
> db.relations.findOne()
{
"_id" : ObjectId("59bf643db75a5412169767d6"),
"famId" : "F_47",
"persId" : "P_123",
"relTyp" : "husb" #can be child, husb, wife
}
> db.originalData.findOne({'type': 'person'})
{
"_id" : ObjectId("59d47b1fb75a541d97959d63"),
"recordId" : "P_270",
"type" : "person",
"data" : [ {
"contributionId" : "A_31",
"record" : <person-record for _id P_270>,
"gedcom" : "0 @I1223@ INDI\n1 SEX F\n1 NAME Anna Margaretha* /Falkengren/\n1 BIRT\n2 DATE 15 JUN 1705\n2 SOUR Fardhem AI:2 (1751-1769) Bild 430 / sid 37\n1 DEAT\n2 DATE 27 AUG 1764\n2 PLAC Klinte (I)\n2 SOUR Klinte CI:2 (1758-1828) Bild 1020 / sid 195 (AID: v61999.b1020.s195, NAD: SE/ViLA/23050)\n1 FAMS @F01@\n1 CHAN\n2 DATE 29 AUG 2017\n3 TIME 11:59:00"
} ]
}
> db.originalData.findOne({'type': 'family'})
{
"_id" : ObjectId("59d47b1fb75a541d97959d74"),
"recordId" : "F_117",
"type" : "family",
"relation" : [
<relation-record with "famId": "F_117">,
<relation-record with "famId": "F_117">,
...
],
"data" : [ {
"contributionId" : "A_31",
"record" : <family-record with id F_117>,
"gedcom" : "0 @F01@ FAM\n1 MARR\n2 SOUR Visby Stifts Herdaminne\n1 HUSB @A_31-I5115@\n1 WIFE @A_31-I1223@\n1 CHIL @I78017@\n1 CHIL @I1705@\n1 CHIL @I78016@\n1 CHIL @I1798@\n1 CHIL @I2137@\n1 CHAN\n2 DATE 29 AUG 2017\n3 TIME 11:28:00"
} ],
}
??
> db.matches_admin_P.findOne()
{
"_id" : ObjectId("59bec3ccb75a540d58761efa"),
"status" : "rOK",
"matchid" : "P_68",
"workid" : "P_55",
"score" : 10.606552124023438,
"familysim" : 0,
"nodesim" : 0.8333333333333334,
"cosScore" : 0.6689936080056726,
"svmscore" : 0.9999973174618935
}
> db.fam_matches_admin_P.findOne()
{
"_id" : ObjectId("59bec3ccb75a540d58761f0c"),
"status" : "FamEjOK",
"matchRefId" : "gedcom_F01",
"workRefId" : "gedcom_F04",
"wife" : <match-record>,
"matchid" : "F_23",
"workid" : "F_22",
"summary" : {
"status" : "Manuell",
"husb" : "Match",
"children" : [ ],
"wife" : "EjMatch"
},
"husb" : <match-record>,
"children" : [
{
<match-record>,
"sort" : "0", !!KOLLA!!
},
{
"status" : "",
"sort" : "17340721",
"pwork" : <person-record>, #or pmatch
"workid" : "P_64"
},
]
}
"""
#rename to getFamily
def getFamilyFromChild(childId, familyDB, relationsDB):
"""
Build a full family record (husb,wife,marriage,children)
from a person record where person is child in the family
"""
family = relationsDB.find_one({'relTyp': 'child', 'persId': childId})
if family:
return getFamilyFromId(family['famId'], familyDB, relationsDB)
else:
return None
"""
if family:
famRecord = familyDB.find_one({'_id': family['famId']})
famRecord['children'] = []
for member in relationsDB.find({'famId': family['famId']}):
if member['relTyp'] == 'child': famRecord['children'].append(member['persId'])
else: famRecord[member['relTyp']] = member['persId']
#if 'husb' in member: famRecord['husb'] = member['husb']
#elif 'wife' in member: famRecord['wife'] = member['wife']
#elif 'child' in member: famRecord['children'].append(member['child'])
return famRecord
else: return None
"""
def getFamilyFromId(famId, familyDB, relationsDB):
"""
Build a full family record (husb,wife,marriage,children)
from a familyId
"""
famRecord = familyDB.find_one({'_id': famId})
if famRecord is None: return None
famRecord['husb'] = None
famRecord['wife'] = None
famRecord['children'] = []
for member in relationsDB.find({'famId': famRecord['_id']}):
if member['relTyp'] == 'child': famRecord['children'].append(member['persId'])
else: famRecord[member['relTyp']] = member['persId']
#if 'husb' in member: famRecord['husb'] = member['husb']
#elif 'wife' in member: famRecord['wife'] = member['wife']
#elif 'child' in member: famRecord['children'].append(member['child'])
return famRecord
| """
> db.persons.findOne()
{
"_id" : "P_55",
"name" : "Anna Margaretha* /Falkengren/",
"sex" : "F",
"grpNameGiven" : "704 6942",
"grpNameLast" : "4419",
"death" : {
"date" : "17640827",
"source" : "*1 Klinte CI:2, Sidan 195",
"quality": 1,
"tag" : "BURI",
"place" : "Klinte (I)",
"normPlaceUid" : "1675"
},
"birth" : < EVENT - same as death>,
"type" : "person",
"refId" : "I1223"
}
> db.families.findOne()
{
"_id" : "F_19",
"marriage" : < EVENT >,
"type" : "family",
"refId" : "F01"
}
> db.relations.findOne()
{
"_id" : ObjectId("59bf643db75a5412169767d6"),
"famId" : "F_47",
"persId" : "P_123",
"relTyp" : "husb" #can be child, husb, wife
}
> db.originalData.findOne({'type': 'person'})
{
"_id" : ObjectId("59d47b1fb75a541d97959d63"),
"recordId" : "P_270",
"type" : "person",
"data" : [ {
"contributionId" : "A_31",
"record" : <person-record for _id P_270>,
"gedcom" : "0 @I1223@ INDI
1 SEX F
1 NAME Anna Margaretha* /Falkengren/
1 BIRT
2 DATE 15 JUN 1705
2 SOUR Fardhem AI:2 (1751-1769) Bild 430 / sid 37
1 DEAT
2 DATE 27 AUG 1764
2 PLAC Klinte (I)
2 SOUR Klinte CI:2 (1758-1828) Bild 1020 / sid 195 (AID: v61999.b1020.s195, NAD: SE/ViLA/23050)
1 FAMS @F01@
1 CHAN
2 DATE 29 AUG 2017
3 TIME 11:59:00"
} ]
}
> db.originalData.findOne({'type': 'family'})
{
"_id" : ObjectId("59d47b1fb75a541d97959d74"),
"recordId" : "F_117",
"type" : "family",
"relation" : [
<relation-record with "famId": "F_117">,
<relation-record with "famId": "F_117">,
...
],
"data" : [ {
"contributionId" : "A_31",
"record" : <family-record with id F_117>,
"gedcom" : "0 @F01@ FAM
1 MARR
2 SOUR Visby Stifts Herdaminne
1 HUSB @A_31-I5115@
1 WIFE @A_31-I1223@
1 CHIL @I78017@
1 CHIL @I1705@
1 CHIL @I78016@
1 CHIL @I1798@
1 CHIL @I2137@
1 CHAN
2 DATE 29 AUG 2017
3 TIME 11:28:00"
} ],
}
??
> db.matches_admin_P.findOne()
{
"_id" : ObjectId("59bec3ccb75a540d58761efa"),
"status" : "rOK",
"matchid" : "P_68",
"workid" : "P_55",
"score" : 10.606552124023438,
"familysim" : 0,
"nodesim" : 0.8333333333333334,
"cosScore" : 0.6689936080056726,
"svmscore" : 0.9999973174618935
}
> db.fam_matches_admin_P.findOne()
{
"_id" : ObjectId("59bec3ccb75a540d58761f0c"),
"status" : "FamEjOK",
"matchRefId" : "gedcom_F01",
"workRefId" : "gedcom_F04",
"wife" : <match-record>,
"matchid" : "F_23",
"workid" : "F_22",
"summary" : {
"status" : "Manuell",
"husb" : "Match",
"children" : [ ],
"wife" : "EjMatch"
},
"husb" : <match-record>,
"children" : [
{
<match-record>,
"sort" : "0", !!KOLLA!!
},
{
"status" : "",
"sort" : "17340721",
"pwork" : <person-record>, #or pmatch
"workid" : "P_64"
},
]
}
"""
def get_family_from_child(childId, familyDB, relationsDB):
"""
Build a full family record (husb,wife,marriage,children)
from a person record where person is child in the family
"""
family = relationsDB.find_one({'relTyp': 'child', 'persId': childId})
if family:
return get_family_from_id(family['famId'], familyDB, relationsDB)
else:
return None
"\n if family:\n famRecord = familyDB.find_one({'_id': family['famId']})\n famRecord['children'] = []\n for member in relationsDB.find({'famId': family['famId']}):\n if member['relTyp'] == 'child': famRecord['children'].append(member['persId'])\n else: famRecord[member['relTyp']] = member['persId']\n #if 'husb' in member: famRecord['husb'] = member['husb']\n #elif 'wife' in member: famRecord['wife'] = member['wife']\n #elif 'child' in member: famRecord['children'].append(member['child'])\n return famRecord\n else: return None\n "
def get_family_from_id(famId, familyDB, relationsDB):
"""
Build a full family record (husb,wife,marriage,children)
from a familyId
"""
fam_record = familyDB.find_one({'_id': famId})
if famRecord is None:
return None
famRecord['husb'] = None
famRecord['wife'] = None
famRecord['children'] = []
for member in relationsDB.find({'famId': famRecord['_id']}):
if member['relTyp'] == 'child':
famRecord['children'].append(member['persId'])
else:
famRecord[member['relTyp']] = member['persId']
return famRecord |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"read_headers": "03_convert_files.ipynb",
"parse_header_line": "03_convert_files.ipynb",
"restore_header": "03_convert_files.ipynb",
"read__write_from_sep_sv": "03_convert_files.ipynb",
"run_subprocess": "04_generate_report.ipynb",
"create_base_directories": "02_initalise_repository.ipynb",
"directory_is_empty": "02_initalise_repository.ipynb",
"parse_directory_date_to_datetime": "02_initalise_repository.ipynb",
"datetime_to_timestamp": "02_initalise_repository.ipynb",
"delete_files_in_repository_directory": "02_initalise_repository.ipynb",
"copy_directory_to_directory": "02_initalise_repository.ipynb",
"rename_all_files_in_directory_from_txt_to_csv": "02_initalise_repository.ipynb",
"add_all_new_files_to_respository": "02_initalise_repository.ipynb",
"commit_repository": "02_initalise_repository.ipynb",
"branch_exists": "02_initalise_repository.ipynb",
"create_branch": "02_initalise_repository.ipynb",
"switch_to_branch": "02_initalise_repository.ipynb",
"repository_exists": "02_initalise_repository.ipynb",
"create_repository": "02_initalise_repository.ipynb",
"add_directory_to_repository": "02_initalise_repository.ipynb",
"copy_into_repository": "02_initalise_repository.ipynb",
"write_from_sep_sv": "03_convert_files.ipynb",
"restore_header_in_mem": "03_convert_files.ipynb",
"convert_directory": "03_convert_files.ipynb",
"convert_dirs": "03_convert_files.ipynb",
"get_output_from_cmd": "04_generate_report.ipynb",
"verbose": "04_generate_report.ipynb",
"show_progress": "04_generate_report.ipynb",
"GitRepositoryReader": "04_generate_report.ipynb",
"parse_commitstr_to_datetime": "04_generate_report.ipynb",
"copyfile_fullpath": "04_generate_report.ipynb",
"mkdir_for_fullpath": "04_generate_report.ipynb",
"remove_files_from_output_branch": "04_generate_report.ipynb",
"remove_files_from_output": "04_generate_report.ipynb",
"get_report_name_refs": "04_generate_report.ipynb",
"make_output_directories": "04_generate_report.ipynb",
"get_relative_path": "04_generate_report.ipynb",
"copy_style_and_bootstrap": "04_generate_report.ipynb",
"bootstrap_navbar": "04_generate_report.ipynb",
"header": "04_generate_report.ipynb",
"footer": "04_generate_report.ipynb",
"page": "04_generate_report.ipynb",
"diff2html_template": "04_generate_report.ipynb",
"default_footer": "04_generate_report.ipynb",
"generate_difference_report_page": "04_generate_report.ipynb",
"BranchComparisonReport": "04_generate_report.ipynb",
"FileChangeHistoryReportForBranch": "04_generate_report.ipynb"}
modules = ["csv_header_restore.py",
"convert_to_csv.py",
"initalise_repository.py",
"convert_files.py",
"generate_report.py"]
doc_url = "https://3ideas.github.io/config_tracker/"
git_url = "https://github.com/3ideas/config_tracker/tree/master/"
def custom_doc_links(name): return None
| __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'read_headers': '03_convert_files.ipynb', 'parse_header_line': '03_convert_files.ipynb', 'restore_header': '03_convert_files.ipynb', 'read__write_from_sep_sv': '03_convert_files.ipynb', 'run_subprocess': '04_generate_report.ipynb', 'create_base_directories': '02_initalise_repository.ipynb', 'directory_is_empty': '02_initalise_repository.ipynb', 'parse_directory_date_to_datetime': '02_initalise_repository.ipynb', 'datetime_to_timestamp': '02_initalise_repository.ipynb', 'delete_files_in_repository_directory': '02_initalise_repository.ipynb', 'copy_directory_to_directory': '02_initalise_repository.ipynb', 'rename_all_files_in_directory_from_txt_to_csv': '02_initalise_repository.ipynb', 'add_all_new_files_to_respository': '02_initalise_repository.ipynb', 'commit_repository': '02_initalise_repository.ipynb', 'branch_exists': '02_initalise_repository.ipynb', 'create_branch': '02_initalise_repository.ipynb', 'switch_to_branch': '02_initalise_repository.ipynb', 'repository_exists': '02_initalise_repository.ipynb', 'create_repository': '02_initalise_repository.ipynb', 'add_directory_to_repository': '02_initalise_repository.ipynb', 'copy_into_repository': '02_initalise_repository.ipynb', 'write_from_sep_sv': '03_convert_files.ipynb', 'restore_header_in_mem': '03_convert_files.ipynb', 'convert_directory': '03_convert_files.ipynb', 'convert_dirs': '03_convert_files.ipynb', 'get_output_from_cmd': '04_generate_report.ipynb', 'verbose': '04_generate_report.ipynb', 'show_progress': '04_generate_report.ipynb', 'GitRepositoryReader': '04_generate_report.ipynb', 'parse_commitstr_to_datetime': '04_generate_report.ipynb', 'copyfile_fullpath': '04_generate_report.ipynb', 'mkdir_for_fullpath': '04_generate_report.ipynb', 'remove_files_from_output_branch': '04_generate_report.ipynb', 'remove_files_from_output': '04_generate_report.ipynb', 'get_report_name_refs': '04_generate_report.ipynb', 'make_output_directories': '04_generate_report.ipynb', 'get_relative_path': '04_generate_report.ipynb', 'copy_style_and_bootstrap': '04_generate_report.ipynb', 'bootstrap_navbar': '04_generate_report.ipynb', 'header': '04_generate_report.ipynb', 'footer': '04_generate_report.ipynb', 'page': '04_generate_report.ipynb', 'diff2html_template': '04_generate_report.ipynb', 'default_footer': '04_generate_report.ipynb', 'generate_difference_report_page': '04_generate_report.ipynb', 'BranchComparisonReport': '04_generate_report.ipynb', 'FileChangeHistoryReportForBranch': '04_generate_report.ipynb'}
modules = ['csv_header_restore.py', 'convert_to_csv.py', 'initalise_repository.py', 'convert_files.py', 'generate_report.py']
doc_url = 'https://3ideas.github.io/config_tracker/'
git_url = 'https://github.com/3ideas/config_tracker/tree/master/'
def custom_doc_links(name):
return None |
class Solution:
@staticmethod
def longest_palindromic(s: str) -> str:
pass
def expandAroundCenter (s, left, right):
while left >= 0 and right < len(s) and s[left] == s[right]:
left -=1
right +=1
return s[left+1:right]
longestSub = ""
for i in range(len(s)):
center = expandAroundCenter(s, i, i)
inBetween = expandAroundCenter(s, i, i+1)
longestSub = max(longestSub, center, inBetween, key=len)
return print("Output : ", longestSub)
s =input("input : s = ")
Solution.longest_palindromic(s) | class Solution:
@staticmethod
def longest_palindromic(s: str) -> str:
pass
def expand_around_center(s, left, right):
while left >= 0 and right < len(s) and (s[left] == s[right]):
left -= 1
right += 1
return s[left + 1:right]
longest_sub = ''
for i in range(len(s)):
center = expand_around_center(s, i, i)
in_between = expand_around_center(s, i, i + 1)
longest_sub = max(longestSub, center, inBetween, key=len)
return print('Output : ', longestSub)
s = input('input : s = ')
Solution.longest_palindromic(s) |
"""
Count the number of prime numbers less than a non-negative number, n.
"""
class Solution(object):
def countPrimes(self, n):
"""
:type n: int
:rtype: int
"""
if n < 2:
return 0
sieve = [True] * n
sieve[0] = False
sieve[1] = False
for i in range(2, n):
if sieve[i]:
for j in range(i * i, n, i):
sieve[j] = False
count = 0
i = 0
while i < n:
if sieve[i]:
count = count + 1
i += 1
return count
A = 10
s = Solution()
print(s.countPrimes(A))
| """
Count the number of prime numbers less than a non-negative number, n.
"""
class Solution(object):
def count_primes(self, n):
"""
:type n: int
:rtype: int
"""
if n < 2:
return 0
sieve = [True] * n
sieve[0] = False
sieve[1] = False
for i in range(2, n):
if sieve[i]:
for j in range(i * i, n, i):
sieve[j] = False
count = 0
i = 0
while i < n:
if sieve[i]:
count = count + 1
i += 1
return count
a = 10
s = solution()
print(s.countPrimes(A)) |
#
# PySNMP MIB module PET-EVENTS (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/PET-EVENTS
# Produced by pysmi-0.3.4 at Wed May 1 14:40:13 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, iso, TimeTicks, ModuleIdentity, IpAddress, enterprises, Gauge32, MibIdentifier, Bits, NotificationType, Integer32, ObjectIdentity, Counter64, NotificationType, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "iso", "TimeTicks", "ModuleIdentity", "IpAddress", "enterprises", "Gauge32", "MibIdentifier", "Bits", "NotificationType", "Integer32", "ObjectIdentity", "Counter64", "NotificationType", "Counter32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
wiredformgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 3183))
pet = MibIdentifier((1, 3, 6, 1, 4, 1, 3183, 1))
petEvts = MibIdentifier((1, 3, 6, 1, 4, 1, 3183, 1, 1))
petTrapUnderTemperatureWarning = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,65792))
if mibBuilder.loadTexts: petTrapUnderTemperatureWarning.setDescription('Under-Temperature Warning (Lower non-critical, going low)')
petTrapUnderTemperatureCritical = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,65794))
if mibBuilder.loadTexts: petTrapUnderTemperatureCritical.setDescription('Critical Under-Temperature Problem (Lower Critical - going low)')
petTrapOverTemperatureWarning = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,65799))
if mibBuilder.loadTexts: petTrapOverTemperatureWarning.setDescription('Over-Temperature Warning (Upper non-critical, going high)')
petTrapOverTemperatureCritical = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,65801))
if mibBuilder.loadTexts: petTrapOverTemperatureCritical.setDescription('Critical Over-Temperature Problem (Upper Critical - going high)')
petTrapGenericCriticalTemperature = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,67330))
if mibBuilder.loadTexts: petTrapGenericCriticalTemperature.setDescription('Generic Critical Temperature Problem (Transition to Critical from less severe)')
petTrapGenericTemperatureWarning = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,67331))
if mibBuilder.loadTexts: petTrapGenericTemperatureWarning.setDescription('Generic Temperature Warning (Transition to Warning from less severe)')
petTrapUnderAnalogVoltageCritical = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,131330))
if mibBuilder.loadTexts: petTrapUnderAnalogVoltageCritical.setDescription('Critical Under-Voltage Problem (Lower Critical - going low)')
petTrapOverAnalogVoltageCritical = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,131337))
if mibBuilder.loadTexts: petTrapOverAnalogVoltageCritical.setDescription('Critical Over-Voltage Problem (Upper Critical - going high)')
petTrapGenericCriticalDiscreteVoltage2 = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,132866))
if mibBuilder.loadTexts: petTrapGenericCriticalDiscreteVoltage2.setDescription('Generic Critical Voltage Problem (Transition to Critical from less severe)')
petTrapGenericDiscreteVoltageWarning = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,132867))
if mibBuilder.loadTexts: petTrapGenericDiscreteVoltageWarning.setDescription('Generic Voltage Warning (Transition to Non-Critical from less severe)')
petTrapGenericCriticalFan = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,263938))
if mibBuilder.loadTexts: petTrapGenericCriticalFan.setDescription('Generic Critical Fan failure (Transition to Critical from less severe)')
petTrapGenericFanWarning = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,263169))
if mibBuilder.loadTexts: petTrapGenericFanWarning.setDescription('Generic Predictive Fan failure (predictive failure asserted)')
petTrapFanSpeedproblem = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,262402))
if mibBuilder.loadTexts: petTrapFanSpeedproblem.setDescription('Fan Speed Problem (speed too low to meet chassis cooling specs)')
petTrapFanSpeedWarning = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,262400))
if mibBuilder.loadTexts: petTrapFanSpeedWarning.setDescription('Fan speed warning (Fan speed below expected speed. Cooling still adequate)')
petTrapPowerSupplyFailureDetected = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,552705))
if mibBuilder.loadTexts: petTrapPowerSupplyFailureDetected.setDescription('Power supply Failure detected')
petTrapPowerSupplyWarning = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,552706))
if mibBuilder.loadTexts: petTrapPowerSupplyWarning.setDescription('Power supply Warning')
petTrapProcessorInternalError = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,487168))
if mibBuilder.loadTexts: petTrapProcessorInternalError.setDescription('Processor Internal Error')
petTrapProcessorThermalTrip = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,487169))
if mibBuilder.loadTexts: petTrapProcessorThermalTrip.setDescription('Processor Thermal Trip (Over Temperature Shutdown)')
petTrapProcessorBistError = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,487170))
if mibBuilder.loadTexts: petTrapProcessorBistError.setDescription('Processor Fault Resilient Booting (FRB) 1 / BIST (Built In Self Test) Failure')
petTrapProcessorFRB2Failure = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,487171))
if mibBuilder.loadTexts: petTrapProcessorFRB2Failure.setDescription('Processor Fault Resilient Booting (FRB) 2 / Hang in Power On Self Test (POST) Failure')
petTrapProcessorFRB3Failure = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,487172))
if mibBuilder.loadTexts: petTrapProcessorFRB3Failure.setDescription('Processor Fault Resilient Booting (FRB) 3 / Processor Setup / Initialization Failure')
petTrapMemoryUncorrectableECC = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,814849))
if mibBuilder.loadTexts: petTrapMemoryUncorrectableECC.setDescription('Uncorrectable ECC or other uncorrectable memory error')
petTrapChassisIntrusion = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,356096))
if mibBuilder.loadTexts: petTrapChassisIntrusion.setDescription('Chassis Intrusion - Physical Security Violation')
petTrapCriticalInterruptBusTimeout = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1273601))
if mibBuilder.loadTexts: petTrapCriticalInterruptBusTimeout.setDescription('Critical Interrupt, Bus Timeout error')
petTrapCriticalInterruptIOChannelNMI = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1273602))
if mibBuilder.loadTexts: petTrapCriticalInterruptIOChannelNMI.setDescription('Critical Interrupt, IO Channel check NMI error')
petTrapCriticalInterruptSoftwareNMI = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1273603))
if mibBuilder.loadTexts: petTrapCriticalInterruptSoftwareNMI.setDescription('Critical Interrupt, software NMI error')
petTrapCriticalInterruptPCIPERR = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1273604))
if mibBuilder.loadTexts: petTrapCriticalInterruptPCIPERR.setDescription('Critical Interrupt, PCI PERR parity error')
petTrapCriticalInterruptPCISERR = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1273605))
if mibBuilder.loadTexts: petTrapCriticalInterruptPCISERR.setDescription('Critical Interrupt, PCI SERR parity error')
petTrapCriticalInterruptBusUncorrect = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1273608))
if mibBuilder.loadTexts: petTrapCriticalInterruptBusUncorrect.setDescription('Critical Interrupt, Bus Uncorrectable error')
petTrapCriticalInterruptFatalNMI = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1273609))
if mibBuilder.loadTexts: petTrapCriticalInterruptFatalNMI.setDescription('Critical Interrupt, Fatal NMI error')
petTrapBIOSPOSTCodeError = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1011456))
if mibBuilder.loadTexts: petTrapBIOSPOSTCodeError.setDescription('System Firmware Progress: BIOS POST code error')
petTrapWatchdogReset = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,2322177))
if mibBuilder.loadTexts: petTrapWatchdogReset.setDescription('Watchdog Reset')
petTrapWatchdogPowerDown = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,2322178))
if mibBuilder.loadTexts: petTrapWatchdogPowerDown.setDescription('Watchdog Power Down')
petTrapWatchdogPowerCycle = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,2322179))
if mibBuilder.loadTexts: petTrapWatchdogPowerCycle.setDescription('Watchdog Power Cycle')
petTrapOEMSystemBootEvent = NotificationType((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0,1208065))
if mibBuilder.loadTexts: petTrapOEMSystemBootEvent.setDescription('OEM System Boot Event')
mibBuilder.exportSymbols("PET-EVENTS", petTrapUnderTemperatureCritical=petTrapUnderTemperatureCritical, wiredformgmt=wiredformgmt, petTrapUnderAnalogVoltageCritical=petTrapUnderAnalogVoltageCritical, petEvts=petEvts, petTrapOverTemperatureWarning=petTrapOverTemperatureWarning, petTrapFanSpeedWarning=petTrapFanSpeedWarning, petTrapProcessorThermalTrip=petTrapProcessorThermalTrip, petTrapProcessorBistError=petTrapProcessorBistError, petTrapGenericDiscreteVoltageWarning=petTrapGenericDiscreteVoltageWarning, petTrapGenericCriticalTemperature=petTrapGenericCriticalTemperature, petTrapProcessorFRB2Failure=petTrapProcessorFRB2Failure, petTrapWatchdogPowerDown=petTrapWatchdogPowerDown, petTrapWatchdogReset=petTrapWatchdogReset, petTrapCriticalInterruptSoftwareNMI=petTrapCriticalInterruptSoftwareNMI, petTrapOEMSystemBootEvent=petTrapOEMSystemBootEvent, petTrapGenericCriticalFan=petTrapGenericCriticalFan, petTrapGenericCriticalDiscreteVoltage2=petTrapGenericCriticalDiscreteVoltage2, petTrapOverAnalogVoltageCritical=petTrapOverAnalogVoltageCritical, petTrapMemoryUncorrectableECC=petTrapMemoryUncorrectableECC, petTrapPowerSupplyWarning=petTrapPowerSupplyWarning, petTrapCriticalInterruptBusUncorrect=petTrapCriticalInterruptBusUncorrect, petTrapProcessorFRB3Failure=petTrapProcessorFRB3Failure, petTrapOverTemperatureCritical=petTrapOverTemperatureCritical, petTrapGenericFanWarning=petTrapGenericFanWarning, petTrapUnderTemperatureWarning=petTrapUnderTemperatureWarning, petTrapCriticalInterruptFatalNMI=petTrapCriticalInterruptFatalNMI, petTrapWatchdogPowerCycle=petTrapWatchdogPowerCycle, petTrapProcessorInternalError=petTrapProcessorInternalError, petTrapCriticalInterruptIOChannelNMI=petTrapCriticalInterruptIOChannelNMI, petTrapCriticalInterruptBusTimeout=petTrapCriticalInterruptBusTimeout, petTrapFanSpeedproblem=petTrapFanSpeedproblem, petTrapCriticalInterruptPCIPERR=petTrapCriticalInterruptPCIPERR, petTrapChassisIntrusion=petTrapChassisIntrusion, petTrapBIOSPOSTCodeError=petTrapBIOSPOSTCodeError, petTrapCriticalInterruptPCISERR=petTrapCriticalInterruptPCISERR, petTrapPowerSupplyFailureDetected=petTrapPowerSupplyFailureDetected, pet=pet, petTrapGenericTemperatureWarning=petTrapGenericTemperatureWarning)
| (octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_intersection, value_size_constraint, constraints_union, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_scalar, mib_table, mib_table_row, mib_table_column, unsigned32, iso, time_ticks, module_identity, ip_address, enterprises, gauge32, mib_identifier, bits, notification_type, integer32, object_identity, counter64, notification_type, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Unsigned32', 'iso', 'TimeTicks', 'ModuleIdentity', 'IpAddress', 'enterprises', 'Gauge32', 'MibIdentifier', 'Bits', 'NotificationType', 'Integer32', 'ObjectIdentity', 'Counter64', 'NotificationType', 'Counter32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
wiredformgmt = mib_identifier((1, 3, 6, 1, 4, 1, 3183))
pet = mib_identifier((1, 3, 6, 1, 4, 1, 3183, 1))
pet_evts = mib_identifier((1, 3, 6, 1, 4, 1, 3183, 1, 1))
pet_trap_under_temperature_warning = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 65792))
if mibBuilder.loadTexts:
petTrapUnderTemperatureWarning.setDescription('Under-Temperature Warning (Lower non-critical, going low)')
pet_trap_under_temperature_critical = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 65794))
if mibBuilder.loadTexts:
petTrapUnderTemperatureCritical.setDescription('Critical Under-Temperature Problem (Lower Critical - going low)')
pet_trap_over_temperature_warning = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 65799))
if mibBuilder.loadTexts:
petTrapOverTemperatureWarning.setDescription('Over-Temperature Warning (Upper non-critical, going high)')
pet_trap_over_temperature_critical = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 65801))
if mibBuilder.loadTexts:
petTrapOverTemperatureCritical.setDescription('Critical Over-Temperature Problem (Upper Critical - going high)')
pet_trap_generic_critical_temperature = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 67330))
if mibBuilder.loadTexts:
petTrapGenericCriticalTemperature.setDescription('Generic Critical Temperature Problem (Transition to Critical from less severe)')
pet_trap_generic_temperature_warning = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 67331))
if mibBuilder.loadTexts:
petTrapGenericTemperatureWarning.setDescription('Generic Temperature Warning (Transition to Warning from less severe)')
pet_trap_under_analog_voltage_critical = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 131330))
if mibBuilder.loadTexts:
petTrapUnderAnalogVoltageCritical.setDescription('Critical Under-Voltage Problem (Lower Critical - going low)')
pet_trap_over_analog_voltage_critical = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 131337))
if mibBuilder.loadTexts:
petTrapOverAnalogVoltageCritical.setDescription('Critical Over-Voltage Problem (Upper Critical - going high)')
pet_trap_generic_critical_discrete_voltage2 = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 132866))
if mibBuilder.loadTexts:
petTrapGenericCriticalDiscreteVoltage2.setDescription('Generic Critical Voltage Problem (Transition to Critical from less severe)')
pet_trap_generic_discrete_voltage_warning = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 132867))
if mibBuilder.loadTexts:
petTrapGenericDiscreteVoltageWarning.setDescription('Generic Voltage Warning (Transition to Non-Critical from less severe)')
pet_trap_generic_critical_fan = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 263938))
if mibBuilder.loadTexts:
petTrapGenericCriticalFan.setDescription('Generic Critical Fan failure (Transition to Critical from less severe)')
pet_trap_generic_fan_warning = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 263169))
if mibBuilder.loadTexts:
petTrapGenericFanWarning.setDescription('Generic Predictive Fan failure (predictive failure asserted)')
pet_trap_fan_speedproblem = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 262402))
if mibBuilder.loadTexts:
petTrapFanSpeedproblem.setDescription('Fan Speed Problem (speed too low to meet chassis cooling specs)')
pet_trap_fan_speed_warning = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 262400))
if mibBuilder.loadTexts:
petTrapFanSpeedWarning.setDescription('Fan speed warning (Fan speed below expected speed. Cooling still adequate)')
pet_trap_power_supply_failure_detected = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 552705))
if mibBuilder.loadTexts:
petTrapPowerSupplyFailureDetected.setDescription('Power supply Failure detected')
pet_trap_power_supply_warning = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 552706))
if mibBuilder.loadTexts:
petTrapPowerSupplyWarning.setDescription('Power supply Warning')
pet_trap_processor_internal_error = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 487168))
if mibBuilder.loadTexts:
petTrapProcessorInternalError.setDescription('Processor Internal Error')
pet_trap_processor_thermal_trip = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 487169))
if mibBuilder.loadTexts:
petTrapProcessorThermalTrip.setDescription('Processor Thermal Trip (Over Temperature Shutdown)')
pet_trap_processor_bist_error = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 487170))
if mibBuilder.loadTexts:
petTrapProcessorBistError.setDescription('Processor Fault Resilient Booting (FRB) 1 / BIST (Built In Self Test) Failure')
pet_trap_processor_frb2_failure = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 487171))
if mibBuilder.loadTexts:
petTrapProcessorFRB2Failure.setDescription('Processor Fault Resilient Booting (FRB) 2 / Hang in Power On Self Test (POST) Failure')
pet_trap_processor_frb3_failure = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 487172))
if mibBuilder.loadTexts:
petTrapProcessorFRB3Failure.setDescription('Processor Fault Resilient Booting (FRB) 3 / Processor Setup / Initialization Failure')
pet_trap_memory_uncorrectable_ecc = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 814849))
if mibBuilder.loadTexts:
petTrapMemoryUncorrectableECC.setDescription('Uncorrectable ECC or other uncorrectable memory error')
pet_trap_chassis_intrusion = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 356096))
if mibBuilder.loadTexts:
petTrapChassisIntrusion.setDescription('Chassis Intrusion - Physical Security Violation')
pet_trap_critical_interrupt_bus_timeout = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1273601))
if mibBuilder.loadTexts:
petTrapCriticalInterruptBusTimeout.setDescription('Critical Interrupt, Bus Timeout error')
pet_trap_critical_interrupt_io_channel_nmi = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1273602))
if mibBuilder.loadTexts:
petTrapCriticalInterruptIOChannelNMI.setDescription('Critical Interrupt, IO Channel check NMI error')
pet_trap_critical_interrupt_software_nmi = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1273603))
if mibBuilder.loadTexts:
petTrapCriticalInterruptSoftwareNMI.setDescription('Critical Interrupt, software NMI error')
pet_trap_critical_interrupt_pciperr = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1273604))
if mibBuilder.loadTexts:
petTrapCriticalInterruptPCIPERR.setDescription('Critical Interrupt, PCI PERR parity error')
pet_trap_critical_interrupt_pciserr = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1273605))
if mibBuilder.loadTexts:
petTrapCriticalInterruptPCISERR.setDescription('Critical Interrupt, PCI SERR parity error')
pet_trap_critical_interrupt_bus_uncorrect = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1273608))
if mibBuilder.loadTexts:
petTrapCriticalInterruptBusUncorrect.setDescription('Critical Interrupt, Bus Uncorrectable error')
pet_trap_critical_interrupt_fatal_nmi = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1273609))
if mibBuilder.loadTexts:
petTrapCriticalInterruptFatalNMI.setDescription('Critical Interrupt, Fatal NMI error')
pet_trap_biospost_code_error = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1011456))
if mibBuilder.loadTexts:
petTrapBIOSPOSTCodeError.setDescription('System Firmware Progress: BIOS POST code error')
pet_trap_watchdog_reset = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 2322177))
if mibBuilder.loadTexts:
petTrapWatchdogReset.setDescription('Watchdog Reset')
pet_trap_watchdog_power_down = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 2322178))
if mibBuilder.loadTexts:
petTrapWatchdogPowerDown.setDescription('Watchdog Power Down')
pet_trap_watchdog_power_cycle = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 2322179))
if mibBuilder.loadTexts:
petTrapWatchdogPowerCycle.setDescription('Watchdog Power Cycle')
pet_trap_oem_system_boot_event = notification_type((1, 3, 6, 1, 4, 1, 3183, 1, 1) + (0, 1208065))
if mibBuilder.loadTexts:
petTrapOEMSystemBootEvent.setDescription('OEM System Boot Event')
mibBuilder.exportSymbols('PET-EVENTS', petTrapUnderTemperatureCritical=petTrapUnderTemperatureCritical, wiredformgmt=wiredformgmt, petTrapUnderAnalogVoltageCritical=petTrapUnderAnalogVoltageCritical, petEvts=petEvts, petTrapOverTemperatureWarning=petTrapOverTemperatureWarning, petTrapFanSpeedWarning=petTrapFanSpeedWarning, petTrapProcessorThermalTrip=petTrapProcessorThermalTrip, petTrapProcessorBistError=petTrapProcessorBistError, petTrapGenericDiscreteVoltageWarning=petTrapGenericDiscreteVoltageWarning, petTrapGenericCriticalTemperature=petTrapGenericCriticalTemperature, petTrapProcessorFRB2Failure=petTrapProcessorFRB2Failure, petTrapWatchdogPowerDown=petTrapWatchdogPowerDown, petTrapWatchdogReset=petTrapWatchdogReset, petTrapCriticalInterruptSoftwareNMI=petTrapCriticalInterruptSoftwareNMI, petTrapOEMSystemBootEvent=petTrapOEMSystemBootEvent, petTrapGenericCriticalFan=petTrapGenericCriticalFan, petTrapGenericCriticalDiscreteVoltage2=petTrapGenericCriticalDiscreteVoltage2, petTrapOverAnalogVoltageCritical=petTrapOverAnalogVoltageCritical, petTrapMemoryUncorrectableECC=petTrapMemoryUncorrectableECC, petTrapPowerSupplyWarning=petTrapPowerSupplyWarning, petTrapCriticalInterruptBusUncorrect=petTrapCriticalInterruptBusUncorrect, petTrapProcessorFRB3Failure=petTrapProcessorFRB3Failure, petTrapOverTemperatureCritical=petTrapOverTemperatureCritical, petTrapGenericFanWarning=petTrapGenericFanWarning, petTrapUnderTemperatureWarning=petTrapUnderTemperatureWarning, petTrapCriticalInterruptFatalNMI=petTrapCriticalInterruptFatalNMI, petTrapWatchdogPowerCycle=petTrapWatchdogPowerCycle, petTrapProcessorInternalError=petTrapProcessorInternalError, petTrapCriticalInterruptIOChannelNMI=petTrapCriticalInterruptIOChannelNMI, petTrapCriticalInterruptBusTimeout=petTrapCriticalInterruptBusTimeout, petTrapFanSpeedproblem=petTrapFanSpeedproblem, petTrapCriticalInterruptPCIPERR=petTrapCriticalInterruptPCIPERR, petTrapChassisIntrusion=petTrapChassisIntrusion, petTrapBIOSPOSTCodeError=petTrapBIOSPOSTCodeError, petTrapCriticalInterruptPCISERR=petTrapCriticalInterruptPCISERR, petTrapPowerSupplyFailureDetected=petTrapPowerSupplyFailureDetected, pet=pet, petTrapGenericTemperatureWarning=petTrapGenericTemperatureWarning) |
andres = {
"nombre": "Andres",
"apellido": "Velasco",
"edad": 22,
"sueldo": 1.01,
"hijos": [],
"casado": False,
"lotera": None,
"mascota": {
"nombre": "Cachetes",
"edad": 3,
},
}
if andres:
print("Si")
else:
print("No")
print(andres['nombre'])
print(andres['mascota']['nombre'])
andres.pop("casado")
print(andres)
# Iterar por valores
for valor in andres.values():
print(f"Valor: {valor}")
# Iterar por llaves
for llave in andres.keys():
print(f"Llave: {llave} Valor: {andres[llave]} {andres.get(llave)}")
# Otra forma de iterar el diccionario
for clave, valor in andres.items():
print(f"clave: {clave} valor: {valor}")
# Agregar un nuevo atributo al diccionario
andres["profesion"] = "Maestro"
andres.update({"peso": 0, "altura": 1})
print(andres)
| andres = {'nombre': 'Andres', 'apellido': 'Velasco', 'edad': 22, 'sueldo': 1.01, 'hijos': [], 'casado': False, 'lotera': None, 'mascota': {'nombre': 'Cachetes', 'edad': 3}}
if andres:
print('Si')
else:
print('No')
print(andres['nombre'])
print(andres['mascota']['nombre'])
andres.pop('casado')
print(andres)
for valor in andres.values():
print(f'Valor: {valor}')
for llave in andres.keys():
print(f'Llave: {llave} Valor: {andres[llave]} {andres.get(llave)}')
for (clave, valor) in andres.items():
print(f'clave: {clave} valor: {valor}')
andres['profesion'] = 'Maestro'
andres.update({'peso': 0, 'altura': 1})
print(andres) |
class Listened:
def __init__(self, times):
self.times = times
def params_str(self):
return "{{times: '{}'}}".format(self.times)
| class Listened:
def __init__(self, times):
self.times = times
def params_str(self):
return "{{times: '{}'}}".format(self.times) |
'''
Question 03:
Write code in python to print various datatypes of variable x.
My Solution:
'''
a = "fruits"
b = 20
c = 20.5
d = 1j
e = ["apple", "orange", "pomegranate"]
f = ("banana", "strawberry", "grape")
g = range(8)
h = {"pomegranate" : "fruit", "class" : "flora" }
i = {"kiwi", "dragon fruit", "custard apple"}
j = frozenset({"kiwi", "dragon fruit", "custard apple"})
k = True
l = b"Hello"
m = bytearray(5)
n = memoryview(bytes(5))
print(type(a))
print(type(b))
print(type(c))
print(type(d))
print(type(e))
print(type(f))
print(type(g))
print(type(h))
print(type(i))
print(type(j))
print(type(k))
print(type(l))
print(type(m))
print(type(n))
| """
Question 03:
Write code in python to print various datatypes of variable x.
My Solution:
"""
a = 'fruits'
b = 20
c = 20.5
d = 1j
e = ['apple', 'orange', 'pomegranate']
f = ('banana', 'strawberry', 'grape')
g = range(8)
h = {'pomegranate': 'fruit', 'class': 'flora'}
i = {'kiwi', 'dragon fruit', 'custard apple'}
j = frozenset({'kiwi', 'dragon fruit', 'custard apple'})
k = True
l = b'Hello'
m = bytearray(5)
n = memoryview(bytes(5))
print(type(a))
print(type(b))
print(type(c))
print(type(d))
print(type(e))
print(type(f))
print(type(g))
print(type(h))
print(type(i))
print(type(j))
print(type(k))
print(type(l))
print(type(m))
print(type(n)) |
VARS_COMMAND = 'command'
VARS_SUBCOMMAND = 'subcommand'
VARS_DEFAULT = 'default'
API_BASE_URL = 'https://api.epsagon.com'
| vars_command = 'command'
vars_subcommand = 'subcommand'
vars_default = 'default'
api_base_url = 'https://api.epsagon.com' |
'''
An object class for a value of a parameter.
'''
class Value:
def __init__(self, p, v):
self.param_name = p
self.value = v
self.visited = False
self.visited_num = 0
| """
An object class for a value of a parameter.
"""
class Value:
def __init__(self, p, v):
self.param_name = p
self.value = v
self.visited = False
self.visited_num = 0 |
parentToChildrenBags = {}
with open("C:\\Privat\\advent_of_code20\\puzzle7\\input1.txt") as f:
for line in f:
line = line.strip()
print(line)
lineSplit = line.split('contain')
startingColorSplit = lineSplit[0].split(' ')
startingColor = startingColorSplit[0] + ' ' + startingColorSplit[1]
if not startingColor in parentToChildrenBags:
parentToChildrenBags[startingColor] = []
print(lineSplit)
lineSplit2 = lineSplit[1].split(',')
print(lineSplit2)
for bag in lineSplit2:
if 'no other bags' in bag:
continue
bagSplit = bag.strip().split(' ')
bagString = bagSplit[1] + ' ' + bagSplit[2]
if not bagString in parentToChildrenBags[startingColor]:
parentToChildrenBags[startingColor].append((bagString, bagSplit[0]))
print(parentToChildrenBags)
baggs = []
def recurse(parentToChildrenBags, bagTuples):
for bagTuple in bagTuples:
i = 0
while i < int(bagTuple[1]):
recurse(parentToChildrenBags, parentToChildrenBags[bagTuple[0]])
i += 1
baggs.append(bagTuple[0])
recurse(parentToChildrenBags, parentToChildrenBags['shiny gold'])
#print(baggs)
print("Number of bags that are contained in a shiny gold bag: " + str(len(baggs)))
| parent_to_children_bags = {}
with open('C:\\Privat\\advent_of_code20\\puzzle7\\input1.txt') as f:
for line in f:
line = line.strip()
print(line)
line_split = line.split('contain')
starting_color_split = lineSplit[0].split(' ')
starting_color = startingColorSplit[0] + ' ' + startingColorSplit[1]
if not startingColor in parentToChildrenBags:
parentToChildrenBags[startingColor] = []
print(lineSplit)
line_split2 = lineSplit[1].split(',')
print(lineSplit2)
for bag in lineSplit2:
if 'no other bags' in bag:
continue
bag_split = bag.strip().split(' ')
bag_string = bagSplit[1] + ' ' + bagSplit[2]
if not bagString in parentToChildrenBags[startingColor]:
parentToChildrenBags[startingColor].append((bagString, bagSplit[0]))
print(parentToChildrenBags)
baggs = []
def recurse(parentToChildrenBags, bagTuples):
for bag_tuple in bagTuples:
i = 0
while i < int(bagTuple[1]):
recurse(parentToChildrenBags, parentToChildrenBags[bagTuple[0]])
i += 1
baggs.append(bagTuple[0])
recurse(parentToChildrenBags, parentToChildrenBags['shiny gold'])
print('Number of bags that are contained in a shiny gold bag: ' + str(len(baggs))) |
def main() -> None:
# fermat's little theorem
n, k, m = map(int, input().split())
# m^(k^n)
MOD = 998_244_353
m %= MOD
print(0 if m == 0 else pow(m, pow(k, n, MOD - 1), MOD))
# k^n % (MOD - 1) might be 0.
# 0^0 is defined as 1 in Python.
# but if m == 0, answer shoud be 0
# (Fermat's Little Theorem cannot be applied when m == 0).
if __name__ == "__main__":
main()
| def main() -> None:
(n, k, m) = map(int, input().split())
mod = 998244353
m %= MOD
print(0 if m == 0 else pow(m, pow(k, n, MOD - 1), MOD))
if __name__ == '__main__':
main() |
lista = ['99', '102', '89', '120', '117']
cont = 0
maximo = lista[1]
while cont < 3:
if lista[cont] > lista[cont+1]:
maximo = lista[cont+1]
cont = cont + 1
print(maximo)
| lista = ['99', '102', '89', '120', '117']
cont = 0
maximo = lista[1]
while cont < 3:
if lista[cont] > lista[cont + 1]:
maximo = lista[cont + 1]
cont = cont + 1
print(maximo) |
logo = """
___________ __ .__ __________
\__ ___/_ __________/ |_| | ____ \______ \_____ ____ ____
| | | | \_ __ \ __\ | _/ __ \ | _/\__ \ _/ ___\/ __ \
| | | | /| | \/| | | |_\ ___/ | | \ / __ \\ \__\ ___/
|____| |____/ |__| |__| |____/\___ > |____|_ /(____ /\___ >___ >
\/ \/ \/ \/ \/
""" | logo = '\n___________ __ .__ __________ \n\\__ ___/_ __________/ |_| | ____ \\______ \\_____ ____ ____ \n | | | | \\_ __ \\ __\\ | _/ __ \\ | _/\\__ \\ _/ ___\\/ __ \\ \n | | | | /| | \\/| | | |_\\ ___/ | | \\ / __ \\ \\__\\ ___/ \n |____| |____/ |__| |__| |____/\\___ > |____|_ /(____ /\\___ >___ >\n \\/ \\/ \\/ \\/ \\/ \n' |
def calculateHandlen(hand):
"""
Returns the length (number of letters) in the current hand.
hand: dictionary (string int)
returns: integer
"""
result = 0
for item in hand.keys():
result += hand[item]
return result
hand = {'h':1, 'e':1, 'l':2, 'o':1}
print(calculateHandlen(hand)) | def calculate_handlen(hand):
"""
Returns the length (number of letters) in the current hand.
hand: dictionary (string int)
returns: integer
"""
result = 0
for item in hand.keys():
result += hand[item]
return result
hand = {'h': 1, 'e': 1, 'l': 2, 'o': 1}
print(calculate_handlen(hand)) |
t = int(input())
for _ in range(t):
fib = [1,1]
n = int(input())
if n == 1:
print('IsFibo')
else:
while n > fib[1]:
fib.insert(2, fib[0] + fib[1])
fib.remove(fib[0])
if fib[1] == n:
print('IsFibo')
else:
print('IsNotFibo') | t = int(input())
for _ in range(t):
fib = [1, 1]
n = int(input())
if n == 1:
print('IsFibo')
else:
while n > fib[1]:
fib.insert(2, fib[0] + fib[1])
fib.remove(fib[0])
if fib[1] == n:
print('IsFibo')
else:
print('IsNotFibo') |
def g(x):
b = 0
i = 1
while i < x:
j = i + 1
while j <= x:
b += gcd(i, j)
j += 1
i += 1
return b
def gcd(a, b):
while not b == 0:
a, b = b, a % b
return a
a = int(input())
while a:
a = g(a)
print(a)
a = int(input())
| def g(x):
b = 0
i = 1
while i < x:
j = i + 1
while j <= x:
b += gcd(i, j)
j += 1
i += 1
return b
def gcd(a, b):
while not b == 0:
(a, b) = (b, a % b)
return a
a = int(input())
while a:
a = g(a)
print(a)
a = int(input()) |
class ExampleError(Exception):
pass
def bad_function():
raise ExampleError('this is a message', 1, 2, 'other1', 'other2', 'other3')
try:
bad_function()
except ExampleError as err:
message, x, y, *others = err.args
print(f'[I] {message}')
print(f'[I] Others: {others}') | class Exampleerror(Exception):
pass
def bad_function():
raise example_error('this is a message', 1, 2, 'other1', 'other2', 'other3')
try:
bad_function()
except ExampleError as err:
(message, x, y, *others) = err.args
print(f'[I] {message}')
print(f'[I] Others: {others}') |
# Created by MechAviv
# Kinesis Introduction
# Map ID :: 331001110
# Hideout :: Training Room 1
if "1" not in sm.getQuestEx(22700, "E1"):
sm.lockForIntro()
sm.playSound("Sound/Field.img/masteryBook/EnchantSuccess")
sm.showClearStageExpWindow(350)
sm.giveExp(350)
sm.playExclSoundWithDownBGM("Voice3.img/Kinesis/guide_04", 100)
sm.sendDelay(2500)
sm.setQuestEx(22700, "E1", "1")
sm.unlockForIntro()
sm.warp(331001120, 0) | if '1' not in sm.getQuestEx(22700, 'E1'):
sm.lockForIntro()
sm.playSound('Sound/Field.img/masteryBook/EnchantSuccess')
sm.showClearStageExpWindow(350)
sm.giveExp(350)
sm.playExclSoundWithDownBGM('Voice3.img/Kinesis/guide_04', 100)
sm.sendDelay(2500)
sm.setQuestEx(22700, 'E1', '1')
sm.unlockForIntro()
sm.warp(331001120, 0) |
"""
Given a binary tree root and an integer target, delete all the leaf nodes
with value target.
Note that once you delete a leaf node with value target, if it's parent
node becomes a leaf node and has the value target, it should also be
deleted (you need to continue doing that until you can't).
Example
Input: root = [1,2,3,2,null,2,4], target = 2
Output: [1,null,3,null,4]
Explanation: Leaf nodes in green with value (target = 2) are removed
(Picture in left).
After removing, new nodes become leaf nodes with value
(target = 2) (Picture in center).
Example:
Input: root = [1,3,3,3,2], target = 3
Output: [1,3,null,null,2]
Example:
Input: root = [1,2,null,2,null,2], target = 2
Output: [1]
Explanation: Leaf nodes in green with value (target = 2) are removed at
each step.
Example:
Input: root = [1,1,1], target = 1
Output: []
Example:
Input: root = [1,2,3], target = 1
Output: [1,2,3]
Constraints:
- 1 <= target <= 1000
- The given binary tree will have between 1 and 3000 nodes.
- Each node's value is between [1, 1000].
"""
#Difficulty: Medium
#50 / 50 test cases passed.
#Runtime: 72 ms
#Memory Usage: 14 MB
#Runtime: 72 ms, faster than 35.26% of Python3 online submissions for Delete Leaves With a Given Value.
#Memory Usage: 14 MB, less than 90.57% of Python3 online submissions for Delete Leaves With a Given Value.
# 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 removeLeafNodes(self, root: TreeNode, target: int) -> TreeNode:
self.dfs(root, target)
if root and root.val == target and not root.left and not root.right:
root = None
return root
def dfs(self, root, target):
if not root:
return
self.dfs(root.left, target)
self.dfs(root.right, target)
if root.left and root.left.val == target and not root.left.left and not root.left.right:
root.left = None
if root.right and root.right.val == target and not root.right.left and not root.right.right:
root.right = None
| """
Given a binary tree root and an integer target, delete all the leaf nodes
with value target.
Note that once you delete a leaf node with value target, if it's parent
node becomes a leaf node and has the value target, it should also be
deleted (you need to continue doing that until you can't).
Example
Input: root = [1,2,3,2,null,2,4], target = 2
Output: [1,null,3,null,4]
Explanation: Leaf nodes in green with value (target = 2) are removed
(Picture in left).
After removing, new nodes become leaf nodes with value
(target = 2) (Picture in center).
Example:
Input: root = [1,3,3,3,2], target = 3
Output: [1,3,null,null,2]
Example:
Input: root = [1,2,null,2,null,2], target = 2
Output: [1]
Explanation: Leaf nodes in green with value (target = 2) are removed at
each step.
Example:
Input: root = [1,1,1], target = 1
Output: []
Example:
Input: root = [1,2,3], target = 1
Output: [1,2,3]
Constraints:
- 1 <= target <= 1000
- The given binary tree will have between 1 and 3000 nodes.
- Each node's value is between [1, 1000].
"""
class Solution:
def remove_leaf_nodes(self, root: TreeNode, target: int) -> TreeNode:
self.dfs(root, target)
if root and root.val == target and (not root.left) and (not root.right):
root = None
return root
def dfs(self, root, target):
if not root:
return
self.dfs(root.left, target)
self.dfs(root.right, target)
if root.left and root.left.val == target and (not root.left.left) and (not root.left.right):
root.left = None
if root.right and root.right.val == target and (not root.right.left) and (not root.right.right):
root.right = None |
"""
memory.py
Represents a file memory.
"""
class Memory():
def write(self, line):
f = open("results", "a")
template = f"{line}\n"
f.write(template)
f.close()
| """
memory.py
Represents a file memory.
"""
class Memory:
def write(self, line):
f = open('results', 'a')
template = f'{line}\n'
f.write(template)
f.close() |
#TheBestTimeToParty
# celebrities Comes Goes
# beyonce 6 7
# Taylor 7 9
# Brad 10 11
# Katy 10 12
# Tom 8 10
# Drake 9 11
# Alicia 6 8
# [6 7) <- notice that at 6:59, Beyonce is there, but 7, she will be gone
# but the great thing about this, is that python intervals are integer; why does this help us?
# Answer: The range when someone is there, say 9-11 only needs to care about the times [9,10], inclusive.
# therefore python's natural usage of lists that start inclusively at the first value, and end non-inclusive are perfect.
# e.g. mylist[9:11] means it represents 9, 10 but not 11
######
# How to build this array above to represent my celebs and their comes/goes times?
# I chose two arrays; one for the celebs, and one for the times. In reality, the names of the celebs aren't given, however
# I think I will keep a list of their names.
def firstAttempt():
celebs = ['beyonce', 'taylor', 'brad', 'katy', 'tom', 'drake', 'alicia']
times = [list(range(6,7)), list(range(7,9)), list(range(10,12)), list(range(10,12)), list(range(8,10)), list(range(9,11)), list(range(6,8))]
maxcount = 0
maxindex = 0
celebNames=['' for x in range(max(max(times)) + 1)]
count=[0 for x in range(max(max(times)) + 1)]
#print (times)
#print (min(min(times)))
for j in range(min(min(times)) , max(max(times))+1):
for index, time in enumerate(times):
if(time[0] == j):
count[j] = count[j]+1
celebNames[j] = ' '.join([celebNames[j],celebs[index-len(celebs)]])
elif(len(time) > 1):
if(time[0] <= j) and (j < (time[len(time)-1] + 1)):
count[j] = count[j] + 1
celebNames[j] = ' '.join([celebNames[j],celebs[index-len(celebs)]])
if(maxcount < count[j]):
maxindex = j
maxcount = count[j]
print("The best time to meet a celebrity is at ", maxindex, " and you would meet these people: ", celebNames[maxindex])
firstAttempt()
| def first_attempt():
celebs = ['beyonce', 'taylor', 'brad', 'katy', 'tom', 'drake', 'alicia']
times = [list(range(6, 7)), list(range(7, 9)), list(range(10, 12)), list(range(10, 12)), list(range(8, 10)), list(range(9, 11)), list(range(6, 8))]
maxcount = 0
maxindex = 0
celeb_names = ['' for x in range(max(max(times)) + 1)]
count = [0 for x in range(max(max(times)) + 1)]
for j in range(min(min(times)), max(max(times)) + 1):
for (index, time) in enumerate(times):
if time[0] == j:
count[j] = count[j] + 1
celebNames[j] = ' '.join([celebNames[j], celebs[index - len(celebs)]])
elif len(time) > 1:
if time[0] <= j and j < time[len(time) - 1] + 1:
count[j] = count[j] + 1
celebNames[j] = ' '.join([celebNames[j], celebs[index - len(celebs)]])
if maxcount < count[j]:
maxindex = j
maxcount = count[j]
print('The best time to meet a celebrity is at ', maxindex, ' and you would meet these people: ', celebNames[maxindex])
first_attempt() |
class Heap:
def __init__(self, initial_size=10):
self.cbt = [None for _ in range(initial_size)] # initialize arrays
self.next_index = 0 # denotes next index where new element should go
def insert(self, data):
# insert element at the next index
self.cbt[self.next_index] = data
# heapify
self._up_heapify()
# increase index by 1
self.next_index += 1
# double the array and copy elements if next_index goes out of array bounds
if self.next_index >= len(self.cbt):
temp = self.cbt
self.cbt = [None for _ in range(2 * len(self.cbt))]
for index in range(self.next_index):
self.cbt[index] = temp[index]
def remove(self):
if self.size() == 0:
return None
self.next_index -= 1
to_remove = self.cbt[0]
last_element = self.cbt[self.next_index]
# place last element of the cbt at the root
self.cbt[0] = last_element
# we do not remove the elementm, rather we allow next `insert` operation to overwrite it
self.cbt[self.next_index] = to_remove
self._down_heapify()
return to_remove
def size(self):
return self.next_index
def is_empty(self):
return self.size() == 0
def _up_heapify(self):
# print("inside heapify")
child_index = self.next_index
while child_index >= 1:
parent_index = (child_index - 1) // 2
parent_element = self.cbt[parent_index]
child_element = self.cbt[child_index]
if parent_element > child_element:
self.cbt[parent_index] = child_element
self.cbt[child_index] = parent_element
child_index = parent_index
else:
break
def _down_heapify(self):
parent_index = 0
while parent_index < self.next_index:
left_child_index = 2 * parent_index + 1
right_child_index = 2 * parent_index + 2
parent = self.cbt[parent_index]
left_child = None
right_child = None
min_element = parent
# check if left child exists
if left_child_index < self.next_index:
left_child = self.cbt[left_child_index]
# check if right child exists
if right_child_index < self.next_index:
right_child = self.cbt[right_child_index]
# compare with left child
if left_child is not None:
min_element = min(parent, left_child)
# compare with right child
if right_child is not None:
min_element = min(right_child, min_element)
# check if parent is rightly placed
if min_element == parent:
return
if min_element == left_child:
self.cbt[left_child_index] = parent
self.cbt[parent_index] = min_element
parent = left_child_index
elif min_element == right_child:
self.cbt[right_child_index] = parent
self.cbt[parent_index] = min_element
parent = right_child_index
def get_minimum(self):
# Returns the minimum element present in the heap
if self.size() == 0:
return None
return self.cbt[0]
if __name__ == '__main__':
heap_size = 5
heap = Heap(heap_size)
elements = [1, 2, 3, 4, 1, 2]
for element in elements:
heap.insert(element)
print('Inserted elements: {}'.format(elements))
print('size of heap: {}'.format(heap.size()))
for _ in range(4):
print('Call remove: {}'.format(heap.remove()))
print('Call get_minimum: {}'.format(heap.get_minimum()))
for _ in range(2):
print('Call remove: {}'.format(heap.remove()))
print('size of heap: {}'.format(heap.size()))
print('Call remove: {}'.format(heap.remove()))
print('Call is_empty: {}'.format(heap.is_empty())) | class Heap:
def __init__(self, initial_size=10):
self.cbt = [None for _ in range(initial_size)]
self.next_index = 0
def insert(self, data):
self.cbt[self.next_index] = data
self._up_heapify()
self.next_index += 1
if self.next_index >= len(self.cbt):
temp = self.cbt
self.cbt = [None for _ in range(2 * len(self.cbt))]
for index in range(self.next_index):
self.cbt[index] = temp[index]
def remove(self):
if self.size() == 0:
return None
self.next_index -= 1
to_remove = self.cbt[0]
last_element = self.cbt[self.next_index]
self.cbt[0] = last_element
self.cbt[self.next_index] = to_remove
self._down_heapify()
return to_remove
def size(self):
return self.next_index
def is_empty(self):
return self.size() == 0
def _up_heapify(self):
child_index = self.next_index
while child_index >= 1:
parent_index = (child_index - 1) // 2
parent_element = self.cbt[parent_index]
child_element = self.cbt[child_index]
if parent_element > child_element:
self.cbt[parent_index] = child_element
self.cbt[child_index] = parent_element
child_index = parent_index
else:
break
def _down_heapify(self):
parent_index = 0
while parent_index < self.next_index:
left_child_index = 2 * parent_index + 1
right_child_index = 2 * parent_index + 2
parent = self.cbt[parent_index]
left_child = None
right_child = None
min_element = parent
if left_child_index < self.next_index:
left_child = self.cbt[left_child_index]
if right_child_index < self.next_index:
right_child = self.cbt[right_child_index]
if left_child is not None:
min_element = min(parent, left_child)
if right_child is not None:
min_element = min(right_child, min_element)
if min_element == parent:
return
if min_element == left_child:
self.cbt[left_child_index] = parent
self.cbt[parent_index] = min_element
parent = left_child_index
elif min_element == right_child:
self.cbt[right_child_index] = parent
self.cbt[parent_index] = min_element
parent = right_child_index
def get_minimum(self):
if self.size() == 0:
return None
return self.cbt[0]
if __name__ == '__main__':
heap_size = 5
heap = heap(heap_size)
elements = [1, 2, 3, 4, 1, 2]
for element in elements:
heap.insert(element)
print('Inserted elements: {}'.format(elements))
print('size of heap: {}'.format(heap.size()))
for _ in range(4):
print('Call remove: {}'.format(heap.remove()))
print('Call get_minimum: {}'.format(heap.get_minimum()))
for _ in range(2):
print('Call remove: {}'.format(heap.remove()))
print('size of heap: {}'.format(heap.size()))
print('Call remove: {}'.format(heap.remove()))
print('Call is_empty: {}'.format(heap.is_empty())) |
class Solution:
def specialArray(self, nums: List[int]) -> int:
for i in range(len(nums) + 1):
count = 0
for num in nums:
if num >= i:
count += 1
if count > i:
break
if count == i:
return i
return -1 | class Solution:
def special_array(self, nums: List[int]) -> int:
for i in range(len(nums) + 1):
count = 0
for num in nums:
if num >= i:
count += 1
if count > i:
break
if count == i:
return i
return -1 |
decoration_prices = {
'ornament set': 2,
'tree skirt': 5,
'tree garlands': 3,
'tree lights': 15,
}
quantity = int(input())
days = int(input())
total_spirit = 0
total_cost = 0
for day in range(2, days+1):
if day % 11 == 0:
quantity += 2
if day % 2 == 0:
total_spirit += 5
total_cost += decoration_prices['ornament set'] * quantity
if day % 3 == 0:
total_spirit += 13
total_cost += (
decoration_prices['tree skirt'] +
decoration_prices['tree garlands']
) * quantity
if day % 5 == 0:
total_spirit += 17
total_cost += decoration_prices['tree lights'] * quantity
if day % 3 == 0:
total_spirit += 30
if day % 10 == 0:
total_spirit -= 20
total_cost += (
decoration_prices['tree skirt'] +
decoration_prices['tree garlands'] +
decoration_prices['tree lights']
)
if day == days:
total_spirit -= 30
print(f'cost {total_cost}')
print(f'spirit {total_spirit}')
| decoration_prices = {'ornament set': 2, 'tree skirt': 5, 'tree garlands': 3, 'tree lights': 15}
quantity = int(input())
days = int(input())
total_spirit = 0
total_cost = 0
for day in range(2, days + 1):
if day % 11 == 0:
quantity += 2
if day % 2 == 0:
total_spirit += 5
total_cost += decoration_prices['ornament set'] * quantity
if day % 3 == 0:
total_spirit += 13
total_cost += (decoration_prices['tree skirt'] + decoration_prices['tree garlands']) * quantity
if day % 5 == 0:
total_spirit += 17
total_cost += decoration_prices['tree lights'] * quantity
if day % 3 == 0:
total_spirit += 30
if day % 10 == 0:
total_spirit -= 20
total_cost += decoration_prices['tree skirt'] + decoration_prices['tree garlands'] + decoration_prices['tree lights']
if day == days:
total_spirit -= 30
print(f'cost {total_cost}')
print(f'spirit {total_spirit}') |
# Leetcode 35. Search Insert Position
#
# Link: https://leetcode.com/problems/search-insert-position/
# Difficulty: Easy
# Solution using BinarySearch
# Complexity:
# O(logN) time | where N represent the number of elements in the input array
# O(1) space
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
left, right = 0, len(nums) - 1
while left <= right:
pivot = (left + right) // 2
if nums[pivot] > target:
right = pivot - 1
elif nums[pivot] < target:
left = pivot + 1
else:
return pivot
return left
| class Solution:
def search_insert(self, nums: List[int], target: int) -> int:
(left, right) = (0, len(nums) - 1)
while left <= right:
pivot = (left + right) // 2
if nums[pivot] > target:
right = pivot - 1
elif nums[pivot] < target:
left = pivot + 1
else:
return pivot
return left |
def darken(hex_str: str, amount: int) -> str:
rgb = hex_to_rgb(hex_str)
rgb_result = tuple(map(lambda x: clamp(x - amount, 0, 255), rgb))
return rgb_to_hex(rgb_result)
def hex_to_rgb(hex_str: str) -> tuple:
hex_ = hex_str.lstrip('#')
return tuple(int(hex_[i:i+2], 16) for i in (0, 2, 4))
def rgb_to_hex(rgb: tuple) -> str:
return '#' + ''.join(map(lambda x: (str(hex(x))[2:4]).zfill(2), rgb))
def clamp(value: int, min_: int, max_: int) -> int:
return min(max_, max(min_, value))
| def darken(hex_str: str, amount: int) -> str:
rgb = hex_to_rgb(hex_str)
rgb_result = tuple(map(lambda x: clamp(x - amount, 0, 255), rgb))
return rgb_to_hex(rgb_result)
def hex_to_rgb(hex_str: str) -> tuple:
hex_ = hex_str.lstrip('#')
return tuple((int(hex_[i:i + 2], 16) for i in (0, 2, 4)))
def rgb_to_hex(rgb: tuple) -> str:
return '#' + ''.join(map(lambda x: str(hex(x))[2:4].zfill(2), rgb))
def clamp(value: int, min_: int, max_: int) -> int:
return min(max_, max(min_, value)) |
# spread
# Manas Dash
# 24th aug 2020
# Implements javascript's [].concat(...arr). Flattens the list(non-deep) and returns a list.
def spread(arg):
ret = []
for i in arg:
if isinstance(i, list):
ret.extend(i)
else:
ret.append(i)
return ret
print(spread([1, 2, 3, [4, 5, 6], [7], 8, 9]))
print(spread(['The', 'quick', 'brown', ['fox', 'jumps', 'over'], ['the'], 'lazy', 'dog']))
# Output
# [1,2,3,4,5,6,7,8,9]
# ['The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']
| def spread(arg):
ret = []
for i in arg:
if isinstance(i, list):
ret.extend(i)
else:
ret.append(i)
return ret
print(spread([1, 2, 3, [4, 5, 6], [7], 8, 9]))
print(spread(['The', 'quick', 'brown', ['fox', 'jumps', 'over'], ['the'], 'lazy', 'dog'])) |
# testnet_nanoswap_pools = {(77279127, 77279142): 77282939} # (asset1_id, asset2_id) -> app_id
ASSET1_ID = 77279127
ASSET2_ID = 77279142
# Test UST asset
# Set to zero to initialize a new test asset
USTEST_ID = 0
# USTEST_ID = 85382910
# USTEST_ID = 80691763
# MetaPool App Id
# Set to zero to initialize a new metapool
METAPOOL_APP_ID = 0
# METAPOOL_APP_ID = 85383055
# METAPOOL_APP_ID = 83592564
# metaswap_contract_id = 81880111
# Default Pool argument
MIN_INCREMENT = 1000
FEE_BPS = 30
| asset1_id = 77279127
asset2_id = 77279142
ustest_id = 0
metapool_app_id = 0
min_increment = 1000
fee_bps = 30 |
num = int(input())
isHave = False
for i in range(1, 31):
for j in range(1, 31):
for k in range(1, 31):
if i < j < k:
sum = i + j + k
if sum == num:
print(f'{i} + {j} + {k} = {sum}')
isHave=True
if i > j > k:
sum = i * j * k
if sum == num:
print(f'{i} * {j} * {k} = {sum}')
isHave=True
if not isHave:
print('No!')
# for i in range(3, num+1):
# for j in range(2, num):
# if j > i:
# continue
# for k in range(1, num - 1):
# if i > j > k:
# sum = i * j * k
# if sum == num:
# print(f'{i} * {j} * {k} = {sum}') | num = int(input())
is_have = False
for i in range(1, 31):
for j in range(1, 31):
for k in range(1, 31):
if i < j < k:
sum = i + j + k
if sum == num:
print(f'{i} + {j} + {k} = {sum}')
is_have = True
if i > j > k:
sum = i * j * k
if sum == num:
print(f'{i} * {j} * {k} = {sum}')
is_have = True
if not isHave:
print('No!') |
expected_output = {
"license_usage": {
"network-premier_5G": {
"entitlement": "ESR_P_5G_P",
"count": "1",
"status": "IN USE"
},
"dna-premier_5G": {
"entitlement": "DNA_P_5G_P",
"count": "1",
"status": "IN USE"
},
"hseck9": {
"entitlement": "DNA_HSEC",
"count": "1",
"status": "IN USE"
}
}
}
| expected_output = {'license_usage': {'network-premier_5G': {'entitlement': 'ESR_P_5G_P', 'count': '1', 'status': 'IN USE'}, 'dna-premier_5G': {'entitlement': 'DNA_P_5G_P', 'count': '1', 'status': 'IN USE'}, 'hseck9': {'entitlement': 'DNA_HSEC', 'count': '1', 'status': 'IN USE'}}} |
class Node:
def __init__(self, label, before, after):
self.label = label
self.before = before
self.after = after
def __repr__(self):
return f'{self.label}'
# Build the circular list
line = input()
first = Node(int(line[0]), None, None)
last = first
for label in line[1:]:
node = Node(int(label), last, None)
last.after = node
last = node
first.before = last
last.after = first
cur = first
for i in range(100):
# Splice the next three cups
splice_start = cur.after
splice_end = splice_start.after.after
cur.after = splice_end.after
splice_end.after.before = cur
# Find the destination cup
dest = cur.after
goal = cur.label - 1 if cur.label != 1 else 9
while dest.label != goal:
dest = dest.after
if dest.label != goal and dest == cur:
goal = goal - 1 if goal != 1 else 9
# Place the three cups after the destination
dest.after.before = splice_end
splice_end.after = dest.after
dest.after = splice_start
splice_start.before = dest
# Advance to the next cup
cur = cur.after
# Display the list after cup one
cup_one = first
while cup_one.label != 1:
cup_one = cup_one.after
cur = cup_one.after
while cur != cup_one:
print(cur.label, end='')
cur = cur.after
print()
| class Node:
def __init__(self, label, before, after):
self.label = label
self.before = before
self.after = after
def __repr__(self):
return f'{self.label}'
line = input()
first = node(int(line[0]), None, None)
last = first
for label in line[1:]:
node = node(int(label), last, None)
last.after = node
last = node
first.before = last
last.after = first
cur = first
for i in range(100):
splice_start = cur.after
splice_end = splice_start.after.after
cur.after = splice_end.after
splice_end.after.before = cur
dest = cur.after
goal = cur.label - 1 if cur.label != 1 else 9
while dest.label != goal:
dest = dest.after
if dest.label != goal and dest == cur:
goal = goal - 1 if goal != 1 else 9
dest.after.before = splice_end
splice_end.after = dest.after
dest.after = splice_start
splice_start.before = dest
cur = cur.after
cup_one = first
while cup_one.label != 1:
cup_one = cup_one.after
cur = cup_one.after
while cur != cup_one:
print(cur.label, end='')
cur = cur.after
print() |
class HJ():
def __init__(self, val, n,i):
self.g = [0.0]*n
self.g[i] = 1.0
self.f = val
class Parametrization():
def __init__(self):
self.parameters = {}
self.variable_indices = {}
def add_parameter(self, key, value, is_variable=False):
if key in self.parameters:
raise RuntimeError("Key {} already exists!".format(key))
self.parameters[key] = (value, is_variable)
def __getitem__(self, key):
return self.parameters[key][0]
def initialize(self):
for key, val in self.parameters.items():
if val[1]:
self.variable_indices[key] = len(self.variable_indices)
for key, i in self.variable_indices.items():
self.parameters[key] = HJ(self.parameters[key][0],len(self.variable_indices), i)
def get_variables(self):
x = []
for key in self.variable_indices.keys():
x.append(self.parameters[key])
return x
def update(self, x):
for key, i in self.variable_indices.items():
self.parameters[key] = x[i]
parameters = Parametrization()
parameters.add_parameter("l1", 10.0)
parameters.add_parameter("l2", 10.0)
parameters.add_parameter("h1", 1.0, is_variable=True)
parameters.add_parameter("h2", 2.0, is_variable=True)
parameters.add_parameter("b1", 0.5)
parameters.add_parameter("b2", 0.5)
parameters.initialize()
print(parameters.parameters)
x = parameters.get_variables()
print(x)
new_x = ["new1", "new2"]
parameters.update(new_x)
print(parameters.parameters)
x = parameters.get_variables()
print(x) | class Hj:
def __init__(self, val, n, i):
self.g = [0.0] * n
self.g[i] = 1.0
self.f = val
class Parametrization:
def __init__(self):
self.parameters = {}
self.variable_indices = {}
def add_parameter(self, key, value, is_variable=False):
if key in self.parameters:
raise runtime_error('Key {} already exists!'.format(key))
self.parameters[key] = (value, is_variable)
def __getitem__(self, key):
return self.parameters[key][0]
def initialize(self):
for (key, val) in self.parameters.items():
if val[1]:
self.variable_indices[key] = len(self.variable_indices)
for (key, i) in self.variable_indices.items():
self.parameters[key] = hj(self.parameters[key][0], len(self.variable_indices), i)
def get_variables(self):
x = []
for key in self.variable_indices.keys():
x.append(self.parameters[key])
return x
def update(self, x):
for (key, i) in self.variable_indices.items():
self.parameters[key] = x[i]
parameters = parametrization()
parameters.add_parameter('l1', 10.0)
parameters.add_parameter('l2', 10.0)
parameters.add_parameter('h1', 1.0, is_variable=True)
parameters.add_parameter('h2', 2.0, is_variable=True)
parameters.add_parameter('b1', 0.5)
parameters.add_parameter('b2', 0.5)
parameters.initialize()
print(parameters.parameters)
x = parameters.get_variables()
print(x)
new_x = ['new1', 'new2']
parameters.update(new_x)
print(parameters.parameters)
x = parameters.get_variables()
print(x) |
{
'targets': [{
'target_name': 'yatm',
'sources': [
'src/yatm.cc',
'src/image.cc',
'src/transform.cc'
],
'include_dirs': [
'<!(node -e "require(\'nan\')")',
'deps/include/glib-2.0',
'deps/include',
'deps/lib/glib-2.0/include'
],
'libraries': [
'../deps/lib/libvips-cpp.so',
'../deps/lib/libvips.so',
'-Wl,-rpath=\'$${ORIGIN}/../../deps/lib\''
],
'defines': [
'_GLIBCXX_USE_CXX11_ABI=0'
],
'cflags_cc': [
'-fexceptions',
'-std=c++0x',
'-Wall',
'-O3'
]
}]
}
| {'targets': [{'target_name': 'yatm', 'sources': ['src/yatm.cc', 'src/image.cc', 'src/transform.cc'], 'include_dirs': ['<!(node -e "require(\'nan\')")', 'deps/include/glib-2.0', 'deps/include', 'deps/lib/glib-2.0/include'], 'libraries': ['../deps/lib/libvips-cpp.so', '../deps/lib/libvips.so', "-Wl,-rpath='$${ORIGIN}/../../deps/lib'"], 'defines': ['_GLIBCXX_USE_CXX11_ABI=0'], 'cflags_cc': ['-fexceptions', '-std=c++0x', '-Wall', '-O3']}]} |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
def str0(n): return str(n) if n > 9 else '0%s' % n
def strh(t): return '%s:%s' % ( str0(int(t/60)), str0(t % 60) )
| def str0(n):
return str(n) if n > 9 else '0%s' % n
def strh(t):
return '%s:%s' % (str0(int(t / 60)), str0(t % 60)) |
class Address:
def __init__(self):
self.city: str = ""
self.street: str = ""
self.telephone: str = ""
@classmethod
def from_xml(cls, node):
address = cls()
address.init_from_xml(node)
return address
def init_from_xml(self, node):
self.city = node.attrib['city']
self.street = node.attrib['street']
self.telephone = node.attrib['telephone']
| class Address:
def __init__(self):
self.city: str = ''
self.street: str = ''
self.telephone: str = ''
@classmethod
def from_xml(cls, node):
address = cls()
address.init_from_xml(node)
return address
def init_from_xml(self, node):
self.city = node.attrib['city']
self.street = node.attrib['street']
self.telephone = node.attrib['telephone'] |
def acronym_buster(message):
acronyms = {
'CTA': 'call to action',
'EOD': 'the end of the day',
'IAM': 'in a meeting',
'KPI': 'key performance indicators',
'NRN': 'no reply necessary',
'OOO': 'out of office',
'SWOT': 'strengths, weaknesses, opportunities and threats',
'TBD': 'to be decided',
'WAH': 'work at home'
}
result = []
for sentence in message.split('.'):
tmp = []
for i, word in enumerate(sentence.split()):
if word.isupper() and len(word) > 2:
try:
word = acronyms[word]
except KeyError:
return ('{} is an acronym. I do not like acronyms. Please'
' remove them from your email.'.format(word))
tmp.append(word[0].upper() + word[1:] if i == 0 else word)
result.append(' '.join(tmp))
return '. '.join(result).rstrip()
| def acronym_buster(message):
acronyms = {'CTA': 'call to action', 'EOD': 'the end of the day', 'IAM': 'in a meeting', 'KPI': 'key performance indicators', 'NRN': 'no reply necessary', 'OOO': 'out of office', 'SWOT': 'strengths, weaknesses, opportunities and threats', 'TBD': 'to be decided', 'WAH': 'work at home'}
result = []
for sentence in message.split('.'):
tmp = []
for (i, word) in enumerate(sentence.split()):
if word.isupper() and len(word) > 2:
try:
word = acronyms[word]
except KeyError:
return '{} is an acronym. I do not like acronyms. Please remove them from your email.'.format(word)
tmp.append(word[0].upper() + word[1:] if i == 0 else word)
result.append(' '.join(tmp))
return '. '.join(result).rstrip() |
# -*- coding: utf-8 -*-
"""Top-level package for PyPITest."""
__author__ = """Wanhu Tang"""
__email__ = 'test@test.com'
__version__ = '0.1.0'
| """Top-level package for PyPITest."""
__author__ = 'Wanhu Tang'
__email__ = 'test@test.com'
__version__ = '0.1.0' |
class Parser:
def __new__(self, args: str = None):
r = {}
if args is None:
r['status'] = None
else:
r['status'] = True
if len(args.split(' ')) == 1:
r = {
0: args
}
else:
r = {0: args.split(' ')[0]}
for each in args.split(' '):
if each.startswith('-'):
r[each] = args.split(' ')\
[list(args.split(' ')).index(each)+1]
return r | class Parser:
def __new__(self, args: str=None):
r = {}
if args is None:
r['status'] = None
else:
r['status'] = True
if len(args.split(' ')) == 1:
r = {0: args}
else:
r = {0: args.split(' ')[0]}
for each in args.split(' '):
if each.startswith('-'):
r[each] = args.split(' ')[list(args.split(' ')).index(each) + 1]
return r |
{
"targets": [
{
"target_name": "diskfree",
"sources": [
"./src/disk-gyp.cpp",
"./src/disk.cpp"
],
},
],
}
| {'targets': [{'target_name': 'diskfree', 'sources': ['./src/disk-gyp.cpp', './src/disk.cpp']}]} |
rolls = input().split()
sum_dict = dict()
max = 0
for i in range(1, int(rolls[0]) + 1):
for j in range(1, int(rolls[1]) + 1):
sum = i + j
if sum not in sum_dict:
sum_dict[sum] = 0
else:
sum_dict[sum] += 1
if sum_dict[sum] > max:
max = sum_dict[sum]
for i in sum_dict:
if sum_dict[i] == max:
print(i) | rolls = input().split()
sum_dict = dict()
max = 0
for i in range(1, int(rolls[0]) + 1):
for j in range(1, int(rolls[1]) + 1):
sum = i + j
if sum not in sum_dict:
sum_dict[sum] = 0
else:
sum_dict[sum] += 1
if sum_dict[sum] > max:
max = sum_dict[sum]
for i in sum_dict:
if sum_dict[i] == max:
print(i) |
VOTING_MAJORITY = 0.51
CONSENSUS_TYPES = {
0: '0: kick',
1: '1: make admin',
2: '2: revoke admin',
3: '3: add longevity',
4: '4: remove longevity'
}
| voting_majority = 0.51
consensus_types = {0: '0: kick', 1: '1: make admin', 2: '2: revoke admin', 3: '3: add longevity', 4: '4: remove longevity'} |
class TrayError(Exception):
def __init__(self, value, caller=None):
self.value = value
self.caller = caller
def __str__(self):
return repr(self.value)
class NoObservationError(TrayError):
pass
class NoUndoError(TrayError):
pass
class PropertyNotFoundError(TrayError):
pass
class PropertyNotFoundError(TrayError):
pass
class DoubleEmptyRecordError(TrayError):
pass
class NoZipFileError(TrayError):
pass
class BurnInBackgroundError(TrayError):
pass | class Trayerror(Exception):
def __init__(self, value, caller=None):
self.value = value
self.caller = caller
def __str__(self):
return repr(self.value)
class Noobservationerror(TrayError):
pass
class Noundoerror(TrayError):
pass
class Propertynotfounderror(TrayError):
pass
class Propertynotfounderror(TrayError):
pass
class Doubleemptyrecorderror(TrayError):
pass
class Nozipfileerror(TrayError):
pass
class Burninbackgrounderror(TrayError):
pass |
"""Switch between Google or open source dependencies."""
# Switch between Google and OSS dependencies
USE_OSS = True
# Per-dependency switches determining whether each dependency is ready
# to be replaced by its OSS equivalence.
# TODO(danmane,mrry,opensource): Flip these switches, then remove them
OSS_APP = True
OSS_FLAGS = True
OSS_GFILE = True
OSS_GOOGLETEST = True
OSS_LOGGING = True
OSS_PARAMETERIZED = True
| """Switch between Google or open source dependencies."""
use_oss = True
oss_app = True
oss_flags = True
oss_gfile = True
oss_googletest = True
oss_logging = True
oss_parameterized = True |
"""This is the starting point for a Python package.
"""
__version__ = '0.0.1'
| """This is the starting point for a Python package.
"""
__version__ = '0.0.1' |
class Solution(object):
def restoreIpAddresses(self, s):
"""
:type s: str
:rtype: List[str]
"""
return self.restoreHelper(s, 0, len(s))
def restoreHelper(self, s, index, length, string="", dot=0):
result = []
if dot == 3:
if int(s[index:]) <= 255 and (s[index] != "0" or length == 1):
return [string + s[index:]]
else:
for i in range(1, min(length, 4)):
num = s[index:index+i]
if int(num) <= 255 and (s[index] != "0" or i == 1):
result += self.restoreHelper(s, index+i, length-i, string+num+".", dot+1)
return result | class Solution(object):
def restore_ip_addresses(self, s):
"""
:type s: str
:rtype: List[str]
"""
return self.restoreHelper(s, 0, len(s))
def restore_helper(self, s, index, length, string='', dot=0):
result = []
if dot == 3:
if int(s[index:]) <= 255 and (s[index] != '0' or length == 1):
return [string + s[index:]]
else:
for i in range(1, min(length, 4)):
num = s[index:index + i]
if int(num) <= 255 and (s[index] != '0' or i == 1):
result += self.restoreHelper(s, index + i, length - i, string + num + '.', dot + 1)
return result |
def knapsack(items, maxweight):
N = len(items)
W = maxweight
bestvalues = [[0] * (W + 1)
for i in range(N + 1)]
for i, (value, weight) in enumerate(items):
for capacity in range(maxweight + 1):
if weight > capacity:
bestvalues[i + 1][capacity] = bestvalues[i][capacity]
else:
candidate1 = bestvalues[i][capacity]
candidate2 = bestvalues[i][capacity - weight] + value
bestvalues[i + 1][capacity] = max(candidate1, candidate2)
reconstruction = []
j = maxweight
for i in range(N, 0, -1):
if bestvalues[i][j] != bestvalues[i - 1][j]:
reconstruction.append(i - 1)
j -= items[i - 1][1]
reconstruction.reverse()
return bestvalues[len(items)][maxweight], reconstruction | def knapsack(items, maxweight):
n = len(items)
w = maxweight
bestvalues = [[0] * (W + 1) for i in range(N + 1)]
for (i, (value, weight)) in enumerate(items):
for capacity in range(maxweight + 1):
if weight > capacity:
bestvalues[i + 1][capacity] = bestvalues[i][capacity]
else:
candidate1 = bestvalues[i][capacity]
candidate2 = bestvalues[i][capacity - weight] + value
bestvalues[i + 1][capacity] = max(candidate1, candidate2)
reconstruction = []
j = maxweight
for i in range(N, 0, -1):
if bestvalues[i][j] != bestvalues[i - 1][j]:
reconstruction.append(i - 1)
j -= items[i - 1][1]
reconstruction.reverse()
return (bestvalues[len(items)][maxweight], reconstruction) |
def getHeadWord():
return {
"Work": ["(Work|WORK)", "(WORK EXPERIENCE|Experience(s?)|EXPERIENCE(S?))", "(History|HISTORY)", "(Projects|PROJECTS)"],
"Education": ["(Education|EDUCATION)", "(Qualifications|QUALIFICATIONS)"],
"Skills": [
"(Skills|SKILLS)",
"(Proficiency|PROFICIENCY)",
"LANGUAGE",
"CERTIFICATION",
"(Skill ?(sets?)|SKILLSET)"
]
} | def get_head_word():
return {'Work': ['(Work|WORK)', '(WORK EXPERIENCE|Experience(s?)|EXPERIENCE(S?))', '(History|HISTORY)', '(Projects|PROJECTS)'], 'Education': ['(Education|EDUCATION)', '(Qualifications|QUALIFICATIONS)'], 'Skills': ['(Skills|SKILLS)', '(Proficiency|PROFICIENCY)', 'LANGUAGE', 'CERTIFICATION', '(Skill ?(sets?)|SKILLSET)']} |
#
# PySNMP MIB module ASCEND-SDSL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-SDSL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:29:09 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
wanTypeSdsl, = mibBuilder.importSymbols("ASCEND-WAN-MIB", "wanTypeSdsl")
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
IpAddress, NotificationType, TimeTicks, Counter64, ModuleIdentity, Gauge32, Integer32, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Counter32, ObjectIdentity, MibIdentifier, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "NotificationType", "TimeTicks", "Counter64", "ModuleIdentity", "Gauge32", "Integer32", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Counter32", "ObjectIdentity", "MibIdentifier", "Bits")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
sdslLineStatusTable = MibTable((1, 3, 6, 1, 4, 1, 529, 4, 8, 1), )
if mibBuilder.loadTexts: sdslLineStatusTable.setStatus('mandatory')
if mibBuilder.loadTexts: sdslLineStatusTable.setDescription('SDSL status parameters.')
sdslLineStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1), ).setIndexNames((0, "ASCEND-SDSL-MIB", "sdslStatusIfEntryIndex"))
if mibBuilder.loadTexts: sdslLineStatusEntry.setStatus('mandatory')
if mibBuilder.loadTexts: sdslLineStatusEntry.setDescription('An interface status entry containing objects to describe the interface.')
sdslStatusIfEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusIfEntryIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusIfEntryIndex.setDescription('Interface group index assigned to this port.')
sdslStatusShelfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusShelfIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusShelfIndex.setDescription("TNT's SDSL modules Shelf ID.")
sdslStatusSlotIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusSlotIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusSlotIndex.setDescription("TNT's SDSL modules Slot ID.")
sdslStatusLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusLineIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusLineIndex.setDescription('SDSL modules line ID.')
sdslStatusUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("other", 1), ("coe", 2), ("cpe", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusUnitType.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusUnitType.setDescription('Unit type defines if the unit is operating either as a Central Office Equipment (COE) or Customer Premiss equipment (CPE).')
sdslStatusLineState = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("other", 1), ("configure", 2), ("deactivate", 3), ("deactive-lost", 4), ("start-up", 5), ("pend-port-up", 6), ("up", 7), ("pend-deactivate", 8), ("out-of-service", 9)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusLineState.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusLineState.setDescription('Interface state describes the current ports operating state. States are: Config, Pend Down, Up, Down, Start-up, or N/A.')
sdslStatusUpRate = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=NamedValues(("m2320000", 2320000), ("m1568000", 1568000), ("m1552000", 1552000), ("m1536000", 1536000), ("m1168000", 1168000), ("m1152000", 1152000), ("m1040000", 1040000), ("k784000", 784000), ("k768000", 768000), ("k528000", 528000), ("k416000", 416000), ("k400000", 400000), ("k384000", 384000), ("k272000", 272000), ("k208000", 208000), ("k192000", 192000), ("k160000", 160000), ("k144000", 144000)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sdslStatusUpRate.setStatus('deprecated')
if mibBuilder.loadTexts: sdslStatusUpRate.setDescription('The current up stream (cpe to coe) rate The object dslStatusUpRate is deprecated. To set line rate the object sdslConfigLineRate of the new sdslLineConfigTable should be used.')
sdslStatusDownRate = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=NamedValues(("m2320000", 2320000), ("m1568000", 1568000), ("m1552000", 1552000), ("m1536000", 1536000), ("m1168000", 1168000), ("m1152000", 1152000), ("m1040000", 1040000), ("k784000", 784000), ("k768000", 768000), ("k528000", 528000), ("k416000", 416000), ("k400000", 400000), ("k384000", 384000), ("k272000", 272000), ("k208000", 208000), ("k192000", 192000), ("k160000", 160000), ("k144000", 144000)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sdslStatusDownRate.setStatus('deprecated')
if mibBuilder.loadTexts: sdslStatusDownRate.setDescription('The current down stream (coe to cpe) rate The object dslStatusDownRate is deprecated. To set line rate the object sdslConfigLineRate of the new sdslLineConfigTable should be used.')
sdslStatusVendorId = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusVendorId.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusVendorId.setDescription('Vendor identification.')
sdslStatusMajorFirmWareVer = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusMajorFirmWareVer.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusMajorFirmWareVer.setDescription('Major firmware version.')
sdslStatusMinorFirmWareVer = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusMinorFirmWareVer.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusMinorFirmWareVer.setDescription('Minor firmware version.')
sdslStatusHardWareVer = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusHardWareVer.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusHardWareVer.setDescription('Hardware version.')
sdslStatusLineRate = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=NamedValues(("unknown", 1), ("m2320000", 2320000), ("m1568000", 1568000), ("m1552000", 1552000), ("m1536000", 1536000), ("m1168000", 1168000), ("m1152000", 1152000), ("m1040000", 1040000), ("k784000", 784000), ("k768000", 768000), ("k528000", 528000), ("k416000", 416000), ("k400000", 400000), ("k384000", 384000), ("k272000", 272000), ("k208000", 208000), ("k192000", 192000), ("k160000", 160000), ("k144000", 144000)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatusLineRate.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatusLineRate.setDescription('The current line rate')
sdslLineStatisticTable = MibTable((1, 3, 6, 1, 4, 1, 529, 4, 8, 2), )
if mibBuilder.loadTexts: sdslLineStatisticTable.setStatus('mandatory')
if mibBuilder.loadTexts: sdslLineStatisticTable.setDescription('SDSL statistical parameters.')
sdslLineStatisticEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1), ).setIndexNames((0, "ASCEND-SDSL-MIB", "sdslStatIfEntryIndex"))
if mibBuilder.loadTexts: sdslLineStatisticEntry.setStatus('mandatory')
if mibBuilder.loadTexts: sdslLineStatisticEntry.setDescription('An interface statistical entry containing objects to describe the interface.')
sdslStatIfEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatIfEntryIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatIfEntryIndex.setDescription('The interface groups interface index is used to index into this table.')
sdslStatShelfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatShelfIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatShelfIndex.setDescription('SDSL modules Shelf ID.')
sdslStatSlotIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatSlotIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatSlotIndex.setDescription('SDSL modules Slot ID.')
sdslStatLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatLineIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatLineIndex.setDescription('SDSL modules interface ID.')
sdslStatConnUpDays = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatConnUpDays.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatConnUpDays.setDescription('Connection up day count.')
sdslStatConnUpHours = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatConnUpHours.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatConnUpHours.setDescription('Connection Up 24 hour count.')
sdslStatConnUpMinutes = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatConnUpMinutes.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatConnUpMinutes.setDescription('Connection up minute count.')
sdslStatRxSignalPresent = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatRxSignalPresent.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatRxSignalPresent.setDescription('Receive signal present detection.')
sdslStatLineQualityDb = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatLineQualityDb.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatLineQualityDb.setDescription('Lines noise margin. Reliable data will transfer with a reading of -5db or greater.')
sdslStatUpDwnCntr = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatUpDwnCntr.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatUpDwnCntr.setDescription('Line Up Down counter value displays the number of times the interface transitions from a down to up state.')
sdslStatLineSelfTest = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4, 1, 2, 3))).clone(namedValues=NamedValues(("other", 4), ("selfTestFailed", 1), ("localLoopBackFailed", 2), ("passed", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatLineSelfTest.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatLineSelfTest.setDescription('Line hardware self test results (Passed or Failed).')
sdslStatBertTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("one-minute", 1), ("two-minutes", 2), ("three-minutes", 3), ("four-minutes", 4), ("five-minutes", 5), ("ten-minutes", 6), ("fifteen-minutes", 7), ("twenty-minutes", 8), ("thirty-minutes", 9)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sdslStatBertTimer.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatBertTimer.setDescription('BER test duration configuration. The BER test lasts for the duration of this timer.')
sdslStatBertEna = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sdslStatBertEna.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatBertEna.setDescription('Enable/disable of the BER test. If nodes are connected, then the BER test is ran between the units. If this node is not connected to a remote node, then the interface is placed into analog loopback and the BER test is started.')
sdslStatBertState = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("active", 1), ("stopped", 2), ("start-up", 3), ("waiting", 4), ("pend-active", 5), ("bert-los", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatBertState.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatBertState.setDescription("BER test states. When this node is not connected to another node, the test is disabled. When two nodes are connected then the BER test waits for the other node to start it's BER test and then starts collecting bit errors immediately.")
sdslStatBertErrorCounter = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslStatBertErrorCounter.setStatus('mandatory')
if mibBuilder.loadTexts: sdslStatBertErrorCounter.setDescription('BER test bit error counter.')
sdslLineConfigTable = MibTable((1, 3, 6, 1, 4, 1, 529, 4, 8, 3), )
if mibBuilder.loadTexts: sdslLineConfigTable.setStatus('mandatory')
if mibBuilder.loadTexts: sdslLineConfigTable.setDescription('SDSL status parameters.')
sdslLineConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1), ).setIndexNames((0, "ASCEND-SDSL-MIB", "sdslConfigIfEntryIndex"))
if mibBuilder.loadTexts: sdslLineConfigEntry.setStatus('mandatory')
if mibBuilder.loadTexts: sdslLineConfigEntry.setDescription('An interface status entry containing objects to describe the interface.')
sdslConfigIfEntryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslConfigIfEntryIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslConfigIfEntryIndex.setDescription('Interface group index assigned to this port.')
sdslConfigShelfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslConfigShelfIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslConfigShelfIndex.setDescription("TNT's SDSL modules Shelf ID.")
sdslConfigSlotIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslConfigSlotIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslConfigSlotIndex.setDescription("TNT's SDSL modules Slot ID.")
sdslConfigLineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: sdslConfigLineIndex.setStatus('mandatory')
if mibBuilder.loadTexts: sdslConfigLineIndex.setDescription('SDSL modules line ID.')
sdslConfigLineRate = MibTableColumn((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=NamedValues(("unknown", 1), ("m2320000", 2320000), ("m1568000", 1568000), ("m1552000", 1552000), ("m1536000", 1536000), ("m1168000", 1168000), ("m1152000", 1152000), ("m1040000", 1040000), ("k784000", 784000), ("k768000", 768000), ("k528000", 528000), ("k416000", 416000), ("k400000", 400000), ("k384000", 384000), ("k272000", 272000), ("k208000", 208000), ("k192000", 192000), ("k160000", 160000), ("k144000", 144000)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: sdslConfigLineRate.setStatus('mandatory')
if mibBuilder.loadTexts: sdslConfigLineRate.setDescription('The current line rate')
mibBuilder.exportSymbols("ASCEND-SDSL-MIB", sdslConfigShelfIndex=sdslConfigShelfIndex, sdslStatusMajorFirmWareVer=sdslStatusMajorFirmWareVer, sdslStatIfEntryIndex=sdslStatIfEntryIndex, sdslStatRxSignalPresent=sdslStatRxSignalPresent, sdslStatusUnitType=sdslStatusUnitType, sdslLineStatusEntry=sdslLineStatusEntry, sdslStatusHardWareVer=sdslStatusHardWareVer, sdslStatConnUpHours=sdslStatConnUpHours, sdslConfigSlotIndex=sdslConfigSlotIndex, sdslStatBertErrorCounter=sdslStatBertErrorCounter, sdslStatusUpRate=sdslStatusUpRate, sdslStatusShelfIndex=sdslStatusShelfIndex, sdslStatConnUpMinutes=sdslStatConnUpMinutes, sdslStatusLineState=sdslStatusLineState, sdslStatusMinorFirmWareVer=sdslStatusMinorFirmWareVer, sdslStatusVendorId=sdslStatusVendorId, sdslStatLineQualityDb=sdslStatLineQualityDb, sdslStatLineSelfTest=sdslStatLineSelfTest, sdslStatConnUpDays=sdslStatConnUpDays, sdslLineStatisticEntry=sdslLineStatisticEntry, sdslStatBertEna=sdslStatBertEna, sdslStatBertState=sdslStatBertState, sdslStatShelfIndex=sdslStatShelfIndex, sdslConfigLineRate=sdslConfigLineRate, sdslStatBertTimer=sdslStatBertTimer, sdslLineConfigTable=sdslLineConfigTable, sdslStatusLineIndex=sdslStatusLineIndex, sdslLineStatusTable=sdslLineStatusTable, sdslConfigIfEntryIndex=sdslConfigIfEntryIndex, sdslStatusIfEntryIndex=sdslStatusIfEntryIndex, sdslConfigLineIndex=sdslConfigLineIndex, sdslStatusDownRate=sdslStatusDownRate, sdslStatLineIndex=sdslStatLineIndex, sdslLineConfigEntry=sdslLineConfigEntry, sdslStatusSlotIndex=sdslStatusSlotIndex, sdslStatUpDwnCntr=sdslStatUpDwnCntr, sdslLineStatisticTable=sdslLineStatisticTable, sdslStatSlotIndex=sdslStatSlotIndex, sdslStatusLineRate=sdslStatusLineRate)
| (wan_type_sdsl,) = mibBuilder.importSymbols('ASCEND-WAN-MIB', 'wanTypeSdsl')
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, value_size_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(ip_address, notification_type, time_ticks, counter64, module_identity, gauge32, integer32, unsigned32, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, counter32, object_identity, mib_identifier, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'NotificationType', 'TimeTicks', 'Counter64', 'ModuleIdentity', 'Gauge32', 'Integer32', 'Unsigned32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Counter32', 'ObjectIdentity', 'MibIdentifier', 'Bits')
(textual_convention, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString')
sdsl_line_status_table = mib_table((1, 3, 6, 1, 4, 1, 529, 4, 8, 1))
if mibBuilder.loadTexts:
sdslLineStatusTable.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslLineStatusTable.setDescription('SDSL status parameters.')
sdsl_line_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1)).setIndexNames((0, 'ASCEND-SDSL-MIB', 'sdslStatusIfEntryIndex'))
if mibBuilder.loadTexts:
sdslLineStatusEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslLineStatusEntry.setDescription('An interface status entry containing objects to describe the interface.')
sdsl_status_if_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusIfEntryIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusIfEntryIndex.setDescription('Interface group index assigned to this port.')
sdsl_status_shelf_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusShelfIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusShelfIndex.setDescription("TNT's SDSL modules Shelf ID.")
sdsl_status_slot_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusSlotIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusSlotIndex.setDescription("TNT's SDSL modules Slot ID.")
sdsl_status_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusLineIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusLineIndex.setDescription('SDSL modules line ID.')
sdsl_status_unit_type = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('other', 1), ('coe', 2), ('cpe', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusUnitType.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusUnitType.setDescription('Unit type defines if the unit is operating either as a Central Office Equipment (COE) or Customer Premiss equipment (CPE).')
sdsl_status_line_state = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=named_values(('other', 1), ('configure', 2), ('deactivate', 3), ('deactive-lost', 4), ('start-up', 5), ('pend-port-up', 6), ('up', 7), ('pend-deactivate', 8), ('out-of-service', 9)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusLineState.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusLineState.setDescription('Interface state describes the current ports operating state. States are: Config, Pend Down, Up, Down, Start-up, or N/A.')
sdsl_status_up_rate = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=named_values(('m2320000', 2320000), ('m1568000', 1568000), ('m1552000', 1552000), ('m1536000', 1536000), ('m1168000', 1168000), ('m1152000', 1152000), ('m1040000', 1040000), ('k784000', 784000), ('k768000', 768000), ('k528000', 528000), ('k416000', 416000), ('k400000', 400000), ('k384000', 384000), ('k272000', 272000), ('k208000', 208000), ('k192000', 192000), ('k160000', 160000), ('k144000', 144000)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
sdslStatusUpRate.setStatus('deprecated')
if mibBuilder.loadTexts:
sdslStatusUpRate.setDescription('The current up stream (cpe to coe) rate The object dslStatusUpRate is deprecated. To set line rate the object sdslConfigLineRate of the new sdslLineConfigTable should be used.')
sdsl_status_down_rate = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=named_values(('m2320000', 2320000), ('m1568000', 1568000), ('m1552000', 1552000), ('m1536000', 1536000), ('m1168000', 1168000), ('m1152000', 1152000), ('m1040000', 1040000), ('k784000', 784000), ('k768000', 768000), ('k528000', 528000), ('k416000', 416000), ('k400000', 400000), ('k384000', 384000), ('k272000', 272000), ('k208000', 208000), ('k192000', 192000), ('k160000', 160000), ('k144000', 144000)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
sdslStatusDownRate.setStatus('deprecated')
if mibBuilder.loadTexts:
sdslStatusDownRate.setDescription('The current down stream (coe to cpe) rate The object dslStatusDownRate is deprecated. To set line rate the object sdslConfigLineRate of the new sdslLineConfigTable should be used.')
sdsl_status_vendor_id = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusVendorId.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusVendorId.setDescription('Vendor identification.')
sdsl_status_major_firm_ware_ver = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusMajorFirmWareVer.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusMajorFirmWareVer.setDescription('Major firmware version.')
sdsl_status_minor_firm_ware_ver = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusMinorFirmWareVer.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusMinorFirmWareVer.setDescription('Minor firmware version.')
sdsl_status_hard_ware_ver = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusHardWareVer.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusHardWareVer.setDescription('Hardware version.')
sdsl_status_line_rate = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 1, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=named_values(('unknown', 1), ('m2320000', 2320000), ('m1568000', 1568000), ('m1552000', 1552000), ('m1536000', 1536000), ('m1168000', 1168000), ('m1152000', 1152000), ('m1040000', 1040000), ('k784000', 784000), ('k768000', 768000), ('k528000', 528000), ('k416000', 416000), ('k400000', 400000), ('k384000', 384000), ('k272000', 272000), ('k208000', 208000), ('k192000', 192000), ('k160000', 160000), ('k144000', 144000)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatusLineRate.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatusLineRate.setDescription('The current line rate')
sdsl_line_statistic_table = mib_table((1, 3, 6, 1, 4, 1, 529, 4, 8, 2))
if mibBuilder.loadTexts:
sdslLineStatisticTable.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslLineStatisticTable.setDescription('SDSL statistical parameters.')
sdsl_line_statistic_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1)).setIndexNames((0, 'ASCEND-SDSL-MIB', 'sdslStatIfEntryIndex'))
if mibBuilder.loadTexts:
sdslLineStatisticEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslLineStatisticEntry.setDescription('An interface statistical entry containing objects to describe the interface.')
sdsl_stat_if_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatIfEntryIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatIfEntryIndex.setDescription('The interface groups interface index is used to index into this table.')
sdsl_stat_shelf_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatShelfIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatShelfIndex.setDescription('SDSL modules Shelf ID.')
sdsl_stat_slot_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatSlotIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatSlotIndex.setDescription('SDSL modules Slot ID.')
sdsl_stat_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatLineIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatLineIndex.setDescription('SDSL modules interface ID.')
sdsl_stat_conn_up_days = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatConnUpDays.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatConnUpDays.setDescription('Connection up day count.')
sdsl_stat_conn_up_hours = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatConnUpHours.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatConnUpHours.setDescription('Connection Up 24 hour count.')
sdsl_stat_conn_up_minutes = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatConnUpMinutes.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatConnUpMinutes.setDescription('Connection up minute count.')
sdsl_stat_rx_signal_present = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatRxSignalPresent.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatRxSignalPresent.setDescription('Receive signal present detection.')
sdsl_stat_line_quality_db = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatLineQualityDb.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatLineQualityDb.setDescription('Lines noise margin. Reliable data will transfer with a reading of -5db or greater.')
sdsl_stat_up_dwn_cntr = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatUpDwnCntr.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatUpDwnCntr.setDescription('Line Up Down counter value displays the number of times the interface transitions from a down to up state.')
sdsl_stat_line_self_test = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(4, 1, 2, 3))).clone(namedValues=named_values(('other', 4), ('selfTestFailed', 1), ('localLoopBackFailed', 2), ('passed', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatLineSelfTest.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatLineSelfTest.setDescription('Line hardware self test results (Passed or Failed).')
sdsl_stat_bert_timer = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=named_values(('one-minute', 1), ('two-minutes', 2), ('three-minutes', 3), ('four-minutes', 4), ('five-minutes', 5), ('ten-minutes', 6), ('fifteen-minutes', 7), ('twenty-minutes', 8), ('thirty-minutes', 9)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
sdslStatBertTimer.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatBertTimer.setDescription('BER test duration configuration. The BER test lasts for the duration of this timer.')
sdsl_stat_bert_ena = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('no', 1), ('yes', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
sdslStatBertEna.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatBertEna.setDescription('Enable/disable of the BER test. If nodes are connected, then the BER test is ran between the units. If this node is not connected to a remote node, then the interface is placed into analog loopback and the BER test is started.')
sdsl_stat_bert_state = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 14), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('active', 1), ('stopped', 2), ('start-up', 3), ('waiting', 4), ('pend-active', 5), ('bert-los', 6)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatBertState.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatBertState.setDescription("BER test states. When this node is not connected to another node, the test is disabled. When two nodes are connected then the BER test waits for the other node to start it's BER test and then starts collecting bit errors immediately.")
sdsl_stat_bert_error_counter = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 2, 1, 15), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslStatBertErrorCounter.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslStatBertErrorCounter.setDescription('BER test bit error counter.')
sdsl_line_config_table = mib_table((1, 3, 6, 1, 4, 1, 529, 4, 8, 3))
if mibBuilder.loadTexts:
sdslLineConfigTable.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslLineConfigTable.setDescription('SDSL status parameters.')
sdsl_line_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1)).setIndexNames((0, 'ASCEND-SDSL-MIB', 'sdslConfigIfEntryIndex'))
if mibBuilder.loadTexts:
sdslLineConfigEntry.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslLineConfigEntry.setDescription('An interface status entry containing objects to describe the interface.')
sdsl_config_if_entry_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslConfigIfEntryIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslConfigIfEntryIndex.setDescription('Interface group index assigned to this port.')
sdsl_config_shelf_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslConfigShelfIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslConfigShelfIndex.setDescription("TNT's SDSL modules Shelf ID.")
sdsl_config_slot_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslConfigSlotIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslConfigSlotIndex.setDescription("TNT's SDSL modules Slot ID.")
sdsl_config_line_index = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
sdslConfigLineIndex.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslConfigLineIndex.setDescription('SDSL modules line ID.')
sdsl_config_line_rate = mib_table_column((1, 3, 6, 1, 4, 1, 529, 4, 8, 3, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2320000, 1568000, 1552000, 1536000, 1168000, 1152000, 1040000, 784000, 768000, 528000, 416000, 400000, 384000, 272000, 208000, 192000, 160000, 144000))).clone(namedValues=named_values(('unknown', 1), ('m2320000', 2320000), ('m1568000', 1568000), ('m1552000', 1552000), ('m1536000', 1536000), ('m1168000', 1168000), ('m1152000', 1152000), ('m1040000', 1040000), ('k784000', 784000), ('k768000', 768000), ('k528000', 528000), ('k416000', 416000), ('k400000', 400000), ('k384000', 384000), ('k272000', 272000), ('k208000', 208000), ('k192000', 192000), ('k160000', 160000), ('k144000', 144000)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
sdslConfigLineRate.setStatus('mandatory')
if mibBuilder.loadTexts:
sdslConfigLineRate.setDescription('The current line rate')
mibBuilder.exportSymbols('ASCEND-SDSL-MIB', sdslConfigShelfIndex=sdslConfigShelfIndex, sdslStatusMajorFirmWareVer=sdslStatusMajorFirmWareVer, sdslStatIfEntryIndex=sdslStatIfEntryIndex, sdslStatRxSignalPresent=sdslStatRxSignalPresent, sdslStatusUnitType=sdslStatusUnitType, sdslLineStatusEntry=sdslLineStatusEntry, sdslStatusHardWareVer=sdslStatusHardWareVer, sdslStatConnUpHours=sdslStatConnUpHours, sdslConfigSlotIndex=sdslConfigSlotIndex, sdslStatBertErrorCounter=sdslStatBertErrorCounter, sdslStatusUpRate=sdslStatusUpRate, sdslStatusShelfIndex=sdslStatusShelfIndex, sdslStatConnUpMinutes=sdslStatConnUpMinutes, sdslStatusLineState=sdslStatusLineState, sdslStatusMinorFirmWareVer=sdslStatusMinorFirmWareVer, sdslStatusVendorId=sdslStatusVendorId, sdslStatLineQualityDb=sdslStatLineQualityDb, sdslStatLineSelfTest=sdslStatLineSelfTest, sdslStatConnUpDays=sdslStatConnUpDays, sdslLineStatisticEntry=sdslLineStatisticEntry, sdslStatBertEna=sdslStatBertEna, sdslStatBertState=sdslStatBertState, sdslStatShelfIndex=sdslStatShelfIndex, sdslConfigLineRate=sdslConfigLineRate, sdslStatBertTimer=sdslStatBertTimer, sdslLineConfigTable=sdslLineConfigTable, sdslStatusLineIndex=sdslStatusLineIndex, sdslLineStatusTable=sdslLineStatusTable, sdslConfigIfEntryIndex=sdslConfigIfEntryIndex, sdslStatusIfEntryIndex=sdslStatusIfEntryIndex, sdslConfigLineIndex=sdslConfigLineIndex, sdslStatusDownRate=sdslStatusDownRate, sdslStatLineIndex=sdslStatLineIndex, sdslLineConfigEntry=sdslLineConfigEntry, sdslStatusSlotIndex=sdslStatusSlotIndex, sdslStatUpDwnCntr=sdslStatUpDwnCntr, sdslLineStatisticTable=sdslLineStatisticTable, sdslStatSlotIndex=sdslStatSlotIndex, sdslStatusLineRate=sdslStatusLineRate) |
'''
Kattis - powereggs
Actually a hard problem, but we read the explanation in CP4 to get this super efficient solution
that runs in O(32*k).
Time: O(32k), Space: O(1)'''
def f(d, k): # number of floors we can determine with d drops and k eggs
ans = 0
cur = 1 # d choose i
for i in range(1, k+1):
cur = cur * (d-i+1) // i # d choose i = d choose (i-1) * (d-i+1) / i
ans += cur
return ans
num_tc = int(input())
for _ in range(num_tc):
n, k = map(int, input().split())
for i in range(1, 33):
if (f(i, k) >= n): # able to do these many floors
print(i)
break
else:
print("Impossible") | """
Kattis - powereggs
Actually a hard problem, but we read the explanation in CP4 to get this super efficient solution
that runs in O(32*k).
Time: O(32k), Space: O(1)"""
def f(d, k):
ans = 0
cur = 1
for i in range(1, k + 1):
cur = cur * (d - i + 1) // i
ans += cur
return ans
num_tc = int(input())
for _ in range(num_tc):
(n, k) = map(int, input().split())
for i in range(1, 33):
if f(i, k) >= n:
print(i)
break
else:
print('Impossible') |
class DictPopper:
def __init__(self, d):
self.__d = d
self.__data = dict()
def __iter__(self):
def f(pair):
return self.__d.pop(*pair)
return map(f, self.__data.items())
def add(self, key, default = None, spreadKey = False):
for k in (key, ) if not spreadKey else key:
self.__data[k] = default
return self
| class Dictpopper:
def __init__(self, d):
self.__d = d
self.__data = dict()
def __iter__(self):
def f(pair):
return self.__d.pop(*pair)
return map(f, self.__data.items())
def add(self, key, default=None, spreadKey=False):
for k in (key,) if not spreadKey else key:
self.__data[k] = default
return self |
def isPalindrome(x: int):
if str(x) == str(x)[::-1]:
return True
else:
return False
print(isPalindrome(20011002))
| def is_palindrome(x: int):
if str(x) == str(x)[::-1]:
return True
else:
return False
print(is_palindrome(20011002)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.