content
stringlengths
7
1.05M
# -----------------------Path related parameters--------------------------------------- train_ct_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/train/ct' # CT data path of the original training set train_seg_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/train/seg' # Original training set labeled data path test_ct_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/dataset/test/ct' # CT data path of the original test set test_seg_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/dataset/test/seg/' # Original test set labeled data path training_set_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/data_prepare/train/' # Adresse de stockage des données utilisée pour former le réseau pred_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/dataset/test/liver_pred' # Save path of network prediction results crf_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/test/crf' # CRF optimization result save path module_path = '/content/gdrive/My Drive/MICCAI-LITS2017-master/module/net550-0.251-0.231.pth' # / Test model path # -----------------------Path related parameters--------------- ------------------------ # ---------------------Training data to obtain relevant parameters----------------------------------- size = 48 # Use 48 consecutive slices as input to the network down_scale = 0.5 # Cross-sectional downsampling factor expand_slice = 20 # Cross-sectional downsampling factor... slice_thickness = 1 # Normalize the spacing of all data on the z-axis to 1mm upper, lower = 200, -200 # CT data gray cut window # ---------------------Training data to obtain relevant parameters----------------------------------- # -----------------------Network structure related parameters------------------------------------ drop_rate = 0.3 # dropout random drop probability # -----------------------Network structure related parameters------------------------------------ # ---------------------Network training related parameters-------------------------------------- gpu = '0' # The serial number of the graphics card used Epoch = 20 learning_rate = 1e-3 learning_rate_decay = [500, 750] alpha = 0.33 # In-depth supervision attenuation coefficient batch_size = 1 num_workers = 3 pin_memory = True cudnn_benchmark = True # ---------------------Network training related parameters-------------------------------------- # ----------------------Model test related parameters------------------------------------- threshold = 0.5 # Threshold stride = 12 # Sliding sampling step maximum_hole = 5e4 # Largest void area # ----------------------Model test related parameters------------------------------------- # ---------------------CRF post-processing optimization related parameters---------------------------------- z_expand, x_expand, y_expand = 10, 30, 30 # The number of expansions in three directions based on the predicted results max_iter = 20 # CRF iterations s1, s2, s3 = 1, 10, 10 # CRF Gaussian kernel parameters # ---------------------CRF post-processing optimization related parameters----------------------------------
print("Enter the no of rows: ") n = int(input()) for i in range(n): count = 0 flag = 0 for j in range(n): if(i==j): flag = 1 if(flag==1): print(n-count, end=" ") count+=1 if(flag!=1): print("1",end=" ") print() # Enter the no of rows: # 5 # 5 4 3 2 1 # 1 5 4 3 2 # 1 1 5 4 3 # 1 1 1 5 4 # 1 1 1 1 5
I=input k=int(I()) l=int(I()) r=1 while k**r<l:r+=1 print(['NO','YES\n'+str(r-1)][k**r==l])
bot_is_not_admin = 'Ой! Для того, чтобы бот мог менять название беседы, нужно сделать его админом.' setting = 'Для настройки смены названия для вашей беседы введите, разделяя вертикальной ' \ 'чертой "@wchanger Название чётной недели | Название нечётной недели"' success = 'Бот успешно настроен и теперь будет менять название беседы!' greeting = 'Привет! ' + setting + ' Не забудь сделать бота админом!' user_is_not_admin = 'Извини, настроить бота могут только админы 😕' error = 'Упс! Команда не распознана 😕'
# Advance Lists my_list = [1, 2, 3] # Add element print('\n# Add element\n') my_list.append(4) my_list.append(4) print(my_list) # Count element's occurrences print('\n# Count element\'s occurrences\n') print(f'2 = {my_list.count(2)}') print(f'4 = {my_list.count(4)}') print(f'5 = {my_list.count(5)}') # Extend print('\n# Extend\n') x = [1, 2, 3] x.append([4, 5]) print(f'Use append = {x}') x = [1, 2, 3] x.extend([4, 5]) print(f'Use Extend = {x}') # Index print('\n# Index\n') print(f'List = {my_list}') print(f'Index of 2 = {my_list.index(2)}') print(f'Index of 4 = {my_list.index(4)}') # Insert print('\n# Insert\n') print(f'List = {my_list}') my_list.insert(2, 'Inserted') print(f'After insert in pos 2 = {my_list}')
#!/usr/bin/env python # coding=utf-8 # author: zengyuetian content_type_json = {'Content-Type': 'application/json'} accept_type_json = {'Accept': 'application/json'} if __name__ == "__main__": pass
# # %CopyrightBegin% # # Copyright Ericsson AB 2013. All Rights Reserved. # # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. # # %CopyrightEnd% # def get_thread_name(t): f = gdb.newest_frame(); while f: if f.name() == "async_main": return "async"; elif f.name() == "erts_sys_main_thread": return "main"; elif f.name() == "signal_dispatcher_thread_func": return "signal_dispatcher"; elif f.name() == "sys_msg_dispatcher_func": return "sys_msg_dispatcher"; elif f.name() == "child_waiter": return "child_waiter"; elif f.name() == "sched_thread_func": return "scheduler"; elif f.name() == "aux_thread": return "aux"; f = f.older(); return "unknown"; curr_thread = gdb.selected_thread(); for i in gdb.inferiors(): gdb.write(" Id Thread Name Frame\n"); for t in i.threads(): t.switch(); if curr_thread == t: gdb.write("*"); else: gdb.write(" "); gdb.write("{0:<3} {1:20} {2}\n".format( t.num,get_thread_name(t), gdb.newest_frame().name())); curr_thread.switch();
# Marcelo Campos de Medeiros # ADS UNIFIP # REVISÃO DE PYTHON # AULA 10 CONDIÇÕES GUSTAVO GUANABARA ''' Faça um Programa que leia um ano qualquer e mostre se ele é BISSEXTO. ''' print('='*30) print('{:#^30}'.format(' ANO BISSEXTO ')) print('='*30) print() ano = int(input('Informe o ano: ')) print() # condição para ser bissexto ano % 4 == 0 and ano % 100 != 0 or ano % 400 == 0 if ano % 4 == 0 and ano % 100 != 0 or ano % 400 == 0: print('O ano %d é BISSEXTO!'%ano) else: print('O ano {} NÃO É BISSEXTO!'.format(ano)) print()
# 264. Ugly Number II # Runtime: 173 ms, faster than 54.94% of Python3 online submissions for Ugly Number II. # Memory Usage: 14.2 MB, less than 73.79% of Python3 online submissions for Ugly Number II. class Solution: # Three Pointers def nthUglyNumber(self, n: int) -> int: nums = [1] p2, p3, p5 = 0, 0, 0 for _ in range(1, n): n2 = 2 * nums[p2] n3 = 3 * nums[p3] n5 = 5 * nums[p5] nums.append(min(n2, n3, n5)) if nums[-1] == n2: p2 += 1 if nums[-1] == n3: p3 += 1 if nums[-1] == n5: p5 += 1 return nums[-1]
def showAries(): print("ARIES (March 21 – April 19)") print("") print("Aries is independent in nature, fun loving, impulsive and a tough cookie. You desire big goals and possess the determination to accomplish them without getting weakened by any hurdle. " + "The courage and ambition you hold are worthy enough to drive you ahead. Sometimes your bossy behavior tends to be hurtful.") print("") print("Try to strengthen your ego and not suppress others.") def showTaurus(): print("TAURUS (April 20 – May 20)") print("") print("Taurus, the born leaders, are morally and ethically upright and loyal. You possess a firm spirit which keeps you moving on the right path. " + "Your ethicality knows no limits. You keep your emotions and feelings to yourself. The unmoving emotions and behavior turn you into a reserved and obstinate person. " + "Your work act as the barricade between your emotions and you as it consumes all your time and restricts you in sharing what you feel.") print("") print("You must open and communicate as it would provide you relief rather than hurting you.") def showGemini(): print("GEMINI (May 21 – June 20)") print("") print("The Combination of charismatic persona and open personality. Your versatility, intelligence, and witty behavior draw the attention of people. " + "Being happy is your life's Mantra, no matter what ups and downs you face. Your excellent communication skills keep your social circle growing. " + "As you easily get bored, you tend to be insensitive towards others’ feelings.") print("") print("Try to have a better understanding of others' perspective and feelings too.") def showCancer(): print("CANCER (June 21 – July 22)") print("") print("Cancer is the most understanding, generous and emotional among all. And, the biggest introvert with the deepest feelings and emotions, on the other side. " + "Rather than living in a practical world, you live in a world of fantasy with hundreds of voices revolving in your head and guiding your way.") print("") print("Try to have more social connections and live in a practical world.") def showLeo(): print("LEO (July 23 – Aug. 22)") print("") print("Leo, the born leaders, are noble, honest and confident. You always remain in the spotlight and holds a persona which attracts others. " + "But sometimes you are self-centered and highly rely upon others' viewpoints and opinion.") print("") print("You must ensure that your decisions are not dependent on others, rather, they must be based on your own views.") def showVirgo(): print("VIRGO (Aug. 23 – Sept. 22)") print("") print("Virgo is practical, meticulous and cool-headed. You are the one with the solution to every problem. In the race of heart and head, you always listen to your head. " + "Sometimes you set unrealistic goals which are hard to accomplish that also creates a difficult situation for you and others.") print("") print("You must go with the flow rather than controlling everything.") def showLibra(): print("LIBRA (Sept. 23 – Oct. 22)") print("") print("Libra is diplomatic but is balanced in nature, possess the carefree attitude and are pleasant in behavior. " + "You are balanced in making decisions but because of your careless behavior, you face difficult situations. " + "You try to make others comfortable. You think too much which results in delayed decisions.") print("") print("Try to take prompt decisions by believing in yourself.") def showScorpio(): print("SCORPIO (Oct. 23 – Nov. 21)") print("") print("Scorpio is people with a sensual, creative and confident persona. Your sensual nature makes you the best lovers of all the zodiacs. " + "You hold a magnetic pull which draws the attention of people. You have a sharp memory and a revengeful streak which can be dangerous for your enemies.") print("") print("It is good for you to move on and forgive rather than keeping knots of grudges.") def showSagittarius(): print("SAGITTARIUS (Nov. 22 – Dec. 21)") print("") print("Sagittarius holds explosive, fiery and generous personality. You attract people with your funny behavior and generosity. " + "Many times you also hurt others with your frank and fearless attitude as you unintentionally hurt others with your outspoken attitude.") print("") print("Try to listen to other people too and remain emotionally-available.") def showCapricorn(): print("CAPRICORN (Dec. 22 – Jan. 19)") print("") print("Capricorns are hardworking, calm, determined and motivated. You are helpful and practical in nature. " + "Whatever the challenges are, you always remain ready and keep attaining your desired goals. Your workaholic nature and competitive spirit can sometimes be annoying to others.") print("") print("Sometimes slowing down your speed might help you cherish every moment.") def showAquarius(): print("AQUARIUS (Jan. 20 – Feb. 18)") print("") print("Being Aquarius, you are alluring, adventurous and captivating in nature. You possess worldly knowledge because of your passion for travel. " + "Your personality is full of intelligence and you keep the conversation going for hours owing to your excellent communication skills. " + "However, your independent and unpredictable nature sometimes makes difficult for people to understand you.") print("") print("It’s good to communicate with an open heart, to make your trips more happening.") def showPisces(): print("PISCES (Feb. 19 – March 20)") print("") print("Being a Pisces, you tend to be compassionate, sympathetic and artistic. You are the one with a pure heart and always remain kind to others. " + "You hold a personality that craves solitude. You live in a world of dreams and imagination and possess the huge interest in music and art.") print("") print("Try to live in a practical world rather than losing yourself in thoughts and imaginations.") def main(): sign = input("Enter your zodiac sign to know your sign's characteristics and personality traits: ") if sign.lower() == "aries": showAries() print("") print("") main() elif sign.lower() == "taurus": showTaurus() print("") print("") main() elif sign.lower() == "gemini": showGemini() print("") print("") main() elif sign.lower() == "cancer": showCancer() print("") print("") main() elif sign.lower() == "leo": showLeo() print("") print("") main() elif sign.lower() == "virgo": showVirgo() print("") print("") main() elif sign.lower() == "libra": showLibra() print("") print("") main() elif sign.lower() == "scorpio": showScorpio() print("") print("") main() elif sign.lower() == "sagittarius": showSagittarius() print("") print("") main() elif sign.lower() == "capricorn": showCapricorn() print("") print("") main() elif sign.lower() == "aquarius": showAquarius() print("") print("") main() elif sign.lower() == "pisces": showPisces() print("") print("") main() else: print("Sorry, you have entered an invalid zodiac sign. Please try again.") print("") print("") main() main()
# -*- coding: utf-8 -*- """ @Time : 2020/3/13 13:39 @Author : 半纸梁 @File : contains.py """ PER_PAGE_NUMBER = 10 # 分页每页显示数据条数 IMAGE_MAX_SIZE = 5 * 1024 * 1024 # 5M 图片大小最大为5M IMAGE_EXT_NAME_LS = ["bmp", "jpg", "png", "tif", "gif", "pcx", "tga", "exif", "fpx", "svg", "psd", "cdr", "pcd", "dxf", "ufo", "eps", "ai", "raw", "WMF", "webp"] # 图片后缀名 DOC_EXT_NAME_LS = ["ppt", "pptx", "doc", "docx", "xls", "xlsx", "txt", "pdf"] # 文档后缀名 DOC_MAX_SIZE = 100 * 1024 * 1024 # 100M 图片大小最大为100M
class Constraints(object): ''' Contains all of the primary and foreign key constraint names for the given entity as tuples of entities and relations which are part of constraints ''' def __init__(self, pk_constraints, fk_constraints): self.pk_constraints = pk_constraints self.fk_constraints = fk_constraints
_base_ = [ '../_base_/models/du_pspnet_r50-d8.py', '../_base_/datasets/yantai_st12.py', '../_base_/runtimes/yantai_runtime.py', '../_base_/schedules/schedule_yantai.py' ] model = dict( decode_head=dict(num_classes=4), auxiliary_head=dict(num_classes=4)) test_cfg = dict(mode='whole')
#!/usr/bin/env python3 print("Gioco del tic tac toe") board = [ ['-','-','-'], ['-','-','-'], ['-','-','-'] ] symList = ['X','O'] def mostra_tabellone(): for i in range(3): for j in range(3): print(board[i][j], end=" ") print() def win(board): for sym in symList: #check rows for i in range(3): if board[i].count(sym)==3: return sym #check columns for i in range(3): if (board[0][i]==sym and board[1][i]==sym and board[2][i]==sym): return sym # check diagonals if (board[0][0]==sym and board[1][1]==sym and board[2][2]==sym): return sym if (board[0][2]==sym and board[1][1]==sym and board[2][0]==sym): return sym return False winner=False for idx in range(9): symbol = symList[idx%2] mostra_tabellone() print("Il tuo simbolo è: "+symbol) while True: r = int(input("Inserisci la riga (valori da 0 a 2): ")) c = int(input("Inserisici la colonna (valori da 0 a 2): ")) # aggiungere anche condizione che r,c devono essere compresi tra 0 e 2 if board[r][c]=='-': board[r][c] = symbol break winner=win() if winner: break mostra_tabellone() print("The winner is... "+winner+"!")
class Level: def __init__(self, ident, desc, nresources): self.id = ident self.description = desc self.networkResources = nresources
o = input() e = input() ans = '' for i in range(len(e)): ans += o[i] ans += e[i] if len(o)-len(e) == 1: ans += o[-1] print(ans)
# from ..sims.deprecated.cat_mouse import data_visualizer as cat_mouse_vis # from ..sims.deprecated.route_choice import data_visualizer as route_choice_vis # from ..sims.deprecated.simple_migration import data_visualizer as simple_mig_vis """ @pytest.mark.skip(reason="deprecated") def test_cat_mouse_visualizer(): cat_mouse_vis.visualize(test=True) @pytest.mark.skip(reason="deprecated") def test_route_choice_visualizer(): route_choice_vis.visualize(test=True) @pytest.mark.skip(reason="deprecated") def test_simple_migration_visualizer(): simple_mig_vis.visualize(test=True) """
#!/usr/bin/python3 class colors: """Colored terminal outputs""" # Colors can be added and they will be loaded throughout the program # To output "test" in green: # print(colors.GREEN + "test" + colors.RESET) # print({1}test{0}.format(colors.RESET, colors.GREEN)) GREEN = '\033[92m' YELLOW = '\033[93m' BLUE = '\033[94m' RED = '\033[91m' BOLD = '\033[1m' RESET = '\033[0m'
class Item(object): """ item对象, """ def __init__(self, schema=None, **kwargs): """ :param schema: 建表语句,要求有建表权限 :param kwargs: 要存储的数据 """ self.capacity = kwargs self.schema = schema # 增加元素 def __setitem__(self, key, value): self.capacity[key] = value # 取出元素 def __getitem__(self, item): return self.capacity[item] # 删除元素 def __delitem__(self, key): del self.capacity[key] # 对象可迭代 def __iter__(self): return self.capacity.items() def pop(self, key): return self.capacity.pop(key) def get(self, key, default=None): return self.capacity.get(key, default) def keys(self): return self.capacity.keys() def values(self): return self.capacity.values() def clear(self): return self.capacity.clear() def __repr__(self): return f'<Item: {len(self.capacity)} field>' __str__ = __repr__ class MySQLSaverItem(Item): def __init__(self, table: str, auto_update=True, schema=None, **kwargs): super().__init__(schema, **kwargs) self.table = table self.auto_update = auto_update
{ "targets": [{ "target_name": "mine.uv", "type": "executable", "dependencies": [ "mine.uv-lib", ], "sources": [ "src/main.c", ], }, { "target_name": "mine.uv-lib", "type": "<(library)", "include_dirs": [ "src" ], "dependencies": [ "deps/uv/uv.gyp:libuv", "deps/openssl/openssl.gyp:openssl", "deps/zlib/zlib.gyp:zlib", ], "direct_dependent_settings": { "include_dirs": [ "src" ], }, "sources": [ "src/client.c", "src/client-handshake.c", "src/client-protocol.c", "src/format/anvil-encode.c", "src/format/anvil-parse.c", "src/format/nbt-common.c", "src/format/nbt-encode.c", "src/format/nbt-parse.c", "src/format/nbt-utils.c", "src/format/nbt-value.c", "src/protocol/framer.c", "src/protocol/parser.c", "src/utils/buffer.c", "src/utils/common.c", "src/utils/string.c", "src/server.c", "src/session.c", "src/world.c", ], }] }
# # PySNMP MIB module CISCO-UNIFIED-COMPUTING-SYSFILE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-UNIFIED-COMPUTING-SYSFILE-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:17:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") CiscoAlarmSeverity, TimeIntervalSec, Unsigned64, CiscoInetAddressMask, CiscoNetworkAddress = mibBuilder.importSymbols("CISCO-TC", "CiscoAlarmSeverity", "TimeIntervalSec", "Unsigned64", "CiscoInetAddressMask", "CiscoNetworkAddress") ciscoUnifiedComputingMIBObjects, CucsManagedObjectId, CucsManagedObjectDn = mibBuilder.importSymbols("CISCO-UNIFIED-COMPUTING-MIB", "ciscoUnifiedComputingMIBObjects", "CucsManagedObjectId", "CucsManagedObjectDn") CucsFsmFsmStageStatus, CucsSysfileMutationFsmStageName, CucsFsmFlags, CucsConditionRemoteInvRslt, CucsSysfileMutationAction, CucsSysfileMutationFsmTaskItem, CucsFsmCompletion, CucsNetworkSwitchId, CucsSysfileMutationFsmCurrentFsm = mibBuilder.importSymbols("CISCO-UNIFIED-COMPUTING-TC-MIB", "CucsFsmFsmStageStatus", "CucsSysfileMutationFsmStageName", "CucsFsmFlags", "CucsConditionRemoteInvRslt", "CucsSysfileMutationAction", "CucsSysfileMutationFsmTaskItem", "CucsFsmCompletion", "CucsNetworkSwitchId", "CucsSysfileMutationFsmCurrentFsm") InetAddressIPv6, InetAddressIPv4 = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressIPv6", "InetAddressIPv4") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Gauge32, Unsigned32, iso, ModuleIdentity, MibIdentifier, IpAddress, ObjectIdentity, Counter32, Integer32, Counter64, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "Unsigned32", "iso", "ModuleIdentity", "MibIdentifier", "IpAddress", "ObjectIdentity", "Counter32", "Integer32", "Counter64", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "NotificationType") TimeStamp, TextualConvention, MacAddress, DisplayString, RowPointer, TimeInterval, TruthValue, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "TimeStamp", "TextualConvention", "MacAddress", "DisplayString", "RowPointer", "TimeInterval", "TruthValue", "DateAndTime") cucsSysfileObjects = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48)) if mibBuilder.loadTexts: cucsSysfileObjects.setLastUpdated('201601180000Z') if mibBuilder.loadTexts: cucsSysfileObjects.setOrganization('Cisco Systems Inc.') if mibBuilder.loadTexts: cucsSysfileObjects.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553 -NETS E-mail: cs-san@cisco.com, cs-lan-switch-snmp@cisco.com') if mibBuilder.loadTexts: cucsSysfileObjects.setDescription('MIB representation of the Cisco Unified Computing System SYSFILE management information model package') cucsSysfileDigestTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3), ) if mibBuilder.loadTexts: cucsSysfileDigestTable.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestTable.setDescription('Cisco UCS sysfile:Digest managed object table') cucsSysfileDigestEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-SYSFILE-MIB", "cucsSysfileDigestInstanceId")) if mibBuilder.loadTexts: cucsSysfileDigestEntry.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestEntry.setDescription('Entry for the cucsSysfileDigestTable table.') cucsSysfileDigestInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 1), CucsManagedObjectId()) if mibBuilder.loadTexts: cucsSysfileDigestInstanceId.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestInstanceId.setDescription('Instance identifier of the managed object.') cucsSysfileDigestDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestDn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestDn.setDescription('Cisco UCS sysfile:Digest:dn managed object property') cucsSysfileDigestRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 3), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestRn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestRn.setDescription('Cisco UCS sysfile:Digest:rn managed object property') cucsSysfileDigestCreationTS = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 4), Unsigned64()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestCreationTS.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestCreationTS.setDescription('Cisco UCS sysfile:Digest:creationTS managed object property') cucsSysfileDigestDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 5), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestDescr.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestDescr.setDescription('Cisco UCS sysfile:Digest:descr managed object property') cucsSysfileDigestName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 6), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestName.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestName.setDescription('Cisco UCS sysfile:Digest:name managed object property') cucsSysfileDigestSize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 7), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestSize.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestSize.setDescription('Cisco UCS sysfile:Digest:size managed object property') cucsSysfileDigestSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 8), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestSource.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestSource.setDescription('Cisco UCS sysfile:Digest:source managed object property') cucsSysfileDigestSwitchId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 9), CucsNetworkSwitchId()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestSwitchId.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestSwitchId.setDescription('Cisco UCS sysfile:Digest:switchId managed object property') cucsSysfileDigestTs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 10), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestTs.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestTs.setDescription('Cisco UCS sysfile:Digest:ts managed object property') cucsSysfileDigestUri = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 3, 1, 11), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileDigestUri.setStatus('current') if mibBuilder.loadTexts: cucsSysfileDigestUri.setDescription('Cisco UCS sysfile:Digest:uri managed object property') cucsSysfileMutationTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1), ) if mibBuilder.loadTexts: cucsSysfileMutationTable.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationTable.setDescription('Cisco UCS sysfile:Mutation managed object table') cucsSysfileMutationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-SYSFILE-MIB", "cucsSysfileMutationInstanceId")) if mibBuilder.loadTexts: cucsSysfileMutationEntry.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationEntry.setDescription('Entry for the cucsSysfileMutationTable table.') cucsSysfileMutationInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 1), CucsManagedObjectId()) if mibBuilder.loadTexts: cucsSysfileMutationInstanceId.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationInstanceId.setDescription('Instance identifier of the managed object.') cucsSysfileMutationDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationDn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationDn.setDescription('Cisco UCS sysfile:Mutation:dn managed object property') cucsSysfileMutationRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 3), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationRn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationRn.setDescription('Cisco UCS sysfile:Mutation:rn managed object property') cucsSysfileMutationAction = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 4), CucsSysfileMutationAction()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationAction.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationAction.setDescription('Cisco UCS sysfile:Mutation:action managed object property') cucsSysfileMutationDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 5), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationDescr.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationDescr.setDescription('Cisco UCS sysfile:Mutation:descr managed object property') cucsSysfileMutationFsmDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 6), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmDescr.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmDescr.setDescription('Cisco UCS sysfile:Mutation:fsmDescr managed object property') cucsSysfileMutationFsmPrev = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 7), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmPrev.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmPrev.setDescription('Cisco UCS sysfile:Mutation:fsmPrev managed object property') cucsSysfileMutationFsmProgr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 8), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmProgr.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmProgr.setDescription('Cisco UCS sysfile:Mutation:fsmProgr managed object property') cucsSysfileMutationFsmRmtInvErrCode = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 9), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtInvErrCode.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtInvErrCode.setDescription('Cisco UCS sysfile:Mutation:fsmRmtInvErrCode managed object property') cucsSysfileMutationFsmRmtInvErrDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 10), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtInvErrDescr.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtInvErrDescr.setDescription('Cisco UCS sysfile:Mutation:fsmRmtInvErrDescr managed object property') cucsSysfileMutationFsmRmtInvRslt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 11), CucsConditionRemoteInvRslt()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtInvRslt.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtInvRslt.setDescription('Cisco UCS sysfile:Mutation:fsmRmtInvRslt managed object property') cucsSysfileMutationFsmStageDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 12), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageDescr.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageDescr.setDescription('Cisco UCS sysfile:Mutation:fsmStageDescr managed object property') cucsSysfileMutationFsmStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 13), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStamp.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStamp.setDescription('Cisco UCS sysfile:Mutation:fsmStamp managed object property') cucsSysfileMutationFsmStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 14), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStatus.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStatus.setDescription('Cisco UCS sysfile:Mutation:fsmStatus managed object property') cucsSysfileMutationFsmTry = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 1, 1, 15), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmTry.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTry.setDescription('Cisco UCS sysfile:Mutation:fsmTry managed object property') cucsSysfileMutationFsmTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4), ) if mibBuilder.loadTexts: cucsSysfileMutationFsmTable.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTable.setDescription('Cisco UCS sysfile:MutationFsm managed object table') cucsSysfileMutationFsmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-SYSFILE-MIB", "cucsSysfileMutationFsmInstanceId")) if mibBuilder.loadTexts: cucsSysfileMutationFsmEntry.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmEntry.setDescription('Entry for the cucsSysfileMutationFsmTable table.') cucsSysfileMutationFsmInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 1), CucsManagedObjectId()) if mibBuilder.loadTexts: cucsSysfileMutationFsmInstanceId.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmInstanceId.setDescription('Instance identifier of the managed object.') cucsSysfileMutationFsmDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmDn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmDn.setDescription('Cisco UCS sysfile:MutationFsm:dn managed object property') cucsSysfileMutationFsmRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 3), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmRn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmRn.setDescription('Cisco UCS sysfile:MutationFsm:rn managed object property') cucsSysfileMutationFsmCompletionTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 4), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmCompletionTime.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmCompletionTime.setDescription('Cisco UCS sysfile:MutationFsm:completionTime managed object property') cucsSysfileMutationFsmCurrentFsm = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 5), CucsSysfileMutationFsmCurrentFsm()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmCurrentFsm.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmCurrentFsm.setDescription('Cisco UCS sysfile:MutationFsm:currentFsm managed object property') cucsSysfileMutationFsmDescrData = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 6), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmDescrData.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmDescrData.setDescription('Cisco UCS sysfile:MutationFsm:descr managed object property') cucsSysfileMutationFsmFsmStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 7), CucsFsmFsmStageStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmFsmStatus.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmFsmStatus.setDescription('Cisco UCS sysfile:MutationFsm:fsmStatus managed object property') cucsSysfileMutationFsmProgress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 8), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmProgress.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmProgress.setDescription('Cisco UCS sysfile:MutationFsm:progress managed object property') cucsSysfileMutationFsmRmtErrCode = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 9), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtErrCode.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtErrCode.setDescription('Cisco UCS sysfile:MutationFsm:rmtErrCode managed object property') cucsSysfileMutationFsmRmtErrDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 10), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtErrDescr.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtErrDescr.setDescription('Cisco UCS sysfile:MutationFsm:rmtErrDescr managed object property') cucsSysfileMutationFsmRmtRslt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 4, 1, 11), CucsConditionRemoteInvRslt()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtRslt.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmRmtRslt.setDescription('Cisco UCS sysfile:MutationFsm:rmtRslt managed object property') cucsSysfileMutationFsmStageTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5), ) if mibBuilder.loadTexts: cucsSysfileMutationFsmStageTable.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageTable.setDescription('Cisco UCS sysfile:MutationFsmStage managed object table') cucsSysfileMutationFsmStageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-SYSFILE-MIB", "cucsSysfileMutationFsmStageInstanceId")) if mibBuilder.loadTexts: cucsSysfileMutationFsmStageEntry.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageEntry.setDescription('Entry for the cucsSysfileMutationFsmStageTable table.') cucsSysfileMutationFsmStageInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 1), CucsManagedObjectId()) if mibBuilder.loadTexts: cucsSysfileMutationFsmStageInstanceId.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageInstanceId.setDescription('Instance identifier of the managed object.') cucsSysfileMutationFsmStageDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageDn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageDn.setDescription('Cisco UCS sysfile:MutationFsmStage:dn managed object property') cucsSysfileMutationFsmStageRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 3), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageRn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageRn.setDescription('Cisco UCS sysfile:MutationFsmStage:rn managed object property') cucsSysfileMutationFsmStageDescrData = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 4), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageDescrData.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageDescrData.setDescription('Cisco UCS sysfile:MutationFsmStage:descr managed object property') cucsSysfileMutationFsmStageLastUpdateTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 5), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageLastUpdateTime.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageLastUpdateTime.setDescription('Cisco UCS sysfile:MutationFsmStage:lastUpdateTime managed object property') cucsSysfileMutationFsmStageName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 6), CucsSysfileMutationFsmStageName()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageName.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageName.setDescription('Cisco UCS sysfile:MutationFsmStage:name managed object property') cucsSysfileMutationFsmStageOrder = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 7), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageOrder.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageOrder.setDescription('Cisco UCS sysfile:MutationFsmStage:order managed object property') cucsSysfileMutationFsmStageRetry = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 8), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageRetry.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageRetry.setDescription('Cisco UCS sysfile:MutationFsmStage:retry managed object property') cucsSysfileMutationFsmStageStageStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 5, 1, 9), CucsFsmFsmStageStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmStageStageStatus.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmStageStageStatus.setDescription('Cisco UCS sysfile:MutationFsmStage:stageStatus managed object property') cucsSysfileMutationFsmTaskTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2), ) if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskTable.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskTable.setDescription('Cisco UCS sysfile:MutationFsmTask managed object table') cucsSysfileMutationFsmTaskEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1), ).setIndexNames((0, "CISCO-UNIFIED-COMPUTING-SYSFILE-MIB", "cucsSysfileMutationFsmTaskInstanceId")) if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskEntry.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskEntry.setDescription('Entry for the cucsSysfileMutationFsmTaskTable table.') cucsSysfileMutationFsmTaskInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1, 1), CucsManagedObjectId()) if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskInstanceId.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskInstanceId.setDescription('Instance identifier of the managed object.') cucsSysfileMutationFsmTaskDn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1, 2), CucsManagedObjectDn()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskDn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskDn.setDescription('Cisco UCS sysfile:MutationFsmTask:dn managed object property') cucsSysfileMutationFsmTaskRn = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1, 3), SnmpAdminString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskRn.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskRn.setDescription('Cisco UCS sysfile:MutationFsmTask:rn managed object property') cucsSysfileMutationFsmTaskCompletion = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1, 4), CucsFsmCompletion()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskCompletion.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskCompletion.setDescription('Cisco UCS sysfile:MutationFsmTask:completion managed object property') cucsSysfileMutationFsmTaskFlags = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1, 5), CucsFsmFlags()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskFlags.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskFlags.setDescription('Cisco UCS sysfile:MutationFsmTask:flags managed object property') cucsSysfileMutationFsmTaskItem = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1, 6), CucsSysfileMutationFsmTaskItem()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskItem.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskItem.setDescription('Cisco UCS sysfile:MutationFsmTask:item managed object property') cucsSysfileMutationFsmTaskSeqId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 719, 1, 48, 2, 1, 7), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskSeqId.setStatus('current') if mibBuilder.loadTexts: cucsSysfileMutationFsmTaskSeqId.setDescription('Cisco UCS sysfile:MutationFsmTask:seqId managed object property') mibBuilder.exportSymbols("CISCO-UNIFIED-COMPUTING-SYSFILE-MIB", cucsSysfileMutationFsmCurrentFsm=cucsSysfileMutationFsmCurrentFsm, cucsSysfileDigestName=cucsSysfileDigestName, cucsSysfileMutationFsmStageTable=cucsSysfileMutationFsmStageTable, cucsSysfileDigestUri=cucsSysfileDigestUri, cucsSysfileMutationFsmTaskInstanceId=cucsSysfileMutationFsmTaskInstanceId, cucsSysfileMutationFsmDn=cucsSysfileMutationFsmDn, cucsSysfileMutationFsmTaskItem=cucsSysfileMutationFsmTaskItem, cucsSysfileMutationFsmTaskCompletion=cucsSysfileMutationFsmTaskCompletion, cucsSysfileMutationFsmRmtErrDescr=cucsSysfileMutationFsmRmtErrDescr, cucsSysfileMutationFsmStageInstanceId=cucsSysfileMutationFsmStageInstanceId, cucsSysfileMutationFsmRmtInvRslt=cucsSysfileMutationFsmRmtInvRslt, cucsSysfileMutationFsmDescr=cucsSysfileMutationFsmDescr, cucsSysfileMutationFsmDescrData=cucsSysfileMutationFsmDescrData, cucsSysfileMutationFsmEntry=cucsSysfileMutationFsmEntry, cucsSysfileDigestSwitchId=cucsSysfileDigestSwitchId, cucsSysfileMutationFsmRn=cucsSysfileMutationFsmRn, cucsSysfileMutationEntry=cucsSysfileMutationEntry, cucsSysfileDigestSource=cucsSysfileDigestSource, cucsSysfileMutationFsmStatus=cucsSysfileMutationFsmStatus, cucsSysfileObjects=cucsSysfileObjects, cucsSysfileMutationFsmTaskFlags=cucsSysfileMutationFsmTaskFlags, cucsSysfileDigestTable=cucsSysfileDigestTable, cucsSysfileMutationFsmStageRetry=cucsSysfileMutationFsmStageRetry, cucsSysfileMutationFsmTaskTable=cucsSysfileMutationFsmTaskTable, cucsSysfileMutationFsmTable=cucsSysfileMutationFsmTable, cucsSysfileDigestCreationTS=cucsSysfileDigestCreationTS, cucsSysfileMutationFsmRmtRslt=cucsSysfileMutationFsmRmtRslt, cucsSysfileMutationFsmStageDescrData=cucsSysfileMutationFsmStageDescrData, cucsSysfileMutationFsmProgr=cucsSysfileMutationFsmProgr, cucsSysfileMutationFsmTaskEntry=cucsSysfileMutationFsmTaskEntry, cucsSysfileMutationFsmInstanceId=cucsSysfileMutationFsmInstanceId, cucsSysfileMutationFsmStageDn=cucsSysfileMutationFsmStageDn, cucsSysfileDigestDescr=cucsSysfileDigestDescr, cucsSysfileMutationFsmCompletionTime=cucsSysfileMutationFsmCompletionTime, cucsSysfileDigestEntry=cucsSysfileDigestEntry, cucsSysfileMutationFsmRmtInvErrDescr=cucsSysfileMutationFsmRmtInvErrDescr, cucsSysfileDigestInstanceId=cucsSysfileDigestInstanceId, PYSNMP_MODULE_ID=cucsSysfileObjects, cucsSysfileDigestSize=cucsSysfileDigestSize, cucsSysfileMutationFsmFsmStatus=cucsSysfileMutationFsmFsmStatus, cucsSysfileMutationAction=cucsSysfileMutationAction, cucsSysfileMutationFsmRmtInvErrCode=cucsSysfileMutationFsmRmtInvErrCode, cucsSysfileMutationInstanceId=cucsSysfileMutationInstanceId, cucsSysfileDigestDn=cucsSysfileDigestDn, cucsSysfileMutationTable=cucsSysfileMutationTable, cucsSysfileMutationFsmStamp=cucsSysfileMutationFsmStamp, cucsSysfileMutationFsmProgress=cucsSysfileMutationFsmProgress, cucsSysfileMutationFsmStageLastUpdateTime=cucsSysfileMutationFsmStageLastUpdateTime, cucsSysfileMutationFsmStageEntry=cucsSysfileMutationFsmStageEntry, cucsSysfileMutationFsmStageName=cucsSysfileMutationFsmStageName, cucsSysfileMutationFsmStageStageStatus=cucsSysfileMutationFsmStageStageStatus, cucsSysfileMutationFsmTaskRn=cucsSysfileMutationFsmTaskRn, cucsSysfileMutationRn=cucsSysfileMutationRn, cucsSysfileMutationFsmTry=cucsSysfileMutationFsmTry, cucsSysfileMutationFsmTaskSeqId=cucsSysfileMutationFsmTaskSeqId, cucsSysfileMutationFsmStageRn=cucsSysfileMutationFsmStageRn, cucsSysfileMutationDescr=cucsSysfileMutationDescr, cucsSysfileMutationFsmPrev=cucsSysfileMutationFsmPrev, cucsSysfileMutationFsmStageOrder=cucsSysfileMutationFsmStageOrder, cucsSysfileMutationFsmTaskDn=cucsSysfileMutationFsmTaskDn, cucsSysfileMutationFsmStageDescr=cucsSysfileMutationFsmStageDescr, cucsSysfileDigestTs=cucsSysfileDigestTs, cucsSysfileMutationFsmRmtErrCode=cucsSysfileMutationFsmRmtErrCode, cucsSysfileMutationDn=cucsSysfileMutationDn, cucsSysfileDigestRn=cucsSysfileDigestRn)
def duel1(a, b, c): k = 0 for _ in range(c): a = a * 16807 % 2147483647 b = b * 48271 % 2147483647 k += a & 0xffff == b & 0xffff return k def duel2(a, b, c): k = 0 for _ in range(c): a = a * 16807 % 2147483647 while a & 0x3: a = a * 16807 % 2147483647 b = b * 48271 % 2147483647 while b & 0x7: b = b * 48271 % 2147483647 k += a & 0xffff == b & 0xffff return k print(duel1(783, 325, 40_000_000)) print(duel2(783, 325, 5_000_000))
{ 'name': 'OpenERP Web Diagram', 'category': 'Hidden', 'description': """ Openerp Web Diagram view. ========================= """, 'version': '2.0', 'depends': ['web'], 'js': [ 'static/lib/js/raphael.js', 'static/lib/js/jquery.mousewheel.js', 'static/src/js/vec2.js', 'static/src/js/graph.js', 'static/src/js/diagram.js', ], 'css': [ 'static/src/css/base_diagram.css', ], 'qweb': [ 'static/src/xml/*.xml', ], 'auto_install': True, }
class Solution: def __init__(self): self.res = "" self.maxLen = 0 def naive(self,s): self.length = len(s) def loop(start,end): l,r = start,end while l>=0 and r<=self.length-1 and s[l]==s[r]: if r-l+1>self.maxLen: self.res = s[l:r+1] self.maxLen = r-l+1 l-=1 r+=1 for i in range(self.length): loop(i,i) loop(i,i+1) return self.res
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) def f(): (some_global): int print(some_global) # EXPECTED: [ ..., LOAD_CONST(Code((1, 0))), LOAD_CONST('f'), MAKE_FUNCTION(0), STORE_NAME('f'), LOAD_CONST(None), RETURN_VALUE(0), CODE_START('f'), ~LOAD_CONST('int'), ]
#This program computes compound interest #Prompt the user to input the inital investment C = int(input('Enter the initial amount of an investment(C): ')) #Prompt the user to input the yearly rate of interest r = float(input('Enter the yearly rate of interest(r): ')) #Prompt the user to input the number of years until maturation t = int(input('Enter the number of years until maturation(t): ')) #Prompt the user to input the number of times the interest is compounded per year n = int(input('Enter the number of times the interest is compounded per year(n): ')) #This is the formula to compute the compound interest. It is printed to the nearest penny p = str(round(C * (((1 + (r/n)) ** (t*n))), 2)) #This outputs the compound interest to the nearest penny print('The final value of the investment to the nearest penny is: ', p)
{ "targets": [ { "target_name": "index", "sources": [ "epoc.cc"], "include_dirs" : [ "<!(node -e \"require('nan')\")" ], "conditions": [ ['OS=="mac"', { "cflags": [ "-m64" ], "ldflags": [ "-m64" ], "xcode_settings": { "OTHER_CFLAGS": ["-ObjC++"], "ARCHS": [ "x86_64" ] }, "link_settings": { "libraries": [ "/Library/Frameworks/edk.framework/edk" ], "include_dirs": ["./lib/includes/", "./lib/"] } }] ] } ] }
SAMPLE_DATASET = """GATATATGCATATACTT ATAT """ SAMPLE_OUTPUT = """2 4 10""" def kmer_generator(string, n): """returns a generator for kmers of length n""" return (string[i : i + n] for i in range(0, len(string))) def solution(dataset: list) -> str: s, t = map(lambda x: x.strip(), dataset) # clean locs = [ str(i) for i, kmer in enumerate(kmer_generator(s, len(t)), 1) if kmer == t ] # process return " ".join(locs) # report def test_solution(): assert solution(SAMPLE_DATASET.splitlines(True)) == SAMPLE_OUTPUT
"""Some utility functions module.""" def camel_to_snake(s): """ converts CamelCase string to camel_case\ taken from https://stackoverflow.com/a/44969381 :param s: some string :type s: str: :return: a camel_case string :rtype: str: """ no_camel = ''.join(['_'+c.lower() if c.isupper() else c for c in s]).lstrip('_') return no_camel.replace('__', '_') def create_query_sting(param_dict): """ turns a dict into a query string :param param_dict: a dictionary :type param_dict: dict :return: a clean query string :rtype: str """ params = "&".join( [ f"{key}={value}" for key, value in param_dict.items() ] ) return params.replace('#', '%23') def id_from_uri(uri): """ extracts the id from an ARCHE-URL like https://whatever.com/123 -> 123 :param uri: some ARCHE-URL :type uri: str :return: the actual ID, e.g. 123 :rtype: str: """ if uri.endswith('/'): uri = uri[:-1] a_id = uri.split('/')[-1] try: return f"{int(a_id)}" except ValueError: return ""
n1 = float(input('Primeiro número: ')) n2 = float(input('Segundo número: ')) opcao = 0 while opcao != 5: print() print(''' [1]Somar [2]Multiplicar [3]Maior [4]Novos números [5]Sair do programa''') print() opcao = int(input('Escolha uma opção: ')) if opcao == 1: soma = n1 + n2 print(f'{n1} + {n2} = {soma}') elif opcao == 2: mult = n1 * n2 print(f'{n1} x {n2} = {mult}') elif opcao == 3: if n1 > n2: maior = n1 else: maior = n2 print(f'O maior valor é {maior}') elif opcao == 4: n1 = float(input('Primeiro número: ')) n2 = float(input('Segundo número: ')) elif opcao == 5: print('Finalizando...') else: print('Opção inválida. Tente novamente') print(10*'=-=') print('Fim do programa! Volte sempre!')
""" ranges from taking the first k to taking the last k, so try all the combinations, shifting one numbr at a time """ class Solution: def maxScore(self, cardPoints: List[int], k: int) -> int: max_score = curr_score = sum(cardPoints[:k]) for i in range(1, k+1): curr_score += cardPoints[-i] - cardPoints[k-i] max_score = max(max_score, curr_score) return max_score
class IdentityHolder: """ Wraps an object so that it can be quickly compared by object identity rather than value. Also provides a total order based on object address. This is frequently useful for sets representing cycles: set value equality is O(n) but object identity equality is O(1). Different cycles can have the same nodes in a different order; it is important to distinguish these objects, but useful to represent them as sets for purposes of fast intersection. """ def __init__(self, value, tag=None): """Wrap a value, optionally tagged with extra information.""" self.value = value self.tag = tag def __hash__(self): return id(self.value) def __eq__(self, other): return self.value is other.value def __str__(self): return 'IH`' + str(self.value) + '`' def __repr__(self): return 'IdentityHolder(' + repr(self.value) + ', ' + repr(self.tag) + ')' def order(self, other): """Return a tuple of this holder and the other such that the first item is before the second in a total order.""" return (self, other) if self.isbefore(other) else (other, self) def isbefore(self, other): """Determine whether this holder is before the other in a total order.""" return id(self.value) < id(other.value)
def uniqueOccurrences(self, arr: List[int]) -> bool: m = {} for i in arr: if i in m: m[i] += 1 else: m[i] = 1 return len(m.values()) == len(set(m.values()))
#Faça um Programa que leia três números e mostre o maior deles. a = int(input("Digite o primeiro número: ")) b = int(input("Digite o segundo número: ")) c = int(input("DIgite o terceiro número: ")) primeiro = a segundo = b terceiro = c if terceiro > segundo: terceiro,segundo = segundo,terceiro if segundo > primeiro: segundo,primeiro = primeiro, segundo if terceiro > segundo: terceiro,segundo = segundo,terceiro print(f"O maior número é: {primeiro}")
# leetcode class Solution: def hammingDistance(self, x: int, y: int) -> int: ans = 0 xor = bin(x^y)[2:] for l in xor: if l == '1': ans += 1 return ans
''' Write a function sumprimes(l) that takes as input a list of integers l and retuns the sum of all the prime numbers in l. Here are some examples to show how your function should work. >>> sumprimes([3,3,1,13]) 19 ''' def sumprimes(l): prime_sum = int() for num in l: if is_prime(num): prime_sum = prime_sum + num return prime_sum def is_prime(n): factor_list = [] for num in range(2, n+1): if n % num == 0: factor_list = factor_list + [num] return len(factor_list) == 1
''' date : 31/03/2020 description : this module keeps information on print objects used by editor author : Celray James CHAWANDA contact : celray.chawanda@outlook.com licence : MIT 2020 ''' print_obj_lookup = { "basin_wb" : "1", "basin_nb" : "2", "basin_ls" : "3", "basin_pw" : "4", "basin_aqu" : "5", "basin_res" : "6", "basin_cha" : "7", "basin_sd_cha" : "8", "basin_psc" : "9", "region_wb" : "10", "region_nb" : "11", "region_ls" : "12", "region_pw" : "13", "region_aqu" : "14", "region_res" : "15", "region_cha" : "16", "region_sd_cha" : "17", "region_psc" : "18", "lsunit_wb" : "19", "lsunit_nb" : "20", "lsunit_ls" : "21", "lsunit_pw" : "22", "hru_wb" : "23", "hru_nb" : "24", "hru_ls" : "25", "hru_pw" : "26", "hru-lte_wb" : "27", "hru-lte_nb" : "28", "hru-lte_ls" : "29", "hru-lte_pw" : "30", "channel" : "31", "channel_sd" : "32", "aquifer" : "33", "reservoir" : "34", "recall" : "35", "hyd" : "36", "ru" : "37", "pest" : "38", }
load("//scala:scala_cross_version.bzl", "scala_mvn_artifact", ) def specs2_version(): return "3.8.8" def specs2_repositories(): native.maven_jar( name = "io_bazel_rules_scala_org_specs2_specs2_core", artifact = scala_mvn_artifact("org.specs2:specs2-core:" + specs2_version()), sha1 = "495bed00c73483f4f5f43945fde63c615d03e637", ) native.maven_jar( name = "io_bazel_rules_scala_org_specs2_specs2_common", artifact = scala_mvn_artifact("org.specs2:specs2-common:" + specs2_version()), sha1 = "15bc009eaae3a574796c0f558d8696b57ae903c3", ) native.maven_jar( name = "io_bazel_rules_scala_org_specs2_specs2_matcher", artifact = scala_mvn_artifact("org.specs2:specs2-matcher:" + specs2_version()), sha1 = "d2e967737abef7421e47b8994a8c92784e624d62", ) native.maven_jar( name = "io_bazel_rules_scala_org_scalaz_scalaz_effect", artifact = scala_mvn_artifact("org.scalaz:scalaz-effect:7.2.7"), sha1 = "824bbb83da12224b3537c354c51eb3da72c435b5", ) native.maven_jar( name = "io_bazel_rules_scala_org_scalaz_scalaz_core", artifact = scala_mvn_artifact("org.scalaz:scalaz-core:7.2.7"), sha1 = "ebf85118d0bf4ce18acebf1d8475ee7deb7f19f1", ) native.bind(name = 'io_bazel_rules_scala/dependency/specs2/specs2', actual = "@io_bazel_rules_scala//specs2:specs2") def specs2_dependencies(): return ["//external:io_bazel_rules_scala/dependency/specs2/specs2"]
class Solution: def XXX(self, nums: List[int]) -> List[List[int]]: l = len(nums) if l <= 1: return [nums] total = 1 for i in range(2, l + 1): total *= i res = [[] for _ in range(total)] div = total for i in range(l): ni = nums[i] for j in range(total): res[j].insert(j // div % (i + 1), ni) div = div // (i + 2) return res
#Program for merge sort in linked list class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def append(self, new_value): new_node = Node(new_value) if self.head is None: self.head = new_node return curr_node = self.head while curr_node.next is not None: curr_node = curr_node.next curr_node.next = new_node def sortedMerge(self, a, b): result = None # Base cases if a == None: return b if b == None: return a if a.data <= b.data: result = a result.next = self.sortedMerge(a.next, b) else: result = b result.next = self.sortedMerge(a, b.next) return result #function for merge sort def mergeSort(self, h): if h == None or h.next == None: return h # get the middle of the list middle = self.getMiddle(h) nexttomiddle = middle.next # set the next of middle node to None middle.next = None # Apply mergeSort on left list left = self.mergeSort(h) # Apply mergeSort on right list right = self.mergeSort(nexttomiddle) # Merge the left and right lists sortedlist = self.sortedMerge(left, right) return sortedlist #get middle element from the linked list def getMiddle(self, head): if (head == None): return head slow = head fast = head while (fast.next != None and fast.next.next != None): slow = slow.next fast = fast.next.next return slow def printList(head): if head is None: print(' ') return curr_node = head while curr_node: print(curr_node.data, end = " ") curr_node = curr_node.next print(' ') # Main Code if __name__ == '__main__': li = LinkedList() li.append(67) li.append(98) li.append(45) li.append(12) li.append(43) li.append(17) # Apply merge Sort li.head = li.mergeSort(li.head) print ("Sorted Linked List is:") printList(li.head)
''' CoG application-level constants. ''' SECTION_DEFAULT = 'DEFAULT' SECTION_ESGF = 'ESGF' SECTION_EMAIL = 'EMAIL' SECTION_GLOBUS = 'GLOBUS' SECTION_PID = 'PID' # note: use lower case VALID_MIME_TYPES = { '.bmp': ['image/bmp', 'image/x-windows-bmp'], '.csv': ['text/plain'], '.doc': ['application/msword'], '.docx': ['application/msword','application/zip'], '.gif': ['image/gif'], '.jpg': ['image/jpeg','image/pjpeg'], '.jpeg': ['image/jpeg', 'image/pjpeg' ], '.pdf': ['application/pdf'], '.png': ['image/png'], '.ppt': ['application/mspowerpoint', 'application/powerpoint', 'application/vnd.ms-powerpoint', 'application/x-mspowerpoint', 'application/vnd.ms-office'], '.pptx': ['application/mspowerpoint', 'application/powerpoint', 'application/vnd.ms-powerpoint', 'application/x-mspowerpoint','application/zip'], '.tif': ['image/tiff', 'image/x-tiff'], '.tiff': ['image/tiff', 'image/x-tiff'], '.txt': ['text/plain'], '.xls': ['application/excel', 'application/vnd.ms-excel', 'application/x-msexcel'], '.xlsx': ['application/excel', 'application/vnd.ms-excel', 'application/x-msexcel','application/zip'], } # fix the configuration file names to avoid path manipulation warnings IDP_WHITELIST_FILENAME = "esgf_idp.xml" IDP_WHITELIST_STATIC_FILENAME = "esgf_idp_static.xml" KNOWN_PROVIDERS_FILENAME = "esgf_known_providers.xml" PEER_NODES_FILENAME = "esgf_cogs.xml"
"""The exception for the rayvision api.""" class RayvisionError(Exception): """Raise RayvisionError if something wrong.""" def __init__(self, error_code, error, *args, **kwargs): """Initialize error message, inherited Exception. Args: error_code (int): Error status code. error (str): Error message. args (set): Other parameters. kwargs (dict): Other keyword parameters. """ super(RayvisionError, self).__init__(self, error, *args, **kwargs) self.error_code = error_code self.error = error def __str__(self): """Let its object out an error message.""" return 'RayvisionError: {0}: {1}'.format(self.error_code, self.error) class RayvisionAPIError(RayvisionError): """Raise RayVisionAPIError.""" def __init__(self, error_code, error, request): """Initialize API error message, inherited RayvisionError. Args: error_code (int): Error status code. error (object): Error message. request (str): Request url. """ super(RayvisionAPIError, self).__init__(error_code, error) self.error_code = error_code self.error = error self.request = request def __str__(self): """Let its object print out an error message.""" return 'Error code: {}, Error message: {}, URL: {}'.format( self.error_code, self.error, self.request) class RayvisionAPIParameterError(RayvisionError): def __init__(self, error_message, data, request_url): """Initialize Task error message, inherited RayvisionError. Args: response (requests.Response): The response of the requests. """ self.error_message = error_message self.error_code = 601 self.request_url = request_url self.post_data = data def __str__(self): """Let its object out an error message.""" return ('Error code: {}, ' 'Error message: Request parameter error ({}), ' 'URL: {}'.format(self.error_code, self.error_message, self.request_url))
#!/usr/bin/env python # coding: utf-8 # --- # # Python Basics - Assingment 3 ToDo # # --- # **Exercise 1** # # **Task 1** Define a function called **repeat_stuff** that takes in two inputs, **stuff**, and **num_repeats**. # # We will want to make this function print a string with stuff repeated num_repeats amount of times. For now, only put an empty print statement inside the function. # # In[6]: def repeat_stuff(stuff, num_repeats): for i in range(num_repeats): print(stuff) repeat_stuff (input("Input an word: "), int(input("Repeat how many times? "))) # --- # **Task 2** Outside of the function, call repeat_stuff. # # You can use the value "Row " for stuff and 3 for num_repeats. # Change the print statement inside repeat_stuff to a **return** statement instead. It should **return stuff*num_repeats** # Note: Multiplying a string just makes a new string with the old one repeated! For example: "na*6 -> result is nanananana # Then, give the parameter **num_repeats** a default value of **10**. # In[7]: def repeat_stuff(stuff, num_repeats): return stuff*num_repeats repeat_stuff (input("Input an word: "), int(input("Repeat how many times? "))) # --- # **Task 3** Add **repeat_stuff("Row ", 3)** and the string **"Your Boat. " ** together and save the result to a variable called **lyrics**. # # Create a variable called **song **and assign it the value of **repeat_stuff** called with the singular input **lyrics**. # # Print song. # # Good job!! # In[14]: def repeat_stuff(stuff, num_repeats): return stuff*num_repeats lyrics = repeat_stuff("Row ", 3) + "Your Boat! \n" song = repeat_stuff(lyrics, 3) print(song) # --- # **Exercise 2** # # The program reads the height in centimeters and then converts the height to feet and inches. # # Problem Solution # # 1. Take the height in centimeters and store it in a variable. # 2. Convert the height in centimeters into inches and feet. # 3. Print the length in inches and feet. # 4. Exit. # # Hint! # inches=0.394*cm # feet=0.0328*cm # In[1]: def cm_feet(figure): return round(figure/30.48, 2) height = float(input("Enter your height in cm: " )) res = cm_feet(height) print("You are ", res, "feet tall.") # --- # **Exercise 3** # # This is a Python Program to check whether a number is positive or negative. # # Problem Solution # # 1. Take the value of the integer and store in a variable. # 2. Use an if statement to determine whether the number is positive or negative. # 3. Exit. # In[1]: def evaluate(num): if num < 0: print(num, "is negative.") elif num > 0: print(num, "is positive.") elif num == 0: print(num, "is zero.") num = int(input("Enter an integer: ")) evaluate(num)
sessions = [{ "1": { "type": "session", "source": {"id": "scope"}, "id": "1", 'profile': {"id": "1"} } }] profiles = [ {"1": {'id': "1", "traits": {}}}, {"2": {'id': "2", "traits": {}}}, ] class MockStorageCrud: def __init__(self, index, domain_class_ref, entity): self.index = index self.domain_class_ref = domain_class_ref self.entity = entity if index == 'session': self.data = sessions elif index == 'profile': self.data = profiles async def load(self): for item in self.data: if self.entity.id in item: return self.domain_class_ref(**item[self.entity.id]) return None async def save(self): self.data.append({self.entity.id: self.entity.dict(exclude_unset=True)}) async def delete(self): del(self.data[self.entity.id]) class EntityStorageCrud: def __init__(self, index, entity): self.index = index self.entity = entity if index == 'session': self.data = sessions elif index == 'profile': self.data = profiles async def load(self, domain_class_ref): for item in self.data: if self.entity.id in item: return domain_class_ref(**item[self.entity.id]) return None async def save(self): self.data.append({self.entity.id: self.entity.dict(exclude_unset=True)}) async def delete(self): del(self.data[self.entity.id])
m = float(input('Digite uma distância em metros: ')) k = m/1000 hct = m/100 dct = m/10 dcm = m*10 cm = m*100 mm = m*1000 print('A distância de {} metros informada corresponde a: \n{} Quilômetros;\n{} Hectômetros;\n{}Decâmetros;\n{:.0f}Decímetros;\n{:.0f}Centímetros e;\n{:.0f}Milímetros.'.format(m, k, hct, dct, dcm, cm, mm))
# Configuration file for opasDataLoader default_build_pattern = "(bEXP_ARCH1|bSeriesTOC)" default_process_pattern = "(bKBD3|bSeriesTOC)" # Global variables (for data and instances) options = None # Source codes (books/journals) which should store paragraphs SRC_CODES_TO_INCLUDE_PARAS = ["GW", "SE"] # for these codes, do not create update notifications DATA_UPDATE_PREPUBLICATION_CODES_TO_IGNORE = ["IPL", "ZBK", "NLP", "SE", "GW"] # no update notifications for these codes.
class Chocolatine: def __init__(self): print("je suis mangé!") def nom(self): return "CH0C0LA71N3 !!!!!" cadeau = (Chocolatine(), "Nicolas", "Julian") #déplier un tuple objet, destinataire, expediteur = cadeau #afficher un tuple print(cadeau) #fonction qui mange un objet de type: tuple(objet, destinataire, expediteur) def offrir( truc ): liste_des_trucs_offert = [] objet, destinataire, expediteur = truc print("-> {} offre {} à {}. Le voici dans le return:".format(expediteur, objet.nom(), destinataire)) return objet truc_pour_untel = offrir(cadeau) print(truc_pour_untel) ##exercice avancé## class Chocolatine: def __init__(self): print("je suis mangé!") def nom(self): return "CH0C0LA71N3 !!!!!" cadeau = (Chocolatine, 3, "Nicolas") def offrir2( truc ): liste_des_trucs_offert = [] objet, nombre, destinataire = truc for i in range(nombre): liste_des_trucs_offert.append(objet()) return liste_des_trucs_offert, destinataire truc_pour_untel, untel = offrir2(cadeau) print("j'offre {} {} à {}. les voici:".format(cadeau[1], cadeau[0]().nom(), untel), truc_pour_untel)
""" Custom Exceptions """ __author__ = "Alastair Tse <alastair@tse.id.au>" __license__ = "BSD" __copyright__ = "Copyright (c) 2004, Alastair Tse" __revision__ = "$Id: exceptions.py,v 1.2 2004/05/04 12:18:21 acnt2 Exp $" class ID3Exception(Exception): """General ID3Exception""" pass class ID3EncodingException(ID3Exception): """Encoding Exception""" pass class ID3VersionMismatchException(ID3Exception): """Version Mismatch problems""" pass class ID3HeaderInvalidException(ID3Exception): """Header is malformed or none existant""" pass class ID3ParameterException(ID3Exception): """Parameters are missing or malformed""" pass class ID3FrameException(ID3Exception): """Frame is malformed or missing""" pass class ID3NotImplementedException(ID3Exception): """This function isn't implemented""" pass
class Recommendation: def __init__(self, title): self.title = title self.wikidata_id = None self.rank = None self.pageviews = None self.url = None self.sitelink_count = None def __dict__(self): return dict(title=self.title, wikidata_id=self.wikidata_id, rank=self.rank, pageviews=self.pageviews, url=self.url, sitelink_count=self.sitelink_count) def incorporate_wikidata_item(self, item): self.wikidata_id = item.id self.url = item.url self.sitelink_count = item.sitelink_count
class Solution: def reverse(self, x: int) -> int: b = 0 if x < 0: b, x = 1, abs(x) mod, res = 0, 0 while x: #下面两行分离出每一个位,从而完成逆序 x, mod = x // 10, x % 10 res = res * 10 + mod if res > 2147483648: return 0 if b == 1: res = -res return res
# coding=utf8 # # OOO$QHHHQ$$$$$$$$$QQQHHHHNHHHNNNNNNNNNNN # OO$$QHHNHQ$$$$$O$$$QQQHHHNNHHHNNNNNNMNNN # $$$QQHHHH$$$OOO$$$$QQQQHHHHHHHNHNNNMNNNN # HHQQQHHH--:!OOO$$$QQQQQQQHHHHHNNNNNNNNNN # NNNHQHQ-;-:-:O$$$$$QQQ$QQQQHHHHNNNNNNNNN # NMNHHQ;-;----:$$$$$$$:::OQHHHHHNNNNHHNNN # NNNHH;;;-----:C$$$$$::----::-::>NNNNNNNN # NNHHQ:;;--:---:$$$$$:::--;;;;;-HNNNNNNNN # HHQQQ:-;-----:--$$$7::-;;;.;.;;HNNMMNNNH # QQQ$Q>-:---:----Q$$!!:;;;...;;QHNMMMNNHH # $$$$$$$:::-:--:!7Q$!:::::;;;;OQHMMMNNHHH # OOO$$$$O:!--:!:-7HQ>:!---.-;7O$HMMMNHHHQ # OOOOOO$OO:::!:!!>N7!7:!-.;:;CC$HMMMNNQQQ # OOOOOOOOOO!::>7C!N>!!C-!7--O?COHMMMNNQQQ # OOOO?7?OOOO!!!!:CH7>7>7--:QC??OC>NMNNHQQ # OOOO?>>>>COO!>?!7H?O>!:::H$:-;---:!ONHHH # OOOO?7>>>>!>?7!>>$O>QOC?N7;;;..;;;;-!NNN # COCC77>>>>!!>7>!>?7C7!>O:;;-.;..-----!MM # OCCC>>>>!!!!7>>O?OOOO>!!;-;-..;.;;;;-:CN # OOCC!!!!!!!>>!>7COCC$C7>->-;:;.;;;;;;-:M # CCOO7::!!!!!!!!CCOOC$?7::-;-:;;;;-----:7 # OOOQH!-!!!!!!!>C7$OC7?!:-;!;-----;---::O # CO$QNN7:!>!!!!!!>?CC$7C!!?CC?CO$$7---->N # CO$QHNNNO7>!!>O?C??!7C>!---7CO$QOOQHHHHN # OO$HHNNNNNNNNNNCCO?!!!------7$QQOO$QQQQH # O$QHHNNMNNNNNNNQO$C!!!:----::QQ$OCOQQ$QQ # $QHQHHNMMMMNNNNQQ$C>!::------QQ$OCO$$$$$ # QHHHHNNMMNHHHHHQQQQQ7!!:-----?Q$$OO$$$O$ # HHQQHHNNH$$$$$$QQHHHH$>!:--::7QQ$OOO$OOO # $$$QQQHQ$OCO$O$QQ$QQQ$$C!::::$HQ$OOO$OOO # OOO$$QQ$OCCOOOOQO$$$$$OC>!!:?HHQ$OO$$OOO # OCCO$Q$$OOO77>>7CO$$OOOOOCQQHQQQ$$O$$$$O # # lilac - a static blog generator. # https://github.com/hit9/lilac # nz2324 AT 126.com """global vars""" version = "0.3.9" charset = "utf8" # utf8 read and write everywhere src_ext = ".md" # source filename extension out_ext = ".html" # output filename extension src_dir = "src" # source directory, './src' out_dir = "." # output directory, './'
class Category: def __init__(self, category): self.name = category self.ledger = [] # Each entry is a dictionary self.ledger1 = [] # Each entry is an array self.balance = 0 self.withdrawals = 0 def deposit(self, amt, desc=""): self.balance += amt self.ledger.append({"amount": amt, "description": desc }) self.ledger1.append([desc, amt]) def withdraw(self, amt, desc=""): if (not self.check_funds(amt)): return False self.balance -= amt self.withdrawals += amt self.ledger.append({"amount": -amt, "description": desc }) self.ledger1.append([desc, -amt]) return True def check_funds(self, amt): if (amt > self.balance): return False return True def get_balance(self): return self.balance def transfer(self, amt, to): if self.check_funds(amt): self.withdraw(amt, "Transfer to " + to.name) to.deposit(amt, "Transfer from " + self.name) return True return False def printLedger(self): print("Balance - " + str(self.balance)) for entry in self.ledger: for item in entry.items(): print(item) def printUsingArray(self): count = 30 - len(self.name) header = "" # Header needs to be 30 chars max if (count > 0): header += "*" * (count//2) # Number of * before Category header += self.name header += "*" * (30 - len(header)) # Number of * After Category # print(len(header)) lines = "" for entry in self.ledger1: desc = entry[0] line = desc[0:23] # Truncate to 23 chars or less line += " " * (23 - len(line)) # Pad to 23 # print a float with two decimal places amt = "{:.2f}".format(entry[1]) leftPadding = 7 - len(amt) line += " " * leftPadding + amt line += "\n" lines += line total = "Total: " + str(self.balance) return header + "\n" + lines + total def __repr__(self): count = 30 - len(self.name) header = "" # Header needs to be 30 chars max if (count > 0): header += "*" * (count//2) # Number of * before Category header += self.name header += "*" * (30 - len(header)) # Number of * After Category lines = "" for entry in self.ledger: desc = entry["description"] line = desc[0:23] # Truncate to 23 chars or less line += " " * (23 - len(line)) # Pad to 23 # print a float with two decimal places amt = "{:.2f}".format(entry["amount"]) leftPadding = 7 - len(amt) line += " " * leftPadding + amt line += "\n" lines += line total = "Total: " + str(self.balance) return header + "\n" + lines + total def create_spend_chart(categories): chartData = [] total_spend = 0 longest_name_length = 0 for category in categories: total_spend += category.withdrawals if (len(category.name) > longest_name_length): longest_name_length = len(category.name) for category in categories: percentageWD = (category.withdrawals / total_spend) * 100 data = int(percentageWD//10) * 10 # Round "down" to 10 chartData.append({ "cat": category.name, "data": data }) lines = "Percentage spent by category\n" number_of_dashes = 3 * len(chartData) # 3 spaces per bar for x in range(100, -1, -10): # 100..90.....10..0 line = "{:3}".format(x) + "| " for dd in chartData: if (x > dd["data"]): line += " " # 3 spaces else: line += "o " # 2 spaces line += "\n" lines += line lines += " " + ("-" * number_of_dashes) + "-\n" # Add horizonal line jj = 0 while (jj < longest_name_length): line = " " # 3 spaces for cc in categories: if (jj < len(cc.name)): line += " " + cc.name[jj] else: line += " " + " " lines += line + " " jj += 1 if (jj < longest_name_length): lines += "\n" return lines def test_create_spend_chart(): food = Category("Food") food.deposit(900, "deposit") entertainment = Category("Entertainment") entertainment.deposit(900, "deposit") business = Category("Business") business.deposit(900, "deposit") food.withdraw(105.55) entertainment.withdraw(33.40) business.withdraw(10.99) print(create_spend_chart([business, food, entertainment])) if __name__ == "__main__": food = Category("Foods") food.deposit(1000, "initial deposit") food.withdraw(10.15, "groceries") food.withdraw(15.89, "restaurant and more food for dessert") # print(food.get_balance()) clothing = Category("Clothing") food.transfer(50, clothing) clothing.withdraw(25.55) clothing.withdraw(100) auto = Category("Auto") auto.deposit(1000, "initial deposit") auto.withdraw(15) # food.printLedger() # clothing.printLedger() # auto.printLedger() print(food) print(clothing) print(create_spend_chart([food, clothing, auto])) test_create_spend_chart()
__author__ = "songjiangshan" __copyright__ = "Copyright (C) 2021 songjiangshan \n All Rights Reserved." __license__ = "" __version__ = "1.0" DEVICE_TYPE_TAG=0 #OLD3 DEVICE_TYPE_ANCHOR=1 #OLD2 DEVICE_TYPE_ANCHORZ=2 #OLD1 def client_id_remove_group(client_id): return str(client_id_get_type(client_id)) + '-' + str(client_id_get_no(client_id)) def client_id_get_no(client_id: str): """ 输入字符串,返回对应的号 :param client_id: :return: int型数值 """ id = int(client_id.split('-')[-1]) return id def client_id_get_type(client_id): id = int(client_id.split('-')[-2]) return id def client_id_get_group(client_id): id = int(client_id.split('-')[0]) return id def pack_client_id(group_id=0, type_int=DEVICE_TYPE_ANCHOR, no=0): ret = str(group_id) + '-' + str(type_int) + '-' + str(no) return ret if __name__ == '__main__': assert client_id_get_no('1-2-3') == 3 assert client_id_get_no('1-2-20') == 20 assert client_id_get_no('1-12-21') == 21 print(client_id_get_type('1-12-21')) # assert client_id_get_type('1-2-3') == 2 # assert client_id_get_group('1-2-3') == 1 # assert client_id_get_group('2-2-3') == 2
def extractExpandablefemaleBlogspotCom(item): ''' DISABLED Parser for 'expandablefemale.blogspot.com' ''' return None
# -*- coding: utf-8 -*- """ Impact @author: Michael Howden (michael@sahanafoundation.org) @date-created: 2010-10-12 Impact resources used by I(ncident)RS and Assessment """ module = "impact" if deployment_settings.has_module("irs") or deployment_settings.has_module("assess"): # ----------------------------------------------------------------------------- # Impact Type resourcename = "type" tablename = "%s_%s" % (module, resourcename) table = db.define_table(tablename, Field("name", length=128, notnull=True, unique=True), cluster_id(), migrate=migrate, *s3_meta_fields() ) # CRUD strings ADD_IMPACT_TYPE = T("Add Impact Type") LIST_IMPACT_TYPE = T("List Impact Types") s3.crud_strings[tablename] = Storage( title_create = ADD_IMPACT_TYPE, title_display = T("Impact Type Details"), title_list = LIST_IMPACT_TYPE, title_update = T("Edit Impact Type"), title_search = T("Search Impact Type"), subtitle_create = T("Add New Impact Type"), subtitle_list = T("Impact Types"), label_list_button = LIST_IMPACT_TYPE, label_create_button = ADD_IMPACT_TYPE, label_delete_button = T("Delete Impact Type"), msg_record_created = T("Impact Type added"), msg_record_modified = T("Impact Type updated"), msg_record_deleted = T("Impact Type deleted"), msg_list_empty = T("No Impact Types currently registered")) def impact_type_comment(): if auth.has_membership(auth.id_group("'Administrator'")): return DIV(A(ADD_IMPACT_TYPE, _class="colorbox", _href=URL(r=request, c="impact", f="type", args="create", vars=dict(format="popup", child="impact_type_id")), _target="top", _title=ADD_IMPACT_TYPE ) ) else: return None impact_type_id = S3ReusableField("impact_type_id", db.impact_type, sortby="name", requires = IS_NULL_OR(IS_ONE_OF(db, "impact_type.id","%(name)s", sort=True)), represent = lambda id: shn_get_db_field_value(db = db, table = "impact_type", field = "name", look_up = id), label = T("Impact Type"), comment = impact_type_comment(), ondelete = "RESTRICT" ) # ----------------------------------------------------------------------------- # Impact resourcename = "impact" tablename = "%s_%s" % (module, resourcename) table = db.define_table(tablename, incident_id(), assess_id(), impact_type_id(), Field("value", "double"), Field("severity", "integer", default = 0), comments(), migrate=migrate, *s3_meta_fields() ) #Hide fk fields in forms table.incident_id.readable = table.incident_id.writable = False table.assess_id.readable = table.assess_id.writable = False table.severity.requires = IS_EMPTY_OR(IS_IN_SET(assess_severity_opts)) table.severity.widget=SQLFORM.widgets.radio.widget table.severity.represent = shn_assess_severity_represent # CRUD strings ADD_IMPACT = T("Add Impact") LIST_IMPACT = T("List Impacts") s3.crud_strings[tablename] = Storage( title_create = ADD_IMPACT, title_display = T("Impact Details"), title_list = LIST_IMPACT, title_update = T("Edit Impact"), title_search = T("Search Impacts"), subtitle_create = T("Add New Impact"), subtitle_list = T("Impacts"), label_list_button = LIST_IMPACT, label_create_button = ADD_IMPACT, label_delete_button = T("Delete Impact"), msg_record_created = T("Impact added"), msg_record_modified = T("Impact updated"), msg_record_deleted = T("Impact deleted"), msg_list_empty = T("No Impacts currently registered")) # Impact as component of assessments and incidents s3xrc.model.add_component(module, resourcename, multiple=True, joinby=dict(assess_assess="assess_id", irs_incident="incident_id")) # -----------------------------------------------------------------------------
# -*- coding: utf-8 -*- # pyxliff/__init__.py """Provides useful functions for SDLXliff terms verification and discovery.""" __version__ = "0.1.0"
class NanoblocksClass: """ Global class that should be inherited by any Nanoblocks class that requires access to the network. """ def __init__(self, nano_network): self._nano_network = nano_network @property def network(self): return self._nano_network @property def node_backend(self): return self.network.node_backend @property def work_server(self): return self.network.work_server @property def accounts(self): return self.network.accounts @property def blocks(self): return self.network.blocks
# # PySNMP MIB module ZYXEL-L3-IP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZYXEL-L3-IP-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:50:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") iso, Counter64, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Counter32, MibIdentifier, Gauge32, TimeTicks, ObjectIdentity, IpAddress, Integer32, ModuleIdentity, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Counter64", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Counter32", "MibIdentifier", "Gauge32", "TimeTicks", "ObjectIdentity", "IpAddress", "Integer32", "ModuleIdentity", "Unsigned32") TextualConvention, RowStatus, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString") esMgmt, = mibBuilder.importSymbols("ZYXEL-ES-SMI", "esMgmt") zyxelL3Ip = ModuleIdentity((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40)) if mibBuilder.loadTexts: zyxelL3Ip.setLastUpdated('201207010000Z') if mibBuilder.loadTexts: zyxelL3Ip.setOrganization('Enterprise Solution ZyXEL') if mibBuilder.loadTexts: zyxelL3Ip.setContactInfo('') if mibBuilder.loadTexts: zyxelL3Ip.setDescription('The subtree for layer 3 switch ip address') zyxelLayer3IpSetup = MibIdentifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1)) zyLayer3IpDnsIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zyLayer3IpDnsIpAddress.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpDnsIpAddress.setDescription('Enter a domain name server IP address in order to be able to use a domain name instead of an IP address.') zyLayer3IpDefaultMgmt = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("inBand", 0), ("outOfBand", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: zyLayer3IpDefaultMgmt.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpDefaultMgmt.setDescription('Specify which traffic flow (In-Band or Out-of-band) the switch is to send packets originating from it or packets with unknown source.') zyLayer3IpDefaultGateway = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zyLayer3IpDefaultGateway.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpDefaultGateway.setDescription('IP address of the default outgoing gateway.') zyLayer3IpInbandMaxNumberOfInterfaces = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyLayer3IpInbandMaxNumberOfInterfaces.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpInbandMaxNumberOfInterfaces.setDescription('The maximum number of in-band IP that can be created.') zyxelLayer3IpInbandTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 5), ) if mibBuilder.loadTexts: zyxelLayer3IpInbandTable.setStatus('current') if mibBuilder.loadTexts: zyxelLayer3IpInbandTable.setDescription('The table contains layer3 IP in-band configuration.') zyxelLayer3IpInbandEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 5, 1), ).setIndexNames((0, "ZYXEL-L3-IP-MIB", "zyLayer3IpInbandIpAddress"), (0, "ZYXEL-L3-IP-MIB", "zyLayer3IpInbandMask")) if mibBuilder.loadTexts: zyxelLayer3IpInbandEntry.setStatus('current') if mibBuilder.loadTexts: zyxelLayer3IpInbandEntry.setDescription('An entry contains layer3 IP in-band configuration.') zyLayer3IpInbandIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 5, 1, 1), IpAddress()) if mibBuilder.loadTexts: zyLayer3IpInbandIpAddress.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpInbandIpAddress.setDescription('Enter the IP address of your switch in dotted decimal notation, for example, 192.168.1.1. This is the IP address of the Switch in an IP routing domain.') zyLayer3IpInbandMask = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 5, 1, 2), IpAddress()) if mibBuilder.loadTexts: zyLayer3IpInbandMask.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpInbandMask.setDescription('Enter the IP subnet mask of an IP routing domain in dotted decimal notation, for example, 255.255.255.0.') zyLayer3IpInbandVid = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 5, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: zyLayer3IpInbandVid.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpInbandVid.setDescription('Enter the VLAN identification number to which an IP routing domain belongs.') zyLayer3IpInbandRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 40, 1, 5, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: zyLayer3IpInbandRowStatus.setStatus('current') if mibBuilder.loadTexts: zyLayer3IpInbandRowStatus.setDescription('This object allows entries to be created and deleted from the in-band IP table.') mibBuilder.exportSymbols("ZYXEL-L3-IP-MIB", zyLayer3IpInbandVid=zyLayer3IpInbandVid, PYSNMP_MODULE_ID=zyxelL3Ip, zyxelLayer3IpSetup=zyxelLayer3IpSetup, zyxelL3Ip=zyxelL3Ip, zyLayer3IpDnsIpAddress=zyLayer3IpDnsIpAddress, zyLayer3IpInbandIpAddress=zyLayer3IpInbandIpAddress, zyLayer3IpDefaultGateway=zyLayer3IpDefaultGateway, zyLayer3IpInbandMaxNumberOfInterfaces=zyLayer3IpInbandMaxNumberOfInterfaces, zyxelLayer3IpInbandTable=zyxelLayer3IpInbandTable, zyLayer3IpDefaultMgmt=zyLayer3IpDefaultMgmt, zyLayer3IpInbandRowStatus=zyLayer3IpInbandRowStatus, zyxelLayer3IpInbandEntry=zyxelLayer3IpInbandEntry, zyLayer3IpInbandMask=zyLayer3IpInbandMask)
# Given an Android 3x3 key lock screen and two integers m and n, # where 1 ≤ m ≤ n ≤ 9, count the total number of unlock patterns of the Android lock screen, # which consist of minimum of m keys and maximum n keys. # Rules for a valid pattern: # Each pattern must connect at least m keys and at most n keys. # All the keys must be distinct. # If the line connecting two consecutive keys in the pattern passes through any other keys, # the other keys must have previously selected in the pattern. # No jumps through non selected key is allowed. # The order of keys used matters. # Explanation: # | 1 | 2 | 3 | # | 4 | 5 | 6 | # | 7 | 8 | 9 | # Invalid move: 4 - 1 - 3 - 6 # Line 1 - 3 passes through key 2 which had not been selected in the pattern. # Invalid move: 4 - 1 - 9 - 2 # Line 1 - 9 passes through key 5 which had not been selected in the pattern. # Valid move: 2 - 4 - 1 - 3 - 6 # Line 1 - 3 is valid because it passes through key 2, which had been selected in the pattern # Valid move: 6 - 5 - 4 - 1 - 9 - 2 # Line 1 - 9 is valid because it passes through key 5, which had been selected in the pattern. # Example: # Input: m = 1, n = 1 # Output: 9 class Solution(object): def numberOfPatterns(self, m, n): """ :type m: int :type n: int :rtype: int """ # M1. 递归回溯 # https://www.cnblogs.com/grandyang/p/5541012.html if m > n: return 0 memo, res, needSkip = {}, [], [[0] * 10 for _ in range(10)] needSkip[1][3], needSkip[3][1], needSkip[1][7], needSkip[7][1], needSkip[1][9], needSkip[9][1] = 2, 2, 4, 4, 5, 5 needSkip[2][8], needSkip[8][2], needSkip[3][9], needSkip[9][3], needSkip[3][7], needSkip[7][3] = 5, 5, 6, 6, 5, 5 needSkip[4][6], needSkip[6][4], needSkip[7][9], needSkip[9][7] = 5, 5, 8, 8 return self.helper(needSkip, memo, m, n, 1, 1, [0] * 10) * 4 \ + self.helper(needSkip, memo, m, n, 1, 2, [0] * 10) * 4 \ + self.helper(needSkip, memo, m, n, 1, 5, [0] * 10) def helper(self, needSkip, memo, m, n, curLen, curLast, visited): visitedKey = self.constructKey(visited) if (curLen, visitedKey, curLast) not in memo: if curLen > n: return 0 res = 0 if m <= curLen <= n: res += 1 visited[curLast] = True for i in range(1, 10): if not visited[i] and (needSkip[curLast][i] == 0 or visited[needSkip[curLast][i]]): res += self.helper(needSkip, memo, m, n, curLen + 1, i, visited) visited[curLast] = False memo[(curLen, visitedKey, curLast)] = res return memo[(curLen, visitedKey, curLast)] def constructKey(self, visited): res = 0 for val in visited: res = (res << 1) + val return res
""" Dana jest tablica T[N]. Proszę napisać program zliczający liczbę “enek” o określonym iloczynie. """ def number_of_ns(T, product, n, idx=0): if product == 1 and n == 0: return 1 if n == 0: return 0 count = 0 for i in range(idx, len(T)): if product % T[i] == 0: count += number_of_ns(T, product // T[i], n - 1, i + 1) return count T = [4, 6, 1, 7, 8, 3, 8, 9, 4, 21, 6, 12, 9, 6, 2] print(number_of_ns(T, 16, 3))
##planets = [ ## { ## "planet": "Tatooine", ## "visited": False, ## "reachable": ["Dagobah", "Hoth"] ## }, ## { ## "planet": "Dagobah", ## "visited": False, ## "reachable": ["Hoth", "Endor"] ## }, ## { ## "planet": "Endor", ## "visited": False, ## "reachable": [] ## }, ## { ## "planet": "Hoth", ## "visited": False, ## "reachable": ["Endor"] ## }, ##] ## ##def build_reachables(planets, reachables): ## reachable_planets = [] ## for planet in planets: ## if planet["planet"] in reachables: ## reachable_planets.append(planet) ## return reachable_planets ## ##def explore_all_routes(planets, current_planet,trajectory): ## current_planet["visited"] = True ## print(current_planet) ## trajectory.append(current_planet) ## reachables = current_planet["reachable"] ## reachables_list = build_reachables(planets,reachables) ## for voisin in reachables_list: ## if not voisin["visited"]: ## explore_all_routes(planets, voisin, trajectory) ## ## ## ##for planet in planets: ## trajectory = [] ## if not planet["visited"]: ## explore_all_routes(planets, planet, trajectory) ## planets[planet] mylist =[{'trajectory': ['Tatooine', 'Hoth', 'Endor'], 'total_time': 7, 'caught_proba': 0.19}, {'trajectory': ['Tatooine', 'Hoth', 'Endor'], 'total_time': 7, 'caught_proba': 0.18}, {'trajectory': ['Tatooine', 'Hoth', 'Endor'], 'total_time': 7, 'caught_proba': 0} ] def take_caught_proba(elem): return elem["caught_proba"] mylist.sort(key=take_caught_proba) print(mylist[0])
# -*- coding: utf-8 -*- def main(): n, m = map(int, input().split()) xs = sorted(list(map(int, input().split()))) if n >= m: print(0) else: ans = xs[-1] - xs[0] diff = [0 for _ in range(m - 1)] for i in range(m - 1): diff[i] = xs[i + 1] - xs[i] print(ans - sum(sorted(diff, reverse=True)[:n - 1])) if __name__ == '__main__': main()
if True: pass if 0: pass if 1: pass if (1==1) : pass if 1 == 2 + - 1 : pass if 456 == 244: pass if 1 == 0 - 5 + 6 - 1: pass if 2 + 2 == 5: pass if 23313 + 31313 == 0: pass if 2 + 2 == 3 + 1 * 0 + 1 : pass if 1 == 1: pass if - 1== 2-3 : pass if (2 + 2) + 2 == 7: pass if 55 * 2 / 2 * 4 / 4 * 2 / 2 == 759 + ( -1 + 56 + 77 - 77) + 123 * 3 - (369 - 1 + 1 - 1 - 1 + 2 + 2 ** 2 - 4) - 750 - 3 ** 2 + 1: pass if 55 * 2 / 2 * 4 / 4 * 2 / 2 == 759 + -1 + 56 + 77 - 77 + 123 * 3 - 369 - 1 + 1 - 1 - 1 + 2 + 2 ** 2 - 4 - 750 - 3 ** 2 + 1: pass if 55 * 2 / 2 * 4 / 4 * 2 / 2 == 759 + ( -1 + 56 + 77 - 77) + 123 * 3 - (369 - 1 + 1 - 1 - 1 + 2 + 2 ** 2 - 4) - 750 - 3 ** 2 : pass if 55 * 2 / 2 * 4 / 4 * 2 / 2 == 759 + -1 + 56 + 77 - 77 + 123 * 3 - 369 - 1 + 1 - 1 - 1 + 2 + 2 ** 2 - 4 - 750 - 3 ** 2 : pass if 55*2/2*4/4*2/2+2**3==759+-1+56+77-77+123*3-369-1+1-1-1+2+2**2-4-750-3**2+3**2-1+1//34 : pass if True and False or True and False: pass if True and ( False or True ) : pass if ( True and False ) or False : pass if True and not False: pass if not True and False: pass if 123456 + 6 - 999 + 3333 - 228 or 1 == 5: pass if not True and True or True and not True: pass if 2 +2 * 2 == 6: pass if 10 * 10 // 101 * 10 == 0: pass if 10 * 11 // 101 * 10 == 0: pass if ( 2+ 2 ) * 2 == 8: pass if ( 2 + 2) * 2 ==7 : pass if -(1+1)==-2: pass if -(1+1)!=-2: pass if 2 + ( 2 ) == 3 or 1: pass if ( 99 * 8 )/ 10 > 10: pass if 99 * ( 8 / 10) < 10: pass if 99 * ( 8 / 10 )> 10: pass if - (1313 - 1314) * - 1 == 1 * (2 - 3): pass if 1/0 ==0: pass if 100% 3==1: pass if 100 %0==1: pass if 100 % 4==1: pass if 1/1==1: pass
# lists02.py def test_list_01(): # Tuples: immutable t1 = (1, 2, 3) print(t1, type(t1)) # Lists: immutable l1 = [1, 2, 3] print(l1, type(l1)) t2 = t1 l2 = l1 # Kopie, Clone erzeugen l2 = list(l1) # Neue Liste mit den Elementen aus l1 l3 = l1.copy() t2 = t2 + (4, ) l2.append(4) print("T1: ", t1, type(t1)) print("L1: ", l1, type(l1)) print("T2: ", t2, type(t2)) print("L2: ", l2, type(l2)) print("L3: ", l3, type(l3)) def test_list_02(): l1 = ["A", "B"] # Leere Liste l2 = [] l3 = list() for i in range(1, 10): l2.append(i) l4 = list(range(1, 10)) l3.append(42) # 42 anfügen l3.append(l2) # Liste l2 anfügen print("L2 ", l2, type(l2), "#", len(l2)) print("L3 ", l3, type(l3), "#", len(l3)) l3[1].append(10) print("L3 ", l3, type(l3), "#", len(l3)) def test_list_03(): l1 = ["A", "B", "C", "C"] l2 = ["D", "E", "F"] l3 = list("DEF") # l1.append(l2) # List 12 wird komplett in l1 eingefügt l1.extend(l2) # Element aus 12 werden in l1 angefügt print("L1 ", l1, type(l1), "#", len(l1)) l1.insert(0, "XXXX") l1.insert(0, "YY") l1.insert(0, "ZZZ") print("L1 ", l1, type(l1), '#', len(l1)) last = l1.pop print("L1 ", l1, type(l1), '#', len(l1)) l1.remove("C") # entfernt nur erstes finding # l1.remove("C") # entfernt nur erstes finding print("L1 ", l1, type(l1), '#', len(l1)) exist = "C" in l1 # findet nur erstes finding print('Exist("C")', exist) if exist: pos = l1.index("C", 0) print('Pos("C")', pos) def test_list_04(): def mySelector(x): # return str(x) return -int(x) l1 = [3,4,2,5] l1.sort() # .reverse() print("L1 sortiert ", l1) l1.reverse() # .reverse() print("L1 reverse sortiert", l1) l1.append("11") l1.append("1") # Lambda-Ausdruck => Funktionsausdruck # Funktion ohne Namen # mySelector = lambda x: -int(x) l1.sort(key = mySelector) #.reverse() print("L1 sortiert ", l1) # Auch Lambda l1.sort(key = lambda x: -int(x)) #.reverse() print("L1 sortiert mit Lambda ", l1) l2 = ["BB", "A", "CCC", "DD", "AA", "DDDD", "EEE"] l2.sort(reverse = True, key = lambda x: len(x)) # sortiert nach der Länge print("Sortiert nach der Länge ", l2) def test_list_05(): l1 = [1,2,3] l2 = ["A", "B", "C"] l3 = l1 + l2 # l1 = l1 + l2 print("L3 ", l3) print(l1*5) l4 = zip(l1,l2) print("L4 ", l4) for elem in l4: print("Elemeents in L4 ", elem, type(elem)) for a, b in l4: print("a,b ", a,b) def test_list_06(): l2 = ["A", "B", "C"] l3 = list(map(lambda x: (x, ord(x)), l2)) print("L3 ", l3) l4 = [ [elem, ord(elem) ] for elem in l2] # Comprehension => List Comprehension print("L4 ", l4) l5 = [ (i,j) for i in range(1,10) for j in range (0,10)] print("L5 ", l5) l6 = [] for i in range(1,10): for j in range (1,10): if i < j: l6.append((i,j)) print("L6 ", l6) # test_list_01() # test_list_02() # test_list_03() # test_list_04() # test_list_05() test_list_06()
# # PySNMP MIB module ALCATEL-IND1-IPX-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-IPX-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:02:31 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # routingIND1Ipx, = mibBuilder.importSymbols("ALCATEL-IND1-BASE", "routingIND1Ipx") OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") ModuleIdentity, TimeTicks, Integer32, iso, Counter32, NotificationType, IpAddress, MibIdentifier, Unsigned32, ObjectIdentity, Bits, Counter64, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "TimeTicks", "Integer32", "iso", "Counter32", "NotificationType", "IpAddress", "MibIdentifier", "Unsigned32", "ObjectIdentity", "Bits", "Counter64", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention") alcatelIND1IPXMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1)) alcatelIND1IPXMIB.setRevisions(('2007-04-03 00:00',)) if mibBuilder.loadTexts: alcatelIND1IPXMIB.setLastUpdated('200704030000Z') if mibBuilder.loadTexts: alcatelIND1IPXMIB.setOrganization('Alcatel-Lucent') alcatelIND1IPXMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1)) class NetNumber(TextualConvention, OctetString): status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4) fixedLength = 4 class HostAddress(TextualConvention, OctetString): status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6) fixedLength = 6 alaIpxRoutingGroup = ObjectIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1)) if mibBuilder.loadTexts: alaIpxRoutingGroup.setStatus('current') alaIpxFilterGroup = ObjectIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2)) if mibBuilder.loadTexts: alaIpxFilterGroup.setStatus('current') alaIpxTimerGroup = ObjectIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 3)) if mibBuilder.loadTexts: alaIpxTimerGroup.setStatus('current') alaIpxStaticRouteTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1), ) if mibBuilder.loadTexts: alaIpxStaticRouteTable.setStatus('current') alaIpxStaticRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxStaticRouteNetNum")) if mibBuilder.loadTexts: alaIpxStaticRouteEntry.setStatus('current') alaIpxStaticRouteNetNum = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1, 1, 1), NetNumber().clone(hexValue="00000000")) if mibBuilder.loadTexts: alaIpxStaticRouteNetNum.setStatus('current') alaIpxStaticRouteNextHopNet = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1, 1, 2), NetNumber().clone(hexValue="00000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxStaticRouteNextHopNet.setStatus('current') alaIpxStaticRouteNextHopNode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1, 1, 3), HostAddress().clone(hexValue="000000000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxStaticRouteNextHopNode.setStatus('current') alaIpxStaticRouteTicks = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxStaticRouteTicks.setStatus('current') alaIpxStaticRouteHopCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 16))).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxStaticRouteHopCount.setStatus('current') alaIpxStaticRouteRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 1, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxStaticRouteRowStatus.setStatus('current') alaIpxDefRouteTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 2), ) if mibBuilder.loadTexts: alaIpxDefRouteTable.setStatus('current') alaIpxDefRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 2, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxDefRouteVlanId")) if mibBuilder.loadTexts: alaIpxDefRouteEntry.setStatus('current') alaIpxDefRouteVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaIpxDefRouteVlanId.setStatus('current') alaIpxDefRouteNet = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 2, 1, 2), NetNumber().clone(hexValue="00000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxDefRouteNet.setStatus('current') alaIpxDefRouteNode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 2, 1, 3), HostAddress().clone(hexValue="000000000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxDefRouteNode.setStatus('current') alaIpxDefRouteRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxDefRouteRowStatus.setStatus('current') alaIpxExtMsgTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 3), ) if mibBuilder.loadTexts: alaIpxExtMsgTable.setStatus('current') alaIpxExtMsgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 3, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxExtMsgVlanId")) if mibBuilder.loadTexts: alaIpxExtMsgEntry.setStatus('current') alaIpxExtMsgVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaIpxExtMsgVlanId.setStatus('current') alaIpxExtMsgMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxExtMsgMode.setStatus('current') alaIpxExtMsgRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 3, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxExtMsgRowStatus.setStatus('current') alaIpxFlush = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("rip", 1), ("sap", 2), ("both", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIpxFlush.setStatus('current') alaIpxRipSapFilterTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1), ) if mibBuilder.loadTexts: alaIpxRipSapFilterTable.setStatus('current') alaIpxRipSapFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterVlanId"), (0, "ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterType"), (0, "ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterNet"), (0, "ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterNetMask"), (0, "ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterNode"), (0, "ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterNodeMask"), (0, "ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterSvcType")) if mibBuilder.loadTexts: alaIpxRipSapFilterEntry.setStatus('current') alaIpxRipSapFilterVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaIpxRipSapFilterVlanId.setStatus('current') alaIpxRipSapFilterType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("sapOutput", 1), ("sapInput", 2), ("gnsOutput", 3), ("ripOutput", 4), ("ripInput", 5))).clone(1)) if mibBuilder.loadTexts: alaIpxRipSapFilterType.setStatus('current') alaIpxRipSapFilterNet = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 3), NetNumber().clone(hexValue="00000000")) if mibBuilder.loadTexts: alaIpxRipSapFilterNet.setStatus('current') alaIpxRipSapFilterNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 4), NetNumber().clone(hexValue="ffffffff")) if mibBuilder.loadTexts: alaIpxRipSapFilterNetMask.setStatus('current') alaIpxRipSapFilterNode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 5), HostAddress().clone(hexValue="000000000000")) if mibBuilder.loadTexts: alaIpxRipSapFilterNode.setStatus('current') alaIpxRipSapFilterNodeMask = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 6), HostAddress().clone(hexValue="ffffffffffff")) if mibBuilder.loadTexts: alaIpxRipSapFilterNodeMask.setStatus('current') alaIpxRipSapFilterSvcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(65535)) if mibBuilder.loadTexts: alaIpxRipSapFilterSvcType.setStatus('current') alaIpxRipSapFilterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("allow", 1), ("block", 2))).clone('allow')).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxRipSapFilterMode.setStatus('current') alaIpxRipSapFilterRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 1, 1, 10), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxRipSapFilterRowStatus.setStatus('current') alaIpxWatchdogSpoofTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 2), ) if mibBuilder.loadTexts: alaIpxWatchdogSpoofTable.setStatus('current') alaIpxWatchdogSpoofEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 2, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxWatchdogSpoofVlanId")) if mibBuilder.loadTexts: alaIpxWatchdogSpoofEntry.setStatus('current') alaIpxWatchdogSpoofVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaIpxWatchdogSpoofVlanId.setStatus('current') alaIpxWatchdogSpoofMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxWatchdogSpoofMode.setStatus('current') alaIpxWatchdogSpoofRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxWatchdogSpoofRowStatus.setStatus('current') alaIpxSerialFilterTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 3), ) if mibBuilder.loadTexts: alaIpxSerialFilterTable.setStatus('current') alaIpxSerialFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 3, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxSerialFilterVlanId")) if mibBuilder.loadTexts: alaIpxSerialFilterEntry.setStatus('current') alaIpxSerialFilterVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaIpxSerialFilterVlanId.setStatus('current') alaIpxSerialFilterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxSerialFilterMode.setStatus('current') alaIpxSerialFilterRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 3, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxSerialFilterRowStatus.setStatus('current') alaSpxKeepaliveSpoofTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 4), ) if mibBuilder.loadTexts: alaSpxKeepaliveSpoofTable.setStatus('current') alaSpxKeepaliveSpoofEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 4, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaSpxKeepaliveSpoofVlanId")) if mibBuilder.loadTexts: alaSpxKeepaliveSpoofEntry.setStatus('current') alaSpxKeepaliveSpoofVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaSpxKeepaliveSpoofVlanId.setStatus('current') alaSpxKeepaliveSpoofMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaSpxKeepaliveSpoofMode.setStatus('current') alaSpxKeepaliveSpoofRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 4, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaSpxKeepaliveSpoofRowStatus.setStatus('current') alaIpxType20Table = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 5), ) if mibBuilder.loadTexts: alaIpxType20Table.setStatus('current') alaIpxType20Entry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 5, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxType20VlanId")) if mibBuilder.loadTexts: alaIpxType20Entry.setStatus('current') alaIpxType20VlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaIpxType20VlanId.setStatus('current') alaIpxType20Mode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxType20Mode.setStatus('current') alaIpxType20RowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 2, 5, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxType20RowStatus.setStatus('current') alaIpxTimerTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 3, 1), ) if mibBuilder.loadTexts: alaIpxTimerTable.setStatus('current') alaIpxTimerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 3, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IPX-MIB", "alaIpxTimerVlanId")) if mibBuilder.loadTexts: alaIpxTimerEntry.setStatus('current') alaIpxTimerVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4094))) if mibBuilder.loadTexts: alaIpxTimerVlanId.setStatus('current') alaIpxTimerSap = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 180)).clone(60)).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxTimerSap.setStatus('current') alaIpxTimerRip = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 180)).clone(60)).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxTimerRip.setStatus('current') alaIpxTimerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 1, 3, 1, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIpxTimerRowStatus.setStatus('current') alcatelIND1IPXMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2)) alcatelIND1IPXMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 1)) alcatelIND1IPXMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2)) alcatelIND1IPXMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 1, 1)).setObjects(("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBStaticRouteGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBDefRouteGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBExtMsgGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBFlushGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBRipSapFilterGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBWatchdogSpoofGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBSerialFilterGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBKeepaliveSpoofGroup"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBType20Group"), ("ALCATEL-IND1-IPX-MIB", "alcatelIND1IPXMIBTimerGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBCompliance = alcatelIND1IPXMIBCompliance.setStatus('current') alcatelIND1IPXMIBStaticRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 1)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxStaticRouteNextHopNet"), ("ALCATEL-IND1-IPX-MIB", "alaIpxStaticRouteNextHopNode"), ("ALCATEL-IND1-IPX-MIB", "alaIpxStaticRouteTicks"), ("ALCATEL-IND1-IPX-MIB", "alaIpxStaticRouteHopCount"), ("ALCATEL-IND1-IPX-MIB", "alaIpxStaticRouteRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBStaticRouteGroup = alcatelIND1IPXMIBStaticRouteGroup.setStatus('current') alcatelIND1IPXMIBDefRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 2)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxDefRouteNet"), ("ALCATEL-IND1-IPX-MIB", "alaIpxDefRouteNode"), ("ALCATEL-IND1-IPX-MIB", "alaIpxDefRouteRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBDefRouteGroup = alcatelIND1IPXMIBDefRouteGroup.setStatus('current') alcatelIND1IPXMIBExtMsgGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 3)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxExtMsgMode"), ("ALCATEL-IND1-IPX-MIB", "alaIpxExtMsgRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBExtMsgGroup = alcatelIND1IPXMIBExtMsgGroup.setStatus('current') alcatelIND1IPXMIBFlushGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 4)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxFlush")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBFlushGroup = alcatelIND1IPXMIBFlushGroup.setStatus('current') alcatelIND1IPXMIBRipSapFilterGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 5)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterMode"), ("ALCATEL-IND1-IPX-MIB", "alaIpxRipSapFilterRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBRipSapFilterGroup = alcatelIND1IPXMIBRipSapFilterGroup.setStatus('current') alcatelIND1IPXMIBWatchdogSpoofGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 6)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxWatchdogSpoofMode"), ("ALCATEL-IND1-IPX-MIB", "alaIpxWatchdogSpoofRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBWatchdogSpoofGroup = alcatelIND1IPXMIBWatchdogSpoofGroup.setStatus('current') alcatelIND1IPXMIBSerialFilterGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 7)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxSerialFilterMode"), ("ALCATEL-IND1-IPX-MIB", "alaIpxSerialFilterRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBSerialFilterGroup = alcatelIND1IPXMIBSerialFilterGroup.setStatus('current') alcatelIND1IPXMIBKeepaliveSpoofGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 8)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaSpxKeepaliveSpoofMode"), ("ALCATEL-IND1-IPX-MIB", "alaSpxKeepaliveSpoofRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBKeepaliveSpoofGroup = alcatelIND1IPXMIBKeepaliveSpoofGroup.setStatus('current') alcatelIND1IPXMIBType20Group = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 9)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxType20Mode"), ("ALCATEL-IND1-IPX-MIB", "alaIpxType20RowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBType20Group = alcatelIND1IPXMIBType20Group.setStatus('current') alcatelIND1IPXMIBTimerGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 10, 8, 1, 2, 2, 10)).setObjects(("ALCATEL-IND1-IPX-MIB", "alaIpxTimerRip"), ("ALCATEL-IND1-IPX-MIB", "alaIpxTimerSap"), ("ALCATEL-IND1-IPX-MIB", "alaIpxTimerRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alcatelIND1IPXMIBTimerGroup = alcatelIND1IPXMIBTimerGroup.setStatus('current') mibBuilder.exportSymbols("ALCATEL-IND1-IPX-MIB", alcatelIND1IPXMIBTimerGroup=alcatelIND1IPXMIBTimerGroup, alaIpxRipSapFilterNetMask=alaIpxRipSapFilterNetMask, alcatelIND1IPXMIBConformance=alcatelIND1IPXMIBConformance, alcatelIND1IPXMIBExtMsgGroup=alcatelIND1IPXMIBExtMsgGroup, alcatelIND1IPXMIBCompliances=alcatelIND1IPXMIBCompliances, HostAddress=HostAddress, alaSpxKeepaliveSpoofMode=alaSpxKeepaliveSpoofMode, alaIpxExtMsgEntry=alaIpxExtMsgEntry, alaIpxDefRouteNet=alaIpxDefRouteNet, alaIpxStaticRouteNetNum=alaIpxStaticRouteNetNum, alaIpxType20Table=alaIpxType20Table, alaIpxStaticRouteNextHopNet=alaIpxStaticRouteNextHopNet, alaIpxDefRouteRowStatus=alaIpxDefRouteRowStatus, PYSNMP_MODULE_ID=alcatelIND1IPXMIB, alaSpxKeepaliveSpoofRowStatus=alaSpxKeepaliveSpoofRowStatus, alaIpxStaticRouteTicks=alaIpxStaticRouteTicks, alaIpxTimerVlanId=alaIpxTimerVlanId, alcatelIND1IPXMIBWatchdogSpoofGroup=alcatelIND1IPXMIBWatchdogSpoofGroup, alaIpxTimerRowStatus=alaIpxTimerRowStatus, alaIpxWatchdogSpoofTable=alaIpxWatchdogSpoofTable, alaSpxKeepaliveSpoofVlanId=alaSpxKeepaliveSpoofVlanId, alaIpxRipSapFilterRowStatus=alaIpxRipSapFilterRowStatus, alcatelIND1IPXMIBSerialFilterGroup=alcatelIND1IPXMIBSerialFilterGroup, alcatelIND1IPXMIBStaticRouteGroup=alcatelIND1IPXMIBStaticRouteGroup, alaIpxRipSapFilterNodeMask=alaIpxRipSapFilterNodeMask, alaIpxTimerRip=alaIpxTimerRip, alaIpxTimerSap=alaIpxTimerSap, alaIpxRipSapFilterVlanId=alaIpxRipSapFilterVlanId, alaIpxRipSapFilterNode=alaIpxRipSapFilterNode, alaIpxSerialFilterVlanId=alaIpxSerialFilterVlanId, alaIpxRoutingGroup=alaIpxRoutingGroup, alaIpxStaticRouteHopCount=alaIpxStaticRouteHopCount, alcatelIND1IPXMIBType20Group=alcatelIND1IPXMIBType20Group, alaIpxTimerTable=alaIpxTimerTable, alaIpxType20VlanId=alaIpxType20VlanId, alaIpxWatchdogSpoofEntry=alaIpxWatchdogSpoofEntry, alaIpxFilterGroup=alaIpxFilterGroup, alaIpxRipSapFilterTable=alaIpxRipSapFilterTable, alaIpxRipSapFilterMode=alaIpxRipSapFilterMode, alcatelIND1IPXMIBObjects=alcatelIND1IPXMIBObjects, alaIpxSerialFilterTable=alaIpxSerialFilterTable, alaIpxDefRouteTable=alaIpxDefRouteTable, alaIpxType20Mode=alaIpxType20Mode, alaIpxRipSapFilterNet=alaIpxRipSapFilterNet, alaIpxType20RowStatus=alaIpxType20RowStatus, alaIpxTimerGroup=alaIpxTimerGroup, alaIpxStaticRouteRowStatus=alaIpxStaticRouteRowStatus, alaIpxSerialFilterEntry=alaIpxSerialFilterEntry, alaIpxDefRouteNode=alaIpxDefRouteNode, alcatelIND1IPXMIBFlushGroup=alcatelIND1IPXMIBFlushGroup, alaIpxRipSapFilterSvcType=alaIpxRipSapFilterSvcType, NetNumber=NetNumber, alaIpxExtMsgTable=alaIpxExtMsgTable, alcatelIND1IPXMIBGroups=alcatelIND1IPXMIBGroups, alaSpxKeepaliveSpoofEntry=alaSpxKeepaliveSpoofEntry, alaIpxExtMsgRowStatus=alaIpxExtMsgRowStatus, alaIpxTimerEntry=alaIpxTimerEntry, alaIpxStaticRouteNextHopNode=alaIpxStaticRouteNextHopNode, alcatelIND1IPXMIBDefRouteGroup=alcatelIND1IPXMIBDefRouteGroup, alcatelIND1IPXMIBCompliance=alcatelIND1IPXMIBCompliance, alaIpxStaticRouteEntry=alaIpxStaticRouteEntry, alaIpxSerialFilterMode=alaIpxSerialFilterMode, alaSpxKeepaliveSpoofTable=alaSpxKeepaliveSpoofTable, alaIpxDefRouteVlanId=alaIpxDefRouteVlanId, alaIpxRipSapFilterEntry=alaIpxRipSapFilterEntry, alaIpxWatchdogSpoofRowStatus=alaIpxWatchdogSpoofRowStatus, alaIpxExtMsgMode=alaIpxExtMsgMode, alaIpxSerialFilterRowStatus=alaIpxSerialFilterRowStatus, alcatelIND1IPXMIB=alcatelIND1IPXMIB, alaIpxRipSapFilterType=alaIpxRipSapFilterType, alaIpxDefRouteEntry=alaIpxDefRouteEntry, alaIpxStaticRouteTable=alaIpxStaticRouteTable, alcatelIND1IPXMIBKeepaliveSpoofGroup=alcatelIND1IPXMIBKeepaliveSpoofGroup, alaIpxWatchdogSpoofMode=alaIpxWatchdogSpoofMode, alcatelIND1IPXMIBRipSapFilterGroup=alcatelIND1IPXMIBRipSapFilterGroup, alaIpxFlush=alaIpxFlush, alaIpxExtMsgVlanId=alaIpxExtMsgVlanId, alaIpxWatchdogSpoofVlanId=alaIpxWatchdogSpoofVlanId, alaIpxType20Entry=alaIpxType20Entry)
command = input() command = command.strip() tokens = [] numbers = ['0','1','2','3','4','5','6','7','9'] if (command[:4]=="cout" and command[-1]==';'): index = 4 while(True): if(command[index]=='<' and command[index+1]=='<'): index+=2 s="" while(command[index]!='<' and command[index]!=';'): s+=command[index] index+=1 tokens.append(s) if (command[index]==';'): break elif (command[index]=='<'): continue else: print("ERROR!") exit() else: print("ERROR") exit() else: print("ERROR") exit() print(tokens) cout = [] for t in tokens: to = t.strip() num="" i=0 if (to[0]=='\"' and to[-1]=='\"'): cout.append(to[1:len(to)-1]) elif (to[i] in numbers): while(i!= len(to) and to[i] in numbers): num+=to[i] i+=1 if (i!=len(to)): print("ERROR") exit() else: cout.append(num) elif (to=="endl"): cout.append(-1) else: print("ERROR!!") exit() for p in cout: if p==-1: print('\n',end='') else: print(p,end=' ')
""" Source: https://en.wikipedia.org/wiki/Palindrome#Names """ def is_palindrome(text: str) -> bool: return text.lower() == text.lower()[::-1] if __name__=='__main__': text = input('Give me the text to analyze: ') print(f'{text} Is Palindrome?: {is_palindrome(text)}')
result = { "due-date": "2018-11-13T00:00:00", "features": [ { "geometry": { "coordinates": [ [ [ 9.52487, 46.85514 ], [ 9.52212, 46.8517 ], [ 9.52433, 46.84804 ], [ 9.53032, 46.84769 ], [ 9.53377, 46.85042 ], [ 9.53482, 46.85252 ], [ 9.53253, 46.85529 ], [ 9.52487, 46.85514 ] ] ], "type": "Polygon" }, "properties": { "grade": "B", "uic_ref": 1 }, "type": "Feature" }, { "geometry": { "coordinates": [ [ [ 9.52538, 46.85437 ], [ 9.52431, 46.85209 ], [ 9.52566, 46.84971 ], [ 9.52948, 46.84958 ], [ 9.53216, 46.85214 ], [ 9.53055, 46.85425 ], [ 9.52538, 46.85437 ] ] ], "type": "Polygon" }, "properties": { "grade": "A", "uic_ref": 1 }, "type": "Feature" } ], "lower-bound": "06:00", "type": "FeatureCollection", "type-of-day": "Working Day", "type-of-interval": "Day", "upper-bound": "20:00" }
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Michael A.G. Aivazis # California Institute of Technology # (C) 1998-2005 All Rights Reserved # # {LicenseText} # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # def KeyboardAttributes(object): def identify(self, inspector): return inspector.onKeyboardAttributes(self) def __init__(self): self.accesskey = '' self.tabindex = '' return # version __id__ = "$Id: KeyboardAttributes.py,v 1.1 2005/03/20 07:22:58 aivazis Exp $" # End of file
# -*- coding: utf-8 -*- """ Created on Sun Jul 5 16:32:17 2020 Write a Python function that returns a list of keys in aDict that map to integer values that are unique (i.e. values appear exactly once in aDict). The list of keys you return should be sorted in increasing order. (If aDict does not contain any unique values, you should return an empty list.) @author: MarcoSilva """ def uniqueValues(aDict): ''' aDict: a dictionary ''' d = {} l = [] # for each key in the dictionary we check if the respective value exists in # the dictionary, if it does we update, otherwise we add a new one for k in aDict: val = aDict[k] if val in d: d[val] += 1 else: d[val] = 1 # for each value in the new dict, if it only has showed one time # we get the key from aDict and add it to the list to return for v in d: if d[v] == 1: l.append(getIndex(aDict,v)) # sorting because we need to return in order l.sort() return l def getIndex(aDict, val): ''' Receives a dictionary and a value to search If any key corresponds to that value, that key is returned ''' for k in aDict: if aDict[k] == val: return k return None
class Solution: def findLHS(self, nums: list) -> int: nums.sort() start_index = 0 l_count = 0 m_count = 0 LHS = 0 for i in range(len(nums)): if start_index == 0: l_count = 1 min_num = nums[i] start_index = 1 # max_num = None else: if nums[i] == min_num: l_count += 1 elif nums[i] - min_num == 1: max_num = nums[i] m_count += 1 elif m_count != 0 and (nums[i] - max_num == 1): min_num = max_num l_count = m_count m_count = 1 else: min_num = nums[i] l_count = 1 m_count = 0 # max_num = min_num + 1 if l_count and m_count and l_count + m_count > LHS: LHS = l_count + m_count return LHS nums = [1,3,2,2,5,2,3,7] nums = [1,2,3,4] nums = [1,1,1,1] nums = [1,3,5,7,9,11,13,15,17] nums = [1,2,-1,1,2,5,2,5,2] nums = [3,2,2,3,2,1,3,3,3,-2,0,3,2,1,0,3,1,0,1,3,0,3,3] s = Solution() print(s.findLHS(nums))
MAX_WORD_SENTENCE = 40 # VECTORIZATIONS TDIDF_EMBEDDING = 'tdidf' TOKENIZER = 'tokenizer' # IMBALANCE SMOTE_IMBALANCE = 'smote' # DATASET TYPES FINANCIAL_DATASET = 'financial_phrases_bank' MOVIE_DATASET = 'movie_data' SST_DATASET = 'sst_dataset' TWITTER_DATASET = 'twitter_data' YAHOO_DATASET = 'yahoo_data' NN_DATASET = 'nn_dataset' POLYGLON_DATASET = 'polyglon_data' # MODELS LOG_REG = 'logistic_regression' VADER = 'vader' SPACY = 'spacy' CONV_MODEL = 'conv_model' BERT_MODEL = 'bert_model' TRANSFOMER_MODEL = 'transformer_model' # RESOURCES TSLA_PRELOAD = 'resources/twitter_dataset/TSLA_preload' AAPL_PRELOAD = 'resources/yahoo_dataset/AAPL-news-cleaned_preload' TSLA_SENTIMENT = 'resources/twitter_dataset/TSLA_sentiment' AAPL_SENTIMENT = 'resources/yahoo_dataset/AAPL-news-cleaned_sentiment'
# Faça um programa que leia um número inteiro e mostre na tela o seu sucessor e seu antecessor num = int(input('Digite um número inteiro: ')) ant = num - 1 suc = num + 1 print('O sucessor de {} é {} e seu antecessor é {}'.format(num, suc, ant)) # Resolução com somente uma variável: # print('O sucessor de {} é {} e seu antecessor é {}'.format(num, (num+1), (num-1)))
__all__ = [ 'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn', 'vgg19_bn', 'vgg19', ] model_urls = { 'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth', 'vgg13': 'https://download.pytorch.org/models/vgg13-c768596a.pth', 'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth', 'vgg19': 'https://download.pytorch.org/models/vgg19-dcbb9e9d.pth', 'vgg11_bn': 'https://download.pytorch.org/models/vgg11_bn-6002323d.pth', 'vgg13_bn': 'https://download.pytorch.org/models/vgg13_bn-abd245e5.pth', 'vgg16_bn': 'https://download.pytorch.org/models/vgg16_bn-6c64b313.pth', 'vgg19_bn': 'https://download.pytorch.org/models/vgg19_bn-c79401a0.pth', } cfg = { 'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'VGG13': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'], 'VGG16': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M'], 'VGG19': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 512, 512, 512, 512, 'M', 512, 512, 512, 512, 'M'], } dtype=object class VGG(nn.Module): def __init__(self, vgg_name): super(VGG, self).__init__() self.features = self._make_layers(cfg[vgg_name]) self.classifier = nn.Sequential( nn.Linear(512, 512), nn.ReLU(True), nn.Linear(512, 512), nn.ReLU(True), nn.Linear(512, 10) ) def forward(self, x): out = self.features(x) out = out.view(out.size(0), -1) out = self.classifier(out) output = F.log_softmax(out, dim=1) return output def _make_layers(self, cfg): layers = [] in_channels = 3 for x in cfg: if x == 'M': layers += [nn.MaxPool2d(kernel_size=2, stride=2)] else: layers += [nn.Conv2d(in_channels, x, kernel_size=3, padding=1), nn.BatchNorm2d(x), nn.ReLU(inplace=True)] in_channels = x layers += [nn.AvgPool2d(kernel_size=1, stride=1)] return nn.Sequential(*layers) def baseline_data(num): xtrain, ytrain, xtmp,ytmp = get_cifar10() x , y = shuffle_list_data(xtrain, ytrain) x, y = x[:num], y[:num] transform, _ = get_default_data_transforms(train=True, verbose=False) loader = torch.utils.data.DataLoader(CustomImageDataset(x, y, transform), batch_size=16, shuffle=True) return loader def client_update(client_model, optimizer, train_loader, epoch=5): model.train() for e in range(epoch): for batch_idx, (data, target) in enumerate(train_loader): data, target = data.cuda(), target.cuda() optimizer.zero_grad() output = client_model(data) loss = F.nll_loss(output, target) loss.backward() optimizer.step() return loss.item() def client_syn(client_model, global_model): client_model.load_state_dict(global_model.state_dict()) def server_aggregate(global_model, client_models,client_lens): total = sum(client_lens) n = len(client_models) global_dict = global_model.state_dict() for k in global_dict.keys(): global_dict[k] = torch.stack([client_models[i].state_dict()[k].float()*(n*client_lens[i]/total) for i in range(len(client_models))], 0).mean(0) global_model.load_state_dict(global_dict) for model in client_models: model.load_state_dict(global_model.state_dict()) def test(global_model, test_loader): model.eval() test_loss = 0 correct = 0 with torch.no_grad(): for data, target in test_loader: data, target = data.cuda(), target.cuda() output = global_model(data) test_loss += F.nll_loss(output, target, reduction='sum').item() # sum up batch loss pred = output.argmax(dim=1, keepdim=True) # get the index of the max log-probability correct += pred.eq(target.view_as(pred)).sum().item() test_loss /= len(test_loader.dataset) acc = correct / len(test_loader.dataset) print('comm-round: {} | average train loss {%0.3g} | test loss {%0.3g} | test acc: {%0.3f}' % (r, loss_retrain / num_selected, test_loss, acc)) return test_loss, acc classes_pc = 2 num_clients = 20 num_selected = 6 num_rounds = 5 epochs = 2 batch_size = 32 baseline_num = 100 retrain_epochs = 2 #### global model ########## global_model = VGG('VGG19').cuda() ############# client models ############################### client_models = [ VGG('VGG19').cuda() for _ in range(num_selected)] for model in client_models: model.load_state_dict(global_model.state_dict()) ### initial synchronizing with global modle #include Devise::TestHelpers, type: :controller ###### optimizers ################ opt = [optim.SGD(model.parameters(), lr=0.01) for model in client_models] def baseline_data(num): xtrain, ytrain, xtmp,ytmp = get_cifar10() x , y = shuffle_list_data(xtrain, ytrain) x, y = x[:num], y[:num] transform, _ = get_default_data_transforms(train=True, verbose=False) loader = torch.utils.data.DataLoader(CustomImageDataset(x, y, transform), batch_size=16, shuffle=True) return loader ####### baseline data ############ loader_fixed = baseline_data(baseline_num) train_loader, test_loader = get_data_loaders(classes_pc=classes_pc, nclients= num_clients, batch_size=batch_size,verbose=True) losses_train = [] losses_test = [] acc_test = [] losses_retrain=[] np.warnings.filterwarnings('ignore', category=np.VisibleDeprecationWarning) def client_syn(client_model, global_model): client_model.load_state_dict(global_model.state_dict()) def client_update(client_model, optimizer, train_loader, epoch=5): model.train() for e in range(epoch): for batch_idx, (data, target) in enumerate(train_loader): data, target = data.cuda(), target.cuda() optimizer.zero_grad() output = client_model(data) loss = F.nll_loss(output, target) loss.backward() optimizer.step() return loss.item() def test(global_model, test_loader): model.eval() test_loss = 0 correct = 0 with torch.no_grad(): for data, target in test_loader: data, target = data.cuda(), target.cuda() output = global_model(data) test_loss += F.nll_loss(output, target, reduction='sum').item() # sum up batch loss pred = output.argmax(dim=1, keepdim=True) # get the index of the max log-probability correct += pred.eq(target.view_as(pred)).sum().item() test_loss /= len(test_loader.dataset) acc = correct / len(test_loader.dataset) print('comm-round: {} | average train loss {%0.3g} | test loss {%0.3g} | test acc: {%0.3f}' % (r, loss_retrain / num_selected, test_loss, acc)) return test_loss, acc # Runnining FL for r in range(num_rounds): #Communication round # select random clients client_idx = np.random.permutation(num_clients)[:num_selected] client_lens = [len(train_loader[idx]) for idx in client_idx] # client update loss = 0 for i in tqdm(range(num_selected)): client_syn(client_models[i], global_model) loss += client_update(client_models[i], opt[i], train_loader[client_idx[i]], epochs) losses_train.append(loss) # server aggregate #### retraining on the global server loss_retrain =0 for i in tqdm(range(num_selected)): loss_retrain+= client_update(client_models[i], opt[i], loader_fixed) losses_retrain.append(loss_retrain) def test(global_model, test_loader): model.eval() test_loss = 0 correct = 0 with torch.no_grad(): for data, target in test_loader: data, target = data.cuda(), target.cuda() output = global_model(data) test_loss += F.nll_loss(output, target, reduction='sum').item() # sum up batch loss pred = output.argmax(dim=1, keepdim=True) # get the index of the max log-probability correct += pred.eq(target.view_as(pred)).sum().item() test_loss /= len(test_loader.dataset) acc = correct / len(test_loader.dataset) return test_loss, acc def server_aggregate(global_model, client_models,client_lens): test_loss, acc = test(global_model, test_loader) losses_test.append(test_loss) acc_test.append(acc) print('%d-th round' % r) #print('average train loss %0.3g | test loss %0.3g | test acc: %0.3f' % (loss_retrain / num_selected, test_loss, acc))
class BaseDriver(object): EXECUTABLE_PATH = None BINARY_PATH = None def __init__(self): self._driver = None @property def driver(self): return self._driver
# 2019-02-18 # sentence to dictionary meaning sentence = "It is truth universally acknowledged" f = open('dict_test.TXT', 'r', encoding='utf-8') dictionary = {} for line in f: word = line[:-1].split(" : ", 1) dictionary.update({word[0]:word[-1]}) f.close() print("Sentence :", sentence) for word in sentence.split(" "): print(word.lower(), ':', dictionary[word.lower()])
def calcIoU(rectA, rectB): """Calculate IoU for two rectangles. Args: rectA: Rectangular bounding box ([top left X, top left Y, bottom right X, bottom right Y]). rectB: Rectangular bounding box ([top left X, top left Y, bottom right X, bottom right Y]). Returns: Returns IoU, intersection area, rectangle A area, and rectangle B area. """ # Top left X, top left Y, bottom right X, bottom right Y of rectangle A. aXmin, aYmin, aXmax, aYmax = rectA # Top left X, top left Y, bottom right X, bottom right Y of rectangle B. bXmin, bYmin, bXmax, bYmax = rectB # Calculate the area of rectangle A. aArea = (aXmax - aXmin) * (aYmax - aYmin) # aArea = (aXmax - aXmin + 1) * (aYmax - aYmin + 1)# The reason for adding 1 is to avoid division by zero. # Calculate the area of rectangle B. bArea = (bXmax - bXmin) * (bYmax - bYmin) # bArea = (bXmax - bXmin + 1) * (bYmax - bYmin + 1)# The reason for adding 1 is to avoid division by zero. # Calculate the area of intersection. interXmin = max(aXmin, bXmin) interYmin = max(aYmin, bYmin) interXmax = min(aXmax, bXmax) interYmax = min(aYmax, bYmax) interWidth = max(0, interXmax - interXmin) # interWidth = max(0, interXmax - interXmin + 1)# The reason for adding 1 is to avoid division by zero. interHeight = max(0, interYmax - interYmin) # interHeight = max(0, interYmax - interYmin + 1)# The reason for adding 1 is to avoid division by zero. interArea = interWidth * interHeight # Calculate the area of union. unionArea = aArea + bArea - interArea # Calculate IoU. iou = interArea / unionArea return round(iou, 3), interArea, aArea, bArea
class MultiCollector(object): 'a collector combining multiple other collectors' def __init__(self): self._collectors = {} def register(self, name, collector): self._collectors[name] = collector def start(self): for name in self._collectors: self._collectors[name].start() def stop(self): for name in self._collectors: self._collectors[name].stop() def result(self): r = {} for name in self._collectors: r.update({name: self._collectors[name].result()}) return r
# Set number of participants num_dyads = 4 num_participants = num_dyads*2 # Create lists for iterations participants = list(range(num_participants)) dyads = list(range(num_dyads))
class Node(object): def Class(self): """ self.Class() -> Class of node. @return: Class of node. """ # raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") return "%s(%r)" % (self.__class__, self.__dict__) def __getitem__(self): """ x.__getitem__(y) <==> x[y] """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def __len__(self): """ x.__len__() <==> len(x) """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def __reduce_ex__(self): raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def __repr__(self): """ x.__repr__() <==> repr(x) """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def __str__(self): """ x.__str__() <==> str(x) """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def addKnob(self, k): """ self.addKnob(k) -> None. Add knob k to this node or panel. @param k: Knob. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def allKnobs(self): """ self.allKnobs() -> list Get a list of all knobs in this node, including nameless knobs. For example: >>> b = nuke.nodes.Blur() >>> b.allKnobs() @return: List of all knobs. Note that this doesn't follow the links for Link_Knobs """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def autoplace(self): """ self.autoplace() -> None. Automatically place nodes, so they do not overlap. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def bbox(self): """ self.bbox() -> List of x, y, w, h. Bounding box of the node. @return: List of x, y, w, h. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def canSetInput(self, i, node): """ self.canSetInput(i, node) -> bool Check whether the output of 'node' can be connected to input i. @param i: Input number. @param node: The node to be connected to input i. @return: True if node can be connected, False otherwise. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def channels(self): """ self.channels() -> String list. List channels output by this node. @return: String list. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def clones(self): """ self.clones() -> Number of clones. @return: Number of clones. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def connectInput(self, i, node): """ self.connectInput(i, node) -> bool Connect the output of 'node' to the i'th input or the next available unconnected input. The requested input is tried first, but if it is already set then subsequent inputs are tried until an unconnected one is found, as when you drop a connection arrow onto a node in the GUI. @param i: Input number to try first. @param node: The node to connect to input i. @return: True if a connection is made, False otherwise. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def deepSample(self, c, x, y, n): """ self.deepSample(c, x, y, n) -> Floating point value. Return pixel values from a deep image. This requires the image to be calculated, so performance may be very bad if this is placed into an expression in a control panel. @param c: Channel name. @param x: Position to sample (X coordinate). @param y: Position to sample (Y coordinate). @param n: Sample index (between 0 and the number returned by deepSampleCount() for this pixel, or -1 for the frontmost). @return: Floating point value. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def deepSampleCount(self, x, y): """ self.deepSampleCount(x, y) -> Integer value. Return number of samples for a pixel on a deep image. This requires the image to be calculated, so performance may be very bad if this is placed into an expression in a control panel. @param x: Position to sample (X coordinate). @param y: Position to sample (Y coordinate). @return: Integer value. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def dependencies(self, what): """ self.dependencies(what) -> List of nodes. List all nodes referred to by this node. 'what' is an optional integer (see below). You can use the following constants or'ed together to select what types of dependencies are looked for: nuke.EXPRESSIONS = expressions nuke.INPUTS = visible input pipes nuke.HIDDEN_INPUTS = hidden input pipes. The default is to look for all types of connections. Example: nuke.toNode('Blur1').dependencies( nuke.INPUTS | nuke.EXPRESSIONS ) @param what: Or'ed constant of nuke.EXPRESSIONS, nuke.INPUTS and nuke.HIDDEN_INPUTS to select the types of dependencies. The default is to look for all types of connections. @return: List of nodes. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def dependent(self, what, forceEvaluate): """ self.dependent(what, forceEvaluate) -> List of nodes. List all nodes that read information from this node. 'what' is an optional integer: You can use any combination of the following constants or'ed together to select what types of dependent nodes to look for: nuke.EXPRESSIONS = expressions nuke.INPUTS = visible input pipes nuke.HIDDEN_INPUTS = hidden input pipes. The default is to look for all types of connections. forceEvaluate is an optional boolean defaulting to True. When this parameter is true, it forces a re-evaluation of the entire tree. This can be expensive, but otherwise could give incorrect results if nodes are expression-linked. Example: nuke.toNode('Blur1').dependent( nuke.INPUTS | nuke.EXPRESSIONS ) @param what: Or'ed constant of nuke.EXPRESSIONS, nuke.INPUTS and nuke.HIDDEN_INPUTS to select the types of dependent nodes. The default is to look for all types of connections. @param forceEvaluate: Specifies whether a full tree evaluation will take place. Defaults to True. @return: List of nodes. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def error(self): """ error() -> bool True if the node or any in its input tree have an error, or False otherwise. Error state of the node and its input tree. Deprecated; use hasError or treeHasError instead. Note that this will always return false for viewers, which cannot generate their input trees. Instead, choose an input of the viewer (e.g. the active one), and call treeHasError() on that. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def fileDependencies(self, start, end): """ self.fileDependencies(start, end) -> List of nodes and filenames. @param start: first frame @param end: last frame Returns the list of input file dependencies for this node and all nodes upstream from this node for the given frame range. The file dependencies are calcuated by searching for Read ops or ops with a File knob. All views are considered and current proxy mode is used to decide on whether full format or proxy files are returned. Note that Write nodes files are also included but precomps, gizmos and external plugins are not. Any time shifting operation such as frameholds, timeblurs, motionblur etc are taken into consideration. @return The return list is a list of nodes and files they require. Eg. [Read1, ['file1.dpx, file2.dpx'] ], [Read2, ['file3.dpx', 'file4.dpx'] ] ] """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def firstFrame(self): """ self.firstFrame() -> int. First frame in frame range for this node. @return: int. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def forceValidate(self): """ self.forceValidate() -> None Force the node to validate itself, updating its hash. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def format(self): """ self.format() -> Format. Format of the node. @return: Format. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def frameRange(self): """ self.frameRange() -> FrameRange. Frame range for this node. @return: FrameRange. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def fullName(self): """ self.fullName() -> str Get the name of this node and any groups enclosing it in 'group.group.name' form. @return: The fully-qualified name of this node, as a string. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def getNumKnobs(self): """ self.numKnobs() -> The number of knobs. @return: The number of knobs. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def hasError(self): """ hasError() -> bool True if the node itself has an error, regardless of the state of the ops in its input tree, or False otherwise. Error state of the node itself, regardless of the state of the ops in its input tree. Note that an error on a node may not appear if there is an error somewhere in its input tree, because it may not be possible to validate the node itself correctly in that case. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def height(self): """ self.height() -> int. Height of the node. @return: int. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def help(self): """ self.help() -> str @return: Help for the node. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def hideControlPanel(self): """ self.hideControlPanel() -> None @return: None """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def input(self, i): """ self.input(i) -> The i'th input. @param i: Input number. @return: The i'th input. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def inputs(self): """ self.inputs() -> Gets the maximum number of connected inputs. @return: Number of the highest connected input + 1. If inputs 0, 1, and 3 are connected, this will return 4. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def isSelected(self): """ self.isSelected() -> bool Returns the current selection state of the node. This is the same as checking the 'selected' knob. @return: True if selected, or False if not. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def knob(self, p): """ self.knob(p) -> The knob named p or the pth knob. @param p: A string or an integer. @return: The knob named p or the pth knob. Note that this follows the links for Link_Knobs """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def knobs(self): """ self.knobs() -> dict Get a dictionary of (name, knob) pairs for all knobs in this node. For example: >>> b = nuke.nodes.Blur() >>> b.knobs() @return: Dictionary of all knobs. Note that this doesn't follow the links for Link_Knobs """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def lastFrame(self): """ self.lastFrame() -> int. Last frame in frame range for this node. @return: int. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def linkableKnobs(self): """ self.linkableKnobs(knobType) -> List Returns a list of any knobs that may be linked to from the node as well as some meta information about the knob. This may include whether the knob is enabled and whether it should be used for absolute or relative values. Not all of these variables may make sense for all knobs.. @param knobType A KnobType describing the type of knobs you want.@return: A list of LinkableKnobInfo that may be empty . """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def maxInputs(self): """ self.maximumInputs() -> Maximum number of inputs this node can have. @return: Maximum number of inputs this node can have. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def maxOutputs(self): """ self.maximumOutputs() -> Maximum number of outputs this node can have. @return: Maximum number of outputs this node can have. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def maximumInputs(self): """ self.maximumInputs() -> Maximum number of inputs this node can have. @return: Maximum number of inputs this node can have. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def maximumOutputs(self): """ self.maximumOutputs() -> Maximum number of outputs this node can have. @return: Maximum number of outputs this node can have. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def metadata(self, key, time, view): """ self.metadata(key, time, view) -> value or dict Return the metadata item for key on this node at current output context, or at optional time and view. If key is not specified a dictionary containing all key/value pairs is returned. None is returned if key does not exist on this node. @param key: Optional name of the metadata key to retrieve. @param time: Optional time to evaluate at (default is taken from node's current output context). @param view: Optional view to evaluate at (default is taken from node's current output context). @return: The requested metadata value, a dictionary containing all keys if a key name is not provided, or None if the specified key is not matched. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def minInputs(self): """ self.minimumInputs() -> Minimum number of inputs this node can have. @return: Minimum number of inputs this node can have. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def minimumInputs(self): """ self.minimumInputs() -> Minimum number of inputs this node can have. @return: Minimum number of inputs this node can have. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def name(self): """ self.name() -> str @return: Name of node. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def numKnobs(self): """ self.numKnobs() -> The number of knobs. @return: The number of knobs. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def opHashes(self): """ self.opHashes() -> list of int Returns a list of hash values, one for each op in this node. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def optionalInput(self): """ self.optionalInput() -> Number of first optional input. @return: Number of first optional input. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def performanceInfo(self): """ self.performanceInfo( category ) -> Returns performance information for this node. Performance timing must be enabled. @category: performance category ( optional ).A performance category, must be either nuke.PROFILE_STORE, nuke.PROFILE_VALIDATE, nuke.PROFILE_REQUEST or nuke.PROFILE_ENGINE The default is nuke.PROFILE_ENGINE which gives the performance info of the render engine. @return: A dictionary containing the cumulative performance info for this category, where: callCount = the number of calls made timeTakenCPU = the CPU time spent in microseconds timeTakenWall = the actual time ( wall time ) spent in microseconds """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def pixelAspect(self): """ self.pixelAspect() -> int. Pixel Aspect ratio of the node. @return: float. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def proxy(self): """ self.proxy() -> bool @return: True if proxy is enabled, False otherwise. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def readKnobs(self, s): """ self.readKnobs(s) -> None. Read the knobs from a string (TCL syntax). @param s: A string. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def redraw(self): """ self.redraw() -> None. Force a redraw of the node. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def removeKnob(self, k): """ self.removeKnob(k) -> None. Remove knob k from this node or panel. Throws a ValueError exception if k is not found on the node. @param k: Knob. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def resetKnobsToDefault(self): """ self.resetKnobsToDefault() -> None Reset all the knobs to their default values. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def running(self): """ self.running() -> Node rendering when paralled threads are running or None. Class method. @return: Node rendering when paralled threads are running or None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def sample(self, c, x, y, dx, dy, frame): """ self.sample(c, x, y, dx, dy) -> Floating point value. Return pixel values from an image. This requires the image to be calculated, so performance may be very bad if this is placed into an expression in a control panel. Produces a cubic filtered result. Any sizes less than 1, including 0, produce the same filtered result, this is correct based on sampling theory. Note that integers are at the corners of pixels, to center on a pixel add .5 to both coordinates. If the optional dx,dy are not given then the exact value of the square pixel that x,y lands in is returned. This is also called 'impulse filtering'. @param c: Channel name. @param x: Centre of the area to sample (X coordinate). @param y: Centre of the area to sample (Y coordinate). @param dx: Optional size of the area to sample (X coordinate). @param dy: Optional size of the area to sample (Y coordinate). @param frame: Optional frame to sample the node at. @return: Floating point value. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def screenHeight(self): """ self.screenHeight() -> int. Height of the node when displayed on screen in the DAG, at 1:1 zoom, in pixels. @return: int. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def screenWidth(self): """ self.screenWidth() -> int. Width of the node when displayed on screen in the DAG, at 1:1 zoom, in pixels. @return: int. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def selectOnly(self): """ self.selectOnly() -> None. Set this node to be the only selection, as if it had been clicked in the DAG. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def setInput(self, i, node): """ self.setInput(i, node) -> bool Connect input i to node if canSetInput() returns true. @param i: Input number. @param node: The node to connect to input i. @return: True if canSetInput() returns true, or if the input is already correct. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def setName(self, name, uncollide, updateExpressions): """ self.setName(name, uncollide=True, updateExpressions=False) -> None Set name of the node and resolve name collisions if optional named argument 'uncollide' is True. @param name: A string. @param uncollide: Optional boolean to resolve name collisions. Defaults to True. @param updateExpressions: Optional boolean to update expressions in other nodes to point at the new name. Defaults to False. @return: None """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def setSelected(self, selected): """ self.setSelected(selected) -> None. Set the selection state of the node. This is the same as changing the 'selected' knob. @param selected: New selection state - True or False. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def setTab(self, tabIndex): """ self.setTab(tabIndex) -> None @param tabIndex: The tab to show (first is 0). @return: None """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def setXYpos(self, x, y): """ self.setXYpos(x, y) -> None. Set the (x, y) position of node in node graph. @param x: The x position of node in node graph. @param y: The y position of node in node graph. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def setXpos(self, x): """ self.setXpos(x) -> None. Set the x position of node in node graph. @param x: The x position of node in node graph. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def setYpos(self, y): """ self.setYpos(y) -> None. Set the y position of node in node graph. @param y: The y position of node in node graph. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def showControlPanel(self, forceFloat): """ self.showControlPanel(forceFloat = false) -> None @param forceFloat: Optional python object. If it evaluates to True the control panel will always open as a floating panel. Default is False. @return: None """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def showInfo(self, s): """ self.showInfo(s) -> None. Creates a dialog box showing the result of script s. @param s: A string. @return: None. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def shown(self): """ self.shown() -> true if the properties panel is open. This can be used to skip updates that are not visible to the user. @return: true if the properties panel is open. This can be used to skip updates that are not visible to the user. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def treeHasError(self): """ treeHasError() -> bool True if the node or any in its input tree have an error, or False otherwise. Error state of the node and its input tree. Note that this will always return false for viewers, which cannot generate their input trees. Instead, choose an input of the viewer (e.g. the active one), and call treeHasError() on that. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def upstreamFrameRange(self, i): """ self.upstreamFrameRange(i) -> FrameRange Frame range for the i'th input of this node. @param i: Input number. @return: FrameRange. Returns None when querying an invalid input. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def width(self): """ self.width() -> int. Width of the node. @return: int. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def writeKnobs(self, i): """ self.writeKnobs(i) -> String in .nk form. Return a tcl list. If TO_SCRIPT | TO_VALUE is not on, this is a simple list of knob names. If it is on, it is an alternating list of knob names and the output of to_script(). Flags can be any of these or'd together: - nuke.TO_SCRIPT produces to_script(0) values - nuke.TO_VALUE produces to_script(context) values - nuke.WRITE_NON_DEFAULT_ONLY skips knobs with not_default() false - nuke.WRITE_USER_KNOB_DEFS writes addUserKnob commands for user knobs - nuke.WRITE_ALL writes normally invisible knobs like name, xpos, ypos @param i: The set of flags or'd together. Default is TO_SCRIPT | TO_VALUE. @return: String in .nk form. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.") def xpos(self): """ self.xpos() -> X position of node in node graph. @return: X position of node in node graph. """ raise NotImplementedError("This function is not written yet. Please put in an issue on the github page.")
basrol = input("Başrolün ismi: ") kardes = input("Başrolün Ağabeyi: ") anne = input("Başrolün Annesi: ") baba = input("Başrolün Babası: ") sevgili1 = input("Basrolun Sevdiği: ") arkadas = input("Başrolün Yakın Arkadaşı: ") mekan = input("Nerede: ") isyeri = input("Nerede Çalışıyorlar: ") print ("------------------------------------------") print(basrol, "ve ",kardes," kardeştir.") print("Anneleri ",anne,", babaları ",baba,"'dir.") print(basrol,", ağabeyinin ve ",sevgili1,"'nin" ,mekan,"nde, ",kardes," ve ",sevgili1,"'nin fotoğrafını çeken fotoğrafçı ile tartışmış ve fotoğrafçının kamerasını kırmıştır.") print("Fotoğrafçının kamerasını kırması üzerine, kameranın parasını çıkartmak için ağabeyi ile birlikte ",isyeri," işine girip para biriktirmiştir.") print("Kazandığı para ile birlikte âşık olduğu ",sevgili1,"'ye hediye almıştır ve ",sevgili1,"'ye aldığı hediyeyi verip açılmayı planlayan ",basrol,", ağabeyi ",kardes," ile ",sevgili1,"'yi öpüşürken görmüştür.") print("Bu olaydan sonra",basrol," eve gitmiş ve babasının, Kameranın parası nerede? diye sormasının ardından babası ile tartışmıştır.") print("Tartışma sırasında evin annesi ",anne,", çocuğu ve eşini ayırmak için araya girmiş ve baba ",baba,", eşine tokat atmıştır.") print("Buna dayanamayan ",basrol," babasına yumruk atmış ve iş arabasını alıp evden kaçmıştır.") print("Arkadaşı ",arkadas," ile alkol alan ",basrol,"'i, ",kardes," gelip almıştır.") print("Arabayla eve giderken ",kardes," ile tartışmıştır ve bu tartışma sırasında ",kardes," önüne çıkan genci fark etmeyip ona çarpmıştır ve genç ölmüştür.") print("Olaydan sonraki gün ",kardes,"'in üniversite sınavı olduğu için suçu ",basrol," üstlenmiştir ve",basrol," 4 yıl hapis cezasına çarptırılmıştır.") print("hikâye de bu şekilde başlar.") print ("------------------------------------------")
__all__ = ['v1', 'f1', 'C1'] v1 = 18 v2 = 36 def f1(): pass def f2(): pass class C1(object): pass class C2(object): pass
values = { 'r': 0.000000000001 } typers = { 'r': float } def setGlobal(key, value): values[key] = value
""" Settings for tests. """ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'example.sqlite', }, } INSTALLED_APPS = [ 'tests.django_app' ] MIDDLEWARE_CLASSES = () SECRET_KEY = 'testing.'
class UnsupportedMethod(Exception): def __init__(self, message, errors): super().__init__(message) class NoPayload(Exception): def __init__(self): super().__init__()
def print_multiplication_table(vertical_interval, horizontal_interval): print('\t', end='') for i in range(horizontal_interval[0], horizontal_interval[1] + 1): print(i, end='\t') print() for i in range(vertical_interval[0], vertical_interval[1] + 1): print(i, end='\t') for j in range(horizontal_interval[0], horizontal_interval[1] + 1): print(i * j, end='\t') print() intervals = (int(input()), int(input())), (int(input()), int(input())) print_multiplication_table(intervals[0], intervals[1])
class Colors: def __init__(self): self.color_dict = { "ERROR": ';'.join([str(7), str(31), str(47)]), "WARN": ';'.join([str(7), str(33), str(40)]), "INFO": ';'.join([str(7), str(32), str(40)]), "GENERAL": ';'.join([str(7), str(34), str(47)]) } def get_cformat(self, message_type): return self.color_dict[message_type]
def globals(request): #import pdb #pdb.set_trace() data = {} if 'menu_item' in request.session: data['menu_item'] = request.session['menu_item'] return data
SQLALCHEMY_DATABASE_URI = \ 'mysql+cymysql://root:00000000@localhost/ucar' SECRET_KEY = '***' SQLALCHEMY_TRACK_MODIFICATIONS = True MINA_APP = { 'AppID': '***', 'AppSecret': '***' }
#!/usr/bin/env python def upgradeDriverCfg(version, dValue={}, dOption=[]): """Upgrade the config given by the dict dValue and dict dOption to the latest version.""" # the dQuantUpdate dict contains rules for replacing missing quantities dQuantReplace = {} # update quantities depending on version if version == '1.0': # convert version 1.0 -> 1.1 # changes: # demodulation not on by default version = '1.1' # if converting from old driver, turn on demodulation dValue['Enable demodulation'] = True # return new version and data return (version, dValue, dOption, dQuantReplace)
class Class: def __init__(self, name: str): self.name = name class Instance: def __init__(self, cls: Class): self.cls = cls self._fields = {} def get_attr(self, name: str): if name not in self._fields: raise AttributeError(f"'{self.cls.name}' has no attribute {name}") return self._fields[name] def set_attr(self, name: str, value): self._fields[name] = value
# Pell Numbers class Pell: def __init__(self): self.limiter = 1000 self.numbers = [0, 1] self.path = r'./Pell_Sequence/results.txt' def void(self): with open(self.path, "w+") as file: for i in range(self.limiter): self.numbers.append(2 * self.numbers[i+1] + self.numbers[i]) file.writelines(f'{self.numbers}\n') Start = Pell() Start.void()
def squares(n): i = 1 while i <= n: yield i * i i += 1 print(list(squares(5)))
def prod(L): p = 1 for i in L: p *= i return p
'''13 - Tendo como dado de entrada a altura (h) de uma pessoa, construa um algoritmo que calcule seu peso ideal, utilizando as seguintes fórmulas: * Para homens: (72.7*h) - 58 * Para mulheres: (62.1*h) - 44.7 ''' altura = float(input('Digite a sua altura em metros: ')) print(f'O peso ideal para homens é de {(72.7*altura) - 58:.2f}Kg') print(f'O peso ideal para mulheres é de {(62.1*altura) - 44.7:.2f}Kg')
# a,b = [set(input().split()) for i in range(4)][1::2] # print ('\n'.join(sorted(a^b, key=int))) a,b=(int(input()),input().split()) c,d=(int(input()),input().split()) x=set(b) y=set(d) p=y.difference(x) q=x.difference(y) r=p.union(q) print ('\n'.join(sorted(r, key=int)))
def partida (): n = int(input("Escolha quantas peças para jogar: ")) while n <= 0: print ("Jogada não permitida. Escolha um número inteiro positivo") n = int(input("Escolha quantas peças para jogar: ")) m = int(input("Qual a quantidade máxima de peças removidas? ")) while m >= n or m <= 0: m = int(input("Quantidade não permitida. Qual a quantidade máxima de peças removidas? ")) print("Ok! O total de peças inicial é",n, "e remoção de no máximo",m, "peças por jogada.") mi = m if n%(m+1) == 0: print("Você começa!") User = True else: print("Computador começa!") User = False while n > 0: if User == True: mi = usuario_escolhe_jogada (n, m) User = False n = n - mi if n == 0: print("Você ganhou!") return ("User") else: mi = computador_escolhe_jogada (n, m) User = True n = n - mi if n == 0: print("O computador ganhou!") return ("PC") def usuario_escolhe_jogada (n, m): mi = int(input("Escolha quantas peças remover: ")) while mi > m or mi <= 0 or mi > n: print ("Jogada não permitida. Escolha um número inteiro, positivo e menor ou igual a",m) mi = int(input("Tente novamente! Escolha quantas peças remover: ")) print("Você removeu",mi,"peças") return (mi) def computador_escolhe_jogada (n, m): mi = m while mi > 1 and (n - mi)%(m+1) != 0: mi = mi - 1 print("O computador removeu",mi,"peças") return (mi) print ("Bem-vindo ao jogo do NIM! Escolha:") print ("1 - para jogar uma partida isolada") print ("2 - para jogar um campeonato") resposta = int(input()) while resposta != 1 and resposta !=2: print ("Jogada não permitida. Digite 1 ou 2") resposta = int(input()) if resposta == 1: partida() else: y = 1 Vit_PC = 0 Vit_User = 0 while y <= 3: if partida() == "PC": Vit_PC = Vit_PC + 1 else: Vit_User = Vit_User + 1 y = y + 1 print("Placar: Você",Vit_User,"X",Vit_PC,"Computador")
def f(bar): # type: (str) -> str return bar f(bytearray())
# job_list_one_shot.py --- # # Filename: job_list_one_shot.py # Author: Abhishek Udupa # Created: Tue Jan 26 15:13:19 2016 (-0500) # # # Copyright (c) 2015, Abhishek Udupa, University of Pennsylvania # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by The University of Pennsylvania # 4. Neither the name of the University of Pennsylvania nor the # names of its contributors may be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ''AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # # Code: [ (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_103_10.sl'], 'icfp_103_10-anytime', 'icfp_103_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_113_1000.sl'], 'icfp_113_1000-anytime', 'icfp_113_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_125_10.sl'], 'icfp_125_10-anytime', 'icfp_125_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_14_1000.sl'], 'icfp_14_1000-anytime', 'icfp_14_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_147_1000.sl'], 'icfp_147_1000-anytime', 'icfp_147_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_28_10.sl'], 'icfp_28_10-anytime', 'icfp_28_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_39_100.sl'], 'icfp_39_100-anytime', 'icfp_39_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_51_10.sl'], 'icfp_51_10-anytime', 'icfp_51_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_68_1000.sl'], 'icfp_68_1000-anytime', 'icfp_68_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_72_10.sl'], 'icfp_72_10-anytime', 'icfp_72_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_82_10.sl'], 'icfp_82_10-anytime', 'icfp_82_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_94_1000.sl'], 'icfp_94_1000-anytime', 'icfp_94_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_96_10.sl'], 'icfp_96_10-anytime', 'icfp_96_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_104_10.sl'], 'icfp_104_10-anytime', 'icfp_104_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_114_100.sl'], 'icfp_114_100-anytime', 'icfp_114_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_134_1000.sl'], 'icfp_134_1000-anytime', 'icfp_134_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_143_1000.sl'], 'icfp_143_1000-anytime', 'icfp_143_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_150_10.sl'], 'icfp_150_10-anytime', 'icfp_150_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_30_10.sl'], 'icfp_30_10-anytime', 'icfp_30_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_45_1000.sl'], 'icfp_45_1000-anytime', 'icfp_45_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_54_1000.sl'], 'icfp_54_1000-anytime', 'icfp_54_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_69_10.sl'], 'icfp_69_10-anytime', 'icfp_69_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_73_10.sl'], 'icfp_73_10-anytime', 'icfp_73_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_87_10.sl'], 'icfp_87_10-anytime', 'icfp_87_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_94_100.sl'], 'icfp_94_100-anytime', 'icfp_94_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_99_100.sl'], 'icfp_99_100-anytime', 'icfp_99_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_105_1000.sl'], 'icfp_105_1000-anytime', 'icfp_105_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_118_100.sl'], 'icfp_118_100-anytime', 'icfp_118_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_135_100.sl'], 'icfp_135_100-anytime', 'icfp_135_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_144_1000.sl'], 'icfp_144_1000-anytime', 'icfp_144_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_21_1000.sl'], 'icfp_21_1000-anytime', 'icfp_21_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_32_10.sl'], 'icfp_32_10-anytime', 'icfp_32_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_45_10.sl'], 'icfp_45_10-anytime', 'icfp_45_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_56_1000.sl'], 'icfp_56_1000-anytime', 'icfp_56_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_7_1000.sl'], 'icfp_7_1000-anytime', 'icfp_7_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_81_1000.sl'], 'icfp_81_1000-anytime', 'icfp_81_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_9_1000.sl'], 'icfp_9_1000-anytime', 'icfp_9_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_95_100.sl'], 'icfp_95_100-anytime', 'icfp_95_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_105_100.sl'], 'icfp_105_100-anytime', 'icfp_105_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_118_10.sl'], 'icfp_118_10-anytime', 'icfp_118_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_139_10.sl'], 'icfp_139_10-anytime', 'icfp_139_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_144_100.sl'], 'icfp_144_100-anytime', 'icfp_144_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_25_1000.sl'], 'icfp_25_1000-anytime', 'icfp_25_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_38_10.sl'], 'icfp_38_10-anytime', 'icfp_38_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_5_1000.sl'], 'icfp_5_1000-anytime', 'icfp_5_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_64_10.sl'], 'icfp_64_10-anytime', 'icfp_64_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_7_10.sl'], 'icfp_7_10-anytime', 'icfp_7_10-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_82_100.sl'], 'icfp_82_100-anytime', 'icfp_82_100-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_93_1000.sl'], 'icfp_93_1000-anytime', 'icfp_93_1000-anytime'), (['python3', 'solvers.py', '--anytime', '3600', 'icfp', '../benchmarks/icfp/icfp_96_1000.sl'], 'icfp_96_1000-anytime', 'icfp_96_1000-anytime') ] # # job_list_one_shot.py ends here
class Vehicle: ''' Documentation needed here ''' def __init__(self, numberOfTires, colorOfVehicle): ''' Documentation needed here ''' self.numberOfTires = numberOfTires self.colorOfVehicle = colorOfVehicle def start(self): ''' This function starts the vehicle ''' print("I started!") def drive(self): ''' This function drives the vehicle ''' print("I'm driving!") def setColor(color): ''' This function updates the color of the vehicle based on the pass in information Parameters: Color -> a color to update the vehicle's color with ''' this.colorOfVehicle = color def __repr__(self): return "I'm a Vehicle!"