content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
wordle = open("Wordle.txt", "r") wordList = [] for line in wordle: stripped_line = line.strip() wordList.append(stripped_line) mutableList = [] outcomeList = [] def blackLetter(letter, list): for word in list: if letter in word: list.remove(word) def greenLetter(letter, location, greenList): for word in greenList: if word[location] == letter: mutableList.append(word) continue elif word in mutableList: mutableList.remove(word) #greenList.remove(word) def moreGreenLetter(letter, location, greenList): for word in greenList: if word[location] == letter: #mutableList.append(word) continue elif word[location] != letter: mutableList.remove(word) #greenList.remove(word) greenLetter("z", 4, wordList) moreGreenLetter("r", 1, mutableList) print(wordList) print(mutableList) # def checkforyellow(yellowIn, yellowOut, wordCheck=0): # for word in yellowIn: # if blackSet.isdisjoint(word): # for key in yellowKeys: # if wordCheck == len(yellowKeys): # print(word) # yellowOut.append(word) # break # elif word[yellowDict[key]] == key: # break # elif key not in word: # break # elif key in word: # print(word) # wordCheck += 1 # else: break # # # def checkforgreen(greenIn, greenOut, wordCheck=0): # for word in greenIn: # for key in greenKeys: # if word[greenDict[key]] != key: # break # elif wordCheck < len(greenKeys): # wordCheck += 1 # continue # else: # greenOut.append(word) # break
wordle = open('Wordle.txt', 'r') word_list = [] for line in wordle: stripped_line = line.strip() wordList.append(stripped_line) mutable_list = [] outcome_list = [] def black_letter(letter, list): for word in list: if letter in word: list.remove(word) def green_letter(letter, location, greenList): for word in greenList: if word[location] == letter: mutableList.append(word) continue elif word in mutableList: mutableList.remove(word) def more_green_letter(letter, location, greenList): for word in greenList: if word[location] == letter: continue elif word[location] != letter: mutableList.remove(word) green_letter('z', 4, wordList) more_green_letter('r', 1, mutableList) print(wordList) print(mutableList)
weight = [] diff = 0 n = int(input()) for i in range(n): q, c = map(int, input().split()) if c == 2: q *= -1 weight.append(q) diff += q min_diff = abs(diff) for i in range(n): if abs(diff - 2*weight[i]) < min_diff: min_diff = abs(diff - 2*weight[i]) for j in range(i+1, n): if abs(diff - 2*(weight[i] + weight[j])) < min_diff: min_diff = abs(diff - 2*(weight[i] + weight[j])) print(min_diff)
weight = [] diff = 0 n = int(input()) for i in range(n): (q, c) = map(int, input().split()) if c == 2: q *= -1 weight.append(q) diff += q min_diff = abs(diff) for i in range(n): if abs(diff - 2 * weight[i]) < min_diff: min_diff = abs(diff - 2 * weight[i]) for j in range(i + 1, n): if abs(diff - 2 * (weight[i] + weight[j])) < min_diff: min_diff = abs(diff - 2 * (weight[i] + weight[j])) print(min_diff)
def counting_sort(arr): # Find min and max values min_value = min(arr) max_value = max(arr) counting_arr = [0]*(max_value-min_value+1) for num in arr: counting_arr[num-min_value] += 1 index = 0 for i, count in enumerate(counting_arr): for _ in range(count): arr[index] = min_value + i index += 1 test_array = [3, 3, 2, 6, 4, 7, 9, 7, 8] counting_sort(test_array) print(test_array)
def counting_sort(arr): min_value = min(arr) max_value = max(arr) counting_arr = [0] * (max_value - min_value + 1) for num in arr: counting_arr[num - min_value] += 1 index = 0 for (i, count) in enumerate(counting_arr): for _ in range(count): arr[index] = min_value + i index += 1 test_array = [3, 3, 2, 6, 4, 7, 9, 7, 8] counting_sort(test_array) print(test_array)
# [8 kyu] Grasshopper - Terminal Game Move Function # # Author: Hsins # Date: 2019/12/20 def move(position, roll): return position + 2 * roll
def move(position, roll): return position + 2 * roll
# Go to new line using \n print('-------------------------------------------------------') print("My name is\nMaurizio Petrelli") # Inserting characters using octal values print('-------------------------------------------------------') print("\100 \136 \137 \077 \176") # Inserting characters using hex values print('-------------------------------------------------------') print("\x23 \x24 \x25 \x26 \x2A") print('-------------------------------------------------------') '''Output: ------------------------------------------------------- My name is Maurizio Petrelli ------------------------------------------------------- @ ^ _ ? ~ ------------------------------------------------------- # $ % & * ------------------------------------------------------- '''
print('-------------------------------------------------------') print('My name is\nMaurizio Petrelli') print('-------------------------------------------------------') print('@ ^ _ ? ~') print('-------------------------------------------------------') print('# $ % & *') print('-------------------------------------------------------') 'Output:\n-------------------------------------------------------\nMy name is\nMaurizio Petrelli\n-------------------------------------------------------\n@ ^ _ ? ~\n-------------------------------------------------------\n# $ % & *\n-------------------------------------------------------\n'
class RetryOptions: def __init__(self, firstRetry: int, maxNumber: int): self.backoffCoefficient: int self.maxRetryIntervalInMilliseconds: int self.retryTimeoutInMilliseconds: int self.firstRetryIntervalInMilliseconds: int = firstRetry self.maxNumberOfAttempts: int = maxNumber if self.firstRetryIntervalInMilliseconds <= 0: raise ValueError("firstRetryIntervalInMilliseconds value" "must be greater than 0.")
class Retryoptions: def __init__(self, firstRetry: int, maxNumber: int): self.backoffCoefficient: int self.maxRetryIntervalInMilliseconds: int self.retryTimeoutInMilliseconds: int self.firstRetryIntervalInMilliseconds: int = firstRetry self.maxNumberOfAttempts: int = maxNumber if self.firstRetryIntervalInMilliseconds <= 0: raise value_error('firstRetryIntervalInMilliseconds valuemust be greater than 0.')
def rotations(l): out = [] for i in range(len(l)): a = shift(l, i) out += [a] return out def shift(l, n): return l[n:] + l[:n] if __name__ == '__main__': l = [0,1,2,3,4] for x in rotations(l): print(x)
def rotations(l): out = [] for i in range(len(l)): a = shift(l, i) out += [a] return out def shift(l, n): return l[n:] + l[:n] if __name__ == '__main__': l = [0, 1, 2, 3, 4] for x in rotations(l): print(x)
def make_cut(l): smallest = min(l) return [ x - smallest for x in l if x - smallest > 0 ] length = int(input()) current = list( map( int, input().split() ) ) while current: print(len(current)) current = make_cut(current)
def make_cut(l): smallest = min(l) return [x - smallest for x in l if x - smallest > 0] length = int(input()) current = list(map(int, input().split())) while current: print(len(current)) current = make_cut(current)
#!/usr/bin/env python3 # https://codeforces.com/problemset/problem/1023/A def f(ll): n,k = ll #1e14 f = k//2 + 1 e = min(k-1,n) return max(0,e-f+1) l = list(map(int,input().split())) print(f(l))
def f(ll): (n, k) = ll f = k // 2 + 1 e = min(k - 1, n) return max(0, e - f + 1) l = list(map(int, input().split())) print(f(l))
'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/80C4285C-779E-DD11-9889-001617E30CA4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/A83BF5EE-6E9E-DD11-8082-000423D94700.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/8266853E-999E-DD11-8B73-001D09F2432B.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/2AAFE9A9-A19E-DD11-821B-000423D99F3E.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/067E98F3-489F-DD11-B309-000423D996B4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/64C1D6F5-489F-DD11-90B7-000423D986A8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0012/3C084F93-679C-DD11-A361-000423D9989E.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/9C14E69F-069D-DD11-AC41-001617DBCF1E.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/5439B4CA-309D-DD11-84E5-000423D944F8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/D20BB375-AE9D-DD11-BF49-000423D944FC.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/E2E8FE03-A69D-DD11-8699-000423D98750.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/B40C29EC-B69D-DD11-A665-000423D6A6F4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/843C7874-1F9F-DD11-8E03-000423D98804.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7EB3DF8E-0E9F-DD11-A451-001D09F29146.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CEB001F9-169F-DD11-A5E6-000423D94494.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/382BAEE2-D39E-DD11-A0A4-000423D98EC8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CC5B37A1-A99E-DD11-816F-001617DBD230.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/6EDD168B-2F9F-DD11-ADF5-001617C3B79A.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/EE4B4C82-999C-DD11-86EC-000423D99F3E.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/1CC8332F-459E-DD11-BFE1-001617C3B65A.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7A6A133C-999E-DD11-9155-001D09F2462D.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/F292BE7F-409F-DD11-883A-001617C3B6FE.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/B870AA81-409F-DD11-B549-001617C3B78C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/9003F328-899C-DD11-83D7-000423D986C4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/500B13D3-6F9C-DD11-8745-001617DC1F70.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/4CBAEDCC-309D-DD11-A617-001617E30D06.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/AED19458-399D-DD11-B9AC-000423D9A2AE.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/A6688D1F-959D-DD11-B5B7-000423D6A6F4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/F0076F20-F59E-DD11-8B57-000423D944F0.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/EC6C6EA4-499D-DD11-AC7D-000423D98DB4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/DA099105-639D-DD11-9C3E-001617E30F50.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/2E40EDED-1A9E-DD11-9014-001617DBD5AC.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/7647004C-F19D-DD11-8BAA-001617DBD224.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/38881706-5E9E-DD11-B487-000423D98868.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/1098901B-569E-DD11-BE60-000423D985E4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/5E4E7508-919C-DD11-AEB1-000423D9853C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/060DD475-179D-DD11-A003-000423D94908.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/8A563E55-289D-DD11-BA24-000423D6BA18.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/545F9B54-D09D-DD11-A58B-000423D6B5C4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/68795DEE-D79D-DD11-ADB7-000423D98DB4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3AD49E1B-F59E-DD11-81C4-000423D94700.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/548891AB-8C9D-DD11-8989-001617C3B69C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/745CD91D-529D-DD11-8908-000423D6B48C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3EF1CC87-2F9F-DD11-9EFC-001617DF785A.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FCB4F2BA-3C9E-DD11-82C7-000423D99160.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/ECC4D018-569E-DD11-80C4-001617C3B6FE.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/20C97175-669E-DD11-8ADD-00161757BF42.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/52683098-A99E-DD11-BCD0-000423D94AA8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/F6C17BA7-A19E-DD11-B57C-000423D98634.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/D844B765-519F-DD11-96F9-001617E30D0A.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/02EB3FD3-6F9C-DD11-8C35-001617C3B6FE.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/0EB355C8-309D-DD11-85B7-001617C3B64C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/8E478481-BA9E-DD11-9573-000423D6B358.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/A4775BE3-739D-DD11-843D-001617C3B778.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/8E8B21C6-F99D-DD11-BF05-000423D986A8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/0EF20D52-139E-DD11-9473-000423D6B5C4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7C00B404-389F-DD11-AB81-000423D985E4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/AE67CFF1-279F-DD11-B6DC-000423D98804.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7400A101-389F-DD11-B540-000423D60FF6.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/2A630CF2-279F-DD11-942A-000423D985E4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/1CD3DEA6-F59C-DD11-986D-000423D98BC4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/D809EECD-7F9E-DD11-B4D7-00161757BF42.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/64451F65-779E-DD11-869D-001617E30D40.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/BA532E6C-519F-DD11-8DE7-000423D98FBC.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/021AEBFE-7A9F-DD11-863E-0019DB29C620.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CA5A90F6-489F-DD11-8F60-000423D6B2D8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/028578E0-809C-DD11-AF7D-001617C3B6E8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0012/08A6038E-679C-DD11-A4B9-001617E30D0A.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0012/18BA3290-679C-DD11-B9A1-001617C3B77C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/B0CD45DB-D39E-DD11-BC03-000423D985E4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/125FE86B-CB9E-DD11-B054-000423DD2F34.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/6E783236-849D-DD11-A9FF-001617C3B654.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/800FA4BD-5A9D-DD11-ACBB-001617DBD5AC.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/760FB963-7C9D-DD11-B812-001D09F231C9.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/52CBD0DE-0A9E-DD11-B583-000423D6B358.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/905B1953-349E-DD11-8022-001D09F2AD7F.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7A7A6D05-389F-DD11-9D08-000423D98804.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/C223029D-E59C-DD11-A125-001617E30D40.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3293D2A6-4D9E-DD11-81D1-000423D98B5C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4E5AEDFC-5D9E-DD11-BD7D-001617C3B5F4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/2A9CA4B8-909E-DD11-857B-001617E30D38.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/9E30F47D-409F-DD11-A947-001617C3B6E8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/745BB069-519F-DD11-A8F9-000423D94700.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/4493CD28-899C-DD11-AF14-000423D6CA02.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/0085D14F-289D-DD11-862E-000423D6006E.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/841A2D63-E09D-DD11-BDA5-001617DF785A.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/5658C98B-9D9D-DD11-9B46-000423D99F1E.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3ABEFDFB-169F-DD11-94E3-000423D98BC4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FC20EEFC-059F-DD11-A7CA-001617C3B5F4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CE7B883A-ED9E-DD11-A737-0019DB29C614.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4261BA6C-CB9E-DD11-AE94-000423D986A8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/9A134C3C-849D-DD11-8A1C-000423D98C20.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FE7A7A73-1F9F-DD11-A841-001617DBD230.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/6097BB22-FE9C-DD11-AA3C-000423D944F0.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/F4AE9DE3-DC9C-DD11-9223-000423D6B42C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/3CA664CA-309D-DD11-A642-000423D951D4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/2C9D3EE0-C79D-DD11-AAF0-000423D94534.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/7E81C76A-BF9D-DD11-9970-001617E30F50.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4EA98C8F-0E9F-DD11-A48E-001D09F253FC.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/0A4BBAF5-C29E-DD11-967D-0016177CA778.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4253601B-B29E-DD11-9725-001617DBD224.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/E00BC4D5-D39E-DD11-861A-001617C3B5E4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/EA733333-419D-DD11-9B49-000423D99660.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/40A87664-239E-DD11-8ABC-000423D944F8.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/DA448F60-239E-DD11-8347-000423D98DD4.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/0E9D6303-389F-DD11-8C22-001617E30D0A.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/8A40053E-889E-DD11-9442-000423D944F0.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/082ED767-999E-DD11-962C-0019B9F70607.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/205DAE07-0F9D-DD11-9FD4-000423D9890C.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/041B05FD-059F-DD11-871E-001617E30D52.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FE7823F2-C29E-DD11-81F1-0019DB29C614.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/BC834BD5-2B9E-DD11-A8D9-001617C3B706.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/966DFADC-E89D-DD11-A90E-000423D99264.root', 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/B4FD3F7C-409F-DD11-8F2B-001617DBCF90.root'
('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/80C4285C-779E-DD11-9889-001617E30CA4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/A83BF5EE-6E9E-DD11-8082-000423D94700.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/8266853E-999E-DD11-8B73-001D09F2432B.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/2AAFE9A9-A19E-DD11-821B-000423D99F3E.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/067E98F3-489F-DD11-B309-000423D996B4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/64C1D6F5-489F-DD11-90B7-000423D986A8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0012/3C084F93-679C-DD11-A361-000423D9989E.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/9C14E69F-069D-DD11-AC41-001617DBCF1E.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/5439B4CA-309D-DD11-84E5-000423D944F8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/D20BB375-AE9D-DD11-BF49-000423D944FC.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/E2E8FE03-A69D-DD11-8699-000423D98750.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/B40C29EC-B69D-DD11-A665-000423D6A6F4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/843C7874-1F9F-DD11-8E03-000423D98804.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7EB3DF8E-0E9F-DD11-A451-001D09F29146.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CEB001F9-169F-DD11-A5E6-000423D94494.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/382BAEE2-D39E-DD11-A0A4-000423D98EC8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CC5B37A1-A99E-DD11-816F-001617DBD230.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/6EDD168B-2F9F-DD11-ADF5-001617C3B79A.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/EE4B4C82-999C-DD11-86EC-000423D99F3E.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/1CC8332F-459E-DD11-BFE1-001617C3B65A.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7A6A133C-999E-DD11-9155-001D09F2462D.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/F292BE7F-409F-DD11-883A-001617C3B6FE.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/B870AA81-409F-DD11-B549-001617C3B78C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/9003F328-899C-DD11-83D7-000423D986C4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/500B13D3-6F9C-DD11-8745-001617DC1F70.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/4CBAEDCC-309D-DD11-A617-001617E30D06.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/AED19458-399D-DD11-B9AC-000423D9A2AE.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/A6688D1F-959D-DD11-B5B7-000423D6A6F4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/F0076F20-F59E-DD11-8B57-000423D944F0.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/EC6C6EA4-499D-DD11-AC7D-000423D98DB4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/DA099105-639D-DD11-9C3E-001617E30F50.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/2E40EDED-1A9E-DD11-9014-001617DBD5AC.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/7647004C-F19D-DD11-8BAA-001617DBD224.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/38881706-5E9E-DD11-B487-000423D98868.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/1098901B-569E-DD11-BE60-000423D985E4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/5E4E7508-919C-DD11-AEB1-000423D9853C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/060DD475-179D-DD11-A003-000423D94908.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/8A563E55-289D-DD11-BA24-000423D6BA18.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/545F9B54-D09D-DD11-A58B-000423D6B5C4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/68795DEE-D79D-DD11-ADB7-000423D98DB4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3AD49E1B-F59E-DD11-81C4-000423D94700.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/548891AB-8C9D-DD11-8989-001617C3B69C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/745CD91D-529D-DD11-8908-000423D6B48C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3EF1CC87-2F9F-DD11-9EFC-001617DF785A.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FCB4F2BA-3C9E-DD11-82C7-000423D99160.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/ECC4D018-569E-DD11-80C4-001617C3B6FE.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/20C97175-669E-DD11-8ADD-00161757BF42.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/52683098-A99E-DD11-BCD0-000423D94AA8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/F6C17BA7-A19E-DD11-B57C-000423D98634.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/D844B765-519F-DD11-96F9-001617E30D0A.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/02EB3FD3-6F9C-DD11-8C35-001617C3B6FE.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/0EB355C8-309D-DD11-85B7-001617C3B64C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/8E478481-BA9E-DD11-9573-000423D6B358.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/A4775BE3-739D-DD11-843D-001617C3B778.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/8E8B21C6-F99D-DD11-BF05-000423D986A8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/0EF20D52-139E-DD11-9473-000423D6B5C4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7C00B404-389F-DD11-AB81-000423D985E4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/AE67CFF1-279F-DD11-B6DC-000423D98804.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7400A101-389F-DD11-B540-000423D60FF6.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/2A630CF2-279F-DD11-942A-000423D985E4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/1CD3DEA6-F59C-DD11-986D-000423D98BC4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/D809EECD-7F9E-DD11-B4D7-00161757BF42.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/64451F65-779E-DD11-869D-001617E30D40.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/BA532E6C-519F-DD11-8DE7-000423D98FBC.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/021AEBFE-7A9F-DD11-863E-0019DB29C620.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CA5A90F6-489F-DD11-8F60-000423D6B2D8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/028578E0-809C-DD11-AF7D-001617C3B6E8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0012/08A6038E-679C-DD11-A4B9-001617E30D0A.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0012/18BA3290-679C-DD11-B9A1-001617C3B77C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/B0CD45DB-D39E-DD11-BC03-000423D985E4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/125FE86B-CB9E-DD11-B054-000423DD2F34.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/6E783236-849D-DD11-A9FF-001617C3B654.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/800FA4BD-5A9D-DD11-ACBB-001617DBD5AC.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/760FB963-7C9D-DD11-B812-001D09F231C9.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/52CBD0DE-0A9E-DD11-B583-000423D6B358.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/905B1953-349E-DD11-8022-001D09F2AD7F.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/7A7A6D05-389F-DD11-9D08-000423D98804.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/C223029D-E59C-DD11-A125-001617E30D40.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3293D2A6-4D9E-DD11-81D1-000423D98B5C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4E5AEDFC-5D9E-DD11-BD7D-001617C3B5F4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/2A9CA4B8-909E-DD11-857B-001617E30D38.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/9E30F47D-409F-DD11-A947-001617C3B6E8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/745BB069-519F-DD11-A8F9-000423D94700.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/4493CD28-899C-DD11-AF14-000423D6CA02.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/0085D14F-289D-DD11-862E-000423D6006E.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/841A2D63-E09D-DD11-BDA5-001617DF785A.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/5658C98B-9D9D-DD11-9B46-000423D99F1E.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/3ABEFDFB-169F-DD11-94E3-000423D98BC4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FC20EEFC-059F-DD11-A7CA-001617C3B5F4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/CE7B883A-ED9E-DD11-A737-0019DB29C614.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4261BA6C-CB9E-DD11-AE94-000423D986A8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/9A134C3C-849D-DD11-8A1C-000423D98C20.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FE7A7A73-1F9F-DD11-A841-001617DBD230.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/6097BB22-FE9C-DD11-AA3C-000423D944F0.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/F4AE9DE3-DC9C-DD11-9223-000423D6B42C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/3CA664CA-309D-DD11-A642-000423D951D4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/2C9D3EE0-C79D-DD11-AAF0-000423D94534.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/7E81C76A-BF9D-DD11-9970-001617E30F50.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4EA98C8F-0E9F-DD11-A48E-001D09F253FC.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/0A4BBAF5-C29E-DD11-967D-0016177CA778.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/4253601B-B29E-DD11-9725-001617DBD224.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/E00BC4D5-D39E-DD11-861A-001617C3B5E4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/EA733333-419D-DD11-9B49-000423D99660.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/40A87664-239E-DD11-8ABC-000423D944F8.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/DA448F60-239E-DD11-8347-000423D98DD4.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/0E9D6303-389F-DD11-8C22-001617E30D0A.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/8A40053E-889E-DD11-9442-000423D944F0.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/082ED767-999E-DD11-962C-0019B9F70607.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/205DAE07-0F9D-DD11-9FD4-000423D9890C.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/041B05FD-059F-DD11-871E-001617E30D52.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/FE7823F2-C29E-DD11-81F1-0019DB29C614.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/BC834BD5-2B9E-DD11-A8D9-001617C3B706.root',) ('rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0013/966DFADC-E89D-DD11-A90E-000423D99264.root',) 'rfio:///?svcClass=cmscaf&path=/castor/cern.ch/cms/store/data/Commissioning08/Cosmics/ALCARECO/CRAFT_V2P_StreamALCARECOTkAlCosmics0T_v7/0014/B4FD3F7C-409F-DD11-8F2B-001617DBCF90.root'
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def deno_repository(): # Get Deno archive http_archive( name = "deno-amd64", build_file = "//ext/deno:BUILD", sha256 = "7b883e3c638d21dd1875f0108819f2f13647b866ff24965135e679c743013f46", type = "zip", urls = ["https://github.com/denoland/deno/releases/download/v1.17.3/deno-x86_64-unknown-linux-gnu.zip"], )
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') def deno_repository(): http_archive(name='deno-amd64', build_file='//ext/deno:BUILD', sha256='7b883e3c638d21dd1875f0108819f2f13647b866ff24965135e679c743013f46', type='zip', urls=['https://github.com/denoland/deno/releases/download/v1.17.3/deno-x86_64-unknown-linux-gnu.zip'])
# Do not edit this file directly. # It was auto-generated by: code/programs/reflexivity/reflexive_refresh load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") def libevent(): http_archive( name = "libevent", build_file = "//bazel/deps/libevent:build.BUILD", sha256 = "9b436b404793be621c6e01cea573e1a06b5db26dad25a11c6a8c6f8526ed264c", strip_prefix = "libevent-eee26deed38fc7a6b6780b54628b007a2810efcd", urls = [ "https://github.com/Unilang/libevent/archive/eee26deed38fc7a6b6780b54628b007a2810efcd.tar.gz", ], patches = [ "//bazel/deps/libevent/patches:p1.patch", ], patch_args = [ "-p1", ], patch_cmds = [ "find . -type f -name '*.c' -exec sed -i 's/#include <stdlib.h>/#include <stdlib.h>\n#include <stdint.h>\n/g' {} \\;", ], )
load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive') load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_file') def libevent(): http_archive(name='libevent', build_file='//bazel/deps/libevent:build.BUILD', sha256='9b436b404793be621c6e01cea573e1a06b5db26dad25a11c6a8c6f8526ed264c', strip_prefix='libevent-eee26deed38fc7a6b6780b54628b007a2810efcd', urls=['https://github.com/Unilang/libevent/archive/eee26deed38fc7a6b6780b54628b007a2810efcd.tar.gz'], patches=['//bazel/deps/libevent/patches:p1.patch'], patch_args=['-p1'], patch_cmds=["find . -type f -name '*.c' -exec sed -i 's/#include <stdlib.h>/#include <stdlib.h>\n#include <stdint.h>\n/g' {} \\;"])
# jumlah segitiga n = 123 # panjang alas sebuah segitiga alas = 30 # tinggi sebuah segitiga tinggi = 18 # hitung luas sebuah segitiga luas = alas * tinggi * 1/2 # hitung luas total luastotal = n * luas print('luas total : ', luastotal,'satuan luas')
n = 123 alas = 30 tinggi = 18 luas = alas * tinggi * 1 / 2 luastotal = n * luas print('luas total : ', luastotal, 'satuan luas')
# http://codingbat.com/prob/p193507 def string_times(str, n): result = "" for i in range(0, n): result += str return result
def string_times(str, n): result = '' for i in range(0, n): result += str return result
def alternate_case(s): # Like a Giga Chad return "".join([char.lower() if char.isupper() else char.upper() for char in s]) # Like a Beta Male # return s.swapcase() # EXAMPLE AND TESTING # input = ["Hello World", "cODEwARS"] for item in input: print("\nInput: {0}\nAlternate Case: {1}".format(item, alternate_case(item))) assert alternate_case("Hello World") == "hELLO wORLD" # Simple Unit Tests assert alternate_case("cODEwARS") == "CodeWars" # Simple Unit Tests
def alternate_case(s): return ''.join([char.lower() if char.isupper() else char.upper() for char in s]) input = ['Hello World', 'cODEwARS'] for item in input: print('\nInput: {0}\nAlternate Case: {1}'.format(item, alternate_case(item))) assert alternate_case('Hello World') == 'hELLO wORLD' assert alternate_case('cODEwARS') == 'CodeWars'
#!/usr/bin/python3 list = ["Armitage", "Backdoor Factory", "BeEF","cisco-auditing-tool", "cisco-global-exploiter","cisco-ocs","cisco-torch","Commix","crackle", "exploitdb","jboss-autopwn","Linux Exploit Suggester","Maltego Teeth", "Metasploit Framework","MSFPC","RouterSploit","SET","ShellNoob","sqlmap", "THC-IPV6","Yersinia"]
list = ['Armitage', 'Backdoor Factory', 'BeEF', 'cisco-auditing-tool', 'cisco-global-exploiter', 'cisco-ocs', 'cisco-torch', 'Commix', 'crackle', 'exploitdb', 'jboss-autopwn', 'Linux Exploit Suggester', 'Maltego Teeth', 'Metasploit Framework', 'MSFPC', 'RouterSploit', 'SET', 'ShellNoob', 'sqlmap', 'THC-IPV6', 'Yersinia']
def get_max_coins_helper(matrix, crow, ccol, rows, cols): cval = matrix[crow][ccol] if crow == rows - 1 and ccol == cols - 1: return cval down, right = cval, cval if crow < rows - 1: down += get_max_coins_helper( matrix, crow + 1, ccol, rows, cols) if ccol < cols - 1: right += get_max_coins_helper( matrix, crow, ccol + 1, rows, cols) return max(down, right) def get_max_coins(matrix): if matrix: return get_max_coins_helper( matrix, 0, 0, len(matrix), len(matrix[0])) coins = [[0, 3, 1, 1], [2, 0, 0, 4], [1, 5, 3, 1]] assert get_max_coins(coins) == 12 coins = [[0, 3, 1, 1], [2, 8, 9, 4], [1, 5, 3, 1]] assert get_max_coins(coins) == 25
def get_max_coins_helper(matrix, crow, ccol, rows, cols): cval = matrix[crow][ccol] if crow == rows - 1 and ccol == cols - 1: return cval (down, right) = (cval, cval) if crow < rows - 1: down += get_max_coins_helper(matrix, crow + 1, ccol, rows, cols) if ccol < cols - 1: right += get_max_coins_helper(matrix, crow, ccol + 1, rows, cols) return max(down, right) def get_max_coins(matrix): if matrix: return get_max_coins_helper(matrix, 0, 0, len(matrix), len(matrix[0])) coins = [[0, 3, 1, 1], [2, 0, 0, 4], [1, 5, 3, 1]] assert get_max_coins(coins) == 12 coins = [[0, 3, 1, 1], [2, 8, 9, 4], [1, 5, 3, 1]] assert get_max_coins(coins) == 25
class NEC: def __init__( self ): self.prompt = '(.*)' self.timeout = 60 def show(self, *options, **def_args ): '''Possible Options :[' access-filter ', ' accounting ', ' acknowledgments ', ' auto-config ', ' axrp ', ' cfm ', ' channel-group ', ' clock ', ' config-lock-status ', ' cpu ', ' dhcp ', ' dot1x ', ' dumpfile ', ' efmoam ', ' environment ', ' file ', ' flash ', ' gsrp ', ' history ', ' igmp-snooping ', ' interfaces ', ' ip ', ' ip-dual ', ' ipv6-dhcp ', ' license ', ' lldp ', ' logging ', ' loop-detection ', ' mac-address-table ', ' mc ', ' memory ', ' mld-snooping ', ' netconf ', ' netstat ', ' ntp ', ' oadp ', ' openflow ', ' port ', ' power ', ' processes ', ' qos ', ' qos-flow ', ' sessions ', ' sflow ', ' spanning-tree ', ' ssh ', ' system ', ' tcpdump ', ' tech-support ', ' track ', ' version ', ' vlan ', ' vrrpstatus ', ' whoami ']''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_ip(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show ip "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_mc(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show mc "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_cfm(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show cfm "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_ntp(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show ntp "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_ssh(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show ssh "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_qos(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show qos "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_cpu(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show cpu "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_vlan(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show vlan "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_lldp(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show lldp "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_dhcp(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show dhcp "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_axrp(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show axrp "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_oadp(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show oadp "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_gsrp(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show gsrp "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_port(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show port "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_file(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show file "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_power(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show power "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_clock(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show clock "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_dot1x(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show dot1x "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_sflow(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show sflow "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_track(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show track "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_flash(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show flash "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_system(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show system "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_whoami(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show whoami "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_efmoam(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show efmoam "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_memory(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show memory "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_tcpdump(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show tcpdump "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_history(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show history "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_logging(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show logging "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_license(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show license "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_netstat(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show netstat "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_version(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show version "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_netconf(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show netconf "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_ipdual(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show ip-dual "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_sessions(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show sessions "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_qosflow(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show qos-flow "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_openflow(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show openflow "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_dumpfile(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show dumpfile "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_ipv6dhcp(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show ipv6-dhcp "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_processes(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show processes "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_vrrpstatus(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show vrrpstatus "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_interfaces(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show interfaces "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_environment(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show environment "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_autoconfig(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show auto-config "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_techsupport(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show tech-support "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_mldsnooping(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show mld-snooping "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_igmpsnooping(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show igmp-snooping "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_channelgroup(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show channel-group "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_spanningtree(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show spanning-tree "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_loopdetection(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show loop-detection "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_acknowledgments(self, *options, **def_args ): '''Possible Options :[' interface ']''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show acknowledgments "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_macaddresstable(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show mac-address-table "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_configlockstatus(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show config-lock-status "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE def show_acknowledgments_interface(self, *options, **def_args ): '''Possible Options :[]''' arguments= '' for option in options: arguments = arguments + option +' ' prompt = def_args.setdefault('prompt',self.prompt) timeout = def_args.setdefault('timeout',self.timeout) self.execute( cmd= "show acknowledgments interface "+ arguments, prompt = prompt, timeout = timeout ) return main.TRUE
class Nec: def __init__(self): self.prompt = '(.*)' self.timeout = 60 def show(self, *options, **def_args): """Possible Options :[' access-filter ', ' accounting ', ' acknowledgments ', ' auto-config ', ' axrp ', ' cfm ', ' channel-group ', ' clock ', ' config-lock-status ', ' cpu ', ' dhcp ', ' dot1x ', ' dumpfile ', ' efmoam ', ' environment ', ' file ', ' flash ', ' gsrp ', ' history ', ' igmp-snooping ', ' interfaces ', ' ip ', ' ip-dual ', ' ipv6-dhcp ', ' license ', ' lldp ', ' logging ', ' loop-detection ', ' mac-address-table ', ' mc ', ' memory ', ' mld-snooping ', ' netconf ', ' netstat ', ' ntp ', ' oadp ', ' openflow ', ' port ', ' power ', ' processes ', ' qos ', ' qos-flow ', ' sessions ', ' sflow ', ' spanning-tree ', ' ssh ', ' system ', ' tcpdump ', ' tech-support ', ' track ', ' version ', ' vlan ', ' vrrpstatus ', ' whoami ']""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_ip(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show ip ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_mc(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show mc ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_cfm(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show cfm ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_ntp(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show ntp ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_ssh(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show ssh ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_qos(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show qos ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_cpu(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show cpu ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_vlan(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show vlan ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_lldp(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show lldp ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_dhcp(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show dhcp ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_axrp(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show axrp ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_oadp(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show oadp ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_gsrp(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show gsrp ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_port(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show port ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_file(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show file ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_power(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show power ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_clock(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show clock ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_dot1x(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show dot1x ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_sflow(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show sflow ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_track(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show track ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_flash(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show flash ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_system(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show system ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_whoami(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show whoami ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_efmoam(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show efmoam ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_memory(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show memory ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_tcpdump(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show tcpdump ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_history(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show history ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_logging(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show logging ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_license(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show license ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_netstat(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show netstat ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_version(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show version ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_netconf(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show netconf ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_ipdual(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show ip-dual ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_sessions(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show sessions ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_qosflow(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show qos-flow ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_openflow(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show openflow ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_dumpfile(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show dumpfile ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_ipv6dhcp(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show ipv6-dhcp ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_processes(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show processes ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_vrrpstatus(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show vrrpstatus ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_interfaces(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show interfaces ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_environment(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show environment ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_autoconfig(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show auto-config ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_techsupport(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show tech-support ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_mldsnooping(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show mld-snooping ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_igmpsnooping(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show igmp-snooping ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_channelgroup(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show channel-group ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_spanningtree(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show spanning-tree ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_loopdetection(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show loop-detection ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_acknowledgments(self, *options, **def_args): """Possible Options :[' interface ']""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show acknowledgments ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_macaddresstable(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show mac-address-table ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_configlockstatus(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show config-lock-status ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE def show_acknowledgments_interface(self, *options, **def_args): """Possible Options :[]""" arguments = '' for option in options: arguments = arguments + option + ' ' prompt = def_args.setdefault('prompt', self.prompt) timeout = def_args.setdefault('timeout', self.timeout) self.execute(cmd='show acknowledgments interface ' + arguments, prompt=prompt, timeout=timeout) return main.TRUE
#! /usr/bin/env python # -*- coding: utf-8 -*- # __author__ = 'CwT' # document.body.innerHTML += '<form id="dynForm" action="http://example.com/" method="post"> # <input type="hidden" name="q" value="a"></form>'; # document.getElementById("dynForm").submit(); POST_JS = '<form id=\\"dynamicform\\" action=\\"%s\\" method=\\"post\\">%s</form>' INPUT_JS = '<input type=\\"hidden\\" name=\\"%s\\" value=%s>' EXECUTE_JS = 'document.body.innerHTML = "%s"; document.getElementById("dynamicform").submit();' def post_js(url, data): input = "" for key, value in data.items(): if isinstance(value, int): input += INPUT_JS % (key, str(value)) else: input += INPUT_JS % (key, "\\\"%s\\\"" % value) form = POST_JS % (url, input) return EXECUTE_JS % form
post_js = '<form id=\\"dynamicform\\" action=\\"%s\\" method=\\"post\\">%s</form>' input_js = '<input type=\\"hidden\\" name=\\"%s\\" value=%s>' execute_js = 'document.body.innerHTML = "%s"; document.getElementById("dynamicform").submit();' def post_js(url, data): input = '' for (key, value) in data.items(): if isinstance(value, int): input += INPUT_JS % (key, str(value)) else: input += INPUT_JS % (key, '\\"%s\\"' % value) form = POST_JS % (url, input) return EXECUTE_JS % form
# data hiding - encapsulation # this can be achieve by making the attribute or method private # python doesn't have private keyword so precede # the attribute/method identifier with an underscore or a double # this is more effective if object in import or used as a module # it isn't that effective # no underscore = public # single underscore = protected # double underscore = private class Person: __name = '' __age = 0 def __init__(self, name, age): self.__name = name self.__age = age me = Person("John Doe", 32) print(me._Person__name)
class Person: __name = '' __age = 0 def __init__(self, name, age): self.__name = name self.__age = age me = person('John Doe', 32) print(me._Person__name)
# Instruksi: # Buatlah komentar di garis pertama, # Buat variabel bernama jumlah_pacar yang isinya angka (bukan desimal), # Buat variabel bernama lagi_galau yang isinya boolean, # Buat variabel dengan nama terserah anda dan gunakan salah satu dari operator matematika yang telah kita pelajari. #variabel untuk menyimpan data # tipe data boolean dan angka # spasi: pentingnya spasi dalam python # komentar: untuk menjelaskan kode #operasi matematika: mulai dari penambahan sampai modulus jumlah_pacar = 1 lagi_galau = False umur = 20
jumlah_pacar = 1 lagi_galau = False umur = 20
# About: Implementation of the accumulator program # in python 3 specialization # ask to enter string phrase = input("Enter a string: ") # initialize total variable with zero tot = 0 # iterate through the string for char in phrase : if char != " " : tot += 1 # print the result print(tot)
phrase = input('Enter a string: ') tot = 0 for char in phrase: if char != ' ': tot += 1 print(tot)
class MapHash: def __init__(self, maxsize=6): self.maxsize = maxsize # Real scenario 64. self.hash = [None] * self.maxsize # Will be a 2D list def _get_hash_key(self, key): hash = sum(ord(k) for k in key) return hash % self.maxsize def add(self, key, value): hash_key = self._get_hash_key(key) # Hash key hash_value = [key, value] # ADD if self.hash[hash_key] is None: self.hash[hash_key] = [hash_value] # Key-value(IS a list) return True else: # Update for pair in self.hash[hash_key]: # Update-value if pair[0] == key: pair[1] = value # Update-value return True # append new Key in same hash key self.hash[hash_key].append(hash_value) def get(self, key): hash_key = self._get_hash_key(key) if self.hash[hash_key] is not None: for k, v in self.hash[hash_key]: if k == key: return v return "Key Error" def delete(self, key): hash_key = self._get_hash_key(key) if self.hash[hash_key] is not None: for i in range(len(self.hash[hash_key])): if self.hash[hash_key][i][0] == key: self.hash[hash_key].pop(i) return True else: return "Key Error" def __str__(self): return str(self.hash) def pprint(self): for item in self.hash: if item is not None: print(str(item)) data = MapHash() data.add('CaptainAmerica', '567-8888') data.add('Thor', '293-6753') data.add('Thor', '333-8233') data.add('IronMan', '293-8625') data.add('BlackWidow', '852-6551') data.add('Hulk', '632-4123') data.add('Spiderman', '567-2188') data.add('BlackPanther', '777-8888') print(data) print(data.get('BlackPanther')) print(data.delete('BlackPanther')) print(data.pprint())
class Maphash: def __init__(self, maxsize=6): self.maxsize = maxsize self.hash = [None] * self.maxsize def _get_hash_key(self, key): hash = sum((ord(k) for k in key)) return hash % self.maxsize def add(self, key, value): hash_key = self._get_hash_key(key) hash_value = [key, value] if self.hash[hash_key] is None: self.hash[hash_key] = [hash_value] return True else: for pair in self.hash[hash_key]: if pair[0] == key: pair[1] = value return True self.hash[hash_key].append(hash_value) def get(self, key): hash_key = self._get_hash_key(key) if self.hash[hash_key] is not None: for (k, v) in self.hash[hash_key]: if k == key: return v return 'Key Error' def delete(self, key): hash_key = self._get_hash_key(key) if self.hash[hash_key] is not None: for i in range(len(self.hash[hash_key])): if self.hash[hash_key][i][0] == key: self.hash[hash_key].pop(i) return True else: return 'Key Error' def __str__(self): return str(self.hash) def pprint(self): for item in self.hash: if item is not None: print(str(item)) data = map_hash() data.add('CaptainAmerica', '567-8888') data.add('Thor', '293-6753') data.add('Thor', '333-8233') data.add('IronMan', '293-8625') data.add('BlackWidow', '852-6551') data.add('Hulk', '632-4123') data.add('Spiderman', '567-2188') data.add('BlackPanther', '777-8888') print(data) print(data.get('BlackPanther')) print(data.delete('BlackPanther')) print(data.pprint())
#Refer AlexNet implementation code, returns last fully connected layer fc7 = AlexNet(resized, feature_extract=True) shape = (fc7.get_shape().as_list()[-1], 43) fc8_weight = tf.Variable(tf.truncated_normal(shape, stddev=1e-2)) fc8_b = tf.Variable(tf.zeros(43)) logits = tf.nn.xw_plus_b(fc7, fc8_weight, fc8_b) probs = tf.nn.softmax(logits)
fc7 = alex_net(resized, feature_extract=True) shape = (fc7.get_shape().as_list()[-1], 43) fc8_weight = tf.Variable(tf.truncated_normal(shape, stddev=0.01)) fc8_b = tf.Variable(tf.zeros(43)) logits = tf.nn.xw_plus_b(fc7, fc8_weight, fc8_b) probs = tf.nn.softmax(logits)
def isSubsetSum(arr, n, sum): ''' Returns true if there exists a subset with given sum in arr[] ''' # The value of subset[i%2][j] will be true # if there exists a subset of sum j in # arr[0, 1, ...., i-1] subset = [[False for j in range(sum + 1)] for i in range(3)] for i in range(n + 1): for j in range(sum + 1): # A subset with sum 0 is always possible if (j == 0): subset[i % 2][j] = True # If there exists no element no sum # is possible elif (i == 0): subset[i % 2][j] = False elif (arr[i - 1] <= j): subset[i % 2][j] = subset[ (i + 1) % 2][j - arr[i - 1]] or subset[(i + 1) % 2][j] else: subset[i % 2][j] = subset[(i + 1) % 2][j] return subset[n % 2][sum] # Driver code arr = [6, 2, 5] sum = 7 n = len(arr) if (isSubsetSum(arr, n, sum) is True): print("There exists a subset with given sum") else: print("No subset exists with given sum")
def is_subset_sum(arr, n, sum): """ Returns true if there exists a subset with given sum in arr[] """ subset = [[False for j in range(sum + 1)] for i in range(3)] for i in range(n + 1): for j in range(sum + 1): if j == 0: subset[i % 2][j] = True elif i == 0: subset[i % 2][j] = False elif arr[i - 1] <= j: subset[i % 2][j] = subset[(i + 1) % 2][j - arr[i - 1]] or subset[(i + 1) % 2][j] else: subset[i % 2][j] = subset[(i + 1) % 2][j] return subset[n % 2][sum] arr = [6, 2, 5] sum = 7 n = len(arr) if is_subset_sum(arr, n, sum) is True: print('There exists a subset with given sum') else: print('No subset exists with given sum')
tup = ('a','b',1,2,3) print(tup[0]) print(tup[1]) print(tup[2]) print(tup[3]) print(tup[4])
tup = ('a', 'b', 1, 2, 3) print(tup[0]) print(tup[1]) print(tup[2]) print(tup[3]) print(tup[4])
class Solution: def XXX(self, nums: List[int]) -> List[List[int]]: final = list() # ---------------------------------------------------- if len(nums)==1: return [[],nums] if len(nums)==0: return [] # ------------------------------------------------------ def pop(cut): if not cut: return else: for i in range(len(cut)): tmp = copy.deepcopy(cut) tmp.pop(i) if tmp not in final: final.append(tmp) pop(tmp) pop(nums) if nums: final.append(nums) return final
class Solution: def xxx(self, nums: List[int]) -> List[List[int]]: final = list() if len(nums) == 1: return [[], nums] if len(nums) == 0: return [] def pop(cut): if not cut: return else: for i in range(len(cut)): tmp = copy.deepcopy(cut) tmp.pop(i) if tmp not in final: final.append(tmp) pop(tmp) pop(nums) if nums: final.append(nums) return final
# -*- coding: utf-8 -*- # @Time: 2020/7/3 10:21 # @Author: GraceKoo # @File: interview_33.py # @Desc: https://leetcode-cn.com/problems/chou-shu-lcof/ class Solution: def nthUglyNumber(self, n: int) -> int: if n <= 0: return 0 dp, a, b, c = [1] * n, 0, 0, 0 for i in range(1, n): min_ugly = min(dp[a] * 2, dp[b] * 3, dp[c] * 5) dp[i] = min_ugly if min_ugly == dp[a] * 2: a += 1 if min_ugly == dp[b] * 3: b += 1 if min_ugly == dp[c] * 5: c += 1 return dp[-1] so = Solution() print(so.nthUglyNumber(10))
class Solution: def nth_ugly_number(self, n: int) -> int: if n <= 0: return 0 (dp, a, b, c) = ([1] * n, 0, 0, 0) for i in range(1, n): min_ugly = min(dp[a] * 2, dp[b] * 3, dp[c] * 5) dp[i] = min_ugly if min_ugly == dp[a] * 2: a += 1 if min_ugly == dp[b] * 3: b += 1 if min_ugly == dp[c] * 5: c += 1 return dp[-1] so = solution() print(so.nthUglyNumber(10))
# Solution for the SafeCracker 50 Puzzle from Creative Crafthouse # By: Eric Pollinger # 9/11/2016 # # Function to handle the addition of a given slice def add(slice): if row1Outer[(index1 + slice) % 16] != -1: valRow1 = row1Outer[(index1 + slice) % 16] else: valRow1 = row0Inner[slice] if row2Outer[(index2 + slice) % 16] != -1: valRow2 = row2Outer[(index2 + slice) % 16] else: valRow2 = row1Inner[(index1 + slice) % 16] if row3Outer[(index3 + slice) % 16] != -1: valRow3 = row3Outer[(index3 + slice) % 16] else: valRow3 = row2Inner[(index2 + slice) % 16] if row4[(index4 + slice) % 16] != -1: valRow4 = row4[(index4 + slice) % 16] else: valRow4 = row3Inner[(index3 + slice) % 16] return row0Outer[slice] + valRow1 + valRow2 + valRow3 + valRow4 if __name__ == "__main__": # Raw data (Row0 = base of puzzle) row0Outer = [10,1,10,4,5,3,15,16,4,7,0,16,8,4,15,7] row0Inner = [10,10,10,15,7,19,18,2,9,27,13,11,13,10,18,10] row1Outer = [-1,10,-1,8,-1,10,-1,9,-1,8,-1,8,-1,9,-1,6] row1Inner = [1,24,8,10,20,7,20,12,1,10,12,22,0,5,8,5] row2Outer = [0,-1,11,-1,8,-1,8,-1,8,-1,10,-1,11,-1,10,-1] row2Inner = [20,8,19,10,15,20,12,20,13,13,0,22,19,10,0,5] row3Outer = [10,-1,14,-1,11,-1,8,-1,12,-1,11,-1,3,-1,8,-1] row3Inner = [6,18,8,17,4,20,4,14,4,5,1,14,10,17,10,5] row4 = [8,-1,8,-1,16,-1,19,-1,8,-1,17,-1,6,-1,6,-1] count = 0 for index1 in range(0,16): for index2 in range(0,16): for index3 in range(0,16): for index4 in range(0,16): if add(0) == 50: solution = True for sl in range(1,16): if add(sl) != 50: solution = False if solution == True: count = count + 1 # Print Solution print('Solution with index values: ' + str(index1) + ' ' + str(index2) + ' ' + str(index3) + ' ' + str(index4) + ' for a total number of solutions: ' + str(count)) for i in range(0, 5): print('Solution with Slice ' + str(i) + ' values:\t ' + str(row1Outer[(index1 + i) % 16]) + '\t\t' + str( row2Outer[(index2 + i) % 16]) + '\t\t' + str(row3Outer[(index3 + i) % 16]) + '\t\t' + str(row4[(index4 + i) % 16])) if count == 0: print("No Solution Found")
def add(slice): if row1Outer[(index1 + slice) % 16] != -1: val_row1 = row1Outer[(index1 + slice) % 16] else: val_row1 = row0Inner[slice] if row2Outer[(index2 + slice) % 16] != -1: val_row2 = row2Outer[(index2 + slice) % 16] else: val_row2 = row1Inner[(index1 + slice) % 16] if row3Outer[(index3 + slice) % 16] != -1: val_row3 = row3Outer[(index3 + slice) % 16] else: val_row3 = row2Inner[(index2 + slice) % 16] if row4[(index4 + slice) % 16] != -1: val_row4 = row4[(index4 + slice) % 16] else: val_row4 = row3Inner[(index3 + slice) % 16] return row0Outer[slice] + valRow1 + valRow2 + valRow3 + valRow4 if __name__ == '__main__': row0_outer = [10, 1, 10, 4, 5, 3, 15, 16, 4, 7, 0, 16, 8, 4, 15, 7] row0_inner = [10, 10, 10, 15, 7, 19, 18, 2, 9, 27, 13, 11, 13, 10, 18, 10] row1_outer = [-1, 10, -1, 8, -1, 10, -1, 9, -1, 8, -1, 8, -1, 9, -1, 6] row1_inner = [1, 24, 8, 10, 20, 7, 20, 12, 1, 10, 12, 22, 0, 5, 8, 5] row2_outer = [0, -1, 11, -1, 8, -1, 8, -1, 8, -1, 10, -1, 11, -1, 10, -1] row2_inner = [20, 8, 19, 10, 15, 20, 12, 20, 13, 13, 0, 22, 19, 10, 0, 5] row3_outer = [10, -1, 14, -1, 11, -1, 8, -1, 12, -1, 11, -1, 3, -1, 8, -1] row3_inner = [6, 18, 8, 17, 4, 20, 4, 14, 4, 5, 1, 14, 10, 17, 10, 5] row4 = [8, -1, 8, -1, 16, -1, 19, -1, 8, -1, 17, -1, 6, -1, 6, -1] count = 0 for index1 in range(0, 16): for index2 in range(0, 16): for index3 in range(0, 16): for index4 in range(0, 16): if add(0) == 50: solution = True for sl in range(1, 16): if add(sl) != 50: solution = False if solution == True: count = count + 1 print('Solution with index values: ' + str(index1) + ' ' + str(index2) + ' ' + str(index3) + ' ' + str(index4) + ' for a total number of solutions: ' + str(count)) for i in range(0, 5): print('Solution with Slice ' + str(i) + ' values:\t ' + str(row1Outer[(index1 + i) % 16]) + '\t\t' + str(row2Outer[(index2 + i) % 16]) + '\t\t' + str(row3Outer[(index3 + i) % 16]) + '\t\t' + str(row4[(index4 + i) % 16])) if count == 0: print('No Solution Found')
# test __getattr__ on module # ensure that does_not_exist doesn't exist to start with this = __import__(__name__) try: this.does_not_exist assert False except AttributeError: pass # define __getattr__ def __getattr__(attr): if attr == 'does_not_exist': return False raise AttributeError # do feature test (will also test functionality if the feature exists) if not hasattr(this, 'does_not_exist'): print('SKIP') raise SystemExit # check that __getattr__ works as expected print(this.does_not_exist)
this = __import__(__name__) try: this.does_not_exist assert False except AttributeError: pass def __getattr__(attr): if attr == 'does_not_exist': return False raise AttributeError if not hasattr(this, 'does_not_exist'): print('SKIP') raise SystemExit print(this.does_not_exist)
#Cristian Chitiva #[email protected] #12/Sept/2018 myList = ['Hi', 5, 6 , 3.4, "i"] #Create the list myList.append([4, 5]) #Add sublist [4, 5] to myList myList.insert(2,"f") #Add "f" in the position 2 print(myList) myList = [1, 3, 4, 5, 23, 4, 3, 222, 454, 6445, 6, 4654, 455] myList.sort() #Sort the list from lowest to highest print(myList) myList.sort(reverse = True) #Sort the list from highest to lowest print(myList) myList.extend([5, 77]) #Add 5 and 77 to myList print(myList) #List comprehension myList = [] for value in range(0, 50): myList.append(value) print(myList) myList = ["f" for value in range(0,20)] print(myList) myList = [value for value in range(0,20)] print(myList) myList = [value for value in range(0,60,3) if value % 2 == 0] print(myList)
my_list = ['Hi', 5, 6, 3.4, 'i'] myList.append([4, 5]) myList.insert(2, 'f') print(myList) my_list = [1, 3, 4, 5, 23, 4, 3, 222, 454, 6445, 6, 4654, 455] myList.sort() print(myList) myList.sort(reverse=True) print(myList) myList.extend([5, 77]) print(myList) my_list = [] for value in range(0, 50): myList.append(value) print(myList) my_list = ['f' for value in range(0, 20)] print(myList) my_list = [value for value in range(0, 20)] print(myList) my_list = [value for value in range(0, 60, 3) if value % 2 == 0] print(myList)
sample = ["abc", "xyz", "aba", "1221"] def stringCounter(items): amount = 0 for i in items: if len(i) >= 2 and i[0] == i[-1]: amount += 1 return amount print("The amount of string that meet the criteria is:",stringCounter(sample))
sample = ['abc', 'xyz', 'aba', '1221'] def string_counter(items): amount = 0 for i in items: if len(i) >= 2 and i[0] == i[-1]: amount += 1 return amount print('The amount of string that meet the criteria is:', string_counter(sample))
# Uri Online Judge 1079 N = int(input()) for i in range(0,N): Numbers = input() num1 = float(Numbers.split()[0]) num2 = float(Numbers.split()[1]) num3 = float(Numbers.split()[2]) print(((2*num1+3*num2+5*num3)/10).__round__(1))
n = int(input()) for i in range(0, N): numbers = input() num1 = float(Numbers.split()[0]) num2 = float(Numbers.split()[1]) num3 = float(Numbers.split()[2]) print(((2 * num1 + 3 * num2 + 5 * num3) / 10).__round__(1))
entity_id = data.get('entity_id') command = data.get('command') params = str(data.get('params')) parsedParams = [] for z in params.replace(' ', '').replace('],[', '|').replace('[', '').replace(']', '').split('|'): rect = [] for c in z.split(','): rect.append(int(c)) parsedParams.append(rect) if command in ["app_goto_target", "app_segment_clean"]: parsedParams = parsedParams[0] hass.services.call('vacuum', 'send_command', {'entity_id': entity_id, 'command': command, 'params': parsedParams}, True)
entity_id = data.get('entity_id') command = data.get('command') params = str(data.get('params')) parsed_params = [] for z in params.replace(' ', '').replace('],[', '|').replace('[', '').replace(']', '').split('|'): rect = [] for c in z.split(','): rect.append(int(c)) parsedParams.append(rect) if command in ['app_goto_target', 'app_segment_clean']: parsed_params = parsedParams[0] hass.services.call('vacuum', 'send_command', {'entity_id': entity_id, 'command': command, 'params': parsedParams}, True)
def rank_filter(func): def func_filter(local_rank=-1, *args, **kwargs): if local_rank < 1: return func(*args, **kwargs) else: pass return func_filter
def rank_filter(func): def func_filter(local_rank=-1, *args, **kwargs): if local_rank < 1: return func(*args, **kwargs) else: pass return func_filter
tot=coe=rat=sap=0 for i in range(int(input())): n,s=input().split() n=int(n) tot+=n if s=='C':coe+=n elif s=='R':rat+=n elif s=='S':sap+=n print(f"Total: {tot} cobaias\nTotal de coelhos: {coe}\nTotal de ratos: {rat}\nTotal de sapos: {sap}") p=(coe/tot)*100 print("Percentual de coelhos: %.2f"%p,end="") print(" %") p=(rat/tot)*100 print("Percentual de ratos: %.2f"%p,end="") print(" %") p=(sap/tot)*100 print("Percentual de sapos: %.2f"%p,end="") print(" %")
tot = coe = rat = sap = 0 for i in range(int(input())): (n, s) = input().split() n = int(n) tot += n if s == 'C': coe += n elif s == 'R': rat += n elif s == 'S': sap += n print(f'Total: {tot} cobaias\nTotal de coelhos: {coe}\nTotal de ratos: {rat}\nTotal de sapos: {sap}') p = coe / tot * 100 print('Percentual de coelhos: %.2f' % p, end='') print(' %') p = rat / tot * 100 print('Percentual de ratos: %.2f' % p, end='') print(' %') p = sap / tot * 100 print('Percentual de sapos: %.2f' % p, end='') print(' %')
[ ## this file was manually modified by jt { 'functor' : { 'description' : [ "The function always returns a value of the same type than the entry.", "Take care that for integers the value returned can differ by one unit", "from \c ceil((a+b)/2.0) or \c floor((a+b)/2.0), but is always one of", "the two" ], 'module' : 'boost', 'arity' : '2', 'call_types' : [], 'ret_arity' : '0', 'rturn' : { 'default' : 'T', }, 'simd_types' : ['real_'], 'type_defs' : [], 'types' : ['real_', 'signed_int_', 'unsigned_int_'], }, 'info' : 'manually modified', 'unit' : { 'global_header' : { 'first_stamp' : 'modified by jt the 28/11/2010', 'included' : [], 'notes' : ['for integer values average does not,coincide with (a0+a1)/2 by at most one unit.'], 'stamp' : 'modified by jt the 13/12/2010', }, 'ranges' : { 'real_' : [['T(-100)', 'T(100)'], ['T(-100)', 'T(100)']], 'signed_int_' : [['T(-100)', 'T(100)'], ['T(-100)', 'T(100)']], 'unsigned_int_' : [['T(0)', 'T(100)'], ['T(0)', 'T(100)']], }, 'specific_values' : { 'default' : { }, 'real_' : { 'boost::simd::Inf<T>()' : 'boost::simd::Inf<T>()', 'boost::simd::Minf<T>()' : 'boost::simd::Minf<T>()', 'boost::simd::Mone<T>()' : 'boost::simd::Mone<T>()', 'boost::simd::Nan<T>()' : 'boost::simd::Nan<T>()', 'boost::simd::One<T>()' : 'boost::simd::One<T>()', 'boost::simd::Zero<T>()' : 'boost::simd::Zero<T>()', }, 'signed_int_' : { 'boost::simd::Mone<T>()' : 'boost::simd::Mone<T>()', 'boost::simd::One<T>()' : 'boost::simd::One<T>()', 'boost::simd::Zero<T>()' : 'boost::simd::Zero<T>()', }, 'unsigned_int_' : { 'boost::simd::One<T>()' : 'boost::simd::One<T>()', 'boost::simd::Zero<T>()' : 'boost::simd::Zero<T>()', }, }, 'verif_test' : { 'property_call' : { 'default' : ['boost::simd::average(a0,a1)'], }, 'property_value' : { 'default' : ['(a0+a1)/2'], }, 'ulp_thresh' : { 'default' : ['1'], 'real_' : ['0'], }, }, }, 'version' : '0.1', }, ]
[{'functor': {'description': ['The function always returns a value of the same type than the entry.', 'Take care that for integers the value returned can differ by one unit', 'from \\c ceil((a+b)/2.0) or \\c floor((a+b)/2.0), but is always one of', 'the two'], 'module': 'boost', 'arity': '2', 'call_types': [], 'ret_arity': '0', 'rturn': {'default': 'T'}, 'simd_types': ['real_'], 'type_defs': [], 'types': ['real_', 'signed_int_', 'unsigned_int_']}, 'info': 'manually modified', 'unit': {'global_header': {'first_stamp': 'modified by jt the 28/11/2010', 'included': [], 'notes': ['for integer values average does not,coincide with (a0+a1)/2 by at most one unit.'], 'stamp': 'modified by jt the 13/12/2010'}, 'ranges': {'real_': [['T(-100)', 'T(100)'], ['T(-100)', 'T(100)']], 'signed_int_': [['T(-100)', 'T(100)'], ['T(-100)', 'T(100)']], 'unsigned_int_': [['T(0)', 'T(100)'], ['T(0)', 'T(100)']]}, 'specific_values': {'default': {}, 'real_': {'boost::simd::Inf<T>()': 'boost::simd::Inf<T>()', 'boost::simd::Minf<T>()': 'boost::simd::Minf<T>()', 'boost::simd::Mone<T>()': 'boost::simd::Mone<T>()', 'boost::simd::Nan<T>()': 'boost::simd::Nan<T>()', 'boost::simd::One<T>()': 'boost::simd::One<T>()', 'boost::simd::Zero<T>()': 'boost::simd::Zero<T>()'}, 'signed_int_': {'boost::simd::Mone<T>()': 'boost::simd::Mone<T>()', 'boost::simd::One<T>()': 'boost::simd::One<T>()', 'boost::simd::Zero<T>()': 'boost::simd::Zero<T>()'}, 'unsigned_int_': {'boost::simd::One<T>()': 'boost::simd::One<T>()', 'boost::simd::Zero<T>()': 'boost::simd::Zero<T>()'}}, 'verif_test': {'property_call': {'default': ['boost::simd::average(a0,a1)']}, 'property_value': {'default': ['(a0+a1)/2']}, 'ulp_thresh': {'default': ['1'], 'real_': ['0']}}}, 'version': '0.1'}]
# Audit Event Outcomes AUDIT_SUCCESS = "0" AUDIT_MINOR_FAILURE = "4" AUDIT_SERIOUS_FAILURE = "8" AUDIT_MAJOR_FAILURE = "12"
audit_success = '0' audit_minor_failure = '4' audit_serious_failure = '8' audit_major_failure = '12'
#771. Jewels and Stones class Solution: def numJewelsInStones(self, jewels: str, stones: str) -> int: # count = 0 # jewl = {} # for i in jewels: # if i not in jewl: # jewl[i] = 0 # for j in stones: # if j in jewl: # count += 1 # return count # return sum(s in jewels for s in stones) count = 0 jewl = set(jewels) for s in stones: if s in jewl: count += 1 return count
class Solution: def num_jewels_in_stones(self, jewels: str, stones: str) -> int: count = 0 jewl = set(jewels) for s in stones: if s in jewl: count += 1 return count
class MaxPQ: def __init__(self): self.pq = [] def insert(self, v): self.pq.append(v) self.swim(len(self.pq) - 1) def max(self): return self.pq[0] def del_max(self, ): m = self.pq[0] self.pq[0], self.pq[-1] = self.pq[-1], self.pq[0] self.pq = self.pq[:-1] self.sink(0) return m def is_empty(self, ): return not self.pq def size(self, ): return len(self.pq) def swim(self, k): while k > 0 and self.pq[(k - 1) // 2] < self.pq[k]: self.pq[k], self.pq[ (k - 1) // 2] = self.pq[(k - 1) // 2], self.pq[k] k = k // 2 def sink(self, k): N = len(self.pq) while 2 * k + 1 <= N - 1: j = 2 * k + 1 if j < N - 1 and self.pq[j] < self.pq[j + 1]: j += 1 if self.pq[k] > self.pq[j]: break self.pq[k], self.pq[j] = self.pq[j], self.pq[k] k = j
class Maxpq: def __init__(self): self.pq = [] def insert(self, v): self.pq.append(v) self.swim(len(self.pq) - 1) def max(self): return self.pq[0] def del_max(self): m = self.pq[0] (self.pq[0], self.pq[-1]) = (self.pq[-1], self.pq[0]) self.pq = self.pq[:-1] self.sink(0) return m def is_empty(self): return not self.pq def size(self): return len(self.pq) def swim(self, k): while k > 0 and self.pq[(k - 1) // 2] < self.pq[k]: (self.pq[k], self.pq[(k - 1) // 2]) = (self.pq[(k - 1) // 2], self.pq[k]) k = k // 2 def sink(self, k): n = len(self.pq) while 2 * k + 1 <= N - 1: j = 2 * k + 1 if j < N - 1 and self.pq[j] < self.pq[j + 1]: j += 1 if self.pq[k] > self.pq[j]: break (self.pq[k], self.pq[j]) = (self.pq[j], self.pq[k]) k = j
BOT_TOKEN: str = "ODg4MzAyMzkwNTMxNDg1Njk2.YUQuEQ.UO4oyY9Zk4u1W5f-VpPLkkQ70TM" SPOTIFY_ID: str = "" SPOTIFY_SECRET: str = "" BOT_PREFIX = "$" EMBED_COLOR = 0x4dd4d0 #replace after'0x' with desired hex code ex. '#ff0188' >> '0xff0188' SUPPORTED_EXTENSIONS = ('.webm', '.mp4', '.mp3', '.avi', '.wav', '.m4v', '.ogg', '.mov') MAX_SONG_PRELOAD = 5 #maximum of 25 COOKIE_PATH = "/config/cookies/cookies.txt" GLOBAL_DISABLE_AUTOJOIN_VC = False VC_TIMEOUT = 600 #seconds VC_TIMOUT_DEFAULT = True #default template setting for VC timeout true= yes, timeout false= no timeout ALLOW_VC_TIMEOUT_EDIT = True #allow or disallow editing the vc_timeout guild setting STARTUP_MESSAGE = "Starting Bot..." STARTUP_COMPLETE_MESSAGE = "Startup Complete" NO_GUILD_MESSAGE = 'Error: Please join a voice channel or enter the command in guild chat' USER_NOT_IN_VC_MESSAGE = "Error: Please join the active voice channel to use commands" WRONG_CHANNEL_MESSAGE = "Error: Please use configured command channel" NOT_CONNECTED_MESSAGE = "Error: Bot not connected to any voice channel" ALREADY_CONNECTED_MESSAGE = "Error: Already connected to a voice channel" CHANNEL_NOT_FOUND_MESSAGE = "Error: Could not find channel" DEFAULT_CHANNEL_JOIN_FAILED = "Error: Could not join the default voice channel" INVALID_INVITE_MESSAGE = "Error: Invalid invitation link" ADD_MESSAGE= "To add this bot to your own Server, click [here]" #brackets will be the link text INFO_HISTORY_TITLE = "Songs Played:" MAX_HISTORY_LENGTH = 10 MAX_TRACKNAME_HISTORY_LENGTH = 15 SONGINFO_UPLOADER = "Uploader: " SONGINFO_DURATION = "Duration: " SONGINFO_SECONDS = "s" SONGINFO_LIKES = "Likes: " SONGINFO_DISLIKES = "Dislikes: " SONGINFO_NOW_PLAYING = "Now Playing" SONGINFO_QUEUE_ADDED = "Added to queue" SONGINFO_SONGINFO = "Song info" SONGINFO_UNKNOWN_SITE = "Unknown site :question:" SONGINFO_PLAYLIST_QUEUED = "Queued playlist :page_with_curl:" SONGINFO_UNKNOWN_DURATION = "Unknown" HELP_ADDBOT_SHORT = "Add Bot to another server" HELP_ADDBOT_LONG = "Gives you the link for adding this bot to another server of yours." HELP_CONNECT_SHORT = "Connect bot to voicechannel" HELP_CONNECT_LONG = "Connects the bot to the voice channel you are currently in" HELP_DISCONNECT_SHORT = "Disonnect bot from voicechannel" HELP_DISCONNECT_LONG = "Disconnect the bot from the voice channel and stop audio." HELP_SETTINGS_SHORT = "View and set bot settings" HELP_SETTINGS_LONG = "View and set bot settings in the server. Usage: {}settings setting_name value".format(BOT_PREFIX) HELP_HISTORY_SHORT = "Show history of songs" HELP_HISTORY_LONG = "Shows the " + str(MAX_TRACKNAME_HISTORY_LENGTH) + " last played songs." HELP_PAUSE_SHORT = "Pause Music" HELP_PAUSE_LONG = "Pauses the AudioPlayer. Playback can be continued with the resume command." HELP_VOL_SHORT = "Change volume %" HELP_VOL_LONG = "Changes the volume of the AudioPlayer. Argument specifies the % to which the volume should be set." HELP_PREV_SHORT = "Go back one Song" HELP_PREV_LONG = "Plays the previous song again." HELP_RESUME_SHORT = "Resume Music" HELP_RESUME_LONG = "Resumes the AudioPlayer." HELP_SKIP_SHORT = "Skip a song" HELP_SKIP_LONG = "Skips the currently playing song and goes to the next item in the queue." HELP_SONGINFO_SHORT = "Info about current Song" HELP_SONGINFO_LONG = "Shows details about the song currently being played and posts a link to the song." HELP_STOP_SHORT = "Stop Music" HELP_STOP_LONG = "Stops the AudioPlayer and clears the songqueue" HELP_YT_SHORT = "Play a supported link or search on youtube" HELP_YT_LONG = ("$p [link/video title/key words/playlist-link/soundcloud link/spotify link/bandcamp link/twitter link]") HELP_PING_SHORT = "Pong" HELP_PING_LONG = "Test bot response status" HELP_CLEAR_SHORT = "Clear the queue." HELP_CLEAR_LONG = "Clears the queue and skips the current song." HELP_LOOP_SHORT = "Loops the currently playing song, toggle on/off." HELP_LOOP_LONG = "Loops the currently playing song and locks the queue. Use the command again to disable loop." HELP_QUEUE_SHORT = "Shows the songs in queue." HELP_QUEUE_LONG = "Shows the number of songs in queue, up to 10." HELP_SHUFFLE_SHORT = "Shuffle the queue" HELP_SHUFFLE_LONG = "Randomly sort the songs in the current queue" HELP_CHANGECHANNEL_SHORT = "Change the bot channel" HELP_CHANGECHANNEL_LONG = "Change the bot channel to the VC you are in" ABSOLUTE_PATH = '' #do not modify
bot_token: str = 'ODg4MzAyMzkwNTMxNDg1Njk2.YUQuEQ.UO4oyY9Zk4u1W5f-VpPLkkQ70TM' spotify_id: str = '' spotify_secret: str = '' bot_prefix = '$' embed_color = 5100752 supported_extensions = ('.webm', '.mp4', '.mp3', '.avi', '.wav', '.m4v', '.ogg', '.mov') max_song_preload = 5 cookie_path = '/config/cookies/cookies.txt' global_disable_autojoin_vc = False vc_timeout = 600 vc_timout_default = True allow_vc_timeout_edit = True startup_message = 'Starting Bot...' startup_complete_message = 'Startup Complete' no_guild_message = 'Error: Please join a voice channel or enter the command in guild chat' user_not_in_vc_message = 'Error: Please join the active voice channel to use commands' wrong_channel_message = 'Error: Please use configured command channel' not_connected_message = 'Error: Bot not connected to any voice channel' already_connected_message = 'Error: Already connected to a voice channel' channel_not_found_message = 'Error: Could not find channel' default_channel_join_failed = 'Error: Could not join the default voice channel' invalid_invite_message = 'Error: Invalid invitation link' add_message = 'To add this bot to your own Server, click [here]' info_history_title = 'Songs Played:' max_history_length = 10 max_trackname_history_length = 15 songinfo_uploader = 'Uploader: ' songinfo_duration = 'Duration: ' songinfo_seconds = 's' songinfo_likes = 'Likes: ' songinfo_dislikes = 'Dislikes: ' songinfo_now_playing = 'Now Playing' songinfo_queue_added = 'Added to queue' songinfo_songinfo = 'Song info' songinfo_unknown_site = 'Unknown site :question:' songinfo_playlist_queued = 'Queued playlist :page_with_curl:' songinfo_unknown_duration = 'Unknown' help_addbot_short = 'Add Bot to another server' help_addbot_long = 'Gives you the link for adding this bot to another server of yours.' help_connect_short = 'Connect bot to voicechannel' help_connect_long = 'Connects the bot to the voice channel you are currently in' help_disconnect_short = 'Disonnect bot from voicechannel' help_disconnect_long = 'Disconnect the bot from the voice channel and stop audio.' help_settings_short = 'View and set bot settings' help_settings_long = 'View and set bot settings in the server. Usage: {}settings setting_name value'.format(BOT_PREFIX) help_history_short = 'Show history of songs' help_history_long = 'Shows the ' + str(MAX_TRACKNAME_HISTORY_LENGTH) + ' last played songs.' help_pause_short = 'Pause Music' help_pause_long = 'Pauses the AudioPlayer. Playback can be continued with the resume command.' help_vol_short = 'Change volume %' help_vol_long = 'Changes the volume of the AudioPlayer. Argument specifies the % to which the volume should be set.' help_prev_short = 'Go back one Song' help_prev_long = 'Plays the previous song again.' help_resume_short = 'Resume Music' help_resume_long = 'Resumes the AudioPlayer.' help_skip_short = 'Skip a song' help_skip_long = 'Skips the currently playing song and goes to the next item in the queue.' help_songinfo_short = 'Info about current Song' help_songinfo_long = 'Shows details about the song currently being played and posts a link to the song.' help_stop_short = 'Stop Music' help_stop_long = 'Stops the AudioPlayer and clears the songqueue' help_yt_short = 'Play a supported link or search on youtube' help_yt_long = '$p [link/video title/key words/playlist-link/soundcloud link/spotify link/bandcamp link/twitter link]' help_ping_short = 'Pong' help_ping_long = 'Test bot response status' help_clear_short = 'Clear the queue.' help_clear_long = 'Clears the queue and skips the current song.' help_loop_short = 'Loops the currently playing song, toggle on/off.' help_loop_long = 'Loops the currently playing song and locks the queue. Use the command again to disable loop.' help_queue_short = 'Shows the songs in queue.' help_queue_long = 'Shows the number of songs in queue, up to 10.' help_shuffle_short = 'Shuffle the queue' help_shuffle_long = 'Randomly sort the songs in the current queue' help_changechannel_short = 'Change the bot channel' help_changechannel_long = 'Change the bot channel to the VC you are in' absolute_path = ''
class IncompatibleAttribute(Exception): pass class IncompatibleDataException(Exception): pass class UndefinedROI(Exception): pass class InvalidSubscriber(Exception): pass class InvalidMessage(Exception): pass
class Incompatibleattribute(Exception): pass class Incompatibledataexception(Exception): pass class Undefinedroi(Exception): pass class Invalidsubscriber(Exception): pass class Invalidmessage(Exception): pass
# Enter script code message = "kubectl exec -it <cursor> -- bash" keyboard.send_keys("kubectl exec -it ") keyboard.send_keys("<shift>+<ctrl>+v") time.sleep(0.1) keyboard.send_keys(" -- bash")
message = 'kubectl exec -it <cursor> -- bash' keyboard.send_keys('kubectl exec -it ') keyboard.send_keys('<shift>+<ctrl>+v') time.sleep(0.1) keyboard.send_keys(' -- bash')
''' Topic : Algorithms Subtopic : Diagonal Difference Language : Python Problem Statement : Given a square matrix, calculate the absolute difference between the sums of its diagonals. Url : https://www.hackerrank.com/challenges/diagonal-difference/problem ''' #!/bin/python3 # Complete the 'diagonalDifference' function below. # # The function is expected to return an INTEGER. # The function accepts 2D_INTEGER_ARRAY arr as parameter. # def diagonalDifference(arr): # Write your code here n = len(arr) d1 = sum(arr[i][i] for i in range(n)) d2 = sum(arr[i][n-i-1] for i in range(n)) return abs(d1 - d2) assert diagonalDifference([[11,2,4], [4,5,6], [10,8,-12]]) == 15 assert diagonalDifference([[1,2,3], [4,5,6], [9,8,9]]) == 2 assert diagonalDifference([[1,1,1,1], [1,1,1,1], [1,1,1,1], [1,1,1,1]]) == 0
""" Topic : Algorithms Subtopic : Diagonal Difference Language : Python Problem Statement : Given a square matrix, calculate the absolute difference between the sums of its diagonals. Url : https://www.hackerrank.com/challenges/diagonal-difference/problem """ def diagonal_difference(arr): n = len(arr) d1 = sum((arr[i][i] for i in range(n))) d2 = sum((arr[i][n - i - 1] for i in range(n))) return abs(d1 - d2) assert diagonal_difference([[11, 2, 4], [4, 5, 6], [10, 8, -12]]) == 15 assert diagonal_difference([[1, 2, 3], [4, 5, 6], [9, 8, 9]]) == 2 assert diagonal_difference([[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]) == 0
class ParsnipException(Exception): def __init__(self, msg, webtexter=None): self.args = (msg, webtexter) self.msg = msg self.webtexter = webtexter def __str__(self): return repr("[%s] %s - %s" % (self.webtexter.NETWORK_NAME, self.webtexter.phone_number, self.msg)) class LoginError(ParsnipException):pass class MessageSendingError(ParsnipException):pass class ConnectionError(ParsnipException):pass class ResourceError(ParsnipException):pass
class Parsnipexception(Exception): def __init__(self, msg, webtexter=None): self.args = (msg, webtexter) self.msg = msg self.webtexter = webtexter def __str__(self): return repr('[%s] %s - %s' % (self.webtexter.NETWORK_NAME, self.webtexter.phone_number, self.msg)) class Loginerror(ParsnipException): pass class Messagesendingerror(ParsnipException): pass class Connectionerror(ParsnipException): pass class Resourceerror(ParsnipException): pass
def soma(x,y): return print(x + y) def sub(x,y): return print(x - y) def mult(x,y): return print(x * y) def div(x,y): return print(x / y) soma(3,8) sub(10,5) mult(3,9) div(15,7)
def soma(x, y): return print(x + y) def sub(x, y): return print(x - y) def mult(x, y): return print(x * y) def div(x, y): return print(x / y) soma(3, 8) sub(10, 5) mult(3, 9) div(15, 7)
class DeviceLog: def __init__(self, deviceId, deviceName, temperature, location, recordDate): self.deviceId = deviceId self.deviceName = deviceName self.temperature = temperature self.location = location self.recordDate = recordDate def getStatus(self): if self.temperature is None: raise Exception('Invalid Temperature Value Specified!') if self.temperature < 18: status = 'COLD' elif self.temperature >= 18 and self.temperature < 25: status = 'WARM' else: status = 'HOT' return status def __str__(self): return '%s, %s, %s, %s, %s' % (self.deviceId, self.deviceName, self.temperature, self.location, self.recordDate) try: device_log_object = DeviceLog( 'D1001', 'Device-X93984', 24, 'Bangalore', '2022-01-01') print(device_log_object) print('Status : %s' % device_log_object.getStatus()) except Exception as error: print('Error Occurred, Details : %s ' % str(error))
class Devicelog: def __init__(self, deviceId, deviceName, temperature, location, recordDate): self.deviceId = deviceId self.deviceName = deviceName self.temperature = temperature self.location = location self.recordDate = recordDate def get_status(self): if self.temperature is None: raise exception('Invalid Temperature Value Specified!') if self.temperature < 18: status = 'COLD' elif self.temperature >= 18 and self.temperature < 25: status = 'WARM' else: status = 'HOT' return status def __str__(self): return '%s, %s, %s, %s, %s' % (self.deviceId, self.deviceName, self.temperature, self.location, self.recordDate) try: device_log_object = device_log('D1001', 'Device-X93984', 24, 'Bangalore', '2022-01-01') print(device_log_object) print('Status : %s' % device_log_object.getStatus()) except Exception as error: print('Error Occurred, Details : %s ' % str(error))
class NeighborResult: def __init__(self): self.solutions = [] self.choose_path = [] self.current_num = 0 self.curr_solved_gates = []
class Neighborresult: def __init__(self): self.solutions = [] self.choose_path = [] self.current_num = 0 self.curr_solved_gates = []
''' @brief this class reflect action decision regarding condition ''' class EventAction(): ''' @brief build event action @param cond the conditions to perform the action @param to the target state if any @param job the job to do if any ''' def __init__(self, cond="", to="", job=""): self.__to = to self.__job = job self.__cond = cond ''' @brief get action state target @return state name ''' def getState(self) : return self.__to ''' @brief has transition condition @return true if not empty ''' def hasCond(self) : return ( self.__cond != "" ) ''' @brief get action conditions @return condition ''' def getCond(self) : return self.__cond ''' @brief get action job @return job ''' def getJob(self) : return self.__job ''' @brief string represtation for state action @return the string ''' def __str__(self): return "Act( %s, %s, %s )"%(self.__to, self.__job, self.__cond) ''' @brief this class reflect the output switch on event received regarding condition and action to perform ''' class EventCase(): ''' @brief build event case @param event the event title ''' def __init__(self, event): self.__event = event self.__acts = [] ''' @brief get iterator ''' def __iter__(self): return iter(self.__acts) ''' @brief equality implementation @param other the other element to compare with ''' def __eq__(self, other): if isinstance(other, str): return self.__event == other if not isinstance(other, EventCase): return False if self.__event != other.getEvent(): return False return True ''' @brief get action event @return event ''' def getEvent(self) : return self.__event ''' @brief add action @param act the new action ''' def addAct(self, act) : if act not in self.__acts: self.__acts.append(act) ''' @brief string represtation for state action @return the string ''' def __str__(self): output = "Event( %s ) { "%self.__event if len(self.__acts): output += "\n" for act in self.__acts: output += "%s\n"%str(act) return output + "}" ''' @brief this class store all event case for a state ''' class EventCaseList(): ''' @brief build event case list ''' def __init__(self): self.__events = [] ''' @brief get iterator ''' def __iter__(self): return iter(self.__events) ''' @brief append from StateAction @param act the state action ''' def append(self, act): for cond in act.getConds(): evt = None a = EventAction(cond=cond.getCond(),\ to=act.getState(),\ job=act.getJob()) for e in self.__events: if e == cond.getEvent(): evt = e break if not evt: evt = EventCase(cond.getEvent()) self.__events.append(evt) evt.addAct(a) ''' @brief append from State @param state the state ''' def appendState(self, state): for act in state.getActions(): self.append(act) ''' @brief string represtation for state action @return the string ''' def __str__(self): output = "{ " if len(self.__events): output += "\n" for e in self.__events: output += "%s\n"%str(e) return output + "}"
""" @brief this class reflect action decision regarding condition """ class Eventaction: """ @brief build event action @param cond the conditions to perform the action @param to the target state if any @param job the job to do if any """ def __init__(self, cond='', to='', job=''): self.__to = to self.__job = job self.__cond = cond '\n @brief get action state target\n @return state name\n ' def get_state(self): return self.__to '\n @brief has transition condition\n @return true if not empty\n ' def has_cond(self): return self.__cond != '' '\n @brief get action conditions\n @return condition\n ' def get_cond(self): return self.__cond '\n @brief get action job\n @return job\n ' def get_job(self): return self.__job '\n @brief string represtation for state action\n @return the string\n ' def __str__(self): return 'Act( %s, %s, %s )' % (self.__to, self.__job, self.__cond) '\n @brief this class reflect the output switch on event received regarding condition and action to perform\n' class Eventcase: """ @brief build event case @param event the event title """ def __init__(self, event): self.__event = event self.__acts = [] '\n @brief get iterator\n ' def __iter__(self): return iter(self.__acts) '\n @brief equality implementation\n @param other the other element to compare with\n ' def __eq__(self, other): if isinstance(other, str): return self.__event == other if not isinstance(other, EventCase): return False if self.__event != other.getEvent(): return False return True '\n @brief get action event\n @return event\n ' def get_event(self): return self.__event '\n @brief add action \n @param act the new action\n ' def add_act(self, act): if act not in self.__acts: self.__acts.append(act) '\n @brief string represtation for state action\n @return the string\n ' def __str__(self): output = 'Event( %s ) { ' % self.__event if len(self.__acts): output += '\n' for act in self.__acts: output += '%s\n' % str(act) return output + '}' '\n @brief this class store all event case for a state\n' class Eventcaselist: """ @brief build event case list """ def __init__(self): self.__events = [] '\n @brief get iterator\n ' def __iter__(self): return iter(self.__events) '\n @brief append from StateAction\n @param act the state action\n ' def append(self, act): for cond in act.getConds(): evt = None a = event_action(cond=cond.getCond(), to=act.getState(), job=act.getJob()) for e in self.__events: if e == cond.getEvent(): evt = e break if not evt: evt = event_case(cond.getEvent()) self.__events.append(evt) evt.addAct(a) '\n @brief append from State\n @param state the state\n ' def append_state(self, state): for act in state.getActions(): self.append(act) '\n @brief string represtation for state action\n @return the string\n ' def __str__(self): output = '{ ' if len(self.__events): output += '\n' for e in self.__events: output += '%s\n' % str(e) return output + '}'
age = int(input("How old are you ?")) #if age >= 16 and age <= 65: #if 16 <= age <= 65: if age in range(16,66): print ("Have a good day at work.") elif age > 100 or age <= 0: print ("Nice Try. This program is not dumb.") endkey = input ("Press enter to exit") else: print (f"Enjoy your free time, you need to work for us after {65 - age} years.") print ("-"*80)
age = int(input('How old are you ?')) if age in range(16, 66): print('Have a good day at work.') elif age > 100 or age <= 0: print('Nice Try. This program is not dumb.') endkey = input('Press enter to exit') else: print(f'Enjoy your free time, you need to work for us after {65 - age} years.') print('-' * 80)
class Solution: def longestPalindrome(self, s: str) -> int: d = {} for c in s: if c not in d: d[c] = 1 else: d[c] = d[c] + 1 res = 0 for _, n in d.items(): res += n - (n & 1) return res + 1 if res < len(s) else res s = Solution() s.longestPalindrome("ccd")
class Solution: def longest_palindrome(self, s: str) -> int: d = {} for c in s: if c not in d: d[c] = 1 else: d[c] = d[c] + 1 res = 0 for (_, n) in d.items(): res += n - (n & 1) return res + 1 if res < len(s) else res s = solution() s.longestPalindrome('ccd')
# OpenWeatherMap API Key weather_api_key = "f4695ec49ac558195fc591f0d450c34c" # Google API Key g_key = "AIzaSyAyIq5hhFN-Y0M16Ltie3YuwpDiKWx8tCk"
weather_api_key = 'f4695ec49ac558195fc591f0d450c34c' g_key = 'AIzaSyAyIq5hhFN-Y0M16Ltie3YuwpDiKWx8tCk'
class ArgumentError(Exception): def __init__(self, argument_name: str, *args) -> None: super().__init__(*args) self.argument_name = argument_name @property def argument_name(self) -> str: return self.__argument_name @argument_name.setter def argument_name(self, value: str) -> None: self.__argument_name = value def __str__(self) -> str: return f"{super().__str__()}\nArgument name: {self.argument_name}"
class Argumenterror(Exception): def __init__(self, argument_name: str, *args) -> None: super().__init__(*args) self.argument_name = argument_name @property def argument_name(self) -> str: return self.__argument_name @argument_name.setter def argument_name(self, value: str) -> None: self.__argument_name = value def __str__(self) -> str: return f'{super().__str__()}\nArgument name: {self.argument_name}'
BOT_NAME = "placement" SPIDER_MODULES = ["placement.spiders"] NEWSPIDER_MODULE = "placement.spiders" ROBOTSTXT_OBEY = True CONCURRENT_REQUESTS = 16 DUPEFILTER_DEBUG = True EXTENSIONS = {"spidermon.contrib.scrapy.extensions.Spidermon": 500} SPIDERMON_ENABLED = True ITEM_PIPELINES = {"spidermon.contrib.scrapy.pipelines.ItemValidationPipeline": 800} SPIDERMON_VALIDATION_CERBERUS = ["/home/vipulgupta2048/placement/placement/schema.json"] USER_AGENT = "Vipul Gupta - placement ([email protected])"
bot_name = 'placement' spider_modules = ['placement.spiders'] newspider_module = 'placement.spiders' robotstxt_obey = True concurrent_requests = 16 dupefilter_debug = True extensions = {'spidermon.contrib.scrapy.extensions.Spidermon': 500} spidermon_enabled = True item_pipelines = {'spidermon.contrib.scrapy.pipelines.ItemValidationPipeline': 800} spidermon_validation_cerberus = ['/home/vipulgupta2048/placement/placement/schema.json'] user_agent = 'Vipul Gupta - placement ([email protected])'
def star_pattern(n): for i in range(n): for j in range(i+1): print("*",end=" ") print() star_pattern(5) ''' star_pattern(5) * * * * * * * * * * * * * * * '''
def star_pattern(n): for i in range(n): for j in range(i + 1): print('*', end=' ') print() star_pattern(5) '\n star_pattern(5)\n *\n * *\n * * *\n * * * *\n * * * * *\n '
# 1461. Check If a String Contains All Binary Codes of Size K # User Accepted:2806 # User Tried:4007 # Total Accepted:2876 # Total Submissions:9725 # Difficulty:Medium # Given a binary string s and an integer k. # Return True if any binary code of length k is a substring of s. Otherwise, return False. # Example 1: # Input: s = "00110110", k = 2 # Output: true # Explanation: The binary codes of length 2 are "00", "01", "10" and "11". # They can be all found as substrings at indicies 0, 1, 3 and 2 respectively. # Example 2: # Input: s = "00110", k = 2 # Output: true # Example 3: # Input: s = "0110", k = 1 # Output: true # Explanation: The binary codes of length 1 are "0" and "1", it is clear that both exist as a substring. # Example 4: # Input: s = "0110", k = 2 # Output: false # Explanation: The binary code "00" is of length 2 and doesn't exist in the array. # Example 5: # Input: s = "0000000001011100", k = 4 # Output: false # Constraints: # 1 <= s.length <= 5 * 10^5 # s consists of 0's and 1's only. # 1 <= k <= 20 class Solution: def hasAllCodes(self, s: str, k: int) -> bool: for i in range(2**k): tmp = str(bin(i))[2:] if len(tmp) < k: tmp = '0' * (k-len(tmp)) + tmp if tmp in s: # print('fuck') continue else: return False return True # Redo rec = set() tmp = 0 for i in range(len(s)): tmp = tmp * 2 + int(s[i]) if i >= k: tmp -= int(s[i-k]) << k if i >= k-1: rec.add(tmp) return len(rec) == (1<<k)
class Solution: def has_all_codes(self, s: str, k: int) -> bool: for i in range(2 ** k): tmp = str(bin(i))[2:] if len(tmp) < k: tmp = '0' * (k - len(tmp)) + tmp if tmp in s: continue else: return False return True rec = set() tmp = 0 for i in range(len(s)): tmp = tmp * 2 + int(s[i]) if i >= k: tmp -= int(s[i - k]) << k if i >= k - 1: rec.add(tmp) return len(rec) == 1 << k
n = int(input()) v = [] for i in range(n): v.append(int(input())) s = sorted(set(v)) for i in s: print(f'{i} aparece {v.count(i)} vez (es)')
n = int(input()) v = [] for i in range(n): v.append(int(input())) s = sorted(set(v)) for i in s: print(f'{i} aparece {v.count(i)} vez (es)')
expected_output = { "vrf": { "VRF1": { "address_family": { "ipv4": { "instance": { "1": { "areas": { "0.0.0.1": { "sham_links": { "10.21.33.33 10.151.22.22": { "cost": 111, "dcbitless_lsa_count": 1, "donotage_lsa": "not allowed", "dead_interval": 13, "demand_circuit": True, "hello_interval": 3, "hello_timer": "00:00:00:772", "if_index": 2, "local_id": "10.21.33.33", "name": "SL0", "link_state": "up", "remote_id": "10.151.22.22", "retransmit_interval": 5, "state": "point-to-point,", "transit_area_id": "0.0.0.1", "transmit_delay": 7, "wait_interval": 13, } } } } } } } } } } }
expected_output = {'vrf': {'VRF1': {'address_family': {'ipv4': {'instance': {'1': {'areas': {'0.0.0.1': {'sham_links': {'10.21.33.33 10.151.22.22': {'cost': 111, 'dcbitless_lsa_count': 1, 'donotage_lsa': 'not allowed', 'dead_interval': 13, 'demand_circuit': True, 'hello_interval': 3, 'hello_timer': '00:00:00:772', 'if_index': 2, 'local_id': '10.21.33.33', 'name': 'SL0', 'link_state': 'up', 'remote_id': '10.151.22.22', 'retransmit_interval': 5, 'state': 'point-to-point,', 'transit_area_id': '0.0.0.1', 'transmit_delay': 7, 'wait_interval': 13}}}}}}}}}}}
pkgname = "cargo-bootstrap" pkgver = "1.60.0" pkgrel = 0 # satisfy runtime dependencies hostmakedepends = ["curl"] depends = ["!cargo"] pkgdesc = "Bootstrap binaries of Rust package manager" maintainer = "q66 <[email protected]>" license = "MIT OR Apache-2.0" url = "https://rust-lang.org" source = f"https://ftp.octaforge.org/chimera/distfiles/cargo-{pkgver}-{self.profile().triplet}.tar.xz" options = ["!strip"] match self.profile().arch: case "ppc64le": sha256 = "29d19c5015d97c862af365cda33339619fb23ae9a2ae2ea5290765604f99e47d" case "x86_64": sha256 = "07ab0bdeaf14f31fe07e40f2b3a9a6ae18a4b61579c8b6fa22ecd684054a81af" case _: broken = f"not yet built for {self.profile().arch}" def do_install(self): self.install_bin("cargo") self.install_license("LICENSE-APACHE") self.install_license("LICENSE-MIT") self.install_license("LICENSE-THIRD-PARTY")
pkgname = 'cargo-bootstrap' pkgver = '1.60.0' pkgrel = 0 hostmakedepends = ['curl'] depends = ['!cargo'] pkgdesc = 'Bootstrap binaries of Rust package manager' maintainer = 'q66 <[email protected]>' license = 'MIT OR Apache-2.0' url = 'https://rust-lang.org' source = f'https://ftp.octaforge.org/chimera/distfiles/cargo-{pkgver}-{self.profile().triplet}.tar.xz' options = ['!strip'] match self.profile().arch: case 'ppc64le': sha256 = '29d19c5015d97c862af365cda33339619fb23ae9a2ae2ea5290765604f99e47d' case 'x86_64': sha256 = '07ab0bdeaf14f31fe07e40f2b3a9a6ae18a4b61579c8b6fa22ecd684054a81af' case _: broken = f'not yet built for {self.profile().arch}' def do_install(self): self.install_bin('cargo') self.install_license('LICENSE-APACHE') self.install_license('LICENSE-MIT') self.install_license('LICENSE-THIRD-PARTY')
# m=wrf_hydro_ens_sim.members[0] # dir(m) # Change restart frequency to hourly in hydro namelist att_tuple = ('base_hydro_namelist', 'hydro_nlist', 'rst_dt') # The values can be a scalar (uniform across the ensemble) or a list of length N (ensemble size). values = 60 wrf_hydro_ens_sim.set_member_diffs(att_tuple, values) wrf_hydro_ens_sim.member_diffs # wont report any values uniform across the ensemble # but this will: [mm.base_hydro_namelist['hydro_nlist']['rst_dt'] for mm in wrf_hydro_ens_sim.members] # Change restart frequency to hourly in hrldas namelist att_tuple = ('base_hrldas_namelist', 'noahlsm_offline', 'restart_frequency_hours') values = 1 wrf_hydro_ens_sim.set_member_diffs(att_tuple, values) [mm.base_hrldas_namelist['noahlsm_offline']['restart_frequency_hours'] for mm in wrf_hydro_ens_sim.members] # There are multiple restart files in the domain and the default is on 2018-06-01 # Change restart frequency to hourly in hydro namelist. # att_tuple = ('base_hydro_namelist', 'hydro_nlist', 'restart_file') # values = '/glade/work/jamesmcc/domains/public/croton_NY/Gridded/RESTART/HYDRO_RST.2011-08-26_00:00_DOMAIN1' # wrf_hydro_ens_sim.set_member_diffs(att_tuple, values) # att_tuple = ('base_hrldas_namelist', 'noahlsm_offline', 'restart_filename_requested') # values = '/glade/work/jamesmcc/domains/public/croton_NY/Gridded/RESTART/RESTART.2011082600_DOMAIN1' # wrf_hydro_ens_sim.set_member_diffs(att_tuple, values) # Change model advance to 1 hour in hrldas namelist # This is governed by the configuration namelist setting: # run_experiment: time: advance_model_hours: # No other differences across the ensemble, only the FORCING dir for each # will be set at run time by the noise_model. # We could to parameter differences here.
att_tuple = ('base_hydro_namelist', 'hydro_nlist', 'rst_dt') values = 60 wrf_hydro_ens_sim.set_member_diffs(att_tuple, values) wrf_hydro_ens_sim.member_diffs [mm.base_hydro_namelist['hydro_nlist']['rst_dt'] for mm in wrf_hydro_ens_sim.members] att_tuple = ('base_hrldas_namelist', 'noahlsm_offline', 'restart_frequency_hours') values = 1 wrf_hydro_ens_sim.set_member_diffs(att_tuple, values) [mm.base_hrldas_namelist['noahlsm_offline']['restart_frequency_hours'] for mm in wrf_hydro_ens_sim.members]
def main () : i = 1 fib = 1 target = 10 temp = 0 while (i < target) : temp = fib fib += temp i+=1 print(fib) return 0 if __name__ == '__main__': main()
def main(): i = 1 fib = 1 target = 10 temp = 0 while i < target: temp = fib fib += temp i += 1 print(fib) return 0 if __name__ == '__main__': main()
class Solution: def findContentChildren(self, g: List[int], s: List[int]) -> int: g.sort() s.sort() greed_p = 0 size_p = 0 count = 0 while greed_p < len(g) and size_p < len(s): if g[greed_p] <= s[size_p]: count += 1 greed_p += 1 size_p += 1 elif g[greed_p] > s[size_p]: size_p += 1 return count
class Solution: def find_content_children(self, g: List[int], s: List[int]) -> int: g.sort() s.sort() greed_p = 0 size_p = 0 count = 0 while greed_p < len(g) and size_p < len(s): if g[greed_p] <= s[size_p]: count += 1 greed_p += 1 size_p += 1 elif g[greed_p] > s[size_p]: size_p += 1 return count
data = { "publication-date": { "year": { "value": "2020"}, "month": {"value": "01"}}, "short-description": "With a central surface brightness of 29.3 mag arcsec, and half-light radius of r_half=3.1^{+0.9}_{-1.1} kpc, Andromeda XIX (And XIX) is an extremely diffuse satellite of Andromeda.", "external-ids": { "external-id": [ { "external-id-type": "bibcode", "external-id-value": "2020MNRAS.491.3496C", "external-id-relationship": "SELF" }, { "external-id-type": "doi", "external-id-value": "10.1093/mnras/stz3252", "external-id-relationship": "SELF" }, { "external-id-type": "arxiv", "external-id-value": "1910.12879", "external-id-relationship": "SELF" } ] }, "journal-title": { "value": "Monthly Notices of the Royal Astronomical Society" }, "type": "JOURNAL_ARTICLE", "contributors": { "contributor": [ { "credit-name": { "value": "Collins, Michelle L. M." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Tollerud, Erik J." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Rich, R. Michael" }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Ibata, Rodrigo A." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Martin, Nicolas F." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Chapman, Scott C." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Gilbert, Karoline M." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Preston, Janet" }, "contributor-attributes": { "contributor-role": "AUTHOR" } } ] }, "title": { "title": { "value": "A detailed study of Andromeda XIX, an extreme local analogue of ultradiffuse galaxies" } }, "put-code": 63945135 } data_noarxiv = { "publication-date": { "year": { "value": "2020"}, "month": {"value": "01"}}, "short-description": "With a central surface brightness of 29.3 mag arcsec, and half-light radius of r_half=3.1^{+0.9}_{-1.1} kpc, Andromeda XIX (And XIX) is an extremely diffuse satellite of Andromeda.", "external-ids": { "external-id": [ { "external-id-type": "bibcode", "external-id-value": "2020MNRAS.491.3496C", "external-id-relationship": "SELF" }, { "external-id-type": "doi", "external-id-value": "10.1093/mnras/stz3252", "external-id-relationship": "SELF" } ] }, "journal-title": { "value": "Monthly Notices of the Royal Astronomical Society" }, "type": "JOURNAL_ARTICLE", "contributors": { "contributor": [ { "credit-name": { "value": "Collins, Michelle L. M." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Tollerud, Erik J." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Rich, R. Michael" }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Ibata, Rodrigo A." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Martin, Nicolas F." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Chapman, Scott C." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Gilbert, Karoline M." }, "contributor-attributes": { "contributor-role": "AUTHOR" } }, { "credit-name": { "value": "Preston, Janet" }, "contributor-attributes": { "contributor-role": "AUTHOR" } } ] }, "title": { "title": { "value": "A detailed study of Andromeda XIX, an extreme local analogue of ultradiffuse galaxies" } }, "put-code": 63945135 }
data = {'publication-date': {'year': {'value': '2020'}, 'month': {'value': '01'}}, 'short-description': 'With a central surface brightness of 29.3 mag arcsec, and half-light radius of r_half=3.1^{+0.9}_{-1.1} kpc, Andromeda XIX (And XIX) is an extremely diffuse satellite of Andromeda.', 'external-ids': {'external-id': [{'external-id-type': 'bibcode', 'external-id-value': '2020MNRAS.491.3496C', 'external-id-relationship': 'SELF'}, {'external-id-type': 'doi', 'external-id-value': '10.1093/mnras/stz3252', 'external-id-relationship': 'SELF'}, {'external-id-type': 'arxiv', 'external-id-value': '1910.12879', 'external-id-relationship': 'SELF'}]}, 'journal-title': {'value': 'Monthly Notices of the Royal Astronomical Society'}, 'type': 'JOURNAL_ARTICLE', 'contributors': {'contributor': [{'credit-name': {'value': 'Collins, Michelle L. M.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Tollerud, Erik J.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Rich, R. Michael'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Ibata, Rodrigo A.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Martin, Nicolas F.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Chapman, Scott C.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Gilbert, Karoline M.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Preston, Janet'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}]}, 'title': {'title': {'value': 'A detailed study of Andromeda XIX, an extreme local analogue of ultradiffuse galaxies'}}, 'put-code': 63945135} data_noarxiv = {'publication-date': {'year': {'value': '2020'}, 'month': {'value': '01'}}, 'short-description': 'With a central surface brightness of 29.3 mag arcsec, and half-light radius of r_half=3.1^{+0.9}_{-1.1} kpc, Andromeda XIX (And XIX) is an extremely diffuse satellite of Andromeda.', 'external-ids': {'external-id': [{'external-id-type': 'bibcode', 'external-id-value': '2020MNRAS.491.3496C', 'external-id-relationship': 'SELF'}, {'external-id-type': 'doi', 'external-id-value': '10.1093/mnras/stz3252', 'external-id-relationship': 'SELF'}]}, 'journal-title': {'value': 'Monthly Notices of the Royal Astronomical Society'}, 'type': 'JOURNAL_ARTICLE', 'contributors': {'contributor': [{'credit-name': {'value': 'Collins, Michelle L. M.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Tollerud, Erik J.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Rich, R. Michael'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Ibata, Rodrigo A.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Martin, Nicolas F.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Chapman, Scott C.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Gilbert, Karoline M.'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}, {'credit-name': {'value': 'Preston, Janet'}, 'contributor-attributes': {'contributor-role': 'AUTHOR'}}]}, 'title': {'title': {'value': 'A detailed study of Andromeda XIX, an extreme local analogue of ultradiffuse galaxies'}}, 'put-code': 63945135}
# This is a sample Python script. def test_print_hi(): assert True
def test_print_hi(): assert True
hours = input('Enter Hours \n') rate = input('Enter Rate\n') hours = int(hours) rate = float(rate) if (hours <= 40): pay = rate*hours else: extra_time = hours - 40 pay = (rate*hours) + ((rate*extra_time)/2) print('Pay: ', pay)
hours = input('Enter Hours \n') rate = input('Enter Rate\n') hours = int(hours) rate = float(rate) if hours <= 40: pay = rate * hours else: extra_time = hours - 40 pay = rate * hours + rate * extra_time / 2 print('Pay: ', pay)
def get_schema(): return { 'type': 'object', 'properties': { 'connections': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'path': {'type': 'string'}, 'driver': {'type': 'string'}, 'server': {'type': 'string'}, 'database': {'type': 'string'}, 'name_col': {'type': 'string'}, 'text_col': {'type': 'string'}, } } }, 'documents': {'type': 'array', 'items': {'$ref': '#/definitions/document'}}, 'irr_documents': {'type': 'array', 'items': {'$ref': '#/definitions/document'}}, 'labels': {'type': 'array', 'items': {'type': 'string'}}, 'highlights': {'type': 'array', 'items': {'type': 'string'}}, 'project': {'type': 'string'}, 'subproject': {'type': 'string'}, 'start_date': {'type': 'string'}, 'end_date': {'type': 'string'}, 'annotation': { 'type': 'object', 'properties': { 'irr_percent': {'type': 'number'}, 'irr_count': {'type': 'integer'}, 'annotators': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'number': {'type': 'integer'}, 'percent': {'type': 'number', 'maximum': 1.0, 'minimum': 0.0}, 'documents': {'type': 'array', 'items': {'$ref': '#/definitions/document'}}, }, }, }, }, } }, 'definitions': { 'document': { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'metadata': {'type': 'object'}, 'text': {'type': 'string'}, 'offsets': {'type': 'array', 'items': {'$ref': '#/definitions/offset'}}, 'highlights': {'type': 'array', 'items': {'type': 'string'}}, 'expiration_date': {'type': 'string'}, } }, 'offset': { 'type': 'object', 'properties': { 'start': {'type': 'integer', 'minimum': 0}, 'end': {'type': 'integer', 'minimum': 0} } }, } }
def get_schema(): return {'type': 'object', 'properties': {'connections': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'path': {'type': 'string'}, 'driver': {'type': 'string'}, 'server': {'type': 'string'}, 'database': {'type': 'string'}, 'name_col': {'type': 'string'}, 'text_col': {'type': 'string'}}}}, 'documents': {'type': 'array', 'items': {'$ref': '#/definitions/document'}}, 'irr_documents': {'type': 'array', 'items': {'$ref': '#/definitions/document'}}, 'labels': {'type': 'array', 'items': {'type': 'string'}}, 'highlights': {'type': 'array', 'items': {'type': 'string'}}, 'project': {'type': 'string'}, 'subproject': {'type': 'string'}, 'start_date': {'type': 'string'}, 'end_date': {'type': 'string'}, 'annotation': {'type': 'object', 'properties': {'irr_percent': {'type': 'number'}, 'irr_count': {'type': 'integer'}, 'annotators': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'number': {'type': 'integer'}, 'percent': {'type': 'number', 'maximum': 1.0, 'minimum': 0.0}, 'documents': {'type': 'array', 'items': {'$ref': '#/definitions/document'}}}}}}}}, 'definitions': {'document': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'metadata': {'type': 'object'}, 'text': {'type': 'string'}, 'offsets': {'type': 'array', 'items': {'$ref': '#/definitions/offset'}}, 'highlights': {'type': 'array', 'items': {'type': 'string'}}, 'expiration_date': {'type': 'string'}}}, 'offset': {'type': 'object', 'properties': {'start': {'type': 'integer', 'minimum': 0}, 'end': {'type': 'integer', 'minimum': 0}}}}}
def main(): mainFile = open("index.html", 'r', encoding='utf-8') writeFile = open("index_pasted.html", 'w+', encoding='utf-8') classId = 'class="internal"' cssId = '<link rel=' for line in mainFile: if (classId in line): pasteScript(line, writeFile) elif (cssId in line): pasteCSS(line, writeFile) else: writeFile.write(line) writeFile.close() def pasteCSS(line, writeFile): filename = line.split('"')[-2] importFile = open(filename, 'r', encoding='utf-8') writeFile.write("<style>\n") for row in importFile: writeFile.write(row) writeFile.write("</style>\n") def pasteScript(line, writeFile): filename = line.strip().split(" ")[3].split('"')[1] importFile = open(filename, 'r', encoding='utf-8') writeFile.write("<script>\n") for row in importFile: writeFile.write(row) writeFile.write("</script>\n") main()
def main(): main_file = open('index.html', 'r', encoding='utf-8') write_file = open('index_pasted.html', 'w+', encoding='utf-8') class_id = 'class="internal"' css_id = '<link rel=' for line in mainFile: if classId in line: paste_script(line, writeFile) elif cssId in line: paste_css(line, writeFile) else: writeFile.write(line) writeFile.close() def paste_css(line, writeFile): filename = line.split('"')[-2] import_file = open(filename, 'r', encoding='utf-8') writeFile.write('<style>\n') for row in importFile: writeFile.write(row) writeFile.write('</style>\n') def paste_script(line, writeFile): filename = line.strip().split(' ')[3].split('"')[1] import_file = open(filename, 'r', encoding='utf-8') writeFile.write('<script>\n') for row in importFile: writeFile.write(row) writeFile.write('</script>\n') main()
def main(): seed = 0x1234 e = [0x62d5, 0x7b27, 0xc5d4, 0x11c4, 0x5d67, 0xa356, 0x5f84, 0xbd67, 0xad04, 0x9a64, 0xefa6, 0x94d6, 0x2434, 0x0178] flag = "" for index in range(14): for i in range(0x7f-0x20): c = chr(0x20+i) res = encode(c, index, seed) if res == e[index]: print(c) flag += c seed = encode(c, index, seed) print("Kosen{%s}" % flag) def encode(p1, p2, p3): p1 = ord(p1) & 0xff p2 = p2 & 0xffffffff p3 = p3 & 0xffffffff result = (((p1 >> 4) | (p1 & 0xf) << 4) + 1) ^ ((p2 >> 4) | (~p2 << 4)) & 0xff | (p3 >> 4) << 8 ^ ((p3 >> 0xc) | (p3 << 4)) << 8 return result & 0xffff if __name__ == "__main__": main()
def main(): seed = 4660 e = [25301, 31527, 50644, 4548, 23911, 41814, 24452, 48487, 44292, 39524, 61350, 38102, 9268, 376] flag = '' for index in range(14): for i in range(127 - 32): c = chr(32 + i) res = encode(c, index, seed) if res == e[index]: print(c) flag += c seed = encode(c, index, seed) print('Kosen{%s}' % flag) def encode(p1, p2, p3): p1 = ord(p1) & 255 p2 = p2 & 4294967295 p3 = p3 & 4294967295 result = (p1 >> 4 | (p1 & 15) << 4) + 1 ^ (p2 >> 4 | ~p2 << 4) & 255 | p3 >> 4 << 8 ^ (p3 >> 12 | p3 << 4) << 8 return result & 65535 if __name__ == '__main__': main()
#!/usr/bin/env python3 # -*- coding: utf-8 -*- file1=open('data/u_Lvoid_20.txt',encoding='utf-8') file2=open('temp2/void.txt','w',encoding='utf-8') count=0 for line in file1: count=count+1 if(line[0]=='R'):# 'line' here is a string line_list=line.split( ) # 'line_list' is a list of small strings=['R41_1_2', 'n1_1620161_481040', n1_1620161_480880, 2.8e-05] branch=line_list[0].split('-') #branch is a list of string=['R41','1','2'] branch0=branch[0].split('R')#branch is a list of string=['','41'] branch[0]=branch0[1]#now branch is a list of string=['41','1','2'], which is [layer_id, tree_id, branch_id] for i in range(3): file2.write(str(branch[i])) file2.write(' ') branch1=line_list[1].split('_') for i in range(2): file2.write(str(int(branch1[i+1])/1000)) file2.write(' ') branch3=line_list[3].split('um') a=float(branch3[0]) file2.write(str(a)) file2.write('\n') file1.close() file2.close()
file1 = open('data/u_Lvoid_20.txt', encoding='utf-8') file2 = open('temp2/void.txt', 'w', encoding='utf-8') count = 0 for line in file1: count = count + 1 if line[0] == 'R': line_list = line.split() branch = line_list[0].split('-') branch0 = branch[0].split('R') branch[0] = branch0[1] for i in range(3): file2.write(str(branch[i])) file2.write(' ') branch1 = line_list[1].split('_') for i in range(2): file2.write(str(int(branch1[i + 1]) / 1000)) file2.write(' ') branch3 = line_list[3].split('um') a = float(branch3[0]) file2.write(str(a)) file2.write('\n') file1.close() file2.close()
def climbingLeaderboard(scores, alice): scores = list(reversed(sorted(set(scores)))) r, rank = len(scores), [] for a in alice: while (r > 0) and (a >= scores[r - 1]): r -= 1 rank.append(r + 1) return rank
def climbing_leaderboard(scores, alice): scores = list(reversed(sorted(set(scores)))) (r, rank) = (len(scores), []) for a in alice: while r > 0 and a >= scores[r - 1]: r -= 1 rank.append(r + 1) return rank
screen = { "bg": "blue", "rows": 0, "columns": 0, "columnspan": 4, "padx": 5, "pady": 5, } input = { "bg": "blue", "fg": "red", "fs": "20px", } button = { "bg": "blue", "fg": "red", "fs": "20px", }
screen = {'bg': 'blue', 'rows': 0, 'columns': 0, 'columnspan': 4, 'padx': 5, 'pady': 5} input = {'bg': 'blue', 'fg': 'red', 'fs': '20px'} button = {'bg': 'blue', 'fg': 'red', 'fs': '20px'}
# 3. Single layered 4 inputs and 3 outputs(Looping) mInputs = [3, 4, 1, 2] mWeights = [[0.2, -0.4, 0.6, 0.4], [0.4, 0.3, -0.1, 0.8], [0.7, 0.6, 0.3, -0.3]] mBias1 = [3, 4, 2] layer_output = [] for neuron_weights, neuron_bias in zip(mWeights, mBias1): neuron_output = 0 for n_inputs, n_weights in zip(mInputs, neuron_weights): neuron_output += n_inputs*n_weights neuron_output += neuron_bias layer_output.append(neuron_output) print(layer_output)
m_inputs = [3, 4, 1, 2] m_weights = [[0.2, -0.4, 0.6, 0.4], [0.4, 0.3, -0.1, 0.8], [0.7, 0.6, 0.3, -0.3]] m_bias1 = [3, 4, 2] layer_output = [] for (neuron_weights, neuron_bias) in zip(mWeights, mBias1): neuron_output = 0 for (n_inputs, n_weights) in zip(mInputs, neuron_weights): neuron_output += n_inputs * n_weights neuron_output += neuron_bias layer_output.append(neuron_output) print(layer_output)
# reading 2 numbers from the keyboard and printing maximum value r = int(input("Enter the first number: ")) s = int(input("Enter the second number: ")) x = r if r>s else s print(x)
r = int(input('Enter the first number: ')) s = int(input('Enter the second number: ')) x = r if r > s else s print(x)
def main(): STRING = "aababbabbaaba" compressed = compress(STRING) print(compressed) decompressed = decompress(compressed) print(decompressed) def compress(string): encode = {} # string -> code known = "" count = 0 result = [] for letter in string: if known + letter in encode: known += letter else: count += 1 encode[known + letter] = count result.append([encode[known] if known else 0, letter]) known = "" if known: result.append([encode[known], ""]) return result def decompress(compressed): string = "" decode = {} # code -> string known = "" count = 0 for code, new in compressed: if not code: count += 1 decode[count] = new string += new elif not new: string += decode[code] else: count += 1 known = decode[code] decode[count] = known + new string += known + new return string if __name__ == "__main__": main()
def main(): string = 'aababbabbaaba' compressed = compress(STRING) print(compressed) decompressed = decompress(compressed) print(decompressed) def compress(string): encode = {} known = '' count = 0 result = [] for letter in string: if known + letter in encode: known += letter else: count += 1 encode[known + letter] = count result.append([encode[known] if known else 0, letter]) known = '' if known: result.append([encode[known], '']) return result def decompress(compressed): string = '' decode = {} known = '' count = 0 for (code, new) in compressed: if not code: count += 1 decode[count] = new string += new elif not new: string += decode[code] else: count += 1 known = decode[code] decode[count] = known + new string += known + new return string if __name__ == '__main__': main()
# When one class does the work of two, awkwardness results. class Person: def __init__(self, name, office_area_code, office_number): self.name = name self.office_area_code = office_area_code self.office_number = office_number def telephone_number(self): return "%d-%d" % (self.office_area_code, self.office_number) if __name__=="__main__": p = Person("Mario", 51, 966296636) print(p.name) print(p.telephone_number())
class Person: def __init__(self, name, office_area_code, office_number): self.name = name self.office_area_code = office_area_code self.office_number = office_number def telephone_number(self): return '%d-%d' % (self.office_area_code, self.office_number) if __name__ == '__main__': p = person('Mario', 51, 966296636) print(p.name) print(p.telephone_number())
#!/usr/bin/python # -*- coding: utf-8 -*- class OpenError(StandardError): def __init__(self, error_code, error, error_info): self.error_code = error_code self.error = error self.error_info = error_info StandardError.__init__(self, error) def __str__(self): return 'Error: %s: %s, request: %s' % (self.error_code, self.error, self.error_info)
class Openerror(StandardError): def __init__(self, error_code, error, error_info): self.error_code = error_code self.error = error self.error_info = error_info StandardError.__init__(self, error) def __str__(self): return 'Error: %s: %s, request: %s' % (self.error_code, self.error, self.error_info)
table = 'fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF' tr = {} for i in range(58): tr[table[i]] = i s = [11, 10, 3, 8, 4, 6] xor = 177451812 add = 8728348608 def dec(x): r = 0 for i in range(6): r += tr[x[s[i]]] * 58**i return (r - add) ^ xor def enc(x): x = (x ^ xor) + add r = list('BV1 4 1 7 ') for i in range(6): r[s[i]] = table[x // 58**i % 58] return ''.join(r) print(dec('BV17x411w7KC')) print(dec('BV1Q541167Qg')) print(dec('BV1mK4y1C7Bz')) print(enc(170001)) print(enc(455017605)) print(enc(882584971))
table = 'fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF' tr = {} for i in range(58): tr[table[i]] = i s = [11, 10, 3, 8, 4, 6] xor = 177451812 add = 8728348608 def dec(x): r = 0 for i in range(6): r += tr[x[s[i]]] * 58 ** i return r - add ^ xor def enc(x): x = (x ^ xor) + add r = list('BV1 4 1 7 ') for i in range(6): r[s[i]] = table[x // 58 ** i % 58] return ''.join(r) print(dec('BV17x411w7KC')) print(dec('BV1Q541167Qg')) print(dec('BV1mK4y1C7Bz')) print(enc(170001)) print(enc(455017605)) print(enc(882584971))
# # @lc app=leetcode id=838 lang=python3 # # [838] Push Dominoes # # @lc code=start class Solution: def pushDominoes(self, dominoes: str) -> str: l = 0 ans = [] dominoes = 'L' + dominoes + 'R' for r in range(1, len(dominoes)): if dominoes[r] == '.': continue cnt = r - l - 1 if l > 0: ans.append(dominoes[l]) if dominoes[l] == dominoes[r]: ans.append(dominoes[l] * cnt) elif dominoes[l] == 'L' and dominoes[r] == 'R': ans.append('.' * cnt) else: ans.append('R' * (cnt // 2) + '.' * (cnt % 2) + 'L' * (cnt // 2)) l = r return ''.join(ans) if __name__ == '__main__': a = Solution() b = a.pushDominoes(".L.R...LR..L..") print(b) # @lc code=end
class Solution: def push_dominoes(self, dominoes: str) -> str: l = 0 ans = [] dominoes = 'L' + dominoes + 'R' for r in range(1, len(dominoes)): if dominoes[r] == '.': continue cnt = r - l - 1 if l > 0: ans.append(dominoes[l]) if dominoes[l] == dominoes[r]: ans.append(dominoes[l] * cnt) elif dominoes[l] == 'L' and dominoes[r] == 'R': ans.append('.' * cnt) else: ans.append('R' * (cnt // 2) + '.' * (cnt % 2) + 'L' * (cnt // 2)) l = r return ''.join(ans) if __name__ == '__main__': a = solution() b = a.pushDominoes('.L.R...LR..L..') print(b)
class Node: def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right def count_univals(node): if node.right is None and node.left is None: return node.val, True, 1 l_val, l_is_unival, l_univals = count_univals(node.left) r_val, r_is_unival, r_univals = count_univals(node.right) return ( node.val, l_val == r_val and l_val == node.val and l_is_unival and r_is_unival, l_univals + r_univals + (l_val == r_val and l_val == node.val and l_is_unival and r_is_unival) ) if __name__ == "__main__": root = Node(0, Node(1), Node(0, Node(1, Node(1, Node(1), Node(1) ), Node(1, Node(0), Node(1) ) ), Node(0) ) ) _, _, univals = count_univals(root) print(f"univals = {univals}")
class Node: def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right def count_univals(node): if node.right is None and node.left is None: return (node.val, True, 1) (l_val, l_is_unival, l_univals) = count_univals(node.left) (r_val, r_is_unival, r_univals) = count_univals(node.right) return (node.val, l_val == r_val and l_val == node.val and l_is_unival and r_is_unival, l_univals + r_univals + (l_val == r_val and l_val == node.val and l_is_unival and r_is_unival)) if __name__ == '__main__': root = node(0, node(1), node(0, node(1, node(1, node(1), node(1)), node(1, node(0), node(1))), node(0))) (_, _, univals) = count_univals(root) print(f'univals = {univals}')
# Python Tuples # Ordered, Immutable collection of items which allows Duplicate Members # We can put the data, which will not change throughout the program, in a Tuple # Tuples can be called as "Immutable Python Lists" or "Constant Python Lists" employeeTuple = ("Sam", "Sam" "Mike", "John", "Harry", "Tom", "Sean", "Justin") # to check the variable type print(type(employeeTuple)) # to check whether the type is "Tuple" or not print(isinstance(employeeTuple, tuple)) # to print all the elements in the Tuple for employeeName in employeeTuple: print("Employee: " + employeeName) print("**********************************************************") # Other functions # to display an element using index print(employeeTuple[0]) # to display the length of the Tuple print(len(employeeTuple)) # employeeTuple[2] = "David" # This will throw a TypeError since Tuple cannot be modified print(employeeTuple) print("**********************************************************") # we can use the tuple() constructor to create a tuple employeeName2 = tuple(("Richard", "Henry", "Brian")) print(employeeName2) # we can also omit the use of brackets to create a tuple employeeName3 = "David", "Michael", "Shaun" print(employeeName3) print(type(employeeName3)) print("**********************************************************") # Difference between a Tuple and a String myStr = ("Sam") # This is a String print(type(myStr)) # This is a Tuple (for a Tuple, comma is mandatory) with one item myTuple1 = ("Sam",) print(type(myTuple1)) print(len(myTuple1)) # This is an empty Tuple myTuple2 = () print(type(myTuple2)) print(len(myTuple2)) print("**********************************************************") # Value Swapping using Tuple myNumber1 = 2 myNumber2 = 3 myNumber1, myNumber2 = myNumber2, myNumber1 print(myNumber1) print(myNumber2) print("**********************************************************") # Nested Tuples employeeName4 = employeeName3, ("Raj", "Vinith") print(employeeName4) print("**********************************************************") # Tuple Sequence Packing packed_tuple = 1, 2, "Python" print(packed_tuple) # Tuple Sequence Unpacking number1, number2, string1 = packed_tuple print(number1) print(number2) print(string1) print("**********************************************************")
employee_tuple = ('Sam', 'SamMike', 'John', 'Harry', 'Tom', 'Sean', 'Justin') print(type(employeeTuple)) print(isinstance(employeeTuple, tuple)) for employee_name in employeeTuple: print('Employee: ' + employeeName) print('**********************************************************') print(employeeTuple[0]) print(len(employeeTuple)) print(employeeTuple) print('**********************************************************') employee_name2 = tuple(('Richard', 'Henry', 'Brian')) print(employeeName2) employee_name3 = ('David', 'Michael', 'Shaun') print(employeeName3) print(type(employeeName3)) print('**********************************************************') my_str = 'Sam' print(type(myStr)) my_tuple1 = ('Sam',) print(type(myTuple1)) print(len(myTuple1)) my_tuple2 = () print(type(myTuple2)) print(len(myTuple2)) print('**********************************************************') my_number1 = 2 my_number2 = 3 (my_number1, my_number2) = (myNumber2, myNumber1) print(myNumber1) print(myNumber2) print('**********************************************************') employee_name4 = (employeeName3, ('Raj', 'Vinith')) print(employeeName4) print('**********************************************************') packed_tuple = (1, 2, 'Python') print(packed_tuple) (number1, number2, string1) = packed_tuple print(number1) print(number2) print(string1) print('**********************************************************')
# automatically generated by the FlatBuffers compiler, do not modify # namespace: tflite class BuiltinOperator(object): ADD = 0 AVERAGE_POOL_2D = 1 CONCATENATION = 2 CONV_2D = 3 DEPTHWISE_CONV_2D = 4 EMBEDDING_LOOKUP = 7 FULLY_CONNECTED = 9 HASHTABLE_LOOKUP = 10 L2_NORMALIZATION = 11 L2_POOL_2D = 12 LOCAL_RESPONSE_NORMALIZATION = 13 LOGISTIC = 14 LSH_PROJECTION = 15 LSTM = 16 MAX_POOL_2D = 17 RELU = 19 RELU6 = 21 RESHAPE = 22 RESIZE_BILINEAR = 23 RNN = 24 SOFTMAX = 25 SPACE_TO_DEPTH = 26 SVDF = 27 TANH = 28 CONCAT_EMBEDDINGS = 29 SKIP_GRAM = 30 CALL = 31 CUSTOM = 32
class Builtinoperator(object): add = 0 average_pool_2_d = 1 concatenation = 2 conv_2_d = 3 depthwise_conv_2_d = 4 embedding_lookup = 7 fully_connected = 9 hashtable_lookup = 10 l2_normalization = 11 l2_pool_2_d = 12 local_response_normalization = 13 logistic = 14 lsh_projection = 15 lstm = 16 max_pool_2_d = 17 relu = 19 relu6 = 21 reshape = 22 resize_bilinear = 23 rnn = 24 softmax = 25 space_to_depth = 26 svdf = 27 tanh = 28 concat_embeddings = 29 skip_gram = 30 call = 31 custom = 32
class Table(object): def __init__(self, name): self.name = name self.columns = [] def createColumn(self, column): self.columns.append(column) def readColumn(self, name): for value in self.columns: if value.name == name: return value def updateColumn(self, name, column): for i in range(0,len(self.columns)): if self.columns[i].name == name: self.columns[i] = column break def deleteColumn(self, name): for i in range(0, len(self.columns)): if self.columns[i].name == name: del self.columns[i] break
class Table(object): def __init__(self, name): self.name = name self.columns = [] def create_column(self, column): self.columns.append(column) def read_column(self, name): for value in self.columns: if value.name == name: return value def update_column(self, name, column): for i in range(0, len(self.columns)): if self.columns[i].name == name: self.columns[i] = column break def delete_column(self, name): for i in range(0, len(self.columns)): if self.columns[i].name == name: del self.columns[i] break
class Config: api_host = "https://api.frame.io" default_page_size = 50 default_concurrency = 5
class Config: api_host = 'https://api.frame.io' default_page_size = 50 default_concurrency = 5
# Introductory examples name = 'Maurizio' surname = 'Petrelli' print('-------------------------------------------------') print('My name is {}'.format(name)) print('-------------------------------------------------') print('My name is {} and my surname is {}'.format(name, surname)) print('-------------------------------------------------') # Decimal Number formatting PI = 3.14159265358979323846 print('----------------------------------------------------') print("The 2 digit Archimedes' constant is equal to {:.2f}".format(PI)) print("The 3 digit Archimedes' constant is equal to {:.3f}".format(PI)) print("The 4 digit Archimedes' constant is equal to {:.4f}".format(PI)) print("The 5 digit Archimedes' constant is equal to {:.5f}".format(PI)) print('----------------------------------------------------') '''Results ------------------------------------------------- My name is Maurizio ------------------------------------------------- My name is Maurizio and my surname is Petrelli ------------------------------------------------- ---------------------------------------------------- The 2 digit Archimedes' constant is equal to 3.14 The 3 digit Archimedes' constant is equal to 3.142 The 4 digit Archimedes' constant is equal to 3.1416 The 5 digit Archimedes' constant is equal to 3.14159 ---------------------------------------------------- '''
name = 'Maurizio' surname = 'Petrelli' print('-------------------------------------------------') print('My name is {}'.format(name)) print('-------------------------------------------------') print('My name is {} and my surname is {}'.format(name, surname)) print('-------------------------------------------------') pi = 3.141592653589793 print('----------------------------------------------------') print("The 2 digit Archimedes' constant is equal to {:.2f}".format(PI)) print("The 3 digit Archimedes' constant is equal to {:.3f}".format(PI)) print("The 4 digit Archimedes' constant is equal to {:.4f}".format(PI)) print("The 5 digit Archimedes' constant is equal to {:.5f}".format(PI)) print('----------------------------------------------------') "Results\n-------------------------------------------------\nMy name is Maurizio\n-------------------------------------------------\nMy name is Maurizio and my surname is Petrelli\n-------------------------------------------------\n----------------------------------------------------\nThe 2 digit Archimedes' constant is equal to 3.14\nThe 3 digit Archimedes' constant is equal to 3.142\nThe 4 digit Archimedes' constant is equal to 3.1416\nThe 5 digit Archimedes' constant is equal to 3.14159\n----------------------------------------------------\n"
''' Created on Dec 18, 2016 @author: rch '''
""" Created on Dec 18, 2016 @author: rch """
#!/usr/bin/env python # coding=utf-8 class BaseException(Exception): def __init__(self, code, msg): self.code = code self.msg = msg def __str__(self): return '<%s %s>' % (self.__class__.__name__, self.code)
class Baseexception(Exception): def __init__(self, code, msg): self.code = code self.msg = msg def __str__(self): return '<%s %s>' % (self.__class__.__name__, self.code)
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'test_cdecl', 'type': 'loadable_module', 'msvs_settings': { 'VCCLCompilerTool': { 'CallingConvention': 0, }, }, 'sources': [ 'calling-convention.cc', 'calling-convention-cdecl.def', ], }, { 'target_name': 'test_fastcall', 'type': 'loadable_module', 'msvs_settings': { 'VCCLCompilerTool': { 'CallingConvention': 1, }, }, 'sources': [ 'calling-convention.cc', 'calling-convention-fastcall.def', ], }, { 'target_name': 'test_stdcall', 'type': 'loadable_module', 'msvs_settings': { 'VCCLCompilerTool': { 'CallingConvention': 2, }, }, 'sources': [ 'calling-convention.cc', 'calling-convention-stdcall.def', ], }, ], 'conditions': [ ['MSVS_VERSION[0:4]>="2013"', { 'targets': [ { 'target_name': 'test_vectorcall', 'type': 'loadable_module', 'msvs_settings': { 'VCCLCompilerTool': { 'CallingConvention': 3, }, }, 'sources': [ 'calling-convention.cc', 'calling-convention-vectorcall.def', ], }, ], }], ], }
{'targets': [{'target_name': 'test_cdecl', 'type': 'loadable_module', 'msvs_settings': {'VCCLCompilerTool': {'CallingConvention': 0}}, 'sources': ['calling-convention.cc', 'calling-convention-cdecl.def']}, {'target_name': 'test_fastcall', 'type': 'loadable_module', 'msvs_settings': {'VCCLCompilerTool': {'CallingConvention': 1}}, 'sources': ['calling-convention.cc', 'calling-convention-fastcall.def']}, {'target_name': 'test_stdcall', 'type': 'loadable_module', 'msvs_settings': {'VCCLCompilerTool': {'CallingConvention': 2}}, 'sources': ['calling-convention.cc', 'calling-convention-stdcall.def']}], 'conditions': [['MSVS_VERSION[0:4]>="2013"', {'targets': [{'target_name': 'test_vectorcall', 'type': 'loadable_module', 'msvs_settings': {'VCCLCompilerTool': {'CallingConvention': 3}}, 'sources': ['calling-convention.cc', 'calling-convention-vectorcall.def']}]}]]}
# # PySNMP MIB module RBT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RBT-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:18:46 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter32, TimeTicks, ModuleIdentity, Integer32, MibIdentifier, iso, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, ObjectIdentity, Unsigned32, Bits, NotificationType, enterprises, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "TimeTicks", "ModuleIdentity", "Integer32", "MibIdentifier", "iso", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "ObjectIdentity", "Unsigned32", "Bits", "NotificationType", "enterprises", "Counter64") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") rbt = ModuleIdentity((1, 3, 6, 1, 4, 1, 17163)) rbt.setRevisions(('2009-09-23 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: rbt.setRevisionsDescriptions(('Updated contact information',)) if mibBuilder.loadTexts: rbt.setLastUpdated('200909230000Z') if mibBuilder.loadTexts: rbt.setOrganization('Riverbed Technology, Inc.') if mibBuilder.loadTexts: rbt.setContactInfo(' Riverbed Technical Support [email protected]') if mibBuilder.loadTexts: rbt.setDescription('Riverbed Technology MIB') products = MibIdentifier((1, 3, 6, 1, 4, 1, 17163, 1)) mibBuilder.exportSymbols("RBT-MIB", products=products, PYSNMP_MODULE_ID=rbt, rbt=rbt)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, single_value_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (counter32, time_ticks, module_identity, integer32, mib_identifier, iso, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address, object_identity, unsigned32, bits, notification_type, enterprises, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'TimeTicks', 'ModuleIdentity', 'Integer32', 'MibIdentifier', 'iso', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress', 'ObjectIdentity', 'Unsigned32', 'Bits', 'NotificationType', 'enterprises', 'Counter64') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') rbt = module_identity((1, 3, 6, 1, 4, 1, 17163)) rbt.setRevisions(('2009-09-23 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: rbt.setRevisionsDescriptions(('Updated contact information',)) if mibBuilder.loadTexts: rbt.setLastUpdated('200909230000Z') if mibBuilder.loadTexts: rbt.setOrganization('Riverbed Technology, Inc.') if mibBuilder.loadTexts: rbt.setContactInfo(' Riverbed Technical Support [email protected]') if mibBuilder.loadTexts: rbt.setDescription('Riverbed Technology MIB') products = mib_identifier((1, 3, 6, 1, 4, 1, 17163, 1)) mibBuilder.exportSymbols('RBT-MIB', products=products, PYSNMP_MODULE_ID=rbt, rbt=rbt)
def solution(num): if num < 0: raise ValueError if num == 1: return 1 k = None for k in range(num // 2 + 1): if k ** 2 == num: return k elif k ** 2 > num: return k - 1 return k def best_solution(num): if num < 0: raise ValueError if num == 1: return 1 low = 0 high = num // 2 + 1 while low + 1 < high: mid = low + (high - low) // 2 square = mid ** 2 if square == num: return mid elif square < num: low = mid else: high = mid return low if __name__ == '__main__': a = solution(99898) print(a) a = best_solution(19) print(a)
def solution(num): if num < 0: raise ValueError if num == 1: return 1 k = None for k in range(num // 2 + 1): if k ** 2 == num: return k elif k ** 2 > num: return k - 1 return k def best_solution(num): if num < 0: raise ValueError if num == 1: return 1 low = 0 high = num // 2 + 1 while low + 1 < high: mid = low + (high - low) // 2 square = mid ** 2 if square == num: return mid elif square < num: low = mid else: high = mid return low if __name__ == '__main__': a = solution(99898) print(a) a = best_solution(19) print(a)
# Homework #6. Loops print("--- Task #1. 10 monkeys") # Task #1. Write a program that output the following string: "1 monkey 2 monkeys ... 10 monkeys". for x in range(1, 11): if x == 1: monkey = f"{x} monkey " else: monkey = monkey + f"{x} monkeys " print(monkey.strip()) print("\n--- Task #2. Countdown timer") # Task #2. Write a program that output the string that tracks the number of seconds that remain for the roket launching: "10 seconds...9 seconds...8 seconds...7 seconds...6 seconds...5 seconds...4 seconds...3 seconds...2 seconds...1 second" for x in range(10, 0, -1): print(str(x) + " seconds...") print() print("\n--- Task #3") # Task #3. Input two numbers k and n. Calculate you own power (k**n) without using power (**) operator but by using repeated multiplication (number is being multiplied by itself). # Example: 3**4 = 81 is equivalent to 3*3*3*3 = 81. n = int(input("Please enter any number: ")) k = int(input("Please enter any number for a power: ")) x = 1 s = n for x in range(1, k): n = s * n x += 1 print("k ** n =", n) m = (str(s) + " * ") * (k-1) print(f"{m}{s} = {n}") print("\n--- Task #4") # Task #4. The first day of training, the athlete ran 5 km. Each next day, he ran 5% more than the day before. How many kilometers will the athlete run on the 10th day? day = 1 distance = 5 print("The first day distance = ", distance, "km") distance2 = distance * (1.05**9) # for checking print(f"The 10th day distance should be {distance} * (1.05 ** 9) =", round(distance2,2), "km") print() while day < 10: distance += distance * 5/100 print(distance) day += 1 print("On the 10th day, the athlete run ", round(distance,2), "km") print("\n--- Task #5. ") # Task #5. The student did not know a single English word at the beginning of the training. On the first day of class, he learned 5 English words. On each next day, he learned 2 more words than the day before. In how many days will the student know at least n English words? n = int(input("Please enter number of words: ")) day = 0 # d2 words = 5 print(f"The student knew {day} words before training session.") print(f"The student learned {words} on the first day.") total = 5 while words <= n: words = words + 2 day = day + 1 # total = total + words #? print(f"The student will learn {n} words at the the {day} day, but he may learn {words} words by the end of the {day} day of the traning.") print("Verify with addition: 5" + " + 2" * day + " = " + str(words) + " words") print(total) #? print("\n--- Task #6. ") # Task #6. Prompt to a user to input the nunber of steps. Get the string that contains stairs made of sharp sign (#). # # # # # # # # # # num = int(input("How many steps in the stairs: ")) stairs = '' x = 1 while x <= num: print(" " * x + "#") x += 1 print(stairs) print("--- Task #7. ") # 7. Output stars having the form of a pyramid. With the command input, get the number of levels. Use function for center align the string. # * # *** # ***** # ******* levels = int(input("Please enter any number of levels for pyramid: ")) star = '*' x = 1 # ver 1 c_point = levels * 2 # -> extra space before pyramid if levels*2+1 for x in range(levels): star = "*" + x * 2 * "*" x += 1 print(star.center(c_point)) # ver 2 - in class # levels = int(input("Please enter any number of levels for pyramid: ")) c_point = levels * 2 - 1 for x in range(1,levels + 1): stars = x * 2 - 1 print(("*" * stars).center(c_point))
print('--- Task #1. 10 monkeys') for x in range(1, 11): if x == 1: monkey = f'{x} monkey ' else: monkey = monkey + f'{x} monkeys ' print(monkey.strip()) print('\n--- Task #2. Countdown timer') for x in range(10, 0, -1): print(str(x) + ' seconds...') print() print('\n--- Task #3') n = int(input('Please enter any number: ')) k = int(input('Please enter any number for a power: ')) x = 1 s = n for x in range(1, k): n = s * n x += 1 print('k ** n =', n) m = (str(s) + ' * ') * (k - 1) print(f'{m}{s} = {n}') print('\n--- Task #4') day = 1 distance = 5 print('The first day distance = ', distance, 'km') distance2 = distance * 1.05 ** 9 print(f'The 10th day distance should be {distance} * (1.05 ** 9) =', round(distance2, 2), 'km') print() while day < 10: distance += distance * 5 / 100 print(distance) day += 1 print('On the 10th day, the athlete run ', round(distance, 2), 'km') print('\n--- Task #5. ') n = int(input('Please enter number of words: ')) day = 0 words = 5 print(f'The student knew {day} words before training session.') print(f'The student learned {words} on the first day.') total = 5 while words <= n: words = words + 2 day = day + 1 print(f'The student will learn {n} words at the the {day} day, but he may learn {words} words by the end of the {day} day of the traning.') print('Verify with addition: 5' + ' + 2' * day + ' = ' + str(words) + ' words') print(total) print('\n--- Task #6. ') num = int(input('How many steps in the stairs: ')) stairs = '' x = 1 while x <= num: print(' ' * x + '#') x += 1 print(stairs) print('--- Task #7. ') levels = int(input('Please enter any number of levels for pyramid: ')) star = '*' x = 1 c_point = levels * 2 for x in range(levels): star = '*' + x * 2 * '*' x += 1 print(star.center(c_point)) c_point = levels * 2 - 1 for x in range(1, levels + 1): stars = x * 2 - 1 print(('*' * stars).center(c_point))
# # PySNMP MIB module TRANGO-APEX-TRAP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TRANGO-APEX-TRAP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:19:34 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, NotificationType, IpAddress, Gauge32, Unsigned32, TimeTicks, iso, ModuleIdentity, Bits, Counter32, Integer32, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "NotificationType", "IpAddress", "Gauge32", "Unsigned32", "TimeTicks", "iso", "ModuleIdentity", "Bits", "Counter32", "Integer32", "ObjectIdentity") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") MibScalar, MibTable, MibTableRow, MibTableColumn, apex, NotificationType, Unsigned32, ModuleIdentity, ObjectIdentity = mibBuilder.importSymbols("TRANGO-APEX-MIB", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "apex", "NotificationType", "Unsigned32", "ModuleIdentity", "ObjectIdentity") class DisplayString(OctetString): pass trangotrap = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6)) trapReboot = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 1)) if mibBuilder.loadTexts: trapReboot.setStatus('current') trapStartUp = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 2)) if mibBuilder.loadTexts: trapStartUp.setStatus('current') traplock = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3)) trapModemLock = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 1)) if mibBuilder.loadTexts: trapModemLock.setStatus('current') trapTimingLock = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 2)) if mibBuilder.loadTexts: trapTimingLock.setStatus('current') trapInnerCodeLock = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 3)) if mibBuilder.loadTexts: trapInnerCodeLock.setStatus('current') trapEqualizerLock = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 4)) if mibBuilder.loadTexts: trapEqualizerLock.setStatus('current') trapFrameSyncLock = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 5)) if mibBuilder.loadTexts: trapFrameSyncLock.setStatus('current') trapthreshold = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4)) trapmse = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 1)) trapMSEMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 1, 1)) if mibBuilder.loadTexts: trapMSEMinThreshold.setStatus('current') trapMSEMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 1, 2)) if mibBuilder.loadTexts: trapMSEMaxThreshold.setStatus('current') trapber = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 2)) trapBERMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 2, 1)) if mibBuilder.loadTexts: trapBERMinThreshold.setStatus('current') trapBERMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 2, 2)) if mibBuilder.loadTexts: trapBERMaxThreshold.setStatus('current') trapfer = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 3)) trapFERMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 3, 1)) if mibBuilder.loadTexts: trapFERMinThreshold.setStatus('current') trapFERMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 3, 2)) if mibBuilder.loadTexts: trapFERMaxThreshold.setStatus('current') traprssi = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 4)) trapRSSIMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 4, 1)) if mibBuilder.loadTexts: trapRSSIMinThreshold.setStatus('current') trapRSSIMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 4, 2)) if mibBuilder.loadTexts: trapRSSIMaxThreshold.setStatus('current') trapidutemp = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 5)) trapIDUTempMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 5, 1)) if mibBuilder.loadTexts: trapIDUTempMinThreshold.setStatus('current') trapIDUTempMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 5, 2)) if mibBuilder.loadTexts: trapIDUTempMaxThreshold.setStatus('current') trapodutemp = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 6)) trapODUTempMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 6, 1)) if mibBuilder.loadTexts: trapODUTempMinThreshold.setStatus('current') trapODUTempMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 6, 2)) if mibBuilder.loadTexts: trapODUTempMaxThreshold.setStatus('current') trapinport = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 7)) trapInPortUtilMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 7, 1)) if mibBuilder.loadTexts: trapInPortUtilMinThreshold.setStatus('current') trapInPortUtilMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 7, 2)) if mibBuilder.loadTexts: trapInPortUtilMaxThreshold.setStatus('current') trapoutport = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 8)) trapOutPortUtilMinThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 8, 1)) if mibBuilder.loadTexts: trapOutPortUtilMinThreshold.setStatus('current') trapOutPortUtilMaxThreshold = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 8, 2)) if mibBuilder.loadTexts: trapOutPortUtilMaxThreshold.setStatus('current') trapstandby = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5)) trapStandbyLinkDown = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5, 1)) if mibBuilder.loadTexts: trapStandbyLinkDown.setStatus('current') trapStandbyLinkUp = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5, 2)) if mibBuilder.loadTexts: trapStandbyLinkUp.setStatus('current') trapSwitchover = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5, 3)) if mibBuilder.loadTexts: trapSwitchover.setStatus('current') trapeth = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6)) trapethstatus = MibIdentifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1)) trapEth1StatusUpdate = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 1)) if mibBuilder.loadTexts: trapEth1StatusUpdate.setStatus('current') trapEth2StatusUpdate = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 2)) if mibBuilder.loadTexts: trapEth2StatusUpdate.setStatus('current') trapEth3StatusUpdate = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 3)) if mibBuilder.loadTexts: trapEth3StatusUpdate.setStatus('current') trapEth4StatusUpdate = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 4)) if mibBuilder.loadTexts: trapEth4StatusUpdate.setStatus('current') trapDownShift = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 8)) if mibBuilder.loadTexts: trapDownShift.setStatus('current') trapRapidPortShutdown = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 9)) if mibBuilder.loadTexts: trapRapidPortShutdown.setStatus('current') trapRPSPortUp = NotificationType((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 10)) if mibBuilder.loadTexts: trapRPSPortUp.setStatus('current') mibBuilder.exportSymbols("TRANGO-APEX-TRAP-MIB", trapber=trapber, trapEth3StatusUpdate=trapEth3StatusUpdate, DisplayString=DisplayString, trapFERMinThreshold=trapFERMinThreshold, trapStandbyLinkDown=trapStandbyLinkDown, trapInPortUtilMinThreshold=trapInPortUtilMinThreshold, trapMSEMinThreshold=trapMSEMinThreshold, trapRSSIMaxThreshold=trapRSSIMaxThreshold, traprssi=traprssi, trapStandbyLinkUp=trapStandbyLinkUp, trapIDUTempMinThreshold=trapIDUTempMinThreshold, trapRapidPortShutdown=trapRapidPortShutdown, trangotrap=trangotrap, trapStartUp=trapStartUp, trapMSEMaxThreshold=trapMSEMaxThreshold, trapSwitchover=trapSwitchover, traplock=traplock, trapethstatus=trapethstatus, trapEth2StatusUpdate=trapEth2StatusUpdate, trapodutemp=trapodutemp, trapinport=trapinport, trapReboot=trapReboot, trapthreshold=trapthreshold, trapmse=trapmse, trapEth4StatusUpdate=trapEth4StatusUpdate, trapIDUTempMaxThreshold=trapIDUTempMaxThreshold, trapFrameSyncLock=trapFrameSyncLock, trapOutPortUtilMinThreshold=trapOutPortUtilMinThreshold, trapInnerCodeLock=trapInnerCodeLock, trapfer=trapfer, trapTimingLock=trapTimingLock, trapFERMaxThreshold=trapFERMaxThreshold, trapstandby=trapstandby, trapModemLock=trapModemLock, trapInPortUtilMaxThreshold=trapInPortUtilMaxThreshold, trapOutPortUtilMaxThreshold=trapOutPortUtilMaxThreshold, trapoutport=trapoutport, trapODUTempMinThreshold=trapODUTempMinThreshold, trapDownShift=trapDownShift, trapBERMinThreshold=trapBERMinThreshold, trapRPSPortUp=trapRPSPortUp, trapEqualizerLock=trapEqualizerLock, trapeth=trapeth, trapRSSIMinThreshold=trapRSSIMinThreshold, trapEth1StatusUpdate=trapEth1StatusUpdate, trapidutemp=trapidutemp, trapODUTempMaxThreshold=trapODUTempMaxThreshold, trapBERMaxThreshold=trapBERMaxThreshold)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, single_value_constraint, value_range_constraint, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (counter64, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, notification_type, ip_address, gauge32, unsigned32, time_ticks, iso, module_identity, bits, counter32, integer32, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'NotificationType', 'IpAddress', 'Gauge32', 'Unsigned32', 'TimeTicks', 'iso', 'ModuleIdentity', 'Bits', 'Counter32', 'Integer32', 'ObjectIdentity') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') (mib_scalar, mib_table, mib_table_row, mib_table_column, apex, notification_type, unsigned32, module_identity, object_identity) = mibBuilder.importSymbols('TRANGO-APEX-MIB', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'apex', 'NotificationType', 'Unsigned32', 'ModuleIdentity', 'ObjectIdentity') class Displaystring(OctetString): pass trangotrap = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6)) trap_reboot = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 1)) if mibBuilder.loadTexts: trapReboot.setStatus('current') trap_start_up = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 2)) if mibBuilder.loadTexts: trapStartUp.setStatus('current') traplock = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3)) trap_modem_lock = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 1)) if mibBuilder.loadTexts: trapModemLock.setStatus('current') trap_timing_lock = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 2)) if mibBuilder.loadTexts: trapTimingLock.setStatus('current') trap_inner_code_lock = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 3)) if mibBuilder.loadTexts: trapInnerCodeLock.setStatus('current') trap_equalizer_lock = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 4)) if mibBuilder.loadTexts: trapEqualizerLock.setStatus('current') trap_frame_sync_lock = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 3, 5)) if mibBuilder.loadTexts: trapFrameSyncLock.setStatus('current') trapthreshold = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4)) trapmse = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 1)) trap_mse_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 1, 1)) if mibBuilder.loadTexts: trapMSEMinThreshold.setStatus('current') trap_mse_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 1, 2)) if mibBuilder.loadTexts: trapMSEMaxThreshold.setStatus('current') trapber = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 2)) trap_ber_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 2, 1)) if mibBuilder.loadTexts: trapBERMinThreshold.setStatus('current') trap_ber_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 2, 2)) if mibBuilder.loadTexts: trapBERMaxThreshold.setStatus('current') trapfer = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 3)) trap_fer_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 3, 1)) if mibBuilder.loadTexts: trapFERMinThreshold.setStatus('current') trap_fer_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 3, 2)) if mibBuilder.loadTexts: trapFERMaxThreshold.setStatus('current') traprssi = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 4)) trap_rssi_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 4, 1)) if mibBuilder.loadTexts: trapRSSIMinThreshold.setStatus('current') trap_rssi_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 4, 2)) if mibBuilder.loadTexts: trapRSSIMaxThreshold.setStatus('current') trapidutemp = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 5)) trap_idu_temp_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 5, 1)) if mibBuilder.loadTexts: trapIDUTempMinThreshold.setStatus('current') trap_idu_temp_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 5, 2)) if mibBuilder.loadTexts: trapIDUTempMaxThreshold.setStatus('current') trapodutemp = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 6)) trap_odu_temp_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 6, 1)) if mibBuilder.loadTexts: trapODUTempMinThreshold.setStatus('current') trap_odu_temp_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 6, 2)) if mibBuilder.loadTexts: trapODUTempMaxThreshold.setStatus('current') trapinport = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 7)) trap_in_port_util_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 7, 1)) if mibBuilder.loadTexts: trapInPortUtilMinThreshold.setStatus('current') trap_in_port_util_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 7, 2)) if mibBuilder.loadTexts: trapInPortUtilMaxThreshold.setStatus('current') trapoutport = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 8)) trap_out_port_util_min_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 8, 1)) if mibBuilder.loadTexts: trapOutPortUtilMinThreshold.setStatus('current') trap_out_port_util_max_threshold = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 4, 8, 2)) if mibBuilder.loadTexts: trapOutPortUtilMaxThreshold.setStatus('current') trapstandby = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5)) trap_standby_link_down = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5, 1)) if mibBuilder.loadTexts: trapStandbyLinkDown.setStatus('current') trap_standby_link_up = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5, 2)) if mibBuilder.loadTexts: trapStandbyLinkUp.setStatus('current') trap_switchover = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 5, 3)) if mibBuilder.loadTexts: trapSwitchover.setStatus('current') trapeth = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6)) trapethstatus = mib_identifier((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1)) trap_eth1_status_update = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 1)) if mibBuilder.loadTexts: trapEth1StatusUpdate.setStatus('current') trap_eth2_status_update = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 2)) if mibBuilder.loadTexts: trapEth2StatusUpdate.setStatus('current') trap_eth3_status_update = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 3)) if mibBuilder.loadTexts: trapEth3StatusUpdate.setStatus('current') trap_eth4_status_update = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 6, 1, 4)) if mibBuilder.loadTexts: trapEth4StatusUpdate.setStatus('current') trap_down_shift = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 8)) if mibBuilder.loadTexts: trapDownShift.setStatus('current') trap_rapid_port_shutdown = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 9)) if mibBuilder.loadTexts: trapRapidPortShutdown.setStatus('current') trap_rps_port_up = notification_type((1, 3, 6, 1, 4, 1, 5454, 1, 60, 6, 10)) if mibBuilder.loadTexts: trapRPSPortUp.setStatus('current') mibBuilder.exportSymbols('TRANGO-APEX-TRAP-MIB', trapber=trapber, trapEth3StatusUpdate=trapEth3StatusUpdate, DisplayString=DisplayString, trapFERMinThreshold=trapFERMinThreshold, trapStandbyLinkDown=trapStandbyLinkDown, trapInPortUtilMinThreshold=trapInPortUtilMinThreshold, trapMSEMinThreshold=trapMSEMinThreshold, trapRSSIMaxThreshold=trapRSSIMaxThreshold, traprssi=traprssi, trapStandbyLinkUp=trapStandbyLinkUp, trapIDUTempMinThreshold=trapIDUTempMinThreshold, trapRapidPortShutdown=trapRapidPortShutdown, trangotrap=trangotrap, trapStartUp=trapStartUp, trapMSEMaxThreshold=trapMSEMaxThreshold, trapSwitchover=trapSwitchover, traplock=traplock, trapethstatus=trapethstatus, trapEth2StatusUpdate=trapEth2StatusUpdate, trapodutemp=trapodutemp, trapinport=trapinport, trapReboot=trapReboot, trapthreshold=trapthreshold, trapmse=trapmse, trapEth4StatusUpdate=trapEth4StatusUpdate, trapIDUTempMaxThreshold=trapIDUTempMaxThreshold, trapFrameSyncLock=trapFrameSyncLock, trapOutPortUtilMinThreshold=trapOutPortUtilMinThreshold, trapInnerCodeLock=trapInnerCodeLock, trapfer=trapfer, trapTimingLock=trapTimingLock, trapFERMaxThreshold=trapFERMaxThreshold, trapstandby=trapstandby, trapModemLock=trapModemLock, trapInPortUtilMaxThreshold=trapInPortUtilMaxThreshold, trapOutPortUtilMaxThreshold=trapOutPortUtilMaxThreshold, trapoutport=trapoutport, trapODUTempMinThreshold=trapODUTempMinThreshold, trapDownShift=trapDownShift, trapBERMinThreshold=trapBERMinThreshold, trapRPSPortUp=trapRPSPortUp, trapEqualizerLock=trapEqualizerLock, trapeth=trapeth, trapRSSIMinThreshold=trapRSSIMinThreshold, trapEth1StatusUpdate=trapEth1StatusUpdate, trapidutemp=trapidutemp, trapODUTempMaxThreshold=trapODUTempMaxThreshold, trapBERMaxThreshold=trapBERMaxThreshold)
# -*- coding: utf-8 -*- i = 1 for x in range(60, -1, -5): print('I={} J={}'.format(i, x)) i += 3
i = 1 for x in range(60, -1, -5): print('I={} J={}'.format(i, x)) i += 3
def process(N): temp = str(N) temp = temp.replace('4','2') res1 = int(temp) res2 = N-res1 return res1,res2 T = int(input()) for t in range(T): N = int(input()) res1,res2 = process(N) print('Case #{}: {} {}'.format(t+1,res1,res2))
def process(N): temp = str(N) temp = temp.replace('4', '2') res1 = int(temp) res2 = N - res1 return (res1, res2) t = int(input()) for t in range(T): n = int(input()) (res1, res2) = process(N) print('Case #{}: {} {}'.format(t + 1, res1, res2))
class T: WORK_REQUEST = 1 WORK_REPLY = 2 REDUCE = 3 BARRIER = 4 TOKEN = 7 class Tally: total_dirs = 0 total_files = 0 total_filesize = 0 total_stat_filesize = 0 total_symlinks = 0 total_skipped = 0 total_sparse = 0 max_files = 0 total_nlinks = 0 total_nlinked_files = 0 total_0byte_files = 0 devfile_cnt = 0 devfile_sz = 0 spcnt = 0 # stripe cnt account per process # ZFS total_blocks = 0 class G: ZERO = 0 ABORT = -1 WHITE = 50 BLACK = 51 NONE = -99 TERMINATE = -100 MSG = 99 MSG_VALID = True MSG_INVALID = False fmt1 = '%(asctime)s - %(levelname)s - %(rank)s:%(filename)s:%(lineno)d - %(message)s' fmt2 = '%(asctime)s - %(rank)s:%(filename)s:%(lineno)d - %(message)s' bare_fmt = '%(name)s - %(levelname)s - %(message)s' mpi_fmt = '%(name)s - %(levelname)s - %(rank)s - %(message)s' bare_fmt2 = '%(message)s' str = {WHITE: "white", BLACK: "black", NONE: "not set", TERMINATE: "terminate", ABORT: "abort", MSG: "message"} KEY = "key" VAL = "val" logger = None logfile = None loglevel = "warn" use_store = False fix_opt = False preserve = False DB_BUFSIZE = 10000 memitem_threshold = 100000 tempdir = None total_chunks = 0 rid = None chk_file = None chk_file_db = None totalsize = 0 src = None dest = None args_src = None args_dest = None resume = None reduce_interval = 30 reduce_enabled = False verbosity = 0 am_root = False copytype = 'dir2dir' # Lustre file system fs_lustre = None lfs_bin = None stripe_threshold = None b0 = 0 b4k = 4 * 1024 b8k = 8 * 1024 b16k = 16 * 1024 b32k = 32 * 1024 b64k = 64 * 1024 b128k = 128 * 1024 b256k = 256 * 1024 b512k = 512 * 1024 b1m = 1024 * 1024 b2m = 2 * b1m b4m = 4 * b1m b8m = 8 * b1m b16m = 16 * b1m b32m = 32 * b1m b64m = 64 * b1m b128m = 128 * b1m b256m = 256 * b1m b512m = 512 * b1m b1g = 1024 * b1m b4g = 4 * b1g b16g = 16 * b1g b64g = 64 * b1g b128g = 128 * b1g b256g = 256 * b1g b512g = 512 * b1g b1tb = 1024 * b1g b4tb = 4 * b1tb FSZ_BOUND = 64 * b1tb # 25 bins bins = [b0, b4k, b8k, b16k, b32k, b64k, b128k, b256k, b512k, b1m, b2m, b4m, b16m, b32m, b64m, b128m, b256m, b512m, b1g, b4g, b64g, b128g, b256g, b512g, b1tb, b4tb] # 17 bins, the last bin is special # This is error-prone, to be refactored. # bins_fmt = ["B1_000k_004k", "B1_004k_008k", "B1_008k_016k", "B1_016k_032k", "B1_032k_064k", "B1_064k_256k", # "B1_256k_512k", "B1_512k_001m", # "B2_001m_004m", "B2_m004_016m", "B2_016m_512m", "B2_512m_001g", # "B3_001g_100g", "B3_100g_256g", "B3_256g_512g", # "B4_512g_001t", # "B5_001t_up"] # GPFS gpfs_block_size = ("256k", "512k", "b1m", "b4m", "b8m", "b16m", "b32m") gpfs_block_cnt = [0, 0, 0, 0, 0, 0, 0] gpfs_subs = (b256k/32, b512k/32, b1m/32, b4m/32, b8m/32, b16m/32, b32m/32) dev_suffixes = [".C", ".CC", ".CU", ".H", ".CPP", ".HPP", ".CXX", ".F", ".I", ".II", ".F90", ".F95", ".F03", ".FOR", ".O", ".A", ".SO", ".S", ".IN", ".M4", ".CACHE", ".PY", ".PYC"]
class T: work_request = 1 work_reply = 2 reduce = 3 barrier = 4 token = 7 class Tally: total_dirs = 0 total_files = 0 total_filesize = 0 total_stat_filesize = 0 total_symlinks = 0 total_skipped = 0 total_sparse = 0 max_files = 0 total_nlinks = 0 total_nlinked_files = 0 total_0byte_files = 0 devfile_cnt = 0 devfile_sz = 0 spcnt = 0 total_blocks = 0 class G: zero = 0 abort = -1 white = 50 black = 51 none = -99 terminate = -100 msg = 99 msg_valid = True msg_invalid = False fmt1 = '%(asctime)s - %(levelname)s - %(rank)s:%(filename)s:%(lineno)d - %(message)s' fmt2 = '%(asctime)s - %(rank)s:%(filename)s:%(lineno)d - %(message)s' bare_fmt = '%(name)s - %(levelname)s - %(message)s' mpi_fmt = '%(name)s - %(levelname)s - %(rank)s - %(message)s' bare_fmt2 = '%(message)s' str = {WHITE: 'white', BLACK: 'black', NONE: 'not set', TERMINATE: 'terminate', ABORT: 'abort', MSG: 'message'} key = 'key' val = 'val' logger = None logfile = None loglevel = 'warn' use_store = False fix_opt = False preserve = False db_bufsize = 10000 memitem_threshold = 100000 tempdir = None total_chunks = 0 rid = None chk_file = None chk_file_db = None totalsize = 0 src = None dest = None args_src = None args_dest = None resume = None reduce_interval = 30 reduce_enabled = False verbosity = 0 am_root = False copytype = 'dir2dir' fs_lustre = None lfs_bin = None stripe_threshold = None b0 = 0 b4k = 4 * 1024 b8k = 8 * 1024 b16k = 16 * 1024 b32k = 32 * 1024 b64k = 64 * 1024 b128k = 128 * 1024 b256k = 256 * 1024 b512k = 512 * 1024 b1m = 1024 * 1024 b2m = 2 * b1m b4m = 4 * b1m b8m = 8 * b1m b16m = 16 * b1m b32m = 32 * b1m b64m = 64 * b1m b128m = 128 * b1m b256m = 256 * b1m b512m = 512 * b1m b1g = 1024 * b1m b4g = 4 * b1g b16g = 16 * b1g b64g = 64 * b1g b128g = 128 * b1g b256g = 256 * b1g b512g = 512 * b1g b1tb = 1024 * b1g b4tb = 4 * b1tb fsz_bound = 64 * b1tb bins = [b0, b4k, b8k, b16k, b32k, b64k, b128k, b256k, b512k, b1m, b2m, b4m, b16m, b32m, b64m, b128m, b256m, b512m, b1g, b4g, b64g, b128g, b256g, b512g, b1tb, b4tb] gpfs_block_size = ('256k', '512k', 'b1m', 'b4m', 'b8m', 'b16m', 'b32m') gpfs_block_cnt = [0, 0, 0, 0, 0, 0, 0] gpfs_subs = (b256k / 32, b512k / 32, b1m / 32, b4m / 32, b8m / 32, b16m / 32, b32m / 32) dev_suffixes = ['.C', '.CC', '.CU', '.H', '.CPP', '.HPP', '.CXX', '.F', '.I', '.II', '.F90', '.F95', '.F03', '.FOR', '.O', '.A', '.SO', '.S', '.IN', '.M4', '.CACHE', '.PY', '.PYC']
# Types Symbol = str # A Lisp Symbol is implemented as a Python str List = list # A Lisp List is implemented as a Python list Number = (int, float) # A Lisp Number is implemented as a Python int or float # Exp = Union[Symbol, Exp] def atom(token): "Numbers become numbers; every other token is a symbol." try: return int(token) except ValueError: try: return float(token) except ValueError: return Symbol(token)
symbol = str list = list number = (int, float) def atom(token): """Numbers become numbers; every other token is a symbol.""" try: return int(token) except ValueError: try: return float(token) except ValueError: return symbol(token)
def GetInfoMsg(): infoMsg = "This python snippet is triggered by the 'cmd' property.\r\n" infoMsg += "Any command line may be triggered with the 'cmd' property.\r\n" return infoMsg if __name__ == "__main__": print(GetInfoMsg())
def get_info_msg(): info_msg = "This python snippet is triggered by the 'cmd' property.\r\n" info_msg += "Any command line may be triggered with the 'cmd' property.\r\n" return infoMsg if __name__ == '__main__': print(get_info_msg())
def shift_rect(rect, direction, distance=48): if direction == 'left': rect.left -= distance elif direction == 'right': rect.left += distance elif direction == 'up': rect.top -= distance elif direction == 'down': rect.top += distance return rect
def shift_rect(rect, direction, distance=48): if direction == 'left': rect.left -= distance elif direction == 'right': rect.left += distance elif direction == 'up': rect.top -= distance elif direction == 'down': rect.top += distance return rect
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def getLonelyNodes(self, root: TreeNode) -> List[int]: lonely_nodes = [] def dfs(node, is_lonely): if node is None: return if is_lonely: lonely_nodes.append(node.val) if (node.left is None) ^ (node.right is None): is_lonely = True else: is_lonely = False dfs(node.left, is_lonely) dfs(node.right, is_lonely) dfs(root, False) return lonely_nodes
class Solution: def get_lonely_nodes(self, root: TreeNode) -> List[int]: lonely_nodes = [] def dfs(node, is_lonely): if node is None: return if is_lonely: lonely_nodes.append(node.val) if (node.left is None) ^ (node.right is None): is_lonely = True else: is_lonely = False dfs(node.left, is_lonely) dfs(node.right, is_lonely) dfs(root, False) return lonely_nodes
# -*- coding: utf-8 -*- __title__ = "flloat" __description__ = "A Python implementation of the FLLOAT library." __url__ = "https://github.com/marcofavorito/flloat.git" __version__ = "1.0.0a0" __author__ = "Marco Favorito" __author_email__ = "[email protected]" __license__ = "MIT license" __copyright__ = "2019 Marco Favorito"
__title__ = 'flloat' __description__ = 'A Python implementation of the FLLOAT library.' __url__ = 'https://github.com/marcofavorito/flloat.git' __version__ = '1.0.0a0' __author__ = 'Marco Favorito' __author_email__ = '[email protected]' __license__ = 'MIT license' __copyright__ = '2019 Marco Favorito'
class Solution: def rotatedDigits(self, N: 'int') -> 'int': result = 0 for nr in range(1, N + 1): ok = False for digit in str(nr): if digit in '347': break if digit in '6952': ok = True else: result += int(ok) return result
class Solution: def rotated_digits(self, N: 'int') -> 'int': result = 0 for nr in range(1, N + 1): ok = False for digit in str(nr): if digit in '347': break if digit in '6952': ok = True else: result += int(ok) return result